diff --git a/README.md b/README.md index 4da4a3f42..16f6309f6 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,8 @@ # What's ZenStack +> Read full documentation at 👉🏻 https://zenstack.dev/v3. + ZenStack is a TypeScript database toolkit for developing full-stack or backend Node.js/Bun applications. It provides a unified data modeling and access solution with the following features: - A modern schema-first ORM that's compatible with [Prisma](https://github.com/prisma/prisma)'s schema and API diff --git a/TODO.md b/TODO.md index 9628cc16f..09d246598 100644 --- a/TODO.md +++ b/TODO.md @@ -40,7 +40,7 @@ - [x] Unique fields - [x] Scalar fields - [x] Relation fields - - [ ] JSON filtering + - [x] JSON filtering - [ ] Full-text search - [x] Sort - [x] Scalar fields @@ -86,7 +86,7 @@ - [x] Custom table name - [x] Custom field name - [x] Global omit - - [ ] DbNull vs JsonNull + - [x] DbNull vs JsonNull - [ ] Migrate to tsdown - [x] @default validation - [x] Benchmark diff --git a/package.json b/package.json index 8be97821e..4c9a166d4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zenstack-v3", - "version": "3.0.0-beta.27", + "version": "3.0.0-beta.28", "description": "ZenStack", "packageManager": "pnpm@10.23.0", "type": "module", @@ -24,7 +24,7 @@ "@eslint/js": "^9.29.0", "@types/node": "catalog:", "eslint": "~9.29.0", - "glob": "^11.0.2", + "glob": "^11.1.0", "prettier": "^3.5.3", "prisma": "catalog:", "tsup": "^8.5.0", diff --git a/packages/auth-adapters/better-auth/package.json b/packages/auth-adapters/better-auth/package.json index 115219a24..0600e0360 100644 --- a/packages/auth-adapters/better-auth/package.json +++ b/packages/auth-adapters/better-auth/package.json @@ -1,6 +1,6 @@ { "name": "@zenstackhq/better-auth", - "version": "3.0.0-beta.27", + "version": "3.0.0-beta.28", "description": "ZenStack Better Auth Adapter. This adapter is modified from better-auth's Prisma adapter.", "type": "module", "scripts": { diff --git a/packages/cli/package.json b/packages/cli/package.json index 3f6ce268c..7f33b32e6 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -3,7 +3,7 @@ "publisher": "zenstack", "displayName": "ZenStack CLI", "description": "FullStack database toolkit with built-in access control and automatic API generation.", - "version": "3.0.0-beta.27", + "version": "3.0.0-beta.28", "type": "module", "author": { "name": "ZenStack Team" diff --git a/packages/clients/tanstack-query/package.json b/packages/clients/tanstack-query/package.json index 6e14662dc..9a121978b 100644 --- a/packages/clients/tanstack-query/package.json +++ b/packages/clients/tanstack-query/package.json @@ -1,6 +1,6 @@ { "name": "@zenstackhq/tanstack-query", - "version": "3.0.0-beta.27", + "version": "3.0.0-beta.28", "description": "TanStack Query Client for consuming ZenStack v3's CRUD service", "main": "index.js", "type": "module", @@ -10,7 +10,7 @@ "lint": "eslint src --ext ts", "test": "vitest run", "pack": "pnpm pack", - "test:generate": "tsx scripts/generate.ts", + "test:generate": "tsx ../../../scripts/test-generate.ts tests", "test:typecheck": "tsc --noEmit --project tsconfig.test.json" }, "keywords": [ diff --git a/packages/clients/tanstack-query/scripts/generate.ts b/packages/clients/tanstack-query/scripts/generate.ts deleted file mode 100644 index 3801f157e..000000000 --- a/packages/clients/tanstack-query/scripts/generate.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { loadDocument } from '@zenstackhq/language'; -import { TsSchemaGenerator } from '@zenstackhq/sdk'; -import { glob } from 'glob'; -import path from 'node:path'; -import { fileURLToPath } from 'node:url'; - -const dir = path.dirname(fileURLToPath(import.meta.url)); - -async function main() { - const zmodelFiles = glob.sync(path.resolve(dir, '../test/**/*.zmodel')); - for (const file of zmodelFiles) { - console.log(`Generating TS schema for: ${file}`); - await generate(file); - } -} - -async function generate(schemaPath: string) { - const generator = new TsSchemaGenerator(); - const outDir = path.dirname(schemaPath); - const result = await loadDocument(schemaPath); - if (!result.success) { - throw new Error(`Failed to load schema from ${schemaPath}: ${result.errors}`); - } - await generator.generate(result.model, { outDir, liteOnly: true }); -} - -main(); diff --git a/packages/common-helpers/package.json b/packages/common-helpers/package.json index 1654b58d4..564217f13 100644 --- a/packages/common-helpers/package.json +++ b/packages/common-helpers/package.json @@ -1,6 +1,6 @@ { "name": "@zenstackhq/common-helpers", - "version": "3.0.0-beta.27", + "version": "3.0.0-beta.28", "description": "ZenStack Common Helpers", "type": "module", "scripts": { diff --git a/packages/common-helpers/src/zip.ts b/packages/common-helpers/src/zip.ts index 35d4981b5..540a52769 100644 --- a/packages/common-helpers/src/zip.ts +++ b/packages/common-helpers/src/zip.ts @@ -1,7 +1,7 @@ /** * Zips two arrays into an array of tuples. */ -export function zip(arr1: T[], arr2: U[]): Array<[T, U]> { +export function zip(arr1: readonly T[], arr2: readonly U[]): Array<[T, U]> { const length = Math.min(arr1.length, arr2.length); const result: Array<[T, U]> = []; for (let i = 0; i < length; i++) { diff --git a/packages/config/eslint-config/package.json b/packages/config/eslint-config/package.json index 6a6c3bf43..208b0e451 100644 --- a/packages/config/eslint-config/package.json +++ b/packages/config/eslint-config/package.json @@ -1,6 +1,6 @@ { "name": "@zenstackhq/eslint-config", - "version": "3.0.0-beta.27", + "version": "3.0.0-beta.28", "type": "module", "private": true, "license": "MIT" diff --git a/packages/config/typescript-config/package.json b/packages/config/typescript-config/package.json index 3cc4bfe1a..1b05dc4c4 100644 --- a/packages/config/typescript-config/package.json +++ b/packages/config/typescript-config/package.json @@ -1,6 +1,6 @@ { "name": "@zenstackhq/typescript-config", - "version": "3.0.0-beta.27", + "version": "3.0.0-beta.28", "private": true, "license": "MIT" } diff --git a/packages/config/vitest-config/package.json b/packages/config/vitest-config/package.json index f34377268..b0391fa65 100644 --- a/packages/config/vitest-config/package.json +++ b/packages/config/vitest-config/package.json @@ -1,7 +1,7 @@ { "name": "@zenstackhq/vitest-config", "type": "module", - "version": "3.0.0-beta.27", + "version": "3.0.0-beta.28", "private": true, "license": "MIT", "exports": { diff --git a/packages/create-zenstack/package.json b/packages/create-zenstack/package.json index 216a99c3b..2f7a1fd70 100644 --- a/packages/create-zenstack/package.json +++ b/packages/create-zenstack/package.json @@ -1,6 +1,6 @@ { "name": "create-zenstack", - "version": "3.0.0-beta.27", + "version": "3.0.0-beta.28", "description": "Create a new ZenStack project", "type": "module", "scripts": { diff --git a/packages/language/package.json b/packages/language/package.json index e5a45c95f..e58d67294 100644 --- a/packages/language/package.json +++ b/packages/language/package.json @@ -1,7 +1,7 @@ { "name": "@zenstackhq/language", "description": "ZenStack ZModel language specification", - "version": "3.0.0-beta.27", + "version": "3.0.0-beta.28", "license": "MIT", "author": "ZenStack Team", "files": [ @@ -67,12 +67,8 @@ "@zenstackhq/eslint-config": "workspace:*", "@zenstackhq/typescript-config": "workspace:*", "@zenstackhq/vitest-config": "workspace:*", - "glob": "^11.0.2", + "glob": "^11.1.0", "langium-cli": "catalog:", "tmp": "catalog:" - }, - "volta": { - "node": "18.19.1", - "npm": "10.2.4" } } diff --git a/packages/orm/package.json b/packages/orm/package.json index 0312e8abe..603fad418 100644 --- a/packages/orm/package.json +++ b/packages/orm/package.json @@ -1,6 +1,6 @@ { "name": "@zenstackhq/orm", - "version": "3.0.0-beta.27", + "version": "3.0.0-beta.28", "description": "ZenStack ORM", "type": "module", "scripts": { diff --git a/packages/orm/src/client/crud-types.ts b/packages/orm/src/client/crud-types.ts index 55e3edfd6..65e07c1ca 100644 --- a/packages/orm/src/client/crud-types.ts +++ b/packages/orm/src/client/crud-types.ts @@ -1,4 +1,5 @@ import type { ExpressionBuilder, OperandExpression, SqlBool } from 'kysely'; +import type { DbNull, JsonNull, JsonNullValues, JsonValue } from '../common-types'; import type { BuiltinType, FieldDef, @@ -12,16 +13,14 @@ import type { GetEnum, GetEnums, GetModel, - GetModelDiscriminator, GetModelField, GetModelFields, GetModelFieldType, GetModels, - GetSubModels, GetTypeDefField, GetTypeDefFields, + GetTypeDefFieldType, GetTypeDefs, - IsDelegateModel, ModelFieldIsOptional, NonRelationFields, RelationFields, @@ -29,6 +28,7 @@ import type { RelationInfo, ScalarFields, SchemaDef, + TypeDefFieldIsArray, TypeDefFieldIsOptional, } from '../schema'; import type { @@ -57,20 +57,26 @@ export type DefaultModelResult< Optional = false, Array = false, > = WrapType< - IsDelegateModel extends true - ? // delegate model's selection result is a union of all sub-models - DelegateUnionResult, Omit> - : { - [Key in NonRelationFields as ShouldOmitField< - Schema, - Model, - Options, - Key, - Omit - > extends true - ? never - : Key]: MapModelFieldType; - }, + { + [Key in NonRelationFields as ShouldOmitField extends true + ? never + : Key]: MapModelFieldType; + }, + // TODO: revisit how to efficiently implement discriminated sub model types + // IsDelegateModel extends true + // ? // delegate model's selection result is a union of all sub-models + // DelegateUnionResult, Omit> + // : { + // [Key in NonRelationFields as ShouldOmitField< + // Schema, + // Model, + // Options, + // Key, + // Omit + // > extends true + // ? never + // : Key]: MapModelFieldType; + // }, Optional, Array >; @@ -115,15 +121,15 @@ type SchemaLevelOmit< Field extends GetModelFields, > = GetModelField['omit'] extends true ? true : false; -type DelegateUnionResult< - Schema extends SchemaDef, - Model extends GetModels, - Options extends ClientOptions, - SubModel extends GetModels, - Omit = undefined, -> = SubModel extends string // typescript union distribution - ? DefaultModelResult & { [K in GetModelDiscriminator]: SubModel } // fixate discriminated field - : never; +// type DelegateUnionResult< +// Schema extends SchemaDef, +// Model extends GetModels, +// Options extends ClientOptions, +// SubModel extends GetModels, +// Omit = undefined, +// > = SubModel extends string // typescript union distribution +// ? DefaultModelResult & { [K in GetModelDiscriminator]: SubModel } // fixate discriminated field +// : never; type ModelSelectResult< Schema extends SchemaDef, @@ -302,12 +308,19 @@ export type WhereInput< ModelFieldIsOptional, WithAggregations > - : // primitive - PrimitiveFilter< - GetModelFieldType, - ModelFieldIsOptional, - WithAggregations - >; + : GetModelFieldType extends GetTypeDefs + ? TypedJsonFilter< + Schema, + GetModelFieldType, + FieldIsArray, + ModelFieldIsOptional + > + : // primitive + PrimitiveFilter< + GetModelFieldType, + ModelFieldIsOptional, + WithAggregations + >; } & { $expr?: (eb: ExpressionBuilder, Model>) => OperandExpression; } & { @@ -324,29 +337,74 @@ type EnumFilter< > = | NullableIf, Nullable> | ({ + /** + * Checks for equality with the specified enum value. + */ equals?: NullableIf, Nullable>; + + /** + * Checks if the enum value is in the specified list of values. + */ in?: (keyof GetEnum)[]; + + /** + * Checks if the enum value is not in the specified list of values. + */ notIn?: (keyof GetEnum)[]; + + /** + * Builds a negated filter. + */ not?: EnumFilter; } & (WithAggregations extends true ? { + /** + * Filters against the count of records. + */ _count?: NumberFilter<'Int', false, false>; + + /** + * Filters against the minimum value. + */ _min?: EnumFilter; + + /** + * Filters against the maximum value. + */ _max?: EnumFilter; } : {})); -type ArrayFilter = { - equals?: MapScalarType[] | null; - has?: MapScalarType | null; - hasEvery?: MapScalarType[]; - hasSome?: MapScalarType[]; +type ArrayFilter = { + /** + * Checks if the array equals the specified array. + */ + equals?: MapScalarType[] | null; + + /** + * Checks if the array contains all elements of the specified array. + */ + has?: MapScalarType | null; + + /** + * Checks if the array contains any of the elements of the specified array. + */ + hasEvery?: MapScalarType[]; + + /** + * Checks if the array contains some of the elements of the specified array. + */ + hasSome?: MapScalarType[]; + + /** + * Checks if the array is empty. + */ isEmpty?: boolean; }; // map a scalar type (primitive and enum) to TS type -type MapScalarType = - T extends GetEnums ? keyof GetEnum : MapBaseType; +type MapScalarType = + Type extends GetEnums ? keyof GetEnum : MapBaseType; type PrimitiveFilter = T extends 'String' ? StringFilter @@ -359,7 +417,7 @@ type PrimitiveFilter : T extends 'Json' - ? 'Not implemented yet' // TODO: Json filter + ? JsonFilter : never; type CommonPrimitiveFilter< @@ -368,30 +426,84 @@ type CommonPrimitiveFilter< Nullable extends boolean, WithAggregations extends boolean, > = { + /** + * Checks for equality with the specified value. + */ equals?: NullableIf; + + /** + * Checks if the value is in the specified list of values. + */ in?: DataType[]; + + /** + * Checks if the value is not in the specified list of values. + */ notIn?: DataType[]; + + /** + * Checks if the value is less than the specified value. + */ lt?: DataType; + + /** + * Checks if the value is less than or equal to the specified value. + */ lte?: DataType; + + /** + * Checks if the value is greater than the specified value. + */ gt?: DataType; + + /** + * Checks if the value is greater than or equal to the specified value. + */ gte?: DataType; + + /** + * Builds a negated filter. + */ not?: PrimitiveFilter; }; export type StringFilter = | NullableIf | (CommonPrimitiveFilter & { + /** + * Checks if the string contains the specified substring. + */ contains?: string; + + /** + * Checks if the string starts with the specified substring. + */ startsWith?: string; + + /** + * Checks if the string ends with the specified substring. + */ endsWith?: string; + /** - * Not effective for "sqlite" provider + * Specifies the string comparison mode. Not effective for "sqlite" provider */ mode?: 'default' | 'insensitive'; } & (WithAggregations extends true ? { + /** + * Filters against the count of records. + */ _count?: NumberFilter<'Int', false, false>; + + /** + * Filters against the minimum value. + */ _min?: StringFilter; + + /** + * Filters against the maximum value. + */ _max?: StringFilter; } : {})); @@ -405,10 +517,29 @@ export type NumberFilter< | (CommonPrimitiveFilter & (WithAggregations extends true ? { + /** + * Filters against the count of records. + */ _count?: NumberFilter<'Int', false, false>; + + /** + * Filters against the average value. + */ _avg?: NumberFilter; + + /** + * Filters against the sum value. + */ _sum?: NumberFilter; + + /** + * Filters against the minimum value. + */ _min?: NumberFilter; + + /** + * Filters against the maximum value. + */ _max?: NumberFilter; } : {})); @@ -418,8 +549,19 @@ export type DateTimeFilter & (WithAggregations extends true ? { + /** + * Filters against the count of records. + */ _count?: NumberFilter<'Int', false, false>; + + /** + * Filters against the minimum value. + */ _min?: DateTimeFilter; + + /** + * Filters against the maximum value. + */ _max?: DateTimeFilter; } : {})); @@ -427,14 +569,40 @@ export type DateTimeFilter = | NullableIf | ({ + /** + * Checks for equality with the specified value. + */ equals?: NullableIf; + + /** + * Checks if the value is in the specified list of values. + */ in?: Uint8Array[]; + + /** + * Checks if the value is not in the specified list of values. + */ notIn?: Uint8Array[]; + + /** + * Builds a negated filter. + */ not?: BytesFilter; } & (WithAggregations extends true ? { + /** + * Filters against the count of records. + */ _count?: NumberFilter<'Int', false, false>; + + /** + * Filters against the minimum value. + */ _min?: BytesFilter; + + /** + * Filters against the maximum value. + */ _max?: BytesFilter; } : {})); @@ -442,16 +610,147 @@ export type BytesFilter = | NullableIf | ({ + /** + * Checks for equality with the specified value. + */ equals?: NullableIf; + + /** + * Builds a negated filter. + */ not?: BooleanFilter; } & (WithAggregations extends true ? { + /** + * Filters against the count of records. + */ _count?: NumberFilter<'Int', false, false>; + + /** + * Filters against the minimum value. + */ _min?: BooleanFilter; + + /** + * Filters against the maximum value. + */ _max?: BooleanFilter; } : {})); +export type JsonFilter = { + /** + * JSON path to select the value to filter on. If omitted, the whole JSON value is used. + */ + path?: string; + + /** + * Checks for equality with the specified value. + */ + equals?: JsonValue | JsonNullValues; + + /** + * Builds a negated filter. + */ + not?: JsonValue | JsonNullValues; + + /** + * Checks if the value is a string and contains the specified substring. + */ + string_contains?: string; + + /** + * Checks if the value is a string and starts with the specified substring. + */ + string_starts_with?: string; + + /** + * Checks if the value is a string and ends with the specified substring. + */ + string_ends_with?: string; + + /** + * String comparison mode. Not effective for "sqlite" provider + */ + mode?: 'default' | 'insensitive'; + + /** + * Checks if the value is an array and contains the specified value. + */ + array_contains?: JsonValue; + + /** + * Checks if the value is an array and starts with the specified value. + */ + array_starts_with?: JsonValue; + + /** + * Checks if the value is an array and ends with the specified value. + */ + array_ends_with?: JsonValue; +}; + +export type TypedJsonFilter< + Schema extends SchemaDef, + TypeDefName extends GetTypeDefs, + Array extends boolean, + Optional extends boolean, +> = XOR>; + +type TypedJsonTypedFilter< + Schema extends SchemaDef, + TypeDefName extends GetTypeDefs, + Array extends boolean, + Optional extends boolean, +> = + | (Array extends true ? ArrayTypedJsonFilter : NonArrayTypedJsonFilter) + | (Optional extends true ? null : never); + +type ArrayTypedJsonFilter> = { + some?: TypedJsonFieldsFilter; + every?: TypedJsonFieldsFilter; + none?: TypedJsonFieldsFilter; +}; + +type NonArrayTypedJsonFilter> = + | { + is?: TypedJsonFieldsFilter; + isNot?: TypedJsonFieldsFilter; + } + | TypedJsonFieldsFilter; + +type TypedJsonFieldsFilter> = { + [Key in GetTypeDefFields]?: GetTypeDefFieldType< + Schema, + TypeDefName, + Key + > extends GetTypeDefs + ? // nested typedef - recurse + TypedJsonFilter< + Schema, + GetTypeDefFieldType, + TypeDefFieldIsArray, + TypeDefFieldIsOptional + > + : // array + TypeDefFieldIsArray extends true + ? ArrayFilter> + : // enum + GetTypeDefFieldType extends GetEnums + ? EnumFilter< + Schema, + GetTypeDefFieldType, + TypeDefFieldIsOptional, + false + > + : // primitive + PrimitiveFilter< + GetTypeDefFieldType, + TypeDefFieldIsOptional, + false + >; +}; + export type SortOrder = 'asc' | 'desc'; export type NullsOrder = 'first' | 'last'; @@ -465,7 +764,14 @@ export type OrderBy< ? | SortOrder | { + /** + * Sort order + */ sort: SortOrder; + + /** + * Treatment of null values + */ nulls?: NullsOrder; } : SortOrder; @@ -473,6 +779,9 @@ export type OrderBy< ? { [Key in RelationFields]?: FieldIsArray extends true ? { + /** + * Sorts by the count of related records. + */ _count?: SortOrder; } : OrderBy, WithRelation, WithAggregation>; @@ -480,14 +789,31 @@ export type OrderBy< : {}) & (WithAggregation extends true ? { + /** + * Sorts by the count of records. + */ _count?: OrderBy; + + /** + * Sorts by the minimum value. + */ _min?: MinMaxInput; + + /** + * Sorts by the maximum value. + */ _max?: MinMaxInput; } & (NumericFields extends never ? {} : { - // aggregations specific to numeric fields + /** + * Sorts by the average value. + */ _avg?: SumAvgInput; + + /** + * Sorts by the sum value. + */ _sum?: SumAvgInput; }) : {}); @@ -522,8 +848,19 @@ export type SelectIncludeOmit< AllowCount extends boolean, AllowRelation extends boolean = true, > = { + /** + * Explicitly select fields and relations to be returned by the query. + */ select?: SelectInput | null; + + /** + * Specifies relations to be included in the query result. All scalar fields are included. + */ include?: IncludeInput | null; + + /** + * Explicitly omit fields from the query result. + */ omit?: OmitInput | null; }; @@ -539,6 +876,9 @@ export type SelectInput< type SelectCount> = | boolean | { + /** + * Selects specific relations to count. + */ select: { [Key in RelationFields as FieldIsArray extends true ? Key : never]?: | boolean @@ -601,10 +941,17 @@ type ToOneRelationFilter< Field extends RelationFields, > = NullableIf< WhereInput> & { + /** + * Checks if the related record matches the specified filter. + */ is?: NullableIf< WhereInput>, ModelFieldIsOptional >; + + /** + * Checks if the related record does not match the specified filter. + */ isNot?: NullableIf< WhereInput>, ModelFieldIsOptional @@ -683,7 +1030,7 @@ type OppositeRelationFields< Model extends GetModels, Field extends GetModelFields, Opposite = OppositeRelation, -> = Opposite extends RelationInfo ? (Opposite['fields'] extends string[] ? Opposite['fields'] : []) : []; +> = Opposite extends RelationInfo ? (Opposite['fields'] extends readonly string[] ? Opposite['fields'] : []) : []; type OppositeRelationAndFK< Schema extends SchemaDef, @@ -704,13 +1051,31 @@ type OppositeRelationAndFK< //#region Find args type FilterArgs> = { + /** + * Filter conditions + */ where?: WhereInput; }; type SortAndTakeArgs> = { + /** + * Number of records to skip + */ skip?: number; + + /** + * Number of records to take + */ take?: number; + + /** + * Order by clauses + */ orderBy?: OrArray>; + + /** + * Cursor for pagination + */ cursor?: WhereUniqueInput; }; @@ -719,18 +1084,16 @@ export type FindArgs< Model extends GetModels, Collection extends boolean, AllowFilter extends boolean = true, -> = - ProviderSupportsDistinct extends true - ? (Collection extends true - ? SortAndTakeArgs & { - distinct?: OrArray>; - } - : {}) & - (AllowFilter extends true ? FilterArgs : {}) & - SelectIncludeOmit - : (Collection extends true ? SortAndTakeArgs : {}) & - (AllowFilter extends true ? FilterArgs : {}) & - SelectIncludeOmit; +> = (Collection extends true + ? SortAndTakeArgs & { + /** + * Distinct fields + */ + distinct?: OrArray>; + } + : {}) & + (AllowFilter extends true ? FilterArgs : {}) & + SelectIncludeOmit; export type FindManyArgs> = FindArgs; @@ -772,20 +1135,34 @@ type CreateScalarPayload; -// For unknown reason toplevel `Simplify` can't simplify this type, so we added an extra layer -// to make it work type ScalarCreatePayload< Schema extends SchemaDef, Model extends GetModels, Field extends ScalarFields, -> = Simplify< - | MapModelFieldType +> = + | ScalarFieldMutationPayload | (FieldIsArray extends true ? { set?: MapModelFieldType; } - : never) ->; + : never); + +type ScalarFieldMutationPayload< + Schema extends SchemaDef, + Model extends GetModels, + Field extends GetModelFields, +> = + IsJsonField extends true + ? ModelFieldIsOptional extends true + ? JsonValue | JsonNull | DbNull + : JsonValue | JsonNull + : MapModelFieldType; + +type IsJsonField< + Schema extends SchemaDef, + Model extends GetModels, + Field extends GetModelFields, +> = GetModelFieldType extends 'Json' ? true : false; type CreateFKPayload> = OptionalWrap< Schema, @@ -801,9 +1178,24 @@ type CreateRelationFieldPayload< Field extends RelationFields, > = Omit< { + /** + * Connects or create a related record. + */ connectOrCreate?: ConnectOrCreateInput; + + /** + * Creates a related record. + */ create?: NestedCreateInput; + + /** + * Creates a batch of related records. + */ createMany?: NestedCreateManyInput; + + /** + * Connects an existing record. + */ connect?: ConnectInput; }, // no "createMany" for non-array fields @@ -847,7 +1239,14 @@ type ConnectOrCreatePayload< Model extends GetModels, Without extends string = never, > = { + /** + * The unique filter to find an existing record to connect. + */ where: WhereUniqueInput; + + /** + * The data to create a new record if no existing record is found. + */ create: CreateInput; }; @@ -856,7 +1255,14 @@ export type CreateManyInput< Model extends GetModels, Without extends string = never, > = { + /** + * The data for the records to create. + */ data: OrArray, Without> & Omit, Without>>; + + /** + * Specifies whether to skip creating records that would violate unique constraints. + */ skipDuplicates?: boolean; }; @@ -886,7 +1292,14 @@ type NestedCreateManyInput< // #region Update args export type UpdateArgs> = { + /** + * The data to update the record with. + */ data: UpdateInput; + + /** + * The unique filter to find the record to update. + */ where: WhereUniqueInput; } & SelectIncludeOmit; @@ -902,14 +1315,36 @@ export type UpdateManyAndReturnArgs, 'include'>; type UpdateManyPayload, Without extends string = never> = { + /** + * The data to update the records with. + */ data: OrArray>; + + /** + * The filter to select records to update. + */ where?: WhereInput; + + /** + * Limit the number of records to update. + */ limit?: number; }; export type UpsertArgs> = { + /** + * The data to create the record if it doesn't exist. + */ create: CreateInput; + + /** + * The data to update the record with if it exists. + */ update: UpdateInput; + + /** + * The unique filter to find the record to update. + */ where: WhereUniqueInput; } & SelectIncludeOmit; @@ -932,19 +1367,45 @@ type ScalarUpdatePayload< Model extends GetModels, Field extends NonRelationFields, > = - | MapModelFieldType + | ScalarFieldMutationPayload | (Field extends NumericFields ? { + /** + * Sets the field to the specified value. + */ set?: NullableIf>; + + /** + * Increments the field by the specified value. + */ increment?: number; + + /** + * Decrements the field by the specified value. + */ decrement?: number; + + /** + * Multiplies the field by the specified value. + */ multiply?: number; + + /** + * Divides the field by the specified value. + */ divide?: number; } : never) | (FieldIsArray extends true ? { + /** + * Sets the field to the specified array. + */ set?: MapModelFieldType[]; + + /** + * Appends the specified values to the array field. + */ push?: OrArray, true>; } : never); @@ -981,16 +1442,59 @@ type ToManyRelationUpdateInput< Field extends RelationFields, > = Omit< { + /** + * Creates related records. + */ create?: NestedCreateInput; + + /** + * Creates a batch of related records. + */ createMany?: NestedCreateManyInput; + + /** + * Connects existing records. + */ connect?: ConnectInput; + + /** + * Connects or create related records. + */ connectOrCreate?: ConnectOrCreateInput; + + /** + * Disconnects related records. + */ disconnect?: DisconnectInput; + + /** + * Updates related records. + */ update?: NestedUpdateInput; + + /** + * Upserts related records. + */ upsert?: NestedUpsertInput; + + /** + * Updates a batch of related records. + */ updateMany?: NestedUpdateManyInput; + + /** + * Deletes related records. + */ delete?: NestedDeleteInput; + + /** + * Deletes a batch of related records. + */ deleteMany?: NestedDeleteManyInput; + + /** + * Sets the related records to the specified ones. + */ set?: SetRelationInput; }, // exclude @@ -1005,14 +1509,40 @@ type ToOneRelationUpdateInput< Field extends RelationFields, > = Omit< { + /** + * Creates a related record. + */ create?: NestedCreateInput; + + /** + * Connects an existing record. + */ connect?: ConnectInput; + + /** + * Connects or create a related record. + */ connectOrCreate?: ConnectOrCreateInput; + + /** + * Updates the related record. + */ update?: NestedUpdateInput; + + /** + * Upserts the related record. + */ upsert?: NestedUpsertInput; } & (ModelFieldIsOptional extends true ? { + /** + * Disconnects the related record. + */ disconnect?: DisconnectInput; + + /** + * Deletes the related record. + */ delete?: NestedDeleteInput; } : {}), @@ -1024,11 +1554,21 @@ type ToOneRelationUpdateInput< // #region Delete args export type DeleteArgs> = { + /** + * The unique filter to find the record to delete. + */ where: WhereUniqueInput; } & SelectIncludeOmit; export type DeleteManyArgs> = { + /** + * Filter to select records to delete. + */ where?: WhereInput; + + /** + * Limits the number of records to delete. + */ limit?: number; }; @@ -1040,6 +1580,9 @@ export type CountArgs> FindArgs, 'select' | 'include' | 'distinct' | 'omit' > & { + /** + * Selects fields to count + */ select?: CountAggregateInput | true; }; @@ -1062,18 +1605,51 @@ export type CountResult> = { + /** + * Filter conditions + */ where?: WhereInput; + + /** + * Number of records to skip for the aggregation + */ skip?: number; + + /** + * Number of records to take for the aggregation + */ take?: number; + + /** + * Order by clauses + */ orderBy?: OrArray>; } & { + /** + * Performs count aggregation. + */ _count?: true | CountAggregateInput; + + /** + * Performs minimum value aggregation. + */ _min?: MinMaxInput; + + /** + * Performs maximum value aggregation. + */ _max?: MinMaxInput; } & (NumericFields extends never ? {} : { + /** + * Performs average value aggregation. + */ _avg?: SumAvgInput; + + /** + * Performs sum value aggregation. + */ _sum?: SumAvgInput; }); @@ -1105,26 +1681,41 @@ export type AggregateResult; } : {}) & (Args extends { _sum: infer Sum } ? { + /** + * Sum aggregation result + */ _sum: AggCommonOutput; } : {}) & (Args extends { _avg: infer Avg } ? { + /** + * Average aggregation result + */ _avg: AggCommonOutput; } : {}) & (Args extends { _min: infer Min } ? { + /** + * Minimum aggregation result + */ _min: AggCommonOutput; } : {}) & (Args extends { _max: infer Max } ? { + /** + * Maximum aggregation result + */ _max: AggCommonOutput; } : {}); @@ -1147,21 +1738,61 @@ type GroupByHaving> = >; export type GroupByArgs> = { + /** + * Filter conditions + */ where?: WhereInput; + + /** + * Order by clauses + */ orderBy?: OrArray>; + + /** + * Fields to group by + */ by: NonRelationFields | NonEmptyArray>; + + /** + * Filter conditions for the grouped records + */ having?: GroupByHaving; + + /** + * Number of records to take for grouping + */ take?: number; + + /** + * Number of records to skip for grouping + */ skip?: number; - // aggregations + + /** + * Performs count aggregation. + */ _count?: true | CountAggregateInput; + + /** + * Performs minimum value aggregation. + */ _min?: MinMaxInput; + + /** + * Performs maximum value aggregation. + */ _max?: MinMaxInput; } & (NumericFields extends never ? {} : { - // aggregations specific to numeric fields + /** + * Performs average value aggregation. + */ _avg?: SumAvgInput; + + /** + * Performs sum value aggregation. + */ _sum?: SumAvgInput; }); @@ -1176,26 +1807,41 @@ export type GroupByResult< : never]: MapModelFieldType; } & (Args extends { _count: infer Count } ? { + /** + * Count aggregation result + */ _count: AggCommonOutput; } : {}) & (Args extends { _avg: infer Avg } ? { + /** + * Average aggregation result + */ _avg: AggCommonOutput; } : {}) & (Args extends { _sum: infer Sum } ? { + /** + * Sum aggregation result + */ _sum: AggCommonOutput; } : {}) & (Args extends { _min: infer Min } ? { + /** + * Minimum aggregation result + */ _min: AggCommonOutput; } : {}) & (Args extends { _max: infer Max } ? { + /** + * Maximum aggregation result + */ _max: AggCommonOutput; } : {}) @@ -1254,9 +1900,17 @@ type NestedUpdateInput< Field extends RelationFields, > = FieldIsArray extends true - ? OrArray< + ? // to-many + OrArray< { + /** + * Unique filter to select the record to update. + */ where: WhereUniqueInput>; + + /** + * The data to update the record with. + */ data: UpdateInput< Schema, RelationFieldType, @@ -1265,9 +1919,17 @@ type NestedUpdateInput< }, true > - : XOR< + : // to-one + XOR< { - where: WhereUniqueInput>; + /** + * Filter to select the record to update. + */ + where?: WhereInput>; + + /** + * The data to update the record with. + */ data: UpdateInput< Schema, RelationFieldType, @@ -1283,12 +1945,23 @@ type NestedUpsertInput< Field extends RelationFields, > = OrArray< { + /** + * Unique filter to select the record to update. + */ where: WhereUniqueInput>; + + /** + * The data to create the record if it doesn't exist. + */ create: CreateInput< Schema, RelationFieldType, OppositeRelationAndFK >; + + /** + * The data to update the record with if it exists. + */ update: UpdateInput< Schema, RelationFieldType, @@ -1327,7 +2000,7 @@ type NestedDeleteManyInput< type NonOwnedRelationFields> = keyof { [Key in RelationFields as GetModelField['relation'] extends { - references: unknown[]; + references: readonly unknown[]; } ? never : Key]: true; @@ -1339,8 +2012,8 @@ type HasToManyRelations = Schema['provider']['type'] extends 'postgresql' - ? true - : false; +// type ProviderSupportsDistinct = Schema['provider']['type'] extends 'postgresql' +// ? true +// : false; // #endregion diff --git a/packages/orm/src/client/crud/dialects/base-dialect.ts b/packages/orm/src/client/crud/dialects/base-dialect.ts index 42af09d25..30e330a40 100644 --- a/packages/orm/src/client/crud/dialects/base-dialect.ts +++ b/packages/orm/src/client/crud/dialects/base-dialect.ts @@ -2,6 +2,7 @@ import { enumerate, invariant, isPlainObject } from '@zenstackhq/common-helpers' import type { Expression, ExpressionBuilder, ExpressionWrapper, SqlBool, ValueNode } from 'kysely'; import { expressionBuilder, sql, type SelectQueryBuilder } from 'kysely'; import { match, P } from 'ts-pattern'; +import { AnyNullClass, DbNullClass, JsonNullClass } from '../../../common-types'; import type { BuiltinType, DataSourceProviderType, FieldDef, GetModels, ModelDef, SchemaDef } from '../../../schema'; import type { OrArray } from '../../../utils/type-utils'; import { AGGREGATE_OPERATORS, DELEGATE_JOINED_FIELD_PREFIX, LOGICAL_COMBINATORS } from '../../constants'; @@ -27,10 +28,12 @@ import { isEnum, isInheritedField, isRelationField, + isTypeDef, makeDefaultOrderBy, requireField, requireIdFields, requireModel, + requireTypeDef, } from '../../query-utils'; export abstract class BaseCrudDialect { @@ -499,24 +502,213 @@ export abstract class BaseCrudDialect { return this.buildEnumFilter(fieldRef, fieldDef, payload); } - return ( - match(fieldDef.type as BuiltinType) - .with('String', () => this.buildStringFilter(fieldRef, payload)) - .with(P.union('Int', 'Float', 'Decimal', 'BigInt'), (type) => - this.buildNumberFilter(fieldRef, type, payload), - ) - .with('Boolean', () => this.buildBooleanFilter(fieldRef, payload)) - .with('DateTime', () => this.buildDateTimeFilter(fieldRef, payload)) - .with('Bytes', () => this.buildBytesFilter(fieldRef, payload)) - // TODO: JSON filters - .with('Json', () => { - throw createNotSupportedError('JSON filters are not supported yet'); - }) - .with('Unsupported', () => { - throw createInvalidInputError(`Unsupported field cannot be used in filters`); - }) - .exhaustive() - ); + if (isTypeDef(this.schema, fieldDef.type)) { + return this.buildJsonFilter(fieldRef, payload, fieldDef); + } + + return match(fieldDef.type as BuiltinType) + .with('String', () => this.buildStringFilter(fieldRef, payload)) + .with(P.union('Int', 'Float', 'Decimal', 'BigInt'), (type) => + this.buildNumberFilter(fieldRef, type, payload), + ) + .with('Boolean', () => this.buildBooleanFilter(fieldRef, payload)) + .with('DateTime', () => this.buildDateTimeFilter(fieldRef, payload)) + .with('Bytes', () => this.buildBytesFilter(fieldRef, payload)) + .with('Json', () => this.buildJsonFilter(fieldRef, payload, fieldDef)) + .with('Unsupported', () => { + throw createInvalidInputError(`Unsupported field cannot be used in filters`); + }) + .exhaustive(); + } + + private buildJsonFilter(receiver: Expression, filter: any, fieldDef: FieldDef): any { + invariant(filter && typeof filter === 'object', 'Json filter payload must be an object'); + + if ( + [ + 'path', + 'equals', + 'not', + 'string_contains', + 'string_starts_with', + 'string_ends_with', + 'array_contains', + 'array_starts_with', + 'array_ends_with', + ].some((k) => k in filter) + ) { + return this.buildPlainJsonFilter(receiver, filter); + } else if (isTypeDef(this.schema, fieldDef.type)) { + return this.buildTypedJsonFilter(receiver, filter, fieldDef.type, !!fieldDef.array); + } else { + throw createInvalidInputError(`Invalid JSON filter payload`); + } + } + + private buildPlainJsonFilter(receiver: Expression, filter: any) { + const clauses: Expression[] = []; + + const path = filter.path; + const jsonReceiver = this.buildJsonPathSelection(receiver, path); + const stringReceiver = this.eb.cast(jsonReceiver, 'text'); + + const mode = filter.mode ?? 'default'; + invariant(mode === 'default' || mode === 'insensitive', 'Invalid JSON filter mode'); + + for (const [key, value] of Object.entries(filter)) { + switch (key) { + case 'equals': { + clauses.push(this.buildJsonValueFilterClause(jsonReceiver, value)); + break; + } + case 'not': { + clauses.push(this.eb.not(this.buildJsonValueFilterClause(jsonReceiver, value))); + break; + } + case 'string_contains': { + invariant(typeof value === 'string', 'string_contains value must be a string'); + clauses.push(this.buildJsonStringFilter(stringReceiver, key, value, mode)); + break; + } + case 'string_starts_with': { + invariant(typeof value === 'string', 'string_starts_with value must be a string'); + clauses.push(this.buildJsonStringFilter(stringReceiver, key, value, mode)); + break; + } + case 'string_ends_with': { + invariant(typeof value === 'string', 'string_ends_with value must be a string'); + clauses.push(this.buildJsonStringFilter(stringReceiver, key, value, mode)); + break; + } + case 'array_contains': { + clauses.push(this.buildJsonArrayFilter(jsonReceiver, key, value)); + break; + } + case 'array_starts_with': { + clauses.push(this.buildJsonArrayFilter(jsonReceiver, key, value)); + break; + } + case 'array_ends_with': { + clauses.push(this.buildJsonArrayFilter(jsonReceiver, key, value)); + break; + } + case 'path': + case 'mode': + // already handled + break; + default: + throw createInvalidInputError(`Invalid JSON filter key: ${key}`); + } + } + return this.and(...clauses); + } + + private buildTypedJsonFilter(receiver: Expression, filter: any, typeDefName: string, array: boolean) { + if (array) { + return this.buildTypedJsonArrayFilter(receiver, filter, typeDefName); + } else { + return this.buildTypeJsonNonArrayFilter(receiver, filter, typeDefName); + } + } + + private buildTypedJsonArrayFilter(receiver: Expression, filter: any, typeDefName: string) { + invariant(filter && typeof filter === 'object', 'Typed JSON array filter payload must be an object'); + + const makeExistsPred = (filter: any) => + this.buildJsonArrayExistsPredicate(receiver, (elem) => + this.buildTypedJsonFilter(elem, filter, typeDefName, false), + ); + + const makeExistsNegatedPred = (filter: any) => + this.buildJsonArrayExistsPredicate(receiver, (elem) => + this.eb.not(this.buildTypedJsonFilter(elem, filter, typeDefName, false)), + ); + + const clauses: Expression[] = []; + + for (const [key, value] of Object.entries(filter)) { + if (!value || typeof value !== 'object') { + continue; + } + switch (key) { + case 'some': + clauses.push(makeExistsPred(value)); + break; + + case 'none': + clauses.push(this.eb.not(makeExistsPred(value))); + break; + + case 'every': + clauses.push(this.eb.not(makeExistsNegatedPred(value))); + break; + + default: + invariant(false, `Invalid typed JSON array filter key: ${key}`); + } + } + return this.and(...clauses); + } + + private buildTypeJsonNonArrayFilter( + receiver: Expression, + filter: any, + typeDefName: string, + ): Expression { + const clauses: Expression[] = []; + + if (filter === null) { + return this.eb(receiver, '=', 'null'); + } + + invariant(filter && typeof filter === 'object', 'Typed JSON filter payload must be an object'); + + if ('is' in filter || 'isNot' in filter) { + // is / isNot filters + if ('is' in filter && filter.is && typeof filter.is === 'object') { + clauses.push(this.buildTypedJsonFilter(receiver, filter.is, typeDefName, false)); + } + + if ('isNot' in filter && filter.isNot && typeof filter.isNot === 'object') { + clauses.push(this.eb.not(this.buildTypedJsonFilter(receiver, filter.isNot, typeDefName, false))); + } + } else { + // direct field filters + const typeDef = requireTypeDef(this.schema, typeDefName); + for (const [key, value] of Object.entries(filter)) { + const fieldDef = typeDef.fields[key]; + invariant(fieldDef, `Field "${key}" not found in type definition "${typeDefName}"`); + const fieldReceiver = this.buildJsonPathSelection(receiver, `$.${key}`); + if (isTypeDef(this.schema, fieldDef.type)) { + clauses.push(this.buildTypedJsonFilter(fieldReceiver, value, fieldDef.type, !!fieldDef.array)); + } else { + if (fieldDef.array) { + clauses.push(this.buildArrayFilter(fieldReceiver, fieldDef, value)); + } else { + let _receiver = fieldReceiver; + if (fieldDef.type === 'String') { + // trim quotes for string fields + _receiver = this.eb.fn('trim', [this.eb.cast(fieldReceiver, 'text'), sql.lit('"')]); + } + clauses.push(this.buildPrimitiveFilter(_receiver, fieldDef, value)); + } + } + } + } + return this.and(...clauses); + } + + private buildJsonValueFilterClause(lhs: Expression, value: unknown) { + if (value instanceof DbNullClass) { + return this.eb(lhs, 'is', null); + } else if (value instanceof JsonNullClass) { + return this.eb.and([this.eb(lhs, '=', 'null'), this.eb(lhs, 'is not', null)]); + } else if (value instanceof AnyNullClass) { + // AnyNull matches both DB NULL and JSON null + return this.eb.or([this.eb(lhs, 'is', null), this.eb(lhs, '=', 'null')]); + } else { + return this.buildLiteralFilter(lhs, 'Json', value); + } } private buildLiteralFilter(lhs: Expression, type: BuiltinType, rhs: unknown) { @@ -625,22 +817,15 @@ export abstract class BaseCrudDialect { continue; } + invariant(typeof value === 'string', `${key} value must be a string`); + + const escapedValue = this.escapeLikePattern(value); const condition = match(key) - .with('contains', () => - mode === 'insensitive' - ? this.eb(fieldRef, 'ilike', sql.val(`%${value}%`)) - : this.eb(fieldRef, 'like', sql.val(`%${value}%`)), - ) + .with('contains', () => this.buildStringLike(fieldRef, `%${escapedValue}%`, mode === 'insensitive')) .with('startsWith', () => - mode === 'insensitive' - ? this.eb(fieldRef, 'ilike', sql.val(`${value}%`)) - : this.eb(fieldRef, 'like', sql.val(`${value}%`)), - ) - .with('endsWith', () => - mode === 'insensitive' - ? this.eb(fieldRef, 'ilike', sql.val(`%${value}`)) - : this.eb(fieldRef, 'like', sql.val(`%${value}`)), + this.buildStringLike(fieldRef, `${escapedValue}%`, mode === 'insensitive'), ) + .with('endsWith', () => this.buildStringLike(fieldRef, `%${escapedValue}`, mode === 'insensitive')) .otherwise(() => { throw createInvalidInputError(`Invalid string filter key: ${key}`); }); @@ -654,6 +839,33 @@ export abstract class BaseCrudDialect { return this.and(...conditions); } + private buildJsonStringFilter( + receiver: Expression, + operation: 'string_contains' | 'string_starts_with' | 'string_ends_with', + value: string, + mode: 'default' | 'insensitive', + ) { + // build LIKE pattern based on operation, note that receiver is quoted + const escapedValue = this.escapeLikePattern(value); + const pattern = match(operation) + .with('string_contains', () => `"%${escapedValue}%"`) + .with('string_starts_with', () => `"${escapedValue}%"`) + .with('string_ends_with', () => `"%${escapedValue}"`) + .exhaustive(); + + return this.buildStringLike(receiver, pattern, mode === 'insensitive'); + } + + private escapeLikePattern(pattern: string) { + return pattern.replace(/\\/g, '\\\\').replace(/%/g, '\\%').replace(/_/g, '\\_'); + } + + private buildStringLike(receiver: Expression, pattern: string, insensitive: boolean) { + const { supportsILike } = this.getStringCasingBehavior(); + const op = insensitive && supportsILike ? 'ilike' : 'like'; + return sql`${receiver} ${sql.raw(op)} ${sql.val(pattern)} escape '\\'`; + } + private prepStringCasing( eb: ExpressionBuilder, value: unknown, @@ -1212,5 +1424,27 @@ export abstract class BaseCrudDialect { */ abstract getStringCasingBehavior(): { supportsILike: boolean; likeCaseSensitive: boolean }; + /** + * Builds a JSON path selection expression. + */ + protected abstract buildJsonPathSelection(receiver: Expression, path: string | undefined): Expression; + + /** + * Builds a JSON array filter expression. + */ + protected abstract buildJsonArrayFilter( + receiver: Expression, + operation: 'array_contains' | 'array_starts_with' | 'array_ends_with', + value: unknown, + ): Expression; + + /** + * Builds a JSON array exists predicate (returning if any element matches the filter). + */ + protected abstract buildJsonArrayExistsPredicate( + receiver: Expression, + buildFilter: (elem: Expression) => Expression, + ): Expression; + // #endregion } diff --git a/packages/orm/src/client/crud/dialects/postgresql.ts b/packages/orm/src/client/crud/dialects/postgresql.ts index aa4cedd02..733af920c 100644 --- a/packages/orm/src/client/crud/dialects/postgresql.ts +++ b/packages/orm/src/client/crud/dialects/postgresql.ts @@ -7,9 +7,11 @@ import { type ExpressionWrapper, type RawBuilder, type SelectQueryBuilder, + type SqlBool, } from 'kysely'; import { match } from 'ts-pattern'; import z from 'zod'; +import { AnyNullClass, DbNullClass, JsonNullClass } from '../../../common-types'; import type { BuiltinType, FieldDef, GetModels, SchemaDef } from '../../../schema'; import { DELEGATE_JOINED_FIELD_PREFIX } from '../../constants'; import type { FindArgs } from '../../crud-types'; @@ -25,7 +27,6 @@ import { requireModel, } from '../../query-utils'; import { BaseCrudDialect } from './base-dialect'; - export class PostgresCrudDialect extends BaseCrudDialect { private isoDateSchema = z.iso.datetime({ local: true, offset: true }); @@ -42,6 +43,15 @@ export class PostgresCrudDialect extends BaseCrudDiale return value; } + // Handle special null classes for JSON fields + if (value instanceof JsonNullClass) { + return 'null'; + } else if (value instanceof DbNullClass) { + return null; + } else if (value instanceof AnyNullClass) { + invariant(false, 'should not reach here: AnyNull is not a valid input value'); + } + if (Array.isArray(value)) { if (type === 'Json' && !forArrayField) { // node-pg incorrectly handles array values passed to non-array JSON fields, @@ -444,6 +454,53 @@ export class PostgresCrudDialect extends BaseCrudDiale } } + protected override buildJsonPathSelection(receiver: Expression, path: string | undefined) { + if (path) { + return this.eb.fn('jsonb_path_query_first', [receiver, this.eb.val(path)]); + } else { + return receiver; + } + } + + protected override buildJsonArrayFilter( + lhs: Expression, + operation: 'array_contains' | 'array_starts_with' | 'array_ends_with', + value: unknown, + ) { + return match(operation) + .with('array_contains', () => { + const v = Array.isArray(value) ? value : [value]; + return sql`${lhs} @> ${sql.val(JSON.stringify(v))}::jsonb`; + }) + .with('array_starts_with', () => + this.eb( + this.eb.fn('jsonb_extract_path', [lhs, this.eb.val('0')]), + '=', + this.transformPrimitive(value, 'Json', false), + ), + ) + .with('array_ends_with', () => + this.eb( + this.eb.fn('jsonb_extract_path', [lhs, sql`(jsonb_array_length(${lhs}) - 1)::text`]), + '=', + this.transformPrimitive(value, 'Json', false), + ), + ) + .exhaustive(); + } + + protected override buildJsonArrayExistsPredicate( + receiver: Expression, + buildFilter: (elem: Expression) => Expression, + ) { + return this.eb.exists( + this.eb + .selectFrom(this.eb.fn('jsonb_array_elements', [receiver]).as('$items')) + .select(this.eb.lit(1).as('$t')) + .where(buildFilter(this.eb.ref('$items.value'))), + ); + } + override get supportInsertWithDefault() { return true; } diff --git a/packages/orm/src/client/crud/dialects/sqlite.ts b/packages/orm/src/client/crud/dialects/sqlite.ts index 04b22d03d..102d57252 100644 --- a/packages/orm/src/client/crud/dialects/sqlite.ts +++ b/packages/orm/src/client/crud/dialects/sqlite.ts @@ -7,12 +7,14 @@ import { type ExpressionBuilder, type RawBuilder, type SelectQueryBuilder, + type SqlBool, } from 'kysely'; import { match } from 'ts-pattern'; +import { AnyNullClass, DbNullClass, JsonNullClass } from '../../../common-types'; import type { BuiltinType, FieldDef, GetModels, SchemaDef } from '../../../schema'; import { DELEGATE_JOINED_FIELD_PREFIX } from '../../constants'; import type { FindArgs } from '../../crud-types'; -import { createInternalError } from '../../errors'; +import { createInternalError, createNotSupportedError } from '../../errors'; import { getDelegateDescendantModels, getManyToManyRelation, @@ -33,27 +35,35 @@ export class SqliteCrudDialect extends BaseCrudDialect return value; } + // Handle special null classes for JSON fields + if (value instanceof JsonNullClass) { + return 'null'; + } else if (value instanceof DbNullClass) { + return null; + } else if (value instanceof AnyNullClass) { + invariant(false, 'should not reach here: AnyNull is not a valid input value'); + } + + if (type === 'Json' || (this.schema.typeDefs && type in this.schema.typeDefs)) { + // JSON data should be stringified + return JSON.stringify(value); + } + if (Array.isArray(value)) { return value.map((v) => this.transformPrimitive(v, type, false)); } else { - if (this.schema.typeDefs && type in this.schema.typeDefs) { - // typed JSON field - return JSON.stringify(value); - } else { - return match(type) - .with('Boolean', () => (value ? 1 : 0)) - .with('DateTime', () => - value instanceof Date - ? value.toISOString() - : typeof value === 'string' - ? new Date(value).toISOString() - : value, - ) - .with('Decimal', () => (value as Decimal).toString()) - .with('Bytes', () => Buffer.from(value as Uint8Array)) - .with('Json', () => JSON.stringify(value)) - .otherwise(() => value); - } + return match(type) + .with('Boolean', () => (value ? 1 : 0)) + .with('DateTime', () => + value instanceof Date + ? value.toISOString() + : typeof value === 'string' + ? new Date(value).toISOString() + : value, + ) + .with('Decimal', () => (value as Decimal).toString()) + .with('Bytes', () => Buffer.from(value as Uint8Array)) + .otherwise(() => value); } } @@ -350,6 +360,50 @@ export class SqliteCrudDialect extends BaseCrudDialect ); } + protected override buildJsonPathSelection(receiver: Expression, path: string | undefined) { + if (!path) { + return receiver; + } else { + return sql`${receiver} -> ${this.eb.val(path)}`; + } + } + + protected override buildJsonArrayFilter( + lhs: Expression, + operation: 'array_contains' | 'array_starts_with' | 'array_ends_with', + value: unknown, + ) { + return match(operation) + .with('array_contains', () => { + if (Array.isArray(value)) { + throw createNotSupportedError( + 'SQLite "array_contains" only supports checking for a single value, not an array of values', + ); + } else { + return sql`EXISTS (SELECT 1 FROM jsonb_each(${lhs}) WHERE value = ${value})`; + } + }) + .with('array_starts_with', () => + this.eb(this.eb.fn('json_extract', [lhs, this.eb.val('$[0]')]), '=', value), + ) + .with('array_ends_with', () => + this.eb(sql`json_extract(${lhs}, '$[' || (json_array_length(${lhs}) - 1) || ']')`, '=', value), + ) + .exhaustive(); + } + + protected override buildJsonArrayExistsPredicate( + receiver: Expression, + buildFilter: (elem: Expression) => Expression, + ) { + return this.eb.exists( + this.eb + .selectFrom(this.eb.fn('jsonb_each', [receiver]).as('$items')) + .select(this.eb.lit(1).as('$t')) + .where(buildFilter(this.eb.ref('$items.value'))), + ); + } + override get supportsUpdateWithLimit() { return false; } diff --git a/packages/orm/src/client/crud/operations/base.ts b/packages/orm/src/client/crud/operations/base.ts index f5fbca54f..0ac2fe8c5 100644 --- a/packages/orm/src/client/crud/operations/base.ts +++ b/packages/orm/src/client/crud/operations/base.ts @@ -250,7 +250,7 @@ export abstract class BaseOperationHandler { data: any, fromRelation?: FromRelationContext, creatingForDelegate = false, - returnFields?: string[], + returnFields?: readonly string[], ): Promise { const modelDef = this.requireModel(model); @@ -662,7 +662,7 @@ export abstract class BaseOperationHandler { input: { data: any; skipDuplicates?: boolean }, returnData: ReturnData, fromRelation?: FromRelationContext, - fieldsToReturn?: string[], + fieldsToReturn?: readonly string[], ): Promise { if (!input.data || (Array.isArray(input.data) && input.data.length === 0)) { // nothing todo @@ -901,7 +901,7 @@ export abstract class BaseOperationHandler { fromRelation?: FromRelationContext, allowRelationUpdate = true, throwIfNotFound = true, - fieldsToReturn?: string[], + fieldsToReturn?: readonly string[], ): Promise { if (!data || typeof data !== 'object') { throw createInvalidInputError('data must be an object'); @@ -961,9 +961,20 @@ export abstract class BaseOperationHandler { } } + // read pre-update entity with ids so that the caller can use it to identify + // the entity being updated, the read data is used as return value if no update + // is made to the entity + const thisEntity = await this.getEntityIds(kysely, model, combinedWhere); + if (!thisEntity) { + if (throwIfNotFound) { + throw createNotFoundError(model); + } else { + return null; + } + } + if (Object.keys(finalData).length === 0) { - // nothing to update, return the original filter so that caller can identify the entity - return combinedWhere; + return thisEntity; } let needIdRead = false; @@ -997,10 +1008,18 @@ export abstract class BaseOperationHandler { finalData = baseUpdateResult.remainingFields; // base update may change entity ids, update the filter combinedWhere = baseUpdateResult.baseEntity; + + // update this entity with fields in updated base + if (baseUpdateResult.baseEntity) { + for (const [key, value] of Object.entries(baseUpdateResult.baseEntity)) { + if (key in thisEntity) { + thisEntity[key] = value; + } + } + } } const updateFields: any = {}; - let thisEntity: any = undefined; for (const field in finalData) { const fieldDef = this.requireField(model, field); @@ -1010,16 +1029,6 @@ export abstract class BaseOperationHandler { if (!allowRelationUpdate) { throw createNotSupportedError(`Relation update not allowed for field "${field}"`); } - if (!thisEntity) { - thisEntity = await this.getEntityIds(kysely, model, combinedWhere); - if (!thisEntity) { - if (throwIfNotFound) { - throw createNotFoundError(model); - } else { - return null; - } - } - } const parentUpdates = await this.processRelationUpdates( kysely, model, @@ -1027,7 +1036,6 @@ export abstract class BaseOperationHandler { fieldDef, thisEntity, finalData[field], - throwIfNotFound, ); if (Object.keys(parentUpdates).length > 0) { @@ -1044,8 +1052,8 @@ export abstract class BaseOperationHandler { } if (!hasFieldUpdate) { - // nothing to update, return the filter so that the caller can identify the entity - return combinedWhere; + // nothing to update, return the existing entity + return thisEntity; } else { fieldsToReturn = fieldsToReturn ?? requireIdFields(this.schema, model); const query = kysely @@ -1207,7 +1215,7 @@ export abstract class BaseOperationHandler { limit: number | undefined, returnData: ReturnData, filterModel?: string, - fieldsToReturn?: string[], + fieldsToReturn?: readonly string[], ): Promise { if (typeof data !== 'object') { throw createInvalidInputError('data must be an object'); @@ -1347,7 +1355,6 @@ export abstract class BaseOperationHandler { fieldDef: FieldDef, parentIds: any, args: any, - throwIfNotFound: boolean, ) { const fieldModel = fieldDef.type as GetModels; const fromRelationContext: FromRelationContext = { @@ -1415,6 +1422,10 @@ export abstract class BaseOperationHandler { where = undefined; data = item; } + // update should throw if: + // - to-many: there's a where clause and no entity is found + // - to-one: always throw if no entity is found + const throwIfNotFound = !fieldDef.array || !!where; await this.update(kysely, fieldModel, where, data, fromRelationContext, true, throwIfNotFound); } break; @@ -1923,7 +1934,7 @@ export abstract class BaseOperationHandler { where: any, limit?: number, filterModel?: string, - fieldsToReturn?: string[], + fieldsToReturn?: readonly string[], ): Promise> { filterModel ??= model; diff --git a/packages/orm/src/client/crud/validator/index.ts b/packages/orm/src/client/crud/validator/index.ts index 300322246..dc1a6f836 100644 --- a/packages/orm/src/client/crud/validator/index.ts +++ b/packages/orm/src/client/crud/validator/index.ts @@ -3,6 +3,7 @@ import Decimal from 'decimal.js'; import stableStringify from 'json-stable-stringify'; import { match, P } from 'ts-pattern'; import { z, ZodType } from 'zod'; +import { AnyNullClass, DbNullClass, JsonNullClass } from '../../../common-types'; import { type AttributeApplication, type BuiltinType, @@ -296,7 +297,7 @@ export class InputValidator { return result; } - private makePrimitiveSchema(type: string, attributes?: AttributeApplication[]) { + private makeScalarSchema(type: string, attributes?: readonly AttributeApplication[]) { if (this.schema.typeDefs && type in this.schema.typeDefs) { return this.makeTypeDefSchema(type); } else if (this.schema.enums && type in this.schema.enums) { @@ -328,8 +329,9 @@ export class InputValidator { addDecimalValidation(z.string(), attributes, this.extraValidationsEnabled), ]); }) - .with('DateTime', () => z.union([z.date(), z.string().datetime()])) + .with('DateTime', () => z.union([z.date(), z.iso.datetime()])) .with('Bytes', () => z.instanceof(Uint8Array)) + .with('Json', () => this.makeJsonValueSchema(false, false)) .otherwise(() => z.unknown()); } } @@ -365,19 +367,26 @@ export class InputValidator { schema = z.looseObject( Object.fromEntries( Object.entries(typeDef.fields).map(([field, def]) => { - let fieldSchema = this.makePrimitiveSchema(def.type); + let fieldSchema = this.makeScalarSchema(def.type); if (def.array) { fieldSchema = fieldSchema.array(); } if (def.optional) { - fieldSchema = fieldSchema.optional(); + fieldSchema = fieldSchema.nullish(); } return [field, fieldSchema]; }), ), ); - this.setSchemaCache(key!, schema); - return schema; + + // zod doesn't preserve object field order after parsing, here we use a + // validation-only custom schema and use the original data if parsing + // is successful + const finalSchema = z.custom((v) => { + return schema.safeParse(v).success; + }); + this.setSchemaCache(key!, finalSchema); + return finalSchema; } private makeWhereSchema( @@ -432,6 +441,8 @@ export class InputValidator { } else if (fieldDef.array) { // array field fieldSchema = this.makeArrayFilterSchema(fieldDef.type as BuiltinType); + } else if (this.isTypeDefType(fieldDef.type)) { + fieldSchema = this.makeTypedJsonFilterSchema(fieldDef.type, !!fieldDef.optional, !!fieldDef.array); } else { // primitive field fieldSchema = this.makePrimitiveFilterSchema( @@ -526,6 +537,85 @@ export class InputValidator { return result; } + private makeTypedJsonFilterSchema(type: string, optional: boolean, array: boolean) { + const typeDef = getTypeDef(this.schema, type); + invariant(typeDef, `Type definition "${type}" not found in schema`); + + const candidates: z.ZodType[] = []; + + if (!array) { + // fields filter + const fieldSchemas: Record = {}; + for (const [fieldName, fieldDef] of Object.entries(typeDef.fields)) { + if (this.isTypeDefType(fieldDef.type)) { + // recursive typed JSON + fieldSchemas[fieldName] = this.makeTypedJsonFilterSchema( + fieldDef.type, + !!fieldDef.optional, + !!fieldDef.array, + ).optional(); + } else { + // array, enum, primitives + if (fieldDef.array) { + fieldSchemas[fieldName] = this.makeArrayFilterSchema(fieldDef.type as BuiltinType).optional(); + } else { + const enumDef = getEnum(this.schema, fieldDef.type); + if (enumDef) { + fieldSchemas[fieldName] = this.makeEnumFilterSchema( + enumDef, + !!fieldDef.optional, + false, + ).optional(); + } else { + fieldSchemas[fieldName] = this.makePrimitiveFilterSchema( + fieldDef.type as BuiltinType, + !!fieldDef.optional, + false, + ).optional(); + } + } + } + } + + candidates.push(z.strictObject(fieldSchemas)); + } + + const recursiveSchema = z.lazy(() => this.makeTypedJsonFilterSchema(type, optional, false)).optional(); + if (array) { + // array filter + candidates.push( + z.strictObject({ + some: recursiveSchema, + every: recursiveSchema, + none: recursiveSchema, + }), + ); + } else { + // is / isNot filter + candidates.push( + z.strictObject({ + is: recursiveSchema, + isNot: recursiveSchema, + }), + ); + } + + // plain json filter + candidates.push(this.makeJsonFilterSchema(optional)); + + if (optional) { + // allow null as well + candidates.push(z.null()); + } + + // either plain json filter or field filters + return z.union(candidates); + } + + private isTypeDefType(type: string) { + return this.schema.typeDefs && type in this.schema.typeDefs; + } + private makeEnumFilterSchema(enumDef: EnumDef, optional: boolean, withAggregations: boolean) { const baseSchema = z.enum(Object.keys(enumDef.values) as [string, ...string[]]); const components = this.makeCommonPrimitiveFilterComponents( @@ -540,43 +630,74 @@ export class InputValidator { private makeArrayFilterSchema(type: BuiltinType) { return z.strictObject({ - equals: this.makePrimitiveSchema(type).array().optional(), - has: this.makePrimitiveSchema(type).optional(), - hasEvery: this.makePrimitiveSchema(type).array().optional(), - hasSome: this.makePrimitiveSchema(type).array().optional(), + equals: this.makeScalarSchema(type).array().optional(), + has: this.makeScalarSchema(type).optional(), + hasEvery: this.makeScalarSchema(type).array().optional(), + hasSome: this.makeScalarSchema(type).array().optional(), isEmpty: z.boolean().optional(), }); } private makePrimitiveFilterSchema(type: BuiltinType, optional: boolean, withAggregations: boolean) { - if (this.schema.typeDefs && type in this.schema.typeDefs) { - // typed JSON field - return this.makeTypeDefFilterSchema(type, optional); + return match(type) + .with('String', () => this.makeStringFilterSchema(optional, withAggregations)) + .with(P.union('Int', 'Float', 'Decimal', 'BigInt'), (type) => + this.makeNumberFilterSchema(this.makeScalarSchema(type), optional, withAggregations), + ) + .with('Boolean', () => this.makeBooleanFilterSchema(optional, withAggregations)) + .with('DateTime', () => this.makeDateTimeFilterSchema(optional, withAggregations)) + .with('Bytes', () => this.makeBytesFilterSchema(optional, withAggregations)) + .with('Json', () => this.makeJsonFilterSchema(optional)) + .with('Unsupported', () => z.never()) + .exhaustive(); + } + + private makeJsonValueSchema(nullable: boolean, forFilter: boolean): z.ZodType { + const options: z.ZodType[] = [z.string(), z.number(), z.boolean(), z.instanceof(JsonNullClass)]; + + if (forFilter) { + options.push(z.instanceof(DbNullClass)); + } else { + if (nullable) { + // for mutation, allow DbNull only if nullable + options.push(z.instanceof(DbNullClass)); + } } - return ( - match(type) - .with('String', () => this.makeStringFilterSchema(optional, withAggregations)) - .with(P.union('Int', 'Float', 'Decimal', 'BigInt'), (type) => - this.makeNumberFilterSchema(this.makePrimitiveSchema(type), optional, withAggregations), - ) - .with('Boolean', () => this.makeBooleanFilterSchema(optional, withAggregations)) - .with('DateTime', () => this.makeDateTimeFilterSchema(optional, withAggregations)) - .with('Bytes', () => this.makeBytesFilterSchema(optional, withAggregations)) - // TODO: JSON filters - .with('Json', () => z.any()) - .with('Unsupported', () => z.never()) - .exhaustive() - ); + + if (forFilter) { + options.push(z.instanceof(AnyNullClass)); + } + + const schema = z.union([ + ...options, + z.lazy(() => z.union([this.makeJsonValueSchema(false, false), z.null()]).array()), + z.record( + z.string(), + z.lazy(() => z.union([this.makeJsonValueSchema(false, false), z.null()])), + ), + ]); + return this.nullableIf(schema, nullable); } - private makeTypeDefFilterSchema(_type: string, _optional: boolean) { - // TODO: strong typed JSON filtering - return z.never(); + private makeJsonFilterSchema(optional: boolean) { + const valueSchema = this.makeJsonValueSchema(optional, true); + return z.strictObject({ + path: z.string().optional(), + equals: valueSchema.optional(), + not: valueSchema.optional(), + string_contains: z.string().optional(), + string_starts_with: z.string().optional(), + string_ends_with: z.string().optional(), + mode: this.makeStringModeSchema().optional(), + array_contains: valueSchema.optional(), + array_starts_with: valueSchema.optional(), + array_ends_with: valueSchema.optional(), + }); } private makeDateTimeFilterSchema(optional: boolean, withAggregations: boolean): ZodType { return this.makeCommonPrimitiveFilterSchema( - z.union([z.string().datetime(), z.date()]), + z.union([z.iso.datetime(), z.date()]), optional, () => z.lazy(() => this.makeDateTimeFilterSchema(optional, withAggregations)), withAggregations ? ['_count', '_min', '_max'] : undefined, @@ -977,7 +1098,7 @@ export class InputValidator { uncheckedVariantFields[field] = fieldSchema; } } else { - let fieldSchema: ZodType = this.makePrimitiveSchema(fieldDef.type, fieldDef.attributes); + let fieldSchema = this.makeScalarSchema(fieldDef.type, fieldDef.attributes); if (fieldDef.array) { fieldSchema = addListValidation(fieldSchema.array(), fieldDef.attributes); @@ -996,7 +1117,12 @@ export class InputValidator { } if (fieldDef.optional) { - fieldSchema = fieldSchema.nullable(); + if (fieldDef.type === 'Json') { + // DbNull for Json fields + fieldSchema = z.union([fieldSchema, z.instanceof(DbNullClass)]); + } else { + fieldSchema = fieldSchema.nullable(); + } } uncheckedVariantFields[field] = fieldSchema; @@ -1061,7 +1187,7 @@ export class InputValidator { fields['update'] = array ? this.orArray( z.strictObject({ - where: this.makeWhereSchema(fieldType, true).optional(), + where: this.makeWhereSchema(fieldType, true), data: this.makeUpdateDataSchema(fieldType, withoutFields), }), true, @@ -1069,7 +1195,7 @@ export class InputValidator { : z .union([ z.strictObject({ - where: this.makeWhereSchema(fieldType, true).optional(), + where: this.makeWhereSchema(fieldType, false).optional(), data: this.makeUpdateDataSchema(fieldType, withoutFields), }), this.makeUpdateDataSchema(fieldType, withoutFields), @@ -1242,7 +1368,7 @@ export class InputValidator { uncheckedVariantFields[field] = fieldSchema; } } else { - let fieldSchema: ZodType = this.makePrimitiveSchema(fieldDef.type, fieldDef.attributes); + let fieldSchema = this.makeScalarSchema(fieldDef.type, fieldDef.attributes); if (this.isNumericField(fieldDef)) { fieldSchema = z.union([ @@ -1276,7 +1402,12 @@ export class InputValidator { } if (fieldDef.optional) { - fieldSchema = fieldSchema.nullable(); + if (fieldDef.type === 'Json') { + // DbNull for Json fields + fieldSchema = z.union([fieldSchema, z.instanceof(DbNullClass)]); + } else { + fieldSchema = fieldSchema.nullable(); + } } // all fields are optional in update diff --git a/packages/orm/src/client/crud/validator/utils.ts b/packages/orm/src/client/crud/validator/utils.ts index 657ab8049..bbd35900e 100644 --- a/packages/orm/src/client/crud/validator/utils.ts +++ b/packages/orm/src/client/crud/validator/utils.ts @@ -22,7 +22,10 @@ function getArgValue(expr: Expression | und return expr.value as T; } -export function addStringValidation(schema: z.ZodString, attributes: AttributeApplication[] | undefined): z.ZodSchema { +export function addStringValidation( + schema: z.ZodString, + attributes: readonly AttributeApplication[] | undefined, +): z.ZodSchema { if (!attributes || attributes.length === 0) { return schema; } @@ -86,7 +89,10 @@ export function addStringValidation(schema: z.ZodString, attributes: AttributeAp return result; } -export function addNumberValidation(schema: z.ZodNumber, attributes: AttributeApplication[] | undefined): z.ZodSchema { +export function addNumberValidation( + schema: z.ZodNumber, + attributes: readonly AttributeApplication[] | undefined, +): z.ZodSchema { if (!attributes || attributes.length === 0) { return schema; } @@ -114,7 +120,10 @@ export function addNumberValidation(schema: z.ZodNumber, attributes: AttributeAp return result; } -export function addBigIntValidation(schema: z.ZodBigInt, attributes: AttributeApplication[] | undefined): z.ZodSchema { +export function addBigIntValidation( + schema: z.ZodBigInt, + attributes: readonly AttributeApplication[] | undefined, +): z.ZodSchema { if (!attributes || attributes.length === 0) { return schema; } @@ -145,7 +154,7 @@ export function addBigIntValidation(schema: z.ZodBigInt, attributes: AttributeAp export function addDecimalValidation( schema: z.ZodType | z.ZodString, - attributes: AttributeApplication[] | undefined, + attributes: readonly AttributeApplication[] | undefined, addExtraValidation: boolean, ): z.ZodSchema { let result: z.ZodSchema = schema; @@ -224,7 +233,7 @@ export function addDecimalValidation( export function addListValidation( schema: z.ZodArray, - attributes: AttributeApplication[] | undefined, + attributes: readonly AttributeApplication[] | undefined, ): z.ZodSchema { if (!attributes || attributes.length === 0) { return schema; @@ -248,7 +257,10 @@ export function addListValidation( return result; } -export function addCustomValidation(schema: z.ZodSchema, attributes: AttributeApplication[] | undefined): z.ZodSchema { +export function addCustomValidation( + schema: z.ZodSchema, + attributes: readonly AttributeApplication[] | undefined, +): z.ZodSchema { const attrs = attributes?.filter((a) => a.name === '@@validate'); if (!attrs || attrs.length === 0) { return schema; diff --git a/packages/orm/src/client/functions.ts b/packages/orm/src/client/functions.ts index 3f1bc8060..5690a1e45 100644 --- a/packages/orm/src/client/functions.ts +++ b/packages/orm/src/client/functions.ts @@ -1,5 +1,5 @@ import { invariant, lowerCaseFirst, upperCaseFirst } from '@zenstackhq/common-helpers'; -import { sql, ValueNode, type BinaryOperator, type Expression, type ExpressionBuilder } from 'kysely'; +import { sql, ValueNode, type BinaryOperator, type Expression, type ExpressionBuilder, type SqlBool } from 'kysely'; import { match } from 'ts-pattern'; import type { ZModelFunction, ZModelFunctionContext } from './options'; @@ -53,13 +53,16 @@ const textMatch = ( op = 'like'; } + // escape special characters in search string + const escapedSearch = sql`REPLACE(REPLACE(REPLACE(CAST(${searchExpr} as text), '\\', '\\\\'), '%', '\\%'), '_', '\\_')`; + searchExpr = match(method) - .with('contains', () => eb.fn('CONCAT', [sql.lit('%'), sql`CAST(${searchExpr} as text)`, sql.lit('%')])) - .with('startsWith', () => eb.fn('CONCAT', [sql`CAST(${searchExpr} as text)`, sql.lit('%')])) - .with('endsWith', () => eb.fn('CONCAT', [sql.lit('%'), sql`CAST(${searchExpr} as text)`])) + .with('contains', () => eb.fn('CONCAT', [sql.lit('%'), escapedSearch, sql.lit('%')])) + .with('startsWith', () => eb.fn('CONCAT', [escapedSearch, sql.lit('%')])) + .with('endsWith', () => eb.fn('CONCAT', [sql.lit('%'), escapedSearch])) .exhaustive(); - return eb(fieldExpr, op, searchExpr); + return sql`${fieldExpr} ${sql.raw(op)} ${searchExpr} escape '\\'`; }; export const has: ZModelFunction = (eb, args) => { diff --git a/packages/orm/src/client/helpers/schema-db-pusher.ts b/packages/orm/src/client/helpers/schema-db-pusher.ts index f04c14e19..01b265c46 100644 --- a/packages/orm/src/client/helpers/schema-db-pusher.ts +++ b/packages/orm/src/client/helpers/schema-db-pusher.ts @@ -115,9 +115,9 @@ export class SchemaDbPusher { const baseModelDef = requireModel(this.schema, modelDef.baseModel); table = table.addForeignKeyConstraint( `fk_${modelDef.baseModel}_delegate`, - baseModelDef.idFields, + baseModelDef.idFields as string[], modelDef.baseModel, - baseModelDef.idFields, + baseModelDef.idFields as string[], (cb) => cb.onDelete('cascade').onUpdate('cascade'), ); } diff --git a/packages/orm/src/client/query-utils.ts b/packages/orm/src/client/query-utils.ts index 9797584cd..adeabd5d5 100644 --- a/packages/orm/src/client/query-utils.ts +++ b/packages/orm/src/client/query-utils.ts @@ -37,6 +37,14 @@ export function requireModel(schema: SchemaDef, model: string) { return modelDef; } +export function requireTypeDef(schema: SchemaDef, type: string) { + const typeDef = getTypeDef(schema, type); + if (!typeDef) { + throw createInternalError(`Type "${type}" not found in schema`, type); + } + return typeDef; +} + export function getField(schema: SchemaDef, model: string, field: string) { const modelDef = getModel(schema, model); return modelDef?.fields[field]; @@ -190,6 +198,10 @@ export function getEnum(schema: SchemaDef, type: string) { return schema.enums?.[type]; } +export function isTypeDef(schema: SchemaDef, type: string) { + return !!schema.typeDefs?.[type]; +} + export function buildJoinPairs( schema: SchemaDef, model: string, diff --git a/packages/orm/src/common-types.ts b/packages/orm/src/common-types.ts new file mode 100644 index 000000000..39caafb69 --- /dev/null +++ b/packages/orm/src/common-types.ts @@ -0,0 +1,25 @@ +export type JsonValue = string | number | boolean | JsonObject | JsonArray; +export type JsonObject = { [key: string]: JsonValue | null }; +export type JsonArray = ReadonlyArray; +export type JsonNullValues = DbNull | JsonNull | AnyNull; + +export class DbNullClass { + // @ts-ignore + private __brand = 'DbNull' as const; +} +export const DbNull = new DbNullClass(); +export type DbNull = typeof DbNull; + +export class JsonNullClass { + // @ts-ignore + private __brand = 'JsonNull' as const; +} +export const JsonNull = new JsonNullClass(); +export type JsonNull = typeof JsonNull; + +export class AnyNullClass { + // @ts-ignore + private __brand = 'AnyNull' as const; +} +export const AnyNull = new AnyNullClass(); +export type AnyNull = typeof AnyNull; diff --git a/packages/orm/src/index.ts b/packages/orm/src/index.ts index cff4960f1..8fa6615cc 100644 --- a/packages/orm/src/index.ts +++ b/packages/orm/src/index.ts @@ -1,4 +1,4 @@ export * from './client'; +export * from './common-types'; export * as KyselyUtils from './utils/kysely-utils'; export * as SchemaUtils from './utils/schema-utils'; -export type { JsonArray, JsonObject, JsonValue } from './utils/type-utils'; diff --git a/packages/orm/src/utils/object-utils.ts b/packages/orm/src/utils/object-utils.ts index e05ebe5d9..ba9a0886d 100644 --- a/packages/orm/src/utils/object-utils.ts +++ b/packages/orm/src/utils/object-utils.ts @@ -1,13 +1,13 @@ /** * Extract fields from an object. */ -export function extractFields(obj: any, fields: string[]) { +export function extractFields(obj: any, fields: readonly string[]) { return Object.fromEntries(Object.entries(obj).filter(([key]) => fields.includes(key))); } /** * Create an object with fields as keys and true values. */ -export function fieldsToSelectObject(fields: string[]): Record { +export function fieldsToSelectObject(fields: readonly string[]): Record { return Object.fromEntries(fields.map((f) => [f, true])); } diff --git a/packages/orm/src/utils/type-utils.ts b/packages/orm/src/utils/type-utils.ts index 26828cf69..4c671275c 100644 --- a/packages/orm/src/utils/type-utils.ts +++ b/packages/orm/src/utils/type-utils.ts @@ -1,4 +1,5 @@ import type Decimal from 'decimal.js'; +import type { JsonObject, JsonValue } from '../common-types'; export type Optional = Omit & Partial>; @@ -44,11 +45,6 @@ type TypeMap = { export type MapBaseType = T extends keyof TypeMap ? TypeMap[T] : unknown; -export type JsonValue = string | number | boolean | null | JsonObject | JsonArray; - -export type JsonObject = { [key: string]: JsonValue }; -export type JsonArray = Array; - export function call(code: string) { return { code }; } diff --git a/packages/plugins/policy/package.json b/packages/plugins/policy/package.json index 66348a854..6c77e09dc 100644 --- a/packages/plugins/policy/package.json +++ b/packages/plugins/policy/package.json @@ -1,6 +1,6 @@ { "name": "@zenstackhq/plugin-policy", - "version": "3.0.0-beta.27", + "version": "3.0.0-beta.28", "description": "ZenStack Policy Plugin", "type": "module", "scripts": { diff --git a/packages/schema/package.json b/packages/schema/package.json index dabb3d566..04853b153 100644 --- a/packages/schema/package.json +++ b/packages/schema/package.json @@ -1,6 +1,6 @@ { "name": "@zenstackhq/schema", - "version": "3.0.0-beta.27", + "version": "3.0.0-beta.28", "description": "ZenStack Runtime Schema", "type": "module", "scripts": { diff --git a/packages/schema/src/schema.ts b/packages/schema/src/schema.ts index abc98acee..83640c357 100644 --- a/packages/schema/src/schema.ts +++ b/packages/schema/src/schema.ts @@ -22,7 +22,7 @@ export type ModelDef = { name: string; baseModel?: string; fields: Record; - attributes?: AttributeApplication[]; + attributes?: readonly AttributeApplication[]; uniqueFields: Record< string, // singular unique field @@ -30,16 +30,16 @@ export type ModelDef = { // compound unique field | Record> >; - idFields: string[]; + idFields: readonly string[]; computedFields?: Record; isDelegate?: boolean; - subModels?: string[]; + subModels?: readonly string[]; isView?: boolean; }; export type AttributeApplication = { name: string; - args?: AttributeArg[]; + args?: readonly AttributeArg[]; }; export type AttributeArg = { @@ -51,8 +51,8 @@ export type CascadeAction = 'SetNull' | 'Cascade' | 'Restrict' | 'NoAction' | 'S export type RelationInfo = { name?: string; - fields?: string[]; - references?: string[]; + fields?: readonly string[]; + references?: readonly string[]; hasDefault?: boolean; opposite?: string; onDelete?: CascadeAction; @@ -67,11 +67,11 @@ export type FieldDef = { optional?: boolean; unique?: boolean; updatedAt?: boolean; - attributes?: AttributeApplication[]; - default?: MappedBuiltinType | Expression | unknown[]; + attributes?: readonly AttributeApplication[]; + default?: MappedBuiltinType | Expression | readonly unknown[]; omit?: boolean; relation?: RelationInfo; - foreignKeyFor?: string[]; + foreignKeyFor?: readonly string[]; computed?: boolean; originModel?: string; isDiscriminator?: boolean; @@ -101,19 +101,19 @@ export type MappedBuiltinType = string | boolean | number | bigint | Decimal | D export type EnumField = { name: string; - attributes?: AttributeApplication[]; + attributes?: readonly AttributeApplication[]; }; export type EnumDef = { fields?: Record; values: Record; - attributes?: AttributeApplication[]; + attributes?: readonly AttributeApplication[]; }; export type TypeDefDef = { name: string; fields: Record; - attributes?: AttributeApplication[]; + attributes?: readonly AttributeApplication[]; }; //#region Extraction @@ -127,7 +127,7 @@ export type GetDelegateModels = keyof { export type GetSubModels> = GetModel< Schema, Model ->['subModels'] extends string[] +>['subModels'] extends readonly string[] ? Extract['subModels'][number], GetModels> : never; @@ -180,6 +180,12 @@ export type GetTypeDefField< Field extends GetTypeDefFields, > = GetTypeDef['fields'][Field]; +export type GetTypeDefFieldType< + Schema extends SchemaDef, + TypeDef extends GetTypeDefs, + Field extends GetTypeDefFields, +> = GetTypeDef['fields'][Field]['type']; + export type ScalarFields< Schema extends SchemaDef, Model extends GetModels, @@ -187,7 +193,7 @@ export type ScalarFields< > = keyof { [Key in GetModelFields as GetModelField['relation'] extends object ? never - : GetModelField['foreignKeyFor'] extends string[] + : GetModelField['foreignKeyFor'] extends readonly string[] ? never : IncludeComputed extends true ? Key @@ -197,7 +203,11 @@ export type ScalarFields< }; export type ForeignKeyFields> = keyof { - [Key in GetModelFields as GetModelField['foreignKeyFor'] extends string[] + [Key in GetModelFields as GetModelField< + Schema, + Model, + Key + >['foreignKeyFor'] extends readonly string[] ? Key : never]: Key; }; diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 5ff02b7db..c2a123367 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@zenstackhq/sdk", - "version": "3.0.0-beta.27", + "version": "3.0.0-beta.28", "description": "ZenStack SDK", "type": "module", "scripts": { diff --git a/packages/sdk/src/ts-schema-generator.ts b/packages/sdk/src/ts-schema-generator.ts index 780817aaa..9620ca671 100644 --- a/packages/sdk/src/ts-schema-generator.ts +++ b/packages/sdk/src/ts-schema-generator.ts @@ -115,14 +115,14 @@ export class TsSchemaGenerator { ); // Generate schema content first to determine if ExpressionUtils is needed - const schemaObject = this.createSchemaObject(model, lite); + const schemaClass = this.createSchemaClass(model, lite); // Now generate the import declaration with the correct imports // import { type SchemaDef, type OperandExpression, ExpressionUtils } from '@zenstackhq/orm/schema'; const runtimeImportDecl = ts.factory.createImportDeclaration( undefined, ts.factory.createImportClause( - false, + undefined, undefined, ts.factory.createNamedImports([ ts.factory.createImportSpecifier(true, undefined, ts.factory.createIdentifier('SchemaDef')), @@ -150,71 +150,24 @@ export class TsSchemaGenerator { ); statements.push(runtimeImportDecl); - // const _schema = { ... } as const satisfies SchemaDef; - const _schemaDecl = ts.factory.createVariableStatement( - [], - ts.factory.createVariableDeclarationList( - [ - ts.factory.createVariableDeclaration( - '_schema', - undefined, - undefined, - ts.factory.createSatisfiesExpression( - ts.factory.createAsExpression(schemaObject, ts.factory.createTypeReferenceNode('const')), - ts.factory.createTypeReferenceNode('SchemaDef'), - ), - ), - ], - ts.NodeFlags.Const, - ), - ); - statements.push(_schemaDecl); + statements.push(schemaClass); - // type Schema = typeof _schema & { __brand?: 'schema' }; - // use a branded type to prevent typescript compiler from expanding the schema type - const brandedSchemaType = ts.factory.createTypeAliasDeclaration( - undefined, - 'Schema', - undefined, - ts.factory.createIntersectionTypeNode([ - ts.factory.createTypeQueryNode(ts.factory.createIdentifier('_schema')), - ts.factory.createTypeLiteralNode([ - ts.factory.createPropertySignature( - undefined, - '__brand', - ts.factory.createToken(ts.SyntaxKind.QuestionToken), - ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral('schema')), - ), - ]), - ]), - ); - statements.push(brandedSchemaType); - - // export const schema: Schema = _schema; - const schemaExportDecl = ts.factory.createVariableStatement( + // export const schema = new SchemaType(); + const schemaDecl = ts.factory.createVariableStatement( [ts.factory.createModifier(ts.SyntaxKind.ExportKeyword)], ts.factory.createVariableDeclarationList( [ ts.factory.createVariableDeclaration( 'schema', undefined, - ts.factory.createTypeReferenceNode('Schema'), - ts.factory.createIdentifier('_schema'), + undefined, + ts.factory.createNewExpression(ts.factory.createIdentifier('SchemaType'), undefined, []), ), ], ts.NodeFlags.Const, ), ); - statements.push(schemaExportDecl); - - // export type SchemaType = Schema; - const schemaTypeDeclaration = ts.factory.createTypeAliasDeclaration( - [ts.factory.createModifier(ts.SyntaxKind.ExportKeyword)], - 'SchemaType', - undefined, - ts.factory.createTypeReferenceNode('Schema'), - ); - statements.push(schemaTypeDeclaration); + statements.push(schemaDecl); } private createExpressionUtilsCall(method: string, args?: ts.Expression[]): ts.CallExpression { @@ -226,29 +179,54 @@ export class TsSchemaGenerator { ); } - private createSchemaObject(model: Model, lite: boolean): ts.Expression { - const properties: ts.PropertyAssignment[] = [ + private createSchemaClass(model: Model, lite: boolean) { + const members: ts.ClassElement[] = [ // provider - ts.factory.createPropertyAssignment('provider', this.createProviderObject(model)), + ts.factory.createPropertyDeclaration( + undefined, + 'provider', + undefined, + undefined, + this.createAsConst(this.createProviderObject(model)), + ), // models - ts.factory.createPropertyAssignment('models', this.createModelsObject(model, lite)), + ts.factory.createPropertyDeclaration( + undefined, + 'models', + undefined, + undefined, + this.createAsConst(this.createModelsObject(model, lite)), + ), // typeDefs ...(model.declarations.some(isTypeDef) - ? [ts.factory.createPropertyAssignment('typeDefs', this.createTypeDefsObject(model, lite))] + ? [ + ts.factory.createPropertyDeclaration( + undefined, + 'typeDefs', + undefined, + undefined, + this.createAsConst(this.createTypeDefsObject(model, lite)), + ), + ] : []), ]; // enums const enums = model.declarations.filter(isEnum); if (enums.length > 0) { - properties.push( - ts.factory.createPropertyAssignment( + members.push( + ts.factory.createPropertyDeclaration( + undefined, 'enums', - ts.factory.createObjectLiteralExpression( - enums.map((e) => ts.factory.createPropertyAssignment(e.name, this.createEnumObject(e))), - true, + undefined, + undefined, + this.createAsConst( + ts.factory.createObjectLiteralExpression( + enums.map((e) => ts.factory.createPropertyAssignment(e.name, this.createEnumObject(e))), + true, + ), ), ), ); @@ -257,21 +235,59 @@ export class TsSchemaGenerator { // authType const authType = getAuthDecl(model); if (authType) { - properties.push(ts.factory.createPropertyAssignment('authType', this.createLiteralNode(authType.name))); + members.push( + ts.factory.createPropertyDeclaration( + undefined, + 'authType', + undefined, + undefined, + this.createAsConst(this.createLiteralNode(authType.name)), + ), + ); } // procedures const procedures = model.declarations.filter(isProcedure); if (procedures.length > 0) { - properties.push(ts.factory.createPropertyAssignment('procedures', this.createProceduresObject(procedures))); + members.push( + ts.factory.createPropertyDeclaration( + undefined, + 'procedures', + undefined, + undefined, + this.createAsConst(this.createProceduresObject(procedures)), + ), + ); } // plugins - properties.push( - ts.factory.createPropertyAssignment('plugins', ts.factory.createObjectLiteralExpression([], true)), + members.push( + ts.factory.createPropertyDeclaration( + undefined, + 'plugins', + undefined, + undefined, + ts.factory.createObjectLiteralExpression([], true), + ), ); - return ts.factory.createObjectLiteralExpression(properties, true); + const schemaClass = ts.factory.createClassDeclaration( + [ts.factory.createModifier(ts.SyntaxKind.ExportKeyword)], + 'SchemaType', + undefined, + [ + ts.factory.createHeritageClause(ts.SyntaxKind.ImplementsKeyword, [ + ts.factory.createExpressionWithTypeArguments(ts.factory.createIdentifier('SchemaDef'), undefined), + ]), + ], + members, + ); + + return schemaClass; + } + + private createAsConst(expr: ts.Expression) { + return ts.factory.createAsExpression(expr, ts.factory.createTypeReferenceNode('const')); } private createProviderObject(model: Model): ts.Expression { diff --git a/packages/server/package.json b/packages/server/package.json index 435584429..2f65b2e01 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,6 +1,6 @@ { "name": "@zenstackhq/server", - "version": "3.0.0-beta.27", + "version": "3.0.0-beta.28", "description": "ZenStack automatic CRUD API handlers and server adapters", "type": "module", "scripts": { diff --git a/packages/testtools/package.json b/packages/testtools/package.json index 453852c10..b507320d9 100644 --- a/packages/testtools/package.json +++ b/packages/testtools/package.json @@ -1,6 +1,6 @@ { "name": "@zenstackhq/testtools", - "version": "3.0.0-beta.27", + "version": "3.0.0-beta.28", "description": "ZenStack Test Tools", "type": "module", "scripts": { @@ -37,7 +37,7 @@ "@zenstackhq/orm": "workspace:*", "@zenstackhq/sdk": "workspace:*", "@zenstackhq/plugin-policy": "workspace:*", - "glob": "^11.0.2", + "glob": "^11.1.0", "kysely": "catalog:", "prisma": "catalog:", "tmp": "catalog:", diff --git a/packages/testtools/src/client.ts b/packages/testtools/src/client.ts index 1defaeaff..cd6be7472 100644 --- a/packages/testtools/src/client.ts +++ b/packages/testtools/src/client.ts @@ -157,6 +157,7 @@ export async function createTestClient( if (options?.debug) { console.log(`Work directory: ${workDir}`); + console.log(`Database name: ${dbName}`); _options.log = testLogger; } diff --git a/packages/zod/package.json b/packages/zod/package.json index 03b734a0e..704d15d37 100644 --- a/packages/zod/package.json +++ b/packages/zod/package.json @@ -1,6 +1,6 @@ { "name": "@zenstackhq/zod", - "version": "3.0.0-beta.27", + "version": "3.0.0-beta.28", "description": "", "type": "module", "main": "index.js", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8173908af..686c2bc1d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,8 +25,8 @@ catalogs: specifier: ^0.2.6 version: 0.2.6 better-sqlite3: - specifier: ^12.2.0 - version: 12.2.0 + specifier: ^12.5.0 + version: 12.5.0 decimal.js: specifier: ^10.4.3 version: 10.6.0 @@ -90,8 +90,8 @@ importers: specifier: ~9.29.0 version: 9.29.0(jiti@2.6.1) glob: - specifier: ^11.0.2 - version: 11.0.2 + specifier: ^11.1.0 + version: 11.1.0 prettier: specifier: ^3.5.3 version: 3.5.3 @@ -219,7 +219,7 @@ importers: version: link:../config/vitest-config better-sqlite3: specifier: 'catalog:' - version: 12.2.0 + version: 12.5.0 tmp: specifier: 'catalog:' version: 0.2.3 @@ -384,8 +384,8 @@ importers: specifier: workspace:* version: link:../config/vitest-config glob: - specifier: ^11.0.2 - version: 11.0.2 + specifier: ^11.1.0 + version: 11.1.0 langium-cli: specifier: 'catalog:' version: 3.5.0 @@ -406,7 +406,7 @@ importers: version: link:../schema better-sqlite3: specifier: 'catalog:' - version: 12.2.0 + version: 12.5.0 decimal.js: specifier: 'catalog:' version: 10.6.0 @@ -621,7 +621,7 @@ importers: version: 16.0.7(@babel/core@7.28.5)(react-dom@19.2.0(react@19.2.0))(react@19.2.0) nuxt: specifier: ^4.2.0 - version: 4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.9.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1) + version: 4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.5.0)(db0@0.3.4(better-sqlite3@12.5.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.5.0)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.9.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1) supertest: specifier: ^7.1.4 version: 7.1.4 @@ -651,10 +651,10 @@ importers: version: link:../sdk better-sqlite3: specifier: 'catalog:' - version: 12.2.0 + version: 12.5.0 glob: - specifier: ^11.0.2 - version: 11.0.2 + specifier: ^11.1.0 + version: 11.1.0 kysely: specifier: 'catalog:' version: 0.28.8 @@ -728,7 +728,7 @@ importers: version: link:../../packages/clients/tanstack-query better-sqlite3: specifier: 'catalog:' - version: 12.2.0 + version: 12.5.0 kysely: specifier: 'catalog:' version: 0.28.8 @@ -786,7 +786,7 @@ importers: version: link:../../packages/plugins/policy better-sqlite3: specifier: 'catalog:' - version: 12.2.0 + version: 12.5.0 kysely: specifier: 'catalog:' version: 0.28.8 @@ -832,7 +832,7 @@ importers: version: link:../../packages/testtools better-sqlite3: specifier: 'catalog:' - version: 12.2.0 + version: 12.5.0 decimal.js: specifier: 'catalog:' version: 10.6.0 @@ -1708,6 +1708,14 @@ packages: '@ioredis/commands@1.4.0': resolution: {integrity: sha512-aFT2yemJJo+TZCmieA7qnYGQooOS7QfNmYrzGtsYd3g9j5iDP8AimYYAesf79ohjbLG12XxC4nG5DyEnC88AsQ==} + '@isaacs/balanced-match@4.0.1': + resolution: {integrity: sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==} + engines: {node: 20 || >=22} + + '@isaacs/brace-expansion@5.0.0': + resolution: {integrity: sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==} + engines: {node: 20 || >=22} + '@isaacs/cliui@8.0.2': resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} @@ -3650,9 +3658,9 @@ packages: better-call@1.0.19: resolution: {integrity: sha512-sI3GcA1SCVa3H+CDHl8W8qzhlrckwXOTKhqq3OOPXjgn5aTOMIqGY34zLY/pHA6tRRMjTUC3lz5Mi7EbDA24Kw==} - better-sqlite3@12.2.0: - resolution: {integrity: sha512-eGbYq2CT+tos1fBwLQ/tkBt9J5M3JEHjku4hbvQUePCckkvVf14xWj+1m7dGoK81M/fOjFT7yM9UMeKT/+vFLQ==} - engines: {node: 20.x || 22.x || 23.x || 24.x} + better-sqlite3@12.5.0: + resolution: {integrity: sha512-WwCZ/5Diz7rsF29o27o0Gcc1Du+l7Zsv7SYtVPG0X3G/uUI1LqdxrQI7c9Hs2FWpqXXERjW9hp6g3/tH7DlVKg==} + engines: {node: 20.x || 22.x || 23.x || 24.x || 25.x} bidi-js@1.0.3: resolution: {integrity: sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==} @@ -4738,8 +4746,8 @@ packages: resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==} hasBin: true - glob@11.0.2: - resolution: {integrity: sha512-YT7U7Vye+t5fZ/QMkBFrTJ7ZQxInIUjwyAjVj84CYXqgBdv30MFUPGnBR6sQaVq6Is15wYJUsnzTuWaGRBhBAQ==} + glob@11.1.0: + resolution: {integrity: sha512-vuNwKSaKiqm7g0THUBu2x7ckSs3XJLXE+2ssL7/MfTGPLLcrJQ/4Uq1CjPTtO5cCIiRxqvN6Twy1qOwhL0Xjcw==} engines: {node: 20 || >=22} hasBin: true @@ -5140,8 +5148,8 @@ packages: jackspeak@3.4.3: resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} - jackspeak@4.1.0: - resolution: {integrity: sha512-9DDdhb5j6cpeitCbvLO7n7J4IxnbM6hoF6O1g4HQ5TfhvvKN8ywDM7668ZhMHRqVmxqhps/F6syWK2KcPxYlkw==} + jackspeak@4.1.1: + resolution: {integrity: sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ==} engines: {node: 20 || >=22} jiti@2.6.1: @@ -5420,10 +5428,6 @@ packages: lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} - lru-cache@11.1.0: - resolution: {integrity: sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A==} - engines: {node: 20 || >=22} - lru-cache@11.2.2: resolution: {integrity: sha512-F9ODfyqML2coTIsQpSkRHnLSZMtkU8Q+mSfcaIyKwy58u+8k5nvAYeiNhsyMARvzNcXJ9QfWVrcPsC9e9rAxtg==} engines: {node: 20 || >=22} @@ -5533,8 +5537,8 @@ packages: resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} engines: {node: '>=10'} - minimatch@10.0.1: - resolution: {integrity: sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==} + minimatch@10.1.1: + resolution: {integrity: sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==} engines: {node: 20 || >=22} minimatch@3.1.2: @@ -7976,10 +7980,10 @@ snapshots: '@csstools/css-tokenizer@3.0.4': optional: true - '@dxup/nuxt@0.2.0(magicast@0.3.5)': + '@dxup/nuxt@0.2.0(magicast@0.5.0)': dependencies: '@dxup/unimport': 0.1.0 - '@nuxt/kit': 4.2.0(magicast@0.3.5) + '@nuxt/kit': 4.2.0(magicast@0.5.0) chokidar: 4.0.3 pathe: 2.0.3 tinyglobby: 0.2.15 @@ -8340,6 +8344,12 @@ snapshots: '@ioredis/commands@1.4.0': {} + '@isaacs/balanced-match@4.0.1': {} + + '@isaacs/brace-expansion@5.0.0': + dependencies: + '@isaacs/balanced-match': 4.0.1 + '@isaacs/cliui@8.0.2': dependencies: string-width: 5.1.2 @@ -8488,9 +8498,9 @@ snapshots: '@nolyfill/is-core-module@1.0.39': {} - '@nuxt/cli@3.29.3(magicast@0.3.5)': + '@nuxt/cli@3.29.3(magicast@0.5.0)': dependencies: - c12: 3.3.1(magicast@0.3.5) + c12: 3.3.1(magicast@0.5.0) citty: 0.1.6 clipboardy: 5.0.0 confbox: 0.2.2 @@ -8608,9 +8618,35 @@ snapshots: transitivePeerDependencies: - magicast - '@nuxt/kit@4.2.0(magicast@0.3.5)': + '@nuxt/kit@3.20.0(magicast@0.5.0)': dependencies: - c12: 3.3.1(magicast@0.3.5) + c12: 3.3.1(magicast@0.5.0) + consola: 3.4.2 + defu: 6.1.4 + destr: 2.0.5 + errx: 0.1.0 + exsolve: 1.0.7 + ignore: 7.0.5 + jiti: 2.6.1 + klona: 2.0.6 + knitwork: 1.2.0 + mlly: 1.8.0 + ohash: 2.0.11 + pathe: 2.0.3 + pkg-types: 2.3.0 + rc9: 2.1.2 + scule: 1.3.0 + semver: 7.7.3 + tinyglobby: 0.2.15 + ufo: 1.6.1 + unctx: 2.4.1 + untyped: 2.0.0 + transitivePeerDependencies: + - magicast + + '@nuxt/kit@4.2.0(magicast@0.5.0)': + dependencies: + c12: 3.3.1(magicast@0.5.0) consola: 3.4.2 defu: 6.1.4 destr: 2.0.5 @@ -8633,10 +8669,10 @@ snapshots: transitivePeerDependencies: - magicast - '@nuxt/nitro-server@4.2.0(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(ioredis@5.8.2)(magicast@0.3.5)(nuxt@4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.9.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1))(typescript@5.9.3)': + '@nuxt/nitro-server@4.2.0(better-sqlite3@12.5.0)(db0@0.3.4(better-sqlite3@12.5.0))(ioredis@5.8.2)(magicast@0.5.0)(nuxt@4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.5.0)(db0@0.3.4(better-sqlite3@12.5.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.5.0)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.9.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1))(typescript@5.9.3)': dependencies: '@nuxt/devalue': 2.0.2 - '@nuxt/kit': 4.2.0(magicast@0.3.5) + '@nuxt/kit': 4.2.0(magicast@0.5.0) '@unhead/vue': 2.0.19(vue@3.5.22(typescript@5.9.3)) '@vue/shared': 3.5.22 consola: 3.4.2 @@ -8650,15 +8686,15 @@ snapshots: impound: 1.0.0 klona: 2.0.6 mocked-exports: 0.1.1 - nitropack: 2.12.9(better-sqlite3@12.2.0) - nuxt: 4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.9.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1) + nitropack: 2.12.9(better-sqlite3@12.5.0) + nuxt: 4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.5.0)(db0@0.3.4(better-sqlite3@12.5.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.5.0)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.9.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1) pathe: 2.0.3 pkg-types: 2.3.0 radix3: 1.1.2 std-env: 3.10.0 ufo: 1.6.1 unctx: 2.4.1 - unstorage: 1.17.1(db0@0.3.4(better-sqlite3@12.2.0))(ioredis@5.8.2) + unstorage: 1.17.1(db0@0.3.4(better-sqlite3@12.5.0))(ioredis@5.8.2) vue: 3.5.22(typescript@5.9.3) vue-bundle-renderer: 2.2.0 vue-devtools-stub: 0.1.0 @@ -8705,9 +8741,9 @@ snapshots: pkg-types: 2.3.0 std-env: 3.10.0 - '@nuxt/telemetry@2.6.6(magicast@0.3.5)': + '@nuxt/telemetry@2.6.6(magicast@0.5.0)': dependencies: - '@nuxt/kit': 3.20.0(magicast@0.3.5) + '@nuxt/kit': 3.20.0(magicast@0.5.0) citty: 0.1.6 consola: 3.4.2 destr: 2.0.5 @@ -8722,9 +8758,9 @@ snapshots: transitivePeerDependencies: - magicast - '@nuxt/vite-builder@4.2.0(@types/node@20.19.24)(eslint@9.29.0(jiti@2.6.1))(lightningcss@1.30.2)(magicast@0.3.5)(nuxt@4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.9.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1))(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.9.3)(vue@3.5.22(typescript@5.9.3))(yaml@2.8.1)': + '@nuxt/vite-builder@4.2.0(@types/node@20.19.24)(eslint@9.29.0(jiti@2.6.1))(lightningcss@1.30.2)(magicast@0.5.0)(nuxt@4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.5.0)(db0@0.3.4(better-sqlite3@12.5.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.5.0)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.9.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1))(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.9.3)(vue@3.5.22(typescript@5.9.3))(yaml@2.8.1)': dependencies: - '@nuxt/kit': 4.2.0(magicast@0.3.5) + '@nuxt/kit': 4.2.0(magicast@0.5.0) '@rollup/plugin-replace': 6.0.3(rollup@4.52.5) '@vitejs/plugin-vue': 6.0.1(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(vue@3.5.22(typescript@5.9.3)) '@vitejs/plugin-vue-jsx': 5.1.1(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(vue@3.5.22(typescript@5.9.3)) @@ -8742,7 +8778,7 @@ snapshots: magic-string: 0.30.21 mlly: 1.8.0 mocked-exports: 0.1.1 - nuxt: 4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.9.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1) + nuxt: 4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.5.0)(db0@0.3.4(better-sqlite3@12.5.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.5.0)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.9.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1) pathe: 2.0.3 pkg-types: 2.3.0 postcss: 8.5.6 @@ -10458,7 +10494,7 @@ snapshots: set-cookie-parser: 2.7.2 uncrypto: 0.1.3 - better-sqlite3@12.2.0: + better-sqlite3@12.5.0: dependencies: bindings: 1.5.0 prebuild-install: 7.1.3 @@ -10903,9 +10939,9 @@ snapshots: es-errors: 1.3.0 is-data-view: 1.0.2 - db0@0.3.4(better-sqlite3@12.2.0): + db0@0.3.4(better-sqlite3@12.5.0): optionalDependencies: - better-sqlite3: 12.2.0 + better-sqlite3: 12.5.0 debug@3.2.7: dependencies: @@ -11815,11 +11851,11 @@ snapshots: package-json-from-dist: 1.0.1 path-scurry: 1.11.1 - glob@11.0.2: + glob@11.1.0: dependencies: foreground-child: 3.3.1 - jackspeak: 4.1.0 - minimatch: 10.0.1 + jackspeak: 4.1.1 + minimatch: 10.1.1 minipass: 7.1.2 package-json-from-dist: 1.0.1 path-scurry: 2.0.0 @@ -12215,7 +12251,7 @@ snapshots: optionalDependencies: '@pkgjs/parseargs': 0.11.0 - jackspeak@4.1.0: + jackspeak@4.1.1: dependencies: '@isaacs/cliui': 8.0.2 @@ -12495,10 +12531,7 @@ snapshots: lru-cache@10.4.3: {} - lru-cache@11.1.0: {} - - lru-cache@11.2.2: - optional: true + lru-cache@11.2.2: {} lru-cache@5.1.1: dependencies: @@ -12587,9 +12620,9 @@ snapshots: mimic-response@3.1.0: {} - minimatch@10.0.1: + minimatch@10.1.1: dependencies: - brace-expansion: 2.0.2 + '@isaacs/brace-expansion': 5.0.0 minimatch@3.1.2: dependencies: @@ -12692,7 +12725,7 @@ snapshots: - '@babel/core' - babel-plugin-macros - nitropack@2.12.9(better-sqlite3@12.2.0): + nitropack@2.12.9(better-sqlite3@12.5.0): dependencies: '@cloudflare/kv-asset-handler': 0.4.0 '@rollup/plugin-alias': 5.1.1(rollup@4.52.5) @@ -12713,7 +12746,7 @@ snapshots: cookie-es: 2.0.0 croner: 9.1.0 crossws: 0.3.5 - db0: 0.3.4(better-sqlite3@12.2.0) + db0: 0.3.4(better-sqlite3@12.5.0) defu: 6.1.4 destr: 2.0.5 dot-prop: 10.1.0 @@ -12759,7 +12792,7 @@ snapshots: unenv: 2.0.0-rc.24 unimport: 5.5.0 unplugin-utils: 0.3.1 - unstorage: 1.17.1(db0@0.3.4(better-sqlite3@12.2.0))(ioredis@5.8.2) + unstorage: 1.17.1(db0@0.3.4(better-sqlite3@12.5.0))(ioredis@5.8.2) untyped: 2.0.0 unwasm: 0.3.11 youch: 4.1.0-beta.11 @@ -12841,19 +12874,19 @@ snapshots: dependencies: boolbase: 1.0.0 - nuxt@4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.9.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1): + nuxt@4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.5.0)(db0@0.3.4(better-sqlite3@12.5.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.5.0)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.9.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1): dependencies: - '@dxup/nuxt': 0.2.0(magicast@0.3.5) - '@nuxt/cli': 3.29.3(magicast@0.3.5) + '@dxup/nuxt': 0.2.0(magicast@0.5.0) + '@nuxt/cli': 3.29.3(magicast@0.5.0) '@nuxt/devtools': 2.7.0(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(vue@3.5.22(typescript@5.9.3)) - '@nuxt/kit': 4.2.0(magicast@0.3.5) - '@nuxt/nitro-server': 4.2.0(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(ioredis@5.8.2)(magicast@0.3.5)(nuxt@4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.9.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1))(typescript@5.9.3) + '@nuxt/kit': 4.2.0(magicast@0.5.0) + '@nuxt/nitro-server': 4.2.0(better-sqlite3@12.5.0)(db0@0.3.4(better-sqlite3@12.5.0))(ioredis@5.8.2)(magicast@0.5.0)(nuxt@4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.5.0)(db0@0.3.4(better-sqlite3@12.5.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.5.0)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.9.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1))(typescript@5.9.3) '@nuxt/schema': 4.2.0 - '@nuxt/telemetry': 2.6.6(magicast@0.3.5) - '@nuxt/vite-builder': 4.2.0(@types/node@20.19.24)(eslint@9.29.0(jiti@2.6.1))(lightningcss@1.30.2)(magicast@0.3.5)(nuxt@4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.2.0)(db0@0.3.4(better-sqlite3@12.2.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.9.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1))(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.9.3)(vue@3.5.22(typescript@5.9.3))(yaml@2.8.1) + '@nuxt/telemetry': 2.6.6(magicast@0.5.0) + '@nuxt/vite-builder': 4.2.0(@types/node@20.19.24)(eslint@9.29.0(jiti@2.6.1))(lightningcss@1.30.2)(magicast@0.5.0)(nuxt@4.2.0(@parcel/watcher@2.5.1)(@types/node@20.19.24)(@vue/compiler-sfc@3.5.22)(better-sqlite3@12.5.0)(db0@0.3.4(better-sqlite3@12.5.0))(eslint@9.29.0(jiti@2.6.1))(ioredis@5.8.2)(lightningcss@1.30.2)(magicast@0.5.0)(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.9.3)(vite@7.1.12(@types/node@20.19.24)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.1))(yaml@2.8.1))(optionator@0.9.4)(rollup@4.52.5)(terser@5.44.0)(tsx@4.20.3)(typescript@5.9.3)(vue@3.5.22(typescript@5.9.3))(yaml@2.8.1) '@unhead/vue': 2.0.19(vue@3.5.22(typescript@5.9.3)) '@vue/shared': 3.5.22 - c12: 3.3.1(magicast@0.3.5) + c12: 3.3.1(magicast@0.5.0) chokidar: 4.0.3 compatx: 0.2.0 consola: 3.4.2 @@ -13199,7 +13232,7 @@ snapshots: path-scurry@2.0.0: dependencies: - lru-cache: 11.1.0 + lru-cache: 11.2.2 minipass: 7.1.2 path-to-regexp@8.3.0: {} @@ -14696,7 +14729,7 @@ snapshots: '@unrs/resolver-binding-win32-ia32-msvc': 1.11.1 '@unrs/resolver-binding-win32-x64-msvc': 1.11.1 - unstorage@1.17.1(db0@0.3.4(better-sqlite3@12.2.0))(ioredis@5.8.2): + unstorage@1.17.1(db0@0.3.4(better-sqlite3@12.5.0))(ioredis@5.8.2): dependencies: anymatch: 3.1.3 chokidar: 4.0.3 @@ -14707,7 +14740,7 @@ snapshots: ofetch: 1.5.0 ufo: 1.6.1 optionalDependencies: - db0: 0.3.4(better-sqlite3@12.2.0) + db0: 0.3.4(better-sqlite3@12.5.0) ioredis: 5.8.2 untun@0.1.3: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 7c61d05c5..2d0efa782 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -10,7 +10,7 @@ catalog: '@types/react': 19.2.0 '@types/react-dom': 19.2.0 '@types/tmp': ^0.2.6 - better-sqlite3: ^12.2.0 + better-sqlite3: ^12.5.0 decimal.js: ^10.4.3 kysely: ~0.28.8 langium: 3.5.0 diff --git a/samples/next.js/package.json b/samples/next.js/package.json index 83518e136..c675370ca 100644 --- a/samples/next.js/package.json +++ b/samples/next.js/package.json @@ -1,6 +1,6 @@ { "name": "next.js", - "version": "3.0.0-beta.27", + "version": "3.0.0-beta.28", "private": true, "scripts": { "generate": "zen generate --lite", diff --git a/samples/next.js/zenstack/schema-lite.ts b/samples/next.js/zenstack/schema-lite.ts index e8b2f096e..6153abe9d 100644 --- a/samples/next.js/zenstack/schema-lite.ts +++ b/samples/next.js/zenstack/schema-lite.ts @@ -6,11 +6,11 @@ /* eslint-disable */ import { type SchemaDef, ExpressionUtils } from "@zenstackhq/orm/schema"; -const _schema = { - provider: { +export class SchemaType implements SchemaDef { + provider = { type: "sqlite" - }, - models: { + } as const; + models = { User: { name: "User", fields: { @@ -99,12 +99,8 @@ const _schema = { id: { type: "String" } } } - }, - authType: "User", - plugins: {} -} as const satisfies SchemaDef; -type Schema = typeof _schema & { - __brand?: "schema"; -}; -export const schema: Schema = _schema; -export type SchemaType = Schema; + } as const; + authType = "User" as const; + plugins = {}; +} +export const schema = new SchemaType(); diff --git a/samples/next.js/zenstack/schema.ts b/samples/next.js/zenstack/schema.ts index 6388c6c2b..c7d690ed5 100644 --- a/samples/next.js/zenstack/schema.ts +++ b/samples/next.js/zenstack/schema.ts @@ -6,11 +6,11 @@ /* eslint-disable */ import { type SchemaDef, ExpressionUtils } from "@zenstackhq/orm/schema"; -const _schema = { - provider: { +export class SchemaType implements SchemaDef { + provider = { type: "sqlite" - }, - models: { + } as const; + models = { User: { name: "User", fields: { @@ -108,12 +108,8 @@ const _schema = { id: { type: "String" } } } - }, - authType: "User", - plugins: {} -} as const satisfies SchemaDef; -type Schema = typeof _schema & { - __brand?: "schema"; -}; -export const schema: Schema = _schema; -export type SchemaType = Schema; + } as const; + authType = "User" as const; + plugins = {}; +} +export const schema = new SchemaType(); diff --git a/samples/orm/main.ts b/samples/orm/main.ts index c153fabed..59e814c13 100644 --- a/samples/orm/main.ts +++ b/samples/orm/main.ts @@ -1,5 +1,5 @@ -import { PolicyPlugin } from '@zenstackhq/plugin-policy'; import { ZenStackClient } from '@zenstackhq/orm'; +import { PolicyPlugin } from '@zenstackhq/plugin-policy'; import SQLite from 'better-sqlite3'; import { sql, SqliteDialect } from 'kysely'; import { schema } from './zenstack/schema'; diff --git a/samples/orm/package.json b/samples/orm/package.json index 11a29f8a7..30183276c 100644 --- a/samples/orm/package.json +++ b/samples/orm/package.json @@ -1,6 +1,6 @@ { "name": "sample-blog", - "version": "3.0.0-beta.27", + "version": "3.0.0-beta.28", "description": "", "main": "index.js", "private": true, diff --git a/samples/orm/zenstack/schema.ts b/samples/orm/zenstack/schema.ts index 1db7031c0..deb07cb9c 100644 --- a/samples/orm/zenstack/schema.ts +++ b/samples/orm/zenstack/schema.ts @@ -6,11 +6,11 @@ /* eslint-disable */ import { type SchemaDef, type OperandExpression, ExpressionUtils } from "@zenstackhq/orm/schema"; -const _schema = { - provider: { +export class SchemaType implements SchemaDef { + provider = { type: "sqlite" - }, - models: { + } as const; + models = { User: { name: "User", fields: { @@ -204,8 +204,8 @@ const _schema = { id: { type: "String" } } } - }, - typeDefs: { + } as const; + typeDefs = { CommonFields: { name: "CommonFields", fields: { @@ -229,20 +229,16 @@ const _schema = { } } } - }, - enums: { + } as const; + enums = { Role: { values: { ADMIN: "ADMIN", USER: "USER" } } - }, - authType: "User", - plugins: {} -} as const satisfies SchemaDef; -type Schema = typeof _schema & { - __brand?: "schema"; -}; -export const schema: Schema = _schema; -export type SchemaType = Schema; + } as const; + authType = "User" as const; + plugins = {}; +} +export const schema = new SchemaType(); diff --git a/scripts/test-generate.ts b/scripts/test-generate.ts new file mode 100644 index 000000000..4c94ef858 --- /dev/null +++ b/scripts/test-generate.ts @@ -0,0 +1,24 @@ +import { glob } from 'glob'; +import { execSync } from 'node:child_process'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const _dirname = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url)); + +async function main() { + const baseDir = process.argv[2] || '.'; + + const zmodelFiles = [...glob.sync(path.resolve(baseDir, '**/schema.zmodel'), { ignore: '**/node_modules/**' })]; + for (const file of zmodelFiles) { + console.log(`Generating TS schema for: ${file}`); + await generate(file); + } +} + +async function generate(schemaPath: string) { + const cliPath = path.join(_dirname, '../packages/cli/dist/index.js'); + const RUNTIME = process.env.RUNTIME ?? 'node'; + execSync(`${RUNTIME} ${cliPath} generate --schema ${schemaPath}`, { cwd: path.dirname(schemaPath) }); +} + +main(); diff --git a/tests/e2e/apps/rally/rally.test.ts b/tests/e2e/apps/rally/rally.test.ts index 5b2042751..51084594e 100644 --- a/tests/e2e/apps/rally/rally.test.ts +++ b/tests/e2e/apps/rally/rally.test.ts @@ -5,10 +5,10 @@ import { beforeEach, describe, expect, it } from 'vitest'; import { schema, type SchemaType } from './zenstack/schema'; describe('Rally app tests', () => { - let db: ClientContract; + let db: ClientContract; beforeEach(async () => { - db = await createTestClient(schema, { + db = (await createTestClient(schema, { provider: 'postgresql', schemaFile: path.join(__dirname, 'zenstack/schema.zmodel'), copyFiles: [ @@ -19,7 +19,7 @@ describe('Rally app tests', () => { ], dataSourceExtensions: ['citext'], usePrismaPush: true, - }); + })) as any; }); it('works with queries', async () => { diff --git a/tests/e2e/apps/rally/zenstack/schema.ts b/tests/e2e/apps/rally/zenstack/schema.ts index 278bac74a..7d20facea 100644 --- a/tests/e2e/apps/rally/zenstack/schema.ts +++ b/tests/e2e/apps/rally/zenstack/schema.ts @@ -6,11 +6,11 @@ /* eslint-disable */ import { type SchemaDef, ExpressionUtils } from "@zenstackhq/orm/schema"; -const _schema = { - provider: { +export class SchemaType implements SchemaDef { + provider = { type: "postgresql" - }, - models: { + } as const; + models = { Account: { name: "Account", fields: { @@ -2388,8 +2388,8 @@ const _schema = { licenseKey: { type: "String" } } } - }, - enums: { + } as const; + enums = { TimeFormat: { values: { hours12: "hours12", @@ -2516,12 +2516,8 @@ const _schema = { REVOKED: "REVOKED" } } - }, - authType: "User", - plugins: {} -} as const satisfies SchemaDef; -type Schema = typeof _schema & { - __brand?: "schema"; -}; -export const schema: Schema = _schema; -export type SchemaType = Schema; + } as const; + authType = "User" as const; + plugins = {}; +} +export const schema = new SchemaType(); diff --git a/tests/e2e/github-repos/cal.com/cal-com.test.ts b/tests/e2e/github-repos/cal.com/cal-com.test.ts deleted file mode 100644 index 0ca58a1bb..000000000 --- a/tests/e2e/github-repos/cal.com/cal-com.test.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { generateTsSchema } from '@zenstackhq/testtools'; -import { describe, expect, it } from 'vitest'; -import fs from 'node:fs'; -import path from 'node:path'; - -describe('Cal.com e2e tests', () => { - it('has a working schema', async () => { - await expect( - generateTsSchema(fs.readFileSync(path.join(__dirname, 'schema.zmodel'), 'utf8'), 'postgresql'), - ).resolves.toBeTruthy(); - }); -}); diff --git a/tests/e2e/github-repos/cal.com/input.ts b/tests/e2e/github-repos/cal.com/input.ts new file mode 100644 index 000000000..0ed661f72 --- /dev/null +++ b/tests/e2e/github-repos/cal.com/input.ts @@ -0,0 +1,1950 @@ +////////////////////////////////////////////////////////////////////////////////////////////// +// DO NOT MODIFY THIS FILE // +// This file is automatically generated by ZenStack CLI and should not be manually updated. // +////////////////////////////////////////////////////////////////////////////////////////////// + +/* eslint-disable */ + +import { type SchemaType as $Schema } from "./schema"; +import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, ClientOptions as $ClientOptions } from "@zenstackhq/orm"; +import type { SimplifiedModelResult as $SimplifiedModelResult, SelectIncludeOmit as $SelectIncludeOmit } from "@zenstackhq/orm"; +export type HostFindManyArgs = $FindManyArgs<$Schema, "Host">; +export type HostFindUniqueArgs = $FindUniqueArgs<$Schema, "Host">; +export type HostFindFirstArgs = $FindFirstArgs<$Schema, "Host">; +export type HostCreateArgs = $CreateArgs<$Schema, "Host">; +export type HostCreateManyArgs = $CreateManyArgs<$Schema, "Host">; +export type HostCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Host">; +export type HostUpdateArgs = $UpdateArgs<$Schema, "Host">; +export type HostUpdateManyArgs = $UpdateManyArgs<$Schema, "Host">; +export type HostUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Host">; +export type HostUpsertArgs = $UpsertArgs<$Schema, "Host">; +export type HostDeleteArgs = $DeleteArgs<$Schema, "Host">; +export type HostDeleteManyArgs = $DeleteManyArgs<$Schema, "Host">; +export type HostCountArgs = $CountArgs<$Schema, "Host">; +export type HostAggregateArgs = $AggregateArgs<$Schema, "Host">; +export type HostGroupByArgs = $GroupByArgs<$Schema, "Host">; +export type HostWhereInput = $WhereInput<$Schema, "Host">; +export type HostSelect = $SelectInput<$Schema, "Host">; +export type HostInclude = $IncludeInput<$Schema, "Host">; +export type HostOmit = $OmitInput<$Schema, "Host">; +export type HostGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Host", Options, Args>; +export type CalVideoSettingsFindManyArgs = $FindManyArgs<$Schema, "CalVideoSettings">; +export type CalVideoSettingsFindUniqueArgs = $FindUniqueArgs<$Schema, "CalVideoSettings">; +export type CalVideoSettingsFindFirstArgs = $FindFirstArgs<$Schema, "CalVideoSettings">; +export type CalVideoSettingsCreateArgs = $CreateArgs<$Schema, "CalVideoSettings">; +export type CalVideoSettingsCreateManyArgs = $CreateManyArgs<$Schema, "CalVideoSettings">; +export type CalVideoSettingsCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "CalVideoSettings">; +export type CalVideoSettingsUpdateArgs = $UpdateArgs<$Schema, "CalVideoSettings">; +export type CalVideoSettingsUpdateManyArgs = $UpdateManyArgs<$Schema, "CalVideoSettings">; +export type CalVideoSettingsUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "CalVideoSettings">; +export type CalVideoSettingsUpsertArgs = $UpsertArgs<$Schema, "CalVideoSettings">; +export type CalVideoSettingsDeleteArgs = $DeleteArgs<$Schema, "CalVideoSettings">; +export type CalVideoSettingsDeleteManyArgs = $DeleteManyArgs<$Schema, "CalVideoSettings">; +export type CalVideoSettingsCountArgs = $CountArgs<$Schema, "CalVideoSettings">; +export type CalVideoSettingsAggregateArgs = $AggregateArgs<$Schema, "CalVideoSettings">; +export type CalVideoSettingsGroupByArgs = $GroupByArgs<$Schema, "CalVideoSettings">; +export type CalVideoSettingsWhereInput = $WhereInput<$Schema, "CalVideoSettings">; +export type CalVideoSettingsSelect = $SelectInput<$Schema, "CalVideoSettings">; +export type CalVideoSettingsInclude = $IncludeInput<$Schema, "CalVideoSettings">; +export type CalVideoSettingsOmit = $OmitInput<$Schema, "CalVideoSettings">; +export type CalVideoSettingsGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "CalVideoSettings", Options, Args>; +export type EventTypeFindManyArgs = $FindManyArgs<$Schema, "EventType">; +export type EventTypeFindUniqueArgs = $FindUniqueArgs<$Schema, "EventType">; +export type EventTypeFindFirstArgs = $FindFirstArgs<$Schema, "EventType">; +export type EventTypeCreateArgs = $CreateArgs<$Schema, "EventType">; +export type EventTypeCreateManyArgs = $CreateManyArgs<$Schema, "EventType">; +export type EventTypeCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "EventType">; +export type EventTypeUpdateArgs = $UpdateArgs<$Schema, "EventType">; +export type EventTypeUpdateManyArgs = $UpdateManyArgs<$Schema, "EventType">; +export type EventTypeUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "EventType">; +export type EventTypeUpsertArgs = $UpsertArgs<$Schema, "EventType">; +export type EventTypeDeleteArgs = $DeleteArgs<$Schema, "EventType">; +export type EventTypeDeleteManyArgs = $DeleteManyArgs<$Schema, "EventType">; +export type EventTypeCountArgs = $CountArgs<$Schema, "EventType">; +export type EventTypeAggregateArgs = $AggregateArgs<$Schema, "EventType">; +export type EventTypeGroupByArgs = $GroupByArgs<$Schema, "EventType">; +export type EventTypeWhereInput = $WhereInput<$Schema, "EventType">; +export type EventTypeSelect = $SelectInput<$Schema, "EventType">; +export type EventTypeInclude = $IncludeInput<$Schema, "EventType">; +export type EventTypeOmit = $OmitInput<$Schema, "EventType">; +export type EventTypeGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "EventType", Options, Args>; +export type CredentialFindManyArgs = $FindManyArgs<$Schema, "Credential">; +export type CredentialFindUniqueArgs = $FindUniqueArgs<$Schema, "Credential">; +export type CredentialFindFirstArgs = $FindFirstArgs<$Schema, "Credential">; +export type CredentialCreateArgs = $CreateArgs<$Schema, "Credential">; +export type CredentialCreateManyArgs = $CreateManyArgs<$Schema, "Credential">; +export type CredentialCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Credential">; +export type CredentialUpdateArgs = $UpdateArgs<$Schema, "Credential">; +export type CredentialUpdateManyArgs = $UpdateManyArgs<$Schema, "Credential">; +export type CredentialUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Credential">; +export type CredentialUpsertArgs = $UpsertArgs<$Schema, "Credential">; +export type CredentialDeleteArgs = $DeleteArgs<$Schema, "Credential">; +export type CredentialDeleteManyArgs = $DeleteManyArgs<$Schema, "Credential">; +export type CredentialCountArgs = $CountArgs<$Schema, "Credential">; +export type CredentialAggregateArgs = $AggregateArgs<$Schema, "Credential">; +export type CredentialGroupByArgs = $GroupByArgs<$Schema, "Credential">; +export type CredentialWhereInput = $WhereInput<$Schema, "Credential">; +export type CredentialSelect = $SelectInput<$Schema, "Credential">; +export type CredentialInclude = $IncludeInput<$Schema, "Credential">; +export type CredentialOmit = $OmitInput<$Schema, "Credential">; +export type CredentialGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Credential", Options, Args>; +export type DestinationCalendarFindManyArgs = $FindManyArgs<$Schema, "DestinationCalendar">; +export type DestinationCalendarFindUniqueArgs = $FindUniqueArgs<$Schema, "DestinationCalendar">; +export type DestinationCalendarFindFirstArgs = $FindFirstArgs<$Schema, "DestinationCalendar">; +export type DestinationCalendarCreateArgs = $CreateArgs<$Schema, "DestinationCalendar">; +export type DestinationCalendarCreateManyArgs = $CreateManyArgs<$Schema, "DestinationCalendar">; +export type DestinationCalendarCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "DestinationCalendar">; +export type DestinationCalendarUpdateArgs = $UpdateArgs<$Schema, "DestinationCalendar">; +export type DestinationCalendarUpdateManyArgs = $UpdateManyArgs<$Schema, "DestinationCalendar">; +export type DestinationCalendarUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "DestinationCalendar">; +export type DestinationCalendarUpsertArgs = $UpsertArgs<$Schema, "DestinationCalendar">; +export type DestinationCalendarDeleteArgs = $DeleteArgs<$Schema, "DestinationCalendar">; +export type DestinationCalendarDeleteManyArgs = $DeleteManyArgs<$Schema, "DestinationCalendar">; +export type DestinationCalendarCountArgs = $CountArgs<$Schema, "DestinationCalendar">; +export type DestinationCalendarAggregateArgs = $AggregateArgs<$Schema, "DestinationCalendar">; +export type DestinationCalendarGroupByArgs = $GroupByArgs<$Schema, "DestinationCalendar">; +export type DestinationCalendarWhereInput = $WhereInput<$Schema, "DestinationCalendar">; +export type DestinationCalendarSelect = $SelectInput<$Schema, "DestinationCalendar">; +export type DestinationCalendarInclude = $IncludeInput<$Schema, "DestinationCalendar">; +export type DestinationCalendarOmit = $OmitInput<$Schema, "DestinationCalendar">; +export type DestinationCalendarGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "DestinationCalendar", Options, Args>; +export type UserPasswordFindManyArgs = $FindManyArgs<$Schema, "UserPassword">; +export type UserPasswordFindUniqueArgs = $FindUniqueArgs<$Schema, "UserPassword">; +export type UserPasswordFindFirstArgs = $FindFirstArgs<$Schema, "UserPassword">; +export type UserPasswordCreateArgs = $CreateArgs<$Schema, "UserPassword">; +export type UserPasswordCreateManyArgs = $CreateManyArgs<$Schema, "UserPassword">; +export type UserPasswordCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "UserPassword">; +export type UserPasswordUpdateArgs = $UpdateArgs<$Schema, "UserPassword">; +export type UserPasswordUpdateManyArgs = $UpdateManyArgs<$Schema, "UserPassword">; +export type UserPasswordUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "UserPassword">; +export type UserPasswordUpsertArgs = $UpsertArgs<$Schema, "UserPassword">; +export type UserPasswordDeleteArgs = $DeleteArgs<$Schema, "UserPassword">; +export type UserPasswordDeleteManyArgs = $DeleteManyArgs<$Schema, "UserPassword">; +export type UserPasswordCountArgs = $CountArgs<$Schema, "UserPassword">; +export type UserPasswordAggregateArgs = $AggregateArgs<$Schema, "UserPassword">; +export type UserPasswordGroupByArgs = $GroupByArgs<$Schema, "UserPassword">; +export type UserPasswordWhereInput = $WhereInput<$Schema, "UserPassword">; +export type UserPasswordSelect = $SelectInput<$Schema, "UserPassword">; +export type UserPasswordInclude = $IncludeInput<$Schema, "UserPassword">; +export type UserPasswordOmit = $OmitInput<$Schema, "UserPassword">; +export type UserPasswordGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "UserPassword", Options, Args>; +export type TravelScheduleFindManyArgs = $FindManyArgs<$Schema, "TravelSchedule">; +export type TravelScheduleFindUniqueArgs = $FindUniqueArgs<$Schema, "TravelSchedule">; +export type TravelScheduleFindFirstArgs = $FindFirstArgs<$Schema, "TravelSchedule">; +export type TravelScheduleCreateArgs = $CreateArgs<$Schema, "TravelSchedule">; +export type TravelScheduleCreateManyArgs = $CreateManyArgs<$Schema, "TravelSchedule">; +export type TravelScheduleCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "TravelSchedule">; +export type TravelScheduleUpdateArgs = $UpdateArgs<$Schema, "TravelSchedule">; +export type TravelScheduleUpdateManyArgs = $UpdateManyArgs<$Schema, "TravelSchedule">; +export type TravelScheduleUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "TravelSchedule">; +export type TravelScheduleUpsertArgs = $UpsertArgs<$Schema, "TravelSchedule">; +export type TravelScheduleDeleteArgs = $DeleteArgs<$Schema, "TravelSchedule">; +export type TravelScheduleDeleteManyArgs = $DeleteManyArgs<$Schema, "TravelSchedule">; +export type TravelScheduleCountArgs = $CountArgs<$Schema, "TravelSchedule">; +export type TravelScheduleAggregateArgs = $AggregateArgs<$Schema, "TravelSchedule">; +export type TravelScheduleGroupByArgs = $GroupByArgs<$Schema, "TravelSchedule">; +export type TravelScheduleWhereInput = $WhereInput<$Schema, "TravelSchedule">; +export type TravelScheduleSelect = $SelectInput<$Schema, "TravelSchedule">; +export type TravelScheduleInclude = $IncludeInput<$Schema, "TravelSchedule">; +export type TravelScheduleOmit = $OmitInput<$Schema, "TravelSchedule">; +export type TravelScheduleGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "TravelSchedule", Options, Args>; +export type UserFindManyArgs = $FindManyArgs<$Schema, "User">; +export type UserFindUniqueArgs = $FindUniqueArgs<$Schema, "User">; +export type UserFindFirstArgs = $FindFirstArgs<$Schema, "User">; +export type UserCreateArgs = $CreateArgs<$Schema, "User">; +export type UserCreateManyArgs = $CreateManyArgs<$Schema, "User">; +export type UserCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "User">; +export type UserUpdateArgs = $UpdateArgs<$Schema, "User">; +export type UserUpdateManyArgs = $UpdateManyArgs<$Schema, "User">; +export type UserUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "User">; +export type UserUpsertArgs = $UpsertArgs<$Schema, "User">; +export type UserDeleteArgs = $DeleteArgs<$Schema, "User">; +export type UserDeleteManyArgs = $DeleteManyArgs<$Schema, "User">; +export type UserCountArgs = $CountArgs<$Schema, "User">; +export type UserAggregateArgs = $AggregateArgs<$Schema, "User">; +export type UserGroupByArgs = $GroupByArgs<$Schema, "User">; +export type UserWhereInput = $WhereInput<$Schema, "User">; +export type UserSelect = $SelectInput<$Schema, "User">; +export type UserInclude = $IncludeInput<$Schema, "User">; +export type UserOmit = $OmitInput<$Schema, "User">; +export type UserGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "User", Options, Args>; +export type NotificationsSubscriptionsFindManyArgs = $FindManyArgs<$Schema, "NotificationsSubscriptions">; +export type NotificationsSubscriptionsFindUniqueArgs = $FindUniqueArgs<$Schema, "NotificationsSubscriptions">; +export type NotificationsSubscriptionsFindFirstArgs = $FindFirstArgs<$Schema, "NotificationsSubscriptions">; +export type NotificationsSubscriptionsCreateArgs = $CreateArgs<$Schema, "NotificationsSubscriptions">; +export type NotificationsSubscriptionsCreateManyArgs = $CreateManyArgs<$Schema, "NotificationsSubscriptions">; +export type NotificationsSubscriptionsCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "NotificationsSubscriptions">; +export type NotificationsSubscriptionsUpdateArgs = $UpdateArgs<$Schema, "NotificationsSubscriptions">; +export type NotificationsSubscriptionsUpdateManyArgs = $UpdateManyArgs<$Schema, "NotificationsSubscriptions">; +export type NotificationsSubscriptionsUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "NotificationsSubscriptions">; +export type NotificationsSubscriptionsUpsertArgs = $UpsertArgs<$Schema, "NotificationsSubscriptions">; +export type NotificationsSubscriptionsDeleteArgs = $DeleteArgs<$Schema, "NotificationsSubscriptions">; +export type NotificationsSubscriptionsDeleteManyArgs = $DeleteManyArgs<$Schema, "NotificationsSubscriptions">; +export type NotificationsSubscriptionsCountArgs = $CountArgs<$Schema, "NotificationsSubscriptions">; +export type NotificationsSubscriptionsAggregateArgs = $AggregateArgs<$Schema, "NotificationsSubscriptions">; +export type NotificationsSubscriptionsGroupByArgs = $GroupByArgs<$Schema, "NotificationsSubscriptions">; +export type NotificationsSubscriptionsWhereInput = $WhereInput<$Schema, "NotificationsSubscriptions">; +export type NotificationsSubscriptionsSelect = $SelectInput<$Schema, "NotificationsSubscriptions">; +export type NotificationsSubscriptionsInclude = $IncludeInput<$Schema, "NotificationsSubscriptions">; +export type NotificationsSubscriptionsOmit = $OmitInput<$Schema, "NotificationsSubscriptions">; +export type NotificationsSubscriptionsGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "NotificationsSubscriptions", Options, Args>; +export type ProfileFindManyArgs = $FindManyArgs<$Schema, "Profile">; +export type ProfileFindUniqueArgs = $FindUniqueArgs<$Schema, "Profile">; +export type ProfileFindFirstArgs = $FindFirstArgs<$Schema, "Profile">; +export type ProfileCreateArgs = $CreateArgs<$Schema, "Profile">; +export type ProfileCreateManyArgs = $CreateManyArgs<$Schema, "Profile">; +export type ProfileCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Profile">; +export type ProfileUpdateArgs = $UpdateArgs<$Schema, "Profile">; +export type ProfileUpdateManyArgs = $UpdateManyArgs<$Schema, "Profile">; +export type ProfileUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Profile">; +export type ProfileUpsertArgs = $UpsertArgs<$Schema, "Profile">; +export type ProfileDeleteArgs = $DeleteArgs<$Schema, "Profile">; +export type ProfileDeleteManyArgs = $DeleteManyArgs<$Schema, "Profile">; +export type ProfileCountArgs = $CountArgs<$Schema, "Profile">; +export type ProfileAggregateArgs = $AggregateArgs<$Schema, "Profile">; +export type ProfileGroupByArgs = $GroupByArgs<$Schema, "Profile">; +export type ProfileWhereInput = $WhereInput<$Schema, "Profile">; +export type ProfileSelect = $SelectInput<$Schema, "Profile">; +export type ProfileInclude = $IncludeInput<$Schema, "Profile">; +export type ProfileOmit = $OmitInput<$Schema, "Profile">; +export type ProfileGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Profile", Options, Args>; +export type TeamFindManyArgs = $FindManyArgs<$Schema, "Team">; +export type TeamFindUniqueArgs = $FindUniqueArgs<$Schema, "Team">; +export type TeamFindFirstArgs = $FindFirstArgs<$Schema, "Team">; +export type TeamCreateArgs = $CreateArgs<$Schema, "Team">; +export type TeamCreateManyArgs = $CreateManyArgs<$Schema, "Team">; +export type TeamCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Team">; +export type TeamUpdateArgs = $UpdateArgs<$Schema, "Team">; +export type TeamUpdateManyArgs = $UpdateManyArgs<$Schema, "Team">; +export type TeamUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Team">; +export type TeamUpsertArgs = $UpsertArgs<$Schema, "Team">; +export type TeamDeleteArgs = $DeleteArgs<$Schema, "Team">; +export type TeamDeleteManyArgs = $DeleteManyArgs<$Schema, "Team">; +export type TeamCountArgs = $CountArgs<$Schema, "Team">; +export type TeamAggregateArgs = $AggregateArgs<$Schema, "Team">; +export type TeamGroupByArgs = $GroupByArgs<$Schema, "Team">; +export type TeamWhereInput = $WhereInput<$Schema, "Team">; +export type TeamSelect = $SelectInput<$Schema, "Team">; +export type TeamInclude = $IncludeInput<$Schema, "Team">; +export type TeamOmit = $OmitInput<$Schema, "Team">; +export type TeamGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Team", Options, Args>; +export type CreditBalanceFindManyArgs = $FindManyArgs<$Schema, "CreditBalance">; +export type CreditBalanceFindUniqueArgs = $FindUniqueArgs<$Schema, "CreditBalance">; +export type CreditBalanceFindFirstArgs = $FindFirstArgs<$Schema, "CreditBalance">; +export type CreditBalanceCreateArgs = $CreateArgs<$Schema, "CreditBalance">; +export type CreditBalanceCreateManyArgs = $CreateManyArgs<$Schema, "CreditBalance">; +export type CreditBalanceCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "CreditBalance">; +export type CreditBalanceUpdateArgs = $UpdateArgs<$Schema, "CreditBalance">; +export type CreditBalanceUpdateManyArgs = $UpdateManyArgs<$Schema, "CreditBalance">; +export type CreditBalanceUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "CreditBalance">; +export type CreditBalanceUpsertArgs = $UpsertArgs<$Schema, "CreditBalance">; +export type CreditBalanceDeleteArgs = $DeleteArgs<$Schema, "CreditBalance">; +export type CreditBalanceDeleteManyArgs = $DeleteManyArgs<$Schema, "CreditBalance">; +export type CreditBalanceCountArgs = $CountArgs<$Schema, "CreditBalance">; +export type CreditBalanceAggregateArgs = $AggregateArgs<$Schema, "CreditBalance">; +export type CreditBalanceGroupByArgs = $GroupByArgs<$Schema, "CreditBalance">; +export type CreditBalanceWhereInput = $WhereInput<$Schema, "CreditBalance">; +export type CreditBalanceSelect = $SelectInput<$Schema, "CreditBalance">; +export type CreditBalanceInclude = $IncludeInput<$Schema, "CreditBalance">; +export type CreditBalanceOmit = $OmitInput<$Schema, "CreditBalance">; +export type CreditBalanceGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "CreditBalance", Options, Args>; +export type CreditPurchaseLogFindManyArgs = $FindManyArgs<$Schema, "CreditPurchaseLog">; +export type CreditPurchaseLogFindUniqueArgs = $FindUniqueArgs<$Schema, "CreditPurchaseLog">; +export type CreditPurchaseLogFindFirstArgs = $FindFirstArgs<$Schema, "CreditPurchaseLog">; +export type CreditPurchaseLogCreateArgs = $CreateArgs<$Schema, "CreditPurchaseLog">; +export type CreditPurchaseLogCreateManyArgs = $CreateManyArgs<$Schema, "CreditPurchaseLog">; +export type CreditPurchaseLogCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "CreditPurchaseLog">; +export type CreditPurchaseLogUpdateArgs = $UpdateArgs<$Schema, "CreditPurchaseLog">; +export type CreditPurchaseLogUpdateManyArgs = $UpdateManyArgs<$Schema, "CreditPurchaseLog">; +export type CreditPurchaseLogUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "CreditPurchaseLog">; +export type CreditPurchaseLogUpsertArgs = $UpsertArgs<$Schema, "CreditPurchaseLog">; +export type CreditPurchaseLogDeleteArgs = $DeleteArgs<$Schema, "CreditPurchaseLog">; +export type CreditPurchaseLogDeleteManyArgs = $DeleteManyArgs<$Schema, "CreditPurchaseLog">; +export type CreditPurchaseLogCountArgs = $CountArgs<$Schema, "CreditPurchaseLog">; +export type CreditPurchaseLogAggregateArgs = $AggregateArgs<$Schema, "CreditPurchaseLog">; +export type CreditPurchaseLogGroupByArgs = $GroupByArgs<$Schema, "CreditPurchaseLog">; +export type CreditPurchaseLogWhereInput = $WhereInput<$Schema, "CreditPurchaseLog">; +export type CreditPurchaseLogSelect = $SelectInput<$Schema, "CreditPurchaseLog">; +export type CreditPurchaseLogInclude = $IncludeInput<$Schema, "CreditPurchaseLog">; +export type CreditPurchaseLogOmit = $OmitInput<$Schema, "CreditPurchaseLog">; +export type CreditPurchaseLogGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "CreditPurchaseLog", Options, Args>; +export type CreditExpenseLogFindManyArgs = $FindManyArgs<$Schema, "CreditExpenseLog">; +export type CreditExpenseLogFindUniqueArgs = $FindUniqueArgs<$Schema, "CreditExpenseLog">; +export type CreditExpenseLogFindFirstArgs = $FindFirstArgs<$Schema, "CreditExpenseLog">; +export type CreditExpenseLogCreateArgs = $CreateArgs<$Schema, "CreditExpenseLog">; +export type CreditExpenseLogCreateManyArgs = $CreateManyArgs<$Schema, "CreditExpenseLog">; +export type CreditExpenseLogCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "CreditExpenseLog">; +export type CreditExpenseLogUpdateArgs = $UpdateArgs<$Schema, "CreditExpenseLog">; +export type CreditExpenseLogUpdateManyArgs = $UpdateManyArgs<$Schema, "CreditExpenseLog">; +export type CreditExpenseLogUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "CreditExpenseLog">; +export type CreditExpenseLogUpsertArgs = $UpsertArgs<$Schema, "CreditExpenseLog">; +export type CreditExpenseLogDeleteArgs = $DeleteArgs<$Schema, "CreditExpenseLog">; +export type CreditExpenseLogDeleteManyArgs = $DeleteManyArgs<$Schema, "CreditExpenseLog">; +export type CreditExpenseLogCountArgs = $CountArgs<$Schema, "CreditExpenseLog">; +export type CreditExpenseLogAggregateArgs = $AggregateArgs<$Schema, "CreditExpenseLog">; +export type CreditExpenseLogGroupByArgs = $GroupByArgs<$Schema, "CreditExpenseLog">; +export type CreditExpenseLogWhereInput = $WhereInput<$Schema, "CreditExpenseLog">; +export type CreditExpenseLogSelect = $SelectInput<$Schema, "CreditExpenseLog">; +export type CreditExpenseLogInclude = $IncludeInput<$Schema, "CreditExpenseLog">; +export type CreditExpenseLogOmit = $OmitInput<$Schema, "CreditExpenseLog">; +export type CreditExpenseLogGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "CreditExpenseLog", Options, Args>; +export type OrganizationSettingsFindManyArgs = $FindManyArgs<$Schema, "OrganizationSettings">; +export type OrganizationSettingsFindUniqueArgs = $FindUniqueArgs<$Schema, "OrganizationSettings">; +export type OrganizationSettingsFindFirstArgs = $FindFirstArgs<$Schema, "OrganizationSettings">; +export type OrganizationSettingsCreateArgs = $CreateArgs<$Schema, "OrganizationSettings">; +export type OrganizationSettingsCreateManyArgs = $CreateManyArgs<$Schema, "OrganizationSettings">; +export type OrganizationSettingsCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "OrganizationSettings">; +export type OrganizationSettingsUpdateArgs = $UpdateArgs<$Schema, "OrganizationSettings">; +export type OrganizationSettingsUpdateManyArgs = $UpdateManyArgs<$Schema, "OrganizationSettings">; +export type OrganizationSettingsUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "OrganizationSettings">; +export type OrganizationSettingsUpsertArgs = $UpsertArgs<$Schema, "OrganizationSettings">; +export type OrganizationSettingsDeleteArgs = $DeleteArgs<$Schema, "OrganizationSettings">; +export type OrganizationSettingsDeleteManyArgs = $DeleteManyArgs<$Schema, "OrganizationSettings">; +export type OrganizationSettingsCountArgs = $CountArgs<$Schema, "OrganizationSettings">; +export type OrganizationSettingsAggregateArgs = $AggregateArgs<$Schema, "OrganizationSettings">; +export type OrganizationSettingsGroupByArgs = $GroupByArgs<$Schema, "OrganizationSettings">; +export type OrganizationSettingsWhereInput = $WhereInput<$Schema, "OrganizationSettings">; +export type OrganizationSettingsSelect = $SelectInput<$Schema, "OrganizationSettings">; +export type OrganizationSettingsInclude = $IncludeInput<$Schema, "OrganizationSettings">; +export type OrganizationSettingsOmit = $OmitInput<$Schema, "OrganizationSettings">; +export type OrganizationSettingsGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "OrganizationSettings", Options, Args>; +export type MembershipFindManyArgs = $FindManyArgs<$Schema, "Membership">; +export type MembershipFindUniqueArgs = $FindUniqueArgs<$Schema, "Membership">; +export type MembershipFindFirstArgs = $FindFirstArgs<$Schema, "Membership">; +export type MembershipCreateArgs = $CreateArgs<$Schema, "Membership">; +export type MembershipCreateManyArgs = $CreateManyArgs<$Schema, "Membership">; +export type MembershipCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Membership">; +export type MembershipUpdateArgs = $UpdateArgs<$Schema, "Membership">; +export type MembershipUpdateManyArgs = $UpdateManyArgs<$Schema, "Membership">; +export type MembershipUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Membership">; +export type MembershipUpsertArgs = $UpsertArgs<$Schema, "Membership">; +export type MembershipDeleteArgs = $DeleteArgs<$Schema, "Membership">; +export type MembershipDeleteManyArgs = $DeleteManyArgs<$Schema, "Membership">; +export type MembershipCountArgs = $CountArgs<$Schema, "Membership">; +export type MembershipAggregateArgs = $AggregateArgs<$Schema, "Membership">; +export type MembershipGroupByArgs = $GroupByArgs<$Schema, "Membership">; +export type MembershipWhereInput = $WhereInput<$Schema, "Membership">; +export type MembershipSelect = $SelectInput<$Schema, "Membership">; +export type MembershipInclude = $IncludeInput<$Schema, "Membership">; +export type MembershipOmit = $OmitInput<$Schema, "Membership">; +export type MembershipGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Membership", Options, Args>; +export type VerificationTokenFindManyArgs = $FindManyArgs<$Schema, "VerificationToken">; +export type VerificationTokenFindUniqueArgs = $FindUniqueArgs<$Schema, "VerificationToken">; +export type VerificationTokenFindFirstArgs = $FindFirstArgs<$Schema, "VerificationToken">; +export type VerificationTokenCreateArgs = $CreateArgs<$Schema, "VerificationToken">; +export type VerificationTokenCreateManyArgs = $CreateManyArgs<$Schema, "VerificationToken">; +export type VerificationTokenCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "VerificationToken">; +export type VerificationTokenUpdateArgs = $UpdateArgs<$Schema, "VerificationToken">; +export type VerificationTokenUpdateManyArgs = $UpdateManyArgs<$Schema, "VerificationToken">; +export type VerificationTokenUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "VerificationToken">; +export type VerificationTokenUpsertArgs = $UpsertArgs<$Schema, "VerificationToken">; +export type VerificationTokenDeleteArgs = $DeleteArgs<$Schema, "VerificationToken">; +export type VerificationTokenDeleteManyArgs = $DeleteManyArgs<$Schema, "VerificationToken">; +export type VerificationTokenCountArgs = $CountArgs<$Schema, "VerificationToken">; +export type VerificationTokenAggregateArgs = $AggregateArgs<$Schema, "VerificationToken">; +export type VerificationTokenGroupByArgs = $GroupByArgs<$Schema, "VerificationToken">; +export type VerificationTokenWhereInput = $WhereInput<$Schema, "VerificationToken">; +export type VerificationTokenSelect = $SelectInput<$Schema, "VerificationToken">; +export type VerificationTokenInclude = $IncludeInput<$Schema, "VerificationToken">; +export type VerificationTokenOmit = $OmitInput<$Schema, "VerificationToken">; +export type VerificationTokenGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "VerificationToken", Options, Args>; +export type InstantMeetingTokenFindManyArgs = $FindManyArgs<$Schema, "InstantMeetingToken">; +export type InstantMeetingTokenFindUniqueArgs = $FindUniqueArgs<$Schema, "InstantMeetingToken">; +export type InstantMeetingTokenFindFirstArgs = $FindFirstArgs<$Schema, "InstantMeetingToken">; +export type InstantMeetingTokenCreateArgs = $CreateArgs<$Schema, "InstantMeetingToken">; +export type InstantMeetingTokenCreateManyArgs = $CreateManyArgs<$Schema, "InstantMeetingToken">; +export type InstantMeetingTokenCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "InstantMeetingToken">; +export type InstantMeetingTokenUpdateArgs = $UpdateArgs<$Schema, "InstantMeetingToken">; +export type InstantMeetingTokenUpdateManyArgs = $UpdateManyArgs<$Schema, "InstantMeetingToken">; +export type InstantMeetingTokenUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "InstantMeetingToken">; +export type InstantMeetingTokenUpsertArgs = $UpsertArgs<$Schema, "InstantMeetingToken">; +export type InstantMeetingTokenDeleteArgs = $DeleteArgs<$Schema, "InstantMeetingToken">; +export type InstantMeetingTokenDeleteManyArgs = $DeleteManyArgs<$Schema, "InstantMeetingToken">; +export type InstantMeetingTokenCountArgs = $CountArgs<$Schema, "InstantMeetingToken">; +export type InstantMeetingTokenAggregateArgs = $AggregateArgs<$Schema, "InstantMeetingToken">; +export type InstantMeetingTokenGroupByArgs = $GroupByArgs<$Schema, "InstantMeetingToken">; +export type InstantMeetingTokenWhereInput = $WhereInput<$Schema, "InstantMeetingToken">; +export type InstantMeetingTokenSelect = $SelectInput<$Schema, "InstantMeetingToken">; +export type InstantMeetingTokenInclude = $IncludeInput<$Schema, "InstantMeetingToken">; +export type InstantMeetingTokenOmit = $OmitInput<$Schema, "InstantMeetingToken">; +export type InstantMeetingTokenGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "InstantMeetingToken", Options, Args>; +export type BookingReferenceFindManyArgs = $FindManyArgs<$Schema, "BookingReference">; +export type BookingReferenceFindUniqueArgs = $FindUniqueArgs<$Schema, "BookingReference">; +export type BookingReferenceFindFirstArgs = $FindFirstArgs<$Schema, "BookingReference">; +export type BookingReferenceCreateArgs = $CreateArgs<$Schema, "BookingReference">; +export type BookingReferenceCreateManyArgs = $CreateManyArgs<$Schema, "BookingReference">; +export type BookingReferenceCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "BookingReference">; +export type BookingReferenceUpdateArgs = $UpdateArgs<$Schema, "BookingReference">; +export type BookingReferenceUpdateManyArgs = $UpdateManyArgs<$Schema, "BookingReference">; +export type BookingReferenceUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "BookingReference">; +export type BookingReferenceUpsertArgs = $UpsertArgs<$Schema, "BookingReference">; +export type BookingReferenceDeleteArgs = $DeleteArgs<$Schema, "BookingReference">; +export type BookingReferenceDeleteManyArgs = $DeleteManyArgs<$Schema, "BookingReference">; +export type BookingReferenceCountArgs = $CountArgs<$Schema, "BookingReference">; +export type BookingReferenceAggregateArgs = $AggregateArgs<$Schema, "BookingReference">; +export type BookingReferenceGroupByArgs = $GroupByArgs<$Schema, "BookingReference">; +export type BookingReferenceWhereInput = $WhereInput<$Schema, "BookingReference">; +export type BookingReferenceSelect = $SelectInput<$Schema, "BookingReference">; +export type BookingReferenceInclude = $IncludeInput<$Schema, "BookingReference">; +export type BookingReferenceOmit = $OmitInput<$Schema, "BookingReference">; +export type BookingReferenceGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "BookingReference", Options, Args>; +export type AttendeeFindManyArgs = $FindManyArgs<$Schema, "Attendee">; +export type AttendeeFindUniqueArgs = $FindUniqueArgs<$Schema, "Attendee">; +export type AttendeeFindFirstArgs = $FindFirstArgs<$Schema, "Attendee">; +export type AttendeeCreateArgs = $CreateArgs<$Schema, "Attendee">; +export type AttendeeCreateManyArgs = $CreateManyArgs<$Schema, "Attendee">; +export type AttendeeCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Attendee">; +export type AttendeeUpdateArgs = $UpdateArgs<$Schema, "Attendee">; +export type AttendeeUpdateManyArgs = $UpdateManyArgs<$Schema, "Attendee">; +export type AttendeeUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Attendee">; +export type AttendeeUpsertArgs = $UpsertArgs<$Schema, "Attendee">; +export type AttendeeDeleteArgs = $DeleteArgs<$Schema, "Attendee">; +export type AttendeeDeleteManyArgs = $DeleteManyArgs<$Schema, "Attendee">; +export type AttendeeCountArgs = $CountArgs<$Schema, "Attendee">; +export type AttendeeAggregateArgs = $AggregateArgs<$Schema, "Attendee">; +export type AttendeeGroupByArgs = $GroupByArgs<$Schema, "Attendee">; +export type AttendeeWhereInput = $WhereInput<$Schema, "Attendee">; +export type AttendeeSelect = $SelectInput<$Schema, "Attendee">; +export type AttendeeInclude = $IncludeInput<$Schema, "Attendee">; +export type AttendeeOmit = $OmitInput<$Schema, "Attendee">; +export type AttendeeGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Attendee", Options, Args>; +export type BookingFindManyArgs = $FindManyArgs<$Schema, "Booking">; +export type BookingFindUniqueArgs = $FindUniqueArgs<$Schema, "Booking">; +export type BookingFindFirstArgs = $FindFirstArgs<$Schema, "Booking">; +export type BookingCreateArgs = $CreateArgs<$Schema, "Booking">; +export type BookingCreateManyArgs = $CreateManyArgs<$Schema, "Booking">; +export type BookingCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Booking">; +export type BookingUpdateArgs = $UpdateArgs<$Schema, "Booking">; +export type BookingUpdateManyArgs = $UpdateManyArgs<$Schema, "Booking">; +export type BookingUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Booking">; +export type BookingUpsertArgs = $UpsertArgs<$Schema, "Booking">; +export type BookingDeleteArgs = $DeleteArgs<$Schema, "Booking">; +export type BookingDeleteManyArgs = $DeleteManyArgs<$Schema, "Booking">; +export type BookingCountArgs = $CountArgs<$Schema, "Booking">; +export type BookingAggregateArgs = $AggregateArgs<$Schema, "Booking">; +export type BookingGroupByArgs = $GroupByArgs<$Schema, "Booking">; +export type BookingWhereInput = $WhereInput<$Schema, "Booking">; +export type BookingSelect = $SelectInput<$Schema, "Booking">; +export type BookingInclude = $IncludeInput<$Schema, "Booking">; +export type BookingOmit = $OmitInput<$Schema, "Booking">; +export type BookingGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Booking", Options, Args>; +export type TrackingFindManyArgs = $FindManyArgs<$Schema, "Tracking">; +export type TrackingFindUniqueArgs = $FindUniqueArgs<$Schema, "Tracking">; +export type TrackingFindFirstArgs = $FindFirstArgs<$Schema, "Tracking">; +export type TrackingCreateArgs = $CreateArgs<$Schema, "Tracking">; +export type TrackingCreateManyArgs = $CreateManyArgs<$Schema, "Tracking">; +export type TrackingCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Tracking">; +export type TrackingUpdateArgs = $UpdateArgs<$Schema, "Tracking">; +export type TrackingUpdateManyArgs = $UpdateManyArgs<$Schema, "Tracking">; +export type TrackingUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Tracking">; +export type TrackingUpsertArgs = $UpsertArgs<$Schema, "Tracking">; +export type TrackingDeleteArgs = $DeleteArgs<$Schema, "Tracking">; +export type TrackingDeleteManyArgs = $DeleteManyArgs<$Schema, "Tracking">; +export type TrackingCountArgs = $CountArgs<$Schema, "Tracking">; +export type TrackingAggregateArgs = $AggregateArgs<$Schema, "Tracking">; +export type TrackingGroupByArgs = $GroupByArgs<$Schema, "Tracking">; +export type TrackingWhereInput = $WhereInput<$Schema, "Tracking">; +export type TrackingSelect = $SelectInput<$Schema, "Tracking">; +export type TrackingInclude = $IncludeInput<$Schema, "Tracking">; +export type TrackingOmit = $OmitInput<$Schema, "Tracking">; +export type TrackingGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Tracking", Options, Args>; +export type ScheduleFindManyArgs = $FindManyArgs<$Schema, "Schedule">; +export type ScheduleFindUniqueArgs = $FindUniqueArgs<$Schema, "Schedule">; +export type ScheduleFindFirstArgs = $FindFirstArgs<$Schema, "Schedule">; +export type ScheduleCreateArgs = $CreateArgs<$Schema, "Schedule">; +export type ScheduleCreateManyArgs = $CreateManyArgs<$Schema, "Schedule">; +export type ScheduleCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Schedule">; +export type ScheduleUpdateArgs = $UpdateArgs<$Schema, "Schedule">; +export type ScheduleUpdateManyArgs = $UpdateManyArgs<$Schema, "Schedule">; +export type ScheduleUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Schedule">; +export type ScheduleUpsertArgs = $UpsertArgs<$Schema, "Schedule">; +export type ScheduleDeleteArgs = $DeleteArgs<$Schema, "Schedule">; +export type ScheduleDeleteManyArgs = $DeleteManyArgs<$Schema, "Schedule">; +export type ScheduleCountArgs = $CountArgs<$Schema, "Schedule">; +export type ScheduleAggregateArgs = $AggregateArgs<$Schema, "Schedule">; +export type ScheduleGroupByArgs = $GroupByArgs<$Schema, "Schedule">; +export type ScheduleWhereInput = $WhereInput<$Schema, "Schedule">; +export type ScheduleSelect = $SelectInput<$Schema, "Schedule">; +export type ScheduleInclude = $IncludeInput<$Schema, "Schedule">; +export type ScheduleOmit = $OmitInput<$Schema, "Schedule">; +export type ScheduleGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Schedule", Options, Args>; +export type AvailabilityFindManyArgs = $FindManyArgs<$Schema, "Availability">; +export type AvailabilityFindUniqueArgs = $FindUniqueArgs<$Schema, "Availability">; +export type AvailabilityFindFirstArgs = $FindFirstArgs<$Schema, "Availability">; +export type AvailabilityCreateArgs = $CreateArgs<$Schema, "Availability">; +export type AvailabilityCreateManyArgs = $CreateManyArgs<$Schema, "Availability">; +export type AvailabilityCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Availability">; +export type AvailabilityUpdateArgs = $UpdateArgs<$Schema, "Availability">; +export type AvailabilityUpdateManyArgs = $UpdateManyArgs<$Schema, "Availability">; +export type AvailabilityUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Availability">; +export type AvailabilityUpsertArgs = $UpsertArgs<$Schema, "Availability">; +export type AvailabilityDeleteArgs = $DeleteArgs<$Schema, "Availability">; +export type AvailabilityDeleteManyArgs = $DeleteManyArgs<$Schema, "Availability">; +export type AvailabilityCountArgs = $CountArgs<$Schema, "Availability">; +export type AvailabilityAggregateArgs = $AggregateArgs<$Schema, "Availability">; +export type AvailabilityGroupByArgs = $GroupByArgs<$Schema, "Availability">; +export type AvailabilityWhereInput = $WhereInput<$Schema, "Availability">; +export type AvailabilitySelect = $SelectInput<$Schema, "Availability">; +export type AvailabilityInclude = $IncludeInput<$Schema, "Availability">; +export type AvailabilityOmit = $OmitInput<$Schema, "Availability">; +export type AvailabilityGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Availability", Options, Args>; +export type SelectedCalendarFindManyArgs = $FindManyArgs<$Schema, "SelectedCalendar">; +export type SelectedCalendarFindUniqueArgs = $FindUniqueArgs<$Schema, "SelectedCalendar">; +export type SelectedCalendarFindFirstArgs = $FindFirstArgs<$Schema, "SelectedCalendar">; +export type SelectedCalendarCreateArgs = $CreateArgs<$Schema, "SelectedCalendar">; +export type SelectedCalendarCreateManyArgs = $CreateManyArgs<$Schema, "SelectedCalendar">; +export type SelectedCalendarCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "SelectedCalendar">; +export type SelectedCalendarUpdateArgs = $UpdateArgs<$Schema, "SelectedCalendar">; +export type SelectedCalendarUpdateManyArgs = $UpdateManyArgs<$Schema, "SelectedCalendar">; +export type SelectedCalendarUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "SelectedCalendar">; +export type SelectedCalendarUpsertArgs = $UpsertArgs<$Schema, "SelectedCalendar">; +export type SelectedCalendarDeleteArgs = $DeleteArgs<$Schema, "SelectedCalendar">; +export type SelectedCalendarDeleteManyArgs = $DeleteManyArgs<$Schema, "SelectedCalendar">; +export type SelectedCalendarCountArgs = $CountArgs<$Schema, "SelectedCalendar">; +export type SelectedCalendarAggregateArgs = $AggregateArgs<$Schema, "SelectedCalendar">; +export type SelectedCalendarGroupByArgs = $GroupByArgs<$Schema, "SelectedCalendar">; +export type SelectedCalendarWhereInput = $WhereInput<$Schema, "SelectedCalendar">; +export type SelectedCalendarSelect = $SelectInput<$Schema, "SelectedCalendar">; +export type SelectedCalendarInclude = $IncludeInput<$Schema, "SelectedCalendar">; +export type SelectedCalendarOmit = $OmitInput<$Schema, "SelectedCalendar">; +export type SelectedCalendarGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "SelectedCalendar", Options, Args>; +export type EventTypeCustomInputFindManyArgs = $FindManyArgs<$Schema, "EventTypeCustomInput">; +export type EventTypeCustomInputFindUniqueArgs = $FindUniqueArgs<$Schema, "EventTypeCustomInput">; +export type EventTypeCustomInputFindFirstArgs = $FindFirstArgs<$Schema, "EventTypeCustomInput">; +export type EventTypeCustomInputCreateArgs = $CreateArgs<$Schema, "EventTypeCustomInput">; +export type EventTypeCustomInputCreateManyArgs = $CreateManyArgs<$Schema, "EventTypeCustomInput">; +export type EventTypeCustomInputCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "EventTypeCustomInput">; +export type EventTypeCustomInputUpdateArgs = $UpdateArgs<$Schema, "EventTypeCustomInput">; +export type EventTypeCustomInputUpdateManyArgs = $UpdateManyArgs<$Schema, "EventTypeCustomInput">; +export type EventTypeCustomInputUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "EventTypeCustomInput">; +export type EventTypeCustomInputUpsertArgs = $UpsertArgs<$Schema, "EventTypeCustomInput">; +export type EventTypeCustomInputDeleteArgs = $DeleteArgs<$Schema, "EventTypeCustomInput">; +export type EventTypeCustomInputDeleteManyArgs = $DeleteManyArgs<$Schema, "EventTypeCustomInput">; +export type EventTypeCustomInputCountArgs = $CountArgs<$Schema, "EventTypeCustomInput">; +export type EventTypeCustomInputAggregateArgs = $AggregateArgs<$Schema, "EventTypeCustomInput">; +export type EventTypeCustomInputGroupByArgs = $GroupByArgs<$Schema, "EventTypeCustomInput">; +export type EventTypeCustomInputWhereInput = $WhereInput<$Schema, "EventTypeCustomInput">; +export type EventTypeCustomInputSelect = $SelectInput<$Schema, "EventTypeCustomInput">; +export type EventTypeCustomInputInclude = $IncludeInput<$Schema, "EventTypeCustomInput">; +export type EventTypeCustomInputOmit = $OmitInput<$Schema, "EventTypeCustomInput">; +export type EventTypeCustomInputGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "EventTypeCustomInput", Options, Args>; +export type ResetPasswordRequestFindManyArgs = $FindManyArgs<$Schema, "ResetPasswordRequest">; +export type ResetPasswordRequestFindUniqueArgs = $FindUniqueArgs<$Schema, "ResetPasswordRequest">; +export type ResetPasswordRequestFindFirstArgs = $FindFirstArgs<$Schema, "ResetPasswordRequest">; +export type ResetPasswordRequestCreateArgs = $CreateArgs<$Schema, "ResetPasswordRequest">; +export type ResetPasswordRequestCreateManyArgs = $CreateManyArgs<$Schema, "ResetPasswordRequest">; +export type ResetPasswordRequestCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "ResetPasswordRequest">; +export type ResetPasswordRequestUpdateArgs = $UpdateArgs<$Schema, "ResetPasswordRequest">; +export type ResetPasswordRequestUpdateManyArgs = $UpdateManyArgs<$Schema, "ResetPasswordRequest">; +export type ResetPasswordRequestUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "ResetPasswordRequest">; +export type ResetPasswordRequestUpsertArgs = $UpsertArgs<$Schema, "ResetPasswordRequest">; +export type ResetPasswordRequestDeleteArgs = $DeleteArgs<$Schema, "ResetPasswordRequest">; +export type ResetPasswordRequestDeleteManyArgs = $DeleteManyArgs<$Schema, "ResetPasswordRequest">; +export type ResetPasswordRequestCountArgs = $CountArgs<$Schema, "ResetPasswordRequest">; +export type ResetPasswordRequestAggregateArgs = $AggregateArgs<$Schema, "ResetPasswordRequest">; +export type ResetPasswordRequestGroupByArgs = $GroupByArgs<$Schema, "ResetPasswordRequest">; +export type ResetPasswordRequestWhereInput = $WhereInput<$Schema, "ResetPasswordRequest">; +export type ResetPasswordRequestSelect = $SelectInput<$Schema, "ResetPasswordRequest">; +export type ResetPasswordRequestInclude = $IncludeInput<$Schema, "ResetPasswordRequest">; +export type ResetPasswordRequestOmit = $OmitInput<$Schema, "ResetPasswordRequest">; +export type ResetPasswordRequestGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "ResetPasswordRequest", Options, Args>; +export type ReminderMailFindManyArgs = $FindManyArgs<$Schema, "ReminderMail">; +export type ReminderMailFindUniqueArgs = $FindUniqueArgs<$Schema, "ReminderMail">; +export type ReminderMailFindFirstArgs = $FindFirstArgs<$Schema, "ReminderMail">; +export type ReminderMailCreateArgs = $CreateArgs<$Schema, "ReminderMail">; +export type ReminderMailCreateManyArgs = $CreateManyArgs<$Schema, "ReminderMail">; +export type ReminderMailCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "ReminderMail">; +export type ReminderMailUpdateArgs = $UpdateArgs<$Schema, "ReminderMail">; +export type ReminderMailUpdateManyArgs = $UpdateManyArgs<$Schema, "ReminderMail">; +export type ReminderMailUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "ReminderMail">; +export type ReminderMailUpsertArgs = $UpsertArgs<$Schema, "ReminderMail">; +export type ReminderMailDeleteArgs = $DeleteArgs<$Schema, "ReminderMail">; +export type ReminderMailDeleteManyArgs = $DeleteManyArgs<$Schema, "ReminderMail">; +export type ReminderMailCountArgs = $CountArgs<$Schema, "ReminderMail">; +export type ReminderMailAggregateArgs = $AggregateArgs<$Schema, "ReminderMail">; +export type ReminderMailGroupByArgs = $GroupByArgs<$Schema, "ReminderMail">; +export type ReminderMailWhereInput = $WhereInput<$Schema, "ReminderMail">; +export type ReminderMailSelect = $SelectInput<$Schema, "ReminderMail">; +export type ReminderMailInclude = $IncludeInput<$Schema, "ReminderMail">; +export type ReminderMailOmit = $OmitInput<$Schema, "ReminderMail">; +export type ReminderMailGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "ReminderMail", Options, Args>; +export type PaymentFindManyArgs = $FindManyArgs<$Schema, "Payment">; +export type PaymentFindUniqueArgs = $FindUniqueArgs<$Schema, "Payment">; +export type PaymentFindFirstArgs = $FindFirstArgs<$Schema, "Payment">; +export type PaymentCreateArgs = $CreateArgs<$Schema, "Payment">; +export type PaymentCreateManyArgs = $CreateManyArgs<$Schema, "Payment">; +export type PaymentCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Payment">; +export type PaymentUpdateArgs = $UpdateArgs<$Schema, "Payment">; +export type PaymentUpdateManyArgs = $UpdateManyArgs<$Schema, "Payment">; +export type PaymentUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Payment">; +export type PaymentUpsertArgs = $UpsertArgs<$Schema, "Payment">; +export type PaymentDeleteArgs = $DeleteArgs<$Schema, "Payment">; +export type PaymentDeleteManyArgs = $DeleteManyArgs<$Schema, "Payment">; +export type PaymentCountArgs = $CountArgs<$Schema, "Payment">; +export type PaymentAggregateArgs = $AggregateArgs<$Schema, "Payment">; +export type PaymentGroupByArgs = $GroupByArgs<$Schema, "Payment">; +export type PaymentWhereInput = $WhereInput<$Schema, "Payment">; +export type PaymentSelect = $SelectInput<$Schema, "Payment">; +export type PaymentInclude = $IncludeInput<$Schema, "Payment">; +export type PaymentOmit = $OmitInput<$Schema, "Payment">; +export type PaymentGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Payment", Options, Args>; +export type WebhookFindManyArgs = $FindManyArgs<$Schema, "Webhook">; +export type WebhookFindUniqueArgs = $FindUniqueArgs<$Schema, "Webhook">; +export type WebhookFindFirstArgs = $FindFirstArgs<$Schema, "Webhook">; +export type WebhookCreateArgs = $CreateArgs<$Schema, "Webhook">; +export type WebhookCreateManyArgs = $CreateManyArgs<$Schema, "Webhook">; +export type WebhookCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Webhook">; +export type WebhookUpdateArgs = $UpdateArgs<$Schema, "Webhook">; +export type WebhookUpdateManyArgs = $UpdateManyArgs<$Schema, "Webhook">; +export type WebhookUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Webhook">; +export type WebhookUpsertArgs = $UpsertArgs<$Schema, "Webhook">; +export type WebhookDeleteArgs = $DeleteArgs<$Schema, "Webhook">; +export type WebhookDeleteManyArgs = $DeleteManyArgs<$Schema, "Webhook">; +export type WebhookCountArgs = $CountArgs<$Schema, "Webhook">; +export type WebhookAggregateArgs = $AggregateArgs<$Schema, "Webhook">; +export type WebhookGroupByArgs = $GroupByArgs<$Schema, "Webhook">; +export type WebhookWhereInput = $WhereInput<$Schema, "Webhook">; +export type WebhookSelect = $SelectInput<$Schema, "Webhook">; +export type WebhookInclude = $IncludeInput<$Schema, "Webhook">; +export type WebhookOmit = $OmitInput<$Schema, "Webhook">; +export type WebhookGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Webhook", Options, Args>; +export type ImpersonationsFindManyArgs = $FindManyArgs<$Schema, "Impersonations">; +export type ImpersonationsFindUniqueArgs = $FindUniqueArgs<$Schema, "Impersonations">; +export type ImpersonationsFindFirstArgs = $FindFirstArgs<$Schema, "Impersonations">; +export type ImpersonationsCreateArgs = $CreateArgs<$Schema, "Impersonations">; +export type ImpersonationsCreateManyArgs = $CreateManyArgs<$Schema, "Impersonations">; +export type ImpersonationsCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Impersonations">; +export type ImpersonationsUpdateArgs = $UpdateArgs<$Schema, "Impersonations">; +export type ImpersonationsUpdateManyArgs = $UpdateManyArgs<$Schema, "Impersonations">; +export type ImpersonationsUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Impersonations">; +export type ImpersonationsUpsertArgs = $UpsertArgs<$Schema, "Impersonations">; +export type ImpersonationsDeleteArgs = $DeleteArgs<$Schema, "Impersonations">; +export type ImpersonationsDeleteManyArgs = $DeleteManyArgs<$Schema, "Impersonations">; +export type ImpersonationsCountArgs = $CountArgs<$Schema, "Impersonations">; +export type ImpersonationsAggregateArgs = $AggregateArgs<$Schema, "Impersonations">; +export type ImpersonationsGroupByArgs = $GroupByArgs<$Schema, "Impersonations">; +export type ImpersonationsWhereInput = $WhereInput<$Schema, "Impersonations">; +export type ImpersonationsSelect = $SelectInput<$Schema, "Impersonations">; +export type ImpersonationsInclude = $IncludeInput<$Schema, "Impersonations">; +export type ImpersonationsOmit = $OmitInput<$Schema, "Impersonations">; +export type ImpersonationsGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Impersonations", Options, Args>; +export type ApiKeyFindManyArgs = $FindManyArgs<$Schema, "ApiKey">; +export type ApiKeyFindUniqueArgs = $FindUniqueArgs<$Schema, "ApiKey">; +export type ApiKeyFindFirstArgs = $FindFirstArgs<$Schema, "ApiKey">; +export type ApiKeyCreateArgs = $CreateArgs<$Schema, "ApiKey">; +export type ApiKeyCreateManyArgs = $CreateManyArgs<$Schema, "ApiKey">; +export type ApiKeyCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "ApiKey">; +export type ApiKeyUpdateArgs = $UpdateArgs<$Schema, "ApiKey">; +export type ApiKeyUpdateManyArgs = $UpdateManyArgs<$Schema, "ApiKey">; +export type ApiKeyUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "ApiKey">; +export type ApiKeyUpsertArgs = $UpsertArgs<$Schema, "ApiKey">; +export type ApiKeyDeleteArgs = $DeleteArgs<$Schema, "ApiKey">; +export type ApiKeyDeleteManyArgs = $DeleteManyArgs<$Schema, "ApiKey">; +export type ApiKeyCountArgs = $CountArgs<$Schema, "ApiKey">; +export type ApiKeyAggregateArgs = $AggregateArgs<$Schema, "ApiKey">; +export type ApiKeyGroupByArgs = $GroupByArgs<$Schema, "ApiKey">; +export type ApiKeyWhereInput = $WhereInput<$Schema, "ApiKey">; +export type ApiKeySelect = $SelectInput<$Schema, "ApiKey">; +export type ApiKeyInclude = $IncludeInput<$Schema, "ApiKey">; +export type ApiKeyOmit = $OmitInput<$Schema, "ApiKey">; +export type ApiKeyGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "ApiKey", Options, Args>; +export type RateLimitFindManyArgs = $FindManyArgs<$Schema, "RateLimit">; +export type RateLimitFindUniqueArgs = $FindUniqueArgs<$Schema, "RateLimit">; +export type RateLimitFindFirstArgs = $FindFirstArgs<$Schema, "RateLimit">; +export type RateLimitCreateArgs = $CreateArgs<$Schema, "RateLimit">; +export type RateLimitCreateManyArgs = $CreateManyArgs<$Schema, "RateLimit">; +export type RateLimitCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "RateLimit">; +export type RateLimitUpdateArgs = $UpdateArgs<$Schema, "RateLimit">; +export type RateLimitUpdateManyArgs = $UpdateManyArgs<$Schema, "RateLimit">; +export type RateLimitUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "RateLimit">; +export type RateLimitUpsertArgs = $UpsertArgs<$Schema, "RateLimit">; +export type RateLimitDeleteArgs = $DeleteArgs<$Schema, "RateLimit">; +export type RateLimitDeleteManyArgs = $DeleteManyArgs<$Schema, "RateLimit">; +export type RateLimitCountArgs = $CountArgs<$Schema, "RateLimit">; +export type RateLimitAggregateArgs = $AggregateArgs<$Schema, "RateLimit">; +export type RateLimitGroupByArgs = $GroupByArgs<$Schema, "RateLimit">; +export type RateLimitWhereInput = $WhereInput<$Schema, "RateLimit">; +export type RateLimitSelect = $SelectInput<$Schema, "RateLimit">; +export type RateLimitInclude = $IncludeInput<$Schema, "RateLimit">; +export type RateLimitOmit = $OmitInput<$Schema, "RateLimit">; +export type RateLimitGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "RateLimit", Options, Args>; +export type HashedLinkFindManyArgs = $FindManyArgs<$Schema, "HashedLink">; +export type HashedLinkFindUniqueArgs = $FindUniqueArgs<$Schema, "HashedLink">; +export type HashedLinkFindFirstArgs = $FindFirstArgs<$Schema, "HashedLink">; +export type HashedLinkCreateArgs = $CreateArgs<$Schema, "HashedLink">; +export type HashedLinkCreateManyArgs = $CreateManyArgs<$Schema, "HashedLink">; +export type HashedLinkCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "HashedLink">; +export type HashedLinkUpdateArgs = $UpdateArgs<$Schema, "HashedLink">; +export type HashedLinkUpdateManyArgs = $UpdateManyArgs<$Schema, "HashedLink">; +export type HashedLinkUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "HashedLink">; +export type HashedLinkUpsertArgs = $UpsertArgs<$Schema, "HashedLink">; +export type HashedLinkDeleteArgs = $DeleteArgs<$Schema, "HashedLink">; +export type HashedLinkDeleteManyArgs = $DeleteManyArgs<$Schema, "HashedLink">; +export type HashedLinkCountArgs = $CountArgs<$Schema, "HashedLink">; +export type HashedLinkAggregateArgs = $AggregateArgs<$Schema, "HashedLink">; +export type HashedLinkGroupByArgs = $GroupByArgs<$Schema, "HashedLink">; +export type HashedLinkWhereInput = $WhereInput<$Schema, "HashedLink">; +export type HashedLinkSelect = $SelectInput<$Schema, "HashedLink">; +export type HashedLinkInclude = $IncludeInput<$Schema, "HashedLink">; +export type HashedLinkOmit = $OmitInput<$Schema, "HashedLink">; +export type HashedLinkGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "HashedLink", Options, Args>; +export type AccountFindManyArgs = $FindManyArgs<$Schema, "Account">; +export type AccountFindUniqueArgs = $FindUniqueArgs<$Schema, "Account">; +export type AccountFindFirstArgs = $FindFirstArgs<$Schema, "Account">; +export type AccountCreateArgs = $CreateArgs<$Schema, "Account">; +export type AccountCreateManyArgs = $CreateManyArgs<$Schema, "Account">; +export type AccountCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Account">; +export type AccountUpdateArgs = $UpdateArgs<$Schema, "Account">; +export type AccountUpdateManyArgs = $UpdateManyArgs<$Schema, "Account">; +export type AccountUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Account">; +export type AccountUpsertArgs = $UpsertArgs<$Schema, "Account">; +export type AccountDeleteArgs = $DeleteArgs<$Schema, "Account">; +export type AccountDeleteManyArgs = $DeleteManyArgs<$Schema, "Account">; +export type AccountCountArgs = $CountArgs<$Schema, "Account">; +export type AccountAggregateArgs = $AggregateArgs<$Schema, "Account">; +export type AccountGroupByArgs = $GroupByArgs<$Schema, "Account">; +export type AccountWhereInput = $WhereInput<$Schema, "Account">; +export type AccountSelect = $SelectInput<$Schema, "Account">; +export type AccountInclude = $IncludeInput<$Schema, "Account">; +export type AccountOmit = $OmitInput<$Schema, "Account">; +export type AccountGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Account", Options, Args>; +export type SessionFindManyArgs = $FindManyArgs<$Schema, "Session">; +export type SessionFindUniqueArgs = $FindUniqueArgs<$Schema, "Session">; +export type SessionFindFirstArgs = $FindFirstArgs<$Schema, "Session">; +export type SessionCreateArgs = $CreateArgs<$Schema, "Session">; +export type SessionCreateManyArgs = $CreateManyArgs<$Schema, "Session">; +export type SessionCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Session">; +export type SessionUpdateArgs = $UpdateArgs<$Schema, "Session">; +export type SessionUpdateManyArgs = $UpdateManyArgs<$Schema, "Session">; +export type SessionUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Session">; +export type SessionUpsertArgs = $UpsertArgs<$Schema, "Session">; +export type SessionDeleteArgs = $DeleteArgs<$Schema, "Session">; +export type SessionDeleteManyArgs = $DeleteManyArgs<$Schema, "Session">; +export type SessionCountArgs = $CountArgs<$Schema, "Session">; +export type SessionAggregateArgs = $AggregateArgs<$Schema, "Session">; +export type SessionGroupByArgs = $GroupByArgs<$Schema, "Session">; +export type SessionWhereInput = $WhereInput<$Schema, "Session">; +export type SessionSelect = $SelectInput<$Schema, "Session">; +export type SessionInclude = $IncludeInput<$Schema, "Session">; +export type SessionOmit = $OmitInput<$Schema, "Session">; +export type SessionGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Session", Options, Args>; +export type AppFindManyArgs = $FindManyArgs<$Schema, "App">; +export type AppFindUniqueArgs = $FindUniqueArgs<$Schema, "App">; +export type AppFindFirstArgs = $FindFirstArgs<$Schema, "App">; +export type AppCreateArgs = $CreateArgs<$Schema, "App">; +export type AppCreateManyArgs = $CreateManyArgs<$Schema, "App">; +export type AppCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "App">; +export type AppUpdateArgs = $UpdateArgs<$Schema, "App">; +export type AppUpdateManyArgs = $UpdateManyArgs<$Schema, "App">; +export type AppUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "App">; +export type AppUpsertArgs = $UpsertArgs<$Schema, "App">; +export type AppDeleteArgs = $DeleteArgs<$Schema, "App">; +export type AppDeleteManyArgs = $DeleteManyArgs<$Schema, "App">; +export type AppCountArgs = $CountArgs<$Schema, "App">; +export type AppAggregateArgs = $AggregateArgs<$Schema, "App">; +export type AppGroupByArgs = $GroupByArgs<$Schema, "App">; +export type AppWhereInput = $WhereInput<$Schema, "App">; +export type AppSelect = $SelectInput<$Schema, "App">; +export type AppInclude = $IncludeInput<$Schema, "App">; +export type AppOmit = $OmitInput<$Schema, "App">; +export type AppGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "App", Options, Args>; +export type App_RoutingForms_FormFindManyArgs = $FindManyArgs<$Schema, "App_RoutingForms_Form">; +export type App_RoutingForms_FormFindUniqueArgs = $FindUniqueArgs<$Schema, "App_RoutingForms_Form">; +export type App_RoutingForms_FormFindFirstArgs = $FindFirstArgs<$Schema, "App_RoutingForms_Form">; +export type App_RoutingForms_FormCreateArgs = $CreateArgs<$Schema, "App_RoutingForms_Form">; +export type App_RoutingForms_FormCreateManyArgs = $CreateManyArgs<$Schema, "App_RoutingForms_Form">; +export type App_RoutingForms_FormCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "App_RoutingForms_Form">; +export type App_RoutingForms_FormUpdateArgs = $UpdateArgs<$Schema, "App_RoutingForms_Form">; +export type App_RoutingForms_FormUpdateManyArgs = $UpdateManyArgs<$Schema, "App_RoutingForms_Form">; +export type App_RoutingForms_FormUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "App_RoutingForms_Form">; +export type App_RoutingForms_FormUpsertArgs = $UpsertArgs<$Schema, "App_RoutingForms_Form">; +export type App_RoutingForms_FormDeleteArgs = $DeleteArgs<$Schema, "App_RoutingForms_Form">; +export type App_RoutingForms_FormDeleteManyArgs = $DeleteManyArgs<$Schema, "App_RoutingForms_Form">; +export type App_RoutingForms_FormCountArgs = $CountArgs<$Schema, "App_RoutingForms_Form">; +export type App_RoutingForms_FormAggregateArgs = $AggregateArgs<$Schema, "App_RoutingForms_Form">; +export type App_RoutingForms_FormGroupByArgs = $GroupByArgs<$Schema, "App_RoutingForms_Form">; +export type App_RoutingForms_FormWhereInput = $WhereInput<$Schema, "App_RoutingForms_Form">; +export type App_RoutingForms_FormSelect = $SelectInput<$Schema, "App_RoutingForms_Form">; +export type App_RoutingForms_FormInclude = $IncludeInput<$Schema, "App_RoutingForms_Form">; +export type App_RoutingForms_FormOmit = $OmitInput<$Schema, "App_RoutingForms_Form">; +export type App_RoutingForms_FormGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "App_RoutingForms_Form", Options, Args>; +export type App_RoutingForms_FormResponseFindManyArgs = $FindManyArgs<$Schema, "App_RoutingForms_FormResponse">; +export type App_RoutingForms_FormResponseFindUniqueArgs = $FindUniqueArgs<$Schema, "App_RoutingForms_FormResponse">; +export type App_RoutingForms_FormResponseFindFirstArgs = $FindFirstArgs<$Schema, "App_RoutingForms_FormResponse">; +export type App_RoutingForms_FormResponseCreateArgs = $CreateArgs<$Schema, "App_RoutingForms_FormResponse">; +export type App_RoutingForms_FormResponseCreateManyArgs = $CreateManyArgs<$Schema, "App_RoutingForms_FormResponse">; +export type App_RoutingForms_FormResponseCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "App_RoutingForms_FormResponse">; +export type App_RoutingForms_FormResponseUpdateArgs = $UpdateArgs<$Schema, "App_RoutingForms_FormResponse">; +export type App_RoutingForms_FormResponseUpdateManyArgs = $UpdateManyArgs<$Schema, "App_RoutingForms_FormResponse">; +export type App_RoutingForms_FormResponseUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "App_RoutingForms_FormResponse">; +export type App_RoutingForms_FormResponseUpsertArgs = $UpsertArgs<$Schema, "App_RoutingForms_FormResponse">; +export type App_RoutingForms_FormResponseDeleteArgs = $DeleteArgs<$Schema, "App_RoutingForms_FormResponse">; +export type App_RoutingForms_FormResponseDeleteManyArgs = $DeleteManyArgs<$Schema, "App_RoutingForms_FormResponse">; +export type App_RoutingForms_FormResponseCountArgs = $CountArgs<$Schema, "App_RoutingForms_FormResponse">; +export type App_RoutingForms_FormResponseAggregateArgs = $AggregateArgs<$Schema, "App_RoutingForms_FormResponse">; +export type App_RoutingForms_FormResponseGroupByArgs = $GroupByArgs<$Schema, "App_RoutingForms_FormResponse">; +export type App_RoutingForms_FormResponseWhereInput = $WhereInput<$Schema, "App_RoutingForms_FormResponse">; +export type App_RoutingForms_FormResponseSelect = $SelectInput<$Schema, "App_RoutingForms_FormResponse">; +export type App_RoutingForms_FormResponseInclude = $IncludeInput<$Schema, "App_RoutingForms_FormResponse">; +export type App_RoutingForms_FormResponseOmit = $OmitInput<$Schema, "App_RoutingForms_FormResponse">; +export type App_RoutingForms_FormResponseGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "App_RoutingForms_FormResponse", Options, Args>; +export type App_RoutingForms_QueuedFormResponseFindManyArgs = $FindManyArgs<$Schema, "App_RoutingForms_QueuedFormResponse">; +export type App_RoutingForms_QueuedFormResponseFindUniqueArgs = $FindUniqueArgs<$Schema, "App_RoutingForms_QueuedFormResponse">; +export type App_RoutingForms_QueuedFormResponseFindFirstArgs = $FindFirstArgs<$Schema, "App_RoutingForms_QueuedFormResponse">; +export type App_RoutingForms_QueuedFormResponseCreateArgs = $CreateArgs<$Schema, "App_RoutingForms_QueuedFormResponse">; +export type App_RoutingForms_QueuedFormResponseCreateManyArgs = $CreateManyArgs<$Schema, "App_RoutingForms_QueuedFormResponse">; +export type App_RoutingForms_QueuedFormResponseCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "App_RoutingForms_QueuedFormResponse">; +export type App_RoutingForms_QueuedFormResponseUpdateArgs = $UpdateArgs<$Schema, "App_RoutingForms_QueuedFormResponse">; +export type App_RoutingForms_QueuedFormResponseUpdateManyArgs = $UpdateManyArgs<$Schema, "App_RoutingForms_QueuedFormResponse">; +export type App_RoutingForms_QueuedFormResponseUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "App_RoutingForms_QueuedFormResponse">; +export type App_RoutingForms_QueuedFormResponseUpsertArgs = $UpsertArgs<$Schema, "App_RoutingForms_QueuedFormResponse">; +export type App_RoutingForms_QueuedFormResponseDeleteArgs = $DeleteArgs<$Schema, "App_RoutingForms_QueuedFormResponse">; +export type App_RoutingForms_QueuedFormResponseDeleteManyArgs = $DeleteManyArgs<$Schema, "App_RoutingForms_QueuedFormResponse">; +export type App_RoutingForms_QueuedFormResponseCountArgs = $CountArgs<$Schema, "App_RoutingForms_QueuedFormResponse">; +export type App_RoutingForms_QueuedFormResponseAggregateArgs = $AggregateArgs<$Schema, "App_RoutingForms_QueuedFormResponse">; +export type App_RoutingForms_QueuedFormResponseGroupByArgs = $GroupByArgs<$Schema, "App_RoutingForms_QueuedFormResponse">; +export type App_RoutingForms_QueuedFormResponseWhereInput = $WhereInput<$Schema, "App_RoutingForms_QueuedFormResponse">; +export type App_RoutingForms_QueuedFormResponseSelect = $SelectInput<$Schema, "App_RoutingForms_QueuedFormResponse">; +export type App_RoutingForms_QueuedFormResponseInclude = $IncludeInput<$Schema, "App_RoutingForms_QueuedFormResponse">; +export type App_RoutingForms_QueuedFormResponseOmit = $OmitInput<$Schema, "App_RoutingForms_QueuedFormResponse">; +export type App_RoutingForms_QueuedFormResponseGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "App_RoutingForms_QueuedFormResponse", Options, Args>; +export type RoutingFormResponseFieldFindManyArgs = $FindManyArgs<$Schema, "RoutingFormResponseField">; +export type RoutingFormResponseFieldFindUniqueArgs = $FindUniqueArgs<$Schema, "RoutingFormResponseField">; +export type RoutingFormResponseFieldFindFirstArgs = $FindFirstArgs<$Schema, "RoutingFormResponseField">; +export type RoutingFormResponseFieldCreateArgs = $CreateArgs<$Schema, "RoutingFormResponseField">; +export type RoutingFormResponseFieldCreateManyArgs = $CreateManyArgs<$Schema, "RoutingFormResponseField">; +export type RoutingFormResponseFieldCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "RoutingFormResponseField">; +export type RoutingFormResponseFieldUpdateArgs = $UpdateArgs<$Schema, "RoutingFormResponseField">; +export type RoutingFormResponseFieldUpdateManyArgs = $UpdateManyArgs<$Schema, "RoutingFormResponseField">; +export type RoutingFormResponseFieldUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "RoutingFormResponseField">; +export type RoutingFormResponseFieldUpsertArgs = $UpsertArgs<$Schema, "RoutingFormResponseField">; +export type RoutingFormResponseFieldDeleteArgs = $DeleteArgs<$Schema, "RoutingFormResponseField">; +export type RoutingFormResponseFieldDeleteManyArgs = $DeleteManyArgs<$Schema, "RoutingFormResponseField">; +export type RoutingFormResponseFieldCountArgs = $CountArgs<$Schema, "RoutingFormResponseField">; +export type RoutingFormResponseFieldAggregateArgs = $AggregateArgs<$Schema, "RoutingFormResponseField">; +export type RoutingFormResponseFieldGroupByArgs = $GroupByArgs<$Schema, "RoutingFormResponseField">; +export type RoutingFormResponseFieldWhereInput = $WhereInput<$Schema, "RoutingFormResponseField">; +export type RoutingFormResponseFieldSelect = $SelectInput<$Schema, "RoutingFormResponseField">; +export type RoutingFormResponseFieldInclude = $IncludeInput<$Schema, "RoutingFormResponseField">; +export type RoutingFormResponseFieldOmit = $OmitInput<$Schema, "RoutingFormResponseField">; +export type RoutingFormResponseFieldGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "RoutingFormResponseField", Options, Args>; +export type RoutingFormResponseFindManyArgs = $FindManyArgs<$Schema, "RoutingFormResponse">; +export type RoutingFormResponseFindUniqueArgs = $FindUniqueArgs<$Schema, "RoutingFormResponse">; +export type RoutingFormResponseFindFirstArgs = $FindFirstArgs<$Schema, "RoutingFormResponse">; +export type RoutingFormResponseCreateArgs = $CreateArgs<$Schema, "RoutingFormResponse">; +export type RoutingFormResponseCreateManyArgs = $CreateManyArgs<$Schema, "RoutingFormResponse">; +export type RoutingFormResponseCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "RoutingFormResponse">; +export type RoutingFormResponseUpdateArgs = $UpdateArgs<$Schema, "RoutingFormResponse">; +export type RoutingFormResponseUpdateManyArgs = $UpdateManyArgs<$Schema, "RoutingFormResponse">; +export type RoutingFormResponseUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "RoutingFormResponse">; +export type RoutingFormResponseUpsertArgs = $UpsertArgs<$Schema, "RoutingFormResponse">; +export type RoutingFormResponseDeleteArgs = $DeleteArgs<$Schema, "RoutingFormResponse">; +export type RoutingFormResponseDeleteManyArgs = $DeleteManyArgs<$Schema, "RoutingFormResponse">; +export type RoutingFormResponseCountArgs = $CountArgs<$Schema, "RoutingFormResponse">; +export type RoutingFormResponseAggregateArgs = $AggregateArgs<$Schema, "RoutingFormResponse">; +export type RoutingFormResponseGroupByArgs = $GroupByArgs<$Schema, "RoutingFormResponse">; +export type RoutingFormResponseWhereInput = $WhereInput<$Schema, "RoutingFormResponse">; +export type RoutingFormResponseSelect = $SelectInput<$Schema, "RoutingFormResponse">; +export type RoutingFormResponseInclude = $IncludeInput<$Schema, "RoutingFormResponse">; +export type RoutingFormResponseOmit = $OmitInput<$Schema, "RoutingFormResponse">; +export type RoutingFormResponseGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "RoutingFormResponse", Options, Args>; +export type RoutingFormResponseDenormalizedFindManyArgs = $FindManyArgs<$Schema, "RoutingFormResponseDenormalized">; +export type RoutingFormResponseDenormalizedFindUniqueArgs = $FindUniqueArgs<$Schema, "RoutingFormResponseDenormalized">; +export type RoutingFormResponseDenormalizedFindFirstArgs = $FindFirstArgs<$Schema, "RoutingFormResponseDenormalized">; +export type RoutingFormResponseDenormalizedCreateArgs = $CreateArgs<$Schema, "RoutingFormResponseDenormalized">; +export type RoutingFormResponseDenormalizedCreateManyArgs = $CreateManyArgs<$Schema, "RoutingFormResponseDenormalized">; +export type RoutingFormResponseDenormalizedCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "RoutingFormResponseDenormalized">; +export type RoutingFormResponseDenormalizedUpdateArgs = $UpdateArgs<$Schema, "RoutingFormResponseDenormalized">; +export type RoutingFormResponseDenormalizedUpdateManyArgs = $UpdateManyArgs<$Schema, "RoutingFormResponseDenormalized">; +export type RoutingFormResponseDenormalizedUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "RoutingFormResponseDenormalized">; +export type RoutingFormResponseDenormalizedUpsertArgs = $UpsertArgs<$Schema, "RoutingFormResponseDenormalized">; +export type RoutingFormResponseDenormalizedDeleteArgs = $DeleteArgs<$Schema, "RoutingFormResponseDenormalized">; +export type RoutingFormResponseDenormalizedDeleteManyArgs = $DeleteManyArgs<$Schema, "RoutingFormResponseDenormalized">; +export type RoutingFormResponseDenormalizedCountArgs = $CountArgs<$Schema, "RoutingFormResponseDenormalized">; +export type RoutingFormResponseDenormalizedAggregateArgs = $AggregateArgs<$Schema, "RoutingFormResponseDenormalized">; +export type RoutingFormResponseDenormalizedGroupByArgs = $GroupByArgs<$Schema, "RoutingFormResponseDenormalized">; +export type RoutingFormResponseDenormalizedWhereInput = $WhereInput<$Schema, "RoutingFormResponseDenormalized">; +export type RoutingFormResponseDenormalizedSelect = $SelectInput<$Schema, "RoutingFormResponseDenormalized">; +export type RoutingFormResponseDenormalizedInclude = $IncludeInput<$Schema, "RoutingFormResponseDenormalized">; +export type RoutingFormResponseDenormalizedOmit = $OmitInput<$Schema, "RoutingFormResponseDenormalized">; +export type RoutingFormResponseDenormalizedGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "RoutingFormResponseDenormalized", Options, Args>; +export type FeedbackFindManyArgs = $FindManyArgs<$Schema, "Feedback">; +export type FeedbackFindUniqueArgs = $FindUniqueArgs<$Schema, "Feedback">; +export type FeedbackFindFirstArgs = $FindFirstArgs<$Schema, "Feedback">; +export type FeedbackCreateArgs = $CreateArgs<$Schema, "Feedback">; +export type FeedbackCreateManyArgs = $CreateManyArgs<$Schema, "Feedback">; +export type FeedbackCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Feedback">; +export type FeedbackUpdateArgs = $UpdateArgs<$Schema, "Feedback">; +export type FeedbackUpdateManyArgs = $UpdateManyArgs<$Schema, "Feedback">; +export type FeedbackUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Feedback">; +export type FeedbackUpsertArgs = $UpsertArgs<$Schema, "Feedback">; +export type FeedbackDeleteArgs = $DeleteArgs<$Schema, "Feedback">; +export type FeedbackDeleteManyArgs = $DeleteManyArgs<$Schema, "Feedback">; +export type FeedbackCountArgs = $CountArgs<$Schema, "Feedback">; +export type FeedbackAggregateArgs = $AggregateArgs<$Schema, "Feedback">; +export type FeedbackGroupByArgs = $GroupByArgs<$Schema, "Feedback">; +export type FeedbackWhereInput = $WhereInput<$Schema, "Feedback">; +export type FeedbackSelect = $SelectInput<$Schema, "Feedback">; +export type FeedbackInclude = $IncludeInput<$Schema, "Feedback">; +export type FeedbackOmit = $OmitInput<$Schema, "Feedback">; +export type FeedbackGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Feedback", Options, Args>; +export type WorkflowStepFindManyArgs = $FindManyArgs<$Schema, "WorkflowStep">; +export type WorkflowStepFindUniqueArgs = $FindUniqueArgs<$Schema, "WorkflowStep">; +export type WorkflowStepFindFirstArgs = $FindFirstArgs<$Schema, "WorkflowStep">; +export type WorkflowStepCreateArgs = $CreateArgs<$Schema, "WorkflowStep">; +export type WorkflowStepCreateManyArgs = $CreateManyArgs<$Schema, "WorkflowStep">; +export type WorkflowStepCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "WorkflowStep">; +export type WorkflowStepUpdateArgs = $UpdateArgs<$Schema, "WorkflowStep">; +export type WorkflowStepUpdateManyArgs = $UpdateManyArgs<$Schema, "WorkflowStep">; +export type WorkflowStepUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "WorkflowStep">; +export type WorkflowStepUpsertArgs = $UpsertArgs<$Schema, "WorkflowStep">; +export type WorkflowStepDeleteArgs = $DeleteArgs<$Schema, "WorkflowStep">; +export type WorkflowStepDeleteManyArgs = $DeleteManyArgs<$Schema, "WorkflowStep">; +export type WorkflowStepCountArgs = $CountArgs<$Schema, "WorkflowStep">; +export type WorkflowStepAggregateArgs = $AggregateArgs<$Schema, "WorkflowStep">; +export type WorkflowStepGroupByArgs = $GroupByArgs<$Schema, "WorkflowStep">; +export type WorkflowStepWhereInput = $WhereInput<$Schema, "WorkflowStep">; +export type WorkflowStepSelect = $SelectInput<$Schema, "WorkflowStep">; +export type WorkflowStepInclude = $IncludeInput<$Schema, "WorkflowStep">; +export type WorkflowStepOmit = $OmitInput<$Schema, "WorkflowStep">; +export type WorkflowStepGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "WorkflowStep", Options, Args>; +export type WorkflowFindManyArgs = $FindManyArgs<$Schema, "Workflow">; +export type WorkflowFindUniqueArgs = $FindUniqueArgs<$Schema, "Workflow">; +export type WorkflowFindFirstArgs = $FindFirstArgs<$Schema, "Workflow">; +export type WorkflowCreateArgs = $CreateArgs<$Schema, "Workflow">; +export type WorkflowCreateManyArgs = $CreateManyArgs<$Schema, "Workflow">; +export type WorkflowCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Workflow">; +export type WorkflowUpdateArgs = $UpdateArgs<$Schema, "Workflow">; +export type WorkflowUpdateManyArgs = $UpdateManyArgs<$Schema, "Workflow">; +export type WorkflowUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Workflow">; +export type WorkflowUpsertArgs = $UpsertArgs<$Schema, "Workflow">; +export type WorkflowDeleteArgs = $DeleteArgs<$Schema, "Workflow">; +export type WorkflowDeleteManyArgs = $DeleteManyArgs<$Schema, "Workflow">; +export type WorkflowCountArgs = $CountArgs<$Schema, "Workflow">; +export type WorkflowAggregateArgs = $AggregateArgs<$Schema, "Workflow">; +export type WorkflowGroupByArgs = $GroupByArgs<$Schema, "Workflow">; +export type WorkflowWhereInput = $WhereInput<$Schema, "Workflow">; +export type WorkflowSelect = $SelectInput<$Schema, "Workflow">; +export type WorkflowInclude = $IncludeInput<$Schema, "Workflow">; +export type WorkflowOmit = $OmitInput<$Schema, "Workflow">; +export type WorkflowGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Workflow", Options, Args>; +export type AIPhoneCallConfigurationFindManyArgs = $FindManyArgs<$Schema, "AIPhoneCallConfiguration">; +export type AIPhoneCallConfigurationFindUniqueArgs = $FindUniqueArgs<$Schema, "AIPhoneCallConfiguration">; +export type AIPhoneCallConfigurationFindFirstArgs = $FindFirstArgs<$Schema, "AIPhoneCallConfiguration">; +export type AIPhoneCallConfigurationCreateArgs = $CreateArgs<$Schema, "AIPhoneCallConfiguration">; +export type AIPhoneCallConfigurationCreateManyArgs = $CreateManyArgs<$Schema, "AIPhoneCallConfiguration">; +export type AIPhoneCallConfigurationCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "AIPhoneCallConfiguration">; +export type AIPhoneCallConfigurationUpdateArgs = $UpdateArgs<$Schema, "AIPhoneCallConfiguration">; +export type AIPhoneCallConfigurationUpdateManyArgs = $UpdateManyArgs<$Schema, "AIPhoneCallConfiguration">; +export type AIPhoneCallConfigurationUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "AIPhoneCallConfiguration">; +export type AIPhoneCallConfigurationUpsertArgs = $UpsertArgs<$Schema, "AIPhoneCallConfiguration">; +export type AIPhoneCallConfigurationDeleteArgs = $DeleteArgs<$Schema, "AIPhoneCallConfiguration">; +export type AIPhoneCallConfigurationDeleteManyArgs = $DeleteManyArgs<$Schema, "AIPhoneCallConfiguration">; +export type AIPhoneCallConfigurationCountArgs = $CountArgs<$Schema, "AIPhoneCallConfiguration">; +export type AIPhoneCallConfigurationAggregateArgs = $AggregateArgs<$Schema, "AIPhoneCallConfiguration">; +export type AIPhoneCallConfigurationGroupByArgs = $GroupByArgs<$Schema, "AIPhoneCallConfiguration">; +export type AIPhoneCallConfigurationWhereInput = $WhereInput<$Schema, "AIPhoneCallConfiguration">; +export type AIPhoneCallConfigurationSelect = $SelectInput<$Schema, "AIPhoneCallConfiguration">; +export type AIPhoneCallConfigurationInclude = $IncludeInput<$Schema, "AIPhoneCallConfiguration">; +export type AIPhoneCallConfigurationOmit = $OmitInput<$Schema, "AIPhoneCallConfiguration">; +export type AIPhoneCallConfigurationGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "AIPhoneCallConfiguration", Options, Args>; +export type WorkflowsOnEventTypesFindManyArgs = $FindManyArgs<$Schema, "WorkflowsOnEventTypes">; +export type WorkflowsOnEventTypesFindUniqueArgs = $FindUniqueArgs<$Schema, "WorkflowsOnEventTypes">; +export type WorkflowsOnEventTypesFindFirstArgs = $FindFirstArgs<$Schema, "WorkflowsOnEventTypes">; +export type WorkflowsOnEventTypesCreateArgs = $CreateArgs<$Schema, "WorkflowsOnEventTypes">; +export type WorkflowsOnEventTypesCreateManyArgs = $CreateManyArgs<$Schema, "WorkflowsOnEventTypes">; +export type WorkflowsOnEventTypesCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "WorkflowsOnEventTypes">; +export type WorkflowsOnEventTypesUpdateArgs = $UpdateArgs<$Schema, "WorkflowsOnEventTypes">; +export type WorkflowsOnEventTypesUpdateManyArgs = $UpdateManyArgs<$Schema, "WorkflowsOnEventTypes">; +export type WorkflowsOnEventTypesUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "WorkflowsOnEventTypes">; +export type WorkflowsOnEventTypesUpsertArgs = $UpsertArgs<$Schema, "WorkflowsOnEventTypes">; +export type WorkflowsOnEventTypesDeleteArgs = $DeleteArgs<$Schema, "WorkflowsOnEventTypes">; +export type WorkflowsOnEventTypesDeleteManyArgs = $DeleteManyArgs<$Schema, "WorkflowsOnEventTypes">; +export type WorkflowsOnEventTypesCountArgs = $CountArgs<$Schema, "WorkflowsOnEventTypes">; +export type WorkflowsOnEventTypesAggregateArgs = $AggregateArgs<$Schema, "WorkflowsOnEventTypes">; +export type WorkflowsOnEventTypesGroupByArgs = $GroupByArgs<$Schema, "WorkflowsOnEventTypes">; +export type WorkflowsOnEventTypesWhereInput = $WhereInput<$Schema, "WorkflowsOnEventTypes">; +export type WorkflowsOnEventTypesSelect = $SelectInput<$Schema, "WorkflowsOnEventTypes">; +export type WorkflowsOnEventTypesInclude = $IncludeInput<$Schema, "WorkflowsOnEventTypes">; +export type WorkflowsOnEventTypesOmit = $OmitInput<$Schema, "WorkflowsOnEventTypes">; +export type WorkflowsOnEventTypesGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "WorkflowsOnEventTypes", Options, Args>; +export type WorkflowsOnTeamsFindManyArgs = $FindManyArgs<$Schema, "WorkflowsOnTeams">; +export type WorkflowsOnTeamsFindUniqueArgs = $FindUniqueArgs<$Schema, "WorkflowsOnTeams">; +export type WorkflowsOnTeamsFindFirstArgs = $FindFirstArgs<$Schema, "WorkflowsOnTeams">; +export type WorkflowsOnTeamsCreateArgs = $CreateArgs<$Schema, "WorkflowsOnTeams">; +export type WorkflowsOnTeamsCreateManyArgs = $CreateManyArgs<$Schema, "WorkflowsOnTeams">; +export type WorkflowsOnTeamsCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "WorkflowsOnTeams">; +export type WorkflowsOnTeamsUpdateArgs = $UpdateArgs<$Schema, "WorkflowsOnTeams">; +export type WorkflowsOnTeamsUpdateManyArgs = $UpdateManyArgs<$Schema, "WorkflowsOnTeams">; +export type WorkflowsOnTeamsUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "WorkflowsOnTeams">; +export type WorkflowsOnTeamsUpsertArgs = $UpsertArgs<$Schema, "WorkflowsOnTeams">; +export type WorkflowsOnTeamsDeleteArgs = $DeleteArgs<$Schema, "WorkflowsOnTeams">; +export type WorkflowsOnTeamsDeleteManyArgs = $DeleteManyArgs<$Schema, "WorkflowsOnTeams">; +export type WorkflowsOnTeamsCountArgs = $CountArgs<$Schema, "WorkflowsOnTeams">; +export type WorkflowsOnTeamsAggregateArgs = $AggregateArgs<$Schema, "WorkflowsOnTeams">; +export type WorkflowsOnTeamsGroupByArgs = $GroupByArgs<$Schema, "WorkflowsOnTeams">; +export type WorkflowsOnTeamsWhereInput = $WhereInput<$Schema, "WorkflowsOnTeams">; +export type WorkflowsOnTeamsSelect = $SelectInput<$Schema, "WorkflowsOnTeams">; +export type WorkflowsOnTeamsInclude = $IncludeInput<$Schema, "WorkflowsOnTeams">; +export type WorkflowsOnTeamsOmit = $OmitInput<$Schema, "WorkflowsOnTeams">; +export type WorkflowsOnTeamsGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "WorkflowsOnTeams", Options, Args>; +export type DeploymentFindManyArgs = $FindManyArgs<$Schema, "Deployment">; +export type DeploymentFindUniqueArgs = $FindUniqueArgs<$Schema, "Deployment">; +export type DeploymentFindFirstArgs = $FindFirstArgs<$Schema, "Deployment">; +export type DeploymentCreateArgs = $CreateArgs<$Schema, "Deployment">; +export type DeploymentCreateManyArgs = $CreateManyArgs<$Schema, "Deployment">; +export type DeploymentCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Deployment">; +export type DeploymentUpdateArgs = $UpdateArgs<$Schema, "Deployment">; +export type DeploymentUpdateManyArgs = $UpdateManyArgs<$Schema, "Deployment">; +export type DeploymentUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Deployment">; +export type DeploymentUpsertArgs = $UpsertArgs<$Schema, "Deployment">; +export type DeploymentDeleteArgs = $DeleteArgs<$Schema, "Deployment">; +export type DeploymentDeleteManyArgs = $DeleteManyArgs<$Schema, "Deployment">; +export type DeploymentCountArgs = $CountArgs<$Schema, "Deployment">; +export type DeploymentAggregateArgs = $AggregateArgs<$Schema, "Deployment">; +export type DeploymentGroupByArgs = $GroupByArgs<$Schema, "Deployment">; +export type DeploymentWhereInput = $WhereInput<$Schema, "Deployment">; +export type DeploymentSelect = $SelectInput<$Schema, "Deployment">; +export type DeploymentInclude = $IncludeInput<$Schema, "Deployment">; +export type DeploymentOmit = $OmitInput<$Schema, "Deployment">; +export type DeploymentGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Deployment", Options, Args>; +export type WorkflowReminderFindManyArgs = $FindManyArgs<$Schema, "WorkflowReminder">; +export type WorkflowReminderFindUniqueArgs = $FindUniqueArgs<$Schema, "WorkflowReminder">; +export type WorkflowReminderFindFirstArgs = $FindFirstArgs<$Schema, "WorkflowReminder">; +export type WorkflowReminderCreateArgs = $CreateArgs<$Schema, "WorkflowReminder">; +export type WorkflowReminderCreateManyArgs = $CreateManyArgs<$Schema, "WorkflowReminder">; +export type WorkflowReminderCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "WorkflowReminder">; +export type WorkflowReminderUpdateArgs = $UpdateArgs<$Schema, "WorkflowReminder">; +export type WorkflowReminderUpdateManyArgs = $UpdateManyArgs<$Schema, "WorkflowReminder">; +export type WorkflowReminderUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "WorkflowReminder">; +export type WorkflowReminderUpsertArgs = $UpsertArgs<$Schema, "WorkflowReminder">; +export type WorkflowReminderDeleteArgs = $DeleteArgs<$Schema, "WorkflowReminder">; +export type WorkflowReminderDeleteManyArgs = $DeleteManyArgs<$Schema, "WorkflowReminder">; +export type WorkflowReminderCountArgs = $CountArgs<$Schema, "WorkflowReminder">; +export type WorkflowReminderAggregateArgs = $AggregateArgs<$Schema, "WorkflowReminder">; +export type WorkflowReminderGroupByArgs = $GroupByArgs<$Schema, "WorkflowReminder">; +export type WorkflowReminderWhereInput = $WhereInput<$Schema, "WorkflowReminder">; +export type WorkflowReminderSelect = $SelectInput<$Schema, "WorkflowReminder">; +export type WorkflowReminderInclude = $IncludeInput<$Schema, "WorkflowReminder">; +export type WorkflowReminderOmit = $OmitInput<$Schema, "WorkflowReminder">; +export type WorkflowReminderGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "WorkflowReminder", Options, Args>; +export type WebhookScheduledTriggersFindManyArgs = $FindManyArgs<$Schema, "WebhookScheduledTriggers">; +export type WebhookScheduledTriggersFindUniqueArgs = $FindUniqueArgs<$Schema, "WebhookScheduledTriggers">; +export type WebhookScheduledTriggersFindFirstArgs = $FindFirstArgs<$Schema, "WebhookScheduledTriggers">; +export type WebhookScheduledTriggersCreateArgs = $CreateArgs<$Schema, "WebhookScheduledTriggers">; +export type WebhookScheduledTriggersCreateManyArgs = $CreateManyArgs<$Schema, "WebhookScheduledTriggers">; +export type WebhookScheduledTriggersCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "WebhookScheduledTriggers">; +export type WebhookScheduledTriggersUpdateArgs = $UpdateArgs<$Schema, "WebhookScheduledTriggers">; +export type WebhookScheduledTriggersUpdateManyArgs = $UpdateManyArgs<$Schema, "WebhookScheduledTriggers">; +export type WebhookScheduledTriggersUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "WebhookScheduledTriggers">; +export type WebhookScheduledTriggersUpsertArgs = $UpsertArgs<$Schema, "WebhookScheduledTriggers">; +export type WebhookScheduledTriggersDeleteArgs = $DeleteArgs<$Schema, "WebhookScheduledTriggers">; +export type WebhookScheduledTriggersDeleteManyArgs = $DeleteManyArgs<$Schema, "WebhookScheduledTriggers">; +export type WebhookScheduledTriggersCountArgs = $CountArgs<$Schema, "WebhookScheduledTriggers">; +export type WebhookScheduledTriggersAggregateArgs = $AggregateArgs<$Schema, "WebhookScheduledTriggers">; +export type WebhookScheduledTriggersGroupByArgs = $GroupByArgs<$Schema, "WebhookScheduledTriggers">; +export type WebhookScheduledTriggersWhereInput = $WhereInput<$Schema, "WebhookScheduledTriggers">; +export type WebhookScheduledTriggersSelect = $SelectInput<$Schema, "WebhookScheduledTriggers">; +export type WebhookScheduledTriggersInclude = $IncludeInput<$Schema, "WebhookScheduledTriggers">; +export type WebhookScheduledTriggersOmit = $OmitInput<$Schema, "WebhookScheduledTriggers">; +export type WebhookScheduledTriggersGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "WebhookScheduledTriggers", Options, Args>; +export type BookingSeatFindManyArgs = $FindManyArgs<$Schema, "BookingSeat">; +export type BookingSeatFindUniqueArgs = $FindUniqueArgs<$Schema, "BookingSeat">; +export type BookingSeatFindFirstArgs = $FindFirstArgs<$Schema, "BookingSeat">; +export type BookingSeatCreateArgs = $CreateArgs<$Schema, "BookingSeat">; +export type BookingSeatCreateManyArgs = $CreateManyArgs<$Schema, "BookingSeat">; +export type BookingSeatCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "BookingSeat">; +export type BookingSeatUpdateArgs = $UpdateArgs<$Schema, "BookingSeat">; +export type BookingSeatUpdateManyArgs = $UpdateManyArgs<$Schema, "BookingSeat">; +export type BookingSeatUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "BookingSeat">; +export type BookingSeatUpsertArgs = $UpsertArgs<$Schema, "BookingSeat">; +export type BookingSeatDeleteArgs = $DeleteArgs<$Schema, "BookingSeat">; +export type BookingSeatDeleteManyArgs = $DeleteManyArgs<$Schema, "BookingSeat">; +export type BookingSeatCountArgs = $CountArgs<$Schema, "BookingSeat">; +export type BookingSeatAggregateArgs = $AggregateArgs<$Schema, "BookingSeat">; +export type BookingSeatGroupByArgs = $GroupByArgs<$Schema, "BookingSeat">; +export type BookingSeatWhereInput = $WhereInput<$Schema, "BookingSeat">; +export type BookingSeatSelect = $SelectInput<$Schema, "BookingSeat">; +export type BookingSeatInclude = $IncludeInput<$Schema, "BookingSeat">; +export type BookingSeatOmit = $OmitInput<$Schema, "BookingSeat">; +export type BookingSeatGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "BookingSeat", Options, Args>; +export type VerifiedNumberFindManyArgs = $FindManyArgs<$Schema, "VerifiedNumber">; +export type VerifiedNumberFindUniqueArgs = $FindUniqueArgs<$Schema, "VerifiedNumber">; +export type VerifiedNumberFindFirstArgs = $FindFirstArgs<$Schema, "VerifiedNumber">; +export type VerifiedNumberCreateArgs = $CreateArgs<$Schema, "VerifiedNumber">; +export type VerifiedNumberCreateManyArgs = $CreateManyArgs<$Schema, "VerifiedNumber">; +export type VerifiedNumberCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "VerifiedNumber">; +export type VerifiedNumberUpdateArgs = $UpdateArgs<$Schema, "VerifiedNumber">; +export type VerifiedNumberUpdateManyArgs = $UpdateManyArgs<$Schema, "VerifiedNumber">; +export type VerifiedNumberUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "VerifiedNumber">; +export type VerifiedNumberUpsertArgs = $UpsertArgs<$Schema, "VerifiedNumber">; +export type VerifiedNumberDeleteArgs = $DeleteArgs<$Schema, "VerifiedNumber">; +export type VerifiedNumberDeleteManyArgs = $DeleteManyArgs<$Schema, "VerifiedNumber">; +export type VerifiedNumberCountArgs = $CountArgs<$Schema, "VerifiedNumber">; +export type VerifiedNumberAggregateArgs = $AggregateArgs<$Schema, "VerifiedNumber">; +export type VerifiedNumberGroupByArgs = $GroupByArgs<$Schema, "VerifiedNumber">; +export type VerifiedNumberWhereInput = $WhereInput<$Schema, "VerifiedNumber">; +export type VerifiedNumberSelect = $SelectInput<$Schema, "VerifiedNumber">; +export type VerifiedNumberInclude = $IncludeInput<$Schema, "VerifiedNumber">; +export type VerifiedNumberOmit = $OmitInput<$Schema, "VerifiedNumber">; +export type VerifiedNumberGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "VerifiedNumber", Options, Args>; +export type VerifiedEmailFindManyArgs = $FindManyArgs<$Schema, "VerifiedEmail">; +export type VerifiedEmailFindUniqueArgs = $FindUniqueArgs<$Schema, "VerifiedEmail">; +export type VerifiedEmailFindFirstArgs = $FindFirstArgs<$Schema, "VerifiedEmail">; +export type VerifiedEmailCreateArgs = $CreateArgs<$Schema, "VerifiedEmail">; +export type VerifiedEmailCreateManyArgs = $CreateManyArgs<$Schema, "VerifiedEmail">; +export type VerifiedEmailCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "VerifiedEmail">; +export type VerifiedEmailUpdateArgs = $UpdateArgs<$Schema, "VerifiedEmail">; +export type VerifiedEmailUpdateManyArgs = $UpdateManyArgs<$Schema, "VerifiedEmail">; +export type VerifiedEmailUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "VerifiedEmail">; +export type VerifiedEmailUpsertArgs = $UpsertArgs<$Schema, "VerifiedEmail">; +export type VerifiedEmailDeleteArgs = $DeleteArgs<$Schema, "VerifiedEmail">; +export type VerifiedEmailDeleteManyArgs = $DeleteManyArgs<$Schema, "VerifiedEmail">; +export type VerifiedEmailCountArgs = $CountArgs<$Schema, "VerifiedEmail">; +export type VerifiedEmailAggregateArgs = $AggregateArgs<$Schema, "VerifiedEmail">; +export type VerifiedEmailGroupByArgs = $GroupByArgs<$Schema, "VerifiedEmail">; +export type VerifiedEmailWhereInput = $WhereInput<$Schema, "VerifiedEmail">; +export type VerifiedEmailSelect = $SelectInput<$Schema, "VerifiedEmail">; +export type VerifiedEmailInclude = $IncludeInput<$Schema, "VerifiedEmail">; +export type VerifiedEmailOmit = $OmitInput<$Schema, "VerifiedEmail">; +export type VerifiedEmailGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "VerifiedEmail", Options, Args>; +export type FeatureFindManyArgs = $FindManyArgs<$Schema, "Feature">; +export type FeatureFindUniqueArgs = $FindUniqueArgs<$Schema, "Feature">; +export type FeatureFindFirstArgs = $FindFirstArgs<$Schema, "Feature">; +export type FeatureCreateArgs = $CreateArgs<$Schema, "Feature">; +export type FeatureCreateManyArgs = $CreateManyArgs<$Schema, "Feature">; +export type FeatureCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Feature">; +export type FeatureUpdateArgs = $UpdateArgs<$Schema, "Feature">; +export type FeatureUpdateManyArgs = $UpdateManyArgs<$Schema, "Feature">; +export type FeatureUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Feature">; +export type FeatureUpsertArgs = $UpsertArgs<$Schema, "Feature">; +export type FeatureDeleteArgs = $DeleteArgs<$Schema, "Feature">; +export type FeatureDeleteManyArgs = $DeleteManyArgs<$Schema, "Feature">; +export type FeatureCountArgs = $CountArgs<$Schema, "Feature">; +export type FeatureAggregateArgs = $AggregateArgs<$Schema, "Feature">; +export type FeatureGroupByArgs = $GroupByArgs<$Schema, "Feature">; +export type FeatureWhereInput = $WhereInput<$Schema, "Feature">; +export type FeatureSelect = $SelectInput<$Schema, "Feature">; +export type FeatureInclude = $IncludeInput<$Schema, "Feature">; +export type FeatureOmit = $OmitInput<$Schema, "Feature">; +export type FeatureGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Feature", Options, Args>; +export type UserFeaturesFindManyArgs = $FindManyArgs<$Schema, "UserFeatures">; +export type UserFeaturesFindUniqueArgs = $FindUniqueArgs<$Schema, "UserFeatures">; +export type UserFeaturesFindFirstArgs = $FindFirstArgs<$Schema, "UserFeatures">; +export type UserFeaturesCreateArgs = $CreateArgs<$Schema, "UserFeatures">; +export type UserFeaturesCreateManyArgs = $CreateManyArgs<$Schema, "UserFeatures">; +export type UserFeaturesCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "UserFeatures">; +export type UserFeaturesUpdateArgs = $UpdateArgs<$Schema, "UserFeatures">; +export type UserFeaturesUpdateManyArgs = $UpdateManyArgs<$Schema, "UserFeatures">; +export type UserFeaturesUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "UserFeatures">; +export type UserFeaturesUpsertArgs = $UpsertArgs<$Schema, "UserFeatures">; +export type UserFeaturesDeleteArgs = $DeleteArgs<$Schema, "UserFeatures">; +export type UserFeaturesDeleteManyArgs = $DeleteManyArgs<$Schema, "UserFeatures">; +export type UserFeaturesCountArgs = $CountArgs<$Schema, "UserFeatures">; +export type UserFeaturesAggregateArgs = $AggregateArgs<$Schema, "UserFeatures">; +export type UserFeaturesGroupByArgs = $GroupByArgs<$Schema, "UserFeatures">; +export type UserFeaturesWhereInput = $WhereInput<$Schema, "UserFeatures">; +export type UserFeaturesSelect = $SelectInput<$Schema, "UserFeatures">; +export type UserFeaturesInclude = $IncludeInput<$Schema, "UserFeatures">; +export type UserFeaturesOmit = $OmitInput<$Schema, "UserFeatures">; +export type UserFeaturesGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "UserFeatures", Options, Args>; +export type TeamFeaturesFindManyArgs = $FindManyArgs<$Schema, "TeamFeatures">; +export type TeamFeaturesFindUniqueArgs = $FindUniqueArgs<$Schema, "TeamFeatures">; +export type TeamFeaturesFindFirstArgs = $FindFirstArgs<$Schema, "TeamFeatures">; +export type TeamFeaturesCreateArgs = $CreateArgs<$Schema, "TeamFeatures">; +export type TeamFeaturesCreateManyArgs = $CreateManyArgs<$Schema, "TeamFeatures">; +export type TeamFeaturesCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "TeamFeatures">; +export type TeamFeaturesUpdateArgs = $UpdateArgs<$Schema, "TeamFeatures">; +export type TeamFeaturesUpdateManyArgs = $UpdateManyArgs<$Schema, "TeamFeatures">; +export type TeamFeaturesUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "TeamFeatures">; +export type TeamFeaturesUpsertArgs = $UpsertArgs<$Schema, "TeamFeatures">; +export type TeamFeaturesDeleteArgs = $DeleteArgs<$Schema, "TeamFeatures">; +export type TeamFeaturesDeleteManyArgs = $DeleteManyArgs<$Schema, "TeamFeatures">; +export type TeamFeaturesCountArgs = $CountArgs<$Schema, "TeamFeatures">; +export type TeamFeaturesAggregateArgs = $AggregateArgs<$Schema, "TeamFeatures">; +export type TeamFeaturesGroupByArgs = $GroupByArgs<$Schema, "TeamFeatures">; +export type TeamFeaturesWhereInput = $WhereInput<$Schema, "TeamFeatures">; +export type TeamFeaturesSelect = $SelectInput<$Schema, "TeamFeatures">; +export type TeamFeaturesInclude = $IncludeInput<$Schema, "TeamFeatures">; +export type TeamFeaturesOmit = $OmitInput<$Schema, "TeamFeatures">; +export type TeamFeaturesGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "TeamFeatures", Options, Args>; +export type SelectedSlotsFindManyArgs = $FindManyArgs<$Schema, "SelectedSlots">; +export type SelectedSlotsFindUniqueArgs = $FindUniqueArgs<$Schema, "SelectedSlots">; +export type SelectedSlotsFindFirstArgs = $FindFirstArgs<$Schema, "SelectedSlots">; +export type SelectedSlotsCreateArgs = $CreateArgs<$Schema, "SelectedSlots">; +export type SelectedSlotsCreateManyArgs = $CreateManyArgs<$Schema, "SelectedSlots">; +export type SelectedSlotsCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "SelectedSlots">; +export type SelectedSlotsUpdateArgs = $UpdateArgs<$Schema, "SelectedSlots">; +export type SelectedSlotsUpdateManyArgs = $UpdateManyArgs<$Schema, "SelectedSlots">; +export type SelectedSlotsUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "SelectedSlots">; +export type SelectedSlotsUpsertArgs = $UpsertArgs<$Schema, "SelectedSlots">; +export type SelectedSlotsDeleteArgs = $DeleteArgs<$Schema, "SelectedSlots">; +export type SelectedSlotsDeleteManyArgs = $DeleteManyArgs<$Schema, "SelectedSlots">; +export type SelectedSlotsCountArgs = $CountArgs<$Schema, "SelectedSlots">; +export type SelectedSlotsAggregateArgs = $AggregateArgs<$Schema, "SelectedSlots">; +export type SelectedSlotsGroupByArgs = $GroupByArgs<$Schema, "SelectedSlots">; +export type SelectedSlotsWhereInput = $WhereInput<$Schema, "SelectedSlots">; +export type SelectedSlotsSelect = $SelectInput<$Schema, "SelectedSlots">; +export type SelectedSlotsInclude = $IncludeInput<$Schema, "SelectedSlots">; +export type SelectedSlotsOmit = $OmitInput<$Schema, "SelectedSlots">; +export type SelectedSlotsGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "SelectedSlots", Options, Args>; +export type OAuthClientFindManyArgs = $FindManyArgs<$Schema, "OAuthClient">; +export type OAuthClientFindUniqueArgs = $FindUniqueArgs<$Schema, "OAuthClient">; +export type OAuthClientFindFirstArgs = $FindFirstArgs<$Schema, "OAuthClient">; +export type OAuthClientCreateArgs = $CreateArgs<$Schema, "OAuthClient">; +export type OAuthClientCreateManyArgs = $CreateManyArgs<$Schema, "OAuthClient">; +export type OAuthClientCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "OAuthClient">; +export type OAuthClientUpdateArgs = $UpdateArgs<$Schema, "OAuthClient">; +export type OAuthClientUpdateManyArgs = $UpdateManyArgs<$Schema, "OAuthClient">; +export type OAuthClientUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "OAuthClient">; +export type OAuthClientUpsertArgs = $UpsertArgs<$Schema, "OAuthClient">; +export type OAuthClientDeleteArgs = $DeleteArgs<$Schema, "OAuthClient">; +export type OAuthClientDeleteManyArgs = $DeleteManyArgs<$Schema, "OAuthClient">; +export type OAuthClientCountArgs = $CountArgs<$Schema, "OAuthClient">; +export type OAuthClientAggregateArgs = $AggregateArgs<$Schema, "OAuthClient">; +export type OAuthClientGroupByArgs = $GroupByArgs<$Schema, "OAuthClient">; +export type OAuthClientWhereInput = $WhereInput<$Schema, "OAuthClient">; +export type OAuthClientSelect = $SelectInput<$Schema, "OAuthClient">; +export type OAuthClientInclude = $IncludeInput<$Schema, "OAuthClient">; +export type OAuthClientOmit = $OmitInput<$Schema, "OAuthClient">; +export type OAuthClientGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "OAuthClient", Options, Args>; +export type AccessCodeFindManyArgs = $FindManyArgs<$Schema, "AccessCode">; +export type AccessCodeFindUniqueArgs = $FindUniqueArgs<$Schema, "AccessCode">; +export type AccessCodeFindFirstArgs = $FindFirstArgs<$Schema, "AccessCode">; +export type AccessCodeCreateArgs = $CreateArgs<$Schema, "AccessCode">; +export type AccessCodeCreateManyArgs = $CreateManyArgs<$Schema, "AccessCode">; +export type AccessCodeCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "AccessCode">; +export type AccessCodeUpdateArgs = $UpdateArgs<$Schema, "AccessCode">; +export type AccessCodeUpdateManyArgs = $UpdateManyArgs<$Schema, "AccessCode">; +export type AccessCodeUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "AccessCode">; +export type AccessCodeUpsertArgs = $UpsertArgs<$Schema, "AccessCode">; +export type AccessCodeDeleteArgs = $DeleteArgs<$Schema, "AccessCode">; +export type AccessCodeDeleteManyArgs = $DeleteManyArgs<$Schema, "AccessCode">; +export type AccessCodeCountArgs = $CountArgs<$Schema, "AccessCode">; +export type AccessCodeAggregateArgs = $AggregateArgs<$Schema, "AccessCode">; +export type AccessCodeGroupByArgs = $GroupByArgs<$Schema, "AccessCode">; +export type AccessCodeWhereInput = $WhereInput<$Schema, "AccessCode">; +export type AccessCodeSelect = $SelectInput<$Schema, "AccessCode">; +export type AccessCodeInclude = $IncludeInput<$Schema, "AccessCode">; +export type AccessCodeOmit = $OmitInput<$Schema, "AccessCode">; +export type AccessCodeGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "AccessCode", Options, Args>; +export type BookingTimeStatusFindManyArgs = $FindManyArgs<$Schema, "BookingTimeStatus">; +export type BookingTimeStatusFindUniqueArgs = $FindUniqueArgs<$Schema, "BookingTimeStatus">; +export type BookingTimeStatusFindFirstArgs = $FindFirstArgs<$Schema, "BookingTimeStatus">; +export type BookingTimeStatusCreateArgs = $CreateArgs<$Schema, "BookingTimeStatus">; +export type BookingTimeStatusCreateManyArgs = $CreateManyArgs<$Schema, "BookingTimeStatus">; +export type BookingTimeStatusCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "BookingTimeStatus">; +export type BookingTimeStatusUpdateArgs = $UpdateArgs<$Schema, "BookingTimeStatus">; +export type BookingTimeStatusUpdateManyArgs = $UpdateManyArgs<$Schema, "BookingTimeStatus">; +export type BookingTimeStatusUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "BookingTimeStatus">; +export type BookingTimeStatusUpsertArgs = $UpsertArgs<$Schema, "BookingTimeStatus">; +export type BookingTimeStatusDeleteArgs = $DeleteArgs<$Schema, "BookingTimeStatus">; +export type BookingTimeStatusDeleteManyArgs = $DeleteManyArgs<$Schema, "BookingTimeStatus">; +export type BookingTimeStatusCountArgs = $CountArgs<$Schema, "BookingTimeStatus">; +export type BookingTimeStatusAggregateArgs = $AggregateArgs<$Schema, "BookingTimeStatus">; +export type BookingTimeStatusGroupByArgs = $GroupByArgs<$Schema, "BookingTimeStatus">; +export type BookingTimeStatusWhereInput = $WhereInput<$Schema, "BookingTimeStatus">; +export type BookingTimeStatusSelect = $SelectInput<$Schema, "BookingTimeStatus">; +export type BookingTimeStatusInclude = $IncludeInput<$Schema, "BookingTimeStatus">; +export type BookingTimeStatusOmit = $OmitInput<$Schema, "BookingTimeStatus">; +export type BookingTimeStatusGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "BookingTimeStatus", Options, Args>; +export type BookingDenormalizedFindManyArgs = $FindManyArgs<$Schema, "BookingDenormalized">; +export type BookingDenormalizedFindUniqueArgs = $FindUniqueArgs<$Schema, "BookingDenormalized">; +export type BookingDenormalizedFindFirstArgs = $FindFirstArgs<$Schema, "BookingDenormalized">; +export type BookingDenormalizedCreateArgs = $CreateArgs<$Schema, "BookingDenormalized">; +export type BookingDenormalizedCreateManyArgs = $CreateManyArgs<$Schema, "BookingDenormalized">; +export type BookingDenormalizedCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "BookingDenormalized">; +export type BookingDenormalizedUpdateArgs = $UpdateArgs<$Schema, "BookingDenormalized">; +export type BookingDenormalizedUpdateManyArgs = $UpdateManyArgs<$Schema, "BookingDenormalized">; +export type BookingDenormalizedUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "BookingDenormalized">; +export type BookingDenormalizedUpsertArgs = $UpsertArgs<$Schema, "BookingDenormalized">; +export type BookingDenormalizedDeleteArgs = $DeleteArgs<$Schema, "BookingDenormalized">; +export type BookingDenormalizedDeleteManyArgs = $DeleteManyArgs<$Schema, "BookingDenormalized">; +export type BookingDenormalizedCountArgs = $CountArgs<$Schema, "BookingDenormalized">; +export type BookingDenormalizedAggregateArgs = $AggregateArgs<$Schema, "BookingDenormalized">; +export type BookingDenormalizedGroupByArgs = $GroupByArgs<$Schema, "BookingDenormalized">; +export type BookingDenormalizedWhereInput = $WhereInput<$Schema, "BookingDenormalized">; +export type BookingDenormalizedSelect = $SelectInput<$Schema, "BookingDenormalized">; +export type BookingDenormalizedInclude = $IncludeInput<$Schema, "BookingDenormalized">; +export type BookingDenormalizedOmit = $OmitInput<$Schema, "BookingDenormalized">; +export type BookingDenormalizedGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "BookingDenormalized", Options, Args>; +export type BookingTimeStatusDenormalizedFindManyArgs = $FindManyArgs<$Schema, "BookingTimeStatusDenormalized">; +export type BookingTimeStatusDenormalizedFindUniqueArgs = $FindUniqueArgs<$Schema, "BookingTimeStatusDenormalized">; +export type BookingTimeStatusDenormalizedFindFirstArgs = $FindFirstArgs<$Schema, "BookingTimeStatusDenormalized">; +export type BookingTimeStatusDenormalizedCreateArgs = $CreateArgs<$Schema, "BookingTimeStatusDenormalized">; +export type BookingTimeStatusDenormalizedCreateManyArgs = $CreateManyArgs<$Schema, "BookingTimeStatusDenormalized">; +export type BookingTimeStatusDenormalizedCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "BookingTimeStatusDenormalized">; +export type BookingTimeStatusDenormalizedUpdateArgs = $UpdateArgs<$Schema, "BookingTimeStatusDenormalized">; +export type BookingTimeStatusDenormalizedUpdateManyArgs = $UpdateManyArgs<$Schema, "BookingTimeStatusDenormalized">; +export type BookingTimeStatusDenormalizedUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "BookingTimeStatusDenormalized">; +export type BookingTimeStatusDenormalizedUpsertArgs = $UpsertArgs<$Schema, "BookingTimeStatusDenormalized">; +export type BookingTimeStatusDenormalizedDeleteArgs = $DeleteArgs<$Schema, "BookingTimeStatusDenormalized">; +export type BookingTimeStatusDenormalizedDeleteManyArgs = $DeleteManyArgs<$Schema, "BookingTimeStatusDenormalized">; +export type BookingTimeStatusDenormalizedCountArgs = $CountArgs<$Schema, "BookingTimeStatusDenormalized">; +export type BookingTimeStatusDenormalizedAggregateArgs = $AggregateArgs<$Schema, "BookingTimeStatusDenormalized">; +export type BookingTimeStatusDenormalizedGroupByArgs = $GroupByArgs<$Schema, "BookingTimeStatusDenormalized">; +export type BookingTimeStatusDenormalizedWhereInput = $WhereInput<$Schema, "BookingTimeStatusDenormalized">; +export type BookingTimeStatusDenormalizedSelect = $SelectInput<$Schema, "BookingTimeStatusDenormalized">; +export type BookingTimeStatusDenormalizedInclude = $IncludeInput<$Schema, "BookingTimeStatusDenormalized">; +export type BookingTimeStatusDenormalizedOmit = $OmitInput<$Schema, "BookingTimeStatusDenormalized">; +export type BookingTimeStatusDenormalizedGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "BookingTimeStatusDenormalized", Options, Args>; +export type CalendarCacheFindManyArgs = $FindManyArgs<$Schema, "CalendarCache">; +export type CalendarCacheFindUniqueArgs = $FindUniqueArgs<$Schema, "CalendarCache">; +export type CalendarCacheFindFirstArgs = $FindFirstArgs<$Schema, "CalendarCache">; +export type CalendarCacheCreateArgs = $CreateArgs<$Schema, "CalendarCache">; +export type CalendarCacheCreateManyArgs = $CreateManyArgs<$Schema, "CalendarCache">; +export type CalendarCacheCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "CalendarCache">; +export type CalendarCacheUpdateArgs = $UpdateArgs<$Schema, "CalendarCache">; +export type CalendarCacheUpdateManyArgs = $UpdateManyArgs<$Schema, "CalendarCache">; +export type CalendarCacheUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "CalendarCache">; +export type CalendarCacheUpsertArgs = $UpsertArgs<$Schema, "CalendarCache">; +export type CalendarCacheDeleteArgs = $DeleteArgs<$Schema, "CalendarCache">; +export type CalendarCacheDeleteManyArgs = $DeleteManyArgs<$Schema, "CalendarCache">; +export type CalendarCacheCountArgs = $CountArgs<$Schema, "CalendarCache">; +export type CalendarCacheAggregateArgs = $AggregateArgs<$Schema, "CalendarCache">; +export type CalendarCacheGroupByArgs = $GroupByArgs<$Schema, "CalendarCache">; +export type CalendarCacheWhereInput = $WhereInput<$Schema, "CalendarCache">; +export type CalendarCacheSelect = $SelectInput<$Schema, "CalendarCache">; +export type CalendarCacheInclude = $IncludeInput<$Schema, "CalendarCache">; +export type CalendarCacheOmit = $OmitInput<$Schema, "CalendarCache">; +export type CalendarCacheGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "CalendarCache", Options, Args>; +export type TempOrgRedirectFindManyArgs = $FindManyArgs<$Schema, "TempOrgRedirect">; +export type TempOrgRedirectFindUniqueArgs = $FindUniqueArgs<$Schema, "TempOrgRedirect">; +export type TempOrgRedirectFindFirstArgs = $FindFirstArgs<$Schema, "TempOrgRedirect">; +export type TempOrgRedirectCreateArgs = $CreateArgs<$Schema, "TempOrgRedirect">; +export type TempOrgRedirectCreateManyArgs = $CreateManyArgs<$Schema, "TempOrgRedirect">; +export type TempOrgRedirectCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "TempOrgRedirect">; +export type TempOrgRedirectUpdateArgs = $UpdateArgs<$Schema, "TempOrgRedirect">; +export type TempOrgRedirectUpdateManyArgs = $UpdateManyArgs<$Schema, "TempOrgRedirect">; +export type TempOrgRedirectUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "TempOrgRedirect">; +export type TempOrgRedirectUpsertArgs = $UpsertArgs<$Schema, "TempOrgRedirect">; +export type TempOrgRedirectDeleteArgs = $DeleteArgs<$Schema, "TempOrgRedirect">; +export type TempOrgRedirectDeleteManyArgs = $DeleteManyArgs<$Schema, "TempOrgRedirect">; +export type TempOrgRedirectCountArgs = $CountArgs<$Schema, "TempOrgRedirect">; +export type TempOrgRedirectAggregateArgs = $AggregateArgs<$Schema, "TempOrgRedirect">; +export type TempOrgRedirectGroupByArgs = $GroupByArgs<$Schema, "TempOrgRedirect">; +export type TempOrgRedirectWhereInput = $WhereInput<$Schema, "TempOrgRedirect">; +export type TempOrgRedirectSelect = $SelectInput<$Schema, "TempOrgRedirect">; +export type TempOrgRedirectInclude = $IncludeInput<$Schema, "TempOrgRedirect">; +export type TempOrgRedirectOmit = $OmitInput<$Schema, "TempOrgRedirect">; +export type TempOrgRedirectGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "TempOrgRedirect", Options, Args>; +export type AvatarFindManyArgs = $FindManyArgs<$Schema, "Avatar">; +export type AvatarFindUniqueArgs = $FindUniqueArgs<$Schema, "Avatar">; +export type AvatarFindFirstArgs = $FindFirstArgs<$Schema, "Avatar">; +export type AvatarCreateArgs = $CreateArgs<$Schema, "Avatar">; +export type AvatarCreateManyArgs = $CreateManyArgs<$Schema, "Avatar">; +export type AvatarCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Avatar">; +export type AvatarUpdateArgs = $UpdateArgs<$Schema, "Avatar">; +export type AvatarUpdateManyArgs = $UpdateManyArgs<$Schema, "Avatar">; +export type AvatarUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Avatar">; +export type AvatarUpsertArgs = $UpsertArgs<$Schema, "Avatar">; +export type AvatarDeleteArgs = $DeleteArgs<$Schema, "Avatar">; +export type AvatarDeleteManyArgs = $DeleteManyArgs<$Schema, "Avatar">; +export type AvatarCountArgs = $CountArgs<$Schema, "Avatar">; +export type AvatarAggregateArgs = $AggregateArgs<$Schema, "Avatar">; +export type AvatarGroupByArgs = $GroupByArgs<$Schema, "Avatar">; +export type AvatarWhereInput = $WhereInput<$Schema, "Avatar">; +export type AvatarSelect = $SelectInput<$Schema, "Avatar">; +export type AvatarInclude = $IncludeInput<$Schema, "Avatar">; +export type AvatarOmit = $OmitInput<$Schema, "Avatar">; +export type AvatarGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Avatar", Options, Args>; +export type OutOfOfficeEntryFindManyArgs = $FindManyArgs<$Schema, "OutOfOfficeEntry">; +export type OutOfOfficeEntryFindUniqueArgs = $FindUniqueArgs<$Schema, "OutOfOfficeEntry">; +export type OutOfOfficeEntryFindFirstArgs = $FindFirstArgs<$Schema, "OutOfOfficeEntry">; +export type OutOfOfficeEntryCreateArgs = $CreateArgs<$Schema, "OutOfOfficeEntry">; +export type OutOfOfficeEntryCreateManyArgs = $CreateManyArgs<$Schema, "OutOfOfficeEntry">; +export type OutOfOfficeEntryCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "OutOfOfficeEntry">; +export type OutOfOfficeEntryUpdateArgs = $UpdateArgs<$Schema, "OutOfOfficeEntry">; +export type OutOfOfficeEntryUpdateManyArgs = $UpdateManyArgs<$Schema, "OutOfOfficeEntry">; +export type OutOfOfficeEntryUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "OutOfOfficeEntry">; +export type OutOfOfficeEntryUpsertArgs = $UpsertArgs<$Schema, "OutOfOfficeEntry">; +export type OutOfOfficeEntryDeleteArgs = $DeleteArgs<$Schema, "OutOfOfficeEntry">; +export type OutOfOfficeEntryDeleteManyArgs = $DeleteManyArgs<$Schema, "OutOfOfficeEntry">; +export type OutOfOfficeEntryCountArgs = $CountArgs<$Schema, "OutOfOfficeEntry">; +export type OutOfOfficeEntryAggregateArgs = $AggregateArgs<$Schema, "OutOfOfficeEntry">; +export type OutOfOfficeEntryGroupByArgs = $GroupByArgs<$Schema, "OutOfOfficeEntry">; +export type OutOfOfficeEntryWhereInput = $WhereInput<$Schema, "OutOfOfficeEntry">; +export type OutOfOfficeEntrySelect = $SelectInput<$Schema, "OutOfOfficeEntry">; +export type OutOfOfficeEntryInclude = $IncludeInput<$Schema, "OutOfOfficeEntry">; +export type OutOfOfficeEntryOmit = $OmitInput<$Schema, "OutOfOfficeEntry">; +export type OutOfOfficeEntryGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "OutOfOfficeEntry", Options, Args>; +export type OutOfOfficeReasonFindManyArgs = $FindManyArgs<$Schema, "OutOfOfficeReason">; +export type OutOfOfficeReasonFindUniqueArgs = $FindUniqueArgs<$Schema, "OutOfOfficeReason">; +export type OutOfOfficeReasonFindFirstArgs = $FindFirstArgs<$Schema, "OutOfOfficeReason">; +export type OutOfOfficeReasonCreateArgs = $CreateArgs<$Schema, "OutOfOfficeReason">; +export type OutOfOfficeReasonCreateManyArgs = $CreateManyArgs<$Schema, "OutOfOfficeReason">; +export type OutOfOfficeReasonCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "OutOfOfficeReason">; +export type OutOfOfficeReasonUpdateArgs = $UpdateArgs<$Schema, "OutOfOfficeReason">; +export type OutOfOfficeReasonUpdateManyArgs = $UpdateManyArgs<$Schema, "OutOfOfficeReason">; +export type OutOfOfficeReasonUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "OutOfOfficeReason">; +export type OutOfOfficeReasonUpsertArgs = $UpsertArgs<$Schema, "OutOfOfficeReason">; +export type OutOfOfficeReasonDeleteArgs = $DeleteArgs<$Schema, "OutOfOfficeReason">; +export type OutOfOfficeReasonDeleteManyArgs = $DeleteManyArgs<$Schema, "OutOfOfficeReason">; +export type OutOfOfficeReasonCountArgs = $CountArgs<$Schema, "OutOfOfficeReason">; +export type OutOfOfficeReasonAggregateArgs = $AggregateArgs<$Schema, "OutOfOfficeReason">; +export type OutOfOfficeReasonGroupByArgs = $GroupByArgs<$Schema, "OutOfOfficeReason">; +export type OutOfOfficeReasonWhereInput = $WhereInput<$Schema, "OutOfOfficeReason">; +export type OutOfOfficeReasonSelect = $SelectInput<$Schema, "OutOfOfficeReason">; +export type OutOfOfficeReasonInclude = $IncludeInput<$Schema, "OutOfOfficeReason">; +export type OutOfOfficeReasonOmit = $OmitInput<$Schema, "OutOfOfficeReason">; +export type OutOfOfficeReasonGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "OutOfOfficeReason", Options, Args>; +export type PlatformOAuthClientFindManyArgs = $FindManyArgs<$Schema, "PlatformOAuthClient">; +export type PlatformOAuthClientFindUniqueArgs = $FindUniqueArgs<$Schema, "PlatformOAuthClient">; +export type PlatformOAuthClientFindFirstArgs = $FindFirstArgs<$Schema, "PlatformOAuthClient">; +export type PlatformOAuthClientCreateArgs = $CreateArgs<$Schema, "PlatformOAuthClient">; +export type PlatformOAuthClientCreateManyArgs = $CreateManyArgs<$Schema, "PlatformOAuthClient">; +export type PlatformOAuthClientCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "PlatformOAuthClient">; +export type PlatformOAuthClientUpdateArgs = $UpdateArgs<$Schema, "PlatformOAuthClient">; +export type PlatformOAuthClientUpdateManyArgs = $UpdateManyArgs<$Schema, "PlatformOAuthClient">; +export type PlatformOAuthClientUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "PlatformOAuthClient">; +export type PlatformOAuthClientUpsertArgs = $UpsertArgs<$Schema, "PlatformOAuthClient">; +export type PlatformOAuthClientDeleteArgs = $DeleteArgs<$Schema, "PlatformOAuthClient">; +export type PlatformOAuthClientDeleteManyArgs = $DeleteManyArgs<$Schema, "PlatformOAuthClient">; +export type PlatformOAuthClientCountArgs = $CountArgs<$Schema, "PlatformOAuthClient">; +export type PlatformOAuthClientAggregateArgs = $AggregateArgs<$Schema, "PlatformOAuthClient">; +export type PlatformOAuthClientGroupByArgs = $GroupByArgs<$Schema, "PlatformOAuthClient">; +export type PlatformOAuthClientWhereInput = $WhereInput<$Schema, "PlatformOAuthClient">; +export type PlatformOAuthClientSelect = $SelectInput<$Schema, "PlatformOAuthClient">; +export type PlatformOAuthClientInclude = $IncludeInput<$Schema, "PlatformOAuthClient">; +export type PlatformOAuthClientOmit = $OmitInput<$Schema, "PlatformOAuthClient">; +export type PlatformOAuthClientGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "PlatformOAuthClient", Options, Args>; +export type PlatformAuthorizationTokenFindManyArgs = $FindManyArgs<$Schema, "PlatformAuthorizationToken">; +export type PlatformAuthorizationTokenFindUniqueArgs = $FindUniqueArgs<$Schema, "PlatformAuthorizationToken">; +export type PlatformAuthorizationTokenFindFirstArgs = $FindFirstArgs<$Schema, "PlatformAuthorizationToken">; +export type PlatformAuthorizationTokenCreateArgs = $CreateArgs<$Schema, "PlatformAuthorizationToken">; +export type PlatformAuthorizationTokenCreateManyArgs = $CreateManyArgs<$Schema, "PlatformAuthorizationToken">; +export type PlatformAuthorizationTokenCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "PlatformAuthorizationToken">; +export type PlatformAuthorizationTokenUpdateArgs = $UpdateArgs<$Schema, "PlatformAuthorizationToken">; +export type PlatformAuthorizationTokenUpdateManyArgs = $UpdateManyArgs<$Schema, "PlatformAuthorizationToken">; +export type PlatformAuthorizationTokenUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "PlatformAuthorizationToken">; +export type PlatformAuthorizationTokenUpsertArgs = $UpsertArgs<$Schema, "PlatformAuthorizationToken">; +export type PlatformAuthorizationTokenDeleteArgs = $DeleteArgs<$Schema, "PlatformAuthorizationToken">; +export type PlatformAuthorizationTokenDeleteManyArgs = $DeleteManyArgs<$Schema, "PlatformAuthorizationToken">; +export type PlatformAuthorizationTokenCountArgs = $CountArgs<$Schema, "PlatformAuthorizationToken">; +export type PlatformAuthorizationTokenAggregateArgs = $AggregateArgs<$Schema, "PlatformAuthorizationToken">; +export type PlatformAuthorizationTokenGroupByArgs = $GroupByArgs<$Schema, "PlatformAuthorizationToken">; +export type PlatformAuthorizationTokenWhereInput = $WhereInput<$Schema, "PlatformAuthorizationToken">; +export type PlatformAuthorizationTokenSelect = $SelectInput<$Schema, "PlatformAuthorizationToken">; +export type PlatformAuthorizationTokenInclude = $IncludeInput<$Schema, "PlatformAuthorizationToken">; +export type PlatformAuthorizationTokenOmit = $OmitInput<$Schema, "PlatformAuthorizationToken">; +export type PlatformAuthorizationTokenGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "PlatformAuthorizationToken", Options, Args>; +export type AccessTokenFindManyArgs = $FindManyArgs<$Schema, "AccessToken">; +export type AccessTokenFindUniqueArgs = $FindUniqueArgs<$Schema, "AccessToken">; +export type AccessTokenFindFirstArgs = $FindFirstArgs<$Schema, "AccessToken">; +export type AccessTokenCreateArgs = $CreateArgs<$Schema, "AccessToken">; +export type AccessTokenCreateManyArgs = $CreateManyArgs<$Schema, "AccessToken">; +export type AccessTokenCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "AccessToken">; +export type AccessTokenUpdateArgs = $UpdateArgs<$Schema, "AccessToken">; +export type AccessTokenUpdateManyArgs = $UpdateManyArgs<$Schema, "AccessToken">; +export type AccessTokenUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "AccessToken">; +export type AccessTokenUpsertArgs = $UpsertArgs<$Schema, "AccessToken">; +export type AccessTokenDeleteArgs = $DeleteArgs<$Schema, "AccessToken">; +export type AccessTokenDeleteManyArgs = $DeleteManyArgs<$Schema, "AccessToken">; +export type AccessTokenCountArgs = $CountArgs<$Schema, "AccessToken">; +export type AccessTokenAggregateArgs = $AggregateArgs<$Schema, "AccessToken">; +export type AccessTokenGroupByArgs = $GroupByArgs<$Schema, "AccessToken">; +export type AccessTokenWhereInput = $WhereInput<$Schema, "AccessToken">; +export type AccessTokenSelect = $SelectInput<$Schema, "AccessToken">; +export type AccessTokenInclude = $IncludeInput<$Schema, "AccessToken">; +export type AccessTokenOmit = $OmitInput<$Schema, "AccessToken">; +export type AccessTokenGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "AccessToken", Options, Args>; +export type RefreshTokenFindManyArgs = $FindManyArgs<$Schema, "RefreshToken">; +export type RefreshTokenFindUniqueArgs = $FindUniqueArgs<$Schema, "RefreshToken">; +export type RefreshTokenFindFirstArgs = $FindFirstArgs<$Schema, "RefreshToken">; +export type RefreshTokenCreateArgs = $CreateArgs<$Schema, "RefreshToken">; +export type RefreshTokenCreateManyArgs = $CreateManyArgs<$Schema, "RefreshToken">; +export type RefreshTokenCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "RefreshToken">; +export type RefreshTokenUpdateArgs = $UpdateArgs<$Schema, "RefreshToken">; +export type RefreshTokenUpdateManyArgs = $UpdateManyArgs<$Schema, "RefreshToken">; +export type RefreshTokenUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "RefreshToken">; +export type RefreshTokenUpsertArgs = $UpsertArgs<$Schema, "RefreshToken">; +export type RefreshTokenDeleteArgs = $DeleteArgs<$Schema, "RefreshToken">; +export type RefreshTokenDeleteManyArgs = $DeleteManyArgs<$Schema, "RefreshToken">; +export type RefreshTokenCountArgs = $CountArgs<$Schema, "RefreshToken">; +export type RefreshTokenAggregateArgs = $AggregateArgs<$Schema, "RefreshToken">; +export type RefreshTokenGroupByArgs = $GroupByArgs<$Schema, "RefreshToken">; +export type RefreshTokenWhereInput = $WhereInput<$Schema, "RefreshToken">; +export type RefreshTokenSelect = $SelectInput<$Schema, "RefreshToken">; +export type RefreshTokenInclude = $IncludeInput<$Schema, "RefreshToken">; +export type RefreshTokenOmit = $OmitInput<$Schema, "RefreshToken">; +export type RefreshTokenGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "RefreshToken", Options, Args>; +export type DSyncDataFindManyArgs = $FindManyArgs<$Schema, "DSyncData">; +export type DSyncDataFindUniqueArgs = $FindUniqueArgs<$Schema, "DSyncData">; +export type DSyncDataFindFirstArgs = $FindFirstArgs<$Schema, "DSyncData">; +export type DSyncDataCreateArgs = $CreateArgs<$Schema, "DSyncData">; +export type DSyncDataCreateManyArgs = $CreateManyArgs<$Schema, "DSyncData">; +export type DSyncDataCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "DSyncData">; +export type DSyncDataUpdateArgs = $UpdateArgs<$Schema, "DSyncData">; +export type DSyncDataUpdateManyArgs = $UpdateManyArgs<$Schema, "DSyncData">; +export type DSyncDataUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "DSyncData">; +export type DSyncDataUpsertArgs = $UpsertArgs<$Schema, "DSyncData">; +export type DSyncDataDeleteArgs = $DeleteArgs<$Schema, "DSyncData">; +export type DSyncDataDeleteManyArgs = $DeleteManyArgs<$Schema, "DSyncData">; +export type DSyncDataCountArgs = $CountArgs<$Schema, "DSyncData">; +export type DSyncDataAggregateArgs = $AggregateArgs<$Schema, "DSyncData">; +export type DSyncDataGroupByArgs = $GroupByArgs<$Schema, "DSyncData">; +export type DSyncDataWhereInput = $WhereInput<$Schema, "DSyncData">; +export type DSyncDataSelect = $SelectInput<$Schema, "DSyncData">; +export type DSyncDataInclude = $IncludeInput<$Schema, "DSyncData">; +export type DSyncDataOmit = $OmitInput<$Schema, "DSyncData">; +export type DSyncDataGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "DSyncData", Options, Args>; +export type DSyncTeamGroupMappingFindManyArgs = $FindManyArgs<$Schema, "DSyncTeamGroupMapping">; +export type DSyncTeamGroupMappingFindUniqueArgs = $FindUniqueArgs<$Schema, "DSyncTeamGroupMapping">; +export type DSyncTeamGroupMappingFindFirstArgs = $FindFirstArgs<$Schema, "DSyncTeamGroupMapping">; +export type DSyncTeamGroupMappingCreateArgs = $CreateArgs<$Schema, "DSyncTeamGroupMapping">; +export type DSyncTeamGroupMappingCreateManyArgs = $CreateManyArgs<$Schema, "DSyncTeamGroupMapping">; +export type DSyncTeamGroupMappingCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "DSyncTeamGroupMapping">; +export type DSyncTeamGroupMappingUpdateArgs = $UpdateArgs<$Schema, "DSyncTeamGroupMapping">; +export type DSyncTeamGroupMappingUpdateManyArgs = $UpdateManyArgs<$Schema, "DSyncTeamGroupMapping">; +export type DSyncTeamGroupMappingUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "DSyncTeamGroupMapping">; +export type DSyncTeamGroupMappingUpsertArgs = $UpsertArgs<$Schema, "DSyncTeamGroupMapping">; +export type DSyncTeamGroupMappingDeleteArgs = $DeleteArgs<$Schema, "DSyncTeamGroupMapping">; +export type DSyncTeamGroupMappingDeleteManyArgs = $DeleteManyArgs<$Schema, "DSyncTeamGroupMapping">; +export type DSyncTeamGroupMappingCountArgs = $CountArgs<$Schema, "DSyncTeamGroupMapping">; +export type DSyncTeamGroupMappingAggregateArgs = $AggregateArgs<$Schema, "DSyncTeamGroupMapping">; +export type DSyncTeamGroupMappingGroupByArgs = $GroupByArgs<$Schema, "DSyncTeamGroupMapping">; +export type DSyncTeamGroupMappingWhereInput = $WhereInput<$Schema, "DSyncTeamGroupMapping">; +export type DSyncTeamGroupMappingSelect = $SelectInput<$Schema, "DSyncTeamGroupMapping">; +export type DSyncTeamGroupMappingInclude = $IncludeInput<$Schema, "DSyncTeamGroupMapping">; +export type DSyncTeamGroupMappingOmit = $OmitInput<$Schema, "DSyncTeamGroupMapping">; +export type DSyncTeamGroupMappingGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "DSyncTeamGroupMapping", Options, Args>; +export type SecondaryEmailFindManyArgs = $FindManyArgs<$Schema, "SecondaryEmail">; +export type SecondaryEmailFindUniqueArgs = $FindUniqueArgs<$Schema, "SecondaryEmail">; +export type SecondaryEmailFindFirstArgs = $FindFirstArgs<$Schema, "SecondaryEmail">; +export type SecondaryEmailCreateArgs = $CreateArgs<$Schema, "SecondaryEmail">; +export type SecondaryEmailCreateManyArgs = $CreateManyArgs<$Schema, "SecondaryEmail">; +export type SecondaryEmailCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "SecondaryEmail">; +export type SecondaryEmailUpdateArgs = $UpdateArgs<$Schema, "SecondaryEmail">; +export type SecondaryEmailUpdateManyArgs = $UpdateManyArgs<$Schema, "SecondaryEmail">; +export type SecondaryEmailUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "SecondaryEmail">; +export type SecondaryEmailUpsertArgs = $UpsertArgs<$Schema, "SecondaryEmail">; +export type SecondaryEmailDeleteArgs = $DeleteArgs<$Schema, "SecondaryEmail">; +export type SecondaryEmailDeleteManyArgs = $DeleteManyArgs<$Schema, "SecondaryEmail">; +export type SecondaryEmailCountArgs = $CountArgs<$Schema, "SecondaryEmail">; +export type SecondaryEmailAggregateArgs = $AggregateArgs<$Schema, "SecondaryEmail">; +export type SecondaryEmailGroupByArgs = $GroupByArgs<$Schema, "SecondaryEmail">; +export type SecondaryEmailWhereInput = $WhereInput<$Schema, "SecondaryEmail">; +export type SecondaryEmailSelect = $SelectInput<$Schema, "SecondaryEmail">; +export type SecondaryEmailInclude = $IncludeInput<$Schema, "SecondaryEmail">; +export type SecondaryEmailOmit = $OmitInput<$Schema, "SecondaryEmail">; +export type SecondaryEmailGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "SecondaryEmail", Options, Args>; +export type TaskFindManyArgs = $FindManyArgs<$Schema, "Task">; +export type TaskFindUniqueArgs = $FindUniqueArgs<$Schema, "Task">; +export type TaskFindFirstArgs = $FindFirstArgs<$Schema, "Task">; +export type TaskCreateArgs = $CreateArgs<$Schema, "Task">; +export type TaskCreateManyArgs = $CreateManyArgs<$Schema, "Task">; +export type TaskCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Task">; +export type TaskUpdateArgs = $UpdateArgs<$Schema, "Task">; +export type TaskUpdateManyArgs = $UpdateManyArgs<$Schema, "Task">; +export type TaskUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Task">; +export type TaskUpsertArgs = $UpsertArgs<$Schema, "Task">; +export type TaskDeleteArgs = $DeleteArgs<$Schema, "Task">; +export type TaskDeleteManyArgs = $DeleteManyArgs<$Schema, "Task">; +export type TaskCountArgs = $CountArgs<$Schema, "Task">; +export type TaskAggregateArgs = $AggregateArgs<$Schema, "Task">; +export type TaskGroupByArgs = $GroupByArgs<$Schema, "Task">; +export type TaskWhereInput = $WhereInput<$Schema, "Task">; +export type TaskSelect = $SelectInput<$Schema, "Task">; +export type TaskInclude = $IncludeInput<$Schema, "Task">; +export type TaskOmit = $OmitInput<$Schema, "Task">; +export type TaskGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Task", Options, Args>; +export type ManagedOrganizationFindManyArgs = $FindManyArgs<$Schema, "ManagedOrganization">; +export type ManagedOrganizationFindUniqueArgs = $FindUniqueArgs<$Schema, "ManagedOrganization">; +export type ManagedOrganizationFindFirstArgs = $FindFirstArgs<$Schema, "ManagedOrganization">; +export type ManagedOrganizationCreateArgs = $CreateArgs<$Schema, "ManagedOrganization">; +export type ManagedOrganizationCreateManyArgs = $CreateManyArgs<$Schema, "ManagedOrganization">; +export type ManagedOrganizationCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "ManagedOrganization">; +export type ManagedOrganizationUpdateArgs = $UpdateArgs<$Schema, "ManagedOrganization">; +export type ManagedOrganizationUpdateManyArgs = $UpdateManyArgs<$Schema, "ManagedOrganization">; +export type ManagedOrganizationUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "ManagedOrganization">; +export type ManagedOrganizationUpsertArgs = $UpsertArgs<$Schema, "ManagedOrganization">; +export type ManagedOrganizationDeleteArgs = $DeleteArgs<$Schema, "ManagedOrganization">; +export type ManagedOrganizationDeleteManyArgs = $DeleteManyArgs<$Schema, "ManagedOrganization">; +export type ManagedOrganizationCountArgs = $CountArgs<$Schema, "ManagedOrganization">; +export type ManagedOrganizationAggregateArgs = $AggregateArgs<$Schema, "ManagedOrganization">; +export type ManagedOrganizationGroupByArgs = $GroupByArgs<$Schema, "ManagedOrganization">; +export type ManagedOrganizationWhereInput = $WhereInput<$Schema, "ManagedOrganization">; +export type ManagedOrganizationSelect = $SelectInput<$Schema, "ManagedOrganization">; +export type ManagedOrganizationInclude = $IncludeInput<$Schema, "ManagedOrganization">; +export type ManagedOrganizationOmit = $OmitInput<$Schema, "ManagedOrganization">; +export type ManagedOrganizationGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "ManagedOrganization", Options, Args>; +export type PlatformBillingFindManyArgs = $FindManyArgs<$Schema, "PlatformBilling">; +export type PlatformBillingFindUniqueArgs = $FindUniqueArgs<$Schema, "PlatformBilling">; +export type PlatformBillingFindFirstArgs = $FindFirstArgs<$Schema, "PlatformBilling">; +export type PlatformBillingCreateArgs = $CreateArgs<$Schema, "PlatformBilling">; +export type PlatformBillingCreateManyArgs = $CreateManyArgs<$Schema, "PlatformBilling">; +export type PlatformBillingCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "PlatformBilling">; +export type PlatformBillingUpdateArgs = $UpdateArgs<$Schema, "PlatformBilling">; +export type PlatformBillingUpdateManyArgs = $UpdateManyArgs<$Schema, "PlatformBilling">; +export type PlatformBillingUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "PlatformBilling">; +export type PlatformBillingUpsertArgs = $UpsertArgs<$Schema, "PlatformBilling">; +export type PlatformBillingDeleteArgs = $DeleteArgs<$Schema, "PlatformBilling">; +export type PlatformBillingDeleteManyArgs = $DeleteManyArgs<$Schema, "PlatformBilling">; +export type PlatformBillingCountArgs = $CountArgs<$Schema, "PlatformBilling">; +export type PlatformBillingAggregateArgs = $AggregateArgs<$Schema, "PlatformBilling">; +export type PlatformBillingGroupByArgs = $GroupByArgs<$Schema, "PlatformBilling">; +export type PlatformBillingWhereInput = $WhereInput<$Schema, "PlatformBilling">; +export type PlatformBillingSelect = $SelectInput<$Schema, "PlatformBilling">; +export type PlatformBillingInclude = $IncludeInput<$Schema, "PlatformBilling">; +export type PlatformBillingOmit = $OmitInput<$Schema, "PlatformBilling">; +export type PlatformBillingGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "PlatformBilling", Options, Args>; +export type AttributeOptionFindManyArgs = $FindManyArgs<$Schema, "AttributeOption">; +export type AttributeOptionFindUniqueArgs = $FindUniqueArgs<$Schema, "AttributeOption">; +export type AttributeOptionFindFirstArgs = $FindFirstArgs<$Schema, "AttributeOption">; +export type AttributeOptionCreateArgs = $CreateArgs<$Schema, "AttributeOption">; +export type AttributeOptionCreateManyArgs = $CreateManyArgs<$Schema, "AttributeOption">; +export type AttributeOptionCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "AttributeOption">; +export type AttributeOptionUpdateArgs = $UpdateArgs<$Schema, "AttributeOption">; +export type AttributeOptionUpdateManyArgs = $UpdateManyArgs<$Schema, "AttributeOption">; +export type AttributeOptionUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "AttributeOption">; +export type AttributeOptionUpsertArgs = $UpsertArgs<$Schema, "AttributeOption">; +export type AttributeOptionDeleteArgs = $DeleteArgs<$Schema, "AttributeOption">; +export type AttributeOptionDeleteManyArgs = $DeleteManyArgs<$Schema, "AttributeOption">; +export type AttributeOptionCountArgs = $CountArgs<$Schema, "AttributeOption">; +export type AttributeOptionAggregateArgs = $AggregateArgs<$Schema, "AttributeOption">; +export type AttributeOptionGroupByArgs = $GroupByArgs<$Schema, "AttributeOption">; +export type AttributeOptionWhereInput = $WhereInput<$Schema, "AttributeOption">; +export type AttributeOptionSelect = $SelectInput<$Schema, "AttributeOption">; +export type AttributeOptionInclude = $IncludeInput<$Schema, "AttributeOption">; +export type AttributeOptionOmit = $OmitInput<$Schema, "AttributeOption">; +export type AttributeOptionGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "AttributeOption", Options, Args>; +export type AttributeFindManyArgs = $FindManyArgs<$Schema, "Attribute">; +export type AttributeFindUniqueArgs = $FindUniqueArgs<$Schema, "Attribute">; +export type AttributeFindFirstArgs = $FindFirstArgs<$Schema, "Attribute">; +export type AttributeCreateArgs = $CreateArgs<$Schema, "Attribute">; +export type AttributeCreateManyArgs = $CreateManyArgs<$Schema, "Attribute">; +export type AttributeCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Attribute">; +export type AttributeUpdateArgs = $UpdateArgs<$Schema, "Attribute">; +export type AttributeUpdateManyArgs = $UpdateManyArgs<$Schema, "Attribute">; +export type AttributeUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Attribute">; +export type AttributeUpsertArgs = $UpsertArgs<$Schema, "Attribute">; +export type AttributeDeleteArgs = $DeleteArgs<$Schema, "Attribute">; +export type AttributeDeleteManyArgs = $DeleteManyArgs<$Schema, "Attribute">; +export type AttributeCountArgs = $CountArgs<$Schema, "Attribute">; +export type AttributeAggregateArgs = $AggregateArgs<$Schema, "Attribute">; +export type AttributeGroupByArgs = $GroupByArgs<$Schema, "Attribute">; +export type AttributeWhereInput = $WhereInput<$Schema, "Attribute">; +export type AttributeSelect = $SelectInput<$Schema, "Attribute">; +export type AttributeInclude = $IncludeInput<$Schema, "Attribute">; +export type AttributeOmit = $OmitInput<$Schema, "Attribute">; +export type AttributeGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Attribute", Options, Args>; +export type AttributeToUserFindManyArgs = $FindManyArgs<$Schema, "AttributeToUser">; +export type AttributeToUserFindUniqueArgs = $FindUniqueArgs<$Schema, "AttributeToUser">; +export type AttributeToUserFindFirstArgs = $FindFirstArgs<$Schema, "AttributeToUser">; +export type AttributeToUserCreateArgs = $CreateArgs<$Schema, "AttributeToUser">; +export type AttributeToUserCreateManyArgs = $CreateManyArgs<$Schema, "AttributeToUser">; +export type AttributeToUserCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "AttributeToUser">; +export type AttributeToUserUpdateArgs = $UpdateArgs<$Schema, "AttributeToUser">; +export type AttributeToUserUpdateManyArgs = $UpdateManyArgs<$Schema, "AttributeToUser">; +export type AttributeToUserUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "AttributeToUser">; +export type AttributeToUserUpsertArgs = $UpsertArgs<$Schema, "AttributeToUser">; +export type AttributeToUserDeleteArgs = $DeleteArgs<$Schema, "AttributeToUser">; +export type AttributeToUserDeleteManyArgs = $DeleteManyArgs<$Schema, "AttributeToUser">; +export type AttributeToUserCountArgs = $CountArgs<$Schema, "AttributeToUser">; +export type AttributeToUserAggregateArgs = $AggregateArgs<$Schema, "AttributeToUser">; +export type AttributeToUserGroupByArgs = $GroupByArgs<$Schema, "AttributeToUser">; +export type AttributeToUserWhereInput = $WhereInput<$Schema, "AttributeToUser">; +export type AttributeToUserSelect = $SelectInput<$Schema, "AttributeToUser">; +export type AttributeToUserInclude = $IncludeInput<$Schema, "AttributeToUser">; +export type AttributeToUserOmit = $OmitInput<$Schema, "AttributeToUser">; +export type AttributeToUserGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "AttributeToUser", Options, Args>; +export type AssignmentReasonFindManyArgs = $FindManyArgs<$Schema, "AssignmentReason">; +export type AssignmentReasonFindUniqueArgs = $FindUniqueArgs<$Schema, "AssignmentReason">; +export type AssignmentReasonFindFirstArgs = $FindFirstArgs<$Schema, "AssignmentReason">; +export type AssignmentReasonCreateArgs = $CreateArgs<$Schema, "AssignmentReason">; +export type AssignmentReasonCreateManyArgs = $CreateManyArgs<$Schema, "AssignmentReason">; +export type AssignmentReasonCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "AssignmentReason">; +export type AssignmentReasonUpdateArgs = $UpdateArgs<$Schema, "AssignmentReason">; +export type AssignmentReasonUpdateManyArgs = $UpdateManyArgs<$Schema, "AssignmentReason">; +export type AssignmentReasonUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "AssignmentReason">; +export type AssignmentReasonUpsertArgs = $UpsertArgs<$Schema, "AssignmentReason">; +export type AssignmentReasonDeleteArgs = $DeleteArgs<$Schema, "AssignmentReason">; +export type AssignmentReasonDeleteManyArgs = $DeleteManyArgs<$Schema, "AssignmentReason">; +export type AssignmentReasonCountArgs = $CountArgs<$Schema, "AssignmentReason">; +export type AssignmentReasonAggregateArgs = $AggregateArgs<$Schema, "AssignmentReason">; +export type AssignmentReasonGroupByArgs = $GroupByArgs<$Schema, "AssignmentReason">; +export type AssignmentReasonWhereInput = $WhereInput<$Schema, "AssignmentReason">; +export type AssignmentReasonSelect = $SelectInput<$Schema, "AssignmentReason">; +export type AssignmentReasonInclude = $IncludeInput<$Schema, "AssignmentReason">; +export type AssignmentReasonOmit = $OmitInput<$Schema, "AssignmentReason">; +export type AssignmentReasonGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "AssignmentReason", Options, Args>; +export type DelegationCredentialFindManyArgs = $FindManyArgs<$Schema, "DelegationCredential">; +export type DelegationCredentialFindUniqueArgs = $FindUniqueArgs<$Schema, "DelegationCredential">; +export type DelegationCredentialFindFirstArgs = $FindFirstArgs<$Schema, "DelegationCredential">; +export type DelegationCredentialCreateArgs = $CreateArgs<$Schema, "DelegationCredential">; +export type DelegationCredentialCreateManyArgs = $CreateManyArgs<$Schema, "DelegationCredential">; +export type DelegationCredentialCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "DelegationCredential">; +export type DelegationCredentialUpdateArgs = $UpdateArgs<$Schema, "DelegationCredential">; +export type DelegationCredentialUpdateManyArgs = $UpdateManyArgs<$Schema, "DelegationCredential">; +export type DelegationCredentialUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "DelegationCredential">; +export type DelegationCredentialUpsertArgs = $UpsertArgs<$Schema, "DelegationCredential">; +export type DelegationCredentialDeleteArgs = $DeleteArgs<$Schema, "DelegationCredential">; +export type DelegationCredentialDeleteManyArgs = $DeleteManyArgs<$Schema, "DelegationCredential">; +export type DelegationCredentialCountArgs = $CountArgs<$Schema, "DelegationCredential">; +export type DelegationCredentialAggregateArgs = $AggregateArgs<$Schema, "DelegationCredential">; +export type DelegationCredentialGroupByArgs = $GroupByArgs<$Schema, "DelegationCredential">; +export type DelegationCredentialWhereInput = $WhereInput<$Schema, "DelegationCredential">; +export type DelegationCredentialSelect = $SelectInput<$Schema, "DelegationCredential">; +export type DelegationCredentialInclude = $IncludeInput<$Schema, "DelegationCredential">; +export type DelegationCredentialOmit = $OmitInput<$Schema, "DelegationCredential">; +export type DelegationCredentialGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "DelegationCredential", Options, Args>; +export type DomainWideDelegationFindManyArgs = $FindManyArgs<$Schema, "DomainWideDelegation">; +export type DomainWideDelegationFindUniqueArgs = $FindUniqueArgs<$Schema, "DomainWideDelegation">; +export type DomainWideDelegationFindFirstArgs = $FindFirstArgs<$Schema, "DomainWideDelegation">; +export type DomainWideDelegationCreateArgs = $CreateArgs<$Schema, "DomainWideDelegation">; +export type DomainWideDelegationCreateManyArgs = $CreateManyArgs<$Schema, "DomainWideDelegation">; +export type DomainWideDelegationCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "DomainWideDelegation">; +export type DomainWideDelegationUpdateArgs = $UpdateArgs<$Schema, "DomainWideDelegation">; +export type DomainWideDelegationUpdateManyArgs = $UpdateManyArgs<$Schema, "DomainWideDelegation">; +export type DomainWideDelegationUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "DomainWideDelegation">; +export type DomainWideDelegationUpsertArgs = $UpsertArgs<$Schema, "DomainWideDelegation">; +export type DomainWideDelegationDeleteArgs = $DeleteArgs<$Schema, "DomainWideDelegation">; +export type DomainWideDelegationDeleteManyArgs = $DeleteManyArgs<$Schema, "DomainWideDelegation">; +export type DomainWideDelegationCountArgs = $CountArgs<$Schema, "DomainWideDelegation">; +export type DomainWideDelegationAggregateArgs = $AggregateArgs<$Schema, "DomainWideDelegation">; +export type DomainWideDelegationGroupByArgs = $GroupByArgs<$Schema, "DomainWideDelegation">; +export type DomainWideDelegationWhereInput = $WhereInput<$Schema, "DomainWideDelegation">; +export type DomainWideDelegationSelect = $SelectInput<$Schema, "DomainWideDelegation">; +export type DomainWideDelegationInclude = $IncludeInput<$Schema, "DomainWideDelegation">; +export type DomainWideDelegationOmit = $OmitInput<$Schema, "DomainWideDelegation">; +export type DomainWideDelegationGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "DomainWideDelegation", Options, Args>; +export type WorkspacePlatformFindManyArgs = $FindManyArgs<$Schema, "WorkspacePlatform">; +export type WorkspacePlatformFindUniqueArgs = $FindUniqueArgs<$Schema, "WorkspacePlatform">; +export type WorkspacePlatformFindFirstArgs = $FindFirstArgs<$Schema, "WorkspacePlatform">; +export type WorkspacePlatformCreateArgs = $CreateArgs<$Schema, "WorkspacePlatform">; +export type WorkspacePlatformCreateManyArgs = $CreateManyArgs<$Schema, "WorkspacePlatform">; +export type WorkspacePlatformCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "WorkspacePlatform">; +export type WorkspacePlatformUpdateArgs = $UpdateArgs<$Schema, "WorkspacePlatform">; +export type WorkspacePlatformUpdateManyArgs = $UpdateManyArgs<$Schema, "WorkspacePlatform">; +export type WorkspacePlatformUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "WorkspacePlatform">; +export type WorkspacePlatformUpsertArgs = $UpsertArgs<$Schema, "WorkspacePlatform">; +export type WorkspacePlatformDeleteArgs = $DeleteArgs<$Schema, "WorkspacePlatform">; +export type WorkspacePlatformDeleteManyArgs = $DeleteManyArgs<$Schema, "WorkspacePlatform">; +export type WorkspacePlatformCountArgs = $CountArgs<$Schema, "WorkspacePlatform">; +export type WorkspacePlatformAggregateArgs = $AggregateArgs<$Schema, "WorkspacePlatform">; +export type WorkspacePlatformGroupByArgs = $GroupByArgs<$Schema, "WorkspacePlatform">; +export type WorkspacePlatformWhereInput = $WhereInput<$Schema, "WorkspacePlatform">; +export type WorkspacePlatformSelect = $SelectInput<$Schema, "WorkspacePlatform">; +export type WorkspacePlatformInclude = $IncludeInput<$Schema, "WorkspacePlatform">; +export type WorkspacePlatformOmit = $OmitInput<$Schema, "WorkspacePlatform">; +export type WorkspacePlatformGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "WorkspacePlatform", Options, Args>; +export type EventTypeTranslationFindManyArgs = $FindManyArgs<$Schema, "EventTypeTranslation">; +export type EventTypeTranslationFindUniqueArgs = $FindUniqueArgs<$Schema, "EventTypeTranslation">; +export type EventTypeTranslationFindFirstArgs = $FindFirstArgs<$Schema, "EventTypeTranslation">; +export type EventTypeTranslationCreateArgs = $CreateArgs<$Schema, "EventTypeTranslation">; +export type EventTypeTranslationCreateManyArgs = $CreateManyArgs<$Schema, "EventTypeTranslation">; +export type EventTypeTranslationCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "EventTypeTranslation">; +export type EventTypeTranslationUpdateArgs = $UpdateArgs<$Schema, "EventTypeTranslation">; +export type EventTypeTranslationUpdateManyArgs = $UpdateManyArgs<$Schema, "EventTypeTranslation">; +export type EventTypeTranslationUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "EventTypeTranslation">; +export type EventTypeTranslationUpsertArgs = $UpsertArgs<$Schema, "EventTypeTranslation">; +export type EventTypeTranslationDeleteArgs = $DeleteArgs<$Schema, "EventTypeTranslation">; +export type EventTypeTranslationDeleteManyArgs = $DeleteManyArgs<$Schema, "EventTypeTranslation">; +export type EventTypeTranslationCountArgs = $CountArgs<$Schema, "EventTypeTranslation">; +export type EventTypeTranslationAggregateArgs = $AggregateArgs<$Schema, "EventTypeTranslation">; +export type EventTypeTranslationGroupByArgs = $GroupByArgs<$Schema, "EventTypeTranslation">; +export type EventTypeTranslationWhereInput = $WhereInput<$Schema, "EventTypeTranslation">; +export type EventTypeTranslationSelect = $SelectInput<$Schema, "EventTypeTranslation">; +export type EventTypeTranslationInclude = $IncludeInput<$Schema, "EventTypeTranslation">; +export type EventTypeTranslationOmit = $OmitInput<$Schema, "EventTypeTranslation">; +export type EventTypeTranslationGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "EventTypeTranslation", Options, Args>; +export type WatchlistFindManyArgs = $FindManyArgs<$Schema, "Watchlist">; +export type WatchlistFindUniqueArgs = $FindUniqueArgs<$Schema, "Watchlist">; +export type WatchlistFindFirstArgs = $FindFirstArgs<$Schema, "Watchlist">; +export type WatchlistCreateArgs = $CreateArgs<$Schema, "Watchlist">; +export type WatchlistCreateManyArgs = $CreateManyArgs<$Schema, "Watchlist">; +export type WatchlistCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Watchlist">; +export type WatchlistUpdateArgs = $UpdateArgs<$Schema, "Watchlist">; +export type WatchlistUpdateManyArgs = $UpdateManyArgs<$Schema, "Watchlist">; +export type WatchlistUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Watchlist">; +export type WatchlistUpsertArgs = $UpsertArgs<$Schema, "Watchlist">; +export type WatchlistDeleteArgs = $DeleteArgs<$Schema, "Watchlist">; +export type WatchlistDeleteManyArgs = $DeleteManyArgs<$Schema, "Watchlist">; +export type WatchlistCountArgs = $CountArgs<$Schema, "Watchlist">; +export type WatchlistAggregateArgs = $AggregateArgs<$Schema, "Watchlist">; +export type WatchlistGroupByArgs = $GroupByArgs<$Schema, "Watchlist">; +export type WatchlistWhereInput = $WhereInput<$Schema, "Watchlist">; +export type WatchlistSelect = $SelectInput<$Schema, "Watchlist">; +export type WatchlistInclude = $IncludeInput<$Schema, "Watchlist">; +export type WatchlistOmit = $OmitInput<$Schema, "Watchlist">; +export type WatchlistGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Watchlist", Options, Args>; +export type OrganizationOnboardingFindManyArgs = $FindManyArgs<$Schema, "OrganizationOnboarding">; +export type OrganizationOnboardingFindUniqueArgs = $FindUniqueArgs<$Schema, "OrganizationOnboarding">; +export type OrganizationOnboardingFindFirstArgs = $FindFirstArgs<$Schema, "OrganizationOnboarding">; +export type OrganizationOnboardingCreateArgs = $CreateArgs<$Schema, "OrganizationOnboarding">; +export type OrganizationOnboardingCreateManyArgs = $CreateManyArgs<$Schema, "OrganizationOnboarding">; +export type OrganizationOnboardingCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "OrganizationOnboarding">; +export type OrganizationOnboardingUpdateArgs = $UpdateArgs<$Schema, "OrganizationOnboarding">; +export type OrganizationOnboardingUpdateManyArgs = $UpdateManyArgs<$Schema, "OrganizationOnboarding">; +export type OrganizationOnboardingUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "OrganizationOnboarding">; +export type OrganizationOnboardingUpsertArgs = $UpsertArgs<$Schema, "OrganizationOnboarding">; +export type OrganizationOnboardingDeleteArgs = $DeleteArgs<$Schema, "OrganizationOnboarding">; +export type OrganizationOnboardingDeleteManyArgs = $DeleteManyArgs<$Schema, "OrganizationOnboarding">; +export type OrganizationOnboardingCountArgs = $CountArgs<$Schema, "OrganizationOnboarding">; +export type OrganizationOnboardingAggregateArgs = $AggregateArgs<$Schema, "OrganizationOnboarding">; +export type OrganizationOnboardingGroupByArgs = $GroupByArgs<$Schema, "OrganizationOnboarding">; +export type OrganizationOnboardingWhereInput = $WhereInput<$Schema, "OrganizationOnboarding">; +export type OrganizationOnboardingSelect = $SelectInput<$Schema, "OrganizationOnboarding">; +export type OrganizationOnboardingInclude = $IncludeInput<$Schema, "OrganizationOnboarding">; +export type OrganizationOnboardingOmit = $OmitInput<$Schema, "OrganizationOnboarding">; +export type OrganizationOnboardingGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "OrganizationOnboarding", Options, Args>; +export type App_RoutingForms_IncompleteBookingActionsFindManyArgs = $FindManyArgs<$Schema, "App_RoutingForms_IncompleteBookingActions">; +export type App_RoutingForms_IncompleteBookingActionsFindUniqueArgs = $FindUniqueArgs<$Schema, "App_RoutingForms_IncompleteBookingActions">; +export type App_RoutingForms_IncompleteBookingActionsFindFirstArgs = $FindFirstArgs<$Schema, "App_RoutingForms_IncompleteBookingActions">; +export type App_RoutingForms_IncompleteBookingActionsCreateArgs = $CreateArgs<$Schema, "App_RoutingForms_IncompleteBookingActions">; +export type App_RoutingForms_IncompleteBookingActionsCreateManyArgs = $CreateManyArgs<$Schema, "App_RoutingForms_IncompleteBookingActions">; +export type App_RoutingForms_IncompleteBookingActionsCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "App_RoutingForms_IncompleteBookingActions">; +export type App_RoutingForms_IncompleteBookingActionsUpdateArgs = $UpdateArgs<$Schema, "App_RoutingForms_IncompleteBookingActions">; +export type App_RoutingForms_IncompleteBookingActionsUpdateManyArgs = $UpdateManyArgs<$Schema, "App_RoutingForms_IncompleteBookingActions">; +export type App_RoutingForms_IncompleteBookingActionsUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "App_RoutingForms_IncompleteBookingActions">; +export type App_RoutingForms_IncompleteBookingActionsUpsertArgs = $UpsertArgs<$Schema, "App_RoutingForms_IncompleteBookingActions">; +export type App_RoutingForms_IncompleteBookingActionsDeleteArgs = $DeleteArgs<$Schema, "App_RoutingForms_IncompleteBookingActions">; +export type App_RoutingForms_IncompleteBookingActionsDeleteManyArgs = $DeleteManyArgs<$Schema, "App_RoutingForms_IncompleteBookingActions">; +export type App_RoutingForms_IncompleteBookingActionsCountArgs = $CountArgs<$Schema, "App_RoutingForms_IncompleteBookingActions">; +export type App_RoutingForms_IncompleteBookingActionsAggregateArgs = $AggregateArgs<$Schema, "App_RoutingForms_IncompleteBookingActions">; +export type App_RoutingForms_IncompleteBookingActionsGroupByArgs = $GroupByArgs<$Schema, "App_RoutingForms_IncompleteBookingActions">; +export type App_RoutingForms_IncompleteBookingActionsWhereInput = $WhereInput<$Schema, "App_RoutingForms_IncompleteBookingActions">; +export type App_RoutingForms_IncompleteBookingActionsSelect = $SelectInput<$Schema, "App_RoutingForms_IncompleteBookingActions">; +export type App_RoutingForms_IncompleteBookingActionsInclude = $IncludeInput<$Schema, "App_RoutingForms_IncompleteBookingActions">; +export type App_RoutingForms_IncompleteBookingActionsOmit = $OmitInput<$Schema, "App_RoutingForms_IncompleteBookingActions">; +export type App_RoutingForms_IncompleteBookingActionsGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "App_RoutingForms_IncompleteBookingActions", Options, Args>; +export type InternalNotePresetFindManyArgs = $FindManyArgs<$Schema, "InternalNotePreset">; +export type InternalNotePresetFindUniqueArgs = $FindUniqueArgs<$Schema, "InternalNotePreset">; +export type InternalNotePresetFindFirstArgs = $FindFirstArgs<$Schema, "InternalNotePreset">; +export type InternalNotePresetCreateArgs = $CreateArgs<$Schema, "InternalNotePreset">; +export type InternalNotePresetCreateManyArgs = $CreateManyArgs<$Schema, "InternalNotePreset">; +export type InternalNotePresetCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "InternalNotePreset">; +export type InternalNotePresetUpdateArgs = $UpdateArgs<$Schema, "InternalNotePreset">; +export type InternalNotePresetUpdateManyArgs = $UpdateManyArgs<$Schema, "InternalNotePreset">; +export type InternalNotePresetUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "InternalNotePreset">; +export type InternalNotePresetUpsertArgs = $UpsertArgs<$Schema, "InternalNotePreset">; +export type InternalNotePresetDeleteArgs = $DeleteArgs<$Schema, "InternalNotePreset">; +export type InternalNotePresetDeleteManyArgs = $DeleteManyArgs<$Schema, "InternalNotePreset">; +export type InternalNotePresetCountArgs = $CountArgs<$Schema, "InternalNotePreset">; +export type InternalNotePresetAggregateArgs = $AggregateArgs<$Schema, "InternalNotePreset">; +export type InternalNotePresetGroupByArgs = $GroupByArgs<$Schema, "InternalNotePreset">; +export type InternalNotePresetWhereInput = $WhereInput<$Schema, "InternalNotePreset">; +export type InternalNotePresetSelect = $SelectInput<$Schema, "InternalNotePreset">; +export type InternalNotePresetInclude = $IncludeInput<$Schema, "InternalNotePreset">; +export type InternalNotePresetOmit = $OmitInput<$Schema, "InternalNotePreset">; +export type InternalNotePresetGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "InternalNotePreset", Options, Args>; +export type FilterSegmentFindManyArgs = $FindManyArgs<$Schema, "FilterSegment">; +export type FilterSegmentFindUniqueArgs = $FindUniqueArgs<$Schema, "FilterSegment">; +export type FilterSegmentFindFirstArgs = $FindFirstArgs<$Schema, "FilterSegment">; +export type FilterSegmentCreateArgs = $CreateArgs<$Schema, "FilterSegment">; +export type FilterSegmentCreateManyArgs = $CreateManyArgs<$Schema, "FilterSegment">; +export type FilterSegmentCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "FilterSegment">; +export type FilterSegmentUpdateArgs = $UpdateArgs<$Schema, "FilterSegment">; +export type FilterSegmentUpdateManyArgs = $UpdateManyArgs<$Schema, "FilterSegment">; +export type FilterSegmentUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "FilterSegment">; +export type FilterSegmentUpsertArgs = $UpsertArgs<$Schema, "FilterSegment">; +export type FilterSegmentDeleteArgs = $DeleteArgs<$Schema, "FilterSegment">; +export type FilterSegmentDeleteManyArgs = $DeleteManyArgs<$Schema, "FilterSegment">; +export type FilterSegmentCountArgs = $CountArgs<$Schema, "FilterSegment">; +export type FilterSegmentAggregateArgs = $AggregateArgs<$Schema, "FilterSegment">; +export type FilterSegmentGroupByArgs = $GroupByArgs<$Schema, "FilterSegment">; +export type FilterSegmentWhereInput = $WhereInput<$Schema, "FilterSegment">; +export type FilterSegmentSelect = $SelectInput<$Schema, "FilterSegment">; +export type FilterSegmentInclude = $IncludeInput<$Schema, "FilterSegment">; +export type FilterSegmentOmit = $OmitInput<$Schema, "FilterSegment">; +export type FilterSegmentGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "FilterSegment", Options, Args>; +export type UserFilterSegmentPreferenceFindManyArgs = $FindManyArgs<$Schema, "UserFilterSegmentPreference">; +export type UserFilterSegmentPreferenceFindUniqueArgs = $FindUniqueArgs<$Schema, "UserFilterSegmentPreference">; +export type UserFilterSegmentPreferenceFindFirstArgs = $FindFirstArgs<$Schema, "UserFilterSegmentPreference">; +export type UserFilterSegmentPreferenceCreateArgs = $CreateArgs<$Schema, "UserFilterSegmentPreference">; +export type UserFilterSegmentPreferenceCreateManyArgs = $CreateManyArgs<$Schema, "UserFilterSegmentPreference">; +export type UserFilterSegmentPreferenceCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "UserFilterSegmentPreference">; +export type UserFilterSegmentPreferenceUpdateArgs = $UpdateArgs<$Schema, "UserFilterSegmentPreference">; +export type UserFilterSegmentPreferenceUpdateManyArgs = $UpdateManyArgs<$Schema, "UserFilterSegmentPreference">; +export type UserFilterSegmentPreferenceUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "UserFilterSegmentPreference">; +export type UserFilterSegmentPreferenceUpsertArgs = $UpsertArgs<$Schema, "UserFilterSegmentPreference">; +export type UserFilterSegmentPreferenceDeleteArgs = $DeleteArgs<$Schema, "UserFilterSegmentPreference">; +export type UserFilterSegmentPreferenceDeleteManyArgs = $DeleteManyArgs<$Schema, "UserFilterSegmentPreference">; +export type UserFilterSegmentPreferenceCountArgs = $CountArgs<$Schema, "UserFilterSegmentPreference">; +export type UserFilterSegmentPreferenceAggregateArgs = $AggregateArgs<$Schema, "UserFilterSegmentPreference">; +export type UserFilterSegmentPreferenceGroupByArgs = $GroupByArgs<$Schema, "UserFilterSegmentPreference">; +export type UserFilterSegmentPreferenceWhereInput = $WhereInput<$Schema, "UserFilterSegmentPreference">; +export type UserFilterSegmentPreferenceSelect = $SelectInput<$Schema, "UserFilterSegmentPreference">; +export type UserFilterSegmentPreferenceInclude = $IncludeInput<$Schema, "UserFilterSegmentPreference">; +export type UserFilterSegmentPreferenceOmit = $OmitInput<$Schema, "UserFilterSegmentPreference">; +export type UserFilterSegmentPreferenceGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "UserFilterSegmentPreference", Options, Args>; +export type BookingInternalNoteFindManyArgs = $FindManyArgs<$Schema, "BookingInternalNote">; +export type BookingInternalNoteFindUniqueArgs = $FindUniqueArgs<$Schema, "BookingInternalNote">; +export type BookingInternalNoteFindFirstArgs = $FindFirstArgs<$Schema, "BookingInternalNote">; +export type BookingInternalNoteCreateArgs = $CreateArgs<$Schema, "BookingInternalNote">; +export type BookingInternalNoteCreateManyArgs = $CreateManyArgs<$Schema, "BookingInternalNote">; +export type BookingInternalNoteCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "BookingInternalNote">; +export type BookingInternalNoteUpdateArgs = $UpdateArgs<$Schema, "BookingInternalNote">; +export type BookingInternalNoteUpdateManyArgs = $UpdateManyArgs<$Schema, "BookingInternalNote">; +export type BookingInternalNoteUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "BookingInternalNote">; +export type BookingInternalNoteUpsertArgs = $UpsertArgs<$Schema, "BookingInternalNote">; +export type BookingInternalNoteDeleteArgs = $DeleteArgs<$Schema, "BookingInternalNote">; +export type BookingInternalNoteDeleteManyArgs = $DeleteManyArgs<$Schema, "BookingInternalNote">; +export type BookingInternalNoteCountArgs = $CountArgs<$Schema, "BookingInternalNote">; +export type BookingInternalNoteAggregateArgs = $AggregateArgs<$Schema, "BookingInternalNote">; +export type BookingInternalNoteGroupByArgs = $GroupByArgs<$Schema, "BookingInternalNote">; +export type BookingInternalNoteWhereInput = $WhereInput<$Schema, "BookingInternalNote">; +export type BookingInternalNoteSelect = $SelectInput<$Schema, "BookingInternalNote">; +export type BookingInternalNoteInclude = $IncludeInput<$Schema, "BookingInternalNote">; +export type BookingInternalNoteOmit = $OmitInput<$Schema, "BookingInternalNote">; +export type BookingInternalNoteGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "BookingInternalNote", Options, Args>; +export type WorkflowOptOutContactFindManyArgs = $FindManyArgs<$Schema, "WorkflowOptOutContact">; +export type WorkflowOptOutContactFindUniqueArgs = $FindUniqueArgs<$Schema, "WorkflowOptOutContact">; +export type WorkflowOptOutContactFindFirstArgs = $FindFirstArgs<$Schema, "WorkflowOptOutContact">; +export type WorkflowOptOutContactCreateArgs = $CreateArgs<$Schema, "WorkflowOptOutContact">; +export type WorkflowOptOutContactCreateManyArgs = $CreateManyArgs<$Schema, "WorkflowOptOutContact">; +export type WorkflowOptOutContactCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "WorkflowOptOutContact">; +export type WorkflowOptOutContactUpdateArgs = $UpdateArgs<$Schema, "WorkflowOptOutContact">; +export type WorkflowOptOutContactUpdateManyArgs = $UpdateManyArgs<$Schema, "WorkflowOptOutContact">; +export type WorkflowOptOutContactUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "WorkflowOptOutContact">; +export type WorkflowOptOutContactUpsertArgs = $UpsertArgs<$Schema, "WorkflowOptOutContact">; +export type WorkflowOptOutContactDeleteArgs = $DeleteArgs<$Schema, "WorkflowOptOutContact">; +export type WorkflowOptOutContactDeleteManyArgs = $DeleteManyArgs<$Schema, "WorkflowOptOutContact">; +export type WorkflowOptOutContactCountArgs = $CountArgs<$Schema, "WorkflowOptOutContact">; +export type WorkflowOptOutContactAggregateArgs = $AggregateArgs<$Schema, "WorkflowOptOutContact">; +export type WorkflowOptOutContactGroupByArgs = $GroupByArgs<$Schema, "WorkflowOptOutContact">; +export type WorkflowOptOutContactWhereInput = $WhereInput<$Schema, "WorkflowOptOutContact">; +export type WorkflowOptOutContactSelect = $SelectInput<$Schema, "WorkflowOptOutContact">; +export type WorkflowOptOutContactInclude = $IncludeInput<$Schema, "WorkflowOptOutContact">; +export type WorkflowOptOutContactOmit = $OmitInput<$Schema, "WorkflowOptOutContact">; +export type WorkflowOptOutContactGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "WorkflowOptOutContact", Options, Args>; +export type RoleFindManyArgs = $FindManyArgs<$Schema, "Role">; +export type RoleFindUniqueArgs = $FindUniqueArgs<$Schema, "Role">; +export type RoleFindFirstArgs = $FindFirstArgs<$Schema, "Role">; +export type RoleCreateArgs = $CreateArgs<$Schema, "Role">; +export type RoleCreateManyArgs = $CreateManyArgs<$Schema, "Role">; +export type RoleCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Role">; +export type RoleUpdateArgs = $UpdateArgs<$Schema, "Role">; +export type RoleUpdateManyArgs = $UpdateManyArgs<$Schema, "Role">; +export type RoleUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Role">; +export type RoleUpsertArgs = $UpsertArgs<$Schema, "Role">; +export type RoleDeleteArgs = $DeleteArgs<$Schema, "Role">; +export type RoleDeleteManyArgs = $DeleteManyArgs<$Schema, "Role">; +export type RoleCountArgs = $CountArgs<$Schema, "Role">; +export type RoleAggregateArgs = $AggregateArgs<$Schema, "Role">; +export type RoleGroupByArgs = $GroupByArgs<$Schema, "Role">; +export type RoleWhereInput = $WhereInput<$Schema, "Role">; +export type RoleSelect = $SelectInput<$Schema, "Role">; +export type RoleInclude = $IncludeInput<$Schema, "Role">; +export type RoleOmit = $OmitInput<$Schema, "Role">; +export type RoleGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Role", Options, Args>; +export type RolePermissionFindManyArgs = $FindManyArgs<$Schema, "RolePermission">; +export type RolePermissionFindUniqueArgs = $FindUniqueArgs<$Schema, "RolePermission">; +export type RolePermissionFindFirstArgs = $FindFirstArgs<$Schema, "RolePermission">; +export type RolePermissionCreateArgs = $CreateArgs<$Schema, "RolePermission">; +export type RolePermissionCreateManyArgs = $CreateManyArgs<$Schema, "RolePermission">; +export type RolePermissionCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "RolePermission">; +export type RolePermissionUpdateArgs = $UpdateArgs<$Schema, "RolePermission">; +export type RolePermissionUpdateManyArgs = $UpdateManyArgs<$Schema, "RolePermission">; +export type RolePermissionUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "RolePermission">; +export type RolePermissionUpsertArgs = $UpsertArgs<$Schema, "RolePermission">; +export type RolePermissionDeleteArgs = $DeleteArgs<$Schema, "RolePermission">; +export type RolePermissionDeleteManyArgs = $DeleteManyArgs<$Schema, "RolePermission">; +export type RolePermissionCountArgs = $CountArgs<$Schema, "RolePermission">; +export type RolePermissionAggregateArgs = $AggregateArgs<$Schema, "RolePermission">; +export type RolePermissionGroupByArgs = $GroupByArgs<$Schema, "RolePermission">; +export type RolePermissionWhereInput = $WhereInput<$Schema, "RolePermission">; +export type RolePermissionSelect = $SelectInput<$Schema, "RolePermission">; +export type RolePermissionInclude = $IncludeInput<$Schema, "RolePermission">; +export type RolePermissionOmit = $OmitInput<$Schema, "RolePermission">; +export type RolePermissionGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "RolePermission", Options, Args>; diff --git a/tests/e2e/github-repos/cal.com/models.ts b/tests/e2e/github-repos/cal.com/models.ts new file mode 100644 index 000000000..26c9b777e --- /dev/null +++ b/tests/e2e/github-repos/cal.com/models.ts @@ -0,0 +1,174 @@ +////////////////////////////////////////////////////////////////////////////////////////////// +// DO NOT MODIFY THIS FILE // +// This file is automatically generated by ZenStack CLI and should not be manually updated. // +////////////////////////////////////////////////////////////////////////////////////////////// + +/* eslint-disable */ + +import { schema as $schema, type SchemaType as $Schema } from "./schema"; +import { type ModelResult as $ModelResult } from "@zenstackhq/orm"; +export type Host = $ModelResult<$Schema, "Host">; +export type CalVideoSettings = $ModelResult<$Schema, "CalVideoSettings">; +export type EventType = $ModelResult<$Schema, "EventType">; +export type Credential = $ModelResult<$Schema, "Credential">; +export type DestinationCalendar = $ModelResult<$Schema, "DestinationCalendar">; +export type UserPassword = $ModelResult<$Schema, "UserPassword">; +export type TravelSchedule = $ModelResult<$Schema, "TravelSchedule">; +export type User = $ModelResult<$Schema, "User">; +export type NotificationsSubscriptions = $ModelResult<$Schema, "NotificationsSubscriptions">; +export type Profile = $ModelResult<$Schema, "Profile">; +export type Team = $ModelResult<$Schema, "Team">; +export type CreditBalance = $ModelResult<$Schema, "CreditBalance">; +export type CreditPurchaseLog = $ModelResult<$Schema, "CreditPurchaseLog">; +export type CreditExpenseLog = $ModelResult<$Schema, "CreditExpenseLog">; +export type OrganizationSettings = $ModelResult<$Schema, "OrganizationSettings">; +export type Membership = $ModelResult<$Schema, "Membership">; +export type VerificationToken = $ModelResult<$Schema, "VerificationToken">; +export type InstantMeetingToken = $ModelResult<$Schema, "InstantMeetingToken">; +export type BookingReference = $ModelResult<$Schema, "BookingReference">; +export type Attendee = $ModelResult<$Schema, "Attendee">; +export type Booking = $ModelResult<$Schema, "Booking">; +export type Tracking = $ModelResult<$Schema, "Tracking">; +export type Schedule = $ModelResult<$Schema, "Schedule">; +export type Availability = $ModelResult<$Schema, "Availability">; +export type SelectedCalendar = $ModelResult<$Schema, "SelectedCalendar">; +export type EventTypeCustomInput = $ModelResult<$Schema, "EventTypeCustomInput">; +export type ResetPasswordRequest = $ModelResult<$Schema, "ResetPasswordRequest">; +export type ReminderMail = $ModelResult<$Schema, "ReminderMail">; +export type Payment = $ModelResult<$Schema, "Payment">; +export type Webhook = $ModelResult<$Schema, "Webhook">; +export type Impersonations = $ModelResult<$Schema, "Impersonations">; +export type ApiKey = $ModelResult<$Schema, "ApiKey">; +export type RateLimit = $ModelResult<$Schema, "RateLimit">; +export type HashedLink = $ModelResult<$Schema, "HashedLink">; +export type Account = $ModelResult<$Schema, "Account">; +export type Session = $ModelResult<$Schema, "Session">; +export type App = $ModelResult<$Schema, "App">; +export type App_RoutingForms_Form = $ModelResult<$Schema, "App_RoutingForms_Form">; +export type App_RoutingForms_FormResponse = $ModelResult<$Schema, "App_RoutingForms_FormResponse">; +export type App_RoutingForms_QueuedFormResponse = $ModelResult<$Schema, "App_RoutingForms_QueuedFormResponse">; +export type RoutingFormResponseField = $ModelResult<$Schema, "RoutingFormResponseField">; +export type RoutingFormResponse = $ModelResult<$Schema, "RoutingFormResponse">; +export type RoutingFormResponseDenormalized = $ModelResult<$Schema, "RoutingFormResponseDenormalized">; +export type Feedback = $ModelResult<$Schema, "Feedback">; +export type WorkflowStep = $ModelResult<$Schema, "WorkflowStep">; +export type Workflow = $ModelResult<$Schema, "Workflow">; +export type AIPhoneCallConfiguration = $ModelResult<$Schema, "AIPhoneCallConfiguration">; +export type WorkflowsOnEventTypes = $ModelResult<$Schema, "WorkflowsOnEventTypes">; +export type WorkflowsOnTeams = $ModelResult<$Schema, "WorkflowsOnTeams">; +export type Deployment = $ModelResult<$Schema, "Deployment">; +export type WorkflowReminder = $ModelResult<$Schema, "WorkflowReminder">; +export type WebhookScheduledTriggers = $ModelResult<$Schema, "WebhookScheduledTriggers">; +export type BookingSeat = $ModelResult<$Schema, "BookingSeat">; +export type VerifiedNumber = $ModelResult<$Schema, "VerifiedNumber">; +export type VerifiedEmail = $ModelResult<$Schema, "VerifiedEmail">; +export type Feature = $ModelResult<$Schema, "Feature">; +export type UserFeatures = $ModelResult<$Schema, "UserFeatures">; +export type TeamFeatures = $ModelResult<$Schema, "TeamFeatures">; +export type SelectedSlots = $ModelResult<$Schema, "SelectedSlots">; +export type OAuthClient = $ModelResult<$Schema, "OAuthClient">; +export type AccessCode = $ModelResult<$Schema, "AccessCode">; +export type BookingTimeStatus = $ModelResult<$Schema, "BookingTimeStatus">; +export type BookingDenormalized = $ModelResult<$Schema, "BookingDenormalized">; +export type BookingTimeStatusDenormalized = $ModelResult<$Schema, "BookingTimeStatusDenormalized">; +export type CalendarCache = $ModelResult<$Schema, "CalendarCache">; +export type TempOrgRedirect = $ModelResult<$Schema, "TempOrgRedirect">; +export type Avatar = $ModelResult<$Schema, "Avatar">; +export type OutOfOfficeEntry = $ModelResult<$Schema, "OutOfOfficeEntry">; +export type OutOfOfficeReason = $ModelResult<$Schema, "OutOfOfficeReason">; +export type PlatformOAuthClient = $ModelResult<$Schema, "PlatformOAuthClient">; +export type PlatformAuthorizationToken = $ModelResult<$Schema, "PlatformAuthorizationToken">; +export type AccessToken = $ModelResult<$Schema, "AccessToken">; +export type RefreshToken = $ModelResult<$Schema, "RefreshToken">; +export type DSyncData = $ModelResult<$Schema, "DSyncData">; +export type DSyncTeamGroupMapping = $ModelResult<$Schema, "DSyncTeamGroupMapping">; +export type SecondaryEmail = $ModelResult<$Schema, "SecondaryEmail">; +export type Task = $ModelResult<$Schema, "Task">; +export type ManagedOrganization = $ModelResult<$Schema, "ManagedOrganization">; +export type PlatformBilling = $ModelResult<$Schema, "PlatformBilling">; +export type AttributeOption = $ModelResult<$Schema, "AttributeOption">; +export type Attribute = $ModelResult<$Schema, "Attribute">; +export type AttributeToUser = $ModelResult<$Schema, "AttributeToUser">; +export type AssignmentReason = $ModelResult<$Schema, "AssignmentReason">; +export type DelegationCredential = $ModelResult<$Schema, "DelegationCredential">; +export type DomainWideDelegation = $ModelResult<$Schema, "DomainWideDelegation">; +export type WorkspacePlatform = $ModelResult<$Schema, "WorkspacePlatform">; +export type EventTypeTranslation = $ModelResult<$Schema, "EventTypeTranslation">; +export type Watchlist = $ModelResult<$Schema, "Watchlist">; +export type OrganizationOnboarding = $ModelResult<$Schema, "OrganizationOnboarding">; +export type App_RoutingForms_IncompleteBookingActions = $ModelResult<$Schema, "App_RoutingForms_IncompleteBookingActions">; +export type InternalNotePreset = $ModelResult<$Schema, "InternalNotePreset">; +export type FilterSegment = $ModelResult<$Schema, "FilterSegment">; +export type UserFilterSegmentPreference = $ModelResult<$Schema, "UserFilterSegmentPreference">; +export type BookingInternalNote = $ModelResult<$Schema, "BookingInternalNote">; +export type WorkflowOptOutContact = $ModelResult<$Schema, "WorkflowOptOutContact">; +export type Role = $ModelResult<$Schema, "Role">; +export type RolePermission = $ModelResult<$Schema, "RolePermission">; +export const SchedulingType = $schema.enums.SchedulingType.values; +export type SchedulingType = (typeof SchedulingType)[keyof typeof SchedulingType]; +export const PeriodType = $schema.enums.PeriodType.values; +export type PeriodType = (typeof PeriodType)[keyof typeof PeriodType]; +export const CreationSource = $schema.enums.CreationSource.values; +export type CreationSource = (typeof CreationSource)[keyof typeof CreationSource]; +export const IdentityProvider = $schema.enums.IdentityProvider.values; +export type IdentityProvider = (typeof IdentityProvider)[keyof typeof IdentityProvider]; +export const UserPermissionRole = $schema.enums.UserPermissionRole.values; +export type UserPermissionRole = (typeof UserPermissionRole)[keyof typeof UserPermissionRole]; +export const CreditType = $schema.enums.CreditType.values; +export type CreditType = (typeof CreditType)[keyof typeof CreditType]; +export const MembershipRole = $schema.enums.MembershipRole.values; +export type MembershipRole = (typeof MembershipRole)[keyof typeof MembershipRole]; +export const BookingStatus = $schema.enums.BookingStatus.values; +export type BookingStatus = (typeof BookingStatus)[keyof typeof BookingStatus]; +export const EventTypeCustomInputType = $schema.enums.EventTypeCustomInputType.values; +export type EventTypeCustomInputType = (typeof EventTypeCustomInputType)[keyof typeof EventTypeCustomInputType]; +export const ReminderType = $schema.enums.ReminderType.values; +export type ReminderType = (typeof ReminderType)[keyof typeof ReminderType]; +export const PaymentOption = $schema.enums.PaymentOption.values; +export type PaymentOption = (typeof PaymentOption)[keyof typeof PaymentOption]; +export const WebhookTriggerEvents = $schema.enums.WebhookTriggerEvents.values; +export type WebhookTriggerEvents = (typeof WebhookTriggerEvents)[keyof typeof WebhookTriggerEvents]; +export const AppCategories = $schema.enums.AppCategories.values; +export type AppCategories = (typeof AppCategories)[keyof typeof AppCategories]; +export const WorkflowTriggerEvents = $schema.enums.WorkflowTriggerEvents.values; +export type WorkflowTriggerEvents = (typeof WorkflowTriggerEvents)[keyof typeof WorkflowTriggerEvents]; +export const WorkflowActions = $schema.enums.WorkflowActions.values; +export type WorkflowActions = (typeof WorkflowActions)[keyof typeof WorkflowActions]; +export const TimeUnit = $schema.enums.TimeUnit.values; +export type TimeUnit = (typeof TimeUnit)[keyof typeof TimeUnit]; +export const WorkflowTemplates = $schema.enums.WorkflowTemplates.values; +export type WorkflowTemplates = (typeof WorkflowTemplates)[keyof typeof WorkflowTemplates]; +export const WorkflowMethods = $schema.enums.WorkflowMethods.values; +export type WorkflowMethods = (typeof WorkflowMethods)[keyof typeof WorkflowMethods]; +export const FeatureType = $schema.enums.FeatureType.values; +export type FeatureType = (typeof FeatureType)[keyof typeof FeatureType]; +export const RRResetInterval = $schema.enums.RRResetInterval.values; +export type RRResetInterval = (typeof RRResetInterval)[keyof typeof RRResetInterval]; +export const RRTimestampBasis = $schema.enums.RRTimestampBasis.values; +export type RRTimestampBasis = (typeof RRTimestampBasis)[keyof typeof RRTimestampBasis]; +export const AccessScope = $schema.enums.AccessScope.values; +export type AccessScope = (typeof AccessScope)[keyof typeof AccessScope]; +export const RedirectType = $schema.enums.RedirectType.values; +export type RedirectType = (typeof RedirectType)[keyof typeof RedirectType]; +export const SMSLockState = $schema.enums.SMSLockState.values; +export type SMSLockState = (typeof SMSLockState)[keyof typeof SMSLockState]; +export const AttributeType = $schema.enums.AttributeType.values; +export type AttributeType = (typeof AttributeType)[keyof typeof AttributeType]; +export const AssignmentReasonEnum = $schema.enums.AssignmentReasonEnum.values; +export type AssignmentReasonEnum = (typeof AssignmentReasonEnum)[keyof typeof AssignmentReasonEnum]; +export const EventTypeAutoTranslatedField = $schema.enums.EventTypeAutoTranslatedField.values; +export type EventTypeAutoTranslatedField = (typeof EventTypeAutoTranslatedField)[keyof typeof EventTypeAutoTranslatedField]; +export const WatchlistType = $schema.enums.WatchlistType.values; +export type WatchlistType = (typeof WatchlistType)[keyof typeof WatchlistType]; +export const WatchlistSeverity = $schema.enums.WatchlistSeverity.values; +export type WatchlistSeverity = (typeof WatchlistSeverity)[keyof typeof WatchlistSeverity]; +export const BillingPeriod = $schema.enums.BillingPeriod.values; +export type BillingPeriod = (typeof BillingPeriod)[keyof typeof BillingPeriod]; +export const IncompleteBookingActionType = $schema.enums.IncompleteBookingActionType.values; +export type IncompleteBookingActionType = (typeof IncompleteBookingActionType)[keyof typeof IncompleteBookingActionType]; +export const FilterSegmentScope = $schema.enums.FilterSegmentScope.values; +export type FilterSegmentScope = (typeof FilterSegmentScope)[keyof typeof FilterSegmentScope]; +export const WorkflowContactType = $schema.enums.WorkflowContactType.values; +export type WorkflowContactType = (typeof WorkflowContactType)[keyof typeof WorkflowContactType]; +export const RoleType = $schema.enums.RoleType.values; +export type RoleType = (typeof RoleType)[keyof typeof RoleType]; diff --git a/tests/e2e/github-repos/cal.com/schema.ts b/tests/e2e/github-repos/cal.com/schema.ts new file mode 100644 index 000000000..8648a17cb --- /dev/null +++ b/tests/e2e/github-repos/cal.com/schema.ts @@ -0,0 +1,9643 @@ +////////////////////////////////////////////////////////////////////////////////////////////// +// DO NOT MODIFY THIS FILE // +// This file is automatically generated by ZenStack CLI and should not be manually updated. // +////////////////////////////////////////////////////////////////////////////////////////////// + +/* eslint-disable */ + +import { type SchemaDef, ExpressionUtils } from "@zenstackhq/orm/schema"; +export class SchemaType implements SchemaDef { + provider = { + type: "postgresql" + } as const; + models = { + Host: { + name: "Host", + fields: { + user: { + name: "user", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "hosts", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + userId: { + name: "userId", + type: "Int", + id: true, + foreignKeyFor: [ + "user" + ] + }, + eventType: { + name: "eventType", + type: "EventType", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("eventTypeId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "hosts", fields: ["eventTypeId"], references: ["id"], onDelete: "Cascade" } + }, + eventTypeId: { + name: "eventTypeId", + type: "Int", + id: true, + foreignKeyFor: [ + "eventType" + ] + }, + isFixed: { + name: "isFixed", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + priority: { + name: "priority", + type: "Int", + optional: true + }, + weight: { + name: "weight", + type: "Int", + optional: true + }, + weightAdjustment: { + name: "weightAdjustment", + type: "Int", + optional: true + }, + schedule: { + name: "schedule", + type: "Schedule", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("scheduleId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "Host", fields: ["scheduleId"], references: ["id"] } + }, + scheduleId: { + name: "scheduleId", + type: "Int", + optional: true, + foreignKeyFor: [ + "schedule" + ] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + } + }, + attributes: [ + { name: "@@id", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId"), ExpressionUtils.field("eventTypeId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("eventTypeId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("scheduleId")]) }] } + ], + idFields: ["userId", "eventTypeId"], + uniqueFields: { + userId_eventTypeId: { userId: { type: "Int" }, eventTypeId: { type: "Int" } } + } + }, + CalVideoSettings: { + name: "CalVideoSettings", + fields: { + eventTypeId: { + name: "eventTypeId", + type: "Int", + id: true, + attributes: [{ name: "@id" }], + foreignKeyFor: [ + "eventType" + ] + }, + eventType: { + name: "eventType", + type: "EventType", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("eventTypeId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "calVideoSettings", fields: ["eventTypeId"], references: ["id"], onDelete: "Cascade" } + }, + disableRecordingForOrganizer: { + name: "disableRecordingForOrganizer", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + disableRecordingForGuests: { + name: "disableRecordingForGuests", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + enableAutomaticTranscription: { + name: "enableAutomaticTranscription", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + redirectUrlOnExit: { + name: "redirectUrlOnExit", + type: "String", + optional: true + }, + disableTranscriptionForGuests: { + name: "disableTranscriptionForGuests", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + disableTranscriptionForOrganizer: { + name: "disableTranscriptionForOrganizer", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + } + }, + idFields: ["eventTypeId"], + uniqueFields: { + eventTypeId: { type: "Int" } + } + }, + EventType: { + name: "EventType", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + title: { + name: "title", + type: "String" + }, + slug: { + name: "slug", + type: "String" + }, + description: { + name: "description", + type: "String", + optional: true + }, + interfaceLanguage: { + name: "interfaceLanguage", + type: "String", + optional: true + }, + position: { + name: "position", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + locations: { + name: "locations", + type: "Json", + optional: true + }, + length: { + name: "length", + type: "Int" + }, + offsetStart: { + name: "offsetStart", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + hidden: { + name: "hidden", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + hosts: { + name: "hosts", + type: "Host", + array: true, + relation: { opposite: "eventType" } + }, + users: { + name: "users", + type: "User", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("user_eventtype") }] }], + relation: { opposite: "eventTypes", name: "user_eventtype" } + }, + owner: { + name: "owner", + type: "User", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("owner") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "ownedEventTypes", name: "owner", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + userId: { + name: "userId", + type: "Int", + optional: true, + foreignKeyFor: [ + "owner" + ] + }, + profileId: { + name: "profileId", + type: "Int", + optional: true, + foreignKeyFor: [ + "profile" + ] + }, + profile: { + name: "profile", + type: "Profile", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("profileId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "eventTypes", fields: ["profileId"], references: ["id"] } + }, + team: { + name: "team", + type: "Team", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "eventTypes", fields: ["teamId"], references: ["id"], onDelete: "Cascade" } + }, + teamId: { + name: "teamId", + type: "Int", + optional: true, + foreignKeyFor: [ + "team" + ] + }, + hashedLink: { + name: "hashedLink", + type: "HashedLink", + array: true, + relation: { opposite: "eventType" } + }, + bookings: { + name: "bookings", + type: "Booking", + array: true, + relation: { opposite: "eventType" } + }, + availability: { + name: "availability", + type: "Availability", + array: true, + relation: { opposite: "eventType" } + }, + webhooks: { + name: "webhooks", + type: "Webhook", + array: true, + relation: { opposite: "eventType" } + }, + destinationCalendar: { + name: "destinationCalendar", + type: "DestinationCalendar", + optional: true, + relation: { opposite: "eventType" } + }, + useEventLevelSelectedCalendars: { + name: "useEventLevelSelectedCalendars", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + eventName: { + name: "eventName", + type: "String", + optional: true + }, + customInputs: { + name: "customInputs", + type: "EventTypeCustomInput", + array: true, + relation: { opposite: "eventType" } + }, + parentId: { + name: "parentId", + type: "Int", + optional: true, + foreignKeyFor: [ + "parent" + ] + }, + parent: { + name: "parent", + type: "EventType", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("managed_eventtype") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("parentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "children", name: "managed_eventtype", fields: ["parentId"], references: ["id"], onDelete: "Cascade" } + }, + children: { + name: "children", + type: "EventType", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("managed_eventtype") }] }], + relation: { opposite: "parent", name: "managed_eventtype" } + }, + bookingFields: { + name: "bookingFields", + type: "Json", + optional: true + }, + timeZone: { + name: "timeZone", + type: "String", + optional: true + }, + periodType: { + name: "periodType", + type: "PeriodType", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("UNLIMITED") }] }], + default: "UNLIMITED" + }, + periodStartDate: { + name: "periodStartDate", + type: "DateTime", + optional: true + }, + periodEndDate: { + name: "periodEndDate", + type: "DateTime", + optional: true + }, + periodDays: { + name: "periodDays", + type: "Int", + optional: true + }, + periodCountCalendarDays: { + name: "periodCountCalendarDays", + type: "Boolean", + optional: true + }, + lockTimeZoneToggleOnBookingPage: { + name: "lockTimeZoneToggleOnBookingPage", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + requiresConfirmation: { + name: "requiresConfirmation", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + requiresConfirmationWillBlockSlot: { + name: "requiresConfirmationWillBlockSlot", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + requiresConfirmationForFreeEmail: { + name: "requiresConfirmationForFreeEmail", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + requiresBookerEmailVerification: { + name: "requiresBookerEmailVerification", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + canSendCalVideoTranscriptionEmails: { + name: "canSendCalVideoTranscriptionEmails", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(true) }] }], + default: true + }, + autoTranslateDescriptionEnabled: { + name: "autoTranslateDescriptionEnabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + recurringEvent: { + name: "recurringEvent", + type: "Json", + optional: true + }, + disableGuests: { + name: "disableGuests", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + hideCalendarNotes: { + name: "hideCalendarNotes", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + hideCalendarEventDetails: { + name: "hideCalendarEventDetails", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + minimumBookingNotice: { + name: "minimumBookingNotice", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(120) }] }], + default: 120 + }, + beforeEventBuffer: { + name: "beforeEventBuffer", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + afterEventBuffer: { + name: "afterEventBuffer", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + seatsPerTimeSlot: { + name: "seatsPerTimeSlot", + type: "Int", + optional: true + }, + onlyShowFirstAvailableSlot: { + name: "onlyShowFirstAvailableSlot", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + disableCancelling: { + name: "disableCancelling", + type: "Boolean", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + disableRescheduling: { + name: "disableRescheduling", + type: "Boolean", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + seatsShowAttendees: { + name: "seatsShowAttendees", + type: "Boolean", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + seatsShowAvailabilityCount: { + name: "seatsShowAvailabilityCount", + type: "Boolean", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(true) }] }], + default: true + }, + schedulingType: { + name: "schedulingType", + type: "SchedulingType", + optional: true + }, + schedule: { + name: "schedule", + type: "Schedule", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("scheduleId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "eventType", fields: ["scheduleId"], references: ["id"] } + }, + scheduleId: { + name: "scheduleId", + type: "Int", + optional: true, + foreignKeyFor: [ + "schedule" + ] + }, + allowReschedulingCancelledBookings: { + name: "allowReschedulingCancelledBookings", + type: "Boolean", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + price: { + name: "price", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + currency: { + name: "currency", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("usd") }] }], + default: "usd" + }, + slotInterval: { + name: "slotInterval", + type: "Int", + optional: true + }, + metadata: { + name: "metadata", + type: "Json", + optional: true + }, + successRedirectUrl: { + name: "successRedirectUrl", + type: "String", + optional: true + }, + forwardParamsSuccessRedirect: { + name: "forwardParamsSuccessRedirect", + type: "Boolean", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(true) }] }], + default: true + }, + workflows: { + name: "workflows", + type: "WorkflowsOnEventTypes", + array: true, + relation: { opposite: "eventType" } + }, + bookingLimits: { + name: "bookingLimits", + type: "Json", + optional: true + }, + durationLimits: { + name: "durationLimits", + type: "Json", + optional: true + }, + isInstantEvent: { + name: "isInstantEvent", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + instantMeetingExpiryTimeOffsetInSeconds: { + name: "instantMeetingExpiryTimeOffsetInSeconds", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(90) }] }], + default: 90 + }, + instantMeetingScheduleId: { + name: "instantMeetingScheduleId", + type: "Int", + optional: true, + foreignKeyFor: [ + "instantMeetingSchedule" + ] + }, + instantMeetingSchedule: { + name: "instantMeetingSchedule", + type: "Schedule", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("InstantMeetingSchedule") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("instantMeetingScheduleId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "instantMeetingEvents", name: "InstantMeetingSchedule", fields: ["instantMeetingScheduleId"], references: ["id"] } + }, + instantMeetingParameters: { + name: "instantMeetingParameters", + type: "String", + array: true + }, + assignAllTeamMembers: { + name: "assignAllTeamMembers", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + assignRRMembersUsingSegment: { + name: "assignRRMembersUsingSegment", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + rrSegmentQueryValue: { + name: "rrSegmentQueryValue", + type: "Json", + optional: true + }, + useEventTypeDestinationCalendarEmail: { + name: "useEventTypeDestinationCalendarEmail", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + aiPhoneCallConfig: { + name: "aiPhoneCallConfig", + type: "AIPhoneCallConfiguration", + optional: true, + relation: { opposite: "eventType" } + }, + isRRWeightsEnabled: { + name: "isRRWeightsEnabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + fieldTranslations: { + name: "fieldTranslations", + type: "EventTypeTranslation", + array: true, + relation: { opposite: "eventType" } + }, + maxLeadThreshold: { + name: "maxLeadThreshold", + type: "Int", + optional: true + }, + includeNoShowInRRCalculation: { + name: "includeNoShowInRRCalculation", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + selectedCalendars: { + name: "selectedCalendars", + type: "SelectedCalendar", + array: true, + relation: { opposite: "eventType" } + }, + allowReschedulingPastBookings: { + name: "allowReschedulingPastBookings", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + hideOrganizerEmail: { + name: "hideOrganizerEmail", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + maxActiveBookingsPerBooker: { + name: "maxActiveBookingsPerBooker", + type: "Int", + optional: true + }, + maxActiveBookingPerBookerOfferReschedule: { + name: "maxActiveBookingPerBookerOfferReschedule", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + customReplyToEmail: { + name: "customReplyToEmail", + type: "String", + optional: true + }, + calVideoSettings: { + name: "calVideoSettings", + type: "CalVideoSettings", + optional: true, + relation: { opposite: "eventType" } + }, + eventTypeColor: { + name: "eventTypeColor", + type: "Json", + optional: true + }, + rescheduleWithSameRoundRobinHost: { + name: "rescheduleWithSameRoundRobinHost", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + secondaryEmailId: { + name: "secondaryEmailId", + type: "Int", + optional: true, + foreignKeyFor: [ + "secondaryEmail" + ] + }, + secondaryEmail: { + name: "secondaryEmail", + type: "SecondaryEmail", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("secondaryEmailId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "eventTypes", fields: ["secondaryEmailId"], references: ["id"], onDelete: "Cascade" } + }, + useBookerTimezone: { + name: "useBookerTimezone", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + restrictionScheduleId: { + name: "restrictionScheduleId", + type: "Int", + optional: true, + foreignKeyFor: [ + "restrictionSchedule" + ] + }, + restrictionSchedule: { + name: "restrictionSchedule", + type: "Schedule", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("restrictionSchedule") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("restrictionScheduleId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "restrictionSchedule", name: "restrictionSchedule", fields: ["restrictionScheduleId"], references: ["id"] } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId"), ExpressionUtils.field("slug")]) }] }, + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId"), ExpressionUtils.field("slug")]) }] }, + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId"), ExpressionUtils.field("parentId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("profileId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("scheduleId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("secondaryEmailId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("parentId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("restrictionScheduleId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + userId_slug: { userId: { type: "Int" }, slug: { type: "String" } }, + teamId_slug: { teamId: { type: "Int" }, slug: { type: "String" } }, + userId_parentId: { userId: { type: "Int" }, parentId: { type: "Int" } } + } + }, + Credential: { + name: "Credential", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + type: { + name: "type", + type: "String" + }, + key: { + name: "key", + type: "Json" + }, + user: { + name: "user", + type: "User", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "credentials", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + userId: { + name: "userId", + type: "Int", + optional: true, + foreignKeyFor: [ + "user" + ] + }, + team: { + name: "team", + type: "Team", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "credentials", fields: ["teamId"], references: ["id"], onDelete: "Cascade" } + }, + teamId: { + name: "teamId", + type: "Int", + optional: true, + foreignKeyFor: [ + "team" + ] + }, + app: { + name: "app", + type: "App", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("appId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("slug")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "credentials", fields: ["appId"], references: ["slug"], onDelete: "Cascade" } + }, + appId: { + name: "appId", + type: "String", + optional: true, + foreignKeyFor: [ + "app" + ] + }, + subscriptionId: { + name: "subscriptionId", + type: "String", + optional: true + }, + paymentStatus: { + name: "paymentStatus", + type: "String", + optional: true + }, + billingCycleStart: { + name: "billingCycleStart", + type: "Int", + optional: true + }, + destinationCalendars: { + name: "destinationCalendars", + type: "DestinationCalendar", + array: true, + relation: { opposite: "credential" } + }, + selectedCalendars: { + name: "selectedCalendars", + type: "SelectedCalendar", + array: true, + relation: { opposite: "credential" } + }, + invalid: { + name: "invalid", + type: "Boolean", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + CalendarCache: { + name: "CalendarCache", + type: "CalendarCache", + array: true, + relation: { opposite: "credential" } + }, + references: { + name: "references", + type: "BookingReference", + array: true, + relation: { opposite: "credential" } + }, + delegationCredentialId: { + name: "delegationCredentialId", + type: "String", + optional: true, + foreignKeyFor: [ + "delegationCredential" + ] + }, + delegationCredential: { + name: "delegationCredential", + type: "DelegationCredential", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("delegationCredentialId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "credentials", fields: ["delegationCredentialId"], references: ["id"], onDelete: "Cascade" } + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("appId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("subscriptionId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("invalid")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId"), ExpressionUtils.field("delegationCredentialId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + } + }, + DestinationCalendar: { + name: "DestinationCalendar", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + integration: { + name: "integration", + type: "String" + }, + externalId: { + name: "externalId", + type: "String" + }, + primaryEmail: { + name: "primaryEmail", + type: "String", + optional: true + }, + user: { + name: "user", + type: "User", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "destinationCalendar", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + userId: { + name: "userId", + type: "Int", + unique: true, + optional: true, + attributes: [{ name: "@unique" }], + foreignKeyFor: [ + "user" + ] + }, + booking: { + name: "booking", + type: "Booking", + array: true, + relation: { opposite: "destinationCalendar" } + }, + eventType: { + name: "eventType", + type: "EventType", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("eventTypeId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "destinationCalendar", fields: ["eventTypeId"], references: ["id"], onDelete: "Cascade" } + }, + eventTypeId: { + name: "eventTypeId", + type: "Int", + unique: true, + optional: true, + attributes: [{ name: "@unique" }], + foreignKeyFor: [ + "eventType" + ] + }, + credentialId: { + name: "credentialId", + type: "Int", + optional: true, + foreignKeyFor: [ + "credential" + ] + }, + credential: { + name: "credential", + type: "Credential", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("credentialId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "destinationCalendars", fields: ["credentialId"], references: ["id"], onDelete: "Cascade" } + }, + delegationCredential: { + name: "delegationCredential", + type: "DelegationCredential", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("delegationCredentialId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "destinationCalendar", fields: ["delegationCredentialId"], references: ["id"], onDelete: "Cascade" } + }, + delegationCredentialId: { + name: "delegationCredentialId", + type: "String", + optional: true, + foreignKeyFor: [ + "delegationCredential" + ] + }, + domainWideDelegation: { + name: "domainWideDelegation", + type: "DomainWideDelegation", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("domainWideDelegationCredentialId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "destinationCalendar", fields: ["domainWideDelegationCredentialId"], references: ["id"], onDelete: "Cascade" } + }, + domainWideDelegationCredentialId: { + name: "domainWideDelegationCredentialId", + type: "String", + optional: true, + foreignKeyFor: [ + "domainWideDelegation" + ] + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("eventTypeId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("credentialId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + userId: { type: "Int" }, + eventTypeId: { type: "Int" } + } + }, + UserPassword: { + name: "UserPassword", + fields: { + hash: { + name: "hash", + type: "String" + }, + userId: { + name: "userId", + type: "Int", + id: true, + unique: true, + attributes: [{ name: "@unique" }], + foreignKeyFor: [ + "user" + ] + }, + user: { + name: "user", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "password", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + } + }, + idFields: ["userId"], + uniqueFields: { + userId: { type: "Int" } + } + }, + TravelSchedule: { + name: "TravelSchedule", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + userId: { + name: "userId", + type: "Int", + foreignKeyFor: [ + "user" + ] + }, + user: { + name: "user", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "travelSchedules", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + timeZone: { + name: "timeZone", + type: "String" + }, + startDate: { + name: "startDate", + type: "DateTime" + }, + endDate: { + name: "endDate", + type: "DateTime", + optional: true + }, + prevTimeZone: { + name: "prevTimeZone", + type: "String", + optional: true + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("startDate")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("endDate")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + } + }, + User: { + name: "User", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + username: { + name: "username", + type: "String", + optional: true + }, + name: { + name: "name", + type: "String", + optional: true + }, + email: { + name: "email", + type: "String" + }, + emailVerified: { + name: "emailVerified", + type: "DateTime", + optional: true + }, + password: { + name: "password", + type: "UserPassword", + optional: true, + relation: { opposite: "user" } + }, + bio: { + name: "bio", + type: "String", + optional: true + }, + avatarUrl: { + name: "avatarUrl", + type: "String", + optional: true + }, + timeZone: { + name: "timeZone", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("Europe/London") }] }], + default: "Europe/London" + }, + travelSchedules: { + name: "travelSchedules", + type: "TravelSchedule", + array: true, + relation: { opposite: "user" } + }, + weekStart: { + name: "weekStart", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("Sunday") }] }], + default: "Sunday" + }, + startTime: { + name: "startTime", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + endTime: { + name: "endTime", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(1440) }] }], + default: 1440 + }, + bufferTime: { + name: "bufferTime", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + hideBranding: { + name: "hideBranding", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + theme: { + name: "theme", + type: "String", + optional: true + }, + appTheme: { + name: "appTheme", + type: "String", + optional: true + }, + createdDate: { + name: "createdDate", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("created") }] }], + default: ExpressionUtils.call("now") + }, + trialEndsAt: { + name: "trialEndsAt", + type: "DateTime", + optional: true + }, + lastActiveAt: { + name: "lastActiveAt", + type: "DateTime", + optional: true + }, + eventTypes: { + name: "eventTypes", + type: "EventType", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("user_eventtype") }] }], + relation: { opposite: "users", name: "user_eventtype" } + }, + credentials: { + name: "credentials", + type: "Credential", + array: true, + relation: { opposite: "user" } + }, + teams: { + name: "teams", + type: "Membership", + array: true, + relation: { opposite: "user" } + }, + bookings: { + name: "bookings", + type: "Booking", + array: true, + relation: { opposite: "user" } + }, + schedules: { + name: "schedules", + type: "Schedule", + array: true, + relation: { opposite: "user" } + }, + defaultScheduleId: { + name: "defaultScheduleId", + type: "Int", + optional: true + }, + selectedCalendars: { + name: "selectedCalendars", + type: "SelectedCalendar", + array: true, + relation: { opposite: "user" } + }, + completedOnboarding: { + name: "completedOnboarding", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + locale: { + name: "locale", + type: "String", + optional: true + }, + timeFormat: { + name: "timeFormat", + type: "Int", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(12) }] }], + default: 12 + }, + twoFactorSecret: { + name: "twoFactorSecret", + type: "String", + optional: true + }, + twoFactorEnabled: { + name: "twoFactorEnabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + backupCodes: { + name: "backupCodes", + type: "String", + optional: true + }, + identityProvider: { + name: "identityProvider", + type: "IdentityProvider", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("CAL") }] }], + default: "CAL" + }, + identityProviderId: { + name: "identityProviderId", + type: "String", + optional: true + }, + availability: { + name: "availability", + type: "Availability", + array: true, + relation: { opposite: "user" } + }, + invitedTo: { + name: "invitedTo", + type: "Int", + optional: true + }, + webhooks: { + name: "webhooks", + type: "Webhook", + array: true, + relation: { opposite: "user" } + }, + brandColor: { + name: "brandColor", + type: "String", + optional: true + }, + darkBrandColor: { + name: "darkBrandColor", + type: "String", + optional: true + }, + destinationCalendar: { + name: "destinationCalendar", + type: "DestinationCalendar", + optional: true, + relation: { opposite: "user" } + }, + allowDynamicBooking: { + name: "allowDynamicBooking", + type: "Boolean", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(true) }] }], + default: true + }, + allowSEOIndexing: { + name: "allowSEOIndexing", + type: "Boolean", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(true) }] }], + default: true + }, + receiveMonthlyDigestEmail: { + name: "receiveMonthlyDigestEmail", + type: "Boolean", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(true) }] }], + default: true + }, + metadata: { + name: "metadata", + type: "Json", + optional: true + }, + verified: { + name: "verified", + type: "Boolean", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + role: { + name: "role", + type: "UserPermissionRole", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("USER") }] }], + default: "USER" + }, + disableImpersonation: { + name: "disableImpersonation", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + impersonatedUsers: { + name: "impersonatedUsers", + type: "Impersonations", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("impersonated_user") }] }], + relation: { opposite: "impersonatedUser", name: "impersonated_user" } + }, + impersonatedBy: { + name: "impersonatedBy", + type: "Impersonations", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("impersonated_by_user") }] }], + relation: { opposite: "impersonatedBy", name: "impersonated_by_user" } + }, + apiKeys: { + name: "apiKeys", + type: "ApiKey", + array: true, + relation: { opposite: "user" } + }, + accounts: { + name: "accounts", + type: "Account", + array: true, + relation: { opposite: "user" } + }, + sessions: { + name: "sessions", + type: "Session", + array: true, + relation: { opposite: "user" } + }, + Feedback: { + name: "Feedback", + type: "Feedback", + array: true, + relation: { opposite: "user" } + }, + ownedEventTypes: { + name: "ownedEventTypes", + type: "EventType", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("owner") }] }], + relation: { opposite: "owner", name: "owner" } + }, + workflows: { + name: "workflows", + type: "Workflow", + array: true, + relation: { opposite: "user" } + }, + routingForms: { + name: "routingForms", + type: "App_RoutingForms_Form", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("routing-form") }] }], + relation: { opposite: "user", name: "routing-form" } + }, + updatedRoutingForms: { + name: "updatedRoutingForms", + type: "App_RoutingForms_Form", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("updated-routing-form") }] }], + relation: { opposite: "updatedBy", name: "updated-routing-form" } + }, + verifiedNumbers: { + name: "verifiedNumbers", + type: "VerifiedNumber", + array: true, + relation: { opposite: "user" } + }, + verifiedEmails: { + name: "verifiedEmails", + type: "VerifiedEmail", + array: true, + relation: { opposite: "user" } + }, + hosts: { + name: "hosts", + type: "Host", + array: true, + relation: { opposite: "user" } + }, + organizationId: { + name: "organizationId", + type: "Int", + optional: true, + foreignKeyFor: [ + "organization" + ] + }, + organization: { + name: "organization", + type: "Team", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("scope") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }] }], + relation: { opposite: "orgUsers", name: "scope", fields: ["organizationId"], references: ["id"], onDelete: "SetNull" } + }, + accessCodes: { + name: "accessCodes", + type: "AccessCode", + array: true, + relation: { opposite: "user" } + }, + bookingRedirects: { + name: "bookingRedirects", + type: "OutOfOfficeEntry", + array: true, + relation: { opposite: "user" } + }, + bookingRedirectsTo: { + name: "bookingRedirectsTo", + type: "OutOfOfficeEntry", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("toUser") }] }], + relation: { opposite: "toUser", name: "toUser" } + }, + locked: { + name: "locked", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + platformOAuthClients: { + name: "platformOAuthClients", + type: "PlatformOAuthClient", + array: true, + relation: { opposite: "users" } + }, + AccessToken: { + name: "AccessToken", + type: "AccessToken", + array: true, + relation: { opposite: "owner" } + }, + RefreshToken: { + name: "RefreshToken", + type: "RefreshToken", + array: true, + relation: { opposite: "owner" } + }, + PlatformAuthorizationToken: { + name: "PlatformAuthorizationToken", + type: "PlatformAuthorizationToken", + array: true, + relation: { opposite: "owner" } + }, + profiles: { + name: "profiles", + type: "Profile", + array: true, + relation: { opposite: "user" } + }, + movedToProfileId: { + name: "movedToProfileId", + type: "Int", + optional: true, + foreignKeyFor: [ + "movedToProfile" + ] + }, + movedToProfile: { + name: "movedToProfile", + type: "Profile", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("moved_to_profile") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("movedToProfileId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }] }], + relation: { opposite: "movedFromUser", name: "moved_to_profile", fields: ["movedToProfileId"], references: ["id"], onDelete: "SetNull" } + }, + secondaryEmails: { + name: "secondaryEmails", + type: "SecondaryEmail", + array: true, + relation: { opposite: "user" } + }, + isPlatformManaged: { + name: "isPlatformManaged", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + OutOfOfficeReasons: { + name: "OutOfOfficeReasons", + type: "OutOfOfficeReason", + array: true, + relation: { opposite: "user" } + }, + smsLockState: { + name: "smsLockState", + type: "SMSLockState", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("UNLOCKED") }] }], + default: "UNLOCKED" + }, + smsLockReviewedByAdmin: { + name: "smsLockReviewedByAdmin", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + NotificationsSubscriptions: { + name: "NotificationsSubscriptions", + type: "NotificationsSubscriptions", + array: true, + relation: { opposite: "user" } + }, + referralLinkId: { + name: "referralLinkId", + type: "String", + optional: true + }, + features: { + name: "features", + type: "UserFeatures", + array: true, + relation: { opposite: "user" } + }, + reassignedBookings: { + name: "reassignedBookings", + type: "Booking", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("reassignByUser") }] }], + relation: { opposite: "reassignBy", name: "reassignByUser" } + }, + createdAttributeToUsers: { + name: "createdAttributeToUsers", + type: "AttributeToUser", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("createdBy") }] }], + relation: { opposite: "createdBy", name: "createdBy" } + }, + updatedAttributeToUsers: { + name: "updatedAttributeToUsers", + type: "AttributeToUser", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("updatedBy") }] }], + relation: { opposite: "updatedBy", name: "updatedBy" } + }, + createdTranslations: { + name: "createdTranslations", + type: "EventTypeTranslation", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("CreatedEventTypeTranslations") }] }], + relation: { opposite: "creator", name: "CreatedEventTypeTranslations" } + }, + updatedTranslations: { + name: "updatedTranslations", + type: "EventTypeTranslation", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("UpdatedEventTypeTranslations") }] }], + relation: { opposite: "updater", name: "UpdatedEventTypeTranslations" } + }, + createdWatchlists: { + name: "createdWatchlists", + type: "Watchlist", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("CreatedWatchlists") }] }], + relation: { opposite: "createdBy", name: "CreatedWatchlists" } + }, + updatedWatchlists: { + name: "updatedWatchlists", + type: "Watchlist", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("UpdatedWatchlists") }] }], + relation: { opposite: "updatedBy", name: "UpdatedWatchlists" } + }, + BookingInternalNote: { + name: "BookingInternalNote", + type: "BookingInternalNote", + array: true, + relation: { opposite: "createdBy" } + }, + creationSource: { + name: "creationSource", + type: "CreationSource", + optional: true + }, + createdOrganizationOnboardings: { + name: "createdOrganizationOnboardings", + type: "OrganizationOnboarding", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("CreatedOrganizationOnboardings") }] }], + relation: { opposite: "createdBy", name: "CreatedOrganizationOnboardings" } + }, + filterSegments: { + name: "filterSegments", + type: "FilterSegment", + array: true, + relation: { opposite: "user" } + }, + filterSegmentPreferences: { + name: "filterSegmentPreferences", + type: "UserFilterSegmentPreference", + array: true, + relation: { opposite: "user" } + }, + creditBalance: { + name: "creditBalance", + type: "CreditBalance", + optional: true, + relation: { opposite: "user" } + }, + whitelistWorkflows: { + name: "whitelistWorkflows", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("email")]) }] }, + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("email"), ExpressionUtils.field("username")]) }] }, + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("username"), ExpressionUtils.field("organizationId")]) }] }, + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("movedToProfileId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("username")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("emailVerified")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("identityProvider")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("identityProviderId")]) }] }, + { name: "@@map", args: [{ name: "name", value: ExpressionUtils.literal("users") }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + email: { type: "String" }, + email_username: { email: { type: "String" }, username: { type: "String" } }, + username_organizationId: { username: { type: "String" }, organizationId: { type: "Int" } }, + movedToProfileId: { type: "Int" } + } + }, + NotificationsSubscriptions: { + name: "NotificationsSubscriptions", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + userId: { + name: "userId", + type: "Int", + foreignKeyFor: [ + "user" + ] + }, + user: { + name: "user", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "NotificationsSubscriptions", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + subscription: { + name: "subscription", + type: "String" + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId"), ExpressionUtils.field("subscription")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + } + }, + Profile: { + name: "Profile", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + uid: { + name: "uid", + type: "String" + }, + userId: { + name: "userId", + type: "Int", + foreignKeyFor: [ + "user" + ] + }, + user: { + name: "user", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "profiles", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + organizationId: { + name: "organizationId", + type: "Int", + foreignKeyFor: [ + "organization" + ] + }, + organization: { + name: "organization", + type: "Team", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "orgProfiles", fields: ["organizationId"], references: ["id"], onDelete: "Cascade" } + }, + username: { + name: "username", + type: "String" + }, + eventTypes: { + name: "eventTypes", + type: "EventType", + array: true, + relation: { opposite: "profile" } + }, + movedFromUser: { + name: "movedFromUser", + type: "User", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("moved_to_profile") }] }], + relation: { opposite: "movedToProfile", name: "moved_to_profile" } + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId"), ExpressionUtils.field("organizationId")]) }] }, + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("username"), ExpressionUtils.field("organizationId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("uid")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + userId_organizationId: { userId: { type: "Int" }, organizationId: { type: "Int" } }, + username_organizationId: { username: { type: "String" }, organizationId: { type: "Int" } } + } + }, + Team: { + name: "Team", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + name: { + name: "name", + type: "String" + }, + slug: { + name: "slug", + type: "String", + optional: true + }, + logoUrl: { + name: "logoUrl", + type: "String", + optional: true + }, + calVideoLogo: { + name: "calVideoLogo", + type: "String", + optional: true + }, + appLogo: { + name: "appLogo", + type: "String", + optional: true + }, + appIconLogo: { + name: "appIconLogo", + type: "String", + optional: true + }, + bio: { + name: "bio", + type: "String", + optional: true + }, + hideBranding: { + name: "hideBranding", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + hideTeamProfileLink: { + name: "hideTeamProfileLink", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + isPrivate: { + name: "isPrivate", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + hideBookATeamMember: { + name: "hideBookATeamMember", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + members: { + name: "members", + type: "Membership", + array: true, + relation: { opposite: "team" } + }, + eventTypes: { + name: "eventTypes", + type: "EventType", + array: true, + relation: { opposite: "team" } + }, + workflows: { + name: "workflows", + type: "Workflow", + array: true, + relation: { opposite: "team" } + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + metadata: { + name: "metadata", + type: "Json", + optional: true + }, + theme: { + name: "theme", + type: "String", + optional: true + }, + rrResetInterval: { + name: "rrResetInterval", + type: "RRResetInterval", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("MONTH") }] }], + default: "MONTH" + }, + rrTimestampBasis: { + name: "rrTimestampBasis", + type: "RRTimestampBasis", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("CREATED_AT") }] }], + default: "CREATED_AT" + }, + brandColor: { + name: "brandColor", + type: "String", + optional: true + }, + darkBrandColor: { + name: "darkBrandColor", + type: "String", + optional: true + }, + verifiedNumbers: { + name: "verifiedNumbers", + type: "VerifiedNumber", + array: true, + relation: { opposite: "team" } + }, + verifiedEmails: { + name: "verifiedEmails", + type: "VerifiedEmail", + array: true, + relation: { opposite: "team" } + }, + bannerUrl: { + name: "bannerUrl", + type: "String", + optional: true + }, + parentId: { + name: "parentId", + type: "Int", + optional: true, + foreignKeyFor: [ + "parent" + ] + }, + parent: { + name: "parent", + type: "Team", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("organization") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("parentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "children", name: "organization", fields: ["parentId"], references: ["id"], onDelete: "Cascade" } + }, + children: { + name: "children", + type: "Team", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("organization") }] }], + relation: { opposite: "parent", name: "organization" } + }, + orgUsers: { + name: "orgUsers", + type: "User", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("scope") }] }], + relation: { opposite: "organization", name: "scope" } + }, + inviteTokens: { + name: "inviteTokens", + type: "VerificationToken", + array: true, + relation: { opposite: "team" } + }, + webhooks: { + name: "webhooks", + type: "Webhook", + array: true, + relation: { opposite: "team" } + }, + timeFormat: { + name: "timeFormat", + type: "Int", + optional: true + }, + timeZone: { + name: "timeZone", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("Europe/London") }] }], + default: "Europe/London" + }, + weekStart: { + name: "weekStart", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("Sunday") }] }], + default: "Sunday" + }, + routingForms: { + name: "routingForms", + type: "App_RoutingForms_Form", + array: true, + relation: { opposite: "team" } + }, + apiKeys: { + name: "apiKeys", + type: "ApiKey", + array: true, + relation: { opposite: "team" } + }, + credentials: { + name: "credentials", + type: "Credential", + array: true, + relation: { opposite: "team" } + }, + accessCodes: { + name: "accessCodes", + type: "AccessCode", + array: true, + relation: { opposite: "team" } + }, + isOrganization: { + name: "isOrganization", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + organizationSettings: { + name: "organizationSettings", + type: "OrganizationSettings", + optional: true, + relation: { opposite: "organization" } + }, + instantMeetingTokens: { + name: "instantMeetingTokens", + type: "InstantMeetingToken", + array: true, + relation: { opposite: "team" } + }, + orgProfiles: { + name: "orgProfiles", + type: "Profile", + array: true, + relation: { opposite: "organization" } + }, + pendingPayment: { + name: "pendingPayment", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + dsyncTeamGroupMapping: { + name: "dsyncTeamGroupMapping", + type: "DSyncTeamGroupMapping", + array: true, + relation: { opposite: "team" } + }, + isPlatform: { + name: "isPlatform", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + platformOAuthClient: { + name: "platformOAuthClient", + type: "PlatformOAuthClient", + array: true, + relation: { opposite: "organization" } + }, + createdByOAuthClient: { + name: "createdByOAuthClient", + type: "PlatformOAuthClient", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("CreatedByOAuthClient") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("createdByOAuthClientId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "teams", name: "CreatedByOAuthClient", fields: ["createdByOAuthClientId"], references: ["id"], onDelete: "Cascade" } + }, + createdByOAuthClientId: { + name: "createdByOAuthClientId", + type: "String", + optional: true, + foreignKeyFor: [ + "createdByOAuthClient" + ] + }, + smsLockState: { + name: "smsLockState", + type: "SMSLockState", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("UNLOCKED") }] }], + default: "UNLOCKED" + }, + platformBilling: { + name: "platformBilling", + type: "PlatformBilling", + optional: true, + relation: { opposite: "team" } + }, + activeOrgWorkflows: { + name: "activeOrgWorkflows", + type: "WorkflowsOnTeams", + array: true, + relation: { opposite: "team" } + }, + attributes: { + name: "attributes", + type: "Attribute", + array: true, + relation: { opposite: "team" } + }, + smsLockReviewedByAdmin: { + name: "smsLockReviewedByAdmin", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + delegationCredentials: { + name: "delegationCredentials", + type: "DelegationCredential", + array: true, + relation: { opposite: "organization" } + }, + domainWideDelegations: { + name: "domainWideDelegations", + type: "DomainWideDelegation", + array: true, + relation: { opposite: "organization" } + }, + roles: { + name: "roles", + type: "Role", + array: true, + relation: { opposite: "team" } + }, + features: { + name: "features", + type: "TeamFeatures", + array: true, + relation: { opposite: "team" } + }, + bookingLimits: { + name: "bookingLimits", + type: "Json", + optional: true + }, + includeManagedEventsInLimits: { + name: "includeManagedEventsInLimits", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + internalNotePresets: { + name: "internalNotePresets", + type: "InternalNotePreset", + array: true, + relation: { opposite: "team" } + }, + creditBalance: { + name: "creditBalance", + type: "CreditBalance", + optional: true, + relation: { opposite: "team" } + }, + organizationOnboarding: { + name: "organizationOnboarding", + type: "OrganizationOnboarding", + optional: true, + relation: { opposite: "organization" } + }, + managedOrganization: { + name: "managedOrganization", + type: "ManagedOrganization", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("ManagedOrganization") }] }], + relation: { opposite: "managedOrganization", name: "ManagedOrganization" } + }, + managedOrganizations: { + name: "managedOrganizations", + type: "ManagedOrganization", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("ManagerOrganization") }] }], + relation: { opposite: "managerOrganization", name: "ManagerOrganization" } + }, + filterSegments: { + name: "filterSegments", + type: "FilterSegment", + array: true, + relation: { opposite: "team" } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("slug"), ExpressionUtils.field("parentId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("parentId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + slug_parentId: { slug: { type: "String" }, parentId: { type: "Int" } } + } + }, + CreditBalance: { + name: "CreditBalance", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("uuid") }] }], + default: ExpressionUtils.call("uuid") + }, + team: { + name: "team", + type: "Team", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "creditBalance", fields: ["teamId"], references: ["id"], onDelete: "Cascade" } + }, + teamId: { + name: "teamId", + type: "Int", + unique: true, + optional: true, + attributes: [{ name: "@unique" }], + foreignKeyFor: [ + "team" + ] + }, + user: { + name: "user", + type: "User", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "creditBalance", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + userId: { + name: "userId", + type: "Int", + unique: true, + optional: true, + attributes: [{ name: "@unique" }], + foreignKeyFor: [ + "user" + ] + }, + additionalCredits: { + name: "additionalCredits", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + limitReachedAt: { + name: "limitReachedAt", + type: "DateTime", + optional: true + }, + warningSentAt: { + name: "warningSentAt", + type: "DateTime", + optional: true + }, + expenseLogs: { + name: "expenseLogs", + type: "CreditExpenseLog", + array: true, + relation: { opposite: "creditBalance" } + }, + purchaseLogs: { + name: "purchaseLogs", + type: "CreditPurchaseLog", + array: true, + relation: { opposite: "creditBalance" } + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + teamId: { type: "Int" }, + userId: { type: "Int" } + } + }, + CreditPurchaseLog: { + name: "CreditPurchaseLog", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("uuid") }] }], + default: ExpressionUtils.call("uuid") + }, + creditBalanceId: { + name: "creditBalanceId", + type: "String", + foreignKeyFor: [ + "creditBalance" + ] + }, + creditBalance: { + name: "creditBalance", + type: "CreditBalance", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("creditBalanceId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "purchaseLogs", fields: ["creditBalanceId"], references: ["id"], onDelete: "Cascade" } + }, + credits: { + name: "credits", + type: "Int" + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" } + } + }, + CreditExpenseLog: { + name: "CreditExpenseLog", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("uuid") }] }], + default: ExpressionUtils.call("uuid") + }, + creditBalanceId: { + name: "creditBalanceId", + type: "String", + foreignKeyFor: [ + "creditBalance" + ] + }, + creditBalance: { + name: "creditBalance", + type: "CreditBalance", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("creditBalanceId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "expenseLogs", fields: ["creditBalanceId"], references: ["id"], onDelete: "Cascade" } + }, + bookingUid: { + name: "bookingUid", + type: "String", + optional: true, + foreignKeyFor: [ + "booking" + ] + }, + booking: { + name: "booking", + type: "Booking", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("bookingUid")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("uid")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "expenseLogs", fields: ["bookingUid"], references: ["uid"], onDelete: "Cascade" } + }, + credits: { + name: "credits", + type: "Int", + optional: true + }, + creditType: { + name: "creditType", + type: "CreditType" + }, + date: { + name: "date", + type: "DateTime" + }, + smsSid: { + name: "smsSid", + type: "String", + optional: true + }, + smsSegments: { + name: "smsSegments", + type: "Int", + optional: true + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" } + } + }, + OrganizationSettings: { + name: "OrganizationSettings", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + organization: { + name: "organization", + type: "Team", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "organizationSettings", fields: ["organizationId"], references: ["id"], onDelete: "Cascade" } + }, + organizationId: { + name: "organizationId", + type: "Int", + unique: true, + attributes: [{ name: "@unique" }], + foreignKeyFor: [ + "organization" + ] + }, + isOrganizationConfigured: { + name: "isOrganizationConfigured", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + isOrganizationVerified: { + name: "isOrganizationVerified", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + orgAutoAcceptEmail: { + name: "orgAutoAcceptEmail", + type: "String" + }, + lockEventTypeCreationForUsers: { + name: "lockEventTypeCreationForUsers", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + adminGetsNoSlotsNotification: { + name: "adminGetsNoSlotsNotification", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + isAdminReviewed: { + name: "isAdminReviewed", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + dSyncData: { + name: "dSyncData", + type: "DSyncData", + optional: true, + relation: { opposite: "org" } + }, + isAdminAPIEnabled: { + name: "isAdminAPIEnabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + allowSEOIndexing: { + name: "allowSEOIndexing", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + orgProfileRedirectsToVerifiedDomain: { + name: "orgProfileRedirectsToVerifiedDomain", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + disablePhoneOnlySMSNotifications: { + name: "disablePhoneOnlySMSNotifications", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + organizationId: { type: "Int" } + } + }, + Membership: { + name: "Membership", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + teamId: { + name: "teamId", + type: "Int", + foreignKeyFor: [ + "team" + ] + }, + userId: { + name: "userId", + type: "Int", + foreignKeyFor: [ + "user" + ] + }, + accepted: { + name: "accepted", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + role: { + name: "role", + type: "MembershipRole" + }, + customRoleId: { + name: "customRoleId", + type: "String", + optional: true, + foreignKeyFor: [ + "customRole" + ] + }, + customRole: { + name: "customRole", + type: "Role", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("customRoleId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "memberships", fields: ["customRoleId"], references: ["id"] } + }, + team: { + name: "team", + type: "Team", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "members", fields: ["teamId"], references: ["id"], onDelete: "Cascade" } + }, + user: { + name: "user", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "teams", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + disableImpersonation: { + name: "disableImpersonation", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + AttributeToUser: { + name: "AttributeToUser", + type: "AttributeToUser", + array: true, + relation: { opposite: "member" } + }, + createdAt: { + name: "createdAt", + type: "DateTime", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + optional: true, + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId"), ExpressionUtils.field("teamId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("accepted")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("role")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("customRoleId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + userId_teamId: { userId: { type: "Int" }, teamId: { type: "Int" } } + } + }, + VerificationToken: { + name: "VerificationToken", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + identifier: { + name: "identifier", + type: "String" + }, + token: { + name: "token", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + expires: { + name: "expires", + type: "DateTime" + }, + expiresInDays: { + name: "expiresInDays", + type: "Int", + optional: true + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + teamId: { + name: "teamId", + type: "Int", + optional: true, + foreignKeyFor: [ + "team" + ] + }, + team: { + name: "team", + type: "Team", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "inviteTokens", fields: ["teamId"], references: ["id"] } + }, + secondaryEmailId: { + name: "secondaryEmailId", + type: "Int", + optional: true, + foreignKeyFor: [ + "secondaryEmail" + ] + }, + secondaryEmail: { + name: "secondaryEmail", + type: "SecondaryEmail", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("secondaryEmailId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "verificationTokens", fields: ["secondaryEmailId"], references: ["id"] } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("identifier"), ExpressionUtils.field("token")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("token")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("secondaryEmailId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + token: { type: "String" }, + identifier_token: { identifier: { type: "String" }, token: { type: "String" } } + } + }, + InstantMeetingToken: { + name: "InstantMeetingToken", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + token: { + name: "token", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + expires: { + name: "expires", + type: "DateTime" + }, + teamId: { + name: "teamId", + type: "Int", + foreignKeyFor: [ + "team" + ] + }, + team: { + name: "team", + type: "Team", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "instantMeetingTokens", fields: ["teamId"], references: ["id"] } + }, + bookingId: { + name: "bookingId", + type: "Int", + unique: true, + optional: true, + attributes: [{ name: "@unique" }], + foreignKeyFor: [ + "booking" + ] + }, + booking: { + name: "booking", + type: "Booking", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("bookingId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "instantMeetingToken", fields: ["bookingId"], references: ["id"], onDelete: "Cascade" } + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("token")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + token: { type: "String" }, + bookingId: { type: "Int" } + } + }, + BookingReference: { + name: "BookingReference", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + type: { + name: "type", + type: "String" + }, + uid: { + name: "uid", + type: "String" + }, + meetingId: { + name: "meetingId", + type: "String", + optional: true + }, + thirdPartyRecurringEventId: { + name: "thirdPartyRecurringEventId", + type: "String", + optional: true + }, + meetingPassword: { + name: "meetingPassword", + type: "String", + optional: true + }, + meetingUrl: { + name: "meetingUrl", + type: "String", + optional: true + }, + booking: { + name: "booking", + type: "Booking", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("bookingId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "references", fields: ["bookingId"], references: ["id"], onDelete: "Cascade" } + }, + bookingId: { + name: "bookingId", + type: "Int", + optional: true, + foreignKeyFor: [ + "booking" + ] + }, + externalCalendarId: { + name: "externalCalendarId", + type: "String", + optional: true + }, + deleted: { + name: "deleted", + type: "Boolean", + optional: true + }, + credential: { + name: "credential", + type: "Credential", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("credentialId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }] }], + relation: { opposite: "references", fields: ["credentialId"], references: ["id"], onDelete: "SetNull" } + }, + credentialId: { + name: "credentialId", + type: "Int", + optional: true, + foreignKeyFor: [ + "credential" + ] + }, + delegationCredential: { + name: "delegationCredential", + type: "DelegationCredential", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("delegationCredentialId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }] }], + relation: { opposite: "bookingReferences", fields: ["delegationCredentialId"], references: ["id"], onDelete: "SetNull" } + }, + delegationCredentialId: { + name: "delegationCredentialId", + type: "String", + optional: true, + foreignKeyFor: [ + "delegationCredential" + ] + }, + domainWideDelegation: { + name: "domainWideDelegation", + type: "DomainWideDelegation", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("domainWideDelegationCredentialId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }] }], + relation: { opposite: "bookingReferences", fields: ["domainWideDelegationCredentialId"], references: ["id"], onDelete: "SetNull" } + }, + domainWideDelegationCredentialId: { + name: "domainWideDelegationCredentialId", + type: "String", + optional: true, + foreignKeyFor: [ + "domainWideDelegation" + ] + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("bookingId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("type")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("uid")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + } + }, + Attendee: { + name: "Attendee", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + email: { + name: "email", + type: "String" + }, + name: { + name: "name", + type: "String" + }, + timeZone: { + name: "timeZone", + type: "String" + }, + phoneNumber: { + name: "phoneNumber", + type: "String", + optional: true + }, + locale: { + name: "locale", + type: "String", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("en") }] }], + default: "en" + }, + booking: { + name: "booking", + type: "Booking", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("bookingId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "attendees", fields: ["bookingId"], references: ["id"], onDelete: "Cascade" } + }, + bookingId: { + name: "bookingId", + type: "Int", + optional: true, + foreignKeyFor: [ + "booking" + ] + }, + bookingSeat: { + name: "bookingSeat", + type: "BookingSeat", + optional: true, + relation: { opposite: "attendee" } + }, + noShow: { + name: "noShow", + type: "Boolean", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("email")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("bookingId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + } + }, + Booking: { + name: "Booking", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + uid: { + name: "uid", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + idempotencyKey: { + name: "idempotencyKey", + type: "String", + unique: true, + optional: true, + attributes: [{ name: "@unique" }] + }, + user: { + name: "user", + type: "User", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "bookings", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + userId: { + name: "userId", + type: "Int", + optional: true, + foreignKeyFor: [ + "user" + ] + }, + userPrimaryEmail: { + name: "userPrimaryEmail", + type: "String", + optional: true + }, + references: { + name: "references", + type: "BookingReference", + array: true, + relation: { opposite: "booking" } + }, + eventType: { + name: "eventType", + type: "EventType", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("eventTypeId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "bookings", fields: ["eventTypeId"], references: ["id"] } + }, + eventTypeId: { + name: "eventTypeId", + type: "Int", + optional: true, + foreignKeyFor: [ + "eventType" + ] + }, + title: { + name: "title", + type: "String" + }, + description: { + name: "description", + type: "String", + optional: true + }, + customInputs: { + name: "customInputs", + type: "Json", + optional: true + }, + responses: { + name: "responses", + type: "Json", + optional: true + }, + startTime: { + name: "startTime", + type: "DateTime" + }, + endTime: { + name: "endTime", + type: "DateTime" + }, + attendees: { + name: "attendees", + type: "Attendee", + array: true, + relation: { opposite: "booking" } + }, + location: { + name: "location", + type: "String", + optional: true + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + optional: true, + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + status: { + name: "status", + type: "BookingStatus", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("ACCEPTED") }] }], + default: "ACCEPTED" + }, + paid: { + name: "paid", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + payment: { + name: "payment", + type: "Payment", + array: true, + relation: { opposite: "booking" } + }, + destinationCalendar: { + name: "destinationCalendar", + type: "DestinationCalendar", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("destinationCalendarId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "booking", fields: ["destinationCalendarId"], references: ["id"] } + }, + destinationCalendarId: { + name: "destinationCalendarId", + type: "Int", + optional: true, + foreignKeyFor: [ + "destinationCalendar" + ] + }, + cancellationReason: { + name: "cancellationReason", + type: "String", + optional: true + }, + rejectionReason: { + name: "rejectionReason", + type: "String", + optional: true + }, + reassignReason: { + name: "reassignReason", + type: "String", + optional: true + }, + reassignBy: { + name: "reassignBy", + type: "User", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("reassignByUser") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("reassignById")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "reassignedBookings", name: "reassignByUser", fields: ["reassignById"], references: ["id"] } + }, + reassignById: { + name: "reassignById", + type: "Int", + optional: true, + foreignKeyFor: [ + "reassignBy" + ] + }, + dynamicEventSlugRef: { + name: "dynamicEventSlugRef", + type: "String", + optional: true + }, + dynamicGroupSlugRef: { + name: "dynamicGroupSlugRef", + type: "String", + optional: true + }, + rescheduled: { + name: "rescheduled", + type: "Boolean", + optional: true + }, + fromReschedule: { + name: "fromReschedule", + type: "String", + optional: true + }, + recurringEventId: { + name: "recurringEventId", + type: "String", + optional: true + }, + smsReminderNumber: { + name: "smsReminderNumber", + type: "String", + optional: true + }, + workflowReminders: { + name: "workflowReminders", + type: "WorkflowReminder", + array: true, + relation: { opposite: "booking" } + }, + scheduledJobs: { + name: "scheduledJobs", + type: "String", + array: true + }, + seatsReferences: { + name: "seatsReferences", + type: "BookingSeat", + array: true, + relation: { opposite: "booking" } + }, + metadata: { + name: "metadata", + type: "Json", + optional: true + }, + isRecorded: { + name: "isRecorded", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + iCalUID: { + name: "iCalUID", + type: "String", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("") }] }], + default: "" + }, + iCalSequence: { + name: "iCalSequence", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + instantMeetingToken: { + name: "instantMeetingToken", + type: "InstantMeetingToken", + optional: true, + relation: { opposite: "booking" } + }, + rating: { + name: "rating", + type: "Int", + optional: true + }, + ratingFeedback: { + name: "ratingFeedback", + type: "String", + optional: true + }, + noShowHost: { + name: "noShowHost", + type: "Boolean", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + scheduledTriggers: { + name: "scheduledTriggers", + type: "WebhookScheduledTriggers", + array: true, + relation: { opposite: "booking" } + }, + oneTimePassword: { + name: "oneTimePassword", + type: "String", + unique: true, + optional: true, + attributes: [{ name: "@unique" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("uuid") }] }], + default: ExpressionUtils.call("uuid") + }, + cancelledBy: { + name: "cancelledBy", + type: "String", + optional: true + }, + rescheduledBy: { + name: "rescheduledBy", + type: "String", + optional: true + }, + routedFromRoutingFormReponse: { + name: "routedFromRoutingFormReponse", + type: "App_RoutingForms_FormResponse", + optional: true, + relation: { opposite: "routedToBooking" } + }, + assignmentReason: { + name: "assignmentReason", + type: "AssignmentReason", + array: true, + relation: { opposite: "booking" } + }, + internalNote: { + name: "internalNote", + type: "BookingInternalNote", + array: true, + relation: { opposite: "booking" } + }, + creationSource: { + name: "creationSource", + type: "CreationSource", + optional: true + }, + tracking: { + name: "tracking", + type: "Tracking", + optional: true, + relation: { opposite: "booking" } + }, + routingFormResponses: { + name: "routingFormResponses", + type: "RoutingFormResponseDenormalized", + array: true, + relation: { opposite: "booking" } + }, + expenseLogs: { + name: "expenseLogs", + type: "CreditExpenseLog", + array: true, + relation: { opposite: "booking" } + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("eventTypeId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("destinationCalendarId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("recurringEventId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("uid")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("status")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("startTime"), ExpressionUtils.field("endTime"), ExpressionUtils.field("status")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + uid: { type: "String" }, + idempotencyKey: { type: "String" }, + oneTimePassword: { type: "String" } + } + }, + Tracking: { + name: "Tracking", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + bookingId: { + name: "bookingId", + type: "Int", + foreignKeyFor: [ + "booking" + ] + }, + booking: { + name: "booking", + type: "Booking", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("bookingId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "tracking", fields: ["bookingId"], references: ["id"], onDelete: "Cascade" } + }, + utm_source: { + name: "utm_source", + type: "String", + optional: true + }, + utm_medium: { + name: "utm_medium", + type: "String", + optional: true + }, + utm_campaign: { + name: "utm_campaign", + type: "String", + optional: true + }, + utm_term: { + name: "utm_term", + type: "String", + optional: true + }, + utm_content: { + name: "utm_content", + type: "String", + optional: true + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("bookingId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + bookingId: { type: "Int" } + } + }, + Schedule: { + name: "Schedule", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + user: { + name: "user", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "schedules", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + userId: { + name: "userId", + type: "Int", + foreignKeyFor: [ + "user" + ] + }, + eventType: { + name: "eventType", + type: "EventType", + array: true, + relation: { opposite: "schedule" } + }, + instantMeetingEvents: { + name: "instantMeetingEvents", + type: "EventType", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("InstantMeetingSchedule") }] }], + relation: { opposite: "instantMeetingSchedule", name: "InstantMeetingSchedule" } + }, + restrictionSchedule: { + name: "restrictionSchedule", + type: "EventType", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("restrictionSchedule") }] }], + relation: { opposite: "restrictionSchedule", name: "restrictionSchedule" } + }, + name: { + name: "name", + type: "String" + }, + timeZone: { + name: "timeZone", + type: "String", + optional: true + }, + availability: { + name: "availability", + type: "Availability", + array: true, + relation: { opposite: "Schedule" } + }, + Host: { + name: "Host", + type: "Host", + array: true, + relation: { opposite: "schedule" } + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + } + }, + Availability: { + name: "Availability", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + user: { + name: "user", + type: "User", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "availability", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + userId: { + name: "userId", + type: "Int", + optional: true, + foreignKeyFor: [ + "user" + ] + }, + eventType: { + name: "eventType", + type: "EventType", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("eventTypeId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "availability", fields: ["eventTypeId"], references: ["id"] } + }, + eventTypeId: { + name: "eventTypeId", + type: "Int", + optional: true, + foreignKeyFor: [ + "eventType" + ] + }, + days: { + name: "days", + type: "Int", + array: true + }, + startTime: { + name: "startTime", + type: "DateTime", + attributes: [{ name: "@db.Time" }] + }, + endTime: { + name: "endTime", + type: "DateTime", + attributes: [{ name: "@db.Time" }] + }, + date: { + name: "date", + type: "DateTime", + optional: true, + attributes: [{ name: "@db.Date" }] + }, + Schedule: { + name: "Schedule", + type: "Schedule", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("scheduleId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "availability", fields: ["scheduleId"], references: ["id"] } + }, + scheduleId: { + name: "scheduleId", + type: "Int", + optional: true, + foreignKeyFor: [ + "Schedule" + ] + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("eventTypeId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("scheduleId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + } + }, + SelectedCalendar: { + name: "SelectedCalendar", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("uuid") }] }], + default: ExpressionUtils.call("uuid") + }, + user: { + name: "user", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "selectedCalendars", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + userId: { + name: "userId", + type: "Int", + foreignKeyFor: [ + "user" + ] + }, + integration: { + name: "integration", + type: "String" + }, + externalId: { + name: "externalId", + type: "String" + }, + credential: { + name: "credential", + type: "Credential", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("credentialId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "selectedCalendars", fields: ["credentialId"], references: ["id"], onDelete: "Cascade" } + }, + credentialId: { + name: "credentialId", + type: "Int", + optional: true, + foreignKeyFor: [ + "credential" + ] + }, + googleChannelId: { + name: "googleChannelId", + type: "String", + optional: true + }, + googleChannelKind: { + name: "googleChannelKind", + type: "String", + optional: true + }, + googleChannelResourceId: { + name: "googleChannelResourceId", + type: "String", + optional: true + }, + googleChannelResourceUri: { + name: "googleChannelResourceUri", + type: "String", + optional: true + }, + googleChannelExpiration: { + name: "googleChannelExpiration", + type: "String", + optional: true + }, + delegationCredential: { + name: "delegationCredential", + type: "DelegationCredential", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("delegationCredentialId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "selectedCalendars", fields: ["delegationCredentialId"], references: ["id"], onDelete: "Cascade" } + }, + delegationCredentialId: { + name: "delegationCredentialId", + type: "String", + optional: true, + foreignKeyFor: [ + "delegationCredential" + ] + }, + domainWideDelegationCredential: { + name: "domainWideDelegationCredential", + type: "DomainWideDelegation", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("domainWideDelegationCredentialId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "selectedCalendars", fields: ["domainWideDelegationCredentialId"], references: ["id"], onDelete: "Cascade" } + }, + domainWideDelegationCredentialId: { + name: "domainWideDelegationCredentialId", + type: "String", + optional: true, + foreignKeyFor: [ + "domainWideDelegationCredential" + ] + }, + error: { + name: "error", + type: "String", + optional: true + }, + lastErrorAt: { + name: "lastErrorAt", + type: "DateTime", + optional: true + }, + watchAttempts: { + name: "watchAttempts", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + unwatchAttempts: { + name: "unwatchAttempts", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + maxAttempts: { + name: "maxAttempts", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(3) }] }], + default: 3 + }, + eventTypeId: { + name: "eventTypeId", + type: "Int", + optional: true, + foreignKeyFor: [ + "eventType" + ] + }, + eventType: { + name: "eventType", + type: "EventType", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("eventTypeId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "selectedCalendars", fields: ["eventTypeId"], references: ["id"] } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId"), ExpressionUtils.field("integration"), ExpressionUtils.field("externalId"), ExpressionUtils.field("eventTypeId")]) }] }, + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("googleChannelId"), ExpressionUtils.field("eventTypeId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("externalId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("eventTypeId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("credentialId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("integration"), ExpressionUtils.field("googleChannelExpiration"), ExpressionUtils.field("error"), ExpressionUtils.field("watchAttempts"), ExpressionUtils.field("maxAttempts")]) }, { name: "name", value: ExpressionUtils.literal("SelectedCalendar_watch_idx") }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("integration"), ExpressionUtils.field("googleChannelExpiration"), ExpressionUtils.field("error"), ExpressionUtils.field("unwatchAttempts"), ExpressionUtils.field("maxAttempts")]) }, { name: "name", value: ExpressionUtils.literal("SelectedCalendar_unwatch_idx") }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + userId_integration_externalId_eventTypeId: { userId: { type: "Int" }, integration: { type: "String" }, externalId: { type: "String" }, eventTypeId: { type: "Int" } }, + googleChannelId_eventTypeId: { googleChannelId: { type: "String" }, eventTypeId: { type: "Int" } } + } + }, + EventTypeCustomInput: { + name: "EventTypeCustomInput", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + eventTypeId: { + name: "eventTypeId", + type: "Int", + foreignKeyFor: [ + "eventType" + ] + }, + eventType: { + name: "eventType", + type: "EventType", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("eventTypeId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "customInputs", fields: ["eventTypeId"], references: ["id"], onDelete: "Cascade" } + }, + label: { + name: "label", + type: "String" + }, + type: { + name: "type", + type: "EventTypeCustomInputType" + }, + options: { + name: "options", + type: "Json", + optional: true + }, + required: { + name: "required", + type: "Boolean" + }, + placeholder: { + name: "placeholder", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("") }] }], + default: "" + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("eventTypeId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + } + }, + ResetPasswordRequest: { + name: "ResetPasswordRequest", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + email: { + name: "email", + type: "String" + }, + expires: { + name: "expires", + type: "DateTime" + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" } + } + }, + ReminderMail: { + name: "ReminderMail", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + referenceId: { + name: "referenceId", + type: "Int" + }, + reminderType: { + name: "reminderType", + type: "ReminderType" + }, + elapsedMinutes: { + name: "elapsedMinutes", + type: "Int" + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("referenceId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("reminderType")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + } + }, + Payment: { + name: "Payment", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + uid: { + name: "uid", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + app: { + name: "app", + type: "App", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("appId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("slug")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "payments", fields: ["appId"], references: ["slug"], onDelete: "Cascade" } + }, + appId: { + name: "appId", + type: "String", + optional: true, + foreignKeyFor: [ + "app" + ] + }, + bookingId: { + name: "bookingId", + type: "Int", + foreignKeyFor: [ + "booking" + ] + }, + booking: { + name: "booking", + type: "Booking", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("bookingId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "payment", fields: ["bookingId"], references: ["id"], onDelete: "Cascade" } + }, + amount: { + name: "amount", + type: "Int" + }, + fee: { + name: "fee", + type: "Int" + }, + currency: { + name: "currency", + type: "String" + }, + success: { + name: "success", + type: "Boolean" + }, + refunded: { + name: "refunded", + type: "Boolean" + }, + data: { + name: "data", + type: "Json" + }, + externalId: { + name: "externalId", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + paymentOption: { + name: "paymentOption", + type: "PaymentOption", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("ON_BOOKING") }] }], + default: "ON_BOOKING" + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("bookingId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("externalId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + uid: { type: "String" }, + externalId: { type: "String" } + } + }, + Webhook: { + name: "Webhook", + fields: { + id: { + name: "id", + type: "String", + id: true, + unique: true, + attributes: [{ name: "@id" }, { name: "@unique" }] + }, + userId: { + name: "userId", + type: "Int", + optional: true, + foreignKeyFor: [ + "user" + ] + }, + teamId: { + name: "teamId", + type: "Int", + optional: true, + foreignKeyFor: [ + "team" + ] + }, + eventTypeId: { + name: "eventTypeId", + type: "Int", + optional: true, + foreignKeyFor: [ + "eventType" + ] + }, + platformOAuthClientId: { + name: "platformOAuthClientId", + type: "String", + optional: true, + foreignKeyFor: [ + "platformOAuthClient" + ] + }, + subscriberUrl: { + name: "subscriberUrl", + type: "String" + }, + payloadTemplate: { + name: "payloadTemplate", + type: "String", + optional: true + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + active: { + name: "active", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(true) }] }], + default: true + }, + eventTriggers: { + name: "eventTriggers", + type: "WebhookTriggerEvents", + array: true + }, + user: { + name: "user", + type: "User", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "webhooks", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + team: { + name: "team", + type: "Team", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "webhooks", fields: ["teamId"], references: ["id"], onDelete: "Cascade" } + }, + eventType: { + name: "eventType", + type: "EventType", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("eventTypeId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "webhooks", fields: ["eventTypeId"], references: ["id"], onDelete: "Cascade" } + }, + platformOAuthClient: { + name: "platformOAuthClient", + type: "PlatformOAuthClient", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("platformOAuthClientId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "webhook", fields: ["platformOAuthClientId"], references: ["id"], onDelete: "Cascade" } + }, + app: { + name: "app", + type: "App", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("appId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("slug")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "Webhook", fields: ["appId"], references: ["slug"], onDelete: "Cascade" } + }, + appId: { + name: "appId", + type: "String", + optional: true, + foreignKeyFor: [ + "app" + ] + }, + secret: { + name: "secret", + type: "String", + optional: true + }, + platform: { + name: "platform", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + scheduledTriggers: { + name: "scheduledTriggers", + type: "WebhookScheduledTriggers", + array: true, + relation: { opposite: "webhook" } + }, + time: { + name: "time", + type: "Int", + optional: true + }, + timeUnit: { + name: "timeUnit", + type: "TimeUnit", + optional: true + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId"), ExpressionUtils.field("subscriberUrl")]) }, { name: "name", value: ExpressionUtils.literal("courseIdentifier") }] }, + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("platformOAuthClientId"), ExpressionUtils.field("subscriberUrl")]) }, { name: "name", value: ExpressionUtils.literal("oauthclientwebhook") }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("active")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + courseIdentifier: { userId: { type: "Int" }, subscriberUrl: { type: "String" } }, + oauthclientwebhook: { platformOAuthClientId: { type: "String" }, subscriberUrl: { type: "String" } } + } + }, + Impersonations: { + name: "Impersonations", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + impersonatedUser: { + name: "impersonatedUser", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("impersonated_user") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("impersonatedUserId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "impersonatedUsers", name: "impersonated_user", fields: ["impersonatedUserId"], references: ["id"], onDelete: "Cascade" } + }, + impersonatedBy: { + name: "impersonatedBy", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("impersonated_by_user") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("impersonatedById")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "impersonatedBy", name: "impersonated_by_user", fields: ["impersonatedById"], references: ["id"], onDelete: "Cascade" } + }, + impersonatedUserId: { + name: "impersonatedUserId", + type: "Int", + foreignKeyFor: [ + "impersonatedUser" + ] + }, + impersonatedById: { + name: "impersonatedById", + type: "Int", + foreignKeyFor: [ + "impersonatedBy" + ] + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("impersonatedUserId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("impersonatedById")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + } + }, + ApiKey: { + name: "ApiKey", + fields: { + id: { + name: "id", + type: "String", + id: true, + unique: true, + attributes: [{ name: "@id" }, { name: "@unique" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + userId: { + name: "userId", + type: "Int", + foreignKeyFor: [ + "user" + ] + }, + teamId: { + name: "teamId", + type: "Int", + optional: true, + foreignKeyFor: [ + "team" + ] + }, + note: { + name: "note", + type: "String", + optional: true + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + expiresAt: { + name: "expiresAt", + type: "DateTime", + optional: true + }, + lastUsedAt: { + name: "lastUsedAt", + type: "DateTime", + optional: true + }, + hashedKey: { + name: "hashedKey", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + user: { + name: "user", + type: "User", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "apiKeys", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + team: { + name: "team", + type: "Team", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "apiKeys", fields: ["teamId"], references: ["id"], onDelete: "Cascade" } + }, + app: { + name: "app", + type: "App", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("appId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("slug")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "ApiKey", fields: ["appId"], references: ["slug"], onDelete: "Cascade" } + }, + appId: { + name: "appId", + type: "String", + optional: true, + foreignKeyFor: [ + "app" + ] + }, + rateLimits: { + name: "rateLimits", + type: "RateLimit", + array: true, + relation: { opposite: "apiKey" } + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + hashedKey: { type: "String" } + } + }, + RateLimit: { + name: "RateLimit", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("uuid") }] }], + default: ExpressionUtils.call("uuid") + }, + name: { + name: "name", + type: "String" + }, + apiKeyId: { + name: "apiKeyId", + type: "String", + foreignKeyFor: [ + "apiKey" + ] + }, + ttl: { + name: "ttl", + type: "Int" + }, + limit: { + name: "limit", + type: "Int" + }, + blockDuration: { + name: "blockDuration", + type: "Int" + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + apiKey: { + name: "apiKey", + type: "ApiKey", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("apiKeyId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "rateLimits", fields: ["apiKeyId"], references: ["id"], onDelete: "Cascade" } + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("apiKeyId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" } + } + }, + HashedLink: { + name: "HashedLink", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + link: { + name: "link", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + eventType: { + name: "eventType", + type: "EventType", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("eventTypeId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "hashedLink", fields: ["eventTypeId"], references: ["id"], onDelete: "Cascade" } + }, + eventTypeId: { + name: "eventTypeId", + type: "Int", + foreignKeyFor: [ + "eventType" + ] + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + link: { type: "String" } + } + }, + Account: { + name: "Account", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + userId: { + name: "userId", + type: "Int", + foreignKeyFor: [ + "user" + ] + }, + type: { + name: "type", + type: "String" + }, + provider: { + name: "provider", + type: "String" + }, + providerAccountId: { + name: "providerAccountId", + type: "String" + }, + providerEmail: { + name: "providerEmail", + type: "String", + optional: true + }, + refresh_token: { + name: "refresh_token", + type: "String", + optional: true, + attributes: [{ name: "@db.Text" }] + }, + access_token: { + name: "access_token", + type: "String", + optional: true, + attributes: [{ name: "@db.Text" }] + }, + expires_at: { + name: "expires_at", + type: "Int", + optional: true + }, + token_type: { + name: "token_type", + type: "String", + optional: true + }, + scope: { + name: "scope", + type: "String", + optional: true + }, + id_token: { + name: "id_token", + type: "String", + optional: true, + attributes: [{ name: "@db.Text" }] + }, + session_state: { + name: "session_state", + type: "String", + optional: true + }, + user: { + name: "user", + type: "User", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "accounts", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("provider"), ExpressionUtils.field("providerAccountId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("type")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + provider_providerAccountId: { provider: { type: "String" }, providerAccountId: { type: "String" } } + } + }, + Session: { + name: "Session", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + sessionToken: { + name: "sessionToken", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + userId: { + name: "userId", + type: "Int", + foreignKeyFor: [ + "user" + ] + }, + expires: { + name: "expires", + type: "DateTime" + }, + user: { + name: "user", + type: "User", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "sessions", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + sessionToken: { type: "String" } + } + }, + App: { + name: "App", + fields: { + slug: { + name: "slug", + type: "String", + id: true, + unique: true, + attributes: [{ name: "@id" }, { name: "@unique" }] + }, + dirName: { + name: "dirName", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + keys: { + name: "keys", + type: "Json", + optional: true + }, + categories: { + name: "categories", + type: "AppCategories", + array: true + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + credentials: { + name: "credentials", + type: "Credential", + array: true, + relation: { opposite: "app" } + }, + payments: { + name: "payments", + type: "Payment", + array: true, + relation: { opposite: "app" } + }, + Webhook: { + name: "Webhook", + type: "Webhook", + array: true, + relation: { opposite: "app" } + }, + ApiKey: { + name: "ApiKey", + type: "ApiKey", + array: true, + relation: { opposite: "app" } + }, + enabled: { + name: "enabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("enabled")]) }] } + ], + idFields: ["slug"], + uniqueFields: { + slug: { type: "String" }, + dirName: { type: "String" } + } + }, + App_RoutingForms_Form: { + name: "App_RoutingForms_Form", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + description: { + name: "description", + type: "String", + optional: true + }, + position: { + name: "position", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + routes: { + name: "routes", + type: "Json", + optional: true + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + name: { + name: "name", + type: "String" + }, + fields: { + name: "fields", + type: "Json", + optional: true + }, + user: { + name: "user", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("routing-form") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "routingForms", name: "routing-form", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + updatedBy: { + name: "updatedBy", + type: "User", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("updated-routing-form") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("updatedById")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }] }], + relation: { opposite: "updatedRoutingForms", name: "updated-routing-form", fields: ["updatedById"], references: ["id"], onDelete: "SetNull" } + }, + updatedById: { + name: "updatedById", + type: "Int", + optional: true, + foreignKeyFor: [ + "updatedBy" + ] + }, + userId: { + name: "userId", + type: "Int", + foreignKeyFor: [ + "user" + ] + }, + team: { + name: "team", + type: "Team", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "routingForms", fields: ["teamId"], references: ["id"], onDelete: "Cascade" } + }, + teamId: { + name: "teamId", + type: "Int", + optional: true, + foreignKeyFor: [ + "team" + ] + }, + responses: { + name: "responses", + type: "App_RoutingForms_FormResponse", + array: true, + relation: { opposite: "form" } + }, + queuedResponses: { + name: "queuedResponses", + type: "App_RoutingForms_QueuedFormResponse", + array: true, + relation: { opposite: "form" } + }, + disabled: { + name: "disabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + settings: { + name: "settings", + type: "Json", + optional: true + }, + incompleteBookingActions: { + name: "incompleteBookingActions", + type: "App_RoutingForms_IncompleteBookingActions", + array: true, + relation: { opposite: "form" } + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("disabled")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" } + } + }, + App_RoutingForms_FormResponse: { + name: "App_RoutingForms_FormResponse", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + formFillerId: { + name: "formFillerId", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + form: { + name: "form", + type: "App_RoutingForms_Form", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("formId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "responses", fields: ["formId"], references: ["id"], onDelete: "Cascade" } + }, + formId: { + name: "formId", + type: "String", + foreignKeyFor: [ + "form" + ] + }, + response: { + name: "response", + type: "Json" + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + optional: true, + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + routedToBookingUid: { + name: "routedToBookingUid", + type: "String", + unique: true, + optional: true, + attributes: [{ name: "@unique" }], + foreignKeyFor: [ + "routedToBooking" + ] + }, + routedToBooking: { + name: "routedToBooking", + type: "Booking", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("routedToBookingUid")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("uid")]) }] }], + relation: { opposite: "routedFromRoutingFormReponse", fields: ["routedToBookingUid"], references: ["uid"] } + }, + chosenRouteId: { + name: "chosenRouteId", + type: "String", + optional: true + }, + routingFormResponseFields: { + name: "routingFormResponseFields", + type: "RoutingFormResponseField", + array: true, + relation: { opposite: "response" } + }, + routingFormResponses: { + name: "routingFormResponses", + type: "RoutingFormResponseDenormalized", + array: true, + relation: { opposite: "response" } + }, + queuedFormResponse: { + name: "queuedFormResponse", + type: "App_RoutingForms_QueuedFormResponse", + optional: true, + relation: { opposite: "actualResponse" } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("formFillerId"), ExpressionUtils.field("formId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("formFillerId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("formId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("routedToBookingUid")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + routedToBookingUid: { type: "String" }, + formFillerId_formId: { formFillerId: { type: "String" }, formId: { type: "String" } } + } + }, + App_RoutingForms_QueuedFormResponse: { + name: "App_RoutingForms_QueuedFormResponse", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + form: { + name: "form", + type: "App_RoutingForms_Form", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("formId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "queuedResponses", fields: ["formId"], references: ["id"], onDelete: "Cascade" } + }, + formId: { + name: "formId", + type: "String", + foreignKeyFor: [ + "form" + ] + }, + response: { + name: "response", + type: "Json" + }, + chosenRouteId: { + name: "chosenRouteId", + type: "String", + optional: true + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + optional: true, + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + actualResponseId: { + name: "actualResponseId", + type: "Int", + unique: true, + optional: true, + attributes: [{ name: "@unique" }], + foreignKeyFor: [ + "actualResponse" + ] + }, + actualResponse: { + name: "actualResponse", + type: "App_RoutingForms_FormResponse", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("actualResponseId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "queuedFormResponse", fields: ["actualResponseId"], references: ["id"], onDelete: "Cascade" } + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + actualResponseId: { type: "Int" } + } + }, + RoutingFormResponseField: { + name: "RoutingFormResponseField", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + responseId: { + name: "responseId", + type: "Int", + foreignKeyFor: [ + "response", + "denormalized" + ] + }, + fieldId: { + name: "fieldId", + type: "String" + }, + valueString: { + name: "valueString", + type: "String", + optional: true + }, + valueNumber: { + name: "valueNumber", + type: "Decimal", + optional: true + }, + valueStringArray: { + name: "valueStringArray", + type: "String", + array: true + }, + response: { + name: "response", + type: "App_RoutingForms_FormResponse", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("responseId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "map", value: ExpressionUtils.literal("RoutingFormResponseField_response_fkey") }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "routingFormResponseFields", fields: ["responseId"], references: ["id"], onDelete: "Cascade" } + }, + denormalized: { + name: "denormalized", + type: "RoutingFormResponseDenormalized", + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("DenormalizedResponseToFields") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("responseId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "fields", name: "DenormalizedResponseToFields", fields: ["responseId"], references: ["id"], onDelete: "Cascade" } + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("responseId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("fieldId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("valueNumber")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("valueStringArray")]) }, { name: "type", value: ExpressionUtils.literal("Gin") }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + } + }, + RoutingFormResponse: { + name: "RoutingFormResponse", + fields: { + id: { + name: "id", + type: "Int", + id: true, + unique: true, + attributes: [{ name: "@unique" }] + }, + response: { + name: "response", + type: "Json" + }, + responseLowercase: { + name: "responseLowercase", + type: "Json" + }, + formId: { + name: "formId", + type: "String" + }, + formName: { + name: "formName", + type: "String" + }, + formTeamId: { + name: "formTeamId", + type: "Int", + optional: true + }, + formUserId: { + name: "formUserId", + type: "Int", + optional: true + }, + bookingUid: { + name: "bookingUid", + type: "String", + optional: true + }, + bookingStatus: { + name: "bookingStatus", + type: "BookingStatus", + optional: true + }, + bookingStatusOrder: { + name: "bookingStatusOrder", + type: "Int", + optional: true + }, + bookingCreatedAt: { + name: "bookingCreatedAt", + type: "DateTime", + optional: true + }, + bookingAttendees: { + name: "bookingAttendees", + type: "Json", + optional: true + }, + bookingUserId: { + name: "bookingUserId", + type: "Int", + optional: true + }, + bookingUserName: { + name: "bookingUserName", + type: "String", + optional: true + }, + bookingUserEmail: { + name: "bookingUserEmail", + type: "String", + optional: true + }, + bookingUserAvatarUrl: { + name: "bookingUserAvatarUrl", + type: "String", + optional: true + }, + bookingAssignmentReason: { + name: "bookingAssignmentReason", + type: "String", + optional: true + }, + bookingAssignmentReasonLowercase: { + name: "bookingAssignmentReasonLowercase", + type: "String", + optional: true + }, + bookingStartTime: { + name: "bookingStartTime", + type: "DateTime", + optional: true + }, + bookingEndTime: { + name: "bookingEndTime", + type: "DateTime", + optional: true + }, + createdAt: { + name: "createdAt", + type: "DateTime" + }, + utm_source: { + name: "utm_source", + type: "String", + optional: true + }, + utm_medium: { + name: "utm_medium", + type: "String", + optional: true + }, + utm_campaign: { + name: "utm_campaign", + type: "String", + optional: true + }, + utm_term: { + name: "utm_term", + type: "String", + optional: true + }, + utm_content: { + name: "utm_content", + type: "String", + optional: true + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + }, + isView: true + }, + RoutingFormResponseDenormalized: { + name: "RoutingFormResponseDenormalized", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }], + foreignKeyFor: [ + "response" + ] + }, + formId: { + name: "formId", + type: "String" + }, + formName: { + name: "formName", + type: "String" + }, + formTeamId: { + name: "formTeamId", + type: "Int", + optional: true + }, + formUserId: { + name: "formUserId", + type: "Int" + }, + booking: { + name: "booking", + type: "Booking", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("bookingId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }] }], + relation: { opposite: "routingFormResponses", fields: ["bookingId"], references: ["id"], onDelete: "SetNull" } + }, + bookingUid: { + name: "bookingUid", + type: "String", + optional: true + }, + bookingId: { + name: "bookingId", + type: "Int", + optional: true, + foreignKeyFor: [ + "booking" + ] + }, + bookingStatus: { + name: "bookingStatus", + type: "BookingStatus", + optional: true + }, + bookingStatusOrder: { + name: "bookingStatusOrder", + type: "Int", + optional: true + }, + bookingCreatedAt: { + name: "bookingCreatedAt", + type: "DateTime", + optional: true, + attributes: [{ name: "@db.Timestamp", args: [{ name: "x", value: ExpressionUtils.literal(3) }] }] + }, + bookingStartTime: { + name: "bookingStartTime", + type: "DateTime", + optional: true, + attributes: [{ name: "@db.Timestamp", args: [{ name: "x", value: ExpressionUtils.literal(3) }] }] + }, + bookingEndTime: { + name: "bookingEndTime", + type: "DateTime", + optional: true, + attributes: [{ name: "@db.Timestamp", args: [{ name: "x", value: ExpressionUtils.literal(3) }] }] + }, + bookingUserId: { + name: "bookingUserId", + type: "Int", + optional: true + }, + bookingUserName: { + name: "bookingUserName", + type: "String", + optional: true + }, + bookingUserEmail: { + name: "bookingUserEmail", + type: "String", + optional: true + }, + bookingUserAvatarUrl: { + name: "bookingUserAvatarUrl", + type: "String", + optional: true + }, + bookingAssignmentReason: { + name: "bookingAssignmentReason", + type: "String", + optional: true + }, + eventTypeId: { + name: "eventTypeId", + type: "Int", + optional: true + }, + eventTypeParentId: { + name: "eventTypeParentId", + type: "Int", + optional: true + }, + eventTypeSchedulingType: { + name: "eventTypeSchedulingType", + type: "String", + optional: true + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@db.Timestamp", args: [{ name: "x", value: ExpressionUtils.literal(3) }] }] + }, + utm_source: { + name: "utm_source", + type: "String", + optional: true + }, + utm_medium: { + name: "utm_medium", + type: "String", + optional: true + }, + utm_campaign: { + name: "utm_campaign", + type: "String", + optional: true + }, + utm_term: { + name: "utm_term", + type: "String", + optional: true + }, + utm_content: { + name: "utm_content", + type: "String", + optional: true + }, + response: { + name: "response", + type: "App_RoutingForms_FormResponse", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "routingFormResponses", fields: ["id"], references: ["id"], onDelete: "Cascade" } + }, + fields: { + name: "fields", + type: "RoutingFormResponseField", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("DenormalizedResponseToFields") }] }], + relation: { opposite: "denormalized", name: "DenormalizedResponseToFields" } + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("formId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("formTeamId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("formUserId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("formId"), ExpressionUtils.field("createdAt")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("bookingId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("bookingUserId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("eventTypeId"), ExpressionUtils.field("eventTypeParentId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + } + }, + Feedback: { + name: "Feedback", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + date: { + name: "date", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + userId: { + name: "userId", + type: "Int", + foreignKeyFor: [ + "user" + ] + }, + user: { + name: "user", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "Feedback", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + rating: { + name: "rating", + type: "String" + }, + comment: { + name: "comment", + type: "String", + optional: true + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("rating")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + } + }, + WorkflowStep: { + name: "WorkflowStep", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + stepNumber: { + name: "stepNumber", + type: "Int" + }, + action: { + name: "action", + type: "WorkflowActions" + }, + workflowId: { + name: "workflowId", + type: "Int", + foreignKeyFor: [ + "workflow" + ] + }, + workflow: { + name: "workflow", + type: "Workflow", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("workflowId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "steps", fields: ["workflowId"], references: ["id"], onDelete: "Cascade" } + }, + sendTo: { + name: "sendTo", + type: "String", + optional: true + }, + reminderBody: { + name: "reminderBody", + type: "String", + optional: true + }, + emailSubject: { + name: "emailSubject", + type: "String", + optional: true + }, + template: { + name: "template", + type: "WorkflowTemplates", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("REMINDER") }] }], + default: "REMINDER" + }, + workflowReminders: { + name: "workflowReminders", + type: "WorkflowReminder", + array: true, + relation: { opposite: "workflowStep" } + }, + numberRequired: { + name: "numberRequired", + type: "Boolean", + optional: true + }, + sender: { + name: "sender", + type: "String", + optional: true + }, + numberVerificationPending: { + name: "numberVerificationPending", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(true) }] }], + default: true + }, + includeCalendarEvent: { + name: "includeCalendarEvent", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + verifiedAt: { + name: "verifiedAt", + type: "DateTime", + optional: true + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("workflowId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + } + }, + Workflow: { + name: "Workflow", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + position: { + name: "position", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + name: { + name: "name", + type: "String" + }, + userId: { + name: "userId", + type: "Int", + optional: true, + foreignKeyFor: [ + "user" + ] + }, + user: { + name: "user", + type: "User", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "workflows", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + team: { + name: "team", + type: "Team", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "workflows", fields: ["teamId"], references: ["id"], onDelete: "Cascade" } + }, + teamId: { + name: "teamId", + type: "Int", + optional: true, + foreignKeyFor: [ + "team" + ] + }, + activeOn: { + name: "activeOn", + type: "WorkflowsOnEventTypes", + array: true, + relation: { opposite: "workflow" } + }, + activeOnTeams: { + name: "activeOnTeams", + type: "WorkflowsOnTeams", + array: true, + relation: { opposite: "workflow" } + }, + isActiveOnAll: { + name: "isActiveOnAll", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + trigger: { + name: "trigger", + type: "WorkflowTriggerEvents" + }, + time: { + name: "time", + type: "Int", + optional: true + }, + timeUnit: { + name: "timeUnit", + type: "TimeUnit", + optional: true + }, + steps: { + name: "steps", + type: "WorkflowStep", + array: true, + relation: { opposite: "workflow" } + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + } + }, + AIPhoneCallConfiguration: { + name: "AIPhoneCallConfiguration", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + eventType: { + name: "eventType", + type: "EventType", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("eventTypeId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "aiPhoneCallConfig", fields: ["eventTypeId"], references: ["id"], onDelete: "Cascade" } + }, + eventTypeId: { + name: "eventTypeId", + type: "Int", + foreignKeyFor: [ + "eventType" + ] + }, + templateType: { + name: "templateType", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("CUSTOM_TEMPLATE") }] }], + default: "CUSTOM_TEMPLATE" + }, + schedulerName: { + name: "schedulerName", + type: "String", + optional: true + }, + generalPrompt: { + name: "generalPrompt", + type: "String", + optional: true + }, + yourPhoneNumber: { + name: "yourPhoneNumber", + type: "String" + }, + numberToCall: { + name: "numberToCall", + type: "String" + }, + guestName: { + name: "guestName", + type: "String", + optional: true + }, + guestEmail: { + name: "guestEmail", + type: "String", + optional: true + }, + guestCompany: { + name: "guestCompany", + type: "String", + optional: true + }, + enabled: { + name: "enabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + beginMessage: { + name: "beginMessage", + type: "String", + optional: true + }, + llmId: { + name: "llmId", + type: "String", + optional: true + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("eventTypeId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("eventTypeId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + eventTypeId: { type: "Int" } + } + }, + WorkflowsOnEventTypes: { + name: "WorkflowsOnEventTypes", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + workflow: { + name: "workflow", + type: "Workflow", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("workflowId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "activeOn", fields: ["workflowId"], references: ["id"], onDelete: "Cascade" } + }, + workflowId: { + name: "workflowId", + type: "Int", + foreignKeyFor: [ + "workflow" + ] + }, + eventType: { + name: "eventType", + type: "EventType", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("eventTypeId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "workflows", fields: ["eventTypeId"], references: ["id"], onDelete: "Cascade" } + }, + eventTypeId: { + name: "eventTypeId", + type: "Int", + foreignKeyFor: [ + "eventType" + ] + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("workflowId"), ExpressionUtils.field("eventTypeId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("workflowId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("eventTypeId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + workflowId_eventTypeId: { workflowId: { type: "Int" }, eventTypeId: { type: "Int" } } + } + }, + WorkflowsOnTeams: { + name: "WorkflowsOnTeams", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + workflow: { + name: "workflow", + type: "Workflow", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("workflowId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "activeOnTeams", fields: ["workflowId"], references: ["id"], onDelete: "Cascade" } + }, + workflowId: { + name: "workflowId", + type: "Int", + foreignKeyFor: [ + "workflow" + ] + }, + team: { + name: "team", + type: "Team", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "activeOrgWorkflows", fields: ["teamId"], references: ["id"], onDelete: "Cascade" } + }, + teamId: { + name: "teamId", + type: "Int", + foreignKeyFor: [ + "team" + ] + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("workflowId"), ExpressionUtils.field("teamId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("workflowId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + workflowId_teamId: { workflowId: { type: "Int" }, teamId: { type: "Int" } } + } + }, + Deployment: { + name: "Deployment", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(1) }] }], + default: 1 + }, + logo: { + name: "logo", + type: "String", + optional: true + }, + theme: { + name: "theme", + type: "Json", + optional: true + }, + licenseKey: { + name: "licenseKey", + type: "String", + optional: true + }, + agreedLicenseAt: { + name: "agreedLicenseAt", + type: "DateTime", + optional: true + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + } + }, + WorkflowReminder: { + name: "WorkflowReminder", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + uuid: { + name: "uuid", + type: "String", + unique: true, + optional: true, + attributes: [{ name: "@unique" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("uuid") }] }], + default: ExpressionUtils.call("uuid") + }, + bookingUid: { + name: "bookingUid", + type: "String", + optional: true, + foreignKeyFor: [ + "booking" + ] + }, + booking: { + name: "booking", + type: "Booking", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("bookingUid")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("uid")]) }] }], + relation: { opposite: "workflowReminders", fields: ["bookingUid"], references: ["uid"] } + }, + method: { + name: "method", + type: "WorkflowMethods" + }, + scheduledDate: { + name: "scheduledDate", + type: "DateTime" + }, + referenceId: { + name: "referenceId", + type: "String", + unique: true, + optional: true, + attributes: [{ name: "@unique" }] + }, + scheduled: { + name: "scheduled", + type: "Boolean" + }, + workflowStepId: { + name: "workflowStepId", + type: "Int", + optional: true, + foreignKeyFor: [ + "workflowStep" + ] + }, + workflowStep: { + name: "workflowStep", + type: "WorkflowStep", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("workflowStepId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "workflowReminders", fields: ["workflowStepId"], references: ["id"], onDelete: "Cascade" } + }, + cancelled: { + name: "cancelled", + type: "Boolean", + optional: true + }, + seatReferenceId: { + name: "seatReferenceId", + type: "String", + optional: true + }, + isMandatoryReminder: { + name: "isMandatoryReminder", + type: "Boolean", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + retryCount: { + name: "retryCount", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("bookingUid")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("workflowStepId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("seatReferenceId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("method"), ExpressionUtils.field("scheduled"), ExpressionUtils.field("scheduledDate")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("cancelled"), ExpressionUtils.field("scheduledDate")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + uuid: { type: "String" }, + referenceId: { type: "String" } + } + }, + WebhookScheduledTriggers: { + name: "WebhookScheduledTriggers", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + jobName: { + name: "jobName", + type: "String", + optional: true + }, + subscriberUrl: { + name: "subscriberUrl", + type: "String" + }, + payload: { + name: "payload", + type: "String" + }, + startAfter: { + name: "startAfter", + type: "DateTime" + }, + retryCount: { + name: "retryCount", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + createdAt: { + name: "createdAt", + type: "DateTime", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + appId: { + name: "appId", + type: "String", + optional: true + }, + webhookId: { + name: "webhookId", + type: "String", + optional: true, + foreignKeyFor: [ + "webhook" + ] + }, + webhook: { + name: "webhook", + type: "Webhook", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("webhookId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "scheduledTriggers", fields: ["webhookId"], references: ["id"], onDelete: "Cascade" } + }, + bookingId: { + name: "bookingId", + type: "Int", + optional: true, + foreignKeyFor: [ + "booking" + ] + }, + booking: { + name: "booking", + type: "Booking", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("bookingId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "scheduledTriggers", fields: ["bookingId"], references: ["id"], onDelete: "Cascade" } + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + } + }, + BookingSeat: { + name: "BookingSeat", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + referenceUid: { + name: "referenceUid", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + bookingId: { + name: "bookingId", + type: "Int", + foreignKeyFor: [ + "booking" + ] + }, + booking: { + name: "booking", + type: "Booking", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("bookingId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "seatsReferences", fields: ["bookingId"], references: ["id"], onDelete: "Cascade" } + }, + attendeeId: { + name: "attendeeId", + type: "Int", + unique: true, + attributes: [{ name: "@unique" }], + foreignKeyFor: [ + "attendee" + ] + }, + attendee: { + name: "attendee", + type: "Attendee", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("attendeeId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "bookingSeat", fields: ["attendeeId"], references: ["id"], onDelete: "Cascade" } + }, + data: { + name: "data", + type: "Json", + optional: true + }, + metadata: { + name: "metadata", + type: "Json", + optional: true + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("bookingId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("attendeeId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + referenceUid: { type: "String" }, + attendeeId: { type: "Int" } + } + }, + VerifiedNumber: { + name: "VerifiedNumber", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + userId: { + name: "userId", + type: "Int", + optional: true, + foreignKeyFor: [ + "user" + ] + }, + user: { + name: "user", + type: "User", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "verifiedNumbers", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + teamId: { + name: "teamId", + type: "Int", + optional: true, + foreignKeyFor: [ + "team" + ] + }, + team: { + name: "team", + type: "Team", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "verifiedNumbers", fields: ["teamId"], references: ["id"], onDelete: "Cascade" } + }, + phoneNumber: { + name: "phoneNumber", + type: "String" + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + } + }, + VerifiedEmail: { + name: "VerifiedEmail", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + userId: { + name: "userId", + type: "Int", + optional: true, + foreignKeyFor: [ + "user" + ] + }, + user: { + name: "user", + type: "User", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "verifiedEmails", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + teamId: { + name: "teamId", + type: "Int", + optional: true, + foreignKeyFor: [ + "team" + ] + }, + team: { + name: "team", + type: "Team", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "verifiedEmails", fields: ["teamId"], references: ["id"], onDelete: "Cascade" } + }, + email: { + name: "email", + type: "String" + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + } + }, + Feature: { + name: "Feature", + fields: { + slug: { + name: "slug", + type: "String", + id: true, + unique: true, + attributes: [{ name: "@id" }, { name: "@unique" }] + }, + enabled: { + name: "enabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + description: { + name: "description", + type: "String", + optional: true + }, + type: { + name: "type", + type: "FeatureType", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("RELEASE") }] }], + default: "RELEASE" + }, + stale: { + name: "stale", + type: "Boolean", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + lastUsedAt: { + name: "lastUsedAt", + type: "DateTime", + optional: true + }, + createdAt: { + name: "createdAt", + type: "DateTime", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + optional: true, + updatedAt: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@updatedAt" }], + default: ExpressionUtils.call("now") + }, + updatedBy: { + name: "updatedBy", + type: "Int", + optional: true + }, + users: { + name: "users", + type: "UserFeatures", + array: true, + relation: { opposite: "feature" } + }, + teams: { + name: "teams", + type: "TeamFeatures", + array: true, + relation: { opposite: "feature" } + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("enabled")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("stale")]) }] } + ], + idFields: ["slug"], + uniqueFields: { + slug: { type: "String" } + } + }, + UserFeatures: { + name: "UserFeatures", + fields: { + user: { + name: "user", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "features", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + userId: { + name: "userId", + type: "Int", + id: true, + foreignKeyFor: [ + "user" + ] + }, + feature: { + name: "feature", + type: "Feature", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("featureId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("slug")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "users", fields: ["featureId"], references: ["slug"], onDelete: "Cascade" } + }, + featureId: { + name: "featureId", + type: "String", + id: true, + foreignKeyFor: [ + "feature" + ] + }, + assignedAt: { + name: "assignedAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + assignedBy: { + name: "assignedBy", + type: "String" + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + } + }, + attributes: [ + { name: "@@id", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId"), ExpressionUtils.field("featureId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId"), ExpressionUtils.field("featureId")]) }] } + ], + idFields: ["userId", "featureId"], + uniqueFields: { + userId_featureId: { userId: { type: "Int" }, featureId: { type: "String" } } + } + }, + TeamFeatures: { + name: "TeamFeatures", + fields: { + team: { + name: "team", + type: "Team", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "features", fields: ["teamId"], references: ["id"], onDelete: "Cascade" } + }, + teamId: { + name: "teamId", + type: "Int", + id: true, + foreignKeyFor: [ + "team" + ] + }, + feature: { + name: "feature", + type: "Feature", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("featureId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("slug")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "teams", fields: ["featureId"], references: ["slug"], onDelete: "Cascade" } + }, + featureId: { + name: "featureId", + type: "String", + id: true, + foreignKeyFor: [ + "feature" + ] + }, + assignedAt: { + name: "assignedAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + assignedBy: { + name: "assignedBy", + type: "String" + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + } + }, + attributes: [ + { name: "@@id", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId"), ExpressionUtils.field("featureId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId"), ExpressionUtils.field("featureId")]) }] } + ], + idFields: ["teamId", "featureId"], + uniqueFields: { + teamId_featureId: { teamId: { type: "Int" }, featureId: { type: "String" } } + } + }, + SelectedSlots: { + name: "SelectedSlots", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + eventTypeId: { + name: "eventTypeId", + type: "Int" + }, + userId: { + name: "userId", + type: "Int" + }, + slotUtcStartDate: { + name: "slotUtcStartDate", + type: "DateTime" + }, + slotUtcEndDate: { + name: "slotUtcEndDate", + type: "DateTime" + }, + uid: { + name: "uid", + type: "String" + }, + releaseAt: { + name: "releaseAt", + type: "DateTime" + }, + isSeat: { + name: "isSeat", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId"), ExpressionUtils.field("slotUtcStartDate"), ExpressionUtils.field("slotUtcEndDate"), ExpressionUtils.field("uid")]) }, { name: "name", value: ExpressionUtils.literal("selectedSlotUnique") }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + selectedSlotUnique: { userId: { type: "Int" }, slotUtcStartDate: { type: "DateTime" }, slotUtcEndDate: { type: "DateTime" }, uid: { type: "String" } } + } + }, + OAuthClient: { + name: "OAuthClient", + fields: { + clientId: { + name: "clientId", + type: "String", + id: true, + unique: true, + attributes: [{ name: "@id" }, { name: "@unique" }] + }, + redirectUri: { + name: "redirectUri", + type: "String" + }, + clientSecret: { + name: "clientSecret", + type: "String" + }, + name: { + name: "name", + type: "String" + }, + logo: { + name: "logo", + type: "String", + optional: true + }, + accessCodes: { + name: "accessCodes", + type: "AccessCode", + array: true, + relation: { opposite: "client" } + } + }, + idFields: ["clientId"], + uniqueFields: { + clientId: { type: "String" } + } + }, + AccessCode: { + name: "AccessCode", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + code: { + name: "code", + type: "String" + }, + clientId: { + name: "clientId", + type: "String", + optional: true, + foreignKeyFor: [ + "client" + ] + }, + client: { + name: "client", + type: "OAuthClient", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("clientId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("clientId")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "accessCodes", fields: ["clientId"], references: ["clientId"], onDelete: "Cascade" } + }, + expiresAt: { + name: "expiresAt", + type: "DateTime" + }, + scopes: { + name: "scopes", + type: "AccessScope", + array: true + }, + userId: { + name: "userId", + type: "Int", + optional: true, + foreignKeyFor: [ + "user" + ] + }, + user: { + name: "user", + type: "User", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "accessCodes", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + teamId: { + name: "teamId", + type: "Int", + optional: true, + foreignKeyFor: [ + "team" + ] + }, + team: { + name: "team", + type: "Team", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "accessCodes", fields: ["teamId"], references: ["id"], onDelete: "Cascade" } + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + } + }, + BookingTimeStatus: { + name: "BookingTimeStatus", + fields: { + id: { + name: "id", + type: "Int", + id: true, + unique: true, + attributes: [{ name: "@unique" }] + }, + uid: { + name: "uid", + type: "String", + optional: true + }, + eventTypeId: { + name: "eventTypeId", + type: "Int", + optional: true + }, + title: { + name: "title", + type: "String", + optional: true + }, + description: { + name: "description", + type: "String", + optional: true + }, + startTime: { + name: "startTime", + type: "DateTime", + optional: true + }, + endTime: { + name: "endTime", + type: "DateTime", + optional: true + }, + createdAt: { + name: "createdAt", + type: "DateTime", + optional: true + }, + location: { + name: "location", + type: "String", + optional: true + }, + paid: { + name: "paid", + type: "Boolean", + optional: true + }, + status: { + name: "status", + type: "BookingStatus", + optional: true + }, + rescheduled: { + name: "rescheduled", + type: "Boolean", + optional: true + }, + userId: { + name: "userId", + type: "Int", + optional: true + }, + teamId: { + name: "teamId", + type: "Int", + optional: true + }, + eventLength: { + name: "eventLength", + type: "Int", + optional: true + }, + timeStatus: { + name: "timeStatus", + type: "String", + optional: true + }, + eventParentId: { + name: "eventParentId", + type: "Int", + optional: true + }, + userEmail: { + name: "userEmail", + type: "String", + optional: true + }, + username: { + name: "username", + type: "String", + optional: true + }, + ratingFeedback: { + name: "ratingFeedback", + type: "String", + optional: true + }, + rating: { + name: "rating", + type: "Int", + optional: true + }, + noShowHost: { + name: "noShowHost", + type: "Boolean", + optional: true + }, + isTeamBooking: { + name: "isTeamBooking", + type: "Boolean" + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + }, + isView: true + }, + BookingDenormalized: { + name: "BookingDenormalized", + fields: { + id: { + name: "id", + type: "Int", + id: true, + unique: true, + attributes: [{ name: "@id" }, { name: "@unique" }] + }, + uid: { + name: "uid", + type: "String" + }, + eventTypeId: { + name: "eventTypeId", + type: "Int", + optional: true + }, + title: { + name: "title", + type: "String" + }, + description: { + name: "description", + type: "String", + optional: true + }, + startTime: { + name: "startTime", + type: "DateTime" + }, + endTime: { + name: "endTime", + type: "DateTime" + }, + createdAt: { + name: "createdAt", + type: "DateTime" + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + optional: true + }, + location: { + name: "location", + type: "String", + optional: true + }, + paid: { + name: "paid", + type: "Boolean" + }, + status: { + name: "status", + type: "BookingStatus" + }, + rescheduled: { + name: "rescheduled", + type: "Boolean", + optional: true + }, + userId: { + name: "userId", + type: "Int", + optional: true + }, + teamId: { + name: "teamId", + type: "Int", + optional: true + }, + eventLength: { + name: "eventLength", + type: "Int", + optional: true + }, + eventParentId: { + name: "eventParentId", + type: "Int", + optional: true + }, + userEmail: { + name: "userEmail", + type: "String", + optional: true + }, + userName: { + name: "userName", + type: "String", + optional: true + }, + userUsername: { + name: "userUsername", + type: "String", + optional: true + }, + ratingFeedback: { + name: "ratingFeedback", + type: "String", + optional: true + }, + rating: { + name: "rating", + type: "Int", + optional: true + }, + noShowHost: { + name: "noShowHost", + type: "Boolean", + optional: true + }, + isTeamBooking: { + name: "isTeamBooking", + type: "Boolean" + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("createdAt")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("eventTypeId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("eventParentId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("startTime")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("endTime")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("status")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId"), ExpressionUtils.field("isTeamBooking")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId"), ExpressionUtils.field("isTeamBooking")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + } + }, + BookingTimeStatusDenormalized: { + name: "BookingTimeStatusDenormalized", + fields: { + id: { + name: "id", + type: "Int", + id: true, + unique: true, + attributes: [{ name: "@id" }, { name: "@unique" }] + }, + uid: { + name: "uid", + type: "String" + }, + eventTypeId: { + name: "eventTypeId", + type: "Int", + optional: true + }, + title: { + name: "title", + type: "String" + }, + description: { + name: "description", + type: "String", + optional: true + }, + startTime: { + name: "startTime", + type: "DateTime" + }, + endTime: { + name: "endTime", + type: "DateTime" + }, + createdAt: { + name: "createdAt", + type: "DateTime" + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + optional: true + }, + location: { + name: "location", + type: "String", + optional: true + }, + paid: { + name: "paid", + type: "Boolean" + }, + status: { + name: "status", + type: "BookingStatus" + }, + rescheduled: { + name: "rescheduled", + type: "Boolean", + optional: true + }, + userId: { + name: "userId", + type: "Int", + optional: true + }, + teamId: { + name: "teamId", + type: "Int", + optional: true + }, + eventLength: { + name: "eventLength", + type: "Int", + optional: true + }, + eventParentId: { + name: "eventParentId", + type: "Int", + optional: true + }, + userEmail: { + name: "userEmail", + type: "String", + optional: true + }, + userName: { + name: "userName", + type: "String", + optional: true + }, + userUsername: { + name: "userUsername", + type: "String", + optional: true + }, + ratingFeedback: { + name: "ratingFeedback", + type: "String", + optional: true + }, + rating: { + name: "rating", + type: "Int", + optional: true + }, + noShowHost: { + name: "noShowHost", + type: "Boolean", + optional: true + }, + isTeamBooking: { + name: "isTeamBooking", + type: "Boolean" + }, + timeStatus: { + name: "timeStatus", + type: "String", + optional: true + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + }, + isView: true + }, + CalendarCache: { + name: "CalendarCache", + fields: { + id: { + name: "id", + type: "String", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("uuid") }] }], + default: ExpressionUtils.call("uuid") + }, + key: { + name: "key", + type: "String", + id: true + }, + value: { + name: "value", + type: "Json" + }, + expiresAt: { + name: "expiresAt", + type: "DateTime" + }, + credentialId: { + name: "credentialId", + type: "Int", + id: true, + foreignKeyFor: [ + "credential" + ] + }, + userId: { + name: "userId", + type: "Int", + optional: true + }, + credential: { + name: "credential", + type: "Credential", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("credentialId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "CalendarCache", fields: ["credentialId"], references: ["id"], onDelete: "Cascade" } + } + }, + attributes: [ + { name: "@@id", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("credentialId"), ExpressionUtils.field("key")]) }] }, + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("credentialId"), ExpressionUtils.field("key")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId"), ExpressionUtils.field("key")]) }] } + ], + idFields: ["key", "credentialId"], + uniqueFields: { + credentialId_key: { credentialId: { type: "Int" }, key: { type: "String" } } + } + }, + TempOrgRedirect: { + name: "TempOrgRedirect", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + from: { + name: "from", + type: "String" + }, + fromOrgId: { + name: "fromOrgId", + type: "Int" + }, + type: { + name: "type", + type: "RedirectType" + }, + toUrl: { + name: "toUrl", + type: "String" + }, + enabled: { + name: "enabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(true) }] }], + default: true + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("from"), ExpressionUtils.field("type"), ExpressionUtils.field("fromOrgId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + from_type_fromOrgId: { from: { type: "String" }, type: { type: "RedirectType" }, fromOrgId: { type: "Int" } } + } + }, + Avatar: { + name: "Avatar", + fields: { + teamId: { + name: "teamId", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + userId: { + name: "userId", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + data: { + name: "data", + type: "String" + }, + objectKey: { + name: "objectKey", + type: "String", + id: true, + unique: true, + attributes: [{ name: "@unique" }] + }, + isBanner: { + name: "isBanner", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId"), ExpressionUtils.field("userId"), ExpressionUtils.field("isBanner")]) }] }, + { name: "@@map", args: [{ name: "name", value: ExpressionUtils.literal("avatars") }] } + ], + idFields: ["objectKey"], + uniqueFields: { + objectKey: { type: "String" }, + teamId_userId_isBanner: { teamId: { type: "Int" }, userId: { type: "Int" }, isBanner: { type: "Boolean" } } + } + }, + OutOfOfficeEntry: { + name: "OutOfOfficeEntry", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + uuid: { + name: "uuid", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + start: { + name: "start", + type: "DateTime" + }, + end: { + name: "end", + type: "DateTime" + }, + notes: { + name: "notes", + type: "String", + optional: true + }, + userId: { + name: "userId", + type: "Int", + foreignKeyFor: [ + "user" + ] + }, + user: { + name: "user", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "bookingRedirects", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + toUserId: { + name: "toUserId", + type: "Int", + optional: true, + foreignKeyFor: [ + "toUser" + ] + }, + toUser: { + name: "toUser", + type: "User", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("toUser") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("toUserId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "bookingRedirectsTo", name: "toUser", fields: ["toUserId"], references: ["id"], onDelete: "Cascade" } + }, + reasonId: { + name: "reasonId", + type: "Int", + optional: true, + foreignKeyFor: [ + "reason" + ] + }, + reason: { + name: "reason", + type: "OutOfOfficeReason", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("reasonId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }] }], + relation: { opposite: "entries", fields: ["reasonId"], references: ["id"], onDelete: "SetNull" } + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("uuid")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("toUserId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("start"), ExpressionUtils.field("end")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + uuid: { type: "String" } + } + }, + OutOfOfficeReason: { + name: "OutOfOfficeReason", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + emoji: { + name: "emoji", + type: "String" + }, + reason: { + name: "reason", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + enabled: { + name: "enabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(true) }] }], + default: true + }, + userId: { + name: "userId", + type: "Int", + optional: true, + foreignKeyFor: [ + "user" + ] + }, + user: { + name: "user", + type: "User", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "OutOfOfficeReasons", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + entries: { + name: "entries", + type: "OutOfOfficeEntry", + array: true, + relation: { opposite: "reason" } + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + reason: { type: "String" } + } + }, + PlatformOAuthClient: { + name: "PlatformOAuthClient", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + name: { + name: "name", + type: "String" + }, + secret: { + name: "secret", + type: "String" + }, + permissions: { + name: "permissions", + type: "Int" + }, + users: { + name: "users", + type: "User", + array: true, + relation: { opposite: "platformOAuthClients" } + }, + logo: { + name: "logo", + type: "String", + optional: true + }, + redirectUris: { + name: "redirectUris", + type: "String", + array: true + }, + organizationId: { + name: "organizationId", + type: "Int", + foreignKeyFor: [ + "organization" + ] + }, + organization: { + name: "organization", + type: "Team", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "platformOAuthClient", fields: ["organizationId"], references: ["id"], onDelete: "Cascade" } + }, + teams: { + name: "teams", + type: "Team", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("CreatedByOAuthClient") }] }], + relation: { opposite: "createdByOAuthClient", name: "CreatedByOAuthClient" } + }, + accessTokens: { + name: "accessTokens", + type: "AccessToken", + array: true, + relation: { opposite: "client" } + }, + refreshToken: { + name: "refreshToken", + type: "RefreshToken", + array: true, + relation: { opposite: "client" } + }, + authorizationTokens: { + name: "authorizationTokens", + type: "PlatformAuthorizationToken", + array: true, + relation: { opposite: "client" } + }, + webhook: { + name: "webhook", + type: "Webhook", + array: true, + relation: { opposite: "platformOAuthClient" } + }, + bookingRedirectUri: { + name: "bookingRedirectUri", + type: "String", + optional: true + }, + bookingCancelRedirectUri: { + name: "bookingCancelRedirectUri", + type: "String", + optional: true + }, + bookingRescheduleRedirectUri: { + name: "bookingRescheduleRedirectUri", + type: "String", + optional: true + }, + areEmailsEnabled: { + name: "areEmailsEnabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + areDefaultEventTypesEnabled: { + name: "areDefaultEventTypesEnabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(true) }] }], + default: true + }, + areCalendarEventsEnabled: { + name: "areCalendarEventsEnabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(true) }] }], + default: true + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" } + } + }, + PlatformAuthorizationToken: { + name: "PlatformAuthorizationToken", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + owner: { + name: "owner", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "PlatformAuthorizationToken", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + client: { + name: "client", + type: "PlatformOAuthClient", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("platformOAuthClientId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "authorizationTokens", fields: ["platformOAuthClientId"], references: ["id"], onDelete: "Cascade" } + }, + platformOAuthClientId: { + name: "platformOAuthClientId", + type: "String", + foreignKeyFor: [ + "client" + ] + }, + userId: { + name: "userId", + type: "Int", + foreignKeyFor: [ + "owner" + ] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId"), ExpressionUtils.field("platformOAuthClientId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + userId_platformOAuthClientId: { userId: { type: "Int" }, platformOAuthClientId: { type: "String" } } + } + }, + AccessToken: { + name: "AccessToken", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + secret: { + name: "secret", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + expiresAt: { + name: "expiresAt", + type: "DateTime" + }, + owner: { + name: "owner", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "AccessToken", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + client: { + name: "client", + type: "PlatformOAuthClient", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("platformOAuthClientId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "accessTokens", fields: ["platformOAuthClientId"], references: ["id"], onDelete: "Cascade" } + }, + platformOAuthClientId: { + name: "platformOAuthClientId", + type: "String", + foreignKeyFor: [ + "client" + ] + }, + userId: { + name: "userId", + type: "Int", + foreignKeyFor: [ + "owner" + ] + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + secret: { type: "String" } + } + }, + RefreshToken: { + name: "RefreshToken", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + secret: { + name: "secret", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + expiresAt: { + name: "expiresAt", + type: "DateTime" + }, + owner: { + name: "owner", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "RefreshToken", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + client: { + name: "client", + type: "PlatformOAuthClient", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("platformOAuthClientId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "refreshToken", fields: ["platformOAuthClientId"], references: ["id"], onDelete: "Cascade" } + }, + platformOAuthClientId: { + name: "platformOAuthClientId", + type: "String", + foreignKeyFor: [ + "client" + ] + }, + userId: { + name: "userId", + type: "Int", + foreignKeyFor: [ + "owner" + ] + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + secret: { type: "String" } + } + }, + DSyncData: { + name: "DSyncData", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + directoryId: { + name: "directoryId", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + tenant: { + name: "tenant", + type: "String" + }, + organizationId: { + name: "organizationId", + type: "Int", + unique: true, + optional: true, + attributes: [{ name: "@unique" }], + foreignKeyFor: [ + "org" + ] + }, + org: { + name: "org", + type: "OrganizationSettings", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("organizationId")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "dSyncData", fields: ["organizationId"], references: ["organizationId"], onDelete: "Cascade" } + }, + teamGroupMapping: { + name: "teamGroupMapping", + type: "DSyncTeamGroupMapping", + array: true, + relation: { opposite: "directory" } + }, + createdAttributeToUsers: { + name: "createdAttributeToUsers", + type: "AttributeToUser", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("createdByDSync") }] }], + relation: { opposite: "createdByDSync", name: "createdByDSync" } + }, + updatedAttributeToUsers: { + name: "updatedAttributeToUsers", + type: "AttributeToUser", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("updatedByDSync") }] }], + relation: { opposite: "updatedByDSync", name: "updatedByDSync" } + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + directoryId: { type: "String" }, + organizationId: { type: "Int" } + } + }, + DSyncTeamGroupMapping: { + name: "DSyncTeamGroupMapping", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + organizationId: { + name: "organizationId", + type: "Int" + }, + teamId: { + name: "teamId", + type: "Int", + foreignKeyFor: [ + "team" + ] + }, + team: { + name: "team", + type: "Team", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "dsyncTeamGroupMapping", fields: ["teamId"], references: ["id"], onDelete: "Cascade" } + }, + directoryId: { + name: "directoryId", + type: "String", + foreignKeyFor: [ + "directory" + ] + }, + directory: { + name: "directory", + type: "DSyncData", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("directoryId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("directoryId")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "teamGroupMapping", fields: ["directoryId"], references: ["directoryId"], onDelete: "Cascade" } + }, + groupName: { + name: "groupName", + type: "String" + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId"), ExpressionUtils.field("groupName")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + teamId_groupName: { teamId: { type: "Int" }, groupName: { type: "String" } } + } + }, + SecondaryEmail: { + name: "SecondaryEmail", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + user: { + name: "user", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "secondaryEmails", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + userId: { + name: "userId", + type: "Int", + foreignKeyFor: [ + "user" + ] + }, + email: { + name: "email", + type: "String" + }, + emailVerified: { + name: "emailVerified", + type: "DateTime", + optional: true + }, + verificationTokens: { + name: "verificationTokens", + type: "VerificationToken", + array: true, + relation: { opposite: "secondaryEmail" } + }, + eventTypes: { + name: "eventTypes", + type: "EventType", + array: true, + relation: { opposite: "secondaryEmail" } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("email")]) }] }, + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId"), ExpressionUtils.field("email")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + email: { type: "String" }, + userId_email: { userId: { type: "Int" }, email: { type: "String" } } + } + }, + Task: { + name: "Task", + fields: { + id: { + name: "id", + type: "String", + id: true, + unique: true, + attributes: [{ name: "@id" }, { name: "@unique" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("uuid") }] }], + default: ExpressionUtils.call("uuid") + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + scheduledAt: { + name: "scheduledAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + succeededAt: { + name: "succeededAt", + type: "DateTime", + optional: true + }, + type: { + name: "type", + type: "String" + }, + payload: { + name: "payload", + type: "String" + }, + attempts: { + name: "attempts", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + maxAttempts: { + name: "maxAttempts", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(3) }] }], + default: 3 + }, + lastError: { + name: "lastError", + type: "String", + optional: true + }, + lastFailedAttemptAt: { + name: "lastFailedAttemptAt", + type: "DateTime", + optional: true + }, + referenceUid: { + name: "referenceUid", + type: "String", + optional: true + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" } + } + }, + ManagedOrganization: { + name: "ManagedOrganization", + fields: { + managedOrganizationId: { + name: "managedOrganizationId", + type: "Int", + id: true, + unique: true, + attributes: [{ name: "@unique" }], + foreignKeyFor: [ + "managedOrganization" + ] + }, + managedOrganization: { + name: "managedOrganization", + type: "Team", + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("ManagedOrganization") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("managedOrganizationId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "managedOrganization", name: "ManagedOrganization", fields: ["managedOrganizationId"], references: ["id"], onDelete: "Cascade" } + }, + managerOrganizationId: { + name: "managerOrganizationId", + type: "Int", + foreignKeyFor: [ + "managerOrganization" + ] + }, + managerOrganization: { + name: "managerOrganization", + type: "Team", + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("ManagerOrganization") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("managerOrganizationId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "managedOrganizations", name: "ManagerOrganization", fields: ["managerOrganizationId"], references: ["id"], onDelete: "Cascade" } + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("managerOrganizationId"), ExpressionUtils.field("managedOrganizationId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("managerOrganizationId")]) }] } + ], + idFields: ["managedOrganizationId"], + uniqueFields: { + managedOrganizationId: { type: "Int" }, + managerOrganizationId_managedOrganizationId: { managerOrganizationId: { type: "Int" }, managedOrganizationId: { type: "Int" } } + } + }, + PlatformBilling: { + name: "PlatformBilling", + fields: { + id: { + name: "id", + type: "Int", + id: true, + unique: true, + attributes: [{ name: "@id" }, { name: "@unique" }], + foreignKeyFor: [ + "team" + ] + }, + customerId: { + name: "customerId", + type: "String" + }, + subscriptionId: { + name: "subscriptionId", + type: "String", + optional: true + }, + priceId: { + name: "priceId", + type: "String", + optional: true + }, + plan: { + name: "plan", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("none") }] }], + default: "none" + }, + billingCycleStart: { + name: "billingCycleStart", + type: "Int", + optional: true + }, + billingCycleEnd: { + name: "billingCycleEnd", + type: "Int", + optional: true + }, + overdue: { + name: "overdue", + type: "Boolean", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + managerBillingId: { + name: "managerBillingId", + type: "Int", + optional: true, + foreignKeyFor: [ + "managerBilling" + ] + }, + managerBilling: { + name: "managerBilling", + type: "PlatformBilling", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("PlatformManagedBilling") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("managerBillingId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "managedBillings", name: "PlatformManagedBilling", fields: ["managerBillingId"], references: ["id"] } + }, + managedBillings: { + name: "managedBillings", + type: "PlatformBilling", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("PlatformManagedBilling") }] }], + relation: { opposite: "managerBilling", name: "PlatformManagedBilling" } + }, + team: { + name: "team", + type: "Team", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "platformBilling", fields: ["id"], references: ["id"], onDelete: "Cascade" } + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + } + }, + AttributeOption: { + name: "AttributeOption", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("uuid") }] }], + default: ExpressionUtils.call("uuid") + }, + attribute: { + name: "attribute", + type: "Attribute", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("attributeId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "options", fields: ["attributeId"], references: ["id"], onDelete: "Cascade" } + }, + attributeId: { + name: "attributeId", + type: "String", + foreignKeyFor: [ + "attribute" + ] + }, + value: { + name: "value", + type: "String" + }, + slug: { + name: "slug", + type: "String" + }, + isGroup: { + name: "isGroup", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + contains: { + name: "contains", + type: "String", + array: true + }, + assignedUsers: { + name: "assignedUsers", + type: "AttributeToUser", + array: true, + relation: { opposite: "attributeOption" } + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" } + } + }, + Attribute: { + name: "Attribute", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("uuid") }] }], + default: ExpressionUtils.call("uuid") + }, + team: { + name: "team", + type: "Team", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "attributes", fields: ["teamId"], references: ["id"], onDelete: "Cascade" } + }, + teamId: { + name: "teamId", + type: "Int", + foreignKeyFor: [ + "team" + ] + }, + type: { + name: "type", + type: "AttributeType" + }, + name: { + name: "name", + type: "String" + }, + slug: { + name: "slug", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + enabled: { + name: "enabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(true) }] }], + default: true + }, + usersCanEditRelation: { + name: "usersCanEditRelation", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + options: { + name: "options", + type: "AttributeOption", + array: true, + relation: { opposite: "attribute" } + }, + isWeightsEnabled: { + name: "isWeightsEnabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + isLocked: { + name: "isLocked", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + slug: { type: "String" } + } + }, + AttributeToUser: { + name: "AttributeToUser", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("uuid") }] }], + default: ExpressionUtils.call("uuid") + }, + member: { + name: "member", + type: "Membership", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("memberId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "AttributeToUser", fields: ["memberId"], references: ["id"], onDelete: "Cascade" } + }, + memberId: { + name: "memberId", + type: "Int", + foreignKeyFor: [ + "member" + ] + }, + attributeOption: { + name: "attributeOption", + type: "AttributeOption", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("attributeOptionId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "assignedUsers", fields: ["attributeOptionId"], references: ["id"], onDelete: "Cascade" } + }, + attributeOptionId: { + name: "attributeOptionId", + type: "String", + foreignKeyFor: [ + "attributeOption" + ] + }, + weight: { + name: "weight", + type: "Int", + optional: true + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + createdById: { + name: "createdById", + type: "Int", + optional: true, + foreignKeyFor: [ + "createdBy" + ] + }, + createdBy: { + name: "createdBy", + type: "User", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("createdBy") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("createdById")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }] }], + relation: { opposite: "createdAttributeToUsers", name: "createdBy", fields: ["createdById"], references: ["id"], onDelete: "SetNull" } + }, + createdByDSyncId: { + name: "createdByDSyncId", + type: "String", + optional: true, + foreignKeyFor: [ + "createdByDSync" + ] + }, + createdByDSync: { + name: "createdByDSync", + type: "DSyncData", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("createdByDSync") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("createdByDSyncId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("directoryId")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }] }], + relation: { opposite: "createdAttributeToUsers", name: "createdByDSync", fields: ["createdByDSyncId"], references: ["directoryId"], onDelete: "SetNull" } + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + optional: true, + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + updatedBy: { + name: "updatedBy", + type: "User", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("updatedBy") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("updatedById")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }] }], + relation: { opposite: "updatedAttributeToUsers", name: "updatedBy", fields: ["updatedById"], references: ["id"], onDelete: "SetNull" } + }, + updatedById: { + name: "updatedById", + type: "Int", + optional: true, + foreignKeyFor: [ + "updatedBy" + ] + }, + updatedByDSyncId: { + name: "updatedByDSyncId", + type: "String", + optional: true, + foreignKeyFor: [ + "updatedByDSync" + ] + }, + updatedByDSync: { + name: "updatedByDSync", + type: "DSyncData", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("updatedByDSync") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("updatedByDSyncId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("directoryId")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }] }], + relation: { opposite: "updatedAttributeToUsers", name: "updatedByDSync", fields: ["updatedByDSyncId"], references: ["directoryId"], onDelete: "SetNull" } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("memberId"), ExpressionUtils.field("attributeOptionId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + memberId_attributeOptionId: { memberId: { type: "Int" }, attributeOptionId: { type: "String" } } + } + }, + AssignmentReason: { + name: "AssignmentReason", + fields: { + id: { + name: "id", + type: "Int", + id: true, + unique: true, + attributes: [{ name: "@id" }, { name: "@unique" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + bookingId: { + name: "bookingId", + type: "Int", + foreignKeyFor: [ + "booking" + ] + }, + booking: { + name: "booking", + type: "Booking", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("bookingId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "assignmentReason", fields: ["bookingId"], references: ["id"], onDelete: "Cascade" } + }, + reasonEnum: { + name: "reasonEnum", + type: "AssignmentReasonEnum" + }, + reasonString: { + name: "reasonString", + type: "String" + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("bookingId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + } + }, + DelegationCredential: { + name: "DelegationCredential", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("uuid") }] }], + default: ExpressionUtils.call("uuid") + }, + workspacePlatform: { + name: "workspacePlatform", + type: "WorkspacePlatform", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("workspacePlatformId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "delegationCredentials", fields: ["workspacePlatformId"], references: ["id"], onDelete: "Cascade" } + }, + workspacePlatformId: { + name: "workspacePlatformId", + type: "Int", + foreignKeyFor: [ + "workspacePlatform" + ] + }, + serviceAccountKey: { + name: "serviceAccountKey", + type: "Json" + }, + enabled: { + name: "enabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + lastEnabledAt: { + name: "lastEnabledAt", + type: "DateTime", + optional: true + }, + lastDisabledAt: { + name: "lastDisabledAt", + type: "DateTime", + optional: true + }, + organizationId: { + name: "organizationId", + type: "Int", + foreignKeyFor: [ + "organization" + ] + }, + organization: { + name: "organization", + type: "Team", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "delegationCredentials", fields: ["organizationId"], references: ["id"], onDelete: "Cascade" } + }, + domain: { + name: "domain", + type: "String" + }, + selectedCalendars: { + name: "selectedCalendars", + type: "SelectedCalendar", + array: true, + relation: { opposite: "delegationCredential" } + }, + destinationCalendar: { + name: "destinationCalendar", + type: "DestinationCalendar", + array: true, + relation: { opposite: "delegationCredential" } + }, + bookingReferences: { + name: "bookingReferences", + type: "BookingReference", + array: true, + relation: { opposite: "delegationCredential" } + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + credentials: { + name: "credentials", + type: "Credential", + array: true, + relation: { opposite: "delegationCredential" } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId"), ExpressionUtils.field("domain")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("enabled")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + organizationId_domain: { organizationId: { type: "Int" }, domain: { type: "String" } } + } + }, + DomainWideDelegation: { + name: "DomainWideDelegation", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("uuid") }] }], + default: ExpressionUtils.call("uuid") + }, + workspacePlatform: { + name: "workspacePlatform", + type: "WorkspacePlatform", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("workspacePlatformId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "domainWideDelegations", fields: ["workspacePlatformId"], references: ["id"], onDelete: "Cascade" } + }, + workspacePlatformId: { + name: "workspacePlatformId", + type: "Int", + foreignKeyFor: [ + "workspacePlatform" + ] + }, + serviceAccountKey: { + name: "serviceAccountKey", + type: "Json" + }, + enabled: { + name: "enabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + organizationId: { + name: "organizationId", + type: "Int", + foreignKeyFor: [ + "organization" + ] + }, + organization: { + name: "organization", + type: "Team", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "domainWideDelegations", fields: ["organizationId"], references: ["id"], onDelete: "Cascade" } + }, + domain: { + name: "domain", + type: "String" + }, + selectedCalendars: { + name: "selectedCalendars", + type: "SelectedCalendar", + array: true, + relation: { opposite: "domainWideDelegationCredential" } + }, + destinationCalendar: { + name: "destinationCalendar", + type: "DestinationCalendar", + array: true, + relation: { opposite: "domainWideDelegation" } + }, + bookingReferences: { + name: "bookingReferences", + type: "BookingReference", + array: true, + relation: { opposite: "domainWideDelegation" } + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId"), ExpressionUtils.field("domain")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + organizationId_domain: { organizationId: { type: "Int" }, domain: { type: "String" } } + } + }, + WorkspacePlatform: { + name: "WorkspacePlatform", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + slug: { + name: "slug", + type: "String" + }, + name: { + name: "name", + type: "String" + }, + description: { + name: "description", + type: "String" + }, + defaultServiceAccountKey: { + name: "defaultServiceAccountKey", + type: "Json" + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + enabled: { + name: "enabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + delegationCredentials: { + name: "delegationCredentials", + type: "DelegationCredential", + array: true, + relation: { opposite: "workspacePlatform" } + }, + domainWideDelegations: { + name: "domainWideDelegations", + type: "DomainWideDelegation", + array: true, + relation: { opposite: "workspacePlatform" } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("slug")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + slug: { type: "String" } + } + }, + EventTypeTranslation: { + name: "EventTypeTranslation", + fields: { + uid: { + name: "uid", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + eventType: { + name: "eventType", + type: "EventType", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("eventTypeId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "fieldTranslations", fields: ["eventTypeId"], references: ["id"], onDelete: "Cascade" } + }, + eventTypeId: { + name: "eventTypeId", + type: "Int", + foreignKeyFor: [ + "eventType" + ] + }, + field: { + name: "field", + type: "EventTypeAutoTranslatedField" + }, + sourceLocale: { + name: "sourceLocale", + type: "String" + }, + targetLocale: { + name: "targetLocale", + type: "String" + }, + translatedText: { + name: "translatedText", + type: "String", + attributes: [{ name: "@db.Text" }] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + createdBy: { + name: "createdBy", + type: "Int", + foreignKeyFor: [ + "creator" + ] + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + updatedBy: { + name: "updatedBy", + type: "Int", + optional: true, + foreignKeyFor: [ + "updater" + ] + }, + creator: { + name: "creator", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("CreatedEventTypeTranslations") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("createdBy")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "createdTranslations", name: "CreatedEventTypeTranslations", fields: ["createdBy"], references: ["id"] } + }, + updater: { + name: "updater", + type: "User", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("UpdatedEventTypeTranslations") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("updatedBy")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }] }], + relation: { opposite: "updatedTranslations", name: "UpdatedEventTypeTranslations", fields: ["updatedBy"], references: ["id"], onDelete: "SetNull" } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("eventTypeId"), ExpressionUtils.field("field"), ExpressionUtils.field("targetLocale")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("eventTypeId"), ExpressionUtils.field("field"), ExpressionUtils.field("targetLocale")]) }] } + ], + idFields: ["uid"], + uniqueFields: { + uid: { type: "String" }, + eventTypeId_field_targetLocale: { eventTypeId: { type: "Int" }, field: { type: "EventTypeAutoTranslatedField" }, targetLocale: { type: "String" } } + } + }, + Watchlist: { + name: "Watchlist", + fields: { + id: { + name: "id", + type: "String", + id: true, + unique: true, + attributes: [{ name: "@id" }, { name: "@unique" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + type: { + name: "type", + type: "WatchlistType" + }, + value: { + name: "value", + type: "String" + }, + description: { + name: "description", + type: "String", + optional: true + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + createdBy: { + name: "createdBy", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("CreatedWatchlists") }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("createdById")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "createdWatchlists", name: "CreatedWatchlists", onDelete: "Cascade", fields: ["createdById"], references: ["id"] } + }, + createdById: { + name: "createdById", + type: "Int", + foreignKeyFor: [ + "createdBy" + ] + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + updatedBy: { + name: "updatedBy", + type: "User", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("UpdatedWatchlists") }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("updatedById")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "updatedWatchlists", name: "UpdatedWatchlists", onDelete: "SetNull", fields: ["updatedById"], references: ["id"] } + }, + updatedById: { + name: "updatedById", + type: "Int", + optional: true, + foreignKeyFor: [ + "updatedBy" + ] + }, + severity: { + name: "severity", + type: "WatchlistSeverity", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("LOW") }] }], + default: "LOW" + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("type"), ExpressionUtils.field("value")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("type"), ExpressionUtils.field("value")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + type_value: { type: { type: "WatchlistType" }, value: { type: "String" } } + } + }, + OrganizationOnboarding: { + name: "OrganizationOnboarding", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("uuid") }] }], + default: ExpressionUtils.call("uuid") + }, + createdBy: { + name: "createdBy", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("CreatedOrganizationOnboardings") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("createdById")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "createdOrganizationOnboardings", name: "CreatedOrganizationOnboardings", fields: ["createdById"], references: ["id"], onDelete: "Cascade" } + }, + createdById: { + name: "createdById", + type: "Int", + foreignKeyFor: [ + "createdBy" + ] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + orgOwnerEmail: { + name: "orgOwnerEmail", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + error: { + name: "error", + type: "String", + optional: true + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + organizationId: { + name: "organizationId", + type: "Int", + unique: true, + optional: true, + attributes: [{ name: "@unique" }], + foreignKeyFor: [ + "organization" + ] + }, + organization: { + name: "organization", + type: "Team", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "organizationOnboarding", fields: ["organizationId"], references: ["id"], onDelete: "Cascade" } + }, + billingPeriod: { + name: "billingPeriod", + type: "BillingPeriod" + }, + pricePerSeat: { + name: "pricePerSeat", + type: "Float" + }, + seats: { + name: "seats", + type: "Int" + }, + isPlatform: { + name: "isPlatform", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + name: { + name: "name", + type: "String" + }, + slug: { + name: "slug", + type: "String" + }, + logo: { + name: "logo", + type: "String", + optional: true + }, + bio: { + name: "bio", + type: "String", + optional: true + }, + isDomainConfigured: { + name: "isDomainConfigured", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + stripeCustomerId: { + name: "stripeCustomerId", + type: "String", + unique: true, + optional: true, + attributes: [{ name: "@unique" }] + }, + stripeSubscriptionId: { + name: "stripeSubscriptionId", + type: "String", + optional: true + }, + stripeSubscriptionItemId: { + name: "stripeSubscriptionItemId", + type: "String", + optional: true + }, + invitedMembers: { + name: "invitedMembers", + type: "Json", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("[]") }] }], + default: "[]" + }, + teams: { + name: "teams", + type: "Json", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("[]") }] }], + default: "[]" + }, + isComplete: { + name: "isComplete", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("orgOwnerEmail")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("stripeCustomerId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + orgOwnerEmail: { type: "String" }, + organizationId: { type: "Int" }, + stripeCustomerId: { type: "String" } + } + }, + App_RoutingForms_IncompleteBookingActions: { + name: "App_RoutingForms_IncompleteBookingActions", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + form: { + name: "form", + type: "App_RoutingForms_Form", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("formId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "incompleteBookingActions", fields: ["formId"], references: ["id"], onDelete: "Cascade" } + }, + formId: { + name: "formId", + type: "String", + foreignKeyFor: [ + "form" + ] + }, + actionType: { + name: "actionType", + type: "IncompleteBookingActionType" + }, + data: { + name: "data", + type: "Json" + }, + enabled: { + name: "enabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(true) }] }], + default: true + }, + credentialId: { + name: "credentialId", + type: "Int", + optional: true + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + } + }, + InternalNotePreset: { + name: "InternalNotePreset", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + name: { + name: "name", + type: "String" + }, + cancellationReason: { + name: "cancellationReason", + type: "String", + optional: true + }, + team: { + name: "team", + type: "Team", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "internalNotePresets", fields: ["teamId"], references: ["id"] } + }, + teamId: { + name: "teamId", + type: "Int", + foreignKeyFor: [ + "team" + ] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + BookingInternalNote: { + name: "BookingInternalNote", + type: "BookingInternalNote", + array: true, + relation: { opposite: "notePreset" } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId"), ExpressionUtils.field("name")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + teamId_name: { teamId: { type: "Int" }, name: { type: "String" } } + } + }, + FilterSegment: { + name: "FilterSegment", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + name: { + name: "name", + type: "String" + }, + tableIdentifier: { + name: "tableIdentifier", + type: "String" + }, + scope: { + name: "scope", + type: "FilterSegmentScope" + }, + activeFilters: { + name: "activeFilters", + type: "Json", + optional: true + }, + sorting: { + name: "sorting", + type: "Json", + optional: true + }, + columnVisibility: { + name: "columnVisibility", + type: "Json", + optional: true + }, + columnSizing: { + name: "columnSizing", + type: "Json", + optional: true + }, + perPage: { + name: "perPage", + type: "Int" + }, + searchTerm: { + name: "searchTerm", + type: "String", + optional: true, + attributes: [{ name: "@db.Text" }] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + user: { + name: "user", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "filterSegments", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + userId: { + name: "userId", + type: "Int", + foreignKeyFor: [ + "user" + ] + }, + team: { + name: "team", + type: "Team", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "filterSegments", fields: ["teamId"], references: ["id"], onDelete: "Cascade" } + }, + teamId: { + name: "teamId", + type: "Int", + optional: true, + foreignKeyFor: [ + "team" + ] + }, + userPreferences: { + name: "userPreferences", + type: "UserFilterSegmentPreference", + array: true, + relation: { opposite: "segment" } + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("scope"), ExpressionUtils.field("userId"), ExpressionUtils.field("tableIdentifier")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("scope"), ExpressionUtils.field("teamId"), ExpressionUtils.field("tableIdentifier")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + } + }, + UserFilterSegmentPreference: { + name: "UserFilterSegmentPreference", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + userId: { + name: "userId", + type: "Int", + foreignKeyFor: [ + "user" + ] + }, + tableIdentifier: { + name: "tableIdentifier", + type: "String" + }, + segmentId: { + name: "segmentId", + type: "Int", + foreignKeyFor: [ + "segment" + ] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + user: { + name: "user", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "filterSegmentPreferences", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + segment: { + name: "segment", + type: "FilterSegment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("segmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "userPreferences", fields: ["segmentId"], references: ["id"], onDelete: "Cascade" } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId"), ExpressionUtils.field("tableIdentifier")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("segmentId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + userId_tableIdentifier: { userId: { type: "Int" }, tableIdentifier: { type: "String" } } + } + }, + BookingInternalNote: { + name: "BookingInternalNote", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + notePreset: { + name: "notePreset", + type: "InternalNotePreset", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("notePresetId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "BookingInternalNote", fields: ["notePresetId"], references: ["id"], onDelete: "Cascade" } + }, + notePresetId: { + name: "notePresetId", + type: "Int", + optional: true, + foreignKeyFor: [ + "notePreset" + ] + }, + text: { + name: "text", + type: "String", + optional: true + }, + booking: { + name: "booking", + type: "Booking", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("bookingId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "internalNote", fields: ["bookingId"], references: ["id"], onDelete: "Cascade" } + }, + bookingId: { + name: "bookingId", + type: "Int", + foreignKeyFor: [ + "booking" + ] + }, + createdBy: { + name: "createdBy", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("createdById")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "BookingInternalNote", fields: ["createdById"], references: ["id"] } + }, + createdById: { + name: "createdById", + type: "Int", + foreignKeyFor: [ + "createdBy" + ] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("bookingId"), ExpressionUtils.field("notePresetId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("bookingId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + bookingId_notePresetId: { bookingId: { type: "Int" }, notePresetId: { type: "Int" } } + } + }, + WorkflowOptOutContact: { + name: "WorkflowOptOutContact", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + type: { + name: "type", + type: "WorkflowContactType" + }, + value: { + name: "value", + type: "String" + }, + optedOut: { + name: "optedOut", + type: "Boolean" + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("type"), ExpressionUtils.field("value")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "Int" }, + type_value: { type: { type: "WorkflowContactType" }, value: { type: "String" } } + } + }, + Role: { + name: "Role", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + name: { + name: "name", + type: "String" + }, + description: { + name: "description", + type: "String", + optional: true + }, + teamId: { + name: "teamId", + type: "Int", + optional: true, + foreignKeyFor: [ + "team" + ] + }, + team: { + name: "team", + type: "Team", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "roles", fields: ["teamId"], references: ["id"], onDelete: "Cascade" } + }, + permissions: { + name: "permissions", + type: "RolePermission", + array: true, + relation: { opposite: "role" } + }, + memberships: { + name: "memberships", + type: "Membership", + array: true, + relation: { opposite: "customRole" } + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + type: { + name: "type", + type: "RoleType", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("CUSTOM") }] }], + default: "CUSTOM" + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("name"), ExpressionUtils.field("teamId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + name_teamId: { name: { type: "String" }, teamId: { type: "Int" } } + } + }, + RolePermission: { + name: "RolePermission", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + roleId: { + name: "roleId", + type: "String", + foreignKeyFor: [ + "role" + ] + }, + role: { + name: "role", + type: "Role", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("roleId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "permissions", fields: ["roleId"], references: ["id"], onDelete: "Cascade" } + }, + resource: { + name: "resource", + type: "String" + }, + action: { + name: "action", + type: "String" + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("roleId"), ExpressionUtils.field("resource"), ExpressionUtils.field("action")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("roleId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("action")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + roleId_resource_action: { roleId: { type: "String" }, resource: { type: "String" }, action: { type: "String" } } + } + } + } as const; + enums = { + SchedulingType: { + values: { + ROUND_ROBIN: "ROUND_ROBIN", + COLLECTIVE: "COLLECTIVE", + MANAGED: "MANAGED" + }, + fields: { + ROUND_ROBIN: { + name: "ROUND_ROBIN", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("roundRobin") }] } + ] + }, + COLLECTIVE: { + name: "COLLECTIVE", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("collective") }] } + ] + }, + MANAGED: { + name: "MANAGED", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("managed") }] } + ] + } + } + }, + PeriodType: { + values: { + UNLIMITED: "UNLIMITED", + ROLLING: "ROLLING", + ROLLING_WINDOW: "ROLLING_WINDOW", + RANGE: "RANGE" + }, + fields: { + UNLIMITED: { + name: "UNLIMITED", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("unlimited") }] } + ] + }, + ROLLING: { + name: "ROLLING", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("rolling") }] } + ] + }, + ROLLING_WINDOW: { + name: "ROLLING_WINDOW", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("rolling_window") }] } + ] + }, + RANGE: { + name: "RANGE", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("range") }] } + ] + } + } + }, + CreationSource: { + values: { + API_V1: "API_V1", + API_V2: "API_V2", + WEBAPP: "WEBAPP" + }, + fields: { + API_V1: { + name: "API_V1", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("api_v1") }] } + ] + }, + API_V2: { + name: "API_V2", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("api_v2") }] } + ] + }, + WEBAPP: { + name: "WEBAPP", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("webapp") }] } + ] + } + } + }, + IdentityProvider: { + values: { + CAL: "CAL", + GOOGLE: "GOOGLE", + SAML: "SAML" + } + }, + UserPermissionRole: { + values: { + USER: "USER", + ADMIN: "ADMIN" + } + }, + CreditType: { + values: { + MONTHLY: "MONTHLY", + ADDITIONAL: "ADDITIONAL" + } + }, + MembershipRole: { + values: { + MEMBER: "MEMBER", + ADMIN: "ADMIN", + OWNER: "OWNER" + } + }, + BookingStatus: { + values: { + CANCELLED: "CANCELLED", + ACCEPTED: "ACCEPTED", + REJECTED: "REJECTED", + PENDING: "PENDING", + AWAITING_HOST: "AWAITING_HOST" + }, + fields: { + CANCELLED: { + name: "CANCELLED", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("cancelled") }] } + ] + }, + ACCEPTED: { + name: "ACCEPTED", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("accepted") }] } + ] + }, + REJECTED: { + name: "REJECTED", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("rejected") }] } + ] + }, + PENDING: { + name: "PENDING", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("pending") }] } + ] + }, + AWAITING_HOST: { + name: "AWAITING_HOST", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("awaiting_host") }] } + ] + } + } + }, + EventTypeCustomInputType: { + values: { + TEXT: "TEXT", + TEXTLONG: "TEXTLONG", + NUMBER: "NUMBER", + BOOL: "BOOL", + RADIO: "RADIO", + PHONE: "PHONE" + }, + fields: { + TEXT: { + name: "TEXT", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("text") }] } + ] + }, + TEXTLONG: { + name: "TEXTLONG", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("textLong") }] } + ] + }, + NUMBER: { + name: "NUMBER", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("number") }] } + ] + }, + BOOL: { + name: "BOOL", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("bool") }] } + ] + }, + RADIO: { + name: "RADIO", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("radio") }] } + ] + }, + PHONE: { + name: "PHONE", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("phone") }] } + ] + } + } + }, + ReminderType: { + values: { + PENDING_BOOKING_CONFIRMATION: "PENDING_BOOKING_CONFIRMATION" + } + }, + PaymentOption: { + values: { + ON_BOOKING: "ON_BOOKING", + HOLD: "HOLD" + } + }, + WebhookTriggerEvents: { + values: { + BOOKING_CREATED: "BOOKING_CREATED", + BOOKING_PAYMENT_INITIATED: "BOOKING_PAYMENT_INITIATED", + BOOKING_PAID: "BOOKING_PAID", + BOOKING_RESCHEDULED: "BOOKING_RESCHEDULED", + BOOKING_REQUESTED: "BOOKING_REQUESTED", + BOOKING_CANCELLED: "BOOKING_CANCELLED", + BOOKING_REJECTED: "BOOKING_REJECTED", + BOOKING_NO_SHOW_UPDATED: "BOOKING_NO_SHOW_UPDATED", + FORM_SUBMITTED: "FORM_SUBMITTED", + MEETING_ENDED: "MEETING_ENDED", + MEETING_STARTED: "MEETING_STARTED", + RECORDING_READY: "RECORDING_READY", + INSTANT_MEETING: "INSTANT_MEETING", + RECORDING_TRANSCRIPTION_GENERATED: "RECORDING_TRANSCRIPTION_GENERATED", + OOO_CREATED: "OOO_CREATED", + AFTER_HOSTS_CAL_VIDEO_NO_SHOW: "AFTER_HOSTS_CAL_VIDEO_NO_SHOW", + AFTER_GUESTS_CAL_VIDEO_NO_SHOW: "AFTER_GUESTS_CAL_VIDEO_NO_SHOW", + FORM_SUBMITTED_NO_EVENT: "FORM_SUBMITTED_NO_EVENT" + } + }, + AppCategories: { + values: { + calendar: "calendar", + messaging: "messaging", + other: "other", + payment: "payment", + video: "video", + web3: "web3", + automation: "automation", + analytics: "analytics", + conferencing: "conferencing", + crm: "crm" + } + }, + WorkflowTriggerEvents: { + values: { + BEFORE_EVENT: "BEFORE_EVENT", + EVENT_CANCELLED: "EVENT_CANCELLED", + NEW_EVENT: "NEW_EVENT", + AFTER_EVENT: "AFTER_EVENT", + RESCHEDULE_EVENT: "RESCHEDULE_EVENT", + AFTER_HOSTS_CAL_VIDEO_NO_SHOW: "AFTER_HOSTS_CAL_VIDEO_NO_SHOW", + AFTER_GUESTS_CAL_VIDEO_NO_SHOW: "AFTER_GUESTS_CAL_VIDEO_NO_SHOW" + } + }, + WorkflowActions: { + values: { + EMAIL_HOST: "EMAIL_HOST", + EMAIL_ATTENDEE: "EMAIL_ATTENDEE", + SMS_ATTENDEE: "SMS_ATTENDEE", + SMS_NUMBER: "SMS_NUMBER", + EMAIL_ADDRESS: "EMAIL_ADDRESS", + WHATSAPP_ATTENDEE: "WHATSAPP_ATTENDEE", + WHATSAPP_NUMBER: "WHATSAPP_NUMBER" + } + }, + TimeUnit: { + values: { + DAY: "DAY", + HOUR: "HOUR", + MINUTE: "MINUTE" + }, + fields: { + DAY: { + name: "DAY", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("day") }] } + ] + }, + HOUR: { + name: "HOUR", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("hour") }] } + ] + }, + MINUTE: { + name: "MINUTE", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("minute") }] } + ] + } + } + }, + WorkflowTemplates: { + values: { + REMINDER: "REMINDER", + CUSTOM: "CUSTOM", + CANCELLED: "CANCELLED", + RESCHEDULED: "RESCHEDULED", + COMPLETED: "COMPLETED", + RATING: "RATING" + } + }, + WorkflowMethods: { + values: { + EMAIL: "EMAIL", + SMS: "SMS", + WHATSAPP: "WHATSAPP" + } + }, + FeatureType: { + values: { + RELEASE: "RELEASE", + EXPERIMENT: "EXPERIMENT", + OPERATIONAL: "OPERATIONAL", + KILL_SWITCH: "KILL_SWITCH", + PERMISSION: "PERMISSION" + } + }, + RRResetInterval: { + values: { + MONTH: "MONTH", + DAY: "DAY" + } + }, + RRTimestampBasis: { + values: { + CREATED_AT: "CREATED_AT", + START_TIME: "START_TIME" + } + }, + AccessScope: { + values: { + READ_BOOKING: "READ_BOOKING", + READ_PROFILE: "READ_PROFILE" + } + }, + RedirectType: { + values: { + UserEventType: "UserEventType", + TeamEventType: "TeamEventType", + User: "User", + Team: "Team" + }, + fields: { + UserEventType: { + name: "UserEventType", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("user-event-type") }] } + ] + }, + TeamEventType: { + name: "TeamEventType", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("team-event-type") }] } + ] + }, + User: { + name: "User", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("user") }] } + ] + }, + Team: { + name: "Team", + attributes: [ + { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("team") }] } + ] + } + } + }, + SMSLockState: { + values: { + LOCKED: "LOCKED", + UNLOCKED: "UNLOCKED", + REVIEW_NEEDED: "REVIEW_NEEDED" + } + }, + AttributeType: { + values: { + TEXT: "TEXT", + NUMBER: "NUMBER", + SINGLE_SELECT: "SINGLE_SELECT", + MULTI_SELECT: "MULTI_SELECT" + } + }, + AssignmentReasonEnum: { + values: { + ROUTING_FORM_ROUTING: "ROUTING_FORM_ROUTING", + ROUTING_FORM_ROUTING_FALLBACK: "ROUTING_FORM_ROUTING_FALLBACK", + REASSIGNED: "REASSIGNED", + RR_REASSIGNED: "RR_REASSIGNED", + REROUTED: "REROUTED", + SALESFORCE_ASSIGNMENT: "SALESFORCE_ASSIGNMENT" + } + }, + EventTypeAutoTranslatedField: { + values: { + DESCRIPTION: "DESCRIPTION", + TITLE: "TITLE" + } + }, + WatchlistType: { + values: { + EMAIL: "EMAIL", + DOMAIN: "DOMAIN", + USERNAME: "USERNAME" + } + }, + WatchlistSeverity: { + values: { + LOW: "LOW", + MEDIUM: "MEDIUM", + HIGH: "HIGH", + CRITICAL: "CRITICAL" + } + }, + BillingPeriod: { + values: { + MONTHLY: "MONTHLY", + ANNUALLY: "ANNUALLY" + } + }, + IncompleteBookingActionType: { + values: { + SALESFORCE: "SALESFORCE" + } + }, + FilterSegmentScope: { + values: { + USER: "USER", + TEAM: "TEAM" + } + }, + WorkflowContactType: { + values: { + PHONE: "PHONE", + EMAIL: "EMAIL" + } + }, + RoleType: { + values: { + SYSTEM: "SYSTEM", + CUSTOM: "CUSTOM" + } + } + } as const; + authType = "User" as const; + plugins = {}; +} +export const schema = new SchemaType(); diff --git a/tests/e2e/github-repos/formbricks/formbricks.test.ts b/tests/e2e/github-repos/formbricks/formbricks.test.ts deleted file mode 100644 index 60766a45a..000000000 --- a/tests/e2e/github-repos/formbricks/formbricks.test.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { generateTsSchema } from '@zenstackhq/testtools'; -import { describe, expect, it } from 'vitest'; -import fs from 'node:fs'; -import path from 'node:path'; - -describe('Formbricks e2e tests', () => { - it('has a working schema', async () => { - await expect( - generateTsSchema(fs.readFileSync(path.join(__dirname, 'schema.zmodel'), 'utf8'), 'postgresql'), - ).resolves.toBeTruthy(); - }); -}); diff --git a/tests/e2e/github-repos/formbricks/input.ts b/tests/e2e/github-repos/formbricks/input.ts new file mode 100644 index 000000000..b50d380e4 --- /dev/null +++ b/tests/e2e/github-repos/formbricks/input.ts @@ -0,0 +1,710 @@ +////////////////////////////////////////////////////////////////////////////////////////////// +// DO NOT MODIFY THIS FILE // +// This file is automatically generated by ZenStack CLI and should not be manually updated. // +////////////////////////////////////////////////////////////////////////////////////////////// + +/* eslint-disable */ + +import { type SchemaType as $Schema } from "./schema"; +import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, ClientOptions as $ClientOptions } from "@zenstackhq/orm"; +import type { SimplifiedModelResult as $SimplifiedModelResult, SelectIncludeOmit as $SelectIncludeOmit } from "@zenstackhq/orm"; +export type WebhookFindManyArgs = $FindManyArgs<$Schema, "Webhook">; +export type WebhookFindUniqueArgs = $FindUniqueArgs<$Schema, "Webhook">; +export type WebhookFindFirstArgs = $FindFirstArgs<$Schema, "Webhook">; +export type WebhookCreateArgs = $CreateArgs<$Schema, "Webhook">; +export type WebhookCreateManyArgs = $CreateManyArgs<$Schema, "Webhook">; +export type WebhookCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Webhook">; +export type WebhookUpdateArgs = $UpdateArgs<$Schema, "Webhook">; +export type WebhookUpdateManyArgs = $UpdateManyArgs<$Schema, "Webhook">; +export type WebhookUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Webhook">; +export type WebhookUpsertArgs = $UpsertArgs<$Schema, "Webhook">; +export type WebhookDeleteArgs = $DeleteArgs<$Schema, "Webhook">; +export type WebhookDeleteManyArgs = $DeleteManyArgs<$Schema, "Webhook">; +export type WebhookCountArgs = $CountArgs<$Schema, "Webhook">; +export type WebhookAggregateArgs = $AggregateArgs<$Schema, "Webhook">; +export type WebhookGroupByArgs = $GroupByArgs<$Schema, "Webhook">; +export type WebhookWhereInput = $WhereInput<$Schema, "Webhook">; +export type WebhookSelect = $SelectInput<$Schema, "Webhook">; +export type WebhookInclude = $IncludeInput<$Schema, "Webhook">; +export type WebhookOmit = $OmitInput<$Schema, "Webhook">; +export type WebhookGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Webhook", Options, Args>; +export type ContactAttributeFindManyArgs = $FindManyArgs<$Schema, "ContactAttribute">; +export type ContactAttributeFindUniqueArgs = $FindUniqueArgs<$Schema, "ContactAttribute">; +export type ContactAttributeFindFirstArgs = $FindFirstArgs<$Schema, "ContactAttribute">; +export type ContactAttributeCreateArgs = $CreateArgs<$Schema, "ContactAttribute">; +export type ContactAttributeCreateManyArgs = $CreateManyArgs<$Schema, "ContactAttribute">; +export type ContactAttributeCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "ContactAttribute">; +export type ContactAttributeUpdateArgs = $UpdateArgs<$Schema, "ContactAttribute">; +export type ContactAttributeUpdateManyArgs = $UpdateManyArgs<$Schema, "ContactAttribute">; +export type ContactAttributeUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "ContactAttribute">; +export type ContactAttributeUpsertArgs = $UpsertArgs<$Schema, "ContactAttribute">; +export type ContactAttributeDeleteArgs = $DeleteArgs<$Schema, "ContactAttribute">; +export type ContactAttributeDeleteManyArgs = $DeleteManyArgs<$Schema, "ContactAttribute">; +export type ContactAttributeCountArgs = $CountArgs<$Schema, "ContactAttribute">; +export type ContactAttributeAggregateArgs = $AggregateArgs<$Schema, "ContactAttribute">; +export type ContactAttributeGroupByArgs = $GroupByArgs<$Schema, "ContactAttribute">; +export type ContactAttributeWhereInput = $WhereInput<$Schema, "ContactAttribute">; +export type ContactAttributeSelect = $SelectInput<$Schema, "ContactAttribute">; +export type ContactAttributeInclude = $IncludeInput<$Schema, "ContactAttribute">; +export type ContactAttributeOmit = $OmitInput<$Schema, "ContactAttribute">; +export type ContactAttributeGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "ContactAttribute", Options, Args>; +export type ContactAttributeKeyFindManyArgs = $FindManyArgs<$Schema, "ContactAttributeKey">; +export type ContactAttributeKeyFindUniqueArgs = $FindUniqueArgs<$Schema, "ContactAttributeKey">; +export type ContactAttributeKeyFindFirstArgs = $FindFirstArgs<$Schema, "ContactAttributeKey">; +export type ContactAttributeKeyCreateArgs = $CreateArgs<$Schema, "ContactAttributeKey">; +export type ContactAttributeKeyCreateManyArgs = $CreateManyArgs<$Schema, "ContactAttributeKey">; +export type ContactAttributeKeyCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "ContactAttributeKey">; +export type ContactAttributeKeyUpdateArgs = $UpdateArgs<$Schema, "ContactAttributeKey">; +export type ContactAttributeKeyUpdateManyArgs = $UpdateManyArgs<$Schema, "ContactAttributeKey">; +export type ContactAttributeKeyUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "ContactAttributeKey">; +export type ContactAttributeKeyUpsertArgs = $UpsertArgs<$Schema, "ContactAttributeKey">; +export type ContactAttributeKeyDeleteArgs = $DeleteArgs<$Schema, "ContactAttributeKey">; +export type ContactAttributeKeyDeleteManyArgs = $DeleteManyArgs<$Schema, "ContactAttributeKey">; +export type ContactAttributeKeyCountArgs = $CountArgs<$Schema, "ContactAttributeKey">; +export type ContactAttributeKeyAggregateArgs = $AggregateArgs<$Schema, "ContactAttributeKey">; +export type ContactAttributeKeyGroupByArgs = $GroupByArgs<$Schema, "ContactAttributeKey">; +export type ContactAttributeKeyWhereInput = $WhereInput<$Schema, "ContactAttributeKey">; +export type ContactAttributeKeySelect = $SelectInput<$Schema, "ContactAttributeKey">; +export type ContactAttributeKeyInclude = $IncludeInput<$Schema, "ContactAttributeKey">; +export type ContactAttributeKeyOmit = $OmitInput<$Schema, "ContactAttributeKey">; +export type ContactAttributeKeyGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "ContactAttributeKey", Options, Args>; +export type ContactFindManyArgs = $FindManyArgs<$Schema, "Contact">; +export type ContactFindUniqueArgs = $FindUniqueArgs<$Schema, "Contact">; +export type ContactFindFirstArgs = $FindFirstArgs<$Schema, "Contact">; +export type ContactCreateArgs = $CreateArgs<$Schema, "Contact">; +export type ContactCreateManyArgs = $CreateManyArgs<$Schema, "Contact">; +export type ContactCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Contact">; +export type ContactUpdateArgs = $UpdateArgs<$Schema, "Contact">; +export type ContactUpdateManyArgs = $UpdateManyArgs<$Schema, "Contact">; +export type ContactUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Contact">; +export type ContactUpsertArgs = $UpsertArgs<$Schema, "Contact">; +export type ContactDeleteArgs = $DeleteArgs<$Schema, "Contact">; +export type ContactDeleteManyArgs = $DeleteManyArgs<$Schema, "Contact">; +export type ContactCountArgs = $CountArgs<$Schema, "Contact">; +export type ContactAggregateArgs = $AggregateArgs<$Schema, "Contact">; +export type ContactGroupByArgs = $GroupByArgs<$Schema, "Contact">; +export type ContactWhereInput = $WhereInput<$Schema, "Contact">; +export type ContactSelect = $SelectInput<$Schema, "Contact">; +export type ContactInclude = $IncludeInput<$Schema, "Contact">; +export type ContactOmit = $OmitInput<$Schema, "Contact">; +export type ContactGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Contact", Options, Args>; +export type ResponseFindManyArgs = $FindManyArgs<$Schema, "Response">; +export type ResponseFindUniqueArgs = $FindUniqueArgs<$Schema, "Response">; +export type ResponseFindFirstArgs = $FindFirstArgs<$Schema, "Response">; +export type ResponseCreateArgs = $CreateArgs<$Schema, "Response">; +export type ResponseCreateManyArgs = $CreateManyArgs<$Schema, "Response">; +export type ResponseCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Response">; +export type ResponseUpdateArgs = $UpdateArgs<$Schema, "Response">; +export type ResponseUpdateManyArgs = $UpdateManyArgs<$Schema, "Response">; +export type ResponseUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Response">; +export type ResponseUpsertArgs = $UpsertArgs<$Schema, "Response">; +export type ResponseDeleteArgs = $DeleteArgs<$Schema, "Response">; +export type ResponseDeleteManyArgs = $DeleteManyArgs<$Schema, "Response">; +export type ResponseCountArgs = $CountArgs<$Schema, "Response">; +export type ResponseAggregateArgs = $AggregateArgs<$Schema, "Response">; +export type ResponseGroupByArgs = $GroupByArgs<$Schema, "Response">; +export type ResponseWhereInput = $WhereInput<$Schema, "Response">; +export type ResponseSelect = $SelectInput<$Schema, "Response">; +export type ResponseInclude = $IncludeInput<$Schema, "Response">; +export type ResponseOmit = $OmitInput<$Schema, "Response">; +export type ResponseGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Response", Options, Args>; +export type ResponseNoteFindManyArgs = $FindManyArgs<$Schema, "ResponseNote">; +export type ResponseNoteFindUniqueArgs = $FindUniqueArgs<$Schema, "ResponseNote">; +export type ResponseNoteFindFirstArgs = $FindFirstArgs<$Schema, "ResponseNote">; +export type ResponseNoteCreateArgs = $CreateArgs<$Schema, "ResponseNote">; +export type ResponseNoteCreateManyArgs = $CreateManyArgs<$Schema, "ResponseNote">; +export type ResponseNoteCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "ResponseNote">; +export type ResponseNoteUpdateArgs = $UpdateArgs<$Schema, "ResponseNote">; +export type ResponseNoteUpdateManyArgs = $UpdateManyArgs<$Schema, "ResponseNote">; +export type ResponseNoteUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "ResponseNote">; +export type ResponseNoteUpsertArgs = $UpsertArgs<$Schema, "ResponseNote">; +export type ResponseNoteDeleteArgs = $DeleteArgs<$Schema, "ResponseNote">; +export type ResponseNoteDeleteManyArgs = $DeleteManyArgs<$Schema, "ResponseNote">; +export type ResponseNoteCountArgs = $CountArgs<$Schema, "ResponseNote">; +export type ResponseNoteAggregateArgs = $AggregateArgs<$Schema, "ResponseNote">; +export type ResponseNoteGroupByArgs = $GroupByArgs<$Schema, "ResponseNote">; +export type ResponseNoteWhereInput = $WhereInput<$Schema, "ResponseNote">; +export type ResponseNoteSelect = $SelectInput<$Schema, "ResponseNote">; +export type ResponseNoteInclude = $IncludeInput<$Schema, "ResponseNote">; +export type ResponseNoteOmit = $OmitInput<$Schema, "ResponseNote">; +export type ResponseNoteGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "ResponseNote", Options, Args>; +export type TagFindManyArgs = $FindManyArgs<$Schema, "Tag">; +export type TagFindUniqueArgs = $FindUniqueArgs<$Schema, "Tag">; +export type TagFindFirstArgs = $FindFirstArgs<$Schema, "Tag">; +export type TagCreateArgs = $CreateArgs<$Schema, "Tag">; +export type TagCreateManyArgs = $CreateManyArgs<$Schema, "Tag">; +export type TagCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Tag">; +export type TagUpdateArgs = $UpdateArgs<$Schema, "Tag">; +export type TagUpdateManyArgs = $UpdateManyArgs<$Schema, "Tag">; +export type TagUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Tag">; +export type TagUpsertArgs = $UpsertArgs<$Schema, "Tag">; +export type TagDeleteArgs = $DeleteArgs<$Schema, "Tag">; +export type TagDeleteManyArgs = $DeleteManyArgs<$Schema, "Tag">; +export type TagCountArgs = $CountArgs<$Schema, "Tag">; +export type TagAggregateArgs = $AggregateArgs<$Schema, "Tag">; +export type TagGroupByArgs = $GroupByArgs<$Schema, "Tag">; +export type TagWhereInput = $WhereInput<$Schema, "Tag">; +export type TagSelect = $SelectInput<$Schema, "Tag">; +export type TagInclude = $IncludeInput<$Schema, "Tag">; +export type TagOmit = $OmitInput<$Schema, "Tag">; +export type TagGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Tag", Options, Args>; +export type TagsOnResponsesFindManyArgs = $FindManyArgs<$Schema, "TagsOnResponses">; +export type TagsOnResponsesFindUniqueArgs = $FindUniqueArgs<$Schema, "TagsOnResponses">; +export type TagsOnResponsesFindFirstArgs = $FindFirstArgs<$Schema, "TagsOnResponses">; +export type TagsOnResponsesCreateArgs = $CreateArgs<$Schema, "TagsOnResponses">; +export type TagsOnResponsesCreateManyArgs = $CreateManyArgs<$Schema, "TagsOnResponses">; +export type TagsOnResponsesCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "TagsOnResponses">; +export type TagsOnResponsesUpdateArgs = $UpdateArgs<$Schema, "TagsOnResponses">; +export type TagsOnResponsesUpdateManyArgs = $UpdateManyArgs<$Schema, "TagsOnResponses">; +export type TagsOnResponsesUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "TagsOnResponses">; +export type TagsOnResponsesUpsertArgs = $UpsertArgs<$Schema, "TagsOnResponses">; +export type TagsOnResponsesDeleteArgs = $DeleteArgs<$Schema, "TagsOnResponses">; +export type TagsOnResponsesDeleteManyArgs = $DeleteManyArgs<$Schema, "TagsOnResponses">; +export type TagsOnResponsesCountArgs = $CountArgs<$Schema, "TagsOnResponses">; +export type TagsOnResponsesAggregateArgs = $AggregateArgs<$Schema, "TagsOnResponses">; +export type TagsOnResponsesGroupByArgs = $GroupByArgs<$Schema, "TagsOnResponses">; +export type TagsOnResponsesWhereInput = $WhereInput<$Schema, "TagsOnResponses">; +export type TagsOnResponsesSelect = $SelectInput<$Schema, "TagsOnResponses">; +export type TagsOnResponsesInclude = $IncludeInput<$Schema, "TagsOnResponses">; +export type TagsOnResponsesOmit = $OmitInput<$Schema, "TagsOnResponses">; +export type TagsOnResponsesGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "TagsOnResponses", Options, Args>; +export type DisplayFindManyArgs = $FindManyArgs<$Schema, "Display">; +export type DisplayFindUniqueArgs = $FindUniqueArgs<$Schema, "Display">; +export type DisplayFindFirstArgs = $FindFirstArgs<$Schema, "Display">; +export type DisplayCreateArgs = $CreateArgs<$Schema, "Display">; +export type DisplayCreateManyArgs = $CreateManyArgs<$Schema, "Display">; +export type DisplayCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Display">; +export type DisplayUpdateArgs = $UpdateArgs<$Schema, "Display">; +export type DisplayUpdateManyArgs = $UpdateManyArgs<$Schema, "Display">; +export type DisplayUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Display">; +export type DisplayUpsertArgs = $UpsertArgs<$Schema, "Display">; +export type DisplayDeleteArgs = $DeleteArgs<$Schema, "Display">; +export type DisplayDeleteManyArgs = $DeleteManyArgs<$Schema, "Display">; +export type DisplayCountArgs = $CountArgs<$Schema, "Display">; +export type DisplayAggregateArgs = $AggregateArgs<$Schema, "Display">; +export type DisplayGroupByArgs = $GroupByArgs<$Schema, "Display">; +export type DisplayWhereInput = $WhereInput<$Schema, "Display">; +export type DisplaySelect = $SelectInput<$Schema, "Display">; +export type DisplayInclude = $IncludeInput<$Schema, "Display">; +export type DisplayOmit = $OmitInput<$Schema, "Display">; +export type DisplayGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Display", Options, Args>; +export type SurveyTriggerFindManyArgs = $FindManyArgs<$Schema, "SurveyTrigger">; +export type SurveyTriggerFindUniqueArgs = $FindUniqueArgs<$Schema, "SurveyTrigger">; +export type SurveyTriggerFindFirstArgs = $FindFirstArgs<$Schema, "SurveyTrigger">; +export type SurveyTriggerCreateArgs = $CreateArgs<$Schema, "SurveyTrigger">; +export type SurveyTriggerCreateManyArgs = $CreateManyArgs<$Schema, "SurveyTrigger">; +export type SurveyTriggerCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "SurveyTrigger">; +export type SurveyTriggerUpdateArgs = $UpdateArgs<$Schema, "SurveyTrigger">; +export type SurveyTriggerUpdateManyArgs = $UpdateManyArgs<$Schema, "SurveyTrigger">; +export type SurveyTriggerUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "SurveyTrigger">; +export type SurveyTriggerUpsertArgs = $UpsertArgs<$Schema, "SurveyTrigger">; +export type SurveyTriggerDeleteArgs = $DeleteArgs<$Schema, "SurveyTrigger">; +export type SurveyTriggerDeleteManyArgs = $DeleteManyArgs<$Schema, "SurveyTrigger">; +export type SurveyTriggerCountArgs = $CountArgs<$Schema, "SurveyTrigger">; +export type SurveyTriggerAggregateArgs = $AggregateArgs<$Schema, "SurveyTrigger">; +export type SurveyTriggerGroupByArgs = $GroupByArgs<$Schema, "SurveyTrigger">; +export type SurveyTriggerWhereInput = $WhereInput<$Schema, "SurveyTrigger">; +export type SurveyTriggerSelect = $SelectInput<$Schema, "SurveyTrigger">; +export type SurveyTriggerInclude = $IncludeInput<$Schema, "SurveyTrigger">; +export type SurveyTriggerOmit = $OmitInput<$Schema, "SurveyTrigger">; +export type SurveyTriggerGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "SurveyTrigger", Options, Args>; +export type SurveyAttributeFilterFindManyArgs = $FindManyArgs<$Schema, "SurveyAttributeFilter">; +export type SurveyAttributeFilterFindUniqueArgs = $FindUniqueArgs<$Schema, "SurveyAttributeFilter">; +export type SurveyAttributeFilterFindFirstArgs = $FindFirstArgs<$Schema, "SurveyAttributeFilter">; +export type SurveyAttributeFilterCreateArgs = $CreateArgs<$Schema, "SurveyAttributeFilter">; +export type SurveyAttributeFilterCreateManyArgs = $CreateManyArgs<$Schema, "SurveyAttributeFilter">; +export type SurveyAttributeFilterCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "SurveyAttributeFilter">; +export type SurveyAttributeFilterUpdateArgs = $UpdateArgs<$Schema, "SurveyAttributeFilter">; +export type SurveyAttributeFilterUpdateManyArgs = $UpdateManyArgs<$Schema, "SurveyAttributeFilter">; +export type SurveyAttributeFilterUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "SurveyAttributeFilter">; +export type SurveyAttributeFilterUpsertArgs = $UpsertArgs<$Schema, "SurveyAttributeFilter">; +export type SurveyAttributeFilterDeleteArgs = $DeleteArgs<$Schema, "SurveyAttributeFilter">; +export type SurveyAttributeFilterDeleteManyArgs = $DeleteManyArgs<$Schema, "SurveyAttributeFilter">; +export type SurveyAttributeFilterCountArgs = $CountArgs<$Schema, "SurveyAttributeFilter">; +export type SurveyAttributeFilterAggregateArgs = $AggregateArgs<$Schema, "SurveyAttributeFilter">; +export type SurveyAttributeFilterGroupByArgs = $GroupByArgs<$Schema, "SurveyAttributeFilter">; +export type SurveyAttributeFilterWhereInput = $WhereInput<$Schema, "SurveyAttributeFilter">; +export type SurveyAttributeFilterSelect = $SelectInput<$Schema, "SurveyAttributeFilter">; +export type SurveyAttributeFilterInclude = $IncludeInput<$Schema, "SurveyAttributeFilter">; +export type SurveyAttributeFilterOmit = $OmitInput<$Schema, "SurveyAttributeFilter">; +export type SurveyAttributeFilterGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "SurveyAttributeFilter", Options, Args>; +export type SurveyFindManyArgs = $FindManyArgs<$Schema, "Survey">; +export type SurveyFindUniqueArgs = $FindUniqueArgs<$Schema, "Survey">; +export type SurveyFindFirstArgs = $FindFirstArgs<$Schema, "Survey">; +export type SurveyCreateArgs = $CreateArgs<$Schema, "Survey">; +export type SurveyCreateManyArgs = $CreateManyArgs<$Schema, "Survey">; +export type SurveyCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Survey">; +export type SurveyUpdateArgs = $UpdateArgs<$Schema, "Survey">; +export type SurveyUpdateManyArgs = $UpdateManyArgs<$Schema, "Survey">; +export type SurveyUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Survey">; +export type SurveyUpsertArgs = $UpsertArgs<$Schema, "Survey">; +export type SurveyDeleteArgs = $DeleteArgs<$Schema, "Survey">; +export type SurveyDeleteManyArgs = $DeleteManyArgs<$Schema, "Survey">; +export type SurveyCountArgs = $CountArgs<$Schema, "Survey">; +export type SurveyAggregateArgs = $AggregateArgs<$Schema, "Survey">; +export type SurveyGroupByArgs = $GroupByArgs<$Schema, "Survey">; +export type SurveyWhereInput = $WhereInput<$Schema, "Survey">; +export type SurveySelect = $SelectInput<$Schema, "Survey">; +export type SurveyInclude = $IncludeInput<$Schema, "Survey">; +export type SurveyOmit = $OmitInput<$Schema, "Survey">; +export type SurveyGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Survey", Options, Args>; +export type SurveyFollowUpFindManyArgs = $FindManyArgs<$Schema, "SurveyFollowUp">; +export type SurveyFollowUpFindUniqueArgs = $FindUniqueArgs<$Schema, "SurveyFollowUp">; +export type SurveyFollowUpFindFirstArgs = $FindFirstArgs<$Schema, "SurveyFollowUp">; +export type SurveyFollowUpCreateArgs = $CreateArgs<$Schema, "SurveyFollowUp">; +export type SurveyFollowUpCreateManyArgs = $CreateManyArgs<$Schema, "SurveyFollowUp">; +export type SurveyFollowUpCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "SurveyFollowUp">; +export type SurveyFollowUpUpdateArgs = $UpdateArgs<$Schema, "SurveyFollowUp">; +export type SurveyFollowUpUpdateManyArgs = $UpdateManyArgs<$Schema, "SurveyFollowUp">; +export type SurveyFollowUpUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "SurveyFollowUp">; +export type SurveyFollowUpUpsertArgs = $UpsertArgs<$Schema, "SurveyFollowUp">; +export type SurveyFollowUpDeleteArgs = $DeleteArgs<$Schema, "SurveyFollowUp">; +export type SurveyFollowUpDeleteManyArgs = $DeleteManyArgs<$Schema, "SurveyFollowUp">; +export type SurveyFollowUpCountArgs = $CountArgs<$Schema, "SurveyFollowUp">; +export type SurveyFollowUpAggregateArgs = $AggregateArgs<$Schema, "SurveyFollowUp">; +export type SurveyFollowUpGroupByArgs = $GroupByArgs<$Schema, "SurveyFollowUp">; +export type SurveyFollowUpWhereInput = $WhereInput<$Schema, "SurveyFollowUp">; +export type SurveyFollowUpSelect = $SelectInput<$Schema, "SurveyFollowUp">; +export type SurveyFollowUpInclude = $IncludeInput<$Schema, "SurveyFollowUp">; +export type SurveyFollowUpOmit = $OmitInput<$Schema, "SurveyFollowUp">; +export type SurveyFollowUpGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "SurveyFollowUp", Options, Args>; +export type ActionClassFindManyArgs = $FindManyArgs<$Schema, "ActionClass">; +export type ActionClassFindUniqueArgs = $FindUniqueArgs<$Schema, "ActionClass">; +export type ActionClassFindFirstArgs = $FindFirstArgs<$Schema, "ActionClass">; +export type ActionClassCreateArgs = $CreateArgs<$Schema, "ActionClass">; +export type ActionClassCreateManyArgs = $CreateManyArgs<$Schema, "ActionClass">; +export type ActionClassCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "ActionClass">; +export type ActionClassUpdateArgs = $UpdateArgs<$Schema, "ActionClass">; +export type ActionClassUpdateManyArgs = $UpdateManyArgs<$Schema, "ActionClass">; +export type ActionClassUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "ActionClass">; +export type ActionClassUpsertArgs = $UpsertArgs<$Schema, "ActionClass">; +export type ActionClassDeleteArgs = $DeleteArgs<$Schema, "ActionClass">; +export type ActionClassDeleteManyArgs = $DeleteManyArgs<$Schema, "ActionClass">; +export type ActionClassCountArgs = $CountArgs<$Schema, "ActionClass">; +export type ActionClassAggregateArgs = $AggregateArgs<$Schema, "ActionClass">; +export type ActionClassGroupByArgs = $GroupByArgs<$Schema, "ActionClass">; +export type ActionClassWhereInput = $WhereInput<$Schema, "ActionClass">; +export type ActionClassSelect = $SelectInput<$Schema, "ActionClass">; +export type ActionClassInclude = $IncludeInput<$Schema, "ActionClass">; +export type ActionClassOmit = $OmitInput<$Schema, "ActionClass">; +export type ActionClassGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "ActionClass", Options, Args>; +export type IntegrationFindManyArgs = $FindManyArgs<$Schema, "Integration">; +export type IntegrationFindUniqueArgs = $FindUniqueArgs<$Schema, "Integration">; +export type IntegrationFindFirstArgs = $FindFirstArgs<$Schema, "Integration">; +export type IntegrationCreateArgs = $CreateArgs<$Schema, "Integration">; +export type IntegrationCreateManyArgs = $CreateManyArgs<$Schema, "Integration">; +export type IntegrationCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Integration">; +export type IntegrationUpdateArgs = $UpdateArgs<$Schema, "Integration">; +export type IntegrationUpdateManyArgs = $UpdateManyArgs<$Schema, "Integration">; +export type IntegrationUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Integration">; +export type IntegrationUpsertArgs = $UpsertArgs<$Schema, "Integration">; +export type IntegrationDeleteArgs = $DeleteArgs<$Schema, "Integration">; +export type IntegrationDeleteManyArgs = $DeleteManyArgs<$Schema, "Integration">; +export type IntegrationCountArgs = $CountArgs<$Schema, "Integration">; +export type IntegrationAggregateArgs = $AggregateArgs<$Schema, "Integration">; +export type IntegrationGroupByArgs = $GroupByArgs<$Schema, "Integration">; +export type IntegrationWhereInput = $WhereInput<$Schema, "Integration">; +export type IntegrationSelect = $SelectInput<$Schema, "Integration">; +export type IntegrationInclude = $IncludeInput<$Schema, "Integration">; +export type IntegrationOmit = $OmitInput<$Schema, "Integration">; +export type IntegrationGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Integration", Options, Args>; +export type DataMigrationFindManyArgs = $FindManyArgs<$Schema, "DataMigration">; +export type DataMigrationFindUniqueArgs = $FindUniqueArgs<$Schema, "DataMigration">; +export type DataMigrationFindFirstArgs = $FindFirstArgs<$Schema, "DataMigration">; +export type DataMigrationCreateArgs = $CreateArgs<$Schema, "DataMigration">; +export type DataMigrationCreateManyArgs = $CreateManyArgs<$Schema, "DataMigration">; +export type DataMigrationCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "DataMigration">; +export type DataMigrationUpdateArgs = $UpdateArgs<$Schema, "DataMigration">; +export type DataMigrationUpdateManyArgs = $UpdateManyArgs<$Schema, "DataMigration">; +export type DataMigrationUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "DataMigration">; +export type DataMigrationUpsertArgs = $UpsertArgs<$Schema, "DataMigration">; +export type DataMigrationDeleteArgs = $DeleteArgs<$Schema, "DataMigration">; +export type DataMigrationDeleteManyArgs = $DeleteManyArgs<$Schema, "DataMigration">; +export type DataMigrationCountArgs = $CountArgs<$Schema, "DataMigration">; +export type DataMigrationAggregateArgs = $AggregateArgs<$Schema, "DataMigration">; +export type DataMigrationGroupByArgs = $GroupByArgs<$Schema, "DataMigration">; +export type DataMigrationWhereInput = $WhereInput<$Schema, "DataMigration">; +export type DataMigrationSelect = $SelectInput<$Schema, "DataMigration">; +export type DataMigrationInclude = $IncludeInput<$Schema, "DataMigration">; +export type DataMigrationOmit = $OmitInput<$Schema, "DataMigration">; +export type DataMigrationGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "DataMigration", Options, Args>; +export type EnvironmentFindManyArgs = $FindManyArgs<$Schema, "Environment">; +export type EnvironmentFindUniqueArgs = $FindUniqueArgs<$Schema, "Environment">; +export type EnvironmentFindFirstArgs = $FindFirstArgs<$Schema, "Environment">; +export type EnvironmentCreateArgs = $CreateArgs<$Schema, "Environment">; +export type EnvironmentCreateManyArgs = $CreateManyArgs<$Schema, "Environment">; +export type EnvironmentCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Environment">; +export type EnvironmentUpdateArgs = $UpdateArgs<$Schema, "Environment">; +export type EnvironmentUpdateManyArgs = $UpdateManyArgs<$Schema, "Environment">; +export type EnvironmentUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Environment">; +export type EnvironmentUpsertArgs = $UpsertArgs<$Schema, "Environment">; +export type EnvironmentDeleteArgs = $DeleteArgs<$Schema, "Environment">; +export type EnvironmentDeleteManyArgs = $DeleteManyArgs<$Schema, "Environment">; +export type EnvironmentCountArgs = $CountArgs<$Schema, "Environment">; +export type EnvironmentAggregateArgs = $AggregateArgs<$Schema, "Environment">; +export type EnvironmentGroupByArgs = $GroupByArgs<$Schema, "Environment">; +export type EnvironmentWhereInput = $WhereInput<$Schema, "Environment">; +export type EnvironmentSelect = $SelectInput<$Schema, "Environment">; +export type EnvironmentInclude = $IncludeInput<$Schema, "Environment">; +export type EnvironmentOmit = $OmitInput<$Schema, "Environment">; +export type EnvironmentGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Environment", Options, Args>; +export type ProjectFindManyArgs = $FindManyArgs<$Schema, "Project">; +export type ProjectFindUniqueArgs = $FindUniqueArgs<$Schema, "Project">; +export type ProjectFindFirstArgs = $FindFirstArgs<$Schema, "Project">; +export type ProjectCreateArgs = $CreateArgs<$Schema, "Project">; +export type ProjectCreateManyArgs = $CreateManyArgs<$Schema, "Project">; +export type ProjectCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Project">; +export type ProjectUpdateArgs = $UpdateArgs<$Schema, "Project">; +export type ProjectUpdateManyArgs = $UpdateManyArgs<$Schema, "Project">; +export type ProjectUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Project">; +export type ProjectUpsertArgs = $UpsertArgs<$Schema, "Project">; +export type ProjectDeleteArgs = $DeleteArgs<$Schema, "Project">; +export type ProjectDeleteManyArgs = $DeleteManyArgs<$Schema, "Project">; +export type ProjectCountArgs = $CountArgs<$Schema, "Project">; +export type ProjectAggregateArgs = $AggregateArgs<$Schema, "Project">; +export type ProjectGroupByArgs = $GroupByArgs<$Schema, "Project">; +export type ProjectWhereInput = $WhereInput<$Schema, "Project">; +export type ProjectSelect = $SelectInput<$Schema, "Project">; +export type ProjectInclude = $IncludeInput<$Schema, "Project">; +export type ProjectOmit = $OmitInput<$Schema, "Project">; +export type ProjectGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Project", Options, Args>; +export type OrganizationFindManyArgs = $FindManyArgs<$Schema, "Organization">; +export type OrganizationFindUniqueArgs = $FindUniqueArgs<$Schema, "Organization">; +export type OrganizationFindFirstArgs = $FindFirstArgs<$Schema, "Organization">; +export type OrganizationCreateArgs = $CreateArgs<$Schema, "Organization">; +export type OrganizationCreateManyArgs = $CreateManyArgs<$Schema, "Organization">; +export type OrganizationCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Organization">; +export type OrganizationUpdateArgs = $UpdateArgs<$Schema, "Organization">; +export type OrganizationUpdateManyArgs = $UpdateManyArgs<$Schema, "Organization">; +export type OrganizationUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Organization">; +export type OrganizationUpsertArgs = $UpsertArgs<$Schema, "Organization">; +export type OrganizationDeleteArgs = $DeleteArgs<$Schema, "Organization">; +export type OrganizationDeleteManyArgs = $DeleteManyArgs<$Schema, "Organization">; +export type OrganizationCountArgs = $CountArgs<$Schema, "Organization">; +export type OrganizationAggregateArgs = $AggregateArgs<$Schema, "Organization">; +export type OrganizationGroupByArgs = $GroupByArgs<$Schema, "Organization">; +export type OrganizationWhereInput = $WhereInput<$Schema, "Organization">; +export type OrganizationSelect = $SelectInput<$Schema, "Organization">; +export type OrganizationInclude = $IncludeInput<$Schema, "Organization">; +export type OrganizationOmit = $OmitInput<$Schema, "Organization">; +export type OrganizationGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Organization", Options, Args>; +export type MembershipFindManyArgs = $FindManyArgs<$Schema, "Membership">; +export type MembershipFindUniqueArgs = $FindUniqueArgs<$Schema, "Membership">; +export type MembershipFindFirstArgs = $FindFirstArgs<$Schema, "Membership">; +export type MembershipCreateArgs = $CreateArgs<$Schema, "Membership">; +export type MembershipCreateManyArgs = $CreateManyArgs<$Schema, "Membership">; +export type MembershipCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Membership">; +export type MembershipUpdateArgs = $UpdateArgs<$Schema, "Membership">; +export type MembershipUpdateManyArgs = $UpdateManyArgs<$Schema, "Membership">; +export type MembershipUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Membership">; +export type MembershipUpsertArgs = $UpsertArgs<$Schema, "Membership">; +export type MembershipDeleteArgs = $DeleteArgs<$Schema, "Membership">; +export type MembershipDeleteManyArgs = $DeleteManyArgs<$Schema, "Membership">; +export type MembershipCountArgs = $CountArgs<$Schema, "Membership">; +export type MembershipAggregateArgs = $AggregateArgs<$Schema, "Membership">; +export type MembershipGroupByArgs = $GroupByArgs<$Schema, "Membership">; +export type MembershipWhereInput = $WhereInput<$Schema, "Membership">; +export type MembershipSelect = $SelectInput<$Schema, "Membership">; +export type MembershipInclude = $IncludeInput<$Schema, "Membership">; +export type MembershipOmit = $OmitInput<$Schema, "Membership">; +export type MembershipGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Membership", Options, Args>; +export type InviteFindManyArgs = $FindManyArgs<$Schema, "Invite">; +export type InviteFindUniqueArgs = $FindUniqueArgs<$Schema, "Invite">; +export type InviteFindFirstArgs = $FindFirstArgs<$Schema, "Invite">; +export type InviteCreateArgs = $CreateArgs<$Schema, "Invite">; +export type InviteCreateManyArgs = $CreateManyArgs<$Schema, "Invite">; +export type InviteCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Invite">; +export type InviteUpdateArgs = $UpdateArgs<$Schema, "Invite">; +export type InviteUpdateManyArgs = $UpdateManyArgs<$Schema, "Invite">; +export type InviteUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Invite">; +export type InviteUpsertArgs = $UpsertArgs<$Schema, "Invite">; +export type InviteDeleteArgs = $DeleteArgs<$Schema, "Invite">; +export type InviteDeleteManyArgs = $DeleteManyArgs<$Schema, "Invite">; +export type InviteCountArgs = $CountArgs<$Schema, "Invite">; +export type InviteAggregateArgs = $AggregateArgs<$Schema, "Invite">; +export type InviteGroupByArgs = $GroupByArgs<$Schema, "Invite">; +export type InviteWhereInput = $WhereInput<$Schema, "Invite">; +export type InviteSelect = $SelectInput<$Schema, "Invite">; +export type InviteInclude = $IncludeInput<$Schema, "Invite">; +export type InviteOmit = $OmitInput<$Schema, "Invite">; +export type InviteGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Invite", Options, Args>; +export type ApiKeyFindManyArgs = $FindManyArgs<$Schema, "ApiKey">; +export type ApiKeyFindUniqueArgs = $FindUniqueArgs<$Schema, "ApiKey">; +export type ApiKeyFindFirstArgs = $FindFirstArgs<$Schema, "ApiKey">; +export type ApiKeyCreateArgs = $CreateArgs<$Schema, "ApiKey">; +export type ApiKeyCreateManyArgs = $CreateManyArgs<$Schema, "ApiKey">; +export type ApiKeyCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "ApiKey">; +export type ApiKeyUpdateArgs = $UpdateArgs<$Schema, "ApiKey">; +export type ApiKeyUpdateManyArgs = $UpdateManyArgs<$Schema, "ApiKey">; +export type ApiKeyUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "ApiKey">; +export type ApiKeyUpsertArgs = $UpsertArgs<$Schema, "ApiKey">; +export type ApiKeyDeleteArgs = $DeleteArgs<$Schema, "ApiKey">; +export type ApiKeyDeleteManyArgs = $DeleteManyArgs<$Schema, "ApiKey">; +export type ApiKeyCountArgs = $CountArgs<$Schema, "ApiKey">; +export type ApiKeyAggregateArgs = $AggregateArgs<$Schema, "ApiKey">; +export type ApiKeyGroupByArgs = $GroupByArgs<$Schema, "ApiKey">; +export type ApiKeyWhereInput = $WhereInput<$Schema, "ApiKey">; +export type ApiKeySelect = $SelectInput<$Schema, "ApiKey">; +export type ApiKeyInclude = $IncludeInput<$Schema, "ApiKey">; +export type ApiKeyOmit = $OmitInput<$Schema, "ApiKey">; +export type ApiKeyGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "ApiKey", Options, Args>; +export type ApiKeyEnvironmentFindManyArgs = $FindManyArgs<$Schema, "ApiKeyEnvironment">; +export type ApiKeyEnvironmentFindUniqueArgs = $FindUniqueArgs<$Schema, "ApiKeyEnvironment">; +export type ApiKeyEnvironmentFindFirstArgs = $FindFirstArgs<$Schema, "ApiKeyEnvironment">; +export type ApiKeyEnvironmentCreateArgs = $CreateArgs<$Schema, "ApiKeyEnvironment">; +export type ApiKeyEnvironmentCreateManyArgs = $CreateManyArgs<$Schema, "ApiKeyEnvironment">; +export type ApiKeyEnvironmentCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "ApiKeyEnvironment">; +export type ApiKeyEnvironmentUpdateArgs = $UpdateArgs<$Schema, "ApiKeyEnvironment">; +export type ApiKeyEnvironmentUpdateManyArgs = $UpdateManyArgs<$Schema, "ApiKeyEnvironment">; +export type ApiKeyEnvironmentUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "ApiKeyEnvironment">; +export type ApiKeyEnvironmentUpsertArgs = $UpsertArgs<$Schema, "ApiKeyEnvironment">; +export type ApiKeyEnvironmentDeleteArgs = $DeleteArgs<$Schema, "ApiKeyEnvironment">; +export type ApiKeyEnvironmentDeleteManyArgs = $DeleteManyArgs<$Schema, "ApiKeyEnvironment">; +export type ApiKeyEnvironmentCountArgs = $CountArgs<$Schema, "ApiKeyEnvironment">; +export type ApiKeyEnvironmentAggregateArgs = $AggregateArgs<$Schema, "ApiKeyEnvironment">; +export type ApiKeyEnvironmentGroupByArgs = $GroupByArgs<$Schema, "ApiKeyEnvironment">; +export type ApiKeyEnvironmentWhereInput = $WhereInput<$Schema, "ApiKeyEnvironment">; +export type ApiKeyEnvironmentSelect = $SelectInput<$Schema, "ApiKeyEnvironment">; +export type ApiKeyEnvironmentInclude = $IncludeInput<$Schema, "ApiKeyEnvironment">; +export type ApiKeyEnvironmentOmit = $OmitInput<$Schema, "ApiKeyEnvironment">; +export type ApiKeyEnvironmentGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "ApiKeyEnvironment", Options, Args>; +export type AccountFindManyArgs = $FindManyArgs<$Schema, "Account">; +export type AccountFindUniqueArgs = $FindUniqueArgs<$Schema, "Account">; +export type AccountFindFirstArgs = $FindFirstArgs<$Schema, "Account">; +export type AccountCreateArgs = $CreateArgs<$Schema, "Account">; +export type AccountCreateManyArgs = $CreateManyArgs<$Schema, "Account">; +export type AccountCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Account">; +export type AccountUpdateArgs = $UpdateArgs<$Schema, "Account">; +export type AccountUpdateManyArgs = $UpdateManyArgs<$Schema, "Account">; +export type AccountUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Account">; +export type AccountUpsertArgs = $UpsertArgs<$Schema, "Account">; +export type AccountDeleteArgs = $DeleteArgs<$Schema, "Account">; +export type AccountDeleteManyArgs = $DeleteManyArgs<$Schema, "Account">; +export type AccountCountArgs = $CountArgs<$Schema, "Account">; +export type AccountAggregateArgs = $AggregateArgs<$Schema, "Account">; +export type AccountGroupByArgs = $GroupByArgs<$Schema, "Account">; +export type AccountWhereInput = $WhereInput<$Schema, "Account">; +export type AccountSelect = $SelectInput<$Schema, "Account">; +export type AccountInclude = $IncludeInput<$Schema, "Account">; +export type AccountOmit = $OmitInput<$Schema, "Account">; +export type AccountGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Account", Options, Args>; +export type UserFindManyArgs = $FindManyArgs<$Schema, "User">; +export type UserFindUniqueArgs = $FindUniqueArgs<$Schema, "User">; +export type UserFindFirstArgs = $FindFirstArgs<$Schema, "User">; +export type UserCreateArgs = $CreateArgs<$Schema, "User">; +export type UserCreateManyArgs = $CreateManyArgs<$Schema, "User">; +export type UserCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "User">; +export type UserUpdateArgs = $UpdateArgs<$Schema, "User">; +export type UserUpdateManyArgs = $UpdateManyArgs<$Schema, "User">; +export type UserUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "User">; +export type UserUpsertArgs = $UpsertArgs<$Schema, "User">; +export type UserDeleteArgs = $DeleteArgs<$Schema, "User">; +export type UserDeleteManyArgs = $DeleteManyArgs<$Schema, "User">; +export type UserCountArgs = $CountArgs<$Schema, "User">; +export type UserAggregateArgs = $AggregateArgs<$Schema, "User">; +export type UserGroupByArgs = $GroupByArgs<$Schema, "User">; +export type UserWhereInput = $WhereInput<$Schema, "User">; +export type UserSelect = $SelectInput<$Schema, "User">; +export type UserInclude = $IncludeInput<$Schema, "User">; +export type UserOmit = $OmitInput<$Schema, "User">; +export type UserGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "User", Options, Args>; +export type ShortUrlFindManyArgs = $FindManyArgs<$Schema, "ShortUrl">; +export type ShortUrlFindUniqueArgs = $FindUniqueArgs<$Schema, "ShortUrl">; +export type ShortUrlFindFirstArgs = $FindFirstArgs<$Schema, "ShortUrl">; +export type ShortUrlCreateArgs = $CreateArgs<$Schema, "ShortUrl">; +export type ShortUrlCreateManyArgs = $CreateManyArgs<$Schema, "ShortUrl">; +export type ShortUrlCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "ShortUrl">; +export type ShortUrlUpdateArgs = $UpdateArgs<$Schema, "ShortUrl">; +export type ShortUrlUpdateManyArgs = $UpdateManyArgs<$Schema, "ShortUrl">; +export type ShortUrlUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "ShortUrl">; +export type ShortUrlUpsertArgs = $UpsertArgs<$Schema, "ShortUrl">; +export type ShortUrlDeleteArgs = $DeleteArgs<$Schema, "ShortUrl">; +export type ShortUrlDeleteManyArgs = $DeleteManyArgs<$Schema, "ShortUrl">; +export type ShortUrlCountArgs = $CountArgs<$Schema, "ShortUrl">; +export type ShortUrlAggregateArgs = $AggregateArgs<$Schema, "ShortUrl">; +export type ShortUrlGroupByArgs = $GroupByArgs<$Schema, "ShortUrl">; +export type ShortUrlWhereInput = $WhereInput<$Schema, "ShortUrl">; +export type ShortUrlSelect = $SelectInput<$Schema, "ShortUrl">; +export type ShortUrlInclude = $IncludeInput<$Schema, "ShortUrl">; +export type ShortUrlOmit = $OmitInput<$Schema, "ShortUrl">; +export type ShortUrlGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "ShortUrl", Options, Args>; +export type SegmentFindManyArgs = $FindManyArgs<$Schema, "Segment">; +export type SegmentFindUniqueArgs = $FindUniqueArgs<$Schema, "Segment">; +export type SegmentFindFirstArgs = $FindFirstArgs<$Schema, "Segment">; +export type SegmentCreateArgs = $CreateArgs<$Schema, "Segment">; +export type SegmentCreateManyArgs = $CreateManyArgs<$Schema, "Segment">; +export type SegmentCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Segment">; +export type SegmentUpdateArgs = $UpdateArgs<$Schema, "Segment">; +export type SegmentUpdateManyArgs = $UpdateManyArgs<$Schema, "Segment">; +export type SegmentUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Segment">; +export type SegmentUpsertArgs = $UpsertArgs<$Schema, "Segment">; +export type SegmentDeleteArgs = $DeleteArgs<$Schema, "Segment">; +export type SegmentDeleteManyArgs = $DeleteManyArgs<$Schema, "Segment">; +export type SegmentCountArgs = $CountArgs<$Schema, "Segment">; +export type SegmentAggregateArgs = $AggregateArgs<$Schema, "Segment">; +export type SegmentGroupByArgs = $GroupByArgs<$Schema, "Segment">; +export type SegmentWhereInput = $WhereInput<$Schema, "Segment">; +export type SegmentSelect = $SelectInput<$Schema, "Segment">; +export type SegmentInclude = $IncludeInput<$Schema, "Segment">; +export type SegmentOmit = $OmitInput<$Schema, "Segment">; +export type SegmentGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Segment", Options, Args>; +export type LanguageFindManyArgs = $FindManyArgs<$Schema, "Language">; +export type LanguageFindUniqueArgs = $FindUniqueArgs<$Schema, "Language">; +export type LanguageFindFirstArgs = $FindFirstArgs<$Schema, "Language">; +export type LanguageCreateArgs = $CreateArgs<$Schema, "Language">; +export type LanguageCreateManyArgs = $CreateManyArgs<$Schema, "Language">; +export type LanguageCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Language">; +export type LanguageUpdateArgs = $UpdateArgs<$Schema, "Language">; +export type LanguageUpdateManyArgs = $UpdateManyArgs<$Schema, "Language">; +export type LanguageUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Language">; +export type LanguageUpsertArgs = $UpsertArgs<$Schema, "Language">; +export type LanguageDeleteArgs = $DeleteArgs<$Schema, "Language">; +export type LanguageDeleteManyArgs = $DeleteManyArgs<$Schema, "Language">; +export type LanguageCountArgs = $CountArgs<$Schema, "Language">; +export type LanguageAggregateArgs = $AggregateArgs<$Schema, "Language">; +export type LanguageGroupByArgs = $GroupByArgs<$Schema, "Language">; +export type LanguageWhereInput = $WhereInput<$Schema, "Language">; +export type LanguageSelect = $SelectInput<$Schema, "Language">; +export type LanguageInclude = $IncludeInput<$Schema, "Language">; +export type LanguageOmit = $OmitInput<$Schema, "Language">; +export type LanguageGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Language", Options, Args>; +export type SurveyLanguageFindManyArgs = $FindManyArgs<$Schema, "SurveyLanguage">; +export type SurveyLanguageFindUniqueArgs = $FindUniqueArgs<$Schema, "SurveyLanguage">; +export type SurveyLanguageFindFirstArgs = $FindFirstArgs<$Schema, "SurveyLanguage">; +export type SurveyLanguageCreateArgs = $CreateArgs<$Schema, "SurveyLanguage">; +export type SurveyLanguageCreateManyArgs = $CreateManyArgs<$Schema, "SurveyLanguage">; +export type SurveyLanguageCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "SurveyLanguage">; +export type SurveyLanguageUpdateArgs = $UpdateArgs<$Schema, "SurveyLanguage">; +export type SurveyLanguageUpdateManyArgs = $UpdateManyArgs<$Schema, "SurveyLanguage">; +export type SurveyLanguageUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "SurveyLanguage">; +export type SurveyLanguageUpsertArgs = $UpsertArgs<$Schema, "SurveyLanguage">; +export type SurveyLanguageDeleteArgs = $DeleteArgs<$Schema, "SurveyLanguage">; +export type SurveyLanguageDeleteManyArgs = $DeleteManyArgs<$Schema, "SurveyLanguage">; +export type SurveyLanguageCountArgs = $CountArgs<$Schema, "SurveyLanguage">; +export type SurveyLanguageAggregateArgs = $AggregateArgs<$Schema, "SurveyLanguage">; +export type SurveyLanguageGroupByArgs = $GroupByArgs<$Schema, "SurveyLanguage">; +export type SurveyLanguageWhereInput = $WhereInput<$Schema, "SurveyLanguage">; +export type SurveyLanguageSelect = $SelectInput<$Schema, "SurveyLanguage">; +export type SurveyLanguageInclude = $IncludeInput<$Schema, "SurveyLanguage">; +export type SurveyLanguageOmit = $OmitInput<$Schema, "SurveyLanguage">; +export type SurveyLanguageGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "SurveyLanguage", Options, Args>; +export type InsightFindManyArgs = $FindManyArgs<$Schema, "Insight">; +export type InsightFindUniqueArgs = $FindUniqueArgs<$Schema, "Insight">; +export type InsightFindFirstArgs = $FindFirstArgs<$Schema, "Insight">; +export type InsightCreateArgs = $CreateArgs<$Schema, "Insight">; +export type InsightCreateManyArgs = $CreateManyArgs<$Schema, "Insight">; +export type InsightCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Insight">; +export type InsightUpdateArgs = $UpdateArgs<$Schema, "Insight">; +export type InsightUpdateManyArgs = $UpdateManyArgs<$Schema, "Insight">; +export type InsightUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Insight">; +export type InsightUpsertArgs = $UpsertArgs<$Schema, "Insight">; +export type InsightDeleteArgs = $DeleteArgs<$Schema, "Insight">; +export type InsightDeleteManyArgs = $DeleteManyArgs<$Schema, "Insight">; +export type InsightCountArgs = $CountArgs<$Schema, "Insight">; +export type InsightAggregateArgs = $AggregateArgs<$Schema, "Insight">; +export type InsightGroupByArgs = $GroupByArgs<$Schema, "Insight">; +export type InsightWhereInput = $WhereInput<$Schema, "Insight">; +export type InsightSelect = $SelectInput<$Schema, "Insight">; +export type InsightInclude = $IncludeInput<$Schema, "Insight">; +export type InsightOmit = $OmitInput<$Schema, "Insight">; +export type InsightGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Insight", Options, Args>; +export type DocumentInsightFindManyArgs = $FindManyArgs<$Schema, "DocumentInsight">; +export type DocumentInsightFindUniqueArgs = $FindUniqueArgs<$Schema, "DocumentInsight">; +export type DocumentInsightFindFirstArgs = $FindFirstArgs<$Schema, "DocumentInsight">; +export type DocumentInsightCreateArgs = $CreateArgs<$Schema, "DocumentInsight">; +export type DocumentInsightCreateManyArgs = $CreateManyArgs<$Schema, "DocumentInsight">; +export type DocumentInsightCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "DocumentInsight">; +export type DocumentInsightUpdateArgs = $UpdateArgs<$Schema, "DocumentInsight">; +export type DocumentInsightUpdateManyArgs = $UpdateManyArgs<$Schema, "DocumentInsight">; +export type DocumentInsightUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "DocumentInsight">; +export type DocumentInsightUpsertArgs = $UpsertArgs<$Schema, "DocumentInsight">; +export type DocumentInsightDeleteArgs = $DeleteArgs<$Schema, "DocumentInsight">; +export type DocumentInsightDeleteManyArgs = $DeleteManyArgs<$Schema, "DocumentInsight">; +export type DocumentInsightCountArgs = $CountArgs<$Schema, "DocumentInsight">; +export type DocumentInsightAggregateArgs = $AggregateArgs<$Schema, "DocumentInsight">; +export type DocumentInsightGroupByArgs = $GroupByArgs<$Schema, "DocumentInsight">; +export type DocumentInsightWhereInput = $WhereInput<$Schema, "DocumentInsight">; +export type DocumentInsightSelect = $SelectInput<$Schema, "DocumentInsight">; +export type DocumentInsightInclude = $IncludeInput<$Schema, "DocumentInsight">; +export type DocumentInsightOmit = $OmitInput<$Schema, "DocumentInsight">; +export type DocumentInsightGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "DocumentInsight", Options, Args>; +export type DocumentFindManyArgs = $FindManyArgs<$Schema, "Document">; +export type DocumentFindUniqueArgs = $FindUniqueArgs<$Schema, "Document">; +export type DocumentFindFirstArgs = $FindFirstArgs<$Schema, "Document">; +export type DocumentCreateArgs = $CreateArgs<$Schema, "Document">; +export type DocumentCreateManyArgs = $CreateManyArgs<$Schema, "Document">; +export type DocumentCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Document">; +export type DocumentUpdateArgs = $UpdateArgs<$Schema, "Document">; +export type DocumentUpdateManyArgs = $UpdateManyArgs<$Schema, "Document">; +export type DocumentUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Document">; +export type DocumentUpsertArgs = $UpsertArgs<$Schema, "Document">; +export type DocumentDeleteArgs = $DeleteArgs<$Schema, "Document">; +export type DocumentDeleteManyArgs = $DeleteManyArgs<$Schema, "Document">; +export type DocumentCountArgs = $CountArgs<$Schema, "Document">; +export type DocumentAggregateArgs = $AggregateArgs<$Schema, "Document">; +export type DocumentGroupByArgs = $GroupByArgs<$Schema, "Document">; +export type DocumentWhereInput = $WhereInput<$Schema, "Document">; +export type DocumentSelect = $SelectInput<$Schema, "Document">; +export type DocumentInclude = $IncludeInput<$Schema, "Document">; +export type DocumentOmit = $OmitInput<$Schema, "Document">; +export type DocumentGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Document", Options, Args>; +export type TeamFindManyArgs = $FindManyArgs<$Schema, "Team">; +export type TeamFindUniqueArgs = $FindUniqueArgs<$Schema, "Team">; +export type TeamFindFirstArgs = $FindFirstArgs<$Schema, "Team">; +export type TeamCreateArgs = $CreateArgs<$Schema, "Team">; +export type TeamCreateManyArgs = $CreateManyArgs<$Schema, "Team">; +export type TeamCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Team">; +export type TeamUpdateArgs = $UpdateArgs<$Schema, "Team">; +export type TeamUpdateManyArgs = $UpdateManyArgs<$Schema, "Team">; +export type TeamUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Team">; +export type TeamUpsertArgs = $UpsertArgs<$Schema, "Team">; +export type TeamDeleteArgs = $DeleteArgs<$Schema, "Team">; +export type TeamDeleteManyArgs = $DeleteManyArgs<$Schema, "Team">; +export type TeamCountArgs = $CountArgs<$Schema, "Team">; +export type TeamAggregateArgs = $AggregateArgs<$Schema, "Team">; +export type TeamGroupByArgs = $GroupByArgs<$Schema, "Team">; +export type TeamWhereInput = $WhereInput<$Schema, "Team">; +export type TeamSelect = $SelectInput<$Schema, "Team">; +export type TeamInclude = $IncludeInput<$Schema, "Team">; +export type TeamOmit = $OmitInput<$Schema, "Team">; +export type TeamGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Team", Options, Args>; +export type TeamUserFindManyArgs = $FindManyArgs<$Schema, "TeamUser">; +export type TeamUserFindUniqueArgs = $FindUniqueArgs<$Schema, "TeamUser">; +export type TeamUserFindFirstArgs = $FindFirstArgs<$Schema, "TeamUser">; +export type TeamUserCreateArgs = $CreateArgs<$Schema, "TeamUser">; +export type TeamUserCreateManyArgs = $CreateManyArgs<$Schema, "TeamUser">; +export type TeamUserCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "TeamUser">; +export type TeamUserUpdateArgs = $UpdateArgs<$Schema, "TeamUser">; +export type TeamUserUpdateManyArgs = $UpdateManyArgs<$Schema, "TeamUser">; +export type TeamUserUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "TeamUser">; +export type TeamUserUpsertArgs = $UpsertArgs<$Schema, "TeamUser">; +export type TeamUserDeleteArgs = $DeleteArgs<$Schema, "TeamUser">; +export type TeamUserDeleteManyArgs = $DeleteManyArgs<$Schema, "TeamUser">; +export type TeamUserCountArgs = $CountArgs<$Schema, "TeamUser">; +export type TeamUserAggregateArgs = $AggregateArgs<$Schema, "TeamUser">; +export type TeamUserGroupByArgs = $GroupByArgs<$Schema, "TeamUser">; +export type TeamUserWhereInput = $WhereInput<$Schema, "TeamUser">; +export type TeamUserSelect = $SelectInput<$Schema, "TeamUser">; +export type TeamUserInclude = $IncludeInput<$Schema, "TeamUser">; +export type TeamUserOmit = $OmitInput<$Schema, "TeamUser">; +export type TeamUserGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "TeamUser", Options, Args>; +export type ProjectTeamFindManyArgs = $FindManyArgs<$Schema, "ProjectTeam">; +export type ProjectTeamFindUniqueArgs = $FindUniqueArgs<$Schema, "ProjectTeam">; +export type ProjectTeamFindFirstArgs = $FindFirstArgs<$Schema, "ProjectTeam">; +export type ProjectTeamCreateArgs = $CreateArgs<$Schema, "ProjectTeam">; +export type ProjectTeamCreateManyArgs = $CreateManyArgs<$Schema, "ProjectTeam">; +export type ProjectTeamCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "ProjectTeam">; +export type ProjectTeamUpdateArgs = $UpdateArgs<$Schema, "ProjectTeam">; +export type ProjectTeamUpdateManyArgs = $UpdateManyArgs<$Schema, "ProjectTeam">; +export type ProjectTeamUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "ProjectTeam">; +export type ProjectTeamUpsertArgs = $UpsertArgs<$Schema, "ProjectTeam">; +export type ProjectTeamDeleteArgs = $DeleteArgs<$Schema, "ProjectTeam">; +export type ProjectTeamDeleteManyArgs = $DeleteManyArgs<$Schema, "ProjectTeam">; +export type ProjectTeamCountArgs = $CountArgs<$Schema, "ProjectTeam">; +export type ProjectTeamAggregateArgs = $AggregateArgs<$Schema, "ProjectTeam">; +export type ProjectTeamGroupByArgs = $GroupByArgs<$Schema, "ProjectTeam">; +export type ProjectTeamWhereInput = $WhereInput<$Schema, "ProjectTeam">; +export type ProjectTeamSelect = $SelectInput<$Schema, "ProjectTeam">; +export type ProjectTeamInclude = $IncludeInput<$Schema, "ProjectTeam">; +export type ProjectTeamOmit = $OmitInput<$Schema, "ProjectTeam">; +export type ProjectTeamGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "ProjectTeam", Options, Args>; diff --git a/tests/e2e/github-repos/formbricks/models.ts b/tests/e2e/github-repos/formbricks/models.ts new file mode 100644 index 000000000..4c57997cf --- /dev/null +++ b/tests/e2e/github-repos/formbricks/models.ts @@ -0,0 +1,468 @@ +////////////////////////////////////////////////////////////////////////////////////////////// +// DO NOT MODIFY THIS FILE // +// This file is automatically generated by ZenStack CLI and should not be manually updated. // +////////////////////////////////////////////////////////////////////////////////////////////// + +/* eslint-disable */ + +import { schema as $schema, type SchemaType as $Schema } from "./schema"; +import { type ModelResult as $ModelResult } from "@zenstackhq/orm"; +/** + * Represents a webhook endpoint for receiving survey-related events. + * Webhooks can be configured to receive notifications about response creation, updates, and completion. + * + * @property id - Unique identifier for the webhook + * @property name - Optional display name for the webhook + * @property url - The endpoint URL where events will be sent + * @property source - Origin of the webhook (user, zapier, make, etc.) + * @property environment - Associated environment + * @property triggers - Types of events that trigger this webhook + * @property surveyIds - List of surveys this webhook is monitoring + */ +export type Webhook = $ModelResult<$Schema, "Webhook">; +/** + * Represents an attribute value associated with a contact. + * Used to store custom properties and characteristics of contacts. + * + * @property id - Unique identifier for the attribute + * @property attributeKey - Reference to the attribute definition + * @property contact - The contact this attribute belongs to + * @property value - The actual value of the attribute + */ +export type ContactAttribute = $ModelResult<$Schema, "ContactAttribute">; +/** + * Defines the possible attributes that can be assigned to contacts. + * Acts as a schema for contact attributes within an environment. + * + * @property id - Unique identifier for the attribute key + * @property isUnique - Whether the attribute must have unique values across contacts + * @property key - The attribute identifier used in the system + * @property name - Display name for the attribute + * @property type - Whether this is a default or custom attribute + * @property environment - The environment this attribute belongs to + */ +export type ContactAttributeKey = $ModelResult<$Schema, "ContactAttributeKey">; +/** + * Represents a person or user who can receive and respond to surveys. + * Contacts are environment-specific and can have multiple attributes and responses. + * + * @property id - Unique identifier for the contact + * @property userId - Optional external user identifier + * @property environment - The environment this contact belongs to + * @property responses - Survey responses from this contact + * @property attributes - Custom attributes associated with this contact + * @property displays - Record of surveys shown to this contact + */ +export type Contact = $ModelResult<$Schema, "Contact">; +/** + * Stores a user's response to a survey, including their answers and metadata. + * Each response is linked to a specific survey and optionally to a contact. + * + * @property id - Unique identifier for the response + * @property finished - Whether the survey was completed + * @property survey - The associated survey + * @property contact - The optional contact who provided the response + * @property data - JSON object containing the actual response data + * @property variables - Custom variables used in the response + * @property ttc - Time to completion metrics + * @property meta - Additional metadata about the response + */ +export type Response = $ModelResult<$Schema, "Response">; +/** + * Represents notes or comments added to survey responses by team members. + * Used for internal communication and response analysis. + * + * @property id - Unique identifier for the note + * @property response - The associated survey response + * @property user - The team member who created the note + * @property text - Content of the note + * @property isResolved - Whether the note has been marked as resolved + * @property isEdited - Whether the note has been modified + */ +export type ResponseNote = $ModelResult<$Schema, "ResponseNote">; +/** + * Represents a label that can be applied to survey responses. + * Used for categorizing and organizing responses within an environment. + * + * @property id - Unique identifier for the tag + * @property name - Display name of the tag + * @property responses - Survey responses tagged with this label + * @property environment - The environment this tag belongs to + */ +export type Tag = $ModelResult<$Schema, "Tag">; +/** + * Junction table linking tags to responses. + * Enables many-to-many relationship between tags and responses. + * + * @property response - The tagged response + * @property tag - The tag applied to the response + */ +export type TagsOnResponses = $ModelResult<$Schema, "TagsOnResponses">; +/** + * Records when a survey is shown to a user. + * Tracks survey display history and response status. + * + * @property id - Unique identifier for the display event + * @property survey - The survey that was displayed + * @property contact - The contact who saw the survey + * @property status - Whether the survey was just seen or responded to + * @property response - The associated response if one exists + */ +export type Display = $ModelResult<$Schema, "Display">; +/** + * Links surveys to specific trigger actions. + * Defines which user actions should cause a survey to be displayed. + * This is the connection table between Surveys and ActionClasses that determines + * when and under what conditions a survey should be triggered. + * + * @property id - Unique identifier for the trigger + * @property survey - The survey to be triggered + * @property actionClass - The action that triggers the survey + * @property createdAt - When the trigger was created + * @property updatedAt - When the trigger was last modified + */ +export type SurveyTrigger = $ModelResult<$Schema, "SurveyTrigger">; +/** + * Defines targeting rules for surveys based on contact attributes. + * Used to show surveys only to contacts matching specific criteria. + * + * @property id - Unique identifier for the filter + * @property attributeKey - The contact attribute to filter on + * @property survey - The survey being filtered + * @property condition - The comparison operator to use + * @property value - The value to compare against + */ +export type SurveyAttributeFilter = $ModelResult<$Schema, "SurveyAttributeFilter">; +/** + * Represents a complete survey configuration including questions, styling, and display rules. + * Core model for the survey functionality in Formbricks. + * + * @property id - Unique identifier for the survey + * @property name - Display name of the survey + * @property type - Survey delivery method (link, web, website, app) + * @property status - Current state of the survey (draft, active, completed, etc) + * @property environment - The environment this survey belongs to + * @property questions - JSON array containing survey questions configuration + * @property displayOption - Rules for how often the survey can be shown + * @property triggers - Actions that can trigger this survey + * @property attributeFilters - Rules for targeting specific contacts + */ +export type Survey = $ModelResult<$Schema, "Survey">; +/** + * Defines follow-up actions for survey responses. + * Enables automated actions based on specific survey response conditions. + * + * @property id - Unique identifier for the follow-up + * @property survey - The associated survey + * @property name - Display name for the follow-up + * @property trigger - Conditions that activate the follow-up + * @property action - Actions to take when triggered + */ +export type SurveyFollowUp = $ModelResult<$Schema, "SurveyFollowUp">; +/** + * Represents a user action that can trigger surveys. + * Used to define points in the user journey where surveys can be shown. + * + * @property id - Unique identifier for the action + * @property name - Display name of the action + * @property type - Whether this is a code or no-code action + * @property key - Unique identifier used in code implementation + * @property noCodeConfig - Configuration for no-code setup + * @property environment - The environment this action belongs to + */ +export type ActionClass = $ModelResult<$Schema, "ActionClass">; +/** + * Represents third-party service integrations. + * Enables data flow between Formbricks and external services. + * + * @property id - Unique identifier for the integration + * @property type - The service being integrated (Google Sheets, Notion, etc.) + * @property environment - The environment this integration belongs to + * @property config - Service-specific configuration details + */ +export type Integration = $ModelResult<$Schema, "Integration">; +/** + * Tracks database schema migrations. + * Used to manage and track the state of data structure changes. + * + * @property id - Unique identifier for the migration + * @property name - Name of the migration + * @property status - Current state of the migration (pending, applied, failed) + * @property startedAt - When the migration began + * @property finishedAt - When the migration completed + */ +export type DataMigration = $ModelResult<$Schema, "DataMigration">; +/** + * Represents either a production or development environment within a project. + * Each project has exactly two environments, serving as the main reference point + * for most Formbricks resources including surveys and actions. + * + * @property id - Unique identifier for the environment + * @property type - Either 'production' or 'development' + * @property project - Reference to parent project + * @property widgetSetupCompleted - Tracks initial widget setup status + * @property surveys - Collection of surveys in this environment + * @property contacts - Collection of contacts/users tracked + * @property actionClasses - Defined actions that can trigger surveys + * @property attributeKeys - Custom attributes configuration + */ +export type Environment = $ModelResult<$Schema, "Environment">; +/** + * Main grouping mechanism for resources in Formbricks. + * Each organization can have multiple projects to separate different applications or products. + * + * @property id - Unique identifier for the project + * @property name - Display name of the project + * @property organization - Reference to parent organization + * @property environments - Development and production environments + * @property styling - Project-wide styling configuration + * @property config - Project-specific configuration + * @property recontactDays - Default recontact delay for surveys + * @property placement - Default widget placement for in-app surveys + */ +export type Project = $ModelResult<$Schema, "Project">; +/** + * Represents the top-level organizational hierarchy in Formbricks. + * Self-hosting instances typically have a single organization, while Formbricks Cloud + * supports multiple organizations with multi-tenancy. + * + * @property id - Unique identifier for the organization + * @property name - Display name of the organization + * @property memberships - User memberships within the organization + * @property projects - Collection of projects owned by the organization + * @property billing - JSON field containing billing information + * @property whitelabel - Whitelabel configuration for the organization + * @property isAIEnabled - Controls access to AI-powered features + */ +export type Organization = $ModelResult<$Schema, "Organization">; +/** + * Links users to organizations with specific roles. + * Manages organization membership and permissions. + * Core model for managing user access within organizations. + * + * @property organization - The organization the user belongs to + * @property user - The member user + * @property accepted - Whether the user has accepted the membership + * @property role - User's role within the organization (owner, manager, member, billing) + */ +export type Membership = $ModelResult<$Schema, "Membership">; +/** + * Represents pending invitations to join an organization. + * Used to manage the process of adding new users to an organization. + * Once accepted, invites are converted into memberships. + * + * @property id - Unique identifier for the invite + * @property email - Email address of the invited user + * @property name - Optional display name for the invited user + * @property organization - The organization sending the invite + * @property creator - The user who created the invite + * @property acceptor - The user who accepted the invite (if accepted) + * @property expiresAt - When the invite becomes invalid + * @property role - Intended role for the invited user + * @property teamIds - Teams the user will be added to upon acceptance + */ +export type Invite = $ModelResult<$Schema, "Invite">; +/** + * Represents enhanced API authentication keys with organization-level ownership. + * Used for authenticating API requests to Formbricks with more granular permissions. + * + * @property id - Unique identifier for the API key + * @property label - Optional descriptive name for the key + * @property hashedKey - Securely stored API key + * @property organization - The organization this key belongs to + * @property createdBy - User ID who created this key + * @property lastUsedAt - Timestamp of last usage + * @property apiKeyEnvironments - Environments this key has access to + */ +export type ApiKey = $ModelResult<$Schema, "ApiKey">; +/** + * Links API keys to environments with specific permissions. + * Enables granular access control for API keys across environments. + * + * @property id - Unique identifier for the environment access entry + * @property apiKey - The associated API key + * @property environment - The environment being accessed + * @property permission - Level of access granted + */ +export type ApiKeyEnvironment = $ModelResult<$Schema, "ApiKeyEnvironment">; +/** + * Stores third-party authentication account information. + * Enables OAuth and other external authentication methods. + * + * @property id - Unique identifier for the account + * @property user - The Formbricks user who owns this account + * @property provider - The authentication provider (GitHub, Google, etc.) + * @property providerAccountId - User ID from the provider + * @property access_token - OAuth access token + * @property refresh_token - OAuth refresh token + */ +export type Account = $ModelResult<$Schema, "Account">; +/** + * Represents a user in the Formbricks system. + * Central model for user authentication and profile management. + * + * @property id - Unique identifier for the user + * @property name - Display name of the user + * @property email - User's email address + * @property role - User's professional role + * @property objective - User's main goal with Formbricks + * @property twoFactorEnabled - Whether 2FA is active + * @property memberships - Organizations the user belongs to + * @property notificationSettings - User's notification preferences + */ +export type User = $ModelResult<$Schema, "User">; +/** + * Maps a short URL to its full destination. + * Used for creating memorable, shortened URLs for surveys. + * + * @property id - Short identifier/slug for the URL + * @property url - The full destination URL + */ +export type ShortUrl = $ModelResult<$Schema, "ShortUrl">; +/** + * Defines a segment of contacts based on attributes. + * Used for targeting surveys to specific user groups. + * + * @property id - Unique identifier for the segment + * @property title - Display name of the segment + * @property filters - Rules defining the segment + * @property isPrivate - Whether the segment is private + * @property environment - The environment this segment belongs to + */ +export type Segment = $ModelResult<$Schema, "Segment">; +/** + * Represents a supported language in the system. + * Used for multilingual survey support. + * + * @property id - Unique identifier for the language + * @property code - Language code (e.g., 'en-US') + * @property alias - Optional friendly name + * @property project - The project this language is enabled for + */ +export type Language = $ModelResult<$Schema, "Language">; +/** + * Links surveys to their supported languages. + * Manages which languages are available for each survey. + * + * @property language - The supported language + * @property survey - The associated survey + * @property default - Whether this is the default language + * @property enabled - Whether this language is currently active + */ +export type SurveyLanguage = $ModelResult<$Schema, "SurveyLanguage">; +/** + * Stores analyzed insights from survey responses. + * Used for tracking patterns and extracting meaningful information. + * + * @property id - Unique identifier for the insight + * @property category - Type of insight (feature request, complaint, etc.) + * @property title - Summary of the insight + * @property description - Detailed explanation + * @property vector - Embedding vector for similarity search + */ +export type Insight = $ModelResult<$Schema, "Insight">; +/** + * Links insights to source documents. + * Enables tracing insights back to original responses. + * + * @property document - The source document + * @property insight - The derived insight + */ +export type DocumentInsight = $ModelResult<$Schema, "DocumentInsight">; +/** + * Represents a processed text document from survey responses. + * Used for analysis and insight generation. + * + * @property id - Unique identifier for the document + * @property survey - The associated survey + * @property response - The source response + * @property sentiment - Analyzed sentiment (positive, negative, neutral) + * @property text - The document content + * @property vector - Embedding vector for similarity search + */ +export type Document = $ModelResult<$Schema, "Document">; +/** + * Represents a team within an organization. + * Enables group-based access control and collaboration. + * + * @property id - Unique identifier for the team + * @property name - Display name of the team + * @property organization - The parent organization + * @property teamUsers - Users who are part of this team + * @property projectTeams - Projects this team has access to + */ +export type Team = $ModelResult<$Schema, "Team">; +/** + * Links users to teams with specific roles. + * Manages team membership and permissions. + * + * @property team - The associated team + * @property user - The team member + * @property role - User's role within the team + */ +export type TeamUser = $ModelResult<$Schema, "TeamUser">; +/** + * Defines team access to specific projects. + * Manages project-level permissions for teams. + * + * @property project - The accessed project + * @property team - The team receiving access + * @property permission - Level of access granted + */ +export type ProjectTeam = $ModelResult<$Schema, "ProjectTeam">; +export const PipelineTriggers = $schema.enums.PipelineTriggers.values; +export type PipelineTriggers = (typeof PipelineTriggers)[keyof typeof PipelineTriggers]; +export const WebhookSource = $schema.enums.WebhookSource.values; +export type WebhookSource = (typeof WebhookSource)[keyof typeof WebhookSource]; +export const ContactAttributeType = $schema.enums.ContactAttributeType.values; +export type ContactAttributeType = (typeof ContactAttributeType)[keyof typeof ContactAttributeType]; +export const SurveyStatus = $schema.enums.SurveyStatus.values; +export type SurveyStatus = (typeof SurveyStatus)[keyof typeof SurveyStatus]; +export const DisplayStatus = $schema.enums.DisplayStatus.values; +export type DisplayStatus = (typeof DisplayStatus)[keyof typeof DisplayStatus]; +export const SurveyAttributeFilterCondition = $schema.enums.SurveyAttributeFilterCondition.values; +export type SurveyAttributeFilterCondition = (typeof SurveyAttributeFilterCondition)[keyof typeof SurveyAttributeFilterCondition]; +export const SurveyType = $schema.enums.SurveyType.values; +export type SurveyType = (typeof SurveyType)[keyof typeof SurveyType]; +export const displayOptions = $schema.enums.displayOptions.values; +export type displayOptions = (typeof displayOptions)[keyof typeof displayOptions]; +export const ActionType = $schema.enums.ActionType.values; +export type ActionType = (typeof ActionType)[keyof typeof ActionType]; +export const EnvironmentType = $schema.enums.EnvironmentType.values; +export type EnvironmentType = (typeof EnvironmentType)[keyof typeof EnvironmentType]; +export const IntegrationType = $schema.enums.IntegrationType.values; +export type IntegrationType = (typeof IntegrationType)[keyof typeof IntegrationType]; +export const DataMigrationStatus = $schema.enums.DataMigrationStatus.values; +export type DataMigrationStatus = (typeof DataMigrationStatus)[keyof typeof DataMigrationStatus]; +export const WidgetPlacement = $schema.enums.WidgetPlacement.values; +export type WidgetPlacement = (typeof WidgetPlacement)[keyof typeof WidgetPlacement]; +export const OrganizationRole = $schema.enums.OrganizationRole.values; +export type OrganizationRole = (typeof OrganizationRole)[keyof typeof OrganizationRole]; +export const MembershipRole = $schema.enums.MembershipRole.values; +export type MembershipRole = (typeof MembershipRole)[keyof typeof MembershipRole]; +/** + * Defines permission levels for API keys. + * Controls what operations an API key can perform. + */ +export const ApiKeyPermission = $schema.enums.ApiKeyPermission.values; +/** + * Defines permission levels for API keys. + * Controls what operations an API key can perform. + */ +export type ApiKeyPermission = (typeof ApiKeyPermission)[keyof typeof ApiKeyPermission]; +export const IdentityProvider = $schema.enums.IdentityProvider.values; +export type IdentityProvider = (typeof IdentityProvider)[keyof typeof IdentityProvider]; +export const Role = $schema.enums.Role.values; +export type Role = (typeof Role)[keyof typeof Role]; +export const Objective = $schema.enums.Objective.values; +export type Objective = (typeof Objective)[keyof typeof Objective]; +export const Intention = $schema.enums.Intention.values; +export type Intention = (typeof Intention)[keyof typeof Intention]; +export const InsightCategory = $schema.enums.InsightCategory.values; +export type InsightCategory = (typeof InsightCategory)[keyof typeof InsightCategory]; +export const Sentiment = $schema.enums.Sentiment.values; +export type Sentiment = (typeof Sentiment)[keyof typeof Sentiment]; +export const TeamUserRole = $schema.enums.TeamUserRole.values; +export type TeamUserRole = (typeof TeamUserRole)[keyof typeof TeamUserRole]; +export const ProjectTeamPermission = $schema.enums.ProjectTeamPermission.values; +export type ProjectTeamPermission = (typeof ProjectTeamPermission)[keyof typeof ProjectTeamPermission]; diff --git a/tests/e2e/github-repos/formbricks/schema.ts b/tests/e2e/github-repos/formbricks/schema.ts new file mode 100644 index 000000000..935b8320b --- /dev/null +++ b/tests/e2e/github-repos/formbricks/schema.ts @@ -0,0 +1,3025 @@ +////////////////////////////////////////////////////////////////////////////////////////////// +// DO NOT MODIFY THIS FILE // +// This file is automatically generated by ZenStack CLI and should not be manually updated. // +////////////////////////////////////////////////////////////////////////////////////////////// + +/* eslint-disable */ + +import { type SchemaDef, ExpressionUtils } from "@zenstackhq/orm/schema"; +export class SchemaType implements SchemaDef { + provider = { + type: "postgresql" + } as const; + models = { + Webhook: { + name: "Webhook", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + name: { + name: "name", + type: "String", + optional: true + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("created_at") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@updatedAt" }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("updated_at") }] }], + default: ExpressionUtils.call("now") + }, + url: { + name: "url", + type: "String" + }, + source: { + name: "source", + type: "WebhookSource", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("user") }] }], + default: "user" + }, + environment: { + name: "environment", + type: "Environment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "webhooks", fields: ["environmentId"], references: ["id"], onDelete: "Cascade" } + }, + environmentId: { + name: "environmentId", + type: "String", + foreignKeyFor: [ + "environment" + ] + }, + triggers: { + name: "triggers", + type: "PipelineTriggers", + array: true + }, + surveyIds: { + name: "surveyIds", + type: "String", + array: true + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" } + } + }, + ContactAttribute: { + name: "ContactAttribute", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("created_at") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("updated_at") }] }] + }, + attributeKey: { + name: "attributeKey", + type: "ContactAttributeKey", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("attributeKeyId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "attributes", fields: ["attributeKeyId"], references: ["id"], onDelete: "Cascade" } + }, + attributeKeyId: { + name: "attributeKeyId", + type: "String", + foreignKeyFor: [ + "attributeKey" + ] + }, + contact: { + name: "contact", + type: "Contact", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("contactId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "attributes", fields: ["contactId"], references: ["id"], onDelete: "Cascade" } + }, + contactId: { + name: "contactId", + type: "String", + foreignKeyFor: [ + "contact" + ] + }, + value: { + name: "value", + type: "String" + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("contactId"), ExpressionUtils.field("attributeKeyId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("attributeKeyId"), ExpressionUtils.field("value")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + contactId_attributeKeyId: { contactId: { type: "String" }, attributeKeyId: { type: "String" } } + } + }, + ContactAttributeKey: { + name: "ContactAttributeKey", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("created_at") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("updated_at") }] }] + }, + isUnique: { + name: "isUnique", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + key: { + name: "key", + type: "String" + }, + name: { + name: "name", + type: "String", + optional: true + }, + description: { + name: "description", + type: "String", + optional: true + }, + type: { + name: "type", + type: "ContactAttributeType", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("custom") }] }], + default: "custom" + }, + environment: { + name: "environment", + type: "Environment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "attributeKeys", fields: ["environmentId"], references: ["id"], onDelete: "Cascade" } + }, + environmentId: { + name: "environmentId", + type: "String", + foreignKeyFor: [ + "environment" + ] + }, + attributes: { + name: "attributes", + type: "ContactAttribute", + array: true, + relation: { opposite: "attributeKey" } + }, + attributeFilters: { + name: "attributeFilters", + type: "SurveyAttributeFilter", + array: true, + relation: { opposite: "attributeKey" } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("key"), ExpressionUtils.field("environmentId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId"), ExpressionUtils.field("createdAt")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + key_environmentId: { key: { type: "String" }, environmentId: { type: "String" } } + } + }, + Contact: { + name: "Contact", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + userId: { + name: "userId", + type: "String", + optional: true + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("created_at") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("updated_at") }] }] + }, + environment: { + name: "environment", + type: "Environment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "contacts", fields: ["environmentId"], references: ["id"], onDelete: "Cascade" } + }, + environmentId: { + name: "environmentId", + type: "String", + foreignKeyFor: [ + "environment" + ] + }, + responses: { + name: "responses", + type: "Response", + array: true, + relation: { opposite: "contact" } + }, + attributes: { + name: "attributes", + type: "ContactAttribute", + array: true, + relation: { opposite: "contact" } + }, + displays: { + name: "displays", + type: "Display", + array: true, + relation: { opposite: "contact" } + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" } + } + }, + Response: { + name: "Response", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("created_at") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@updatedAt" }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("updated_at") }] }], + default: ExpressionUtils.call("now") + }, + finished: { + name: "finished", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + survey: { + name: "survey", + type: "Survey", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("surveyId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "responses", fields: ["surveyId"], references: ["id"], onDelete: "Cascade" } + }, + surveyId: { + name: "surveyId", + type: "String", + foreignKeyFor: [ + "survey" + ] + }, + contact: { + name: "contact", + type: "Contact", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("contactId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "responses", fields: ["contactId"], references: ["id"], onDelete: "Cascade" } + }, + contactId: { + name: "contactId", + type: "String", + optional: true, + foreignKeyFor: [ + "contact" + ] + }, + endingId: { + name: "endingId", + type: "String", + optional: true + }, + notes: { + name: "notes", + type: "ResponseNote", + array: true, + relation: { opposite: "response" } + }, + data: { + name: "data", + type: "Json", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("{}") }] }], + default: "{}" + }, + variables: { + name: "variables", + type: "Json", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("{}") }] }], + default: "{}" + }, + ttc: { + name: "ttc", + type: "Json", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("{}") }] }], + default: "{}" + }, + meta: { + name: "meta", + type: "Json", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("{}") }] }], + default: "{}" + }, + tags: { + name: "tags", + type: "TagsOnResponses", + array: true, + relation: { opposite: "response" } + }, + contactAttributes: { + name: "contactAttributes", + type: "Json", + optional: true + }, + singleUseId: { + name: "singleUseId", + type: "String", + optional: true + }, + language: { + name: "language", + type: "String", + optional: true + }, + documents: { + name: "documents", + type: "Document", + array: true, + relation: { opposite: "response" } + }, + displayId: { + name: "displayId", + type: "String", + unique: true, + optional: true, + attributes: [{ name: "@unique" }], + foreignKeyFor: [ + "display" + ] + }, + display: { + name: "display", + type: "Display", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("displayId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "response", fields: ["displayId"], references: ["id"] } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("surveyId"), ExpressionUtils.field("singleUseId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("createdAt")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("surveyId"), ExpressionUtils.field("createdAt")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("contactId"), ExpressionUtils.field("createdAt")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("surveyId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + displayId: { type: "String" }, + surveyId_singleUseId: { surveyId: { type: "String" }, singleUseId: { type: "String" } } + } + }, + ResponseNote: { + name: "ResponseNote", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("created_at") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("updated_at") }] }] + }, + response: { + name: "response", + type: "Response", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("responseId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "notes", fields: ["responseId"], references: ["id"], onDelete: "Cascade" } + }, + responseId: { + name: "responseId", + type: "String", + foreignKeyFor: [ + "response" + ] + }, + user: { + name: "user", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "responseNotes", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + userId: { + name: "userId", + type: "String", + foreignKeyFor: [ + "user" + ] + }, + text: { + name: "text", + type: "String" + }, + isResolved: { + name: "isResolved", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + isEdited: { + name: "isEdited", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("responseId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" } + } + }, + Tag: { + name: "Tag", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("created_at") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("updated_at") }] }] + }, + name: { + name: "name", + type: "String" + }, + responses: { + name: "responses", + type: "TagsOnResponses", + array: true, + relation: { opposite: "tag" } + }, + environmentId: { + name: "environmentId", + type: "String", + foreignKeyFor: [ + "environment" + ] + }, + environment: { + name: "environment", + type: "Environment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "tags", fields: ["environmentId"], references: ["id"], onDelete: "Cascade" } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId"), ExpressionUtils.field("name")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + environmentId_name: { environmentId: { type: "String" }, name: { type: "String" } } + } + }, + TagsOnResponses: { + name: "TagsOnResponses", + fields: { + responseId: { + name: "responseId", + type: "String", + id: true, + foreignKeyFor: [ + "response" + ] + }, + response: { + name: "response", + type: "Response", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("responseId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "tags", fields: ["responseId"], references: ["id"], onDelete: "Cascade" } + }, + tagId: { + name: "tagId", + type: "String", + id: true, + foreignKeyFor: [ + "tag" + ] + }, + tag: { + name: "tag", + type: "Tag", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("tagId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "responses", fields: ["tagId"], references: ["id"], onDelete: "Cascade" } + } + }, + attributes: [ + { name: "@@id", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("responseId"), ExpressionUtils.field("tagId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("responseId")]) }] } + ], + idFields: ["responseId", "tagId"], + uniqueFields: { + responseId_tagId: { responseId: { type: "String" }, tagId: { type: "String" } } + } + }, + Display: { + name: "Display", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("created_at") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("updated_at") }] }] + }, + survey: { + name: "survey", + type: "Survey", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("surveyId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "displays", fields: ["surveyId"], references: ["id"], onDelete: "Cascade" } + }, + surveyId: { + name: "surveyId", + type: "String", + foreignKeyFor: [ + "survey" + ] + }, + contact: { + name: "contact", + type: "Contact", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("contactId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "displays", fields: ["contactId"], references: ["id"], onDelete: "Cascade" } + }, + contactId: { + name: "contactId", + type: "String", + optional: true, + foreignKeyFor: [ + "contact" + ] + }, + responseId: { + name: "responseId", + type: "String", + unique: true, + optional: true, + attributes: [{ name: "@unique" }] + }, + status: { + name: "status", + type: "DisplayStatus", + optional: true + }, + response: { + name: "response", + type: "Response", + optional: true, + relation: { opposite: "display" } + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("surveyId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("contactId"), ExpressionUtils.field("createdAt")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + responseId: { type: "String" } + } + }, + SurveyTrigger: { + name: "SurveyTrigger", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("created_at") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("updated_at") }] }] + }, + survey: { + name: "survey", + type: "Survey", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("surveyId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "triggers", fields: ["surveyId"], references: ["id"], onDelete: "Cascade" } + }, + surveyId: { + name: "surveyId", + type: "String", + foreignKeyFor: [ + "survey" + ] + }, + actionClass: { + name: "actionClass", + type: "ActionClass", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("actionClassId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "surveyTriggers", fields: ["actionClassId"], references: ["id"], onDelete: "Cascade" } + }, + actionClassId: { + name: "actionClassId", + type: "String", + foreignKeyFor: [ + "actionClass" + ] + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("surveyId"), ExpressionUtils.field("actionClassId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("surveyId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + surveyId_actionClassId: { surveyId: { type: "String" }, actionClassId: { type: "String" } } + } + }, + SurveyAttributeFilter: { + name: "SurveyAttributeFilter", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("created_at") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("updated_at") }] }] + }, + attributeKey: { + name: "attributeKey", + type: "ContactAttributeKey", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("attributeKeyId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "attributeFilters", fields: ["attributeKeyId"], references: ["id"], onDelete: "Cascade" } + }, + attributeKeyId: { + name: "attributeKeyId", + type: "String", + foreignKeyFor: [ + "attributeKey" + ] + }, + survey: { + name: "survey", + type: "Survey", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("surveyId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "attributeFilters", fields: ["surveyId"], references: ["id"], onDelete: "Cascade" } + }, + surveyId: { + name: "surveyId", + type: "String", + foreignKeyFor: [ + "survey" + ] + }, + condition: { + name: "condition", + type: "SurveyAttributeFilterCondition" + }, + value: { + name: "value", + type: "String" + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("surveyId"), ExpressionUtils.field("attributeKeyId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("surveyId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("attributeKeyId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + surveyId_attributeKeyId: { surveyId: { type: "String" }, attributeKeyId: { type: "String" } } + } + }, + Survey: { + name: "Survey", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("created_at") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("updated_at") }] }] + }, + name: { + name: "name", + type: "String" + }, + redirectUrl: { + name: "redirectUrl", + type: "String", + optional: true + }, + type: { + name: "type", + type: "SurveyType", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("web") }] }], + default: "web" + }, + environment: { + name: "environment", + type: "Environment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "surveys", fields: ["environmentId"], references: ["id"], onDelete: "Cascade" } + }, + environmentId: { + name: "environmentId", + type: "String", + foreignKeyFor: [ + "environment" + ] + }, + creator: { + name: "creator", + type: "User", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("createdBy")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "surveys", fields: ["createdBy"], references: ["id"] } + }, + createdBy: { + name: "createdBy", + type: "String", + optional: true, + foreignKeyFor: [ + "creator" + ] + }, + status: { + name: "status", + type: "SurveyStatus", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("draft") }] }], + default: "draft" + }, + welcomeCard: { + name: "welcomeCard", + type: "Json", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("{\"enabled\": false}") }] }], + default: "{\"enabled\": false}" + }, + questions: { + name: "questions", + type: "Json", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("[]") }] }], + default: "[]" + }, + endings: { + name: "endings", + type: "Json", + array: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.array([]) }] }], + default: [] + }, + thankYouCard: { + name: "thankYouCard", + type: "Json", + optional: true + }, + hiddenFields: { + name: "hiddenFields", + type: "Json", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("{\"enabled\": false}") }] }], + default: "{\"enabled\": false}" + }, + variables: { + name: "variables", + type: "Json", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("[]") }] }], + default: "[]" + }, + responses: { + name: "responses", + type: "Response", + array: true, + relation: { opposite: "survey" } + }, + displayOption: { + name: "displayOption", + type: "displayOptions", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("displayOnce") }] }], + default: "displayOnce" + }, + recontactDays: { + name: "recontactDays", + type: "Int", + optional: true + }, + displayLimit: { + name: "displayLimit", + type: "Int", + optional: true + }, + triggers: { + name: "triggers", + type: "SurveyTrigger", + array: true, + relation: { opposite: "survey" } + }, + inlineTriggers: { + name: "inlineTriggers", + type: "Json", + optional: true + }, + attributeFilters: { + name: "attributeFilters", + type: "SurveyAttributeFilter", + array: true, + relation: { opposite: "survey" } + }, + displays: { + name: "displays", + type: "Display", + array: true, + relation: { opposite: "survey" } + }, + autoClose: { + name: "autoClose", + type: "Int", + optional: true + }, + autoComplete: { + name: "autoComplete", + type: "Int", + optional: true + }, + delay: { + name: "delay", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + runOnDate: { + name: "runOnDate", + type: "DateTime", + optional: true + }, + closeOnDate: { + name: "closeOnDate", + type: "DateTime", + optional: true + }, + surveyClosedMessage: { + name: "surveyClosedMessage", + type: "Json", + optional: true + }, + segmentId: { + name: "segmentId", + type: "String", + optional: true, + foreignKeyFor: [ + "segment" + ] + }, + segment: { + name: "segment", + type: "Segment", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("segmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "surveys", fields: ["segmentId"], references: ["id"] } + }, + projectOverwrites: { + name: "projectOverwrites", + type: "Json", + optional: true + }, + styling: { + name: "styling", + type: "Json", + optional: true + }, + singleUse: { + name: "singleUse", + type: "Json", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("{\"enabled\": false, \"isEncrypted\": true}") }] }], + default: "{\"enabled\": false, \"isEncrypted\": true}" + }, + verifyEmail: { + name: "verifyEmail", + type: "Json", + optional: true + }, + isVerifyEmailEnabled: { + name: "isVerifyEmailEnabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + isSingleResponsePerEmailEnabled: { + name: "isSingleResponsePerEmailEnabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + isBackButtonHidden: { + name: "isBackButtonHidden", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + pin: { + name: "pin", + type: "String", + optional: true + }, + resultShareKey: { + name: "resultShareKey", + type: "String", + unique: true, + optional: true, + attributes: [{ name: "@unique" }] + }, + displayPercentage: { + name: "displayPercentage", + type: "Decimal", + optional: true + }, + languages: { + name: "languages", + type: "SurveyLanguage", + array: true, + relation: { opposite: "survey" } + }, + showLanguageSwitch: { + name: "showLanguageSwitch", + type: "Boolean", + optional: true + }, + documents: { + name: "documents", + type: "Document", + array: true, + relation: { opposite: "survey" } + }, + followUps: { + name: "followUps", + type: "SurveyFollowUp", + array: true, + relation: { opposite: "survey" } + }, + recaptcha: { + name: "recaptcha", + type: "Json", + optional: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("{\"enabled\": false, \"threshold\":0.1}") }] }], + default: "{\"enabled\": false, \"threshold\":0.1}" + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId"), ExpressionUtils.field("updatedAt")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("segmentId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + resultShareKey: { type: "String" } + } + }, + SurveyFollowUp: { + name: "SurveyFollowUp", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("created_at") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("updated_at") }] }] + }, + survey: { + name: "survey", + type: "Survey", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("surveyId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "followUps", fields: ["surveyId"], references: ["id"], onDelete: "Cascade" } + }, + surveyId: { + name: "surveyId", + type: "String", + foreignKeyFor: [ + "survey" + ] + }, + name: { + name: "name", + type: "String" + }, + trigger: { + name: "trigger", + type: "Json" + }, + action: { + name: "action", + type: "Json" + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" } + } + }, + ActionClass: { + name: "ActionClass", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("created_at") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("updated_at") }] }] + }, + name: { + name: "name", + type: "String" + }, + description: { + name: "description", + type: "String", + optional: true + }, + type: { + name: "type", + type: "ActionType" + }, + key: { + name: "key", + type: "String", + optional: true + }, + noCodeConfig: { + name: "noCodeConfig", + type: "Json", + optional: true + }, + environment: { + name: "environment", + type: "Environment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "actionClasses", fields: ["environmentId"], references: ["id"], onDelete: "Cascade" } + }, + environmentId: { + name: "environmentId", + type: "String", + foreignKeyFor: [ + "environment" + ] + }, + surveyTriggers: { + name: "surveyTriggers", + type: "SurveyTrigger", + array: true, + relation: { opposite: "actionClass" } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("key"), ExpressionUtils.field("environmentId")]) }] }, + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("name"), ExpressionUtils.field("environmentId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId"), ExpressionUtils.field("createdAt")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + key_environmentId: { key: { type: "String" }, environmentId: { type: "String" } }, + name_environmentId: { name: { type: "String" }, environmentId: { type: "String" } } + } + }, + Integration: { + name: "Integration", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + type: { + name: "type", + type: "IntegrationType" + }, + environmentId: { + name: "environmentId", + type: "String", + foreignKeyFor: [ + "environment" + ] + }, + config: { + name: "config", + type: "Json" + }, + environment: { + name: "environment", + type: "Environment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "integration", fields: ["environmentId"], references: ["id"], onDelete: "Cascade" } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("type"), ExpressionUtils.field("environmentId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + type_environmentId: { type: { type: "IntegrationType" }, environmentId: { type: "String" } } + } + }, + DataMigration: { + name: "DataMigration", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + startedAt: { + name: "startedAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("started_at") }] }], + default: ExpressionUtils.call("now") + }, + finishedAt: { + name: "finishedAt", + type: "DateTime", + optional: true, + attributes: [{ name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("finished_at") }] }] + }, + name: { + name: "name", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + status: { + name: "status", + type: "DataMigrationStatus" + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + name: { type: "String" } + } + }, + Environment: { + name: "Environment", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("created_at") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("updated_at") }] }] + }, + type: { + name: "type", + type: "EnvironmentType" + }, + project: { + name: "project", + type: "Project", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "environments", fields: ["projectId"], references: ["id"], onDelete: "Cascade" } + }, + projectId: { + name: "projectId", + type: "String", + foreignKeyFor: [ + "project" + ] + }, + widgetSetupCompleted: { + name: "widgetSetupCompleted", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + appSetupCompleted: { + name: "appSetupCompleted", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + surveys: { + name: "surveys", + type: "Survey", + array: true, + relation: { opposite: "environment" } + }, + contacts: { + name: "contacts", + type: "Contact", + array: true, + relation: { opposite: "environment" } + }, + actionClasses: { + name: "actionClasses", + type: "ActionClass", + array: true, + relation: { opposite: "environment" } + }, + attributeKeys: { + name: "attributeKeys", + type: "ContactAttributeKey", + array: true, + relation: { opposite: "environment" } + }, + webhooks: { + name: "webhooks", + type: "Webhook", + array: true, + relation: { opposite: "environment" } + }, + tags: { + name: "tags", + type: "Tag", + array: true, + relation: { opposite: "environment" } + }, + segments: { + name: "segments", + type: "Segment", + array: true, + relation: { opposite: "environment" } + }, + integration: { + name: "integration", + type: "Integration", + array: true, + relation: { opposite: "environment" } + }, + documents: { + name: "documents", + type: "Document", + array: true, + relation: { opposite: "environment" } + }, + insights: { + name: "insights", + type: "Insight", + array: true, + relation: { opposite: "environment" } + }, + ApiKeyEnvironment: { + name: "ApiKeyEnvironment", + type: "ApiKeyEnvironment", + array: true, + relation: { opposite: "environment" } + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" } + } + }, + Project: { + name: "Project", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("created_at") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("updated_at") }] }] + }, + name: { + name: "name", + type: "String" + }, + organization: { + name: "organization", + type: "Organization", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "projects", fields: ["organizationId"], references: ["id"], onDelete: "Cascade" } + }, + organizationId: { + name: "organizationId", + type: "String", + foreignKeyFor: [ + "organization" + ] + }, + environments: { + name: "environments", + type: "Environment", + array: true, + relation: { opposite: "project" } + }, + brandColor: { + name: "brandColor", + type: "String", + optional: true + }, + highlightBorderColor: { + name: "highlightBorderColor", + type: "String", + optional: true + }, + styling: { + name: "styling", + type: "Json", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("{\"allowStyleOverwrite\":true}") }] }], + default: "{\"allowStyleOverwrite\":true}" + }, + config: { + name: "config", + type: "Json", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("{}") }] }], + default: "{}" + }, + recontactDays: { + name: "recontactDays", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(7) }] }], + default: 7 + }, + linkSurveyBranding: { + name: "linkSurveyBranding", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(true) }] }], + default: true + }, + inAppSurveyBranding: { + name: "inAppSurveyBranding", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(true) }] }], + default: true + }, + placement: { + name: "placement", + type: "WidgetPlacement", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("bottomRight") }] }], + default: "bottomRight" + }, + clickOutsideClose: { + name: "clickOutsideClose", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(true) }] }], + default: true + }, + darkOverlay: { + name: "darkOverlay", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + languages: { + name: "languages", + type: "Language", + array: true, + relation: { opposite: "project" } + }, + logo: { + name: "logo", + type: "Json", + optional: true + }, + projectTeams: { + name: "projectTeams", + type: "ProjectTeam", + array: true, + relation: { opposite: "project" } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId"), ExpressionUtils.field("name")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + organizationId_name: { organizationId: { type: "String" }, name: { type: "String" } } + } + }, + Organization: { + name: "Organization", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("created_at") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("updated_at") }] }] + }, + name: { + name: "name", + type: "String" + }, + memberships: { + name: "memberships", + type: "Membership", + array: true, + relation: { opposite: "organization" } + }, + projects: { + name: "projects", + type: "Project", + array: true, + relation: { opposite: "organization" } + }, + billing: { + name: "billing", + type: "Json" + }, + whitelabel: { + name: "whitelabel", + type: "Json", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("{}") }] }], + default: "{}" + }, + invites: { + name: "invites", + type: "Invite", + array: true, + relation: { opposite: "organization" } + }, + isAIEnabled: { + name: "isAIEnabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + teams: { + name: "teams", + type: "Team", + array: true, + relation: { opposite: "organization" } + }, + apiKeys: { + name: "apiKeys", + type: "ApiKey", + array: true, + relation: { opposite: "organization" } + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" } + } + }, + Membership: { + name: "Membership", + fields: { + organization: { + name: "organization", + type: "Organization", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "memberships", fields: ["organizationId"], references: ["id"], onDelete: "Cascade" } + }, + organizationId: { + name: "organizationId", + type: "String", + id: true, + foreignKeyFor: [ + "organization" + ] + }, + user: { + name: "user", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "memberships", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + userId: { + name: "userId", + type: "String", + id: true, + foreignKeyFor: [ + "user" + ] + }, + accepted: { + name: "accepted", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + deprecatedRole: { + name: "deprecatedRole", + type: "MembershipRole", + optional: true + }, + role: { + name: "role", + type: "OrganizationRole", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("member") }] }], + default: "member" + } + }, + attributes: [ + { name: "@@id", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId"), ExpressionUtils.field("organizationId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId")]) }] } + ], + idFields: ["organizationId", "userId"], + uniqueFields: { + userId_organizationId: { userId: { type: "String" }, organizationId: { type: "String" } } + } + }, + Invite: { + name: "Invite", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("uuid") }] }], + default: ExpressionUtils.call("uuid") + }, + email: { + name: "email", + type: "String" + }, + name: { + name: "name", + type: "String", + optional: true + }, + organization: { + name: "organization", + type: "Organization", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "invites", fields: ["organizationId"], references: ["id"], onDelete: "Cascade" } + }, + organizationId: { + name: "organizationId", + type: "String", + foreignKeyFor: [ + "organization" + ] + }, + creator: { + name: "creator", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("inviteCreatedBy") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("creatorId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "invitesCreated", name: "inviteCreatedBy", fields: ["creatorId"], references: ["id"] } + }, + creatorId: { + name: "creatorId", + type: "String", + foreignKeyFor: [ + "creator" + ] + }, + acceptor: { + name: "acceptor", + type: "User", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("inviteAcceptedBy") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("acceptorId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "invitesAccepted", name: "inviteAcceptedBy", fields: ["acceptorId"], references: ["id"], onDelete: "Cascade" } + }, + acceptorId: { + name: "acceptorId", + type: "String", + optional: true, + foreignKeyFor: [ + "acceptor" + ] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + expiresAt: { + name: "expiresAt", + type: "DateTime" + }, + deprecatedRole: { + name: "deprecatedRole", + type: "MembershipRole", + optional: true + }, + role: { + name: "role", + type: "OrganizationRole", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("member") }] }], + default: "member" + }, + teamIds: { + name: "teamIds", + type: "String", + array: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.array([]) }] }], + default: [] + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("email"), ExpressionUtils.field("organizationId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" } + } + }, + ApiKey: { + name: "ApiKey", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + createdBy: { + name: "createdBy", + type: "String", + optional: true + }, + lastUsedAt: { + name: "lastUsedAt", + type: "DateTime", + optional: true + }, + label: { + name: "label", + type: "String" + }, + hashedKey: { + name: "hashedKey", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + organizationId: { + name: "organizationId", + type: "String", + foreignKeyFor: [ + "organization" + ] + }, + organization: { + name: "organization", + type: "Organization", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "apiKeys", fields: ["organizationId"], references: ["id"], onDelete: "Cascade" } + }, + apiKeyEnvironments: { + name: "apiKeyEnvironments", + type: "ApiKeyEnvironment", + array: true, + relation: { opposite: "apiKey" } + }, + organizationAccess: { + name: "organizationAccess", + type: "Json", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("{}") }] }], + default: "{}" + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + hashedKey: { type: "String" } + } + }, + ApiKeyEnvironment: { + name: "ApiKeyEnvironment", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + apiKeyId: { + name: "apiKeyId", + type: "String", + foreignKeyFor: [ + "apiKey" + ] + }, + apiKey: { + name: "apiKey", + type: "ApiKey", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("apiKeyId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "apiKeyEnvironments", fields: ["apiKeyId"], references: ["id"], onDelete: "Cascade" } + }, + environmentId: { + name: "environmentId", + type: "String", + foreignKeyFor: [ + "environment" + ] + }, + environment: { + name: "environment", + type: "Environment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "ApiKeyEnvironment", fields: ["environmentId"], references: ["id"], onDelete: "Cascade" } + }, + permission: { + name: "permission", + type: "ApiKeyPermission" + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("apiKeyId"), ExpressionUtils.field("environmentId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + apiKeyId_environmentId: { apiKeyId: { type: "String" }, environmentId: { type: "String" } } + } + }, + Account: { + name: "Account", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("created_at") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("updated_at") }] }] + }, + user: { + name: "user", + type: "User", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "accounts", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + userId: { + name: "userId", + type: "String", + foreignKeyFor: [ + "user" + ] + }, + type: { + name: "type", + type: "String" + }, + provider: { + name: "provider", + type: "String" + }, + providerAccountId: { + name: "providerAccountId", + type: "String" + }, + access_token: { + name: "access_token", + type: "String", + optional: true, + attributes: [{ name: "@db.Text" }] + }, + refresh_token: { + name: "refresh_token", + type: "String", + optional: true, + attributes: [{ name: "@db.Text" }] + }, + expires_at: { + name: "expires_at", + type: "Int", + optional: true + }, + ext_expires_in: { + name: "ext_expires_in", + type: "Int", + optional: true + }, + token_type: { + name: "token_type", + type: "String", + optional: true + }, + scope: { + name: "scope", + type: "String", + optional: true + }, + id_token: { + name: "id_token", + type: "String", + optional: true, + attributes: [{ name: "@db.Text" }] + }, + session_state: { + name: "session_state", + type: "String", + optional: true + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("provider"), ExpressionUtils.field("providerAccountId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + provider_providerAccountId: { provider: { type: "String" }, providerAccountId: { type: "String" } } + } + }, + User: { + name: "User", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("created_at") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("updated_at") }] }] + }, + name: { + name: "name", + type: "String" + }, + email: { + name: "email", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + emailVerified: { + name: "emailVerified", + type: "DateTime", + optional: true, + attributes: [{ name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("email_verified") }] }] + }, + imageUrl: { + name: "imageUrl", + type: "String", + optional: true + }, + twoFactorSecret: { + name: "twoFactorSecret", + type: "String", + optional: true + }, + twoFactorEnabled: { + name: "twoFactorEnabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + backupCodes: { + name: "backupCodes", + type: "String", + optional: true + }, + password: { + name: "password", + type: "String", + optional: true + }, + identityProvider: { + name: "identityProvider", + type: "IdentityProvider", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("email") }] }], + default: "email" + }, + identityProviderAccountId: { + name: "identityProviderAccountId", + type: "String", + optional: true + }, + memberships: { + name: "memberships", + type: "Membership", + array: true, + relation: { opposite: "user" } + }, + accounts: { + name: "accounts", + type: "Account", + array: true, + relation: { opposite: "user" } + }, + responseNotes: { + name: "responseNotes", + type: "ResponseNote", + array: true, + relation: { opposite: "user" } + }, + groupId: { + name: "groupId", + type: "String", + optional: true + }, + invitesCreated: { + name: "invitesCreated", + type: "Invite", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("inviteCreatedBy") }] }], + relation: { opposite: "creator", name: "inviteCreatedBy" } + }, + invitesAccepted: { + name: "invitesAccepted", + type: "Invite", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("inviteAcceptedBy") }] }], + relation: { opposite: "acceptor", name: "inviteAcceptedBy" } + }, + role: { + name: "role", + type: "Role", + optional: true + }, + objective: { + name: "objective", + type: "Objective", + optional: true + }, + notificationSettings: { + name: "notificationSettings", + type: "Json", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("{}") }] }], + default: "{}" + }, + locale: { + name: "locale", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("en-US") }] }], + default: "en-US" + }, + surveys: { + name: "surveys", + type: "Survey", + array: true, + relation: { opposite: "creator" } + }, + teamUsers: { + name: "teamUsers", + type: "TeamUser", + array: true, + relation: { opposite: "user" } + }, + lastLoginAt: { + name: "lastLoginAt", + type: "DateTime", + optional: true + }, + isActive: { + name: "isActive", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(true) }] }], + default: true + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("email")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + email: { type: "String" } + } + }, + ShortUrl: { + name: "ShortUrl", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("created_at") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("updated_at") }] }] + }, + url: { + name: "url", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + url: { type: "String" } + } + }, + Segment: { + name: "Segment", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("created_at") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("updated_at") }] }] + }, + title: { + name: "title", + type: "String" + }, + description: { + name: "description", + type: "String", + optional: true + }, + isPrivate: { + name: "isPrivate", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(true) }] }], + default: true + }, + filters: { + name: "filters", + type: "Json", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("[]") }] }], + default: "[]" + }, + environmentId: { + name: "environmentId", + type: "String", + foreignKeyFor: [ + "environment" + ] + }, + environment: { + name: "environment", + type: "Environment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "segments", fields: ["environmentId"], references: ["id"], onDelete: "Cascade" } + }, + surveys: { + name: "surveys", + type: "Survey", + array: true, + relation: { opposite: "segment" } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId"), ExpressionUtils.field("title")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + environmentId_title: { environmentId: { type: "String" }, title: { type: "String" } } + } + }, + Language: { + name: "Language", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("created_at") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("updated_at") }] }] + }, + code: { + name: "code", + type: "String" + }, + alias: { + name: "alias", + type: "String", + optional: true + }, + project: { + name: "project", + type: "Project", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "languages", fields: ["projectId"], references: ["id"], onDelete: "Cascade" } + }, + projectId: { + name: "projectId", + type: "String", + foreignKeyFor: [ + "project" + ] + }, + surveyLanguages: { + name: "surveyLanguages", + type: "SurveyLanguage", + array: true, + relation: { opposite: "language" } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId"), ExpressionUtils.field("code")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + projectId_code: { projectId: { type: "String" }, code: { type: "String" } } + } + }, + SurveyLanguage: { + name: "SurveyLanguage", + fields: { + language: { + name: "language", + type: "Language", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("languageId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "surveyLanguages", fields: ["languageId"], references: ["id"], onDelete: "Cascade" } + }, + languageId: { + name: "languageId", + type: "String", + id: true, + foreignKeyFor: [ + "language" + ] + }, + surveyId: { + name: "surveyId", + type: "String", + id: true, + foreignKeyFor: [ + "survey" + ] + }, + survey: { + name: "survey", + type: "Survey", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("surveyId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "languages", fields: ["surveyId"], references: ["id"], onDelete: "Cascade" } + }, + default: { + name: "default", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + enabled: { + name: "enabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(true) }] }], + default: true + } + }, + attributes: [ + { name: "@@id", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("languageId"), ExpressionUtils.field("surveyId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("surveyId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("languageId")]) }] } + ], + idFields: ["languageId", "surveyId"], + uniqueFields: { + languageId_surveyId: { languageId: { type: "String" }, surveyId: { type: "String" } } + } + }, + Insight: { + name: "Insight", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("created_at") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("updated_at") }] }] + }, + environmentId: { + name: "environmentId", + type: "String", + foreignKeyFor: [ + "environment" + ] + }, + environment: { + name: "environment", + type: "Environment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "insights", fields: ["environmentId"], references: ["id"], onDelete: "Cascade" } + }, + category: { + name: "category", + type: "InsightCategory" + }, + title: { + name: "title", + type: "String" + }, + description: { + name: "description", + type: "String" + }, + vector: { + name: "vector", + type: "Unsupported", + optional: true + }, + documentInsights: { + name: "documentInsights", + type: "DocumentInsight", + array: true, + relation: { opposite: "insight" } + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" } + } + }, + DocumentInsight: { + name: "DocumentInsight", + fields: { + documentId: { + name: "documentId", + type: "String", + id: true, + foreignKeyFor: [ + "document" + ] + }, + document: { + name: "document", + type: "Document", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("documentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "documentInsights", fields: ["documentId"], references: ["id"], onDelete: "Cascade" } + }, + insightId: { + name: "insightId", + type: "String", + id: true, + foreignKeyFor: [ + "insight" + ] + }, + insight: { + name: "insight", + type: "Insight", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("insightId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "documentInsights", fields: ["insightId"], references: ["id"], onDelete: "Cascade" } + } + }, + attributes: [ + { name: "@@id", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("documentId"), ExpressionUtils.field("insightId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("insightId")]) }] } + ], + idFields: ["documentId", "insightId"], + uniqueFields: { + documentId_insightId: { documentId: { type: "String" }, insightId: { type: "String" } } + } + }, + Document: { + name: "Document", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("created_at") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("updated_at") }] }] + }, + environmentId: { + name: "environmentId", + type: "String", + foreignKeyFor: [ + "environment" + ] + }, + environment: { + name: "environment", + type: "Environment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "documents", fields: ["environmentId"], references: ["id"], onDelete: "Cascade" } + }, + surveyId: { + name: "surveyId", + type: "String", + optional: true, + foreignKeyFor: [ + "survey" + ] + }, + survey: { + name: "survey", + type: "Survey", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("surveyId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "documents", fields: ["surveyId"], references: ["id"], onDelete: "Cascade" } + }, + responseId: { + name: "responseId", + type: "String", + optional: true, + foreignKeyFor: [ + "response" + ] + }, + response: { + name: "response", + type: "Response", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("responseId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "documents", fields: ["responseId"], references: ["id"], onDelete: "Cascade" } + }, + questionId: { + name: "questionId", + type: "String", + optional: true + }, + sentiment: { + name: "sentiment", + type: "Sentiment" + }, + isSpam: { + name: "isSpam", + type: "Boolean" + }, + text: { + name: "text", + type: "String" + }, + vector: { + name: "vector", + type: "Unsupported", + optional: true + }, + documentInsights: { + name: "documentInsights", + type: "DocumentInsight", + array: true, + relation: { opposite: "document" } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("responseId"), ExpressionUtils.field("questionId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("createdAt")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + responseId_questionId: { responseId: { type: "String" }, questionId: { type: "String" } } + } + }, + Team: { + name: "Team", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("created_at") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("updated_at") }] }] + }, + name: { + name: "name", + type: "String" + }, + organizationId: { + name: "organizationId", + type: "String", + foreignKeyFor: [ + "organization" + ] + }, + organization: { + name: "organization", + type: "Organization", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "teams", fields: ["organizationId"], references: ["id"], onDelete: "Cascade" } + }, + teamUsers: { + name: "teamUsers", + type: "TeamUser", + array: true, + relation: { opposite: "team" } + }, + projectTeams: { + name: "projectTeams", + type: "ProjectTeam", + array: true, + relation: { opposite: "team" } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId"), ExpressionUtils.field("name")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + organizationId_name: { organizationId: { type: "String" }, name: { type: "String" } } + } + }, + TeamUser: { + name: "TeamUser", + fields: { + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("created_at") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("updated_at") }] }] + }, + teamId: { + name: "teamId", + type: "String", + id: true, + foreignKeyFor: [ + "team" + ] + }, + team: { + name: "team", + type: "Team", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "teamUsers", fields: ["teamId"], references: ["id"], onDelete: "Cascade" } + }, + userId: { + name: "userId", + type: "String", + id: true, + foreignKeyFor: [ + "user" + ] + }, + user: { + name: "user", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "teamUsers", fields: ["userId"], references: ["id"], onDelete: "Cascade" } + }, + role: { + name: "role", + type: "TeamUserRole" + } + }, + attributes: [ + { name: "@@id", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId"), ExpressionUtils.field("userId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }] } + ], + idFields: ["teamId", "userId"], + uniqueFields: { + teamId_userId: { teamId: { type: "String" }, userId: { type: "String" } } + } + }, + ProjectTeam: { + name: "ProjectTeam", + fields: { + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("created_at") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("updated_at") }] }] + }, + projectId: { + name: "projectId", + type: "String", + id: true, + foreignKeyFor: [ + "project" + ] + }, + project: { + name: "project", + type: "Project", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "projectTeams", fields: ["projectId"], references: ["id"], onDelete: "Cascade" } + }, + teamId: { + name: "teamId", + type: "String", + id: true, + foreignKeyFor: [ + "team" + ] + }, + team: { + name: "team", + type: "Team", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "projectTeams", fields: ["teamId"], references: ["id"], onDelete: "Cascade" } + }, + permission: { + name: "permission", + type: "ProjectTeamPermission", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("read") }] }], + default: "read" + } + }, + attributes: [ + { name: "@@id", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId"), ExpressionUtils.field("teamId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("teamId")]) }] } + ], + idFields: ["projectId", "teamId"], + uniqueFields: { + projectId_teamId: { projectId: { type: "String" }, teamId: { type: "String" } } + } + } + } as const; + enums = { + PipelineTriggers: { + values: { + responseCreated: "responseCreated", + responseUpdated: "responseUpdated", + responseFinished: "responseFinished" + } + }, + WebhookSource: { + values: { + user: "user", + zapier: "zapier", + make: "make", + n8n: "n8n", + activepieces: "activepieces" + } + }, + ContactAttributeType: { + values: { + default: "default", + custom: "custom" + } + }, + SurveyStatus: { + values: { + draft: "draft", + scheduled: "scheduled", + inProgress: "inProgress", + paused: "paused", + completed: "completed" + } + }, + DisplayStatus: { + values: { + seen: "seen", + responded: "responded" + } + }, + SurveyAttributeFilterCondition: { + values: { + equals: "equals", + notEquals: "notEquals" + } + }, + SurveyType: { + values: { + link: "link", + web: "web", + website: "website", + app: "app" + } + }, + displayOptions: { + values: { + displayOnce: "displayOnce", + displayMultiple: "displayMultiple", + displaySome: "displaySome", + respondMultiple: "respondMultiple" + } + }, + ActionType: { + values: { + code: "code", + noCode: "noCode" + } + }, + EnvironmentType: { + values: { + production: "production", + development: "development" + } + }, + IntegrationType: { + values: { + googleSheets: "googleSheets", + notion: "notion", + airtable: "airtable", + slack: "slack" + } + }, + DataMigrationStatus: { + values: { + pending: "pending", + applied: "applied", + failed: "failed" + } + }, + WidgetPlacement: { + values: { + bottomLeft: "bottomLeft", + bottomRight: "bottomRight", + topLeft: "topLeft", + topRight: "topRight", + center: "center" + } + }, + OrganizationRole: { + values: { + owner: "owner", + manager: "manager", + member: "member", + billing: "billing" + } + }, + MembershipRole: { + values: { + owner: "owner", + admin: "admin", + editor: "editor", + developer: "developer", + viewer: "viewer" + } + }, + ApiKeyPermission: { + values: { + read: "read", + write: "write", + manage: "manage" + } + }, + IdentityProvider: { + values: { + email: "email", + github: "github", + google: "google", + azuread: "azuread", + openid: "openid", + saml: "saml" + } + }, + Role: { + values: { + project_manager: "project_manager", + engineer: "engineer", + founder: "founder", + marketing_specialist: "marketing_specialist", + other: "other" + } + }, + Objective: { + values: { + increase_conversion: "increase_conversion", + improve_user_retention: "improve_user_retention", + increase_user_adoption: "increase_user_adoption", + sharpen_marketing_messaging: "sharpen_marketing_messaging", + support_sales: "support_sales", + other: "other" + } + }, + Intention: { + values: { + survey_user_segments: "survey_user_segments", + survey_at_specific_point_in_user_journey: "survey_at_specific_point_in_user_journey", + enrich_customer_profiles: "enrich_customer_profiles", + collect_all_user_feedback_on_one_platform: "collect_all_user_feedback_on_one_platform", + other: "other" + } + }, + InsightCategory: { + values: { + featureRequest: "featureRequest", + complaint: "complaint", + praise: "praise", + other: "other" + } + }, + Sentiment: { + values: { + positive: "positive", + negative: "negative", + neutral: "neutral" + } + }, + TeamUserRole: { + values: { + admin: "admin", + contributor: "contributor" + } + }, + ProjectTeamPermission: { + values: { + read: "read", + readWrite: "readWrite", + manage: "manage" + } + } + } as const; + authType = "User" as const; + plugins = {}; +} +export const schema = new SchemaType(); diff --git a/tests/e2e/github-repos/formbricks/schema.zmodel b/tests/e2e/github-repos/formbricks/schema.zmodel index 7a7c19f35..8f4657e6d 100644 --- a/tests/e2e/github-repos/formbricks/schema.zmodel +++ b/tests/e2e/github-repos/formbricks/schema.zmodel @@ -4,15 +4,6 @@ datasource db { extensions = [pgvector(map: "vector")] } -generator client { - provider = "prisma-client-js" - previewFeatures = ["postgresqlExtensions"] -} - -generator json { - provider = "prisma-json-types-generator" -} - enum PipelineTriggers { responseCreated responseUpdated diff --git a/tests/e2e/github-repos/trigger.dev/input.ts b/tests/e2e/github-repos/trigger.dev/input.ts new file mode 100644 index 000000000..55c0cfa8a --- /dev/null +++ b/tests/e2e/github-repos/trigger.dev/input.ts @@ -0,0 +1,1030 @@ +////////////////////////////////////////////////////////////////////////////////////////////// +// DO NOT MODIFY THIS FILE // +// This file is automatically generated by ZenStack CLI and should not be manually updated. // +////////////////////////////////////////////////////////////////////////////////////////////// + +/* eslint-disable */ + +import { type SchemaType as $Schema } from "./schema"; +import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, ClientOptions as $ClientOptions } from "@zenstackhq/orm"; +import type { SimplifiedModelResult as $SimplifiedModelResult, SelectIncludeOmit as $SelectIncludeOmit } from "@zenstackhq/orm"; +export type UserFindManyArgs = $FindManyArgs<$Schema, "User">; +export type UserFindUniqueArgs = $FindUniqueArgs<$Schema, "User">; +export type UserFindFirstArgs = $FindFirstArgs<$Schema, "User">; +export type UserCreateArgs = $CreateArgs<$Schema, "User">; +export type UserCreateManyArgs = $CreateManyArgs<$Schema, "User">; +export type UserCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "User">; +export type UserUpdateArgs = $UpdateArgs<$Schema, "User">; +export type UserUpdateManyArgs = $UpdateManyArgs<$Schema, "User">; +export type UserUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "User">; +export type UserUpsertArgs = $UpsertArgs<$Schema, "User">; +export type UserDeleteArgs = $DeleteArgs<$Schema, "User">; +export type UserDeleteManyArgs = $DeleteManyArgs<$Schema, "User">; +export type UserCountArgs = $CountArgs<$Schema, "User">; +export type UserAggregateArgs = $AggregateArgs<$Schema, "User">; +export type UserGroupByArgs = $GroupByArgs<$Schema, "User">; +export type UserWhereInput = $WhereInput<$Schema, "User">; +export type UserSelect = $SelectInput<$Schema, "User">; +export type UserInclude = $IncludeInput<$Schema, "User">; +export type UserOmit = $OmitInput<$Schema, "User">; +export type UserGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "User", Options, Args>; +export type InvitationCodeFindManyArgs = $FindManyArgs<$Schema, "InvitationCode">; +export type InvitationCodeFindUniqueArgs = $FindUniqueArgs<$Schema, "InvitationCode">; +export type InvitationCodeFindFirstArgs = $FindFirstArgs<$Schema, "InvitationCode">; +export type InvitationCodeCreateArgs = $CreateArgs<$Schema, "InvitationCode">; +export type InvitationCodeCreateManyArgs = $CreateManyArgs<$Schema, "InvitationCode">; +export type InvitationCodeCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "InvitationCode">; +export type InvitationCodeUpdateArgs = $UpdateArgs<$Schema, "InvitationCode">; +export type InvitationCodeUpdateManyArgs = $UpdateManyArgs<$Schema, "InvitationCode">; +export type InvitationCodeUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "InvitationCode">; +export type InvitationCodeUpsertArgs = $UpsertArgs<$Schema, "InvitationCode">; +export type InvitationCodeDeleteArgs = $DeleteArgs<$Schema, "InvitationCode">; +export type InvitationCodeDeleteManyArgs = $DeleteManyArgs<$Schema, "InvitationCode">; +export type InvitationCodeCountArgs = $CountArgs<$Schema, "InvitationCode">; +export type InvitationCodeAggregateArgs = $AggregateArgs<$Schema, "InvitationCode">; +export type InvitationCodeGroupByArgs = $GroupByArgs<$Schema, "InvitationCode">; +export type InvitationCodeWhereInput = $WhereInput<$Schema, "InvitationCode">; +export type InvitationCodeSelect = $SelectInput<$Schema, "InvitationCode">; +export type InvitationCodeInclude = $IncludeInput<$Schema, "InvitationCode">; +export type InvitationCodeOmit = $OmitInput<$Schema, "InvitationCode">; +export type InvitationCodeGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "InvitationCode", Options, Args>; +export type AuthorizationCodeFindManyArgs = $FindManyArgs<$Schema, "AuthorizationCode">; +export type AuthorizationCodeFindUniqueArgs = $FindUniqueArgs<$Schema, "AuthorizationCode">; +export type AuthorizationCodeFindFirstArgs = $FindFirstArgs<$Schema, "AuthorizationCode">; +export type AuthorizationCodeCreateArgs = $CreateArgs<$Schema, "AuthorizationCode">; +export type AuthorizationCodeCreateManyArgs = $CreateManyArgs<$Schema, "AuthorizationCode">; +export type AuthorizationCodeCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "AuthorizationCode">; +export type AuthorizationCodeUpdateArgs = $UpdateArgs<$Schema, "AuthorizationCode">; +export type AuthorizationCodeUpdateManyArgs = $UpdateManyArgs<$Schema, "AuthorizationCode">; +export type AuthorizationCodeUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "AuthorizationCode">; +export type AuthorizationCodeUpsertArgs = $UpsertArgs<$Schema, "AuthorizationCode">; +export type AuthorizationCodeDeleteArgs = $DeleteArgs<$Schema, "AuthorizationCode">; +export type AuthorizationCodeDeleteManyArgs = $DeleteManyArgs<$Schema, "AuthorizationCode">; +export type AuthorizationCodeCountArgs = $CountArgs<$Schema, "AuthorizationCode">; +export type AuthorizationCodeAggregateArgs = $AggregateArgs<$Schema, "AuthorizationCode">; +export type AuthorizationCodeGroupByArgs = $GroupByArgs<$Schema, "AuthorizationCode">; +export type AuthorizationCodeWhereInput = $WhereInput<$Schema, "AuthorizationCode">; +export type AuthorizationCodeSelect = $SelectInput<$Schema, "AuthorizationCode">; +export type AuthorizationCodeInclude = $IncludeInput<$Schema, "AuthorizationCode">; +export type AuthorizationCodeOmit = $OmitInput<$Schema, "AuthorizationCode">; +export type AuthorizationCodeGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "AuthorizationCode", Options, Args>; +export type PersonalAccessTokenFindManyArgs = $FindManyArgs<$Schema, "PersonalAccessToken">; +export type PersonalAccessTokenFindUniqueArgs = $FindUniqueArgs<$Schema, "PersonalAccessToken">; +export type PersonalAccessTokenFindFirstArgs = $FindFirstArgs<$Schema, "PersonalAccessToken">; +export type PersonalAccessTokenCreateArgs = $CreateArgs<$Schema, "PersonalAccessToken">; +export type PersonalAccessTokenCreateManyArgs = $CreateManyArgs<$Schema, "PersonalAccessToken">; +export type PersonalAccessTokenCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "PersonalAccessToken">; +export type PersonalAccessTokenUpdateArgs = $UpdateArgs<$Schema, "PersonalAccessToken">; +export type PersonalAccessTokenUpdateManyArgs = $UpdateManyArgs<$Schema, "PersonalAccessToken">; +export type PersonalAccessTokenUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "PersonalAccessToken">; +export type PersonalAccessTokenUpsertArgs = $UpsertArgs<$Schema, "PersonalAccessToken">; +export type PersonalAccessTokenDeleteArgs = $DeleteArgs<$Schema, "PersonalAccessToken">; +export type PersonalAccessTokenDeleteManyArgs = $DeleteManyArgs<$Schema, "PersonalAccessToken">; +export type PersonalAccessTokenCountArgs = $CountArgs<$Schema, "PersonalAccessToken">; +export type PersonalAccessTokenAggregateArgs = $AggregateArgs<$Schema, "PersonalAccessToken">; +export type PersonalAccessTokenGroupByArgs = $GroupByArgs<$Schema, "PersonalAccessToken">; +export type PersonalAccessTokenWhereInput = $WhereInput<$Schema, "PersonalAccessToken">; +export type PersonalAccessTokenSelect = $SelectInput<$Schema, "PersonalAccessToken">; +export type PersonalAccessTokenInclude = $IncludeInput<$Schema, "PersonalAccessToken">; +export type PersonalAccessTokenOmit = $OmitInput<$Schema, "PersonalAccessToken">; +export type PersonalAccessTokenGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "PersonalAccessToken", Options, Args>; +export type OrganizationFindManyArgs = $FindManyArgs<$Schema, "Organization">; +export type OrganizationFindUniqueArgs = $FindUniqueArgs<$Schema, "Organization">; +export type OrganizationFindFirstArgs = $FindFirstArgs<$Schema, "Organization">; +export type OrganizationCreateArgs = $CreateArgs<$Schema, "Organization">; +export type OrganizationCreateManyArgs = $CreateManyArgs<$Schema, "Organization">; +export type OrganizationCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Organization">; +export type OrganizationUpdateArgs = $UpdateArgs<$Schema, "Organization">; +export type OrganizationUpdateManyArgs = $UpdateManyArgs<$Schema, "Organization">; +export type OrganizationUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Organization">; +export type OrganizationUpsertArgs = $UpsertArgs<$Schema, "Organization">; +export type OrganizationDeleteArgs = $DeleteArgs<$Schema, "Organization">; +export type OrganizationDeleteManyArgs = $DeleteManyArgs<$Schema, "Organization">; +export type OrganizationCountArgs = $CountArgs<$Schema, "Organization">; +export type OrganizationAggregateArgs = $AggregateArgs<$Schema, "Organization">; +export type OrganizationGroupByArgs = $GroupByArgs<$Schema, "Organization">; +export type OrganizationWhereInput = $WhereInput<$Schema, "Organization">; +export type OrganizationSelect = $SelectInput<$Schema, "Organization">; +export type OrganizationInclude = $IncludeInput<$Schema, "Organization">; +export type OrganizationOmit = $OmitInput<$Schema, "Organization">; +export type OrganizationGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Organization", Options, Args>; +export type OrgMemberFindManyArgs = $FindManyArgs<$Schema, "OrgMember">; +export type OrgMemberFindUniqueArgs = $FindUniqueArgs<$Schema, "OrgMember">; +export type OrgMemberFindFirstArgs = $FindFirstArgs<$Schema, "OrgMember">; +export type OrgMemberCreateArgs = $CreateArgs<$Schema, "OrgMember">; +export type OrgMemberCreateManyArgs = $CreateManyArgs<$Schema, "OrgMember">; +export type OrgMemberCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "OrgMember">; +export type OrgMemberUpdateArgs = $UpdateArgs<$Schema, "OrgMember">; +export type OrgMemberUpdateManyArgs = $UpdateManyArgs<$Schema, "OrgMember">; +export type OrgMemberUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "OrgMember">; +export type OrgMemberUpsertArgs = $UpsertArgs<$Schema, "OrgMember">; +export type OrgMemberDeleteArgs = $DeleteArgs<$Schema, "OrgMember">; +export type OrgMemberDeleteManyArgs = $DeleteManyArgs<$Schema, "OrgMember">; +export type OrgMemberCountArgs = $CountArgs<$Schema, "OrgMember">; +export type OrgMemberAggregateArgs = $AggregateArgs<$Schema, "OrgMember">; +export type OrgMemberGroupByArgs = $GroupByArgs<$Schema, "OrgMember">; +export type OrgMemberWhereInput = $WhereInput<$Schema, "OrgMember">; +export type OrgMemberSelect = $SelectInput<$Schema, "OrgMember">; +export type OrgMemberInclude = $IncludeInput<$Schema, "OrgMember">; +export type OrgMemberOmit = $OmitInput<$Schema, "OrgMember">; +export type OrgMemberGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "OrgMember", Options, Args>; +export type OrgMemberInviteFindManyArgs = $FindManyArgs<$Schema, "OrgMemberInvite">; +export type OrgMemberInviteFindUniqueArgs = $FindUniqueArgs<$Schema, "OrgMemberInvite">; +export type OrgMemberInviteFindFirstArgs = $FindFirstArgs<$Schema, "OrgMemberInvite">; +export type OrgMemberInviteCreateArgs = $CreateArgs<$Schema, "OrgMemberInvite">; +export type OrgMemberInviteCreateManyArgs = $CreateManyArgs<$Schema, "OrgMemberInvite">; +export type OrgMemberInviteCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "OrgMemberInvite">; +export type OrgMemberInviteUpdateArgs = $UpdateArgs<$Schema, "OrgMemberInvite">; +export type OrgMemberInviteUpdateManyArgs = $UpdateManyArgs<$Schema, "OrgMemberInvite">; +export type OrgMemberInviteUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "OrgMemberInvite">; +export type OrgMemberInviteUpsertArgs = $UpsertArgs<$Schema, "OrgMemberInvite">; +export type OrgMemberInviteDeleteArgs = $DeleteArgs<$Schema, "OrgMemberInvite">; +export type OrgMemberInviteDeleteManyArgs = $DeleteManyArgs<$Schema, "OrgMemberInvite">; +export type OrgMemberInviteCountArgs = $CountArgs<$Schema, "OrgMemberInvite">; +export type OrgMemberInviteAggregateArgs = $AggregateArgs<$Schema, "OrgMemberInvite">; +export type OrgMemberInviteGroupByArgs = $GroupByArgs<$Schema, "OrgMemberInvite">; +export type OrgMemberInviteWhereInput = $WhereInput<$Schema, "OrgMemberInvite">; +export type OrgMemberInviteSelect = $SelectInput<$Schema, "OrgMemberInvite">; +export type OrgMemberInviteInclude = $IncludeInput<$Schema, "OrgMemberInvite">; +export type OrgMemberInviteOmit = $OmitInput<$Schema, "OrgMemberInvite">; +export type OrgMemberInviteGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "OrgMemberInvite", Options, Args>; +export type RuntimeEnvironmentFindManyArgs = $FindManyArgs<$Schema, "RuntimeEnvironment">; +export type RuntimeEnvironmentFindUniqueArgs = $FindUniqueArgs<$Schema, "RuntimeEnvironment">; +export type RuntimeEnvironmentFindFirstArgs = $FindFirstArgs<$Schema, "RuntimeEnvironment">; +export type RuntimeEnvironmentCreateArgs = $CreateArgs<$Schema, "RuntimeEnvironment">; +export type RuntimeEnvironmentCreateManyArgs = $CreateManyArgs<$Schema, "RuntimeEnvironment">; +export type RuntimeEnvironmentCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "RuntimeEnvironment">; +export type RuntimeEnvironmentUpdateArgs = $UpdateArgs<$Schema, "RuntimeEnvironment">; +export type RuntimeEnvironmentUpdateManyArgs = $UpdateManyArgs<$Schema, "RuntimeEnvironment">; +export type RuntimeEnvironmentUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "RuntimeEnvironment">; +export type RuntimeEnvironmentUpsertArgs = $UpsertArgs<$Schema, "RuntimeEnvironment">; +export type RuntimeEnvironmentDeleteArgs = $DeleteArgs<$Schema, "RuntimeEnvironment">; +export type RuntimeEnvironmentDeleteManyArgs = $DeleteManyArgs<$Schema, "RuntimeEnvironment">; +export type RuntimeEnvironmentCountArgs = $CountArgs<$Schema, "RuntimeEnvironment">; +export type RuntimeEnvironmentAggregateArgs = $AggregateArgs<$Schema, "RuntimeEnvironment">; +export type RuntimeEnvironmentGroupByArgs = $GroupByArgs<$Schema, "RuntimeEnvironment">; +export type RuntimeEnvironmentWhereInput = $WhereInput<$Schema, "RuntimeEnvironment">; +export type RuntimeEnvironmentSelect = $SelectInput<$Schema, "RuntimeEnvironment">; +export type RuntimeEnvironmentInclude = $IncludeInput<$Schema, "RuntimeEnvironment">; +export type RuntimeEnvironmentOmit = $OmitInput<$Schema, "RuntimeEnvironment">; +export type RuntimeEnvironmentGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "RuntimeEnvironment", Options, Args>; +export type ProjectFindManyArgs = $FindManyArgs<$Schema, "Project">; +export type ProjectFindUniqueArgs = $FindUniqueArgs<$Schema, "Project">; +export type ProjectFindFirstArgs = $FindFirstArgs<$Schema, "Project">; +export type ProjectCreateArgs = $CreateArgs<$Schema, "Project">; +export type ProjectCreateManyArgs = $CreateManyArgs<$Schema, "Project">; +export type ProjectCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Project">; +export type ProjectUpdateArgs = $UpdateArgs<$Schema, "Project">; +export type ProjectUpdateManyArgs = $UpdateManyArgs<$Schema, "Project">; +export type ProjectUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Project">; +export type ProjectUpsertArgs = $UpsertArgs<$Schema, "Project">; +export type ProjectDeleteArgs = $DeleteArgs<$Schema, "Project">; +export type ProjectDeleteManyArgs = $DeleteManyArgs<$Schema, "Project">; +export type ProjectCountArgs = $CountArgs<$Schema, "Project">; +export type ProjectAggregateArgs = $AggregateArgs<$Schema, "Project">; +export type ProjectGroupByArgs = $GroupByArgs<$Schema, "Project">; +export type ProjectWhereInput = $WhereInput<$Schema, "Project">; +export type ProjectSelect = $SelectInput<$Schema, "Project">; +export type ProjectInclude = $IncludeInput<$Schema, "Project">; +export type ProjectOmit = $OmitInput<$Schema, "Project">; +export type ProjectGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Project", Options, Args>; +export type SecretReferenceFindManyArgs = $FindManyArgs<$Schema, "SecretReference">; +export type SecretReferenceFindUniqueArgs = $FindUniqueArgs<$Schema, "SecretReference">; +export type SecretReferenceFindFirstArgs = $FindFirstArgs<$Schema, "SecretReference">; +export type SecretReferenceCreateArgs = $CreateArgs<$Schema, "SecretReference">; +export type SecretReferenceCreateManyArgs = $CreateManyArgs<$Schema, "SecretReference">; +export type SecretReferenceCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "SecretReference">; +export type SecretReferenceUpdateArgs = $UpdateArgs<$Schema, "SecretReference">; +export type SecretReferenceUpdateManyArgs = $UpdateManyArgs<$Schema, "SecretReference">; +export type SecretReferenceUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "SecretReference">; +export type SecretReferenceUpsertArgs = $UpsertArgs<$Schema, "SecretReference">; +export type SecretReferenceDeleteArgs = $DeleteArgs<$Schema, "SecretReference">; +export type SecretReferenceDeleteManyArgs = $DeleteManyArgs<$Schema, "SecretReference">; +export type SecretReferenceCountArgs = $CountArgs<$Schema, "SecretReference">; +export type SecretReferenceAggregateArgs = $AggregateArgs<$Schema, "SecretReference">; +export type SecretReferenceGroupByArgs = $GroupByArgs<$Schema, "SecretReference">; +export type SecretReferenceWhereInput = $WhereInput<$Schema, "SecretReference">; +export type SecretReferenceSelect = $SelectInput<$Schema, "SecretReference">; +export type SecretReferenceInclude = $IncludeInput<$Schema, "SecretReference">; +export type SecretReferenceOmit = $OmitInput<$Schema, "SecretReference">; +export type SecretReferenceGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "SecretReference", Options, Args>; +export type SecretStoreFindManyArgs = $FindManyArgs<$Schema, "SecretStore">; +export type SecretStoreFindUniqueArgs = $FindUniqueArgs<$Schema, "SecretStore">; +export type SecretStoreFindFirstArgs = $FindFirstArgs<$Schema, "SecretStore">; +export type SecretStoreCreateArgs = $CreateArgs<$Schema, "SecretStore">; +export type SecretStoreCreateManyArgs = $CreateManyArgs<$Schema, "SecretStore">; +export type SecretStoreCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "SecretStore">; +export type SecretStoreUpdateArgs = $UpdateArgs<$Schema, "SecretStore">; +export type SecretStoreUpdateManyArgs = $UpdateManyArgs<$Schema, "SecretStore">; +export type SecretStoreUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "SecretStore">; +export type SecretStoreUpsertArgs = $UpsertArgs<$Schema, "SecretStore">; +export type SecretStoreDeleteArgs = $DeleteArgs<$Schema, "SecretStore">; +export type SecretStoreDeleteManyArgs = $DeleteManyArgs<$Schema, "SecretStore">; +export type SecretStoreCountArgs = $CountArgs<$Schema, "SecretStore">; +export type SecretStoreAggregateArgs = $AggregateArgs<$Schema, "SecretStore">; +export type SecretStoreGroupByArgs = $GroupByArgs<$Schema, "SecretStore">; +export type SecretStoreWhereInput = $WhereInput<$Schema, "SecretStore">; +export type SecretStoreSelect = $SelectInput<$Schema, "SecretStore">; +export type SecretStoreInclude = $IncludeInput<$Schema, "SecretStore">; +export type SecretStoreOmit = $OmitInput<$Schema, "SecretStore">; +export type SecretStoreGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "SecretStore", Options, Args>; +export type DataMigrationFindManyArgs = $FindManyArgs<$Schema, "DataMigration">; +export type DataMigrationFindUniqueArgs = $FindUniqueArgs<$Schema, "DataMigration">; +export type DataMigrationFindFirstArgs = $FindFirstArgs<$Schema, "DataMigration">; +export type DataMigrationCreateArgs = $CreateArgs<$Schema, "DataMigration">; +export type DataMigrationCreateManyArgs = $CreateManyArgs<$Schema, "DataMigration">; +export type DataMigrationCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "DataMigration">; +export type DataMigrationUpdateArgs = $UpdateArgs<$Schema, "DataMigration">; +export type DataMigrationUpdateManyArgs = $UpdateManyArgs<$Schema, "DataMigration">; +export type DataMigrationUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "DataMigration">; +export type DataMigrationUpsertArgs = $UpsertArgs<$Schema, "DataMigration">; +export type DataMigrationDeleteArgs = $DeleteArgs<$Schema, "DataMigration">; +export type DataMigrationDeleteManyArgs = $DeleteManyArgs<$Schema, "DataMigration">; +export type DataMigrationCountArgs = $CountArgs<$Schema, "DataMigration">; +export type DataMigrationAggregateArgs = $AggregateArgs<$Schema, "DataMigration">; +export type DataMigrationGroupByArgs = $GroupByArgs<$Schema, "DataMigration">; +export type DataMigrationWhereInput = $WhereInput<$Schema, "DataMigration">; +export type DataMigrationSelect = $SelectInput<$Schema, "DataMigration">; +export type DataMigrationInclude = $IncludeInput<$Schema, "DataMigration">; +export type DataMigrationOmit = $OmitInput<$Schema, "DataMigration">; +export type DataMigrationGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "DataMigration", Options, Args>; +export type BackgroundWorkerFindManyArgs = $FindManyArgs<$Schema, "BackgroundWorker">; +export type BackgroundWorkerFindUniqueArgs = $FindUniqueArgs<$Schema, "BackgroundWorker">; +export type BackgroundWorkerFindFirstArgs = $FindFirstArgs<$Schema, "BackgroundWorker">; +export type BackgroundWorkerCreateArgs = $CreateArgs<$Schema, "BackgroundWorker">; +export type BackgroundWorkerCreateManyArgs = $CreateManyArgs<$Schema, "BackgroundWorker">; +export type BackgroundWorkerCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "BackgroundWorker">; +export type BackgroundWorkerUpdateArgs = $UpdateArgs<$Schema, "BackgroundWorker">; +export type BackgroundWorkerUpdateManyArgs = $UpdateManyArgs<$Schema, "BackgroundWorker">; +export type BackgroundWorkerUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "BackgroundWorker">; +export type BackgroundWorkerUpsertArgs = $UpsertArgs<$Schema, "BackgroundWorker">; +export type BackgroundWorkerDeleteArgs = $DeleteArgs<$Schema, "BackgroundWorker">; +export type BackgroundWorkerDeleteManyArgs = $DeleteManyArgs<$Schema, "BackgroundWorker">; +export type BackgroundWorkerCountArgs = $CountArgs<$Schema, "BackgroundWorker">; +export type BackgroundWorkerAggregateArgs = $AggregateArgs<$Schema, "BackgroundWorker">; +export type BackgroundWorkerGroupByArgs = $GroupByArgs<$Schema, "BackgroundWorker">; +export type BackgroundWorkerWhereInput = $WhereInput<$Schema, "BackgroundWorker">; +export type BackgroundWorkerSelect = $SelectInput<$Schema, "BackgroundWorker">; +export type BackgroundWorkerInclude = $IncludeInput<$Schema, "BackgroundWorker">; +export type BackgroundWorkerOmit = $OmitInput<$Schema, "BackgroundWorker">; +export type BackgroundWorkerGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "BackgroundWorker", Options, Args>; +export type BackgroundWorkerFileFindManyArgs = $FindManyArgs<$Schema, "BackgroundWorkerFile">; +export type BackgroundWorkerFileFindUniqueArgs = $FindUniqueArgs<$Schema, "BackgroundWorkerFile">; +export type BackgroundWorkerFileFindFirstArgs = $FindFirstArgs<$Schema, "BackgroundWorkerFile">; +export type BackgroundWorkerFileCreateArgs = $CreateArgs<$Schema, "BackgroundWorkerFile">; +export type BackgroundWorkerFileCreateManyArgs = $CreateManyArgs<$Schema, "BackgroundWorkerFile">; +export type BackgroundWorkerFileCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "BackgroundWorkerFile">; +export type BackgroundWorkerFileUpdateArgs = $UpdateArgs<$Schema, "BackgroundWorkerFile">; +export type BackgroundWorkerFileUpdateManyArgs = $UpdateManyArgs<$Schema, "BackgroundWorkerFile">; +export type BackgroundWorkerFileUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "BackgroundWorkerFile">; +export type BackgroundWorkerFileUpsertArgs = $UpsertArgs<$Schema, "BackgroundWorkerFile">; +export type BackgroundWorkerFileDeleteArgs = $DeleteArgs<$Schema, "BackgroundWorkerFile">; +export type BackgroundWorkerFileDeleteManyArgs = $DeleteManyArgs<$Schema, "BackgroundWorkerFile">; +export type BackgroundWorkerFileCountArgs = $CountArgs<$Schema, "BackgroundWorkerFile">; +export type BackgroundWorkerFileAggregateArgs = $AggregateArgs<$Schema, "BackgroundWorkerFile">; +export type BackgroundWorkerFileGroupByArgs = $GroupByArgs<$Schema, "BackgroundWorkerFile">; +export type BackgroundWorkerFileWhereInput = $WhereInput<$Schema, "BackgroundWorkerFile">; +export type BackgroundWorkerFileSelect = $SelectInput<$Schema, "BackgroundWorkerFile">; +export type BackgroundWorkerFileInclude = $IncludeInput<$Schema, "BackgroundWorkerFile">; +export type BackgroundWorkerFileOmit = $OmitInput<$Schema, "BackgroundWorkerFile">; +export type BackgroundWorkerFileGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "BackgroundWorkerFile", Options, Args>; +export type BackgroundWorkerTaskFindManyArgs = $FindManyArgs<$Schema, "BackgroundWorkerTask">; +export type BackgroundWorkerTaskFindUniqueArgs = $FindUniqueArgs<$Schema, "BackgroundWorkerTask">; +export type BackgroundWorkerTaskFindFirstArgs = $FindFirstArgs<$Schema, "BackgroundWorkerTask">; +export type BackgroundWorkerTaskCreateArgs = $CreateArgs<$Schema, "BackgroundWorkerTask">; +export type BackgroundWorkerTaskCreateManyArgs = $CreateManyArgs<$Schema, "BackgroundWorkerTask">; +export type BackgroundWorkerTaskCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "BackgroundWorkerTask">; +export type BackgroundWorkerTaskUpdateArgs = $UpdateArgs<$Schema, "BackgroundWorkerTask">; +export type BackgroundWorkerTaskUpdateManyArgs = $UpdateManyArgs<$Schema, "BackgroundWorkerTask">; +export type BackgroundWorkerTaskUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "BackgroundWorkerTask">; +export type BackgroundWorkerTaskUpsertArgs = $UpsertArgs<$Schema, "BackgroundWorkerTask">; +export type BackgroundWorkerTaskDeleteArgs = $DeleteArgs<$Schema, "BackgroundWorkerTask">; +export type BackgroundWorkerTaskDeleteManyArgs = $DeleteManyArgs<$Schema, "BackgroundWorkerTask">; +export type BackgroundWorkerTaskCountArgs = $CountArgs<$Schema, "BackgroundWorkerTask">; +export type BackgroundWorkerTaskAggregateArgs = $AggregateArgs<$Schema, "BackgroundWorkerTask">; +export type BackgroundWorkerTaskGroupByArgs = $GroupByArgs<$Schema, "BackgroundWorkerTask">; +export type BackgroundWorkerTaskWhereInput = $WhereInput<$Schema, "BackgroundWorkerTask">; +export type BackgroundWorkerTaskSelect = $SelectInput<$Schema, "BackgroundWorkerTask">; +export type BackgroundWorkerTaskInclude = $IncludeInput<$Schema, "BackgroundWorkerTask">; +export type BackgroundWorkerTaskOmit = $OmitInput<$Schema, "BackgroundWorkerTask">; +export type BackgroundWorkerTaskGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "BackgroundWorkerTask", Options, Args>; +export type TaskRunFindManyArgs = $FindManyArgs<$Schema, "TaskRun">; +export type TaskRunFindUniqueArgs = $FindUniqueArgs<$Schema, "TaskRun">; +export type TaskRunFindFirstArgs = $FindFirstArgs<$Schema, "TaskRun">; +export type TaskRunCreateArgs = $CreateArgs<$Schema, "TaskRun">; +export type TaskRunCreateManyArgs = $CreateManyArgs<$Schema, "TaskRun">; +export type TaskRunCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "TaskRun">; +export type TaskRunUpdateArgs = $UpdateArgs<$Schema, "TaskRun">; +export type TaskRunUpdateManyArgs = $UpdateManyArgs<$Schema, "TaskRun">; +export type TaskRunUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "TaskRun">; +export type TaskRunUpsertArgs = $UpsertArgs<$Schema, "TaskRun">; +export type TaskRunDeleteArgs = $DeleteArgs<$Schema, "TaskRun">; +export type TaskRunDeleteManyArgs = $DeleteManyArgs<$Schema, "TaskRun">; +export type TaskRunCountArgs = $CountArgs<$Schema, "TaskRun">; +export type TaskRunAggregateArgs = $AggregateArgs<$Schema, "TaskRun">; +export type TaskRunGroupByArgs = $GroupByArgs<$Schema, "TaskRun">; +export type TaskRunWhereInput = $WhereInput<$Schema, "TaskRun">; +export type TaskRunSelect = $SelectInput<$Schema, "TaskRun">; +export type TaskRunInclude = $IncludeInput<$Schema, "TaskRun">; +export type TaskRunOmit = $OmitInput<$Schema, "TaskRun">; +export type TaskRunGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "TaskRun", Options, Args>; +export type TaskRunExecutionSnapshotFindManyArgs = $FindManyArgs<$Schema, "TaskRunExecutionSnapshot">; +export type TaskRunExecutionSnapshotFindUniqueArgs = $FindUniqueArgs<$Schema, "TaskRunExecutionSnapshot">; +export type TaskRunExecutionSnapshotFindFirstArgs = $FindFirstArgs<$Schema, "TaskRunExecutionSnapshot">; +export type TaskRunExecutionSnapshotCreateArgs = $CreateArgs<$Schema, "TaskRunExecutionSnapshot">; +export type TaskRunExecutionSnapshotCreateManyArgs = $CreateManyArgs<$Schema, "TaskRunExecutionSnapshot">; +export type TaskRunExecutionSnapshotCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "TaskRunExecutionSnapshot">; +export type TaskRunExecutionSnapshotUpdateArgs = $UpdateArgs<$Schema, "TaskRunExecutionSnapshot">; +export type TaskRunExecutionSnapshotUpdateManyArgs = $UpdateManyArgs<$Schema, "TaskRunExecutionSnapshot">; +export type TaskRunExecutionSnapshotUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "TaskRunExecutionSnapshot">; +export type TaskRunExecutionSnapshotUpsertArgs = $UpsertArgs<$Schema, "TaskRunExecutionSnapshot">; +export type TaskRunExecutionSnapshotDeleteArgs = $DeleteArgs<$Schema, "TaskRunExecutionSnapshot">; +export type TaskRunExecutionSnapshotDeleteManyArgs = $DeleteManyArgs<$Schema, "TaskRunExecutionSnapshot">; +export type TaskRunExecutionSnapshotCountArgs = $CountArgs<$Schema, "TaskRunExecutionSnapshot">; +export type TaskRunExecutionSnapshotAggregateArgs = $AggregateArgs<$Schema, "TaskRunExecutionSnapshot">; +export type TaskRunExecutionSnapshotGroupByArgs = $GroupByArgs<$Schema, "TaskRunExecutionSnapshot">; +export type TaskRunExecutionSnapshotWhereInput = $WhereInput<$Schema, "TaskRunExecutionSnapshot">; +export type TaskRunExecutionSnapshotSelect = $SelectInput<$Schema, "TaskRunExecutionSnapshot">; +export type TaskRunExecutionSnapshotInclude = $IncludeInput<$Schema, "TaskRunExecutionSnapshot">; +export type TaskRunExecutionSnapshotOmit = $OmitInput<$Schema, "TaskRunExecutionSnapshot">; +export type TaskRunExecutionSnapshotGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "TaskRunExecutionSnapshot", Options, Args>; +export type TaskRunCheckpointFindManyArgs = $FindManyArgs<$Schema, "TaskRunCheckpoint">; +export type TaskRunCheckpointFindUniqueArgs = $FindUniqueArgs<$Schema, "TaskRunCheckpoint">; +export type TaskRunCheckpointFindFirstArgs = $FindFirstArgs<$Schema, "TaskRunCheckpoint">; +export type TaskRunCheckpointCreateArgs = $CreateArgs<$Schema, "TaskRunCheckpoint">; +export type TaskRunCheckpointCreateManyArgs = $CreateManyArgs<$Schema, "TaskRunCheckpoint">; +export type TaskRunCheckpointCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "TaskRunCheckpoint">; +export type TaskRunCheckpointUpdateArgs = $UpdateArgs<$Schema, "TaskRunCheckpoint">; +export type TaskRunCheckpointUpdateManyArgs = $UpdateManyArgs<$Schema, "TaskRunCheckpoint">; +export type TaskRunCheckpointUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "TaskRunCheckpoint">; +export type TaskRunCheckpointUpsertArgs = $UpsertArgs<$Schema, "TaskRunCheckpoint">; +export type TaskRunCheckpointDeleteArgs = $DeleteArgs<$Schema, "TaskRunCheckpoint">; +export type TaskRunCheckpointDeleteManyArgs = $DeleteManyArgs<$Schema, "TaskRunCheckpoint">; +export type TaskRunCheckpointCountArgs = $CountArgs<$Schema, "TaskRunCheckpoint">; +export type TaskRunCheckpointAggregateArgs = $AggregateArgs<$Schema, "TaskRunCheckpoint">; +export type TaskRunCheckpointGroupByArgs = $GroupByArgs<$Schema, "TaskRunCheckpoint">; +export type TaskRunCheckpointWhereInput = $WhereInput<$Schema, "TaskRunCheckpoint">; +export type TaskRunCheckpointSelect = $SelectInput<$Schema, "TaskRunCheckpoint">; +export type TaskRunCheckpointInclude = $IncludeInput<$Schema, "TaskRunCheckpoint">; +export type TaskRunCheckpointOmit = $OmitInput<$Schema, "TaskRunCheckpoint">; +export type TaskRunCheckpointGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "TaskRunCheckpoint", Options, Args>; +export type WaitpointFindManyArgs = $FindManyArgs<$Schema, "Waitpoint">; +export type WaitpointFindUniqueArgs = $FindUniqueArgs<$Schema, "Waitpoint">; +export type WaitpointFindFirstArgs = $FindFirstArgs<$Schema, "Waitpoint">; +export type WaitpointCreateArgs = $CreateArgs<$Schema, "Waitpoint">; +export type WaitpointCreateManyArgs = $CreateManyArgs<$Schema, "Waitpoint">; +export type WaitpointCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Waitpoint">; +export type WaitpointUpdateArgs = $UpdateArgs<$Schema, "Waitpoint">; +export type WaitpointUpdateManyArgs = $UpdateManyArgs<$Schema, "Waitpoint">; +export type WaitpointUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Waitpoint">; +export type WaitpointUpsertArgs = $UpsertArgs<$Schema, "Waitpoint">; +export type WaitpointDeleteArgs = $DeleteArgs<$Schema, "Waitpoint">; +export type WaitpointDeleteManyArgs = $DeleteManyArgs<$Schema, "Waitpoint">; +export type WaitpointCountArgs = $CountArgs<$Schema, "Waitpoint">; +export type WaitpointAggregateArgs = $AggregateArgs<$Schema, "Waitpoint">; +export type WaitpointGroupByArgs = $GroupByArgs<$Schema, "Waitpoint">; +export type WaitpointWhereInput = $WhereInput<$Schema, "Waitpoint">; +export type WaitpointSelect = $SelectInput<$Schema, "Waitpoint">; +export type WaitpointInclude = $IncludeInput<$Schema, "Waitpoint">; +export type WaitpointOmit = $OmitInput<$Schema, "Waitpoint">; +export type WaitpointGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Waitpoint", Options, Args>; +export type TaskRunWaitpointFindManyArgs = $FindManyArgs<$Schema, "TaskRunWaitpoint">; +export type TaskRunWaitpointFindUniqueArgs = $FindUniqueArgs<$Schema, "TaskRunWaitpoint">; +export type TaskRunWaitpointFindFirstArgs = $FindFirstArgs<$Schema, "TaskRunWaitpoint">; +export type TaskRunWaitpointCreateArgs = $CreateArgs<$Schema, "TaskRunWaitpoint">; +export type TaskRunWaitpointCreateManyArgs = $CreateManyArgs<$Schema, "TaskRunWaitpoint">; +export type TaskRunWaitpointCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "TaskRunWaitpoint">; +export type TaskRunWaitpointUpdateArgs = $UpdateArgs<$Schema, "TaskRunWaitpoint">; +export type TaskRunWaitpointUpdateManyArgs = $UpdateManyArgs<$Schema, "TaskRunWaitpoint">; +export type TaskRunWaitpointUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "TaskRunWaitpoint">; +export type TaskRunWaitpointUpsertArgs = $UpsertArgs<$Schema, "TaskRunWaitpoint">; +export type TaskRunWaitpointDeleteArgs = $DeleteArgs<$Schema, "TaskRunWaitpoint">; +export type TaskRunWaitpointDeleteManyArgs = $DeleteManyArgs<$Schema, "TaskRunWaitpoint">; +export type TaskRunWaitpointCountArgs = $CountArgs<$Schema, "TaskRunWaitpoint">; +export type TaskRunWaitpointAggregateArgs = $AggregateArgs<$Schema, "TaskRunWaitpoint">; +export type TaskRunWaitpointGroupByArgs = $GroupByArgs<$Schema, "TaskRunWaitpoint">; +export type TaskRunWaitpointWhereInput = $WhereInput<$Schema, "TaskRunWaitpoint">; +export type TaskRunWaitpointSelect = $SelectInput<$Schema, "TaskRunWaitpoint">; +export type TaskRunWaitpointInclude = $IncludeInput<$Schema, "TaskRunWaitpoint">; +export type TaskRunWaitpointOmit = $OmitInput<$Schema, "TaskRunWaitpoint">; +export type TaskRunWaitpointGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "TaskRunWaitpoint", Options, Args>; +export type WaitpointTagFindManyArgs = $FindManyArgs<$Schema, "WaitpointTag">; +export type WaitpointTagFindUniqueArgs = $FindUniqueArgs<$Schema, "WaitpointTag">; +export type WaitpointTagFindFirstArgs = $FindFirstArgs<$Schema, "WaitpointTag">; +export type WaitpointTagCreateArgs = $CreateArgs<$Schema, "WaitpointTag">; +export type WaitpointTagCreateManyArgs = $CreateManyArgs<$Schema, "WaitpointTag">; +export type WaitpointTagCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "WaitpointTag">; +export type WaitpointTagUpdateArgs = $UpdateArgs<$Schema, "WaitpointTag">; +export type WaitpointTagUpdateManyArgs = $UpdateManyArgs<$Schema, "WaitpointTag">; +export type WaitpointTagUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "WaitpointTag">; +export type WaitpointTagUpsertArgs = $UpsertArgs<$Schema, "WaitpointTag">; +export type WaitpointTagDeleteArgs = $DeleteArgs<$Schema, "WaitpointTag">; +export type WaitpointTagDeleteManyArgs = $DeleteManyArgs<$Schema, "WaitpointTag">; +export type WaitpointTagCountArgs = $CountArgs<$Schema, "WaitpointTag">; +export type WaitpointTagAggregateArgs = $AggregateArgs<$Schema, "WaitpointTag">; +export type WaitpointTagGroupByArgs = $GroupByArgs<$Schema, "WaitpointTag">; +export type WaitpointTagWhereInput = $WhereInput<$Schema, "WaitpointTag">; +export type WaitpointTagSelect = $SelectInput<$Schema, "WaitpointTag">; +export type WaitpointTagInclude = $IncludeInput<$Schema, "WaitpointTag">; +export type WaitpointTagOmit = $OmitInput<$Schema, "WaitpointTag">; +export type WaitpointTagGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "WaitpointTag", Options, Args>; +export type FeatureFlagFindManyArgs = $FindManyArgs<$Schema, "FeatureFlag">; +export type FeatureFlagFindUniqueArgs = $FindUniqueArgs<$Schema, "FeatureFlag">; +export type FeatureFlagFindFirstArgs = $FindFirstArgs<$Schema, "FeatureFlag">; +export type FeatureFlagCreateArgs = $CreateArgs<$Schema, "FeatureFlag">; +export type FeatureFlagCreateManyArgs = $CreateManyArgs<$Schema, "FeatureFlag">; +export type FeatureFlagCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "FeatureFlag">; +export type FeatureFlagUpdateArgs = $UpdateArgs<$Schema, "FeatureFlag">; +export type FeatureFlagUpdateManyArgs = $UpdateManyArgs<$Schema, "FeatureFlag">; +export type FeatureFlagUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "FeatureFlag">; +export type FeatureFlagUpsertArgs = $UpsertArgs<$Schema, "FeatureFlag">; +export type FeatureFlagDeleteArgs = $DeleteArgs<$Schema, "FeatureFlag">; +export type FeatureFlagDeleteManyArgs = $DeleteManyArgs<$Schema, "FeatureFlag">; +export type FeatureFlagCountArgs = $CountArgs<$Schema, "FeatureFlag">; +export type FeatureFlagAggregateArgs = $AggregateArgs<$Schema, "FeatureFlag">; +export type FeatureFlagGroupByArgs = $GroupByArgs<$Schema, "FeatureFlag">; +export type FeatureFlagWhereInput = $WhereInput<$Schema, "FeatureFlag">; +export type FeatureFlagSelect = $SelectInput<$Schema, "FeatureFlag">; +export type FeatureFlagInclude = $IncludeInput<$Schema, "FeatureFlag">; +export type FeatureFlagOmit = $OmitInput<$Schema, "FeatureFlag">; +export type FeatureFlagGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "FeatureFlag", Options, Args>; +export type WorkerInstanceFindManyArgs = $FindManyArgs<$Schema, "WorkerInstance">; +export type WorkerInstanceFindUniqueArgs = $FindUniqueArgs<$Schema, "WorkerInstance">; +export type WorkerInstanceFindFirstArgs = $FindFirstArgs<$Schema, "WorkerInstance">; +export type WorkerInstanceCreateArgs = $CreateArgs<$Schema, "WorkerInstance">; +export type WorkerInstanceCreateManyArgs = $CreateManyArgs<$Schema, "WorkerInstance">; +export type WorkerInstanceCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "WorkerInstance">; +export type WorkerInstanceUpdateArgs = $UpdateArgs<$Schema, "WorkerInstance">; +export type WorkerInstanceUpdateManyArgs = $UpdateManyArgs<$Schema, "WorkerInstance">; +export type WorkerInstanceUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "WorkerInstance">; +export type WorkerInstanceUpsertArgs = $UpsertArgs<$Schema, "WorkerInstance">; +export type WorkerInstanceDeleteArgs = $DeleteArgs<$Schema, "WorkerInstance">; +export type WorkerInstanceDeleteManyArgs = $DeleteManyArgs<$Schema, "WorkerInstance">; +export type WorkerInstanceCountArgs = $CountArgs<$Schema, "WorkerInstance">; +export type WorkerInstanceAggregateArgs = $AggregateArgs<$Schema, "WorkerInstance">; +export type WorkerInstanceGroupByArgs = $GroupByArgs<$Schema, "WorkerInstance">; +export type WorkerInstanceWhereInput = $WhereInput<$Schema, "WorkerInstance">; +export type WorkerInstanceSelect = $SelectInput<$Schema, "WorkerInstance">; +export type WorkerInstanceInclude = $IncludeInput<$Schema, "WorkerInstance">; +export type WorkerInstanceOmit = $OmitInput<$Schema, "WorkerInstance">; +export type WorkerInstanceGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "WorkerInstance", Options, Args>; +export type WorkerInstanceGroupFindManyArgs = $FindManyArgs<$Schema, "WorkerInstanceGroup">; +export type WorkerInstanceGroupFindUniqueArgs = $FindUniqueArgs<$Schema, "WorkerInstanceGroup">; +export type WorkerInstanceGroupFindFirstArgs = $FindFirstArgs<$Schema, "WorkerInstanceGroup">; +export type WorkerInstanceGroupCreateArgs = $CreateArgs<$Schema, "WorkerInstanceGroup">; +export type WorkerInstanceGroupCreateManyArgs = $CreateManyArgs<$Schema, "WorkerInstanceGroup">; +export type WorkerInstanceGroupCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "WorkerInstanceGroup">; +export type WorkerInstanceGroupUpdateArgs = $UpdateArgs<$Schema, "WorkerInstanceGroup">; +export type WorkerInstanceGroupUpdateManyArgs = $UpdateManyArgs<$Schema, "WorkerInstanceGroup">; +export type WorkerInstanceGroupUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "WorkerInstanceGroup">; +export type WorkerInstanceGroupUpsertArgs = $UpsertArgs<$Schema, "WorkerInstanceGroup">; +export type WorkerInstanceGroupDeleteArgs = $DeleteArgs<$Schema, "WorkerInstanceGroup">; +export type WorkerInstanceGroupDeleteManyArgs = $DeleteManyArgs<$Schema, "WorkerInstanceGroup">; +export type WorkerInstanceGroupCountArgs = $CountArgs<$Schema, "WorkerInstanceGroup">; +export type WorkerInstanceGroupAggregateArgs = $AggregateArgs<$Schema, "WorkerInstanceGroup">; +export type WorkerInstanceGroupGroupByArgs = $GroupByArgs<$Schema, "WorkerInstanceGroup">; +export type WorkerInstanceGroupWhereInput = $WhereInput<$Schema, "WorkerInstanceGroup">; +export type WorkerInstanceGroupSelect = $SelectInput<$Schema, "WorkerInstanceGroup">; +export type WorkerInstanceGroupInclude = $IncludeInput<$Schema, "WorkerInstanceGroup">; +export type WorkerInstanceGroupOmit = $OmitInput<$Schema, "WorkerInstanceGroup">; +export type WorkerInstanceGroupGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "WorkerInstanceGroup", Options, Args>; +export type WorkerGroupTokenFindManyArgs = $FindManyArgs<$Schema, "WorkerGroupToken">; +export type WorkerGroupTokenFindUniqueArgs = $FindUniqueArgs<$Schema, "WorkerGroupToken">; +export type WorkerGroupTokenFindFirstArgs = $FindFirstArgs<$Schema, "WorkerGroupToken">; +export type WorkerGroupTokenCreateArgs = $CreateArgs<$Schema, "WorkerGroupToken">; +export type WorkerGroupTokenCreateManyArgs = $CreateManyArgs<$Schema, "WorkerGroupToken">; +export type WorkerGroupTokenCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "WorkerGroupToken">; +export type WorkerGroupTokenUpdateArgs = $UpdateArgs<$Schema, "WorkerGroupToken">; +export type WorkerGroupTokenUpdateManyArgs = $UpdateManyArgs<$Schema, "WorkerGroupToken">; +export type WorkerGroupTokenUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "WorkerGroupToken">; +export type WorkerGroupTokenUpsertArgs = $UpsertArgs<$Schema, "WorkerGroupToken">; +export type WorkerGroupTokenDeleteArgs = $DeleteArgs<$Schema, "WorkerGroupToken">; +export type WorkerGroupTokenDeleteManyArgs = $DeleteManyArgs<$Schema, "WorkerGroupToken">; +export type WorkerGroupTokenCountArgs = $CountArgs<$Schema, "WorkerGroupToken">; +export type WorkerGroupTokenAggregateArgs = $AggregateArgs<$Schema, "WorkerGroupToken">; +export type WorkerGroupTokenGroupByArgs = $GroupByArgs<$Schema, "WorkerGroupToken">; +export type WorkerGroupTokenWhereInput = $WhereInput<$Schema, "WorkerGroupToken">; +export type WorkerGroupTokenSelect = $SelectInput<$Schema, "WorkerGroupToken">; +export type WorkerGroupTokenInclude = $IncludeInput<$Schema, "WorkerGroupToken">; +export type WorkerGroupTokenOmit = $OmitInput<$Schema, "WorkerGroupToken">; +export type WorkerGroupTokenGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "WorkerGroupToken", Options, Args>; +export type TaskRunTagFindManyArgs = $FindManyArgs<$Schema, "TaskRunTag">; +export type TaskRunTagFindUniqueArgs = $FindUniqueArgs<$Schema, "TaskRunTag">; +export type TaskRunTagFindFirstArgs = $FindFirstArgs<$Schema, "TaskRunTag">; +export type TaskRunTagCreateArgs = $CreateArgs<$Schema, "TaskRunTag">; +export type TaskRunTagCreateManyArgs = $CreateManyArgs<$Schema, "TaskRunTag">; +export type TaskRunTagCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "TaskRunTag">; +export type TaskRunTagUpdateArgs = $UpdateArgs<$Schema, "TaskRunTag">; +export type TaskRunTagUpdateManyArgs = $UpdateManyArgs<$Schema, "TaskRunTag">; +export type TaskRunTagUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "TaskRunTag">; +export type TaskRunTagUpsertArgs = $UpsertArgs<$Schema, "TaskRunTag">; +export type TaskRunTagDeleteArgs = $DeleteArgs<$Schema, "TaskRunTag">; +export type TaskRunTagDeleteManyArgs = $DeleteManyArgs<$Schema, "TaskRunTag">; +export type TaskRunTagCountArgs = $CountArgs<$Schema, "TaskRunTag">; +export type TaskRunTagAggregateArgs = $AggregateArgs<$Schema, "TaskRunTag">; +export type TaskRunTagGroupByArgs = $GroupByArgs<$Schema, "TaskRunTag">; +export type TaskRunTagWhereInput = $WhereInput<$Schema, "TaskRunTag">; +export type TaskRunTagSelect = $SelectInput<$Schema, "TaskRunTag">; +export type TaskRunTagInclude = $IncludeInput<$Schema, "TaskRunTag">; +export type TaskRunTagOmit = $OmitInput<$Schema, "TaskRunTag">; +export type TaskRunTagGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "TaskRunTag", Options, Args>; +export type TaskRunDependencyFindManyArgs = $FindManyArgs<$Schema, "TaskRunDependency">; +export type TaskRunDependencyFindUniqueArgs = $FindUniqueArgs<$Schema, "TaskRunDependency">; +export type TaskRunDependencyFindFirstArgs = $FindFirstArgs<$Schema, "TaskRunDependency">; +export type TaskRunDependencyCreateArgs = $CreateArgs<$Schema, "TaskRunDependency">; +export type TaskRunDependencyCreateManyArgs = $CreateManyArgs<$Schema, "TaskRunDependency">; +export type TaskRunDependencyCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "TaskRunDependency">; +export type TaskRunDependencyUpdateArgs = $UpdateArgs<$Schema, "TaskRunDependency">; +export type TaskRunDependencyUpdateManyArgs = $UpdateManyArgs<$Schema, "TaskRunDependency">; +export type TaskRunDependencyUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "TaskRunDependency">; +export type TaskRunDependencyUpsertArgs = $UpsertArgs<$Schema, "TaskRunDependency">; +export type TaskRunDependencyDeleteArgs = $DeleteArgs<$Schema, "TaskRunDependency">; +export type TaskRunDependencyDeleteManyArgs = $DeleteManyArgs<$Schema, "TaskRunDependency">; +export type TaskRunDependencyCountArgs = $CountArgs<$Schema, "TaskRunDependency">; +export type TaskRunDependencyAggregateArgs = $AggregateArgs<$Schema, "TaskRunDependency">; +export type TaskRunDependencyGroupByArgs = $GroupByArgs<$Schema, "TaskRunDependency">; +export type TaskRunDependencyWhereInput = $WhereInput<$Schema, "TaskRunDependency">; +export type TaskRunDependencySelect = $SelectInput<$Schema, "TaskRunDependency">; +export type TaskRunDependencyInclude = $IncludeInput<$Schema, "TaskRunDependency">; +export type TaskRunDependencyOmit = $OmitInput<$Schema, "TaskRunDependency">; +export type TaskRunDependencyGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "TaskRunDependency", Options, Args>; +export type TaskRunCounterFindManyArgs = $FindManyArgs<$Schema, "TaskRunCounter">; +export type TaskRunCounterFindUniqueArgs = $FindUniqueArgs<$Schema, "TaskRunCounter">; +export type TaskRunCounterFindFirstArgs = $FindFirstArgs<$Schema, "TaskRunCounter">; +export type TaskRunCounterCreateArgs = $CreateArgs<$Schema, "TaskRunCounter">; +export type TaskRunCounterCreateManyArgs = $CreateManyArgs<$Schema, "TaskRunCounter">; +export type TaskRunCounterCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "TaskRunCounter">; +export type TaskRunCounterUpdateArgs = $UpdateArgs<$Schema, "TaskRunCounter">; +export type TaskRunCounterUpdateManyArgs = $UpdateManyArgs<$Schema, "TaskRunCounter">; +export type TaskRunCounterUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "TaskRunCounter">; +export type TaskRunCounterUpsertArgs = $UpsertArgs<$Schema, "TaskRunCounter">; +export type TaskRunCounterDeleteArgs = $DeleteArgs<$Schema, "TaskRunCounter">; +export type TaskRunCounterDeleteManyArgs = $DeleteManyArgs<$Schema, "TaskRunCounter">; +export type TaskRunCounterCountArgs = $CountArgs<$Schema, "TaskRunCounter">; +export type TaskRunCounterAggregateArgs = $AggregateArgs<$Schema, "TaskRunCounter">; +export type TaskRunCounterGroupByArgs = $GroupByArgs<$Schema, "TaskRunCounter">; +export type TaskRunCounterWhereInput = $WhereInput<$Schema, "TaskRunCounter">; +export type TaskRunCounterSelect = $SelectInput<$Schema, "TaskRunCounter">; +export type TaskRunCounterInclude = $IncludeInput<$Schema, "TaskRunCounter">; +export type TaskRunCounterOmit = $OmitInput<$Schema, "TaskRunCounter">; +export type TaskRunCounterGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "TaskRunCounter", Options, Args>; +export type TaskRunNumberCounterFindManyArgs = $FindManyArgs<$Schema, "TaskRunNumberCounter">; +export type TaskRunNumberCounterFindUniqueArgs = $FindUniqueArgs<$Schema, "TaskRunNumberCounter">; +export type TaskRunNumberCounterFindFirstArgs = $FindFirstArgs<$Schema, "TaskRunNumberCounter">; +export type TaskRunNumberCounterCreateArgs = $CreateArgs<$Schema, "TaskRunNumberCounter">; +export type TaskRunNumberCounterCreateManyArgs = $CreateManyArgs<$Schema, "TaskRunNumberCounter">; +export type TaskRunNumberCounterCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "TaskRunNumberCounter">; +export type TaskRunNumberCounterUpdateArgs = $UpdateArgs<$Schema, "TaskRunNumberCounter">; +export type TaskRunNumberCounterUpdateManyArgs = $UpdateManyArgs<$Schema, "TaskRunNumberCounter">; +export type TaskRunNumberCounterUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "TaskRunNumberCounter">; +export type TaskRunNumberCounterUpsertArgs = $UpsertArgs<$Schema, "TaskRunNumberCounter">; +export type TaskRunNumberCounterDeleteArgs = $DeleteArgs<$Schema, "TaskRunNumberCounter">; +export type TaskRunNumberCounterDeleteManyArgs = $DeleteManyArgs<$Schema, "TaskRunNumberCounter">; +export type TaskRunNumberCounterCountArgs = $CountArgs<$Schema, "TaskRunNumberCounter">; +export type TaskRunNumberCounterAggregateArgs = $AggregateArgs<$Schema, "TaskRunNumberCounter">; +export type TaskRunNumberCounterGroupByArgs = $GroupByArgs<$Schema, "TaskRunNumberCounter">; +export type TaskRunNumberCounterWhereInput = $WhereInput<$Schema, "TaskRunNumberCounter">; +export type TaskRunNumberCounterSelect = $SelectInput<$Schema, "TaskRunNumberCounter">; +export type TaskRunNumberCounterInclude = $IncludeInput<$Schema, "TaskRunNumberCounter">; +export type TaskRunNumberCounterOmit = $OmitInput<$Schema, "TaskRunNumberCounter">; +export type TaskRunNumberCounterGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "TaskRunNumberCounter", Options, Args>; +export type TaskRunAttemptFindManyArgs = $FindManyArgs<$Schema, "TaskRunAttempt">; +export type TaskRunAttemptFindUniqueArgs = $FindUniqueArgs<$Schema, "TaskRunAttempt">; +export type TaskRunAttemptFindFirstArgs = $FindFirstArgs<$Schema, "TaskRunAttempt">; +export type TaskRunAttemptCreateArgs = $CreateArgs<$Schema, "TaskRunAttempt">; +export type TaskRunAttemptCreateManyArgs = $CreateManyArgs<$Schema, "TaskRunAttempt">; +export type TaskRunAttemptCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "TaskRunAttempt">; +export type TaskRunAttemptUpdateArgs = $UpdateArgs<$Schema, "TaskRunAttempt">; +export type TaskRunAttemptUpdateManyArgs = $UpdateManyArgs<$Schema, "TaskRunAttempt">; +export type TaskRunAttemptUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "TaskRunAttempt">; +export type TaskRunAttemptUpsertArgs = $UpsertArgs<$Schema, "TaskRunAttempt">; +export type TaskRunAttemptDeleteArgs = $DeleteArgs<$Schema, "TaskRunAttempt">; +export type TaskRunAttemptDeleteManyArgs = $DeleteManyArgs<$Schema, "TaskRunAttempt">; +export type TaskRunAttemptCountArgs = $CountArgs<$Schema, "TaskRunAttempt">; +export type TaskRunAttemptAggregateArgs = $AggregateArgs<$Schema, "TaskRunAttempt">; +export type TaskRunAttemptGroupByArgs = $GroupByArgs<$Schema, "TaskRunAttempt">; +export type TaskRunAttemptWhereInput = $WhereInput<$Schema, "TaskRunAttempt">; +export type TaskRunAttemptSelect = $SelectInput<$Schema, "TaskRunAttempt">; +export type TaskRunAttemptInclude = $IncludeInput<$Schema, "TaskRunAttempt">; +export type TaskRunAttemptOmit = $OmitInput<$Schema, "TaskRunAttempt">; +export type TaskRunAttemptGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "TaskRunAttempt", Options, Args>; +export type TaskEventFindManyArgs = $FindManyArgs<$Schema, "TaskEvent">; +export type TaskEventFindUniqueArgs = $FindUniqueArgs<$Schema, "TaskEvent">; +export type TaskEventFindFirstArgs = $FindFirstArgs<$Schema, "TaskEvent">; +export type TaskEventCreateArgs = $CreateArgs<$Schema, "TaskEvent">; +export type TaskEventCreateManyArgs = $CreateManyArgs<$Schema, "TaskEvent">; +export type TaskEventCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "TaskEvent">; +export type TaskEventUpdateArgs = $UpdateArgs<$Schema, "TaskEvent">; +export type TaskEventUpdateManyArgs = $UpdateManyArgs<$Schema, "TaskEvent">; +export type TaskEventUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "TaskEvent">; +export type TaskEventUpsertArgs = $UpsertArgs<$Schema, "TaskEvent">; +export type TaskEventDeleteArgs = $DeleteArgs<$Schema, "TaskEvent">; +export type TaskEventDeleteManyArgs = $DeleteManyArgs<$Schema, "TaskEvent">; +export type TaskEventCountArgs = $CountArgs<$Schema, "TaskEvent">; +export type TaskEventAggregateArgs = $AggregateArgs<$Schema, "TaskEvent">; +export type TaskEventGroupByArgs = $GroupByArgs<$Schema, "TaskEvent">; +export type TaskEventWhereInput = $WhereInput<$Schema, "TaskEvent">; +export type TaskEventSelect = $SelectInput<$Schema, "TaskEvent">; +export type TaskEventInclude = $IncludeInput<$Schema, "TaskEvent">; +export type TaskEventOmit = $OmitInput<$Schema, "TaskEvent">; +export type TaskEventGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "TaskEvent", Options, Args>; +export type TaskQueueFindManyArgs = $FindManyArgs<$Schema, "TaskQueue">; +export type TaskQueueFindUniqueArgs = $FindUniqueArgs<$Schema, "TaskQueue">; +export type TaskQueueFindFirstArgs = $FindFirstArgs<$Schema, "TaskQueue">; +export type TaskQueueCreateArgs = $CreateArgs<$Schema, "TaskQueue">; +export type TaskQueueCreateManyArgs = $CreateManyArgs<$Schema, "TaskQueue">; +export type TaskQueueCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "TaskQueue">; +export type TaskQueueUpdateArgs = $UpdateArgs<$Schema, "TaskQueue">; +export type TaskQueueUpdateManyArgs = $UpdateManyArgs<$Schema, "TaskQueue">; +export type TaskQueueUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "TaskQueue">; +export type TaskQueueUpsertArgs = $UpsertArgs<$Schema, "TaskQueue">; +export type TaskQueueDeleteArgs = $DeleteArgs<$Schema, "TaskQueue">; +export type TaskQueueDeleteManyArgs = $DeleteManyArgs<$Schema, "TaskQueue">; +export type TaskQueueCountArgs = $CountArgs<$Schema, "TaskQueue">; +export type TaskQueueAggregateArgs = $AggregateArgs<$Schema, "TaskQueue">; +export type TaskQueueGroupByArgs = $GroupByArgs<$Schema, "TaskQueue">; +export type TaskQueueWhereInput = $WhereInput<$Schema, "TaskQueue">; +export type TaskQueueSelect = $SelectInput<$Schema, "TaskQueue">; +export type TaskQueueInclude = $IncludeInput<$Schema, "TaskQueue">; +export type TaskQueueOmit = $OmitInput<$Schema, "TaskQueue">; +export type TaskQueueGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "TaskQueue", Options, Args>; +export type BatchTaskRunFindManyArgs = $FindManyArgs<$Schema, "BatchTaskRun">; +export type BatchTaskRunFindUniqueArgs = $FindUniqueArgs<$Schema, "BatchTaskRun">; +export type BatchTaskRunFindFirstArgs = $FindFirstArgs<$Schema, "BatchTaskRun">; +export type BatchTaskRunCreateArgs = $CreateArgs<$Schema, "BatchTaskRun">; +export type BatchTaskRunCreateManyArgs = $CreateManyArgs<$Schema, "BatchTaskRun">; +export type BatchTaskRunCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "BatchTaskRun">; +export type BatchTaskRunUpdateArgs = $UpdateArgs<$Schema, "BatchTaskRun">; +export type BatchTaskRunUpdateManyArgs = $UpdateManyArgs<$Schema, "BatchTaskRun">; +export type BatchTaskRunUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "BatchTaskRun">; +export type BatchTaskRunUpsertArgs = $UpsertArgs<$Schema, "BatchTaskRun">; +export type BatchTaskRunDeleteArgs = $DeleteArgs<$Schema, "BatchTaskRun">; +export type BatchTaskRunDeleteManyArgs = $DeleteManyArgs<$Schema, "BatchTaskRun">; +export type BatchTaskRunCountArgs = $CountArgs<$Schema, "BatchTaskRun">; +export type BatchTaskRunAggregateArgs = $AggregateArgs<$Schema, "BatchTaskRun">; +export type BatchTaskRunGroupByArgs = $GroupByArgs<$Schema, "BatchTaskRun">; +export type BatchTaskRunWhereInput = $WhereInput<$Schema, "BatchTaskRun">; +export type BatchTaskRunSelect = $SelectInput<$Schema, "BatchTaskRun">; +export type BatchTaskRunInclude = $IncludeInput<$Schema, "BatchTaskRun">; +export type BatchTaskRunOmit = $OmitInput<$Schema, "BatchTaskRun">; +export type BatchTaskRunGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "BatchTaskRun", Options, Args>; +export type BatchTaskRunItemFindManyArgs = $FindManyArgs<$Schema, "BatchTaskRunItem">; +export type BatchTaskRunItemFindUniqueArgs = $FindUniqueArgs<$Schema, "BatchTaskRunItem">; +export type BatchTaskRunItemFindFirstArgs = $FindFirstArgs<$Schema, "BatchTaskRunItem">; +export type BatchTaskRunItemCreateArgs = $CreateArgs<$Schema, "BatchTaskRunItem">; +export type BatchTaskRunItemCreateManyArgs = $CreateManyArgs<$Schema, "BatchTaskRunItem">; +export type BatchTaskRunItemCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "BatchTaskRunItem">; +export type BatchTaskRunItemUpdateArgs = $UpdateArgs<$Schema, "BatchTaskRunItem">; +export type BatchTaskRunItemUpdateManyArgs = $UpdateManyArgs<$Schema, "BatchTaskRunItem">; +export type BatchTaskRunItemUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "BatchTaskRunItem">; +export type BatchTaskRunItemUpsertArgs = $UpsertArgs<$Schema, "BatchTaskRunItem">; +export type BatchTaskRunItemDeleteArgs = $DeleteArgs<$Schema, "BatchTaskRunItem">; +export type BatchTaskRunItemDeleteManyArgs = $DeleteManyArgs<$Schema, "BatchTaskRunItem">; +export type BatchTaskRunItemCountArgs = $CountArgs<$Schema, "BatchTaskRunItem">; +export type BatchTaskRunItemAggregateArgs = $AggregateArgs<$Schema, "BatchTaskRunItem">; +export type BatchTaskRunItemGroupByArgs = $GroupByArgs<$Schema, "BatchTaskRunItem">; +export type BatchTaskRunItemWhereInput = $WhereInput<$Schema, "BatchTaskRunItem">; +export type BatchTaskRunItemSelect = $SelectInput<$Schema, "BatchTaskRunItem">; +export type BatchTaskRunItemInclude = $IncludeInput<$Schema, "BatchTaskRunItem">; +export type BatchTaskRunItemOmit = $OmitInput<$Schema, "BatchTaskRunItem">; +export type BatchTaskRunItemGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "BatchTaskRunItem", Options, Args>; +export type EnvironmentVariableFindManyArgs = $FindManyArgs<$Schema, "EnvironmentVariable">; +export type EnvironmentVariableFindUniqueArgs = $FindUniqueArgs<$Schema, "EnvironmentVariable">; +export type EnvironmentVariableFindFirstArgs = $FindFirstArgs<$Schema, "EnvironmentVariable">; +export type EnvironmentVariableCreateArgs = $CreateArgs<$Schema, "EnvironmentVariable">; +export type EnvironmentVariableCreateManyArgs = $CreateManyArgs<$Schema, "EnvironmentVariable">; +export type EnvironmentVariableCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "EnvironmentVariable">; +export type EnvironmentVariableUpdateArgs = $UpdateArgs<$Schema, "EnvironmentVariable">; +export type EnvironmentVariableUpdateManyArgs = $UpdateManyArgs<$Schema, "EnvironmentVariable">; +export type EnvironmentVariableUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "EnvironmentVariable">; +export type EnvironmentVariableUpsertArgs = $UpsertArgs<$Schema, "EnvironmentVariable">; +export type EnvironmentVariableDeleteArgs = $DeleteArgs<$Schema, "EnvironmentVariable">; +export type EnvironmentVariableDeleteManyArgs = $DeleteManyArgs<$Schema, "EnvironmentVariable">; +export type EnvironmentVariableCountArgs = $CountArgs<$Schema, "EnvironmentVariable">; +export type EnvironmentVariableAggregateArgs = $AggregateArgs<$Schema, "EnvironmentVariable">; +export type EnvironmentVariableGroupByArgs = $GroupByArgs<$Schema, "EnvironmentVariable">; +export type EnvironmentVariableWhereInput = $WhereInput<$Schema, "EnvironmentVariable">; +export type EnvironmentVariableSelect = $SelectInput<$Schema, "EnvironmentVariable">; +export type EnvironmentVariableInclude = $IncludeInput<$Schema, "EnvironmentVariable">; +export type EnvironmentVariableOmit = $OmitInput<$Schema, "EnvironmentVariable">; +export type EnvironmentVariableGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "EnvironmentVariable", Options, Args>; +export type EnvironmentVariableValueFindManyArgs = $FindManyArgs<$Schema, "EnvironmentVariableValue">; +export type EnvironmentVariableValueFindUniqueArgs = $FindUniqueArgs<$Schema, "EnvironmentVariableValue">; +export type EnvironmentVariableValueFindFirstArgs = $FindFirstArgs<$Schema, "EnvironmentVariableValue">; +export type EnvironmentVariableValueCreateArgs = $CreateArgs<$Schema, "EnvironmentVariableValue">; +export type EnvironmentVariableValueCreateManyArgs = $CreateManyArgs<$Schema, "EnvironmentVariableValue">; +export type EnvironmentVariableValueCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "EnvironmentVariableValue">; +export type EnvironmentVariableValueUpdateArgs = $UpdateArgs<$Schema, "EnvironmentVariableValue">; +export type EnvironmentVariableValueUpdateManyArgs = $UpdateManyArgs<$Schema, "EnvironmentVariableValue">; +export type EnvironmentVariableValueUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "EnvironmentVariableValue">; +export type EnvironmentVariableValueUpsertArgs = $UpsertArgs<$Schema, "EnvironmentVariableValue">; +export type EnvironmentVariableValueDeleteArgs = $DeleteArgs<$Schema, "EnvironmentVariableValue">; +export type EnvironmentVariableValueDeleteManyArgs = $DeleteManyArgs<$Schema, "EnvironmentVariableValue">; +export type EnvironmentVariableValueCountArgs = $CountArgs<$Schema, "EnvironmentVariableValue">; +export type EnvironmentVariableValueAggregateArgs = $AggregateArgs<$Schema, "EnvironmentVariableValue">; +export type EnvironmentVariableValueGroupByArgs = $GroupByArgs<$Schema, "EnvironmentVariableValue">; +export type EnvironmentVariableValueWhereInput = $WhereInput<$Schema, "EnvironmentVariableValue">; +export type EnvironmentVariableValueSelect = $SelectInput<$Schema, "EnvironmentVariableValue">; +export type EnvironmentVariableValueInclude = $IncludeInput<$Schema, "EnvironmentVariableValue">; +export type EnvironmentVariableValueOmit = $OmitInput<$Schema, "EnvironmentVariableValue">; +export type EnvironmentVariableValueGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "EnvironmentVariableValue", Options, Args>; +export type CheckpointFindManyArgs = $FindManyArgs<$Schema, "Checkpoint">; +export type CheckpointFindUniqueArgs = $FindUniqueArgs<$Schema, "Checkpoint">; +export type CheckpointFindFirstArgs = $FindFirstArgs<$Schema, "Checkpoint">; +export type CheckpointCreateArgs = $CreateArgs<$Schema, "Checkpoint">; +export type CheckpointCreateManyArgs = $CreateManyArgs<$Schema, "Checkpoint">; +export type CheckpointCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Checkpoint">; +export type CheckpointUpdateArgs = $UpdateArgs<$Schema, "Checkpoint">; +export type CheckpointUpdateManyArgs = $UpdateManyArgs<$Schema, "Checkpoint">; +export type CheckpointUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Checkpoint">; +export type CheckpointUpsertArgs = $UpsertArgs<$Schema, "Checkpoint">; +export type CheckpointDeleteArgs = $DeleteArgs<$Schema, "Checkpoint">; +export type CheckpointDeleteManyArgs = $DeleteManyArgs<$Schema, "Checkpoint">; +export type CheckpointCountArgs = $CountArgs<$Schema, "Checkpoint">; +export type CheckpointAggregateArgs = $AggregateArgs<$Schema, "Checkpoint">; +export type CheckpointGroupByArgs = $GroupByArgs<$Schema, "Checkpoint">; +export type CheckpointWhereInput = $WhereInput<$Schema, "Checkpoint">; +export type CheckpointSelect = $SelectInput<$Schema, "Checkpoint">; +export type CheckpointInclude = $IncludeInput<$Schema, "Checkpoint">; +export type CheckpointOmit = $OmitInput<$Schema, "Checkpoint">; +export type CheckpointGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Checkpoint", Options, Args>; +export type CheckpointRestoreEventFindManyArgs = $FindManyArgs<$Schema, "CheckpointRestoreEvent">; +export type CheckpointRestoreEventFindUniqueArgs = $FindUniqueArgs<$Schema, "CheckpointRestoreEvent">; +export type CheckpointRestoreEventFindFirstArgs = $FindFirstArgs<$Schema, "CheckpointRestoreEvent">; +export type CheckpointRestoreEventCreateArgs = $CreateArgs<$Schema, "CheckpointRestoreEvent">; +export type CheckpointRestoreEventCreateManyArgs = $CreateManyArgs<$Schema, "CheckpointRestoreEvent">; +export type CheckpointRestoreEventCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "CheckpointRestoreEvent">; +export type CheckpointRestoreEventUpdateArgs = $UpdateArgs<$Schema, "CheckpointRestoreEvent">; +export type CheckpointRestoreEventUpdateManyArgs = $UpdateManyArgs<$Schema, "CheckpointRestoreEvent">; +export type CheckpointRestoreEventUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "CheckpointRestoreEvent">; +export type CheckpointRestoreEventUpsertArgs = $UpsertArgs<$Schema, "CheckpointRestoreEvent">; +export type CheckpointRestoreEventDeleteArgs = $DeleteArgs<$Schema, "CheckpointRestoreEvent">; +export type CheckpointRestoreEventDeleteManyArgs = $DeleteManyArgs<$Schema, "CheckpointRestoreEvent">; +export type CheckpointRestoreEventCountArgs = $CountArgs<$Schema, "CheckpointRestoreEvent">; +export type CheckpointRestoreEventAggregateArgs = $AggregateArgs<$Schema, "CheckpointRestoreEvent">; +export type CheckpointRestoreEventGroupByArgs = $GroupByArgs<$Schema, "CheckpointRestoreEvent">; +export type CheckpointRestoreEventWhereInput = $WhereInput<$Schema, "CheckpointRestoreEvent">; +export type CheckpointRestoreEventSelect = $SelectInput<$Schema, "CheckpointRestoreEvent">; +export type CheckpointRestoreEventInclude = $IncludeInput<$Schema, "CheckpointRestoreEvent">; +export type CheckpointRestoreEventOmit = $OmitInput<$Schema, "CheckpointRestoreEvent">; +export type CheckpointRestoreEventGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "CheckpointRestoreEvent", Options, Args>; +export type WorkerDeploymentFindManyArgs = $FindManyArgs<$Schema, "WorkerDeployment">; +export type WorkerDeploymentFindUniqueArgs = $FindUniqueArgs<$Schema, "WorkerDeployment">; +export type WorkerDeploymentFindFirstArgs = $FindFirstArgs<$Schema, "WorkerDeployment">; +export type WorkerDeploymentCreateArgs = $CreateArgs<$Schema, "WorkerDeployment">; +export type WorkerDeploymentCreateManyArgs = $CreateManyArgs<$Schema, "WorkerDeployment">; +export type WorkerDeploymentCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "WorkerDeployment">; +export type WorkerDeploymentUpdateArgs = $UpdateArgs<$Schema, "WorkerDeployment">; +export type WorkerDeploymentUpdateManyArgs = $UpdateManyArgs<$Schema, "WorkerDeployment">; +export type WorkerDeploymentUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "WorkerDeployment">; +export type WorkerDeploymentUpsertArgs = $UpsertArgs<$Schema, "WorkerDeployment">; +export type WorkerDeploymentDeleteArgs = $DeleteArgs<$Schema, "WorkerDeployment">; +export type WorkerDeploymentDeleteManyArgs = $DeleteManyArgs<$Schema, "WorkerDeployment">; +export type WorkerDeploymentCountArgs = $CountArgs<$Schema, "WorkerDeployment">; +export type WorkerDeploymentAggregateArgs = $AggregateArgs<$Schema, "WorkerDeployment">; +export type WorkerDeploymentGroupByArgs = $GroupByArgs<$Schema, "WorkerDeployment">; +export type WorkerDeploymentWhereInput = $WhereInput<$Schema, "WorkerDeployment">; +export type WorkerDeploymentSelect = $SelectInput<$Schema, "WorkerDeployment">; +export type WorkerDeploymentInclude = $IncludeInput<$Schema, "WorkerDeployment">; +export type WorkerDeploymentOmit = $OmitInput<$Schema, "WorkerDeployment">; +export type WorkerDeploymentGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "WorkerDeployment", Options, Args>; +export type WorkerDeploymentPromotionFindManyArgs = $FindManyArgs<$Schema, "WorkerDeploymentPromotion">; +export type WorkerDeploymentPromotionFindUniqueArgs = $FindUniqueArgs<$Schema, "WorkerDeploymentPromotion">; +export type WorkerDeploymentPromotionFindFirstArgs = $FindFirstArgs<$Schema, "WorkerDeploymentPromotion">; +export type WorkerDeploymentPromotionCreateArgs = $CreateArgs<$Schema, "WorkerDeploymentPromotion">; +export type WorkerDeploymentPromotionCreateManyArgs = $CreateManyArgs<$Schema, "WorkerDeploymentPromotion">; +export type WorkerDeploymentPromotionCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "WorkerDeploymentPromotion">; +export type WorkerDeploymentPromotionUpdateArgs = $UpdateArgs<$Schema, "WorkerDeploymentPromotion">; +export type WorkerDeploymentPromotionUpdateManyArgs = $UpdateManyArgs<$Schema, "WorkerDeploymentPromotion">; +export type WorkerDeploymentPromotionUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "WorkerDeploymentPromotion">; +export type WorkerDeploymentPromotionUpsertArgs = $UpsertArgs<$Schema, "WorkerDeploymentPromotion">; +export type WorkerDeploymentPromotionDeleteArgs = $DeleteArgs<$Schema, "WorkerDeploymentPromotion">; +export type WorkerDeploymentPromotionDeleteManyArgs = $DeleteManyArgs<$Schema, "WorkerDeploymentPromotion">; +export type WorkerDeploymentPromotionCountArgs = $CountArgs<$Schema, "WorkerDeploymentPromotion">; +export type WorkerDeploymentPromotionAggregateArgs = $AggregateArgs<$Schema, "WorkerDeploymentPromotion">; +export type WorkerDeploymentPromotionGroupByArgs = $GroupByArgs<$Schema, "WorkerDeploymentPromotion">; +export type WorkerDeploymentPromotionWhereInput = $WhereInput<$Schema, "WorkerDeploymentPromotion">; +export type WorkerDeploymentPromotionSelect = $SelectInput<$Schema, "WorkerDeploymentPromotion">; +export type WorkerDeploymentPromotionInclude = $IncludeInput<$Schema, "WorkerDeploymentPromotion">; +export type WorkerDeploymentPromotionOmit = $OmitInput<$Schema, "WorkerDeploymentPromotion">; +export type WorkerDeploymentPromotionGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "WorkerDeploymentPromotion", Options, Args>; +export type TaskScheduleFindManyArgs = $FindManyArgs<$Schema, "TaskSchedule">; +export type TaskScheduleFindUniqueArgs = $FindUniqueArgs<$Schema, "TaskSchedule">; +export type TaskScheduleFindFirstArgs = $FindFirstArgs<$Schema, "TaskSchedule">; +export type TaskScheduleCreateArgs = $CreateArgs<$Schema, "TaskSchedule">; +export type TaskScheduleCreateManyArgs = $CreateManyArgs<$Schema, "TaskSchedule">; +export type TaskScheduleCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "TaskSchedule">; +export type TaskScheduleUpdateArgs = $UpdateArgs<$Schema, "TaskSchedule">; +export type TaskScheduleUpdateManyArgs = $UpdateManyArgs<$Schema, "TaskSchedule">; +export type TaskScheduleUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "TaskSchedule">; +export type TaskScheduleUpsertArgs = $UpsertArgs<$Schema, "TaskSchedule">; +export type TaskScheduleDeleteArgs = $DeleteArgs<$Schema, "TaskSchedule">; +export type TaskScheduleDeleteManyArgs = $DeleteManyArgs<$Schema, "TaskSchedule">; +export type TaskScheduleCountArgs = $CountArgs<$Schema, "TaskSchedule">; +export type TaskScheduleAggregateArgs = $AggregateArgs<$Schema, "TaskSchedule">; +export type TaskScheduleGroupByArgs = $GroupByArgs<$Schema, "TaskSchedule">; +export type TaskScheduleWhereInput = $WhereInput<$Schema, "TaskSchedule">; +export type TaskScheduleSelect = $SelectInput<$Schema, "TaskSchedule">; +export type TaskScheduleInclude = $IncludeInput<$Schema, "TaskSchedule">; +export type TaskScheduleOmit = $OmitInput<$Schema, "TaskSchedule">; +export type TaskScheduleGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "TaskSchedule", Options, Args>; +export type TaskScheduleInstanceFindManyArgs = $FindManyArgs<$Schema, "TaskScheduleInstance">; +export type TaskScheduleInstanceFindUniqueArgs = $FindUniqueArgs<$Schema, "TaskScheduleInstance">; +export type TaskScheduleInstanceFindFirstArgs = $FindFirstArgs<$Schema, "TaskScheduleInstance">; +export type TaskScheduleInstanceCreateArgs = $CreateArgs<$Schema, "TaskScheduleInstance">; +export type TaskScheduleInstanceCreateManyArgs = $CreateManyArgs<$Schema, "TaskScheduleInstance">; +export type TaskScheduleInstanceCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "TaskScheduleInstance">; +export type TaskScheduleInstanceUpdateArgs = $UpdateArgs<$Schema, "TaskScheduleInstance">; +export type TaskScheduleInstanceUpdateManyArgs = $UpdateManyArgs<$Schema, "TaskScheduleInstance">; +export type TaskScheduleInstanceUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "TaskScheduleInstance">; +export type TaskScheduleInstanceUpsertArgs = $UpsertArgs<$Schema, "TaskScheduleInstance">; +export type TaskScheduleInstanceDeleteArgs = $DeleteArgs<$Schema, "TaskScheduleInstance">; +export type TaskScheduleInstanceDeleteManyArgs = $DeleteManyArgs<$Schema, "TaskScheduleInstance">; +export type TaskScheduleInstanceCountArgs = $CountArgs<$Schema, "TaskScheduleInstance">; +export type TaskScheduleInstanceAggregateArgs = $AggregateArgs<$Schema, "TaskScheduleInstance">; +export type TaskScheduleInstanceGroupByArgs = $GroupByArgs<$Schema, "TaskScheduleInstance">; +export type TaskScheduleInstanceWhereInput = $WhereInput<$Schema, "TaskScheduleInstance">; +export type TaskScheduleInstanceSelect = $SelectInput<$Schema, "TaskScheduleInstance">; +export type TaskScheduleInstanceInclude = $IncludeInput<$Schema, "TaskScheduleInstance">; +export type TaskScheduleInstanceOmit = $OmitInput<$Schema, "TaskScheduleInstance">; +export type TaskScheduleInstanceGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "TaskScheduleInstance", Options, Args>; +export type RuntimeEnvironmentSessionFindManyArgs = $FindManyArgs<$Schema, "RuntimeEnvironmentSession">; +export type RuntimeEnvironmentSessionFindUniqueArgs = $FindUniqueArgs<$Schema, "RuntimeEnvironmentSession">; +export type RuntimeEnvironmentSessionFindFirstArgs = $FindFirstArgs<$Schema, "RuntimeEnvironmentSession">; +export type RuntimeEnvironmentSessionCreateArgs = $CreateArgs<$Schema, "RuntimeEnvironmentSession">; +export type RuntimeEnvironmentSessionCreateManyArgs = $CreateManyArgs<$Schema, "RuntimeEnvironmentSession">; +export type RuntimeEnvironmentSessionCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "RuntimeEnvironmentSession">; +export type RuntimeEnvironmentSessionUpdateArgs = $UpdateArgs<$Schema, "RuntimeEnvironmentSession">; +export type RuntimeEnvironmentSessionUpdateManyArgs = $UpdateManyArgs<$Schema, "RuntimeEnvironmentSession">; +export type RuntimeEnvironmentSessionUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "RuntimeEnvironmentSession">; +export type RuntimeEnvironmentSessionUpsertArgs = $UpsertArgs<$Schema, "RuntimeEnvironmentSession">; +export type RuntimeEnvironmentSessionDeleteArgs = $DeleteArgs<$Schema, "RuntimeEnvironmentSession">; +export type RuntimeEnvironmentSessionDeleteManyArgs = $DeleteManyArgs<$Schema, "RuntimeEnvironmentSession">; +export type RuntimeEnvironmentSessionCountArgs = $CountArgs<$Schema, "RuntimeEnvironmentSession">; +export type RuntimeEnvironmentSessionAggregateArgs = $AggregateArgs<$Schema, "RuntimeEnvironmentSession">; +export type RuntimeEnvironmentSessionGroupByArgs = $GroupByArgs<$Schema, "RuntimeEnvironmentSession">; +export type RuntimeEnvironmentSessionWhereInput = $WhereInput<$Schema, "RuntimeEnvironmentSession">; +export type RuntimeEnvironmentSessionSelect = $SelectInput<$Schema, "RuntimeEnvironmentSession">; +export type RuntimeEnvironmentSessionInclude = $IncludeInput<$Schema, "RuntimeEnvironmentSession">; +export type RuntimeEnvironmentSessionOmit = $OmitInput<$Schema, "RuntimeEnvironmentSession">; +export type RuntimeEnvironmentSessionGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "RuntimeEnvironmentSession", Options, Args>; +export type ProjectAlertChannelFindManyArgs = $FindManyArgs<$Schema, "ProjectAlertChannel">; +export type ProjectAlertChannelFindUniqueArgs = $FindUniqueArgs<$Schema, "ProjectAlertChannel">; +export type ProjectAlertChannelFindFirstArgs = $FindFirstArgs<$Schema, "ProjectAlertChannel">; +export type ProjectAlertChannelCreateArgs = $CreateArgs<$Schema, "ProjectAlertChannel">; +export type ProjectAlertChannelCreateManyArgs = $CreateManyArgs<$Schema, "ProjectAlertChannel">; +export type ProjectAlertChannelCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "ProjectAlertChannel">; +export type ProjectAlertChannelUpdateArgs = $UpdateArgs<$Schema, "ProjectAlertChannel">; +export type ProjectAlertChannelUpdateManyArgs = $UpdateManyArgs<$Schema, "ProjectAlertChannel">; +export type ProjectAlertChannelUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "ProjectAlertChannel">; +export type ProjectAlertChannelUpsertArgs = $UpsertArgs<$Schema, "ProjectAlertChannel">; +export type ProjectAlertChannelDeleteArgs = $DeleteArgs<$Schema, "ProjectAlertChannel">; +export type ProjectAlertChannelDeleteManyArgs = $DeleteManyArgs<$Schema, "ProjectAlertChannel">; +export type ProjectAlertChannelCountArgs = $CountArgs<$Schema, "ProjectAlertChannel">; +export type ProjectAlertChannelAggregateArgs = $AggregateArgs<$Schema, "ProjectAlertChannel">; +export type ProjectAlertChannelGroupByArgs = $GroupByArgs<$Schema, "ProjectAlertChannel">; +export type ProjectAlertChannelWhereInput = $WhereInput<$Schema, "ProjectAlertChannel">; +export type ProjectAlertChannelSelect = $SelectInput<$Schema, "ProjectAlertChannel">; +export type ProjectAlertChannelInclude = $IncludeInput<$Schema, "ProjectAlertChannel">; +export type ProjectAlertChannelOmit = $OmitInput<$Schema, "ProjectAlertChannel">; +export type ProjectAlertChannelGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "ProjectAlertChannel", Options, Args>; +export type ProjectAlertFindManyArgs = $FindManyArgs<$Schema, "ProjectAlert">; +export type ProjectAlertFindUniqueArgs = $FindUniqueArgs<$Schema, "ProjectAlert">; +export type ProjectAlertFindFirstArgs = $FindFirstArgs<$Schema, "ProjectAlert">; +export type ProjectAlertCreateArgs = $CreateArgs<$Schema, "ProjectAlert">; +export type ProjectAlertCreateManyArgs = $CreateManyArgs<$Schema, "ProjectAlert">; +export type ProjectAlertCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "ProjectAlert">; +export type ProjectAlertUpdateArgs = $UpdateArgs<$Schema, "ProjectAlert">; +export type ProjectAlertUpdateManyArgs = $UpdateManyArgs<$Schema, "ProjectAlert">; +export type ProjectAlertUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "ProjectAlert">; +export type ProjectAlertUpsertArgs = $UpsertArgs<$Schema, "ProjectAlert">; +export type ProjectAlertDeleteArgs = $DeleteArgs<$Schema, "ProjectAlert">; +export type ProjectAlertDeleteManyArgs = $DeleteManyArgs<$Schema, "ProjectAlert">; +export type ProjectAlertCountArgs = $CountArgs<$Schema, "ProjectAlert">; +export type ProjectAlertAggregateArgs = $AggregateArgs<$Schema, "ProjectAlert">; +export type ProjectAlertGroupByArgs = $GroupByArgs<$Schema, "ProjectAlert">; +export type ProjectAlertWhereInput = $WhereInput<$Schema, "ProjectAlert">; +export type ProjectAlertSelect = $SelectInput<$Schema, "ProjectAlert">; +export type ProjectAlertInclude = $IncludeInput<$Schema, "ProjectAlert">; +export type ProjectAlertOmit = $OmitInput<$Schema, "ProjectAlert">; +export type ProjectAlertGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "ProjectAlert", Options, Args>; +export type ProjectAlertStorageFindManyArgs = $FindManyArgs<$Schema, "ProjectAlertStorage">; +export type ProjectAlertStorageFindUniqueArgs = $FindUniqueArgs<$Schema, "ProjectAlertStorage">; +export type ProjectAlertStorageFindFirstArgs = $FindFirstArgs<$Schema, "ProjectAlertStorage">; +export type ProjectAlertStorageCreateArgs = $CreateArgs<$Schema, "ProjectAlertStorage">; +export type ProjectAlertStorageCreateManyArgs = $CreateManyArgs<$Schema, "ProjectAlertStorage">; +export type ProjectAlertStorageCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "ProjectAlertStorage">; +export type ProjectAlertStorageUpdateArgs = $UpdateArgs<$Schema, "ProjectAlertStorage">; +export type ProjectAlertStorageUpdateManyArgs = $UpdateManyArgs<$Schema, "ProjectAlertStorage">; +export type ProjectAlertStorageUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "ProjectAlertStorage">; +export type ProjectAlertStorageUpsertArgs = $UpsertArgs<$Schema, "ProjectAlertStorage">; +export type ProjectAlertStorageDeleteArgs = $DeleteArgs<$Schema, "ProjectAlertStorage">; +export type ProjectAlertStorageDeleteManyArgs = $DeleteManyArgs<$Schema, "ProjectAlertStorage">; +export type ProjectAlertStorageCountArgs = $CountArgs<$Schema, "ProjectAlertStorage">; +export type ProjectAlertStorageAggregateArgs = $AggregateArgs<$Schema, "ProjectAlertStorage">; +export type ProjectAlertStorageGroupByArgs = $GroupByArgs<$Schema, "ProjectAlertStorage">; +export type ProjectAlertStorageWhereInput = $WhereInput<$Schema, "ProjectAlertStorage">; +export type ProjectAlertStorageSelect = $SelectInput<$Schema, "ProjectAlertStorage">; +export type ProjectAlertStorageInclude = $IncludeInput<$Schema, "ProjectAlertStorage">; +export type ProjectAlertStorageOmit = $OmitInput<$Schema, "ProjectAlertStorage">; +export type ProjectAlertStorageGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "ProjectAlertStorage", Options, Args>; +export type OrganizationIntegrationFindManyArgs = $FindManyArgs<$Schema, "OrganizationIntegration">; +export type OrganizationIntegrationFindUniqueArgs = $FindUniqueArgs<$Schema, "OrganizationIntegration">; +export type OrganizationIntegrationFindFirstArgs = $FindFirstArgs<$Schema, "OrganizationIntegration">; +export type OrganizationIntegrationCreateArgs = $CreateArgs<$Schema, "OrganizationIntegration">; +export type OrganizationIntegrationCreateManyArgs = $CreateManyArgs<$Schema, "OrganizationIntegration">; +export type OrganizationIntegrationCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "OrganizationIntegration">; +export type OrganizationIntegrationUpdateArgs = $UpdateArgs<$Schema, "OrganizationIntegration">; +export type OrganizationIntegrationUpdateManyArgs = $UpdateManyArgs<$Schema, "OrganizationIntegration">; +export type OrganizationIntegrationUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "OrganizationIntegration">; +export type OrganizationIntegrationUpsertArgs = $UpsertArgs<$Schema, "OrganizationIntegration">; +export type OrganizationIntegrationDeleteArgs = $DeleteArgs<$Schema, "OrganizationIntegration">; +export type OrganizationIntegrationDeleteManyArgs = $DeleteManyArgs<$Schema, "OrganizationIntegration">; +export type OrganizationIntegrationCountArgs = $CountArgs<$Schema, "OrganizationIntegration">; +export type OrganizationIntegrationAggregateArgs = $AggregateArgs<$Schema, "OrganizationIntegration">; +export type OrganizationIntegrationGroupByArgs = $GroupByArgs<$Schema, "OrganizationIntegration">; +export type OrganizationIntegrationWhereInput = $WhereInput<$Schema, "OrganizationIntegration">; +export type OrganizationIntegrationSelect = $SelectInput<$Schema, "OrganizationIntegration">; +export type OrganizationIntegrationInclude = $IncludeInput<$Schema, "OrganizationIntegration">; +export type OrganizationIntegrationOmit = $OmitInput<$Schema, "OrganizationIntegration">; +export type OrganizationIntegrationGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "OrganizationIntegration", Options, Args>; +export type BulkActionGroupFindManyArgs = $FindManyArgs<$Schema, "BulkActionGroup">; +export type BulkActionGroupFindUniqueArgs = $FindUniqueArgs<$Schema, "BulkActionGroup">; +export type BulkActionGroupFindFirstArgs = $FindFirstArgs<$Schema, "BulkActionGroup">; +export type BulkActionGroupCreateArgs = $CreateArgs<$Schema, "BulkActionGroup">; +export type BulkActionGroupCreateManyArgs = $CreateManyArgs<$Schema, "BulkActionGroup">; +export type BulkActionGroupCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "BulkActionGroup">; +export type BulkActionGroupUpdateArgs = $UpdateArgs<$Schema, "BulkActionGroup">; +export type BulkActionGroupUpdateManyArgs = $UpdateManyArgs<$Schema, "BulkActionGroup">; +export type BulkActionGroupUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "BulkActionGroup">; +export type BulkActionGroupUpsertArgs = $UpsertArgs<$Schema, "BulkActionGroup">; +export type BulkActionGroupDeleteArgs = $DeleteArgs<$Schema, "BulkActionGroup">; +export type BulkActionGroupDeleteManyArgs = $DeleteManyArgs<$Schema, "BulkActionGroup">; +export type BulkActionGroupCountArgs = $CountArgs<$Schema, "BulkActionGroup">; +export type BulkActionGroupAggregateArgs = $AggregateArgs<$Schema, "BulkActionGroup">; +export type BulkActionGroupGroupByArgs = $GroupByArgs<$Schema, "BulkActionGroup">; +export type BulkActionGroupWhereInput = $WhereInput<$Schema, "BulkActionGroup">; +export type BulkActionGroupSelect = $SelectInput<$Schema, "BulkActionGroup">; +export type BulkActionGroupInclude = $IncludeInput<$Schema, "BulkActionGroup">; +export type BulkActionGroupOmit = $OmitInput<$Schema, "BulkActionGroup">; +export type BulkActionGroupGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "BulkActionGroup", Options, Args>; +export type BulkActionItemFindManyArgs = $FindManyArgs<$Schema, "BulkActionItem">; +export type BulkActionItemFindUniqueArgs = $FindUniqueArgs<$Schema, "BulkActionItem">; +export type BulkActionItemFindFirstArgs = $FindFirstArgs<$Schema, "BulkActionItem">; +export type BulkActionItemCreateArgs = $CreateArgs<$Schema, "BulkActionItem">; +export type BulkActionItemCreateManyArgs = $CreateManyArgs<$Schema, "BulkActionItem">; +export type BulkActionItemCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "BulkActionItem">; +export type BulkActionItemUpdateArgs = $UpdateArgs<$Schema, "BulkActionItem">; +export type BulkActionItemUpdateManyArgs = $UpdateManyArgs<$Schema, "BulkActionItem">; +export type BulkActionItemUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "BulkActionItem">; +export type BulkActionItemUpsertArgs = $UpsertArgs<$Schema, "BulkActionItem">; +export type BulkActionItemDeleteArgs = $DeleteArgs<$Schema, "BulkActionItem">; +export type BulkActionItemDeleteManyArgs = $DeleteManyArgs<$Schema, "BulkActionItem">; +export type BulkActionItemCountArgs = $CountArgs<$Schema, "BulkActionItem">; +export type BulkActionItemAggregateArgs = $AggregateArgs<$Schema, "BulkActionItem">; +export type BulkActionItemGroupByArgs = $GroupByArgs<$Schema, "BulkActionItem">; +export type BulkActionItemWhereInput = $WhereInput<$Schema, "BulkActionItem">; +export type BulkActionItemSelect = $SelectInput<$Schema, "BulkActionItem">; +export type BulkActionItemInclude = $IncludeInput<$Schema, "BulkActionItem">; +export type BulkActionItemOmit = $OmitInput<$Schema, "BulkActionItem">; +export type BulkActionItemGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "BulkActionItem", Options, Args>; +export type RealtimeStreamChunkFindManyArgs = $FindManyArgs<$Schema, "RealtimeStreamChunk">; +export type RealtimeStreamChunkFindUniqueArgs = $FindUniqueArgs<$Schema, "RealtimeStreamChunk">; +export type RealtimeStreamChunkFindFirstArgs = $FindFirstArgs<$Schema, "RealtimeStreamChunk">; +export type RealtimeStreamChunkCreateArgs = $CreateArgs<$Schema, "RealtimeStreamChunk">; +export type RealtimeStreamChunkCreateManyArgs = $CreateManyArgs<$Schema, "RealtimeStreamChunk">; +export type RealtimeStreamChunkCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "RealtimeStreamChunk">; +export type RealtimeStreamChunkUpdateArgs = $UpdateArgs<$Schema, "RealtimeStreamChunk">; +export type RealtimeStreamChunkUpdateManyArgs = $UpdateManyArgs<$Schema, "RealtimeStreamChunk">; +export type RealtimeStreamChunkUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "RealtimeStreamChunk">; +export type RealtimeStreamChunkUpsertArgs = $UpsertArgs<$Schema, "RealtimeStreamChunk">; +export type RealtimeStreamChunkDeleteArgs = $DeleteArgs<$Schema, "RealtimeStreamChunk">; +export type RealtimeStreamChunkDeleteManyArgs = $DeleteManyArgs<$Schema, "RealtimeStreamChunk">; +export type RealtimeStreamChunkCountArgs = $CountArgs<$Schema, "RealtimeStreamChunk">; +export type RealtimeStreamChunkAggregateArgs = $AggregateArgs<$Schema, "RealtimeStreamChunk">; +export type RealtimeStreamChunkGroupByArgs = $GroupByArgs<$Schema, "RealtimeStreamChunk">; +export type RealtimeStreamChunkWhereInput = $WhereInput<$Schema, "RealtimeStreamChunk">; +export type RealtimeStreamChunkSelect = $SelectInput<$Schema, "RealtimeStreamChunk">; +export type RealtimeStreamChunkInclude = $IncludeInput<$Schema, "RealtimeStreamChunk">; +export type RealtimeStreamChunkOmit = $OmitInput<$Schema, "RealtimeStreamChunk">; +export type RealtimeStreamChunkGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "RealtimeStreamChunk", Options, Args>; +export type TaskEventPartitionedFindManyArgs = $FindManyArgs<$Schema, "TaskEventPartitioned">; +export type TaskEventPartitionedFindUniqueArgs = $FindUniqueArgs<$Schema, "TaskEventPartitioned">; +export type TaskEventPartitionedFindFirstArgs = $FindFirstArgs<$Schema, "TaskEventPartitioned">; +export type TaskEventPartitionedCreateArgs = $CreateArgs<$Schema, "TaskEventPartitioned">; +export type TaskEventPartitionedCreateManyArgs = $CreateManyArgs<$Schema, "TaskEventPartitioned">; +export type TaskEventPartitionedCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "TaskEventPartitioned">; +export type TaskEventPartitionedUpdateArgs = $UpdateArgs<$Schema, "TaskEventPartitioned">; +export type TaskEventPartitionedUpdateManyArgs = $UpdateManyArgs<$Schema, "TaskEventPartitioned">; +export type TaskEventPartitionedUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "TaskEventPartitioned">; +export type TaskEventPartitionedUpsertArgs = $UpsertArgs<$Schema, "TaskEventPartitioned">; +export type TaskEventPartitionedDeleteArgs = $DeleteArgs<$Schema, "TaskEventPartitioned">; +export type TaskEventPartitionedDeleteManyArgs = $DeleteManyArgs<$Schema, "TaskEventPartitioned">; +export type TaskEventPartitionedCountArgs = $CountArgs<$Schema, "TaskEventPartitioned">; +export type TaskEventPartitionedAggregateArgs = $AggregateArgs<$Schema, "TaskEventPartitioned">; +export type TaskEventPartitionedGroupByArgs = $GroupByArgs<$Schema, "TaskEventPartitioned">; +export type TaskEventPartitionedWhereInput = $WhereInput<$Schema, "TaskEventPartitioned">; +export type TaskEventPartitionedSelect = $SelectInput<$Schema, "TaskEventPartitioned">; +export type TaskEventPartitionedInclude = $IncludeInput<$Schema, "TaskEventPartitioned">; +export type TaskEventPartitionedOmit = $OmitInput<$Schema, "TaskEventPartitioned">; +export type TaskEventPartitionedGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "TaskEventPartitioned", Options, Args>; diff --git a/tests/e2e/github-repos/trigger.dev/models.ts b/tests/e2e/github-repos/trigger.dev/models.ts new file mode 100644 index 000000000..ba6e7cd16 --- /dev/null +++ b/tests/e2e/github-repos/trigger.dev/models.ts @@ -0,0 +1,172 @@ +////////////////////////////////////////////////////////////////////////////////////////////// +// DO NOT MODIFY THIS FILE // +// This file is automatically generated by ZenStack CLI and should not be manually updated. // +////////////////////////////////////////////////////////////////////////////////////////////// + +/* eslint-disable */ + +import { schema as $schema, type SchemaType as $Schema } from "./schema"; +import { type ModelResult as $ModelResult } from "@zenstackhq/orm"; +export type User = $ModelResult<$Schema, "User">; +export type InvitationCode = $ModelResult<$Schema, "InvitationCode">; +/** + * Used to generate PersonalAccessTokens, they're one-time use + */ +export type AuthorizationCode = $ModelResult<$Schema, "AuthorizationCode">; +export type PersonalAccessToken = $ModelResult<$Schema, "PersonalAccessToken">; +export type Organization = $ModelResult<$Schema, "Organization">; +export type OrgMember = $ModelResult<$Schema, "OrgMember">; +export type OrgMemberInvite = $ModelResult<$Schema, "OrgMemberInvite">; +export type RuntimeEnvironment = $ModelResult<$Schema, "RuntimeEnvironment">; +export type Project = $ModelResult<$Schema, "Project">; +export type SecretReference = $ModelResult<$Schema, "SecretReference">; +export type SecretStore = $ModelResult<$Schema, "SecretStore">; +export type DataMigration = $ModelResult<$Schema, "DataMigration">; +export type BackgroundWorker = $ModelResult<$Schema, "BackgroundWorker">; +export type BackgroundWorkerFile = $ModelResult<$Schema, "BackgroundWorkerFile">; +export type BackgroundWorkerTask = $ModelResult<$Schema, "BackgroundWorkerTask">; +export type TaskRun = $ModelResult<$Schema, "TaskRun">; +/** + * Used by the RunEngine during TaskRun execution + * It has the required information to transactionally progress a run through states, + * and prevent side effects like heartbeats failing a run that has progressed. + * It is optimised for performance and is designed to be cleared at some point, + * so there are no cascading relationships to other models. + */ +export type TaskRunExecutionSnapshot = $ModelResult<$Schema, "TaskRunExecutionSnapshot">; +export type TaskRunCheckpoint = $ModelResult<$Schema, "TaskRunCheckpoint">; +/** + * A Waitpoint blocks a run from continuing until it's completed + * If there's a waitpoint blocking a run, it shouldn't be in the queue + */ +export type Waitpoint = $ModelResult<$Schema, "Waitpoint">; +export type TaskRunWaitpoint = $ModelResult<$Schema, "TaskRunWaitpoint">; +export type WaitpointTag = $ModelResult<$Schema, "WaitpointTag">; +export type FeatureFlag = $ModelResult<$Schema, "FeatureFlag">; +export type WorkerInstance = $ModelResult<$Schema, "WorkerInstance">; +export type WorkerInstanceGroup = $ModelResult<$Schema, "WorkerInstanceGroup">; +export type WorkerGroupToken = $ModelResult<$Schema, "WorkerGroupToken">; +export type TaskRunTag = $ModelResult<$Schema, "TaskRunTag">; +/** + * This is used for triggerAndWait and batchTriggerAndWait. The taskRun is the child task, it points at a parent attempt or a batch + */ +export type TaskRunDependency = $ModelResult<$Schema, "TaskRunDependency">; +/** + * deprecated, we hadn't included the project id in the unique constraint + */ +export type TaskRunCounter = $ModelResult<$Schema, "TaskRunCounter">; +/** + * Used for the TaskRun number (e.g. #1,421) + */ +export type TaskRunNumberCounter = $ModelResult<$Schema, "TaskRunNumberCounter">; +/** + * This is not used from engine v2+, attempts use the TaskRunExecutionSnapshot and TaskRun + */ +export type TaskRunAttempt = $ModelResult<$Schema, "TaskRunAttempt">; +/** + * This is the unified otel span/log model that will eventually be replaced by clickhouse + */ +export type TaskEvent = $ModelResult<$Schema, "TaskEvent">; +export type TaskQueue = $ModelResult<$Schema, "TaskQueue">; +export type BatchTaskRun = $ModelResult<$Schema, "BatchTaskRun">; +/** + * Used in engine V1 only + */ +export type BatchTaskRunItem = $ModelResult<$Schema, "BatchTaskRunItem">; +export type EnvironmentVariable = $ModelResult<$Schema, "EnvironmentVariable">; +export type EnvironmentVariableValue = $ModelResult<$Schema, "EnvironmentVariableValue">; +export type Checkpoint = $ModelResult<$Schema, "Checkpoint">; +export type CheckpointRestoreEvent = $ModelResult<$Schema, "CheckpointRestoreEvent">; +export type WorkerDeployment = $ModelResult<$Schema, "WorkerDeployment">; +export type WorkerDeploymentPromotion = $ModelResult<$Schema, "WorkerDeploymentPromotion">; +/** + * Schedules can be attached to tasks to trigger them on a schedule + */ +export type TaskSchedule = $ModelResult<$Schema, "TaskSchedule">; +/** + * An instance links a schedule with an environment + */ +export type TaskScheduleInstance = $ModelResult<$Schema, "TaskScheduleInstance">; +export type RuntimeEnvironmentSession = $ModelResult<$Schema, "RuntimeEnvironmentSession">; +export type ProjectAlertChannel = $ModelResult<$Schema, "ProjectAlertChannel">; +export type ProjectAlert = $ModelResult<$Schema, "ProjectAlert">; +export type ProjectAlertStorage = $ModelResult<$Schema, "ProjectAlertStorage">; +export type OrganizationIntegration = $ModelResult<$Schema, "OrganizationIntegration">; +/** + * Bulk actions, like canceling and replaying runs + */ +export type BulkActionGroup = $ModelResult<$Schema, "BulkActionGroup">; +export type BulkActionItem = $ModelResult<$Schema, "BulkActionItem">; +export type RealtimeStreamChunk = $ModelResult<$Schema, "RealtimeStreamChunk">; +/** + * This is the unified otel span/log model that will eventually be replaced by clickhouse + */ +export type TaskEventPartitioned = $ModelResult<$Schema, "TaskEventPartitioned">; +export const AuthenticationMethod = $schema.enums.AuthenticationMethod.values; +export type AuthenticationMethod = (typeof AuthenticationMethod)[keyof typeof AuthenticationMethod]; +export const OrgMemberRole = $schema.enums.OrgMemberRole.values; +export type OrgMemberRole = (typeof OrgMemberRole)[keyof typeof OrgMemberRole]; +export const RuntimeEnvironmentType = $schema.enums.RuntimeEnvironmentType.values; +export type RuntimeEnvironmentType = (typeof RuntimeEnvironmentType)[keyof typeof RuntimeEnvironmentType]; +export const ProjectVersion = $schema.enums.ProjectVersion.values; +export type ProjectVersion = (typeof ProjectVersion)[keyof typeof ProjectVersion]; +export const SecretStoreProvider = $schema.enums.SecretStoreProvider.values; +export type SecretStoreProvider = (typeof SecretStoreProvider)[keyof typeof SecretStoreProvider]; +export const TaskTriggerSource = $schema.enums.TaskTriggerSource.values; +export type TaskTriggerSource = (typeof TaskTriggerSource)[keyof typeof TaskTriggerSource]; +export const TaskRunStatus = $schema.enums.TaskRunStatus.values; +export type TaskRunStatus = (typeof TaskRunStatus)[keyof typeof TaskRunStatus]; +export const RunEngineVersion = $schema.enums.RunEngineVersion.values; +export type RunEngineVersion = (typeof RunEngineVersion)[keyof typeof RunEngineVersion]; +export const TaskRunExecutionStatus = $schema.enums.TaskRunExecutionStatus.values; +export type TaskRunExecutionStatus = (typeof TaskRunExecutionStatus)[keyof typeof TaskRunExecutionStatus]; +export const TaskRunCheckpointType = $schema.enums.TaskRunCheckpointType.values; +export type TaskRunCheckpointType = (typeof TaskRunCheckpointType)[keyof typeof TaskRunCheckpointType]; +export const WaitpointType = $schema.enums.WaitpointType.values; +export type WaitpointType = (typeof WaitpointType)[keyof typeof WaitpointType]; +export const WaitpointStatus = $schema.enums.WaitpointStatus.values; +export type WaitpointStatus = (typeof WaitpointStatus)[keyof typeof WaitpointStatus]; +export const WorkerInstanceGroupType = $schema.enums.WorkerInstanceGroupType.values; +export type WorkerInstanceGroupType = (typeof WorkerInstanceGroupType)[keyof typeof WorkerInstanceGroupType]; +export const TaskRunAttemptStatus = $schema.enums.TaskRunAttemptStatus.values; +export type TaskRunAttemptStatus = (typeof TaskRunAttemptStatus)[keyof typeof TaskRunAttemptStatus]; +export const TaskEventLevel = $schema.enums.TaskEventLevel.values; +export type TaskEventLevel = (typeof TaskEventLevel)[keyof typeof TaskEventLevel]; +export const TaskEventKind = $schema.enums.TaskEventKind.values; +export type TaskEventKind = (typeof TaskEventKind)[keyof typeof TaskEventKind]; +export const TaskEventStatus = $schema.enums.TaskEventStatus.values; +export type TaskEventStatus = (typeof TaskEventStatus)[keyof typeof TaskEventStatus]; +export const TaskQueueType = $schema.enums.TaskQueueType.values; +export type TaskQueueType = (typeof TaskQueueType)[keyof typeof TaskQueueType]; +export const TaskQueueVersion = $schema.enums.TaskQueueVersion.values; +export type TaskQueueVersion = (typeof TaskQueueVersion)[keyof typeof TaskQueueVersion]; +export const BatchTaskRunStatus = $schema.enums.BatchTaskRunStatus.values; +export type BatchTaskRunStatus = (typeof BatchTaskRunStatus)[keyof typeof BatchTaskRunStatus]; +export const BatchTaskRunItemStatus = $schema.enums.BatchTaskRunItemStatus.values; +export type BatchTaskRunItemStatus = (typeof BatchTaskRunItemStatus)[keyof typeof BatchTaskRunItemStatus]; +export const CheckpointType = $schema.enums.CheckpointType.values; +export type CheckpointType = (typeof CheckpointType)[keyof typeof CheckpointType]; +export const CheckpointRestoreEventType = $schema.enums.CheckpointRestoreEventType.values; +export type CheckpointRestoreEventType = (typeof CheckpointRestoreEventType)[keyof typeof CheckpointRestoreEventType]; +export const WorkerDeploymentType = $schema.enums.WorkerDeploymentType.values; +export type WorkerDeploymentType = (typeof WorkerDeploymentType)[keyof typeof WorkerDeploymentType]; +export const WorkerDeploymentStatus = $schema.enums.WorkerDeploymentStatus.values; +export type WorkerDeploymentStatus = (typeof WorkerDeploymentStatus)[keyof typeof WorkerDeploymentStatus]; +export const ScheduleType = $schema.enums.ScheduleType.values; +export type ScheduleType = (typeof ScheduleType)[keyof typeof ScheduleType]; +export const ScheduleGeneratorType = $schema.enums.ScheduleGeneratorType.values; +export type ScheduleGeneratorType = (typeof ScheduleGeneratorType)[keyof typeof ScheduleGeneratorType]; +export const ProjectAlertChannelType = $schema.enums.ProjectAlertChannelType.values; +export type ProjectAlertChannelType = (typeof ProjectAlertChannelType)[keyof typeof ProjectAlertChannelType]; +export const ProjectAlertType = $schema.enums.ProjectAlertType.values; +export type ProjectAlertType = (typeof ProjectAlertType)[keyof typeof ProjectAlertType]; +export const ProjectAlertStatus = $schema.enums.ProjectAlertStatus.values; +export type ProjectAlertStatus = (typeof ProjectAlertStatus)[keyof typeof ProjectAlertStatus]; +export const IntegrationService = $schema.enums.IntegrationService.values; +export type IntegrationService = (typeof IntegrationService)[keyof typeof IntegrationService]; +export const BulkActionType = $schema.enums.BulkActionType.values; +export type BulkActionType = (typeof BulkActionType)[keyof typeof BulkActionType]; +export const BulkActionStatus = $schema.enums.BulkActionStatus.values; +export type BulkActionStatus = (typeof BulkActionStatus)[keyof typeof BulkActionStatus]; +export const BulkActionItemStatus = $schema.enums.BulkActionItemStatus.values; +export type BulkActionItemStatus = (typeof BulkActionItemStatus)[keyof typeof BulkActionItemStatus]; diff --git a/tests/e2e/github-repos/trigger.dev/schema.ts b/tests/e2e/github-repos/trigger.dev/schema.ts new file mode 100644 index 000000000..9b884d078 --- /dev/null +++ b/tests/e2e/github-repos/trigger.dev/schema.ts @@ -0,0 +1,6344 @@ +////////////////////////////////////////////////////////////////////////////////////////////// +// DO NOT MODIFY THIS FILE // +// This file is automatically generated by ZenStack CLI and should not be manually updated. // +////////////////////////////////////////////////////////////////////////////////////////////// + +/* eslint-disable */ + +import { type SchemaDef, ExpressionUtils } from "@zenstackhq/orm/schema"; +export class SchemaType implements SchemaDef { + provider = { + type: "postgresql" + } as const; + models = { + User: { + name: "User", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + email: { + name: "email", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + authenticationMethod: { + name: "authenticationMethod", + type: "AuthenticationMethod" + }, + authenticationProfile: { + name: "authenticationProfile", + type: "Json", + optional: true + }, + authenticationExtraParams: { + name: "authenticationExtraParams", + type: "Json", + optional: true + }, + authIdentifier: { + name: "authIdentifier", + type: "String", + unique: true, + optional: true, + attributes: [{ name: "@unique" }] + }, + displayName: { + name: "displayName", + type: "String", + optional: true + }, + name: { + name: "name", + type: "String", + optional: true + }, + avatarUrl: { + name: "avatarUrl", + type: "String", + optional: true + }, + admin: { + name: "admin", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + dashboardPreferences: { + name: "dashboardPreferences", + type: "Json", + optional: true + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + isOnCloudWaitlist: { + name: "isOnCloudWaitlist", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + featureCloud: { + name: "featureCloud", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + isOnHostedRepoWaitlist: { + name: "isOnHostedRepoWaitlist", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + marketingEmails: { + name: "marketingEmails", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(true) }] }], + default: true + }, + confirmedBasicDetails: { + name: "confirmedBasicDetails", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + referralSource: { + name: "referralSource", + type: "String", + optional: true + }, + orgMemberships: { + name: "orgMemberships", + type: "OrgMember", + array: true, + relation: { opposite: "user" } + }, + sentInvites: { + name: "sentInvites", + type: "OrgMemberInvite", + array: true, + relation: { opposite: "inviter" } + }, + invitationCode: { + name: "invitationCode", + type: "InvitationCode", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("invitationCodeId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "users", fields: ["invitationCodeId"], references: ["id"] } + }, + invitationCodeId: { + name: "invitationCodeId", + type: "String", + optional: true, + foreignKeyFor: [ + "invitationCode" + ] + }, + personalAccessTokens: { + name: "personalAccessTokens", + type: "PersonalAccessToken", + array: true, + relation: { opposite: "user" } + }, + deployments: { + name: "deployments", + type: "WorkerDeployment", + array: true, + relation: { opposite: "triggeredBy" } + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + email: { type: "String" }, + authIdentifier: { type: "String" } + } + }, + InvitationCode: { + name: "InvitationCode", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + code: { + name: "code", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + users: { + name: "users", + type: "User", + array: true, + relation: { opposite: "invitationCode" } + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + code: { type: "String" } + } + }, + AuthorizationCode: { + name: "AuthorizationCode", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + code: { + name: "code", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + personalAccessToken: { + name: "personalAccessToken", + type: "PersonalAccessToken", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("personalAccessTokenId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "authorizationCodes", fields: ["personalAccessTokenId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + personalAccessTokenId: { + name: "personalAccessTokenId", + type: "String", + optional: true, + foreignKeyFor: [ + "personalAccessToken" + ] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + code: { type: "String" } + } + }, + PersonalAccessToken: { + name: "PersonalAccessToken", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + name: { + name: "name", + type: "String" + }, + encryptedToken: { + name: "encryptedToken", + type: "Json" + }, + obfuscatedToken: { + name: "obfuscatedToken", + type: "String" + }, + hashedToken: { + name: "hashedToken", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + user: { + name: "user", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "personalAccessTokens", fields: ["userId"], references: ["id"] } + }, + userId: { + name: "userId", + type: "String", + foreignKeyFor: [ + "user" + ] + }, + revokedAt: { + name: "revokedAt", + type: "DateTime", + optional: true + }, + lastAccessedAt: { + name: "lastAccessedAt", + type: "DateTime", + optional: true + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + authorizationCodes: { + name: "authorizationCodes", + type: "AuthorizationCode", + array: true, + relation: { opposite: "personalAccessToken" } + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + hashedToken: { type: "String" } + } + }, + Organization: { + name: "Organization", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + slug: { + name: "slug", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + title: { + name: "title", + type: "String" + }, + maximumExecutionTimePerRunInMs: { + name: "maximumExecutionTimePerRunInMs", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(900000) }] }], + default: 900000 + }, + maximumConcurrencyLimit: { + name: "maximumConcurrencyLimit", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(10) }] }], + default: 10 + }, + maximumSchedulesLimit: { + name: "maximumSchedulesLimit", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(5) }] }], + default: 5 + }, + maximumDevQueueSize: { + name: "maximumDevQueueSize", + type: "Int", + optional: true + }, + maximumDeployedQueueSize: { + name: "maximumDeployedQueueSize", + type: "Int", + optional: true + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + deletedAt: { + name: "deletedAt", + type: "DateTime", + optional: true + }, + companySize: { + name: "companySize", + type: "String", + optional: true + }, + avatar: { + name: "avatar", + type: "Json", + optional: true + }, + runsEnabled: { + name: "runsEnabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(true) }] }], + default: true + }, + v3Enabled: { + name: "v3Enabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + v2Enabled: { + name: "v2Enabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + v2MarqsEnabled: { + name: "v2MarqsEnabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + hasRequestedV3: { + name: "hasRequestedV3", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + environments: { + name: "environments", + type: "RuntimeEnvironment", + array: true, + relation: { opposite: "organization" } + }, + apiRateLimiterConfig: { + name: "apiRateLimiterConfig", + type: "Json", + optional: true + }, + realtimeRateLimiterConfig: { + name: "realtimeRateLimiterConfig", + type: "Json", + optional: true + }, + projects: { + name: "projects", + type: "Project", + array: true, + relation: { opposite: "organization" } + }, + members: { + name: "members", + type: "OrgMember", + array: true, + relation: { opposite: "organization" } + }, + invites: { + name: "invites", + type: "OrgMemberInvite", + array: true, + relation: { opposite: "organization" } + }, + organizationIntegrations: { + name: "organizationIntegrations", + type: "OrganizationIntegration", + array: true, + relation: { opposite: "organization" } + }, + workerGroups: { + name: "workerGroups", + type: "WorkerInstanceGroup", + array: true, + relation: { opposite: "organization" } + }, + workerInstances: { + name: "workerInstances", + type: "WorkerInstance", + array: true, + relation: { opposite: "organization" } + }, + executionSnapshots: { + name: "executionSnapshots", + type: "TaskRunExecutionSnapshot", + array: true, + relation: { opposite: "organization" } + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + slug: { type: "String" } + } + }, + OrgMember: { + name: "OrgMember", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + organization: { + name: "organization", + type: "Organization", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "members", fields: ["organizationId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + organizationId: { + name: "organizationId", + type: "String", + foreignKeyFor: [ + "organization" + ] + }, + user: { + name: "user", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("userId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "orgMemberships", fields: ["userId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + userId: { + name: "userId", + type: "String", + foreignKeyFor: [ + "user" + ] + }, + role: { + name: "role", + type: "OrgMemberRole", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("MEMBER") }] }], + default: "MEMBER" + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + environments: { + name: "environments", + type: "RuntimeEnvironment", + array: true, + relation: { opposite: "orgMember" } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId"), ExpressionUtils.field("userId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + organizationId_userId: { organizationId: { type: "String" }, userId: { type: "String" } } + } + }, + OrgMemberInvite: { + name: "OrgMemberInvite", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + token: { + name: "token", + type: "String", + unique: true, + attributes: [{ name: "@unique" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + email: { + name: "email", + type: "String" + }, + role: { + name: "role", + type: "OrgMemberRole", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("MEMBER") }] }], + default: "MEMBER" + }, + organization: { + name: "organization", + type: "Organization", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "invites", fields: ["organizationId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + organizationId: { + name: "organizationId", + type: "String", + foreignKeyFor: [ + "organization" + ] + }, + inviter: { + name: "inviter", + type: "User", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("inviterId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "sentInvites", fields: ["inviterId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + inviterId: { + name: "inviterId", + type: "String", + foreignKeyFor: [ + "inviter" + ] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId"), ExpressionUtils.field("email")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + token: { type: "String" }, + organizationId_email: { organizationId: { type: "String" }, email: { type: "String" } } + } + }, + RuntimeEnvironment: { + name: "RuntimeEnvironment", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + slug: { + name: "slug", + type: "String" + }, + apiKey: { + name: "apiKey", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + pkApiKey: { + name: "pkApiKey", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + type: { + name: "type", + type: "RuntimeEnvironmentType", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("DEVELOPMENT") }] }], + default: "DEVELOPMENT" + }, + isBranchableEnvironment: { + name: "isBranchableEnvironment", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + branchName: { + name: "branchName", + type: "String", + optional: true + }, + parentEnvironment: { + name: "parentEnvironment", + type: "RuntimeEnvironment", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("parentEnvironment") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("parentEnvironmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "childEnvironments", name: "parentEnvironment", fields: ["parentEnvironmentId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + parentEnvironmentId: { + name: "parentEnvironmentId", + type: "String", + optional: true, + foreignKeyFor: [ + "parentEnvironment" + ] + }, + childEnvironments: { + name: "childEnvironments", + type: "RuntimeEnvironment", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("parentEnvironment") }] }], + relation: { opposite: "parentEnvironment", name: "parentEnvironment" } + }, + git: { + name: "git", + type: "Json", + optional: true + }, + archivedAt: { + name: "archivedAt", + type: "DateTime", + optional: true + }, + shortcode: { + name: "shortcode", + type: "String" + }, + maximumConcurrencyLimit: { + name: "maximumConcurrencyLimit", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(5) }] }], + default: 5 + }, + paused: { + name: "paused", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + autoEnableInternalSources: { + name: "autoEnableInternalSources", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(true) }] }], + default: true + }, + organization: { + name: "organization", + type: "Organization", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "environments", fields: ["organizationId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + organizationId: { + name: "organizationId", + type: "String", + foreignKeyFor: [ + "organization" + ] + }, + project: { + name: "project", + type: "Project", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "environments", fields: ["projectId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + projectId: { + name: "projectId", + type: "String", + foreignKeyFor: [ + "project" + ] + }, + orgMember: { + name: "orgMember", + type: "OrgMember", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("orgMemberId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "environments", fields: ["orgMemberId"], references: ["id"], onDelete: "SetNull", onUpdate: "Cascade" } + }, + orgMemberId: { + name: "orgMemberId", + type: "String", + optional: true, + foreignKeyFor: [ + "orgMember" + ] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + tunnelId: { + name: "tunnelId", + type: "String", + optional: true + }, + backgroundWorkers: { + name: "backgroundWorkers", + type: "BackgroundWorker", + array: true, + relation: { opposite: "runtimeEnvironment" } + }, + backgroundWorkerTasks: { + name: "backgroundWorkerTasks", + type: "BackgroundWorkerTask", + array: true, + relation: { opposite: "runtimeEnvironment" } + }, + taskRuns: { + name: "taskRuns", + type: "TaskRun", + array: true, + relation: { opposite: "runtimeEnvironment" } + }, + taskQueues: { + name: "taskQueues", + type: "TaskQueue", + array: true, + relation: { opposite: "runtimeEnvironment" } + }, + batchTaskRuns: { + name: "batchTaskRuns", + type: "BatchTaskRun", + array: true, + relation: { opposite: "runtimeEnvironment" } + }, + environmentVariableValues: { + name: "environmentVariableValues", + type: "EnvironmentVariableValue", + array: true, + relation: { opposite: "environment" } + }, + checkpoints: { + name: "checkpoints", + type: "Checkpoint", + array: true, + relation: { opposite: "runtimeEnvironment" } + }, + workerDeployments: { + name: "workerDeployments", + type: "WorkerDeployment", + array: true, + relation: { opposite: "environment" } + }, + workerDeploymentPromotions: { + name: "workerDeploymentPromotions", + type: "WorkerDeploymentPromotion", + array: true, + relation: { opposite: "environment" } + }, + taskRunAttempts: { + name: "taskRunAttempts", + type: "TaskRunAttempt", + array: true, + relation: { opposite: "runtimeEnvironment" } + }, + CheckpointRestoreEvent: { + name: "CheckpointRestoreEvent", + type: "CheckpointRestoreEvent", + array: true, + relation: { opposite: "runtimeEnvironment" } + }, + taskScheduleInstances: { + name: "taskScheduleInstances", + type: "TaskScheduleInstance", + array: true, + relation: { opposite: "environment" } + }, + alerts: { + name: "alerts", + type: "ProjectAlert", + array: true, + relation: { opposite: "environment" } + }, + sessions: { + name: "sessions", + type: "RuntimeEnvironmentSession", + array: true, + relation: { opposite: "environment" } + }, + currentSession: { + name: "currentSession", + type: "RuntimeEnvironmentSession", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("currentSession") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("currentSessionId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "currentEnvironments", name: "currentSession", fields: ["currentSessionId"], references: ["id"], onDelete: "SetNull", onUpdate: "Cascade" } + }, + currentSessionId: { + name: "currentSessionId", + type: "String", + optional: true, + foreignKeyFor: [ + "currentSession" + ] + }, + taskRunNumberCounter: { + name: "taskRunNumberCounter", + type: "TaskRunNumberCounter", + array: true, + relation: { opposite: "environment" } + }, + taskRunCheckpoints: { + name: "taskRunCheckpoints", + type: "TaskRunCheckpoint", + array: true, + relation: { opposite: "runtimeEnvironment" } + }, + waitpoints: { + name: "waitpoints", + type: "Waitpoint", + array: true, + relation: { opposite: "environment" } + }, + workerInstances: { + name: "workerInstances", + type: "WorkerInstance", + array: true, + relation: { opposite: "environment" } + }, + executionSnapshots: { + name: "executionSnapshots", + type: "TaskRunExecutionSnapshot", + array: true, + relation: { opposite: "environment" } + }, + waitpointTags: { + name: "waitpointTags", + type: "WaitpointTag", + array: true, + relation: { opposite: "environment" } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId"), ExpressionUtils.field("slug"), ExpressionUtils.field("orgMemberId")]) }] }, + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId"), ExpressionUtils.field("shortcode")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("parentEnvironmentId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + apiKey: { type: "String" }, + pkApiKey: { type: "String" }, + projectId_slug_orgMemberId: { projectId: { type: "String" }, slug: { type: "String" }, orgMemberId: { type: "String" } }, + projectId_shortcode: { projectId: { type: "String" }, shortcode: { type: "String" } } + } + }, + Project: { + name: "Project", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + slug: { + name: "slug", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + name: { + name: "name", + type: "String" + }, + externalRef: { + name: "externalRef", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + organization: { + name: "organization", + type: "Organization", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "projects", fields: ["organizationId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + organizationId: { + name: "organizationId", + type: "String", + foreignKeyFor: [ + "organization" + ] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + deletedAt: { + name: "deletedAt", + type: "DateTime", + optional: true + }, + version: { + name: "version", + type: "ProjectVersion", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("V2") }] }], + default: "V2" + }, + engine: { + name: "engine", + type: "RunEngineVersion", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("V1") }] }], + default: "V1" + }, + builderProjectId: { + name: "builderProjectId", + type: "String", + optional: true + }, + workerGroups: { + name: "workerGroups", + type: "WorkerInstanceGroup", + array: true, + relation: { opposite: "defaultForProjects" } + }, + workers: { + name: "workers", + type: "WorkerInstance", + array: true, + relation: { opposite: "project" } + }, + defaultWorkerGroup: { + name: "defaultWorkerGroup", + type: "WorkerInstanceGroup", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("ProjectDefaultWorkerGroup") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("defaultWorkerGroupId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "defaultForProjects", name: "ProjectDefaultWorkerGroup", fields: ["defaultWorkerGroupId"], references: ["id"] } + }, + defaultWorkerGroupId: { + name: "defaultWorkerGroupId", + type: "String", + optional: true, + foreignKeyFor: [ + "defaultWorkerGroup" + ] + }, + environments: { + name: "environments", + type: "RuntimeEnvironment", + array: true, + relation: { opposite: "project" } + }, + backgroundWorkers: { + name: "backgroundWorkers", + type: "BackgroundWorker", + array: true, + relation: { opposite: "project" } + }, + backgroundWorkerTasks: { + name: "backgroundWorkerTasks", + type: "BackgroundWorkerTask", + array: true, + relation: { opposite: "project" } + }, + taskRuns: { + name: "taskRuns", + type: "TaskRun", + array: true, + relation: { opposite: "project" } + }, + runTags: { + name: "runTags", + type: "TaskRunTag", + array: true, + relation: { opposite: "project" } + }, + taskQueues: { + name: "taskQueues", + type: "TaskQueue", + array: true, + relation: { opposite: "project" } + }, + environmentVariables: { + name: "environmentVariables", + type: "EnvironmentVariable", + array: true, + relation: { opposite: "project" } + }, + checkpoints: { + name: "checkpoints", + type: "Checkpoint", + array: true, + relation: { opposite: "project" } + }, + WorkerDeployment: { + name: "WorkerDeployment", + type: "WorkerDeployment", + array: true, + relation: { opposite: "project" } + }, + CheckpointRestoreEvent: { + name: "CheckpointRestoreEvent", + type: "CheckpointRestoreEvent", + array: true, + relation: { opposite: "project" } + }, + taskSchedules: { + name: "taskSchedules", + type: "TaskSchedule", + array: true, + relation: { opposite: "project" } + }, + alertChannels: { + name: "alertChannels", + type: "ProjectAlertChannel", + array: true, + relation: { opposite: "project" } + }, + alerts: { + name: "alerts", + type: "ProjectAlert", + array: true, + relation: { opposite: "project" } + }, + alertStorages: { + name: "alertStorages", + type: "ProjectAlertStorage", + array: true, + relation: { opposite: "project" } + }, + bulkActionGroups: { + name: "bulkActionGroups", + type: "BulkActionGroup", + array: true, + relation: { opposite: "project" } + }, + BackgroundWorkerFile: { + name: "BackgroundWorkerFile", + type: "BackgroundWorkerFile", + array: true, + relation: { opposite: "project" } + }, + waitpoints: { + name: "waitpoints", + type: "Waitpoint", + array: true, + relation: { opposite: "project" } + }, + taskRunWaitpoints: { + name: "taskRunWaitpoints", + type: "TaskRunWaitpoint", + array: true, + relation: { opposite: "project" } + }, + taskRunCheckpoints: { + name: "taskRunCheckpoints", + type: "TaskRunCheckpoint", + array: true, + relation: { opposite: "project" } + }, + executionSnapshots: { + name: "executionSnapshots", + type: "TaskRunExecutionSnapshot", + array: true, + relation: { opposite: "project" } + }, + waitpointTags: { + name: "waitpointTags", + type: "WaitpointTag", + array: true, + relation: { opposite: "project" } + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + slug: { type: "String" }, + externalRef: { type: "String" } + } + }, + SecretReference: { + name: "SecretReference", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + key: { + name: "key", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + provider: { + name: "provider", + type: "SecretStoreProvider", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("DATABASE") }] }], + default: "DATABASE" + }, + environmentVariableValues: { + name: "environmentVariableValues", + type: "EnvironmentVariableValue", + array: true, + relation: { opposite: "valueReference" } + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + OrganizationIntegration: { + name: "OrganizationIntegration", + type: "OrganizationIntegration", + array: true, + relation: { opposite: "tokenReference" } + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + key: { type: "String" } + } + }, + SecretStore: { + name: "SecretStore", + fields: { + key: { + name: "key", + type: "String", + id: true, + unique: true, + attributes: [{ name: "@unique" }] + }, + value: { + name: "value", + type: "Json" + }, + version: { + name: "version", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("1") }] }], + default: "1" + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("key")]) }, { name: "type", value: ExpressionUtils.literal("BTree") }] } + ], + idFields: ["key"], + uniqueFields: { + key: { type: "String" } + } + }, + DataMigration: { + name: "DataMigration", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + name: { + name: "name", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + completedAt: { + name: "completedAt", + type: "DateTime", + optional: true + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + name: { type: "String" } + } + }, + BackgroundWorker: { + name: "BackgroundWorker", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + friendlyId: { + name: "friendlyId", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + engine: { + name: "engine", + type: "RunEngineVersion", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("V1") }] }], + default: "V1" + }, + contentHash: { + name: "contentHash", + type: "String" + }, + sdkVersion: { + name: "sdkVersion", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("unknown") }] }], + default: "unknown" + }, + cliVersion: { + name: "cliVersion", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("unknown") }] }], + default: "unknown" + }, + project: { + name: "project", + type: "Project", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "backgroundWorkers", fields: ["projectId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + projectId: { + name: "projectId", + type: "String", + foreignKeyFor: [ + "project" + ] + }, + runtimeEnvironment: { + name: "runtimeEnvironment", + type: "RuntimeEnvironment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runtimeEnvironmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "backgroundWorkers", fields: ["runtimeEnvironmentId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + runtimeEnvironmentId: { + name: "runtimeEnvironmentId", + type: "String", + foreignKeyFor: [ + "runtimeEnvironment" + ] + }, + version: { + name: "version", + type: "String" + }, + metadata: { + name: "metadata", + type: "Json" + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + tasks: { + name: "tasks", + type: "BackgroundWorkerTask", + array: true, + relation: { opposite: "worker" } + }, + attempts: { + name: "attempts", + type: "TaskRunAttempt", + array: true, + relation: { opposite: "backgroundWorker" } + }, + lockedRuns: { + name: "lockedRuns", + type: "TaskRun", + array: true, + relation: { opposite: "lockedToVersion" } + }, + files: { + name: "files", + type: "BackgroundWorkerFile", + array: true, + relation: { opposite: "backgroundWorkers" } + }, + queues: { + name: "queues", + type: "TaskQueue", + array: true, + relation: { opposite: "workers" } + }, + deployment: { + name: "deployment", + type: "WorkerDeployment", + optional: true, + relation: { opposite: "worker" } + }, + workerGroup: { + name: "workerGroup", + type: "WorkerInstanceGroup", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("workerGroupId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "backgroundWorkers", fields: ["workerGroupId"], references: ["id"], onDelete: "SetNull", onUpdate: "Cascade" } + }, + workerGroupId: { + name: "workerGroupId", + type: "String", + optional: true, + foreignKeyFor: [ + "workerGroup" + ] + }, + supportsLazyAttempts: { + name: "supportsLazyAttempts", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId"), ExpressionUtils.field("runtimeEnvironmentId"), ExpressionUtils.field("version")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runtimeEnvironmentId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runtimeEnvironmentId"), ExpressionUtils.field("createdAt")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + friendlyId: { type: "String" }, + projectId_runtimeEnvironmentId_version: { projectId: { type: "String" }, runtimeEnvironmentId: { type: "String" }, version: { type: "String" } } + } + }, + BackgroundWorkerFile: { + name: "BackgroundWorkerFile", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + friendlyId: { + name: "friendlyId", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + filePath: { + name: "filePath", + type: "String" + }, + contentHash: { + name: "contentHash", + type: "String" + }, + contents: { + name: "contents", + type: "Bytes" + }, + project: { + name: "project", + type: "Project", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "BackgroundWorkerFile", fields: ["projectId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + projectId: { + name: "projectId", + type: "String", + foreignKeyFor: [ + "project" + ] + }, + backgroundWorkers: { + name: "backgroundWorkers", + type: "BackgroundWorker", + array: true, + relation: { opposite: "files" } + }, + tasks: { + name: "tasks", + type: "BackgroundWorkerTask", + array: true, + relation: { opposite: "file" } + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId"), ExpressionUtils.field("contentHash")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + friendlyId: { type: "String" }, + projectId_contentHash: { projectId: { type: "String" }, contentHash: { type: "String" } } + } + }, + BackgroundWorkerTask: { + name: "BackgroundWorkerTask", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + slug: { + name: "slug", + type: "String" + }, + description: { + name: "description", + type: "String", + optional: true + }, + friendlyId: { + name: "friendlyId", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + filePath: { + name: "filePath", + type: "String" + }, + exportName: { + name: "exportName", + type: "String", + optional: true + }, + worker: { + name: "worker", + type: "BackgroundWorker", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("workerId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "tasks", fields: ["workerId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + workerId: { + name: "workerId", + type: "String", + foreignKeyFor: [ + "worker" + ] + }, + project: { + name: "project", + type: "Project", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "backgroundWorkerTasks", fields: ["projectId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + projectId: { + name: "projectId", + type: "String", + foreignKeyFor: [ + "project" + ] + }, + file: { + name: "file", + type: "BackgroundWorkerFile", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("fileId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "tasks", fields: ["fileId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + fileId: { + name: "fileId", + type: "String", + optional: true, + foreignKeyFor: [ + "file" + ] + }, + runtimeEnvironment: { + name: "runtimeEnvironment", + type: "RuntimeEnvironment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runtimeEnvironmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "backgroundWorkerTasks", fields: ["runtimeEnvironmentId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + runtimeEnvironmentId: { + name: "runtimeEnvironmentId", + type: "String", + foreignKeyFor: [ + "runtimeEnvironment" + ] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + attempts: { + name: "attempts", + type: "TaskRunAttempt", + array: true, + relation: { opposite: "backgroundWorkerTask" } + }, + runs: { + name: "runs", + type: "TaskRun", + array: true, + relation: { opposite: "lockedBy" } + }, + queueConfig: { + name: "queueConfig", + type: "Json", + optional: true + }, + retryConfig: { + name: "retryConfig", + type: "Json", + optional: true + }, + machineConfig: { + name: "machineConfig", + type: "Json", + optional: true + }, + queueId: { + name: "queueId", + type: "String", + optional: true, + foreignKeyFor: [ + "queue" + ] + }, + queue: { + name: "queue", + type: "TaskQueue", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("queueId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "tasks", fields: ["queueId"], references: ["id"], onDelete: "SetNull", onUpdate: "Cascade" } + }, + maxDurationInSeconds: { + name: "maxDurationInSeconds", + type: "Int", + optional: true + }, + triggerSource: { + name: "triggerSource", + type: "TaskTriggerSource", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("STANDARD") }] }], + default: "STANDARD" + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("workerId"), ExpressionUtils.field("slug")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId"), ExpressionUtils.field("slug")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runtimeEnvironmentId"), ExpressionUtils.field("projectId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + friendlyId: { type: "String" }, + workerId_slug: { workerId: { type: "String" }, slug: { type: "String" } } + } + }, + TaskRun: { + name: "TaskRun", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + number: { + name: "number", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + friendlyId: { + name: "friendlyId", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + engine: { + name: "engine", + type: "RunEngineVersion", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("V1") }] }], + default: "V1" + }, + status: { + name: "status", + type: "TaskRunStatus", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("PENDING") }] }], + default: "PENDING" + }, + statusReason: { + name: "statusReason", + type: "String", + optional: true + }, + idempotencyKey: { + name: "idempotencyKey", + type: "String", + optional: true + }, + idempotencyKeyExpiresAt: { + name: "idempotencyKeyExpiresAt", + type: "DateTime", + optional: true + }, + taskIdentifier: { + name: "taskIdentifier", + type: "String" + }, + isTest: { + name: "isTest", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + payload: { + name: "payload", + type: "String" + }, + payloadType: { + name: "payloadType", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("application/json") }] }], + default: "application/json" + }, + context: { + name: "context", + type: "Json", + optional: true + }, + traceContext: { + name: "traceContext", + type: "Json", + optional: true + }, + traceId: { + name: "traceId", + type: "String" + }, + spanId: { + name: "spanId", + type: "String" + }, + runtimeEnvironment: { + name: "runtimeEnvironment", + type: "RuntimeEnvironment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runtimeEnvironmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "taskRuns", fields: ["runtimeEnvironmentId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + runtimeEnvironmentId: { + name: "runtimeEnvironmentId", + type: "String", + foreignKeyFor: [ + "runtimeEnvironment" + ] + }, + environmentType: { + name: "environmentType", + type: "RuntimeEnvironmentType", + optional: true + }, + project: { + name: "project", + type: "Project", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "taskRuns", fields: ["projectId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + projectId: { + name: "projectId", + type: "String", + foreignKeyFor: [ + "project" + ] + }, + organizationId: { + name: "organizationId", + type: "String", + optional: true + }, + queue: { + name: "queue", + type: "String" + }, + lockedQueueId: { + name: "lockedQueueId", + type: "String", + optional: true + }, + workerQueue: { + name: "workerQueue", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("main") }] }, { name: "@map", args: [{ name: "name", value: ExpressionUtils.literal("masterQueue") }] }], + default: "main" + }, + secondaryMasterQueue: { + name: "secondaryMasterQueue", + type: "String", + optional: true + }, + attemptNumber: { + name: "attemptNumber", + type: "Int", + optional: true + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + attempts: { + name: "attempts", + type: "TaskRunAttempt", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("attempts") }] }], + relation: { opposite: "taskRun", name: "attempts" } + }, + tags: { + name: "tags", + type: "TaskRunTag", + array: true, + relation: { opposite: "runs" } + }, + runTags: { + name: "runTags", + type: "String", + array: true + }, + taskVersion: { + name: "taskVersion", + type: "String", + optional: true + }, + sdkVersion: { + name: "sdkVersion", + type: "String", + optional: true + }, + cliVersion: { + name: "cliVersion", + type: "String", + optional: true + }, + checkpoints: { + name: "checkpoints", + type: "Checkpoint", + array: true, + relation: { opposite: "run" } + }, + startedAt: { + name: "startedAt", + type: "DateTime", + optional: true + }, + executedAt: { + name: "executedAt", + type: "DateTime", + optional: true + }, + completedAt: { + name: "completedAt", + type: "DateTime", + optional: true + }, + machinePreset: { + name: "machinePreset", + type: "String", + optional: true + }, + usageDurationMs: { + name: "usageDurationMs", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + costInCents: { + name: "costInCents", + type: "Float", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + baseCostInCents: { + name: "baseCostInCents", + type: "Float", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + lockedAt: { + name: "lockedAt", + type: "DateTime", + optional: true + }, + lockedBy: { + name: "lockedBy", + type: "BackgroundWorkerTask", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("lockedById")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "runs", fields: ["lockedById"], references: ["id"] } + }, + lockedById: { + name: "lockedById", + type: "String", + optional: true, + foreignKeyFor: [ + "lockedBy" + ] + }, + lockedToVersion: { + name: "lockedToVersion", + type: "BackgroundWorker", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("lockedToVersionId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "lockedRuns", fields: ["lockedToVersionId"], references: ["id"] } + }, + lockedToVersionId: { + name: "lockedToVersionId", + type: "String", + optional: true, + foreignKeyFor: [ + "lockedToVersion" + ] + }, + priorityMs: { + name: "priorityMs", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + concurrencyKey: { + name: "concurrencyKey", + type: "String", + optional: true + }, + delayUntil: { + name: "delayUntil", + type: "DateTime", + optional: true + }, + queuedAt: { + name: "queuedAt", + type: "DateTime", + optional: true + }, + ttl: { + name: "ttl", + type: "String", + optional: true + }, + expiredAt: { + name: "expiredAt", + type: "DateTime", + optional: true + }, + maxAttempts: { + name: "maxAttempts", + type: "Int", + optional: true + }, + oneTimeUseToken: { + name: "oneTimeUseToken", + type: "String", + optional: true + }, + associatedWaitpoint: { + name: "associatedWaitpoint", + type: "Waitpoint", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("CompletingRun") }] }], + relation: { opposite: "completedByTaskRun", name: "CompletingRun" } + }, + blockedByWaitpoints: { + name: "blockedByWaitpoints", + type: "TaskRunWaitpoint", + array: true, + relation: { opposite: "taskRun" } + }, + connectedWaitpoints: { + name: "connectedWaitpoints", + type: "Waitpoint", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("WaitpointRunConnections") }] }], + relation: { opposite: "connectedRuns", name: "WaitpointRunConnections" } + }, + taskEventStore: { + name: "taskEventStore", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("taskEvent") }] }], + default: "taskEvent" + }, + queueTimestamp: { + name: "queueTimestamp", + type: "DateTime", + optional: true + }, + batchItems: { + name: "batchItems", + type: "BatchTaskRunItem", + array: true, + relation: { opposite: "taskRun" } + }, + dependency: { + name: "dependency", + type: "TaskRunDependency", + optional: true, + relation: { opposite: "taskRun" } + }, + CheckpointRestoreEvent: { + name: "CheckpointRestoreEvent", + type: "CheckpointRestoreEvent", + array: true, + relation: { opposite: "run" } + }, + executionSnapshots: { + name: "executionSnapshots", + type: "TaskRunExecutionSnapshot", + array: true, + relation: { opposite: "run" } + }, + alerts: { + name: "alerts", + type: "ProjectAlert", + array: true, + relation: { opposite: "taskRun" } + }, + scheduleInstanceId: { + name: "scheduleInstanceId", + type: "String", + optional: true + }, + scheduleId: { + name: "scheduleId", + type: "String", + optional: true + }, + sourceBulkActionItems: { + name: "sourceBulkActionItems", + type: "BulkActionItem", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("SourceActionItemRun") }] }], + relation: { opposite: "sourceRun", name: "SourceActionItemRun" } + }, + destinationBulkActionItems: { + name: "destinationBulkActionItems", + type: "BulkActionItem", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("DestinationActionItemRun") }] }], + relation: { opposite: "destinationRun", name: "DestinationActionItemRun" } + }, + logsDeletedAt: { + name: "logsDeletedAt", + type: "DateTime", + optional: true + }, + rootTaskRun: { + name: "rootTaskRun", + type: "TaskRun", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("TaskRootRun") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("rootTaskRunId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }, { name: "onUpdate", value: ExpressionUtils.literal("NoAction") }] }], + relation: { opposite: "descendantRuns", name: "TaskRootRun", fields: ["rootTaskRunId"], references: ["id"], onDelete: "SetNull", onUpdate: "NoAction" } + }, + rootTaskRunId: { + name: "rootTaskRunId", + type: "String", + optional: true, + foreignKeyFor: [ + "rootTaskRun" + ] + }, + descendantRuns: { + name: "descendantRuns", + type: "TaskRun", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("TaskRootRun") }] }], + relation: { opposite: "rootTaskRun", name: "TaskRootRun" } + }, + parentTaskRun: { + name: "parentTaskRun", + type: "TaskRun", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("TaskParentRun") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("parentTaskRunId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }, { name: "onUpdate", value: ExpressionUtils.literal("NoAction") }] }], + relation: { opposite: "childRuns", name: "TaskParentRun", fields: ["parentTaskRunId"], references: ["id"], onDelete: "SetNull", onUpdate: "NoAction" } + }, + parentTaskRunId: { + name: "parentTaskRunId", + type: "String", + optional: true, + foreignKeyFor: [ + "parentTaskRun" + ] + }, + childRuns: { + name: "childRuns", + type: "TaskRun", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("TaskParentRun") }] }], + relation: { opposite: "parentTaskRun", name: "TaskParentRun" } + }, + parentTaskRunAttempt: { + name: "parentTaskRunAttempt", + type: "TaskRunAttempt", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("TaskParentRunAttempt") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("parentTaskRunAttemptId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }, { name: "onUpdate", value: ExpressionUtils.literal("NoAction") }] }], + relation: { opposite: "childRuns", name: "TaskParentRunAttempt", fields: ["parentTaskRunAttemptId"], references: ["id"], onDelete: "SetNull", onUpdate: "NoAction" } + }, + parentTaskRunAttemptId: { + name: "parentTaskRunAttemptId", + type: "String", + optional: true, + foreignKeyFor: [ + "parentTaskRunAttempt" + ] + }, + batch: { + name: "batch", + type: "BatchTaskRun", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("batchId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }, { name: "onUpdate", value: ExpressionUtils.literal("NoAction") }] }], + relation: { opposite: "runs", fields: ["batchId"], references: ["id"], onDelete: "SetNull", onUpdate: "NoAction" } + }, + batchId: { + name: "batchId", + type: "String", + optional: true, + foreignKeyFor: [ + "batch" + ] + }, + resumeParentOnCompletion: { + name: "resumeParentOnCompletion", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + depth: { + name: "depth", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + parentSpanId: { + name: "parentSpanId", + type: "String", + optional: true + }, + runChainState: { + name: "runChainState", + type: "Json", + optional: true + }, + seedMetadata: { + name: "seedMetadata", + type: "String", + optional: true + }, + seedMetadataType: { + name: "seedMetadataType", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("application/json") }] }], + default: "application/json" + }, + metadata: { + name: "metadata", + type: "String", + optional: true + }, + metadataType: { + name: "metadataType", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("application/json") }] }], + default: "application/json" + }, + metadataVersion: { + name: "metadataVersion", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(1) }] }], + default: 1 + }, + output: { + name: "output", + type: "String", + optional: true + }, + outputType: { + name: "outputType", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("application/json") }] }], + default: "application/json" + }, + error: { + name: "error", + type: "Json", + optional: true + }, + maxDurationInSeconds: { + name: "maxDurationInSeconds", + type: "Int", + optional: true + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("oneTimeUseToken")]) }] }, + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runtimeEnvironmentId"), ExpressionUtils.field("taskIdentifier"), ExpressionUtils.field("idempotencyKey")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("parentTaskRunId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("rootTaskRunId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("scheduleId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("spanId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("parentSpanId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("scheduleId"), ExpressionUtils.field("createdAt")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runTags")]) }, { name: "type", value: ExpressionUtils.literal("Gin") }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runtimeEnvironmentId"), ExpressionUtils.field("batchId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runtimeEnvironmentId"), ExpressionUtils.field("id")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runtimeEnvironmentId"), ExpressionUtils.field("createdAt")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("createdAt")]) }, { name: "type", value: ExpressionUtils.literal("Brin") }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("status"), ExpressionUtils.field("runtimeEnvironmentId"), ExpressionUtils.field("createdAt"), ExpressionUtils.field("id")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + friendlyId: { type: "String" }, + oneTimeUseToken: { type: "String" }, + runtimeEnvironmentId_taskIdentifier_idempotencyKey: { runtimeEnvironmentId: { type: "String" }, taskIdentifier: { type: "String" }, idempotencyKey: { type: "String" } } + } + }, + TaskRunExecutionSnapshot: { + name: "TaskRunExecutionSnapshot", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + engine: { + name: "engine", + type: "RunEngineVersion", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("V2") }] }], + default: "V2" + }, + executionStatus: { + name: "executionStatus", + type: "TaskRunExecutionStatus" + }, + description: { + name: "description", + type: "String" + }, + isValid: { + name: "isValid", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(true) }] }], + default: true + }, + error: { + name: "error", + type: "String", + optional: true + }, + previousSnapshotId: { + name: "previousSnapshotId", + type: "String", + optional: true + }, + runId: { + name: "runId", + type: "String", + foreignKeyFor: [ + "run" + ] + }, + run: { + name: "run", + type: "TaskRun", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "executionSnapshots", fields: ["runId"], references: ["id"] } + }, + runStatus: { + name: "runStatus", + type: "TaskRunStatus" + }, + batchId: { + name: "batchId", + type: "String", + optional: true, + foreignKeyFor: [ + "batch" + ] + }, + batch: { + name: "batch", + type: "BatchTaskRun", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("batchId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "executionSnapshots", fields: ["batchId"], references: ["id"] } + }, + attemptNumber: { + name: "attemptNumber", + type: "Int", + optional: true + }, + environmentId: { + name: "environmentId", + type: "String", + foreignKeyFor: [ + "environment" + ] + }, + environment: { + name: "environment", + type: "RuntimeEnvironment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "executionSnapshots", fields: ["environmentId"], references: ["id"] } + }, + environmentType: { + name: "environmentType", + type: "RuntimeEnvironmentType" + }, + projectId: { + name: "projectId", + type: "String", + foreignKeyFor: [ + "project" + ] + }, + project: { + name: "project", + type: "Project", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "executionSnapshots", fields: ["projectId"], references: ["id"] } + }, + organizationId: { + name: "organizationId", + type: "String", + foreignKeyFor: [ + "organization" + ] + }, + organization: { + name: "organization", + type: "Organization", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "executionSnapshots", fields: ["organizationId"], references: ["id"] } + }, + completedWaitpoints: { + name: "completedWaitpoints", + type: "Waitpoint", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("completedWaitpoints") }] }], + relation: { opposite: "completedExecutionSnapshots", name: "completedWaitpoints" } + }, + completedWaitpointOrder: { + name: "completedWaitpointOrder", + type: "String", + array: true + }, + checkpointId: { + name: "checkpointId", + type: "String", + optional: true, + foreignKeyFor: [ + "checkpoint" + ] + }, + checkpoint: { + name: "checkpoint", + type: "TaskRunCheckpoint", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("checkpointId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "executionSnapshot", fields: ["checkpointId"], references: ["id"] } + }, + workerId: { + name: "workerId", + type: "String", + optional: true, + foreignKeyFor: [ + "worker" + ] + }, + worker: { + name: "worker", + type: "WorkerInstance", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("workerId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "TaskRunExecutionSnapshot", fields: ["workerId"], references: ["id"] } + }, + runnerId: { + name: "runnerId", + type: "String", + optional: true + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + lastHeartbeatAt: { + name: "lastHeartbeatAt", + type: "DateTime", + optional: true + }, + metadata: { + name: "metadata", + type: "Json", + optional: true + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runId"), ExpressionUtils.field("isValid"), ExpressionUtils.field("createdAt")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" } + } + }, + TaskRunCheckpoint: { + name: "TaskRunCheckpoint", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + friendlyId: { + name: "friendlyId", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + type: { + name: "type", + type: "TaskRunCheckpointType" + }, + location: { + name: "location", + type: "String" + }, + imageRef: { + name: "imageRef", + type: "String", + optional: true + }, + reason: { + name: "reason", + type: "String", + optional: true + }, + metadata: { + name: "metadata", + type: "String", + optional: true + }, + project: { + name: "project", + type: "Project", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "taskRunCheckpoints", fields: ["projectId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + projectId: { + name: "projectId", + type: "String", + foreignKeyFor: [ + "project" + ] + }, + runtimeEnvironment: { + name: "runtimeEnvironment", + type: "RuntimeEnvironment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runtimeEnvironmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "taskRunCheckpoints", fields: ["runtimeEnvironmentId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + runtimeEnvironmentId: { + name: "runtimeEnvironmentId", + type: "String", + foreignKeyFor: [ + "runtimeEnvironment" + ] + }, + executionSnapshot: { + name: "executionSnapshot", + type: "TaskRunExecutionSnapshot", + array: true, + relation: { opposite: "checkpoint" } + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + friendlyId: { type: "String" } + } + }, + Waitpoint: { + name: "Waitpoint", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + friendlyId: { + name: "friendlyId", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + type: { + name: "type", + type: "WaitpointType" + }, + status: { + name: "status", + type: "WaitpointStatus", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("PENDING") }] }], + default: "PENDING" + }, + completedAt: { + name: "completedAt", + type: "DateTime", + optional: true + }, + idempotencyKey: { + name: "idempotencyKey", + type: "String" + }, + userProvidedIdempotencyKey: { + name: "userProvidedIdempotencyKey", + type: "Boolean" + }, + idempotencyKeyExpiresAt: { + name: "idempotencyKeyExpiresAt", + type: "DateTime", + optional: true + }, + inactiveIdempotencyKey: { + name: "inactiveIdempotencyKey", + type: "String", + optional: true + }, + completedByTaskRunId: { + name: "completedByTaskRunId", + type: "String", + unique: true, + optional: true, + attributes: [{ name: "@unique" }], + foreignKeyFor: [ + "completedByTaskRun" + ] + }, + completedByTaskRun: { + name: "completedByTaskRun", + type: "TaskRun", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("CompletingRun") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("completedByTaskRunId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }] }], + relation: { opposite: "associatedWaitpoint", name: "CompletingRun", fields: ["completedByTaskRunId"], references: ["id"], onDelete: "SetNull" } + }, + completedAfter: { + name: "completedAfter", + type: "DateTime", + optional: true + }, + completedByBatchId: { + name: "completedByBatchId", + type: "String", + optional: true, + foreignKeyFor: [ + "completedByBatch" + ] + }, + completedByBatch: { + name: "completedByBatch", + type: "BatchTaskRun", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("completedByBatchId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }] }], + relation: { opposite: "waitpoints", fields: ["completedByBatchId"], references: ["id"], onDelete: "SetNull" } + }, + blockingTaskRuns: { + name: "blockingTaskRuns", + type: "TaskRunWaitpoint", + array: true, + relation: { opposite: "waitpoint" } + }, + connectedRuns: { + name: "connectedRuns", + type: "TaskRun", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("WaitpointRunConnections") }] }], + relation: { opposite: "connectedWaitpoints", name: "WaitpointRunConnections" } + }, + completedExecutionSnapshots: { + name: "completedExecutionSnapshots", + type: "TaskRunExecutionSnapshot", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("completedWaitpoints") }] }], + relation: { opposite: "completedWaitpoints", name: "completedWaitpoints" } + }, + output: { + name: "output", + type: "String", + optional: true + }, + outputType: { + name: "outputType", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("application/json") }] }], + default: "application/json" + }, + outputIsError: { + name: "outputIsError", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + project: { + name: "project", + type: "Project", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "waitpoints", fields: ["projectId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + projectId: { + name: "projectId", + type: "String", + foreignKeyFor: [ + "project" + ] + }, + environment: { + name: "environment", + type: "RuntimeEnvironment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "waitpoints", fields: ["environmentId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + environmentId: { + name: "environmentId", + type: "String", + foreignKeyFor: [ + "environment" + ] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + tags: { + name: "tags", + type: "String", + array: true + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId"), ExpressionUtils.field("idempotencyKey")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("completedByBatchId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId"), ExpressionUtils.field("type"), ExpressionUtils.field("createdAt")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId"), ExpressionUtils.field("type"), ExpressionUtils.field("status")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + friendlyId: { type: "String" }, + completedByTaskRunId: { type: "String" }, + environmentId_idempotencyKey: { environmentId: { type: "String" }, idempotencyKey: { type: "String" } } + } + }, + TaskRunWaitpoint: { + name: "TaskRunWaitpoint", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + taskRun: { + name: "taskRun", + type: "TaskRun", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("taskRunId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "blockedByWaitpoints", fields: ["taskRunId"], references: ["id"] } + }, + taskRunId: { + name: "taskRunId", + type: "String", + foreignKeyFor: [ + "taskRun" + ] + }, + waitpoint: { + name: "waitpoint", + type: "Waitpoint", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("waitpointId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "blockingTaskRuns", fields: ["waitpointId"], references: ["id"] } + }, + waitpointId: { + name: "waitpointId", + type: "String", + foreignKeyFor: [ + "waitpoint" + ] + }, + project: { + name: "project", + type: "Project", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "taskRunWaitpoints", fields: ["projectId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + projectId: { + name: "projectId", + type: "String", + foreignKeyFor: [ + "project" + ] + }, + spanIdToComplete: { + name: "spanIdToComplete", + type: "String", + optional: true + }, + batchId: { + name: "batchId", + type: "String", + optional: true, + foreignKeyFor: [ + "batch" + ] + }, + batch: { + name: "batch", + type: "BatchTaskRun", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("batchId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "runsBlocked", fields: ["batchId"], references: ["id"] } + }, + batchIndex: { + name: "batchIndex", + type: "Int", + optional: true + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("taskRunId"), ExpressionUtils.field("waitpointId"), ExpressionUtils.field("batchIndex")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("taskRunId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("waitpointId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + taskRunId_waitpointId_batchIndex: { taskRunId: { type: "String" }, waitpointId: { type: "String" }, batchIndex: { type: "Int" } } + } + }, + WaitpointTag: { + name: "WaitpointTag", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + name: { + name: "name", + type: "String" + }, + environment: { + name: "environment", + type: "RuntimeEnvironment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "waitpointTags", fields: ["environmentId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + environmentId: { + name: "environmentId", + type: "String", + foreignKeyFor: [ + "environment" + ] + }, + project: { + name: "project", + type: "Project", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "waitpointTags", fields: ["projectId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + projectId: { + name: "projectId", + type: "String", + foreignKeyFor: [ + "project" + ] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId"), ExpressionUtils.field("name")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + environmentId_name: { environmentId: { type: "String" }, name: { type: "String" } } + } + }, + FeatureFlag: { + name: "FeatureFlag", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + key: { + name: "key", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + value: { + name: "value", + type: "Json", + optional: true + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + key: { type: "String" } + } + }, + WorkerInstance: { + name: "WorkerInstance", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + name: { + name: "name", + type: "String" + }, + resourceIdentifier: { + name: "resourceIdentifier", + type: "String" + }, + metadata: { + name: "metadata", + type: "Json", + optional: true + }, + workerGroup: { + name: "workerGroup", + type: "WorkerInstanceGroup", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("workerGroupId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "workers", fields: ["workerGroupId"], references: ["id"] } + }, + workerGroupId: { + name: "workerGroupId", + type: "String", + foreignKeyFor: [ + "workerGroup" + ] + }, + TaskRunExecutionSnapshot: { + name: "TaskRunExecutionSnapshot", + type: "TaskRunExecutionSnapshot", + array: true, + relation: { opposite: "worker" } + }, + organization: { + name: "organization", + type: "Organization", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "workerInstances", fields: ["organizationId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + organizationId: { + name: "organizationId", + type: "String", + optional: true, + foreignKeyFor: [ + "organization" + ] + }, + project: { + name: "project", + type: "Project", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "workers", fields: ["projectId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + projectId: { + name: "projectId", + type: "String", + optional: true, + foreignKeyFor: [ + "project" + ] + }, + environment: { + name: "environment", + type: "RuntimeEnvironment", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "workerInstances", fields: ["environmentId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + environmentId: { + name: "environmentId", + type: "String", + optional: true, + foreignKeyFor: [ + "environment" + ] + }, + deployment: { + name: "deployment", + type: "WorkerDeployment", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("deploymentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "workerInstance", fields: ["deploymentId"], references: ["id"], onDelete: "SetNull", onUpdate: "Cascade" } + }, + deploymentId: { + name: "deploymentId", + type: "String", + optional: true, + foreignKeyFor: [ + "deployment" + ] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + lastDequeueAt: { + name: "lastDequeueAt", + type: "DateTime", + optional: true + }, + lastHeartbeatAt: { + name: "lastHeartbeatAt", + type: "DateTime", + optional: true + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("workerGroupId"), ExpressionUtils.field("resourceIdentifier")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + workerGroupId_resourceIdentifier: { workerGroupId: { type: "String" }, resourceIdentifier: { type: "String" } } + } + }, + WorkerInstanceGroup: { + name: "WorkerInstanceGroup", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + type: { + name: "type", + type: "WorkerInstanceGroupType" + }, + name: { + name: "name", + type: "String" + }, + masterQueue: { + name: "masterQueue", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + description: { + name: "description", + type: "String", + optional: true + }, + hidden: { + name: "hidden", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + token: { + name: "token", + type: "WorkerGroupToken", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("tokenId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "workerGroup", fields: ["tokenId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + tokenId: { + name: "tokenId", + type: "String", + unique: true, + attributes: [{ name: "@unique" }], + foreignKeyFor: [ + "token" + ] + }, + workers: { + name: "workers", + type: "WorkerInstance", + array: true, + relation: { opposite: "workerGroup" } + }, + backgroundWorkers: { + name: "backgroundWorkers", + type: "BackgroundWorker", + array: true, + relation: { opposite: "workerGroup" } + }, + defaultForProjects: { + name: "defaultForProjects", + type: "Project", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("ProjectDefaultWorkerGroup") }] }], + relation: { opposite: "defaultWorkerGroup", name: "ProjectDefaultWorkerGroup" } + }, + organization: { + name: "organization", + type: "Organization", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "workerGroups", fields: ["organizationId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + organizationId: { + name: "organizationId", + type: "String", + optional: true, + foreignKeyFor: [ + "organization" + ] + }, + project: { + name: "project", + type: "Project", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "workerGroups", fields: ["projectId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + projectId: { + name: "projectId", + type: "String", + optional: true, + foreignKeyFor: [ + "project" + ] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + masterQueue: { type: "String" }, + tokenId: { type: "String" } + } + }, + WorkerGroupToken: { + name: "WorkerGroupToken", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + tokenHash: { + name: "tokenHash", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + workerGroup: { + name: "workerGroup", + type: "WorkerInstanceGroup", + optional: true, + relation: { opposite: "token" } + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + tokenHash: { type: "String" } + } + }, + TaskRunTag: { + name: "TaskRunTag", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + name: { + name: "name", + type: "String" + }, + friendlyId: { + name: "friendlyId", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + runs: { + name: "runs", + type: "TaskRun", + array: true, + relation: { opposite: "tags" } + }, + project: { + name: "project", + type: "Project", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "runTags", fields: ["projectId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + projectId: { + name: "projectId", + type: "String", + foreignKeyFor: [ + "project" + ] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId"), ExpressionUtils.field("name")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("name"), ExpressionUtils.field("id")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + friendlyId: { type: "String" }, + projectId_name: { projectId: { type: "String" }, name: { type: "String" } } + } + }, + TaskRunDependency: { + name: "TaskRunDependency", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + taskRun: { + name: "taskRun", + type: "TaskRun", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("taskRunId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "dependency", fields: ["taskRunId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + taskRunId: { + name: "taskRunId", + type: "String", + unique: true, + attributes: [{ name: "@unique" }], + foreignKeyFor: [ + "taskRun" + ] + }, + checkpointEvent: { + name: "checkpointEvent", + type: "CheckpointRestoreEvent", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("checkpointEventId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "taskRunDependency", fields: ["checkpointEventId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + checkpointEventId: { + name: "checkpointEventId", + type: "String", + unique: true, + optional: true, + attributes: [{ name: "@unique" }], + foreignKeyFor: [ + "checkpointEvent" + ] + }, + dependentAttempt: { + name: "dependentAttempt", + type: "TaskRunAttempt", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("dependentAttemptId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "dependencies", fields: ["dependentAttemptId"], references: ["id"] } + }, + dependentAttemptId: { + name: "dependentAttemptId", + type: "String", + optional: true, + foreignKeyFor: [ + "dependentAttempt" + ] + }, + dependentBatchRun: { + name: "dependentBatchRun", + type: "BatchTaskRun", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("dependentBatchRun") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("dependentBatchRunId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }] }], + relation: { opposite: "runDependencies", name: "dependentBatchRun", fields: ["dependentBatchRunId"], references: ["id"] } + }, + dependentBatchRunId: { + name: "dependentBatchRunId", + type: "String", + optional: true, + foreignKeyFor: [ + "dependentBatchRun" + ] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + resumedAt: { + name: "resumedAt", + type: "DateTime", + optional: true + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("dependentAttemptId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("dependentBatchRunId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + taskRunId: { type: "String" }, + checkpointEventId: { type: "String" } + } + }, + TaskRunCounter: { + name: "TaskRunCounter", + fields: { + taskIdentifier: { + name: "taskIdentifier", + type: "String", + id: true, + attributes: [{ name: "@id" }] + }, + lastNumber: { + name: "lastNumber", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + } + }, + idFields: ["taskIdentifier"], + uniqueFields: { + taskIdentifier: { type: "String" } + } + }, + TaskRunNumberCounter: { + name: "TaskRunNumberCounter", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + taskIdentifier: { + name: "taskIdentifier", + type: "String" + }, + environment: { + name: "environment", + type: "RuntimeEnvironment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "taskRunNumberCounter", fields: ["environmentId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + environmentId: { + name: "environmentId", + type: "String", + foreignKeyFor: [ + "environment" + ] + }, + lastNumber: { + name: "lastNumber", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("taskIdentifier"), ExpressionUtils.field("environmentId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + taskIdentifier_environmentId: { taskIdentifier: { type: "String" }, environmentId: { type: "String" } } + } + }, + TaskRunAttempt: { + name: "TaskRunAttempt", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + number: { + name: "number", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + friendlyId: { + name: "friendlyId", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + taskRun: { + name: "taskRun", + type: "TaskRun", + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("attempts") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("taskRunId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "attempts", name: "attempts", fields: ["taskRunId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + taskRunId: { + name: "taskRunId", + type: "String", + foreignKeyFor: [ + "taskRun" + ] + }, + backgroundWorker: { + name: "backgroundWorker", + type: "BackgroundWorker", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("backgroundWorkerId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "attempts", fields: ["backgroundWorkerId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + backgroundWorkerId: { + name: "backgroundWorkerId", + type: "String", + foreignKeyFor: [ + "backgroundWorker" + ] + }, + backgroundWorkerTask: { + name: "backgroundWorkerTask", + type: "BackgroundWorkerTask", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("backgroundWorkerTaskId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "attempts", fields: ["backgroundWorkerTaskId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + backgroundWorkerTaskId: { + name: "backgroundWorkerTaskId", + type: "String", + foreignKeyFor: [ + "backgroundWorkerTask" + ] + }, + runtimeEnvironment: { + name: "runtimeEnvironment", + type: "RuntimeEnvironment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runtimeEnvironmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "taskRunAttempts", fields: ["runtimeEnvironmentId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + runtimeEnvironmentId: { + name: "runtimeEnvironmentId", + type: "String", + foreignKeyFor: [ + "runtimeEnvironment" + ] + }, + queue: { + name: "queue", + type: "TaskQueue", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("queueId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "attempts", fields: ["queueId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + queueId: { + name: "queueId", + type: "String", + foreignKeyFor: [ + "queue" + ] + }, + status: { + name: "status", + type: "TaskRunAttemptStatus", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("PENDING") }] }], + default: "PENDING" + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + startedAt: { + name: "startedAt", + type: "DateTime", + optional: true + }, + completedAt: { + name: "completedAt", + type: "DateTime", + optional: true + }, + usageDurationMs: { + name: "usageDurationMs", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + error: { + name: "error", + type: "Json", + optional: true + }, + output: { + name: "output", + type: "String", + optional: true + }, + outputType: { + name: "outputType", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("application/json") }] }], + default: "application/json" + }, + dependencies: { + name: "dependencies", + type: "TaskRunDependency", + array: true, + relation: { opposite: "dependentAttempt" } + }, + batchDependencies: { + name: "batchDependencies", + type: "BatchTaskRun", + array: true, + relation: { opposite: "dependentTaskAttempt" } + }, + checkpoints: { + name: "checkpoints", + type: "Checkpoint", + array: true, + relation: { opposite: "attempt" } + }, + batchTaskRunItems: { + name: "batchTaskRunItems", + type: "BatchTaskRunItem", + array: true, + relation: { opposite: "taskRunAttempt" } + }, + CheckpointRestoreEvent: { + name: "CheckpointRestoreEvent", + type: "CheckpointRestoreEvent", + array: true, + relation: { opposite: "attempt" } + }, + alerts: { + name: "alerts", + type: "ProjectAlert", + array: true, + relation: { opposite: "taskRunAttempt" } + }, + childRuns: { + name: "childRuns", + type: "TaskRun", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("TaskParentRunAttempt") }] }], + relation: { opposite: "parentTaskRunAttempt", name: "TaskParentRunAttempt" } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("taskRunId"), ExpressionUtils.field("number")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("taskRunId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + friendlyId: { type: "String" }, + taskRunId_number: { taskRunId: { type: "String" }, number: { type: "Int" } } + } + }, + TaskEvent: { + name: "TaskEvent", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + message: { + name: "message", + type: "String" + }, + traceId: { + name: "traceId", + type: "String" + }, + spanId: { + name: "spanId", + type: "String" + }, + parentId: { + name: "parentId", + type: "String", + optional: true + }, + tracestate: { + name: "tracestate", + type: "String", + optional: true + }, + isError: { + name: "isError", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + isPartial: { + name: "isPartial", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + isCancelled: { + name: "isCancelled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + isDebug: { + name: "isDebug", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + serviceName: { + name: "serviceName", + type: "String" + }, + serviceNamespace: { + name: "serviceNamespace", + type: "String" + }, + level: { + name: "level", + type: "TaskEventLevel", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("TRACE") }] }], + default: "TRACE" + }, + kind: { + name: "kind", + type: "TaskEventKind", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("INTERNAL") }] }], + default: "INTERNAL" + }, + status: { + name: "status", + type: "TaskEventStatus", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("UNSET") }] }], + default: "UNSET" + }, + links: { + name: "links", + type: "Json", + optional: true + }, + events: { + name: "events", + type: "Json", + optional: true + }, + startTime: { + name: "startTime", + type: "BigInt" + }, + duration: { + name: "duration", + type: "BigInt", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + attemptId: { + name: "attemptId", + type: "String", + optional: true + }, + attemptNumber: { + name: "attemptNumber", + type: "Int", + optional: true + }, + environmentId: { + name: "environmentId", + type: "String" + }, + environmentType: { + name: "environmentType", + type: "RuntimeEnvironmentType" + }, + organizationId: { + name: "organizationId", + type: "String" + }, + projectId: { + name: "projectId", + type: "String" + }, + projectRef: { + name: "projectRef", + type: "String" + }, + runId: { + name: "runId", + type: "String" + }, + runIsTest: { + name: "runIsTest", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + idempotencyKey: { + name: "idempotencyKey", + type: "String", + optional: true + }, + taskSlug: { + name: "taskSlug", + type: "String" + }, + taskPath: { + name: "taskPath", + type: "String", + optional: true + }, + taskExportName: { + name: "taskExportName", + type: "String", + optional: true + }, + workerId: { + name: "workerId", + type: "String", + optional: true + }, + workerVersion: { + name: "workerVersion", + type: "String", + optional: true + }, + queueId: { + name: "queueId", + type: "String", + optional: true + }, + queueName: { + name: "queueName", + type: "String", + optional: true + }, + batchId: { + name: "batchId", + type: "String", + optional: true + }, + properties: { + name: "properties", + type: "Json" + }, + metadata: { + name: "metadata", + type: "Json", + optional: true + }, + style: { + name: "style", + type: "Json", + optional: true + }, + output: { + name: "output", + type: "Json", + optional: true + }, + outputType: { + name: "outputType", + type: "String", + optional: true + }, + payload: { + name: "payload", + type: "Json", + optional: true + }, + payloadType: { + name: "payloadType", + type: "String", + optional: true + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + usageDurationMs: { + name: "usageDurationMs", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + usageCostInCents: { + name: "usageCostInCents", + type: "Float", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + machinePreset: { + name: "machinePreset", + type: "String", + optional: true + }, + machinePresetCpu: { + name: "machinePresetCpu", + type: "Float", + optional: true + }, + machinePresetMemory: { + name: "machinePresetMemory", + type: "Float", + optional: true + }, + machinePresetCentsPerMs: { + name: "machinePresetCentsPerMs", + type: "Float", + optional: true + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("traceId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("spanId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" } + } + }, + TaskQueue: { + name: "TaskQueue", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + friendlyId: { + name: "friendlyId", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + name: { + name: "name", + type: "String" + }, + type: { + name: "type", + type: "TaskQueueType", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("VIRTUAL") }] }], + default: "VIRTUAL" + }, + version: { + name: "version", + type: "TaskQueueVersion", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("V1") }] }], + default: "V1" + }, + orderableName: { + name: "orderableName", + type: "String", + optional: true + }, + project: { + name: "project", + type: "Project", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "taskQueues", fields: ["projectId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + projectId: { + name: "projectId", + type: "String", + foreignKeyFor: [ + "project" + ] + }, + runtimeEnvironment: { + name: "runtimeEnvironment", + type: "RuntimeEnvironment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runtimeEnvironmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "taskQueues", fields: ["runtimeEnvironmentId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + runtimeEnvironmentId: { + name: "runtimeEnvironmentId", + type: "String", + foreignKeyFor: [ + "runtimeEnvironment" + ] + }, + concurrencyLimit: { + name: "concurrencyLimit", + type: "Int", + optional: true + }, + rateLimit: { + name: "rateLimit", + type: "Json", + optional: true + }, + paused: { + name: "paused", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + releaseConcurrencyOnWaitpoint: { + name: "releaseConcurrencyOnWaitpoint", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + attempts: { + name: "attempts", + type: "TaskRunAttempt", + array: true, + relation: { opposite: "queue" } + }, + tasks: { + name: "tasks", + type: "BackgroundWorkerTask", + array: true, + relation: { opposite: "queue" } + }, + workers: { + name: "workers", + type: "BackgroundWorker", + array: true, + relation: { opposite: "queues" } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runtimeEnvironmentId"), ExpressionUtils.field("name")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + friendlyId: { type: "String" }, + runtimeEnvironmentId_name: { runtimeEnvironmentId: { type: "String" }, name: { type: "String" } } + } + }, + BatchTaskRun: { + name: "BatchTaskRun", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + friendlyId: { + name: "friendlyId", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + idempotencyKey: { + name: "idempotencyKey", + type: "String", + optional: true + }, + idempotencyKeyExpiresAt: { + name: "idempotencyKeyExpiresAt", + type: "DateTime", + optional: true + }, + runtimeEnvironment: { + name: "runtimeEnvironment", + type: "RuntimeEnvironment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runtimeEnvironmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "batchTaskRuns", fields: ["runtimeEnvironmentId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + status: { + name: "status", + type: "BatchTaskRunStatus", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("PENDING") }] }], + default: "PENDING" + }, + runtimeEnvironmentId: { + name: "runtimeEnvironmentId", + type: "String", + foreignKeyFor: [ + "runtimeEnvironment" + ] + }, + runs: { + name: "runs", + type: "TaskRun", + array: true, + relation: { opposite: "batch" } + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + runIds: { + name: "runIds", + type: "String", + array: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.array([]) }] }], + default: [] + }, + runCount: { + name: "runCount", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + payload: { + name: "payload", + type: "String", + optional: true + }, + payloadType: { + name: "payloadType", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("application/json") }] }], + default: "application/json" + }, + options: { + name: "options", + type: "Json", + optional: true + }, + batchVersion: { + name: "batchVersion", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("v1") }] }], + default: "v1" + }, + executionSnapshots: { + name: "executionSnapshots", + type: "TaskRunExecutionSnapshot", + array: true, + relation: { opposite: "batch" } + }, + runsBlocked: { + name: "runsBlocked", + type: "TaskRunWaitpoint", + array: true, + relation: { opposite: "batch" } + }, + waitpoints: { + name: "waitpoints", + type: "Waitpoint", + array: true, + relation: { opposite: "completedByBatch" } + }, + sealed: { + name: "sealed", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + sealedAt: { + name: "sealedAt", + type: "DateTime", + optional: true + }, + expectedCount: { + name: "expectedCount", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + completedCount: { + name: "completedCount", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + completedAt: { + name: "completedAt", + type: "DateTime", + optional: true + }, + resumedAt: { + name: "resumedAt", + type: "DateTime", + optional: true + }, + processingJobsCount: { + name: "processingJobsCount", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + processingJobsExpectedCount: { + name: "processingJobsExpectedCount", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + oneTimeUseToken: { + name: "oneTimeUseToken", + type: "String", + optional: true + }, + items: { + name: "items", + type: "BatchTaskRunItem", + array: true, + relation: { opposite: "batchTaskRun" } + }, + taskIdentifier: { + name: "taskIdentifier", + type: "String", + optional: true + }, + checkpointEvent: { + name: "checkpointEvent", + type: "CheckpointRestoreEvent", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("checkpointEventId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "batchTaskRunDependency", fields: ["checkpointEventId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + checkpointEventId: { + name: "checkpointEventId", + type: "String", + unique: true, + optional: true, + attributes: [{ name: "@unique" }], + foreignKeyFor: [ + "checkpointEvent" + ] + }, + dependentTaskAttempt: { + name: "dependentTaskAttempt", + type: "TaskRunAttempt", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("dependentTaskAttemptId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "batchDependencies", fields: ["dependentTaskAttemptId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + dependentTaskAttemptId: { + name: "dependentTaskAttemptId", + type: "String", + optional: true, + foreignKeyFor: [ + "dependentTaskAttempt" + ] + }, + runDependencies: { + name: "runDependencies", + type: "TaskRunDependency", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("dependentBatchRun") }] }], + relation: { opposite: "dependentBatchRun", name: "dependentBatchRun" } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("oneTimeUseToken")]) }] }, + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runtimeEnvironmentId"), ExpressionUtils.field("idempotencyKey")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("dependentTaskAttemptId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + friendlyId: { type: "String" }, + checkpointEventId: { type: "String" }, + oneTimeUseToken: { type: "String" }, + runtimeEnvironmentId_idempotencyKey: { runtimeEnvironmentId: { type: "String" }, idempotencyKey: { type: "String" } } + } + }, + BatchTaskRunItem: { + name: "BatchTaskRunItem", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + status: { + name: "status", + type: "BatchTaskRunItemStatus", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("PENDING") }] }], + default: "PENDING" + }, + batchTaskRun: { + name: "batchTaskRun", + type: "BatchTaskRun", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("batchTaskRunId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "items", fields: ["batchTaskRunId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + batchTaskRunId: { + name: "batchTaskRunId", + type: "String", + foreignKeyFor: [ + "batchTaskRun" + ] + }, + taskRun: { + name: "taskRun", + type: "TaskRun", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("taskRunId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "batchItems", fields: ["taskRunId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + taskRunId: { + name: "taskRunId", + type: "String", + foreignKeyFor: [ + "taskRun" + ] + }, + taskRunAttempt: { + name: "taskRunAttempt", + type: "TaskRunAttempt", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("taskRunAttemptId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "batchTaskRunItems", fields: ["taskRunAttemptId"], references: ["id"], onDelete: "SetNull", onUpdate: "Cascade" } + }, + taskRunAttemptId: { + name: "taskRunAttemptId", + type: "String", + optional: true, + foreignKeyFor: [ + "taskRunAttempt" + ] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + completedAt: { + name: "completedAt", + type: "DateTime", + optional: true + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("batchTaskRunId"), ExpressionUtils.field("taskRunId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("taskRunAttemptId")]) }, { name: "map", value: ExpressionUtils.literal("idx_batchtaskrunitem_taskrunattempt") }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("taskRunId")]) }, { name: "map", value: ExpressionUtils.literal("idx_batchtaskrunitem_taskrun") }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + batchTaskRunId_taskRunId: { batchTaskRunId: { type: "String" }, taskRunId: { type: "String" } } + } + }, + EnvironmentVariable: { + name: "EnvironmentVariable", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + friendlyId: { + name: "friendlyId", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + key: { + name: "key", + type: "String" + }, + project: { + name: "project", + type: "Project", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "environmentVariables", fields: ["projectId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + projectId: { + name: "projectId", + type: "String", + foreignKeyFor: [ + "project" + ] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + values: { + name: "values", + type: "EnvironmentVariableValue", + array: true, + relation: { opposite: "variable" } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId"), ExpressionUtils.field("key")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + friendlyId: { type: "String" }, + projectId_key: { projectId: { type: "String" }, key: { type: "String" } } + } + }, + EnvironmentVariableValue: { + name: "EnvironmentVariableValue", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + valueReference: { + name: "valueReference", + type: "SecretReference", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("valueReferenceId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "environmentVariableValues", fields: ["valueReferenceId"], references: ["id"], onDelete: "SetNull", onUpdate: "Cascade" } + }, + valueReferenceId: { + name: "valueReferenceId", + type: "String", + optional: true, + foreignKeyFor: [ + "valueReference" + ] + }, + variable: { + name: "variable", + type: "EnvironmentVariable", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("variableId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "values", fields: ["variableId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + variableId: { + name: "variableId", + type: "String", + foreignKeyFor: [ + "variable" + ] + }, + environment: { + name: "environment", + type: "RuntimeEnvironment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "environmentVariableValues", fields: ["environmentId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + environmentId: { + name: "environmentId", + type: "String", + foreignKeyFor: [ + "environment" + ] + }, + isSecret: { + name: "isSecret", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("variableId"), ExpressionUtils.field("environmentId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + variableId_environmentId: { variableId: { type: "String" }, environmentId: { type: "String" } } + } + }, + Checkpoint: { + name: "Checkpoint", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + friendlyId: { + name: "friendlyId", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + type: { + name: "type", + type: "CheckpointType" + }, + location: { + name: "location", + type: "String" + }, + imageRef: { + name: "imageRef", + type: "String" + }, + reason: { + name: "reason", + type: "String", + optional: true + }, + metadata: { + name: "metadata", + type: "String", + optional: true + }, + events: { + name: "events", + type: "CheckpointRestoreEvent", + array: true, + relation: { opposite: "checkpoint" } + }, + run: { + name: "run", + type: "TaskRun", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "checkpoints", fields: ["runId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + runId: { + name: "runId", + type: "String", + foreignKeyFor: [ + "run" + ] + }, + attempt: { + name: "attempt", + type: "TaskRunAttempt", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("attemptId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "checkpoints", fields: ["attemptId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + attemptId: { + name: "attemptId", + type: "String", + foreignKeyFor: [ + "attempt" + ] + }, + attemptNumber: { + name: "attemptNumber", + type: "Int", + optional: true + }, + project: { + name: "project", + type: "Project", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "checkpoints", fields: ["projectId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + projectId: { + name: "projectId", + type: "String", + foreignKeyFor: [ + "project" + ] + }, + runtimeEnvironment: { + name: "runtimeEnvironment", + type: "RuntimeEnvironment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runtimeEnvironmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "checkpoints", fields: ["runtimeEnvironmentId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + runtimeEnvironmentId: { + name: "runtimeEnvironmentId", + type: "String", + foreignKeyFor: [ + "runtimeEnvironment" + ] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("attemptId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + friendlyId: { type: "String" } + } + }, + CheckpointRestoreEvent: { + name: "CheckpointRestoreEvent", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + type: { + name: "type", + type: "CheckpointRestoreEventType" + }, + reason: { + name: "reason", + type: "String", + optional: true + }, + metadata: { + name: "metadata", + type: "String", + optional: true + }, + checkpoint: { + name: "checkpoint", + type: "Checkpoint", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("checkpointId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "events", fields: ["checkpointId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + checkpointId: { + name: "checkpointId", + type: "String", + foreignKeyFor: [ + "checkpoint" + ] + }, + run: { + name: "run", + type: "TaskRun", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "CheckpointRestoreEvent", fields: ["runId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + runId: { + name: "runId", + type: "String", + foreignKeyFor: [ + "run" + ] + }, + attempt: { + name: "attempt", + type: "TaskRunAttempt", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("attemptId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "CheckpointRestoreEvent", fields: ["attemptId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + attemptId: { + name: "attemptId", + type: "String", + foreignKeyFor: [ + "attempt" + ] + }, + project: { + name: "project", + type: "Project", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "CheckpointRestoreEvent", fields: ["projectId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + projectId: { + name: "projectId", + type: "String", + foreignKeyFor: [ + "project" + ] + }, + runtimeEnvironment: { + name: "runtimeEnvironment", + type: "RuntimeEnvironment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runtimeEnvironmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "CheckpointRestoreEvent", fields: ["runtimeEnvironmentId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + runtimeEnvironmentId: { + name: "runtimeEnvironmentId", + type: "String", + foreignKeyFor: [ + "runtimeEnvironment" + ] + }, + taskRunDependency: { + name: "taskRunDependency", + type: "TaskRunDependency", + optional: true, + relation: { opposite: "checkpointEvent" } + }, + batchTaskRunDependency: { + name: "batchTaskRunDependency", + type: "BatchTaskRun", + optional: true, + relation: { opposite: "checkpointEvent" } + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("checkpointId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" } + } + }, + WorkerDeployment: { + name: "WorkerDeployment", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + contentHash: { + name: "contentHash", + type: "String" + }, + friendlyId: { + name: "friendlyId", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + shortCode: { + name: "shortCode", + type: "String" + }, + version: { + name: "version", + type: "String" + }, + imageReference: { + name: "imageReference", + type: "String", + optional: true + }, + imagePlatform: { + name: "imagePlatform", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("linux/amd64") }] }], + default: "linux/amd64" + }, + externalBuildData: { + name: "externalBuildData", + type: "Json", + optional: true + }, + status: { + name: "status", + type: "WorkerDeploymentStatus", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("PENDING") }] }], + default: "PENDING" + }, + type: { + name: "type", + type: "WorkerDeploymentType", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("V1") }] }], + default: "V1" + }, + project: { + name: "project", + type: "Project", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "WorkerDeployment", fields: ["projectId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + projectId: { + name: "projectId", + type: "String", + foreignKeyFor: [ + "project" + ] + }, + environment: { + name: "environment", + type: "RuntimeEnvironment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "workerDeployments", fields: ["environmentId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + environmentId: { + name: "environmentId", + type: "String", + foreignKeyFor: [ + "environment" + ] + }, + worker: { + name: "worker", + type: "BackgroundWorker", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("workerId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "deployment", fields: ["workerId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + workerId: { + name: "workerId", + type: "String", + unique: true, + optional: true, + attributes: [{ name: "@unique" }], + foreignKeyFor: [ + "worker" + ] + }, + triggeredBy: { + name: "triggeredBy", + type: "User", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("triggeredById")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "deployments", fields: ["triggeredById"], references: ["id"], onDelete: "SetNull", onUpdate: "Cascade" } + }, + triggeredById: { + name: "triggeredById", + type: "String", + optional: true, + foreignKeyFor: [ + "triggeredBy" + ] + }, + builtAt: { + name: "builtAt", + type: "DateTime", + optional: true + }, + deployedAt: { + name: "deployedAt", + type: "DateTime", + optional: true + }, + failedAt: { + name: "failedAt", + type: "DateTime", + optional: true + }, + errorData: { + name: "errorData", + type: "Json", + optional: true + }, + git: { + name: "git", + type: "Json", + optional: true + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + promotions: { + name: "promotions", + type: "WorkerDeploymentPromotion", + array: true, + relation: { opposite: "deployment" } + }, + alerts: { + name: "alerts", + type: "ProjectAlert", + array: true, + relation: { opposite: "workerDeployment" } + }, + workerInstance: { + name: "workerInstance", + type: "WorkerInstance", + array: true, + relation: { opposite: "deployment" } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId"), ExpressionUtils.field("shortCode")]) }] }, + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId"), ExpressionUtils.field("version")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + friendlyId: { type: "String" }, + workerId: { type: "String" }, + projectId_shortCode: { projectId: { type: "String" }, shortCode: { type: "String" } }, + environmentId_version: { environmentId: { type: "String" }, version: { type: "String" } } + } + }, + WorkerDeploymentPromotion: { + name: "WorkerDeploymentPromotion", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + label: { + name: "label", + type: "String" + }, + deployment: { + name: "deployment", + type: "WorkerDeployment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("deploymentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "promotions", fields: ["deploymentId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + deploymentId: { + name: "deploymentId", + type: "String", + foreignKeyFor: [ + "deployment" + ] + }, + environment: { + name: "environment", + type: "RuntimeEnvironment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "workerDeploymentPromotions", fields: ["environmentId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + environmentId: { + name: "environmentId", + type: "String", + foreignKeyFor: [ + "environment" + ] + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId"), ExpressionUtils.field("label")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + environmentId_label: { environmentId: { type: "String" }, label: { type: "String" } } + } + }, + TaskSchedule: { + name: "TaskSchedule", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + type: { + name: "type", + type: "ScheduleType", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("IMPERATIVE") }] }], + default: "IMPERATIVE" + }, + friendlyId: { + name: "friendlyId", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + taskIdentifier: { + name: "taskIdentifier", + type: "String" + }, + deduplicationKey: { + name: "deduplicationKey", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + userProvidedDeduplicationKey: { + name: "userProvidedDeduplicationKey", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + generatorExpression: { + name: "generatorExpression", + type: "String" + }, + generatorDescription: { + name: "generatorDescription", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("") }] }], + default: "" + }, + generatorType: { + name: "generatorType", + type: "ScheduleGeneratorType", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("CRON") }] }], + default: "CRON" + }, + timezone: { + name: "timezone", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("UTC") }] }], + default: "UTC" + }, + externalId: { + name: "externalId", + type: "String", + optional: true + }, + instances: { + name: "instances", + type: "TaskScheduleInstance", + array: true, + relation: { opposite: "taskSchedule" } + }, + lastRunTriggeredAt: { + name: "lastRunTriggeredAt", + type: "DateTime", + optional: true + }, + project: { + name: "project", + type: "Project", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "taskSchedules", fields: ["projectId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + projectId: { + name: "projectId", + type: "String", + foreignKeyFor: [ + "project" + ] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + active: { + name: "active", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(true) }] }], + default: true + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId"), ExpressionUtils.field("deduplicationKey")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId"), ExpressionUtils.field("createdAt")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + friendlyId: { type: "String" }, + projectId_deduplicationKey: { projectId: { type: "String" }, deduplicationKey: { type: "String" } } + } + }, + TaskScheduleInstance: { + name: "TaskScheduleInstance", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + taskSchedule: { + name: "taskSchedule", + type: "TaskSchedule", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("taskScheduleId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "instances", fields: ["taskScheduleId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + taskScheduleId: { + name: "taskScheduleId", + type: "String", + foreignKeyFor: [ + "taskSchedule" + ] + }, + environment: { + name: "environment", + type: "RuntimeEnvironment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "taskScheduleInstances", fields: ["environmentId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + environmentId: { + name: "environmentId", + type: "String", + foreignKeyFor: [ + "environment" + ] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + active: { + name: "active", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(true) }] }], + default: true + }, + lastScheduledTimestamp: { + name: "lastScheduledTimestamp", + type: "DateTime", + optional: true + }, + nextScheduledTimestamp: { + name: "nextScheduledTimestamp", + type: "DateTime", + optional: true + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("taskScheduleId"), ExpressionUtils.field("environmentId")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + taskScheduleId_environmentId: { taskScheduleId: { type: "String" }, environmentId: { type: "String" } } + } + }, + RuntimeEnvironmentSession: { + name: "RuntimeEnvironmentSession", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + ipAddress: { + name: "ipAddress", + type: "String" + }, + environment: { + name: "environment", + type: "RuntimeEnvironment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "sessions", fields: ["environmentId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + environmentId: { + name: "environmentId", + type: "String", + foreignKeyFor: [ + "environment" + ] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + disconnectedAt: { + name: "disconnectedAt", + type: "DateTime", + optional: true + }, + currentEnvironments: { + name: "currentEnvironments", + type: "RuntimeEnvironment", + array: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("currentSession") }] }], + relation: { opposite: "currentSession", name: "currentSession" } + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" } + } + }, + ProjectAlertChannel: { + name: "ProjectAlertChannel", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + friendlyId: { + name: "friendlyId", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + deduplicationKey: { + name: "deduplicationKey", + type: "String", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + userProvidedDeduplicationKey: { + name: "userProvidedDeduplicationKey", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + integration: { + name: "integration", + type: "OrganizationIntegration", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("integrationId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("SetNull") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "alertChannels", fields: ["integrationId"], references: ["id"], onDelete: "SetNull", onUpdate: "Cascade" } + }, + integrationId: { + name: "integrationId", + type: "String", + optional: true, + foreignKeyFor: [ + "integration" + ] + }, + enabled: { + name: "enabled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(true) }] }], + default: true + }, + type: { + name: "type", + type: "ProjectAlertChannelType" + }, + name: { + name: "name", + type: "String" + }, + properties: { + name: "properties", + type: "Json" + }, + alertTypes: { + name: "alertTypes", + type: "ProjectAlertType", + array: true + }, + environmentTypes: { + name: "environmentTypes", + type: "RuntimeEnvironmentType", + array: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.array([ExpressionUtils.literal("STAGING"), ExpressionUtils.literal("PRODUCTION")]) }] }], + default: ["STAGING", "PRODUCTION"] + }, + project: { + name: "project", + type: "Project", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "alertChannels", fields: ["projectId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + projectId: { + name: "projectId", + type: "String", + foreignKeyFor: [ + "project" + ] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + alerts: { + name: "alerts", + type: "ProjectAlert", + array: true, + relation: { opposite: "channel" } + }, + alertStorages: { + name: "alertStorages", + type: "ProjectAlertStorage", + array: true, + relation: { opposite: "alertChannel" } + } + }, + attributes: [ + { name: "@@unique", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId"), ExpressionUtils.field("deduplicationKey")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + friendlyId: { type: "String" }, + projectId_deduplicationKey: { projectId: { type: "String" }, deduplicationKey: { type: "String" } } + } + }, + ProjectAlert: { + name: "ProjectAlert", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + friendlyId: { + name: "friendlyId", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + project: { + name: "project", + type: "Project", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "alerts", fields: ["projectId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + projectId: { + name: "projectId", + type: "String", + foreignKeyFor: [ + "project" + ] + }, + environment: { + name: "environment", + type: "RuntimeEnvironment", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("environmentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "alerts", fields: ["environmentId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + environmentId: { + name: "environmentId", + type: "String", + foreignKeyFor: [ + "environment" + ] + }, + channel: { + name: "channel", + type: "ProjectAlertChannel", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("channelId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "alerts", fields: ["channelId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + channelId: { + name: "channelId", + type: "String", + foreignKeyFor: [ + "channel" + ] + }, + status: { + name: "status", + type: "ProjectAlertStatus", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("PENDING") }] }], + default: "PENDING" + }, + type: { + name: "type", + type: "ProjectAlertType" + }, + taskRunAttempt: { + name: "taskRunAttempt", + type: "TaskRunAttempt", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("taskRunAttemptId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "alerts", fields: ["taskRunAttemptId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + taskRunAttemptId: { + name: "taskRunAttemptId", + type: "String", + optional: true, + foreignKeyFor: [ + "taskRunAttempt" + ] + }, + taskRun: { + name: "taskRun", + type: "TaskRun", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("taskRunId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "alerts", fields: ["taskRunId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + taskRunId: { + name: "taskRunId", + type: "String", + optional: true, + foreignKeyFor: [ + "taskRun" + ] + }, + workerDeployment: { + name: "workerDeployment", + type: "WorkerDeployment", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("workerDeploymentId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "alerts", fields: ["workerDeploymentId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + workerDeploymentId: { + name: "workerDeploymentId", + type: "String", + optional: true, + foreignKeyFor: [ + "workerDeployment" + ] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + friendlyId: { type: "String" } + } + }, + ProjectAlertStorage: { + name: "ProjectAlertStorage", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + project: { + name: "project", + type: "Project", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "alertStorages", fields: ["projectId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + projectId: { + name: "projectId", + type: "String", + foreignKeyFor: [ + "project" + ] + }, + alertChannel: { + name: "alertChannel", + type: "ProjectAlertChannel", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("alertChannelId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "alertStorages", fields: ["alertChannelId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + alertChannelId: { + name: "alertChannelId", + type: "String", + foreignKeyFor: [ + "alertChannel" + ] + }, + alertType: { + name: "alertType", + type: "ProjectAlertType" + }, + storageId: { + name: "storageId", + type: "String" + }, + storageData: { + name: "storageData", + type: "Json" + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" } + } + }, + OrganizationIntegration: { + name: "OrganizationIntegration", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + friendlyId: { + name: "friendlyId", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + service: { + name: "service", + type: "IntegrationService" + }, + integrationData: { + name: "integrationData", + type: "Json" + }, + tokenReference: { + name: "tokenReference", + type: "SecretReference", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("tokenReferenceId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "OrganizationIntegration", fields: ["tokenReferenceId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + tokenReferenceId: { + name: "tokenReferenceId", + type: "String", + foreignKeyFor: [ + "tokenReference" + ] + }, + organization: { + name: "organization", + type: "Organization", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("organizationId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "organizationIntegrations", fields: ["organizationId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + organizationId: { + name: "organizationId", + type: "String", + foreignKeyFor: [ + "organization" + ] + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + }, + alertChannels: { + name: "alertChannels", + type: "ProjectAlertChannel", + array: true, + relation: { opposite: "integration" } + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + friendlyId: { type: "String" } + } + }, + BulkActionGroup: { + name: "BulkActionGroup", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + friendlyId: { + name: "friendlyId", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + project: { + name: "project", + type: "Project", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("projectId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "bulkActionGroups", fields: ["projectId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + projectId: { + name: "projectId", + type: "String", + foreignKeyFor: [ + "project" + ] + }, + type: { + name: "type", + type: "BulkActionType" + }, + items: { + name: "items", + type: "BulkActionItem", + array: true, + relation: { opposite: "group" } + }, + status: { + name: "status", + type: "BulkActionStatus", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("PENDING") }] }], + default: "PENDING" + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + friendlyId: { type: "String" } + } + }, + BulkActionItem: { + name: "BulkActionItem", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + friendlyId: { + name: "friendlyId", + type: "String", + unique: true, + attributes: [{ name: "@unique" }] + }, + group: { + name: "group", + type: "BulkActionGroup", + attributes: [{ name: "@relation", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("groupId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "items", fields: ["groupId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + groupId: { + name: "groupId", + type: "String", + foreignKeyFor: [ + "group" + ] + }, + type: { + name: "type", + type: "BulkActionType" + }, + status: { + name: "status", + type: "BulkActionItemStatus", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("PENDING") }] }], + default: "PENDING" + }, + sourceRun: { + name: "sourceRun", + type: "TaskRun", + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("SourceActionItemRun") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("sourceRunId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "sourceBulkActionItems", name: "SourceActionItemRun", fields: ["sourceRunId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + sourceRunId: { + name: "sourceRunId", + type: "String", + foreignKeyFor: [ + "sourceRun" + ] + }, + destinationRun: { + name: "destinationRun", + type: "TaskRun", + optional: true, + attributes: [{ name: "@relation", args: [{ name: "name", value: ExpressionUtils.literal("DestinationActionItemRun") }, { name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("destinationRunId")]) }, { name: "references", value: ExpressionUtils.array([ExpressionUtils.field("id")]) }, { name: "onDelete", value: ExpressionUtils.literal("Cascade") }, { name: "onUpdate", value: ExpressionUtils.literal("Cascade") }] }], + relation: { opposite: "destinationBulkActionItems", name: "DestinationActionItemRun", fields: ["destinationRunId"], references: ["id"], onDelete: "Cascade", onUpdate: "Cascade" } + }, + destinationRunId: { + name: "destinationRunId", + type: "String", + optional: true, + foreignKeyFor: [ + "destinationRun" + ] + }, + error: { + name: "error", + type: "String", + optional: true + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + updatedAt: { + name: "updatedAt", + type: "DateTime", + updatedAt: true, + attributes: [{ name: "@updatedAt" }] + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" }, + friendlyId: { type: "String" } + } + }, + RealtimeStreamChunk: { + name: "RealtimeStreamChunk", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + key: { + name: "key", + type: "String" + }, + value: { + name: "value", + type: "String" + }, + sequence: { + name: "sequence", + type: "Int" + }, + runId: { + name: "runId", + type: "String" + }, + createdAt: { + name: "createdAt", + type: "DateTime", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + } + }, + attributes: [ + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("createdAt")]) }] } + ], + idFields: ["id"], + uniqueFields: { + id: { type: "String" } + } + }, + TaskEventPartitioned: { + name: "TaskEventPartitioned", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }], + default: ExpressionUtils.call("cuid") + }, + message: { + name: "message", + type: "String" + }, + traceId: { + name: "traceId", + type: "String" + }, + spanId: { + name: "spanId", + type: "String" + }, + parentId: { + name: "parentId", + type: "String", + optional: true + }, + tracestate: { + name: "tracestate", + type: "String", + optional: true + }, + isError: { + name: "isError", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + isPartial: { + name: "isPartial", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + isCancelled: { + name: "isCancelled", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + serviceName: { + name: "serviceName", + type: "String" + }, + serviceNamespace: { + name: "serviceNamespace", + type: "String" + }, + level: { + name: "level", + type: "TaskEventLevel", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("TRACE") }] }], + default: "TRACE" + }, + kind: { + name: "kind", + type: "TaskEventKind", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("INTERNAL") }] }], + default: "INTERNAL" + }, + status: { + name: "status", + type: "TaskEventStatus", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("UNSET") }] }], + default: "UNSET" + }, + links: { + name: "links", + type: "Json", + optional: true + }, + events: { + name: "events", + type: "Json", + optional: true + }, + startTime: { + name: "startTime", + type: "BigInt" + }, + duration: { + name: "duration", + type: "BigInt", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + attemptId: { + name: "attemptId", + type: "String", + optional: true + }, + attemptNumber: { + name: "attemptNumber", + type: "Int", + optional: true + }, + environmentId: { + name: "environmentId", + type: "String" + }, + environmentType: { + name: "environmentType", + type: "RuntimeEnvironmentType" + }, + organizationId: { + name: "organizationId", + type: "String" + }, + projectId: { + name: "projectId", + type: "String" + }, + projectRef: { + name: "projectRef", + type: "String" + }, + runId: { + name: "runId", + type: "String" + }, + runIsTest: { + name: "runIsTest", + type: "Boolean", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(false) }] }], + default: false + }, + idempotencyKey: { + name: "idempotencyKey", + type: "String", + optional: true + }, + taskSlug: { + name: "taskSlug", + type: "String" + }, + taskPath: { + name: "taskPath", + type: "String", + optional: true + }, + taskExportName: { + name: "taskExportName", + type: "String", + optional: true + }, + workerId: { + name: "workerId", + type: "String", + optional: true + }, + workerVersion: { + name: "workerVersion", + type: "String", + optional: true + }, + queueId: { + name: "queueId", + type: "String", + optional: true + }, + queueName: { + name: "queueName", + type: "String", + optional: true + }, + batchId: { + name: "batchId", + type: "String", + optional: true + }, + properties: { + name: "properties", + type: "Json" + }, + metadata: { + name: "metadata", + type: "Json", + optional: true + }, + style: { + name: "style", + type: "Json", + optional: true + }, + output: { + name: "output", + type: "Json", + optional: true + }, + outputType: { + name: "outputType", + type: "String", + optional: true + }, + payload: { + name: "payload", + type: "Json", + optional: true + }, + payloadType: { + name: "payloadType", + type: "String", + optional: true + }, + createdAt: { + name: "createdAt", + type: "DateTime", + id: true, + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.call("now") }] }], + default: ExpressionUtils.call("now") + }, + usageDurationMs: { + name: "usageDurationMs", + type: "Int", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + usageCostInCents: { + name: "usageCostInCents", + type: "Float", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal(0) }] }], + default: 0 + }, + machinePreset: { + name: "machinePreset", + type: "String", + optional: true + }, + machinePresetCpu: { + name: "machinePresetCpu", + type: "Float", + optional: true + }, + machinePresetMemory: { + name: "machinePresetMemory", + type: "Float", + optional: true + }, + machinePresetCentsPerMs: { + name: "machinePresetCentsPerMs", + type: "Float", + optional: true + } + }, + attributes: [ + { name: "@@id", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("id"), ExpressionUtils.field("createdAt")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("traceId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("spanId")]) }] }, + { name: "@@index", args: [{ name: "fields", value: ExpressionUtils.array([ExpressionUtils.field("runId")]) }] } + ], + idFields: ["id", "createdAt"], + uniqueFields: { + id_createdAt: { id: { type: "String" }, createdAt: { type: "DateTime" } } + } + } + } as const; + enums = { + AuthenticationMethod: { + values: { + GITHUB: "GITHUB", + MAGIC_LINK: "MAGIC_LINK" + } + }, + OrgMemberRole: { + values: { + ADMIN: "ADMIN", + MEMBER: "MEMBER" + } + }, + RuntimeEnvironmentType: { + values: { + PRODUCTION: "PRODUCTION", + STAGING: "STAGING", + DEVELOPMENT: "DEVELOPMENT", + PREVIEW: "PREVIEW" + } + }, + ProjectVersion: { + values: { + V2: "V2", + V3: "V3" + } + }, + SecretStoreProvider: { + values: { + DATABASE: "DATABASE", + AWS_PARAM_STORE: "AWS_PARAM_STORE" + } + }, + TaskTriggerSource: { + values: { + STANDARD: "STANDARD", + SCHEDULED: "SCHEDULED" + } + }, + TaskRunStatus: { + values: { + DELAYED: "DELAYED", + PENDING: "PENDING", + PENDING_VERSION: "PENDING_VERSION", + WAITING_FOR_DEPLOY: "WAITING_FOR_DEPLOY", + EXECUTING: "EXECUTING", + WAITING_TO_RESUME: "WAITING_TO_RESUME", + RETRYING_AFTER_FAILURE: "RETRYING_AFTER_FAILURE", + PAUSED: "PAUSED", + CANCELED: "CANCELED", + INTERRUPTED: "INTERRUPTED", + COMPLETED_SUCCESSFULLY: "COMPLETED_SUCCESSFULLY", + COMPLETED_WITH_ERRORS: "COMPLETED_WITH_ERRORS", + SYSTEM_FAILURE: "SYSTEM_FAILURE", + CRASHED: "CRASHED", + EXPIRED: "EXPIRED", + TIMED_OUT: "TIMED_OUT" + } + }, + RunEngineVersion: { + values: { + V1: "V1", + V2: "V2" + } + }, + TaskRunExecutionStatus: { + values: { + RUN_CREATED: "RUN_CREATED", + QUEUED: "QUEUED", + QUEUED_EXECUTING: "QUEUED_EXECUTING", + PENDING_EXECUTING: "PENDING_EXECUTING", + EXECUTING: "EXECUTING", + EXECUTING_WITH_WAITPOINTS: "EXECUTING_WITH_WAITPOINTS", + SUSPENDED: "SUSPENDED", + PENDING_CANCEL: "PENDING_CANCEL", + FINISHED: "FINISHED" + } + }, + TaskRunCheckpointType: { + values: { + DOCKER: "DOCKER", + KUBERNETES: "KUBERNETES" + } + }, + WaitpointType: { + values: { + RUN: "RUN", + DATETIME: "DATETIME", + MANUAL: "MANUAL", + BATCH: "BATCH" + } + }, + WaitpointStatus: { + values: { + PENDING: "PENDING", + COMPLETED: "COMPLETED" + } + }, + WorkerInstanceGroupType: { + values: { + MANAGED: "MANAGED", + UNMANAGED: "UNMANAGED" + } + }, + TaskRunAttemptStatus: { + values: { + PENDING: "PENDING", + EXECUTING: "EXECUTING", + PAUSED: "PAUSED", + FAILED: "FAILED", + CANCELED: "CANCELED", + COMPLETED: "COMPLETED" + } + }, + TaskEventLevel: { + values: { + TRACE: "TRACE", + DEBUG: "DEBUG", + LOG: "LOG", + INFO: "INFO", + WARN: "WARN", + ERROR: "ERROR" + } + }, + TaskEventKind: { + values: { + UNSPECIFIED: "UNSPECIFIED", + INTERNAL: "INTERNAL", + SERVER: "SERVER", + CLIENT: "CLIENT", + PRODUCER: "PRODUCER", + CONSUMER: "CONSUMER", + UNRECOGNIZED: "UNRECOGNIZED", + LOG: "LOG" + } + }, + TaskEventStatus: { + values: { + UNSET: "UNSET", + OK: "OK", + ERROR: "ERROR", + UNRECOGNIZED: "UNRECOGNIZED" + } + }, + TaskQueueType: { + values: { + VIRTUAL: "VIRTUAL", + NAMED: "NAMED" + } + }, + TaskQueueVersion: { + values: { + V1: "V1", + V2: "V2" + } + }, + BatchTaskRunStatus: { + values: { + PENDING: "PENDING", + COMPLETED: "COMPLETED", + ABORTED: "ABORTED" + } + }, + BatchTaskRunItemStatus: { + values: { + PENDING: "PENDING", + FAILED: "FAILED", + CANCELED: "CANCELED", + COMPLETED: "COMPLETED" + } + }, + CheckpointType: { + values: { + DOCKER: "DOCKER", + KUBERNETES: "KUBERNETES" + } + }, + CheckpointRestoreEventType: { + values: { + CHECKPOINT: "CHECKPOINT", + RESTORE: "RESTORE" + } + }, + WorkerDeploymentType: { + values: { + MANAGED: "MANAGED", + UNMANAGED: "UNMANAGED", + V1: "V1" + } + }, + WorkerDeploymentStatus: { + values: { + PENDING: "PENDING", + BUILDING: "BUILDING", + DEPLOYING: "DEPLOYING", + DEPLOYED: "DEPLOYED", + FAILED: "FAILED", + CANCELED: "CANCELED", + TIMED_OUT: "TIMED_OUT" + } + }, + ScheduleType: { + values: { + DECLARATIVE: "DECLARATIVE", + IMPERATIVE: "IMPERATIVE" + } + }, + ScheduleGeneratorType: { + values: { + CRON: "CRON" + } + }, + ProjectAlertChannelType: { + values: { + EMAIL: "EMAIL", + SLACK: "SLACK", + WEBHOOK: "WEBHOOK" + } + }, + ProjectAlertType: { + values: { + TASK_RUN: "TASK_RUN", + TASK_RUN_ATTEMPT: "TASK_RUN_ATTEMPT", + DEPLOYMENT_FAILURE: "DEPLOYMENT_FAILURE", + DEPLOYMENT_SUCCESS: "DEPLOYMENT_SUCCESS" + } + }, + ProjectAlertStatus: { + values: { + PENDING: "PENDING", + SENT: "SENT", + FAILED: "FAILED" + } + }, + IntegrationService: { + values: { + SLACK: "SLACK" + } + }, + BulkActionType: { + values: { + CANCEL: "CANCEL", + REPLAY: "REPLAY" + } + }, + BulkActionStatus: { + values: { + PENDING: "PENDING", + COMPLETED: "COMPLETED" + } + }, + BulkActionItemStatus: { + values: { + PENDING: "PENDING", + COMPLETED: "COMPLETED", + FAILED: "FAILED" + } + } + } as const; + authType = "User" as const; + plugins = {}; +} +export const schema = new SchemaType(); diff --git a/tests/e2e/github-repos/trigger.dev/schema.zmodel b/tests/e2e/github-repos/trigger.dev/schema.zmodel index 0975ebb5e..4e19953b4 100644 --- a/tests/e2e/github-repos/trigger.dev/schema.zmodel +++ b/tests/e2e/github-repos/trigger.dev/schema.zmodel @@ -1,755 +1,749 @@ datasource db { - provider = "postgresql" - url = env("DATABASE_URL") - directUrl = env("DIRECT_URL") -} - -generator client { - provider = "prisma-client-js" - binaryTargets = ["native", "debian-openssl-1.1.x"] - previewFeatures = ["tracing", "metrics"] + provider = "postgresql" + url = env("DATABASE_URL") + directUrl = env("DIRECT_URL") } model User { - id String @id @default(cuid()) - email String @unique + id String @id @default(cuid()) + email String @unique - authenticationMethod AuthenticationMethod - authenticationProfile Json? - authenticationExtraParams Json? - authIdentifier String? @unique + authenticationMethod AuthenticationMethod + authenticationProfile Json? + authenticationExtraParams Json? + authIdentifier String? @unique - displayName String? - name String? - avatarUrl String? + displayName String? + name String? + avatarUrl String? - admin Boolean @default(false) + admin Boolean @default(false) - /// Preferences for the dashboard + /// Preferences for the dashboard dashboardPreferences Json? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt - /// @deprecated + /// @deprecated isOnCloudWaitlist Boolean @default(false) - /// @deprecated + /// @deprecated featureCloud Boolean @default(false) - /// @deprecated + /// @deprecated isOnHostedRepoWaitlist Boolean @default(false) - marketingEmails Boolean @default(true) - confirmedBasicDetails Boolean @default(false) + marketingEmails Boolean @default(true) + confirmedBasicDetails Boolean @default(false) - referralSource String? + referralSource String? - orgMemberships OrgMember[] - sentInvites OrgMemberInvite[] + orgMemberships OrgMember[] + sentInvites OrgMemberInvite[] - invitationCode InvitationCode? @relation(fields: [invitationCodeId], references: [id]) - invitationCodeId String? - personalAccessTokens PersonalAccessToken[] - deployments WorkerDeployment[] + invitationCode InvitationCode? @relation(fields: [invitationCodeId], references: [id]) + invitationCodeId String? + personalAccessTokens PersonalAccessToken[] + deployments WorkerDeployment[] } // @deprecated This model is no longer used as the Cloud is out of private beta // Leaving it here for now for historical reasons model InvitationCode { - id String @id @default(cuid()) - code String @unique + id String @id @default(cuid()) + code String @unique - users User[] + users User[] - createdAt DateTime @default(now()) + createdAt DateTime @default(now()) } enum AuthenticationMethod { - GITHUB - MAGIC_LINK + GITHUB + MAGIC_LINK } /// Used to generate PersonalAccessTokens, they're one-time use model AuthorizationCode { - id String @id @default(cuid()) + id String @id @default(cuid()) - code String @unique + code String @unique - personalAccessToken PersonalAccessToken? @relation(fields: [personalAccessTokenId], references: [id], onDelete: Cascade, onUpdate: Cascade) - personalAccessTokenId String? + personalAccessToken PersonalAccessToken? @relation(fields: [personalAccessTokenId], references: [id], onDelete: Cascade, onUpdate: Cascade) + personalAccessTokenId String? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt } // Used by User's to perform API actions model PersonalAccessToken { - id String @id @default(cuid()) + id String @id @default(cuid()) - /// If generated by the CLI this will be "cli", otherwise user-provided + /// If generated by the CLI this will be "cli", otherwise user-provided name String - /// This is the token encrypted using the ENCRYPTION_KEY + /// This is the token encrypted using the ENCRYPTION_KEY encryptedToken Json - /// This is shown in the UI, with ******** + /// This is shown in the UI, with ******** obfuscatedToken String - /// This is used to find the token in the database + /// This is used to find the token in the database hashedToken String @unique - user User @relation(fields: [userId], references: [id]) - userId String + user User @relation(fields: [userId], references: [id]) + userId String - revokedAt DateTime? - lastAccessedAt DateTime? + revokedAt DateTime? + lastAccessedAt DateTime? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt - authorizationCodes AuthorizationCode[] + authorizationCodes AuthorizationCode[] } model Organization { - id String @id @default(cuid()) - slug String @unique - title String + id String @id @default(cuid()) + slug String @unique + title String - maximumExecutionTimePerRunInMs Int @default(900000) // 15 minutes - maximumConcurrencyLimit Int @default(10) - /// This is deprecated and will be removed in the future + maximumExecutionTimePerRunInMs Int @default(900000) // 15 minutes + maximumConcurrencyLimit Int @default(10) + /// This is deprecated and will be removed in the future maximumSchedulesLimit Int @default(5) - maximumDevQueueSize Int? - maximumDeployedQueueSize Int? + maximumDevQueueSize Int? + maximumDeployedQueueSize Int? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - deletedAt DateTime? + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + deletedAt DateTime? - companySize String? + companySize String? - avatar Json? + avatar Json? - runsEnabled Boolean @default(true) + runsEnabled Boolean @default(true) - v3Enabled Boolean @default(false) + v3Enabled Boolean @default(false) - /// @deprecated + /// @deprecated v2Enabled Boolean @default(false) - /// @deprecated + /// @deprecated v2MarqsEnabled Boolean @default(false) - /// @deprecated + /// @deprecated hasRequestedV3 Boolean @default(false) - environments RuntimeEnvironment[] + environments RuntimeEnvironment[] - apiRateLimiterConfig Json? - realtimeRateLimiterConfig Json? + apiRateLimiterConfig Json? + realtimeRateLimiterConfig Json? - projects Project[] - members OrgMember[] - invites OrgMemberInvite[] - organizationIntegrations OrganizationIntegration[] - workerGroups WorkerInstanceGroup[] - workerInstances WorkerInstance[] - executionSnapshots TaskRunExecutionSnapshot[] + projects Project[] + members OrgMember[] + invites OrgMemberInvite[] + organizationIntegrations OrganizationIntegration[] + workerGroups WorkerInstanceGroup[] + workerInstances WorkerInstance[] + executionSnapshots TaskRunExecutionSnapshot[] } model OrgMember { - id String @id @default(cuid()) + id String @id @default(cuid()) - organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade, onUpdate: Cascade) - organizationId String + organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade, onUpdate: Cascade) + organizationId String - user User @relation(fields: [userId], references: [id], onDelete: Cascade, onUpdate: Cascade) - userId String + user User @relation(fields: [userId], references: [id], onDelete: Cascade, onUpdate: Cascade) + userId String - role OrgMemberRole @default(MEMBER) + role OrgMemberRole @default(MEMBER) - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - environments RuntimeEnvironment[] + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + environments RuntimeEnvironment[] - @@unique([organizationId, userId]) + @@unique([organizationId, userId]) } enum OrgMemberRole { - ADMIN - MEMBER + ADMIN + MEMBER } model OrgMemberInvite { - id String @id @default(cuid()) - token String @unique @default(cuid()) - email String - role OrgMemberRole @default(MEMBER) + id String @id @default(cuid()) + token String @unique @default(cuid()) + email String + role OrgMemberRole @default(MEMBER) - organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade, onUpdate: Cascade) - organizationId String + organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade, onUpdate: Cascade) + organizationId String - inviter User @relation(fields: [inviterId], references: [id], onDelete: Cascade, onUpdate: Cascade) - inviterId String + inviter User @relation(fields: [inviterId], references: [id], onDelete: Cascade, onUpdate: Cascade) + inviterId String - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt - @@unique([organizationId, email]) + @@unique([organizationId, email]) } model RuntimeEnvironment { - id String @id @default(cuid()) - slug String - apiKey String @unique + id String @id @default(cuid()) + slug String + apiKey String @unique - /// @deprecated was for v2 + /// @deprecated was for v2 pkApiKey String @unique - type RuntimeEnvironmentType @default(DEVELOPMENT) + type RuntimeEnvironmentType @default(DEVELOPMENT) - // Preview branches - /// If true, this environment has branches and is treated differently in the dashboard/API + // Preview branches + /// If true, this environment has branches and is treated differently in the dashboard/API isBranchableEnvironment Boolean @default(false) - branchName String? - parentEnvironment RuntimeEnvironment? @relation("parentEnvironment", fields: [parentEnvironmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) - parentEnvironmentId String? - childEnvironments RuntimeEnvironment[] @relation("parentEnvironment") + branchName String? + parentEnvironment RuntimeEnvironment? @relation("parentEnvironment", fields: [parentEnvironmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) + parentEnvironmentId String? + childEnvironments RuntimeEnvironment[] @relation("parentEnvironment") - // This is GitMeta type - git Json? + // This is GitMeta type + git Json? - /// When set API calls will fail + /// When set API calls will fail archivedAt DateTime? - ///A memorable code for the environment + ///A memorable code for the environment shortcode String - maximumConcurrencyLimit Int @default(5) - paused Boolean @default(false) - - autoEnableInternalSources Boolean @default(true) - - organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade, onUpdate: Cascade) - organizationId String - - project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) - projectId String - - //when the org member is deleted, it will keep the environment but set it to null - orgMember OrgMember? @relation(fields: [orgMemberId], references: [id], onDelete: SetNull, onUpdate: Cascade) - orgMemberId String? - - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - - tunnelId String? - - backgroundWorkers BackgroundWorker[] - backgroundWorkerTasks BackgroundWorkerTask[] - taskRuns TaskRun[] - taskQueues TaskQueue[] - batchTaskRuns BatchTaskRun[] - environmentVariableValues EnvironmentVariableValue[] - checkpoints Checkpoint[] - workerDeployments WorkerDeployment[] - workerDeploymentPromotions WorkerDeploymentPromotion[] - taskRunAttempts TaskRunAttempt[] - CheckpointRestoreEvent CheckpointRestoreEvent[] - taskScheduleInstances TaskScheduleInstance[] - alerts ProjectAlert[] - - sessions RuntimeEnvironmentSession[] - currentSession RuntimeEnvironmentSession? @relation("currentSession", fields: [currentSessionId], references: [id], onDelete: SetNull, onUpdate: Cascade) - currentSessionId String? - taskRunNumberCounter TaskRunNumberCounter[] - taskRunCheckpoints TaskRunCheckpoint[] - waitpoints Waitpoint[] - workerInstances WorkerInstance[] - executionSnapshots TaskRunExecutionSnapshot[] - waitpointTags WaitpointTag[] - - @@unique([projectId, slug, orgMemberId]) - @@unique([projectId, shortcode]) - @@index([parentEnvironmentId]) - @@index([projectId]) + maximumConcurrencyLimit Int @default(5) + paused Boolean @default(false) + + autoEnableInternalSources Boolean @default(true) + + organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade, onUpdate: Cascade) + organizationId String + + project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) + projectId String + + //when the org member is deleted, it will keep the environment but set it to null + orgMember OrgMember? @relation(fields: [orgMemberId], references: [id], onDelete: SetNull, onUpdate: Cascade) + orgMemberId String? + + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + tunnelId String? + + backgroundWorkers BackgroundWorker[] + backgroundWorkerTasks BackgroundWorkerTask[] + taskRuns TaskRun[] + taskQueues TaskQueue[] + batchTaskRuns BatchTaskRun[] + environmentVariableValues EnvironmentVariableValue[] + checkpoints Checkpoint[] + workerDeployments WorkerDeployment[] + workerDeploymentPromotions WorkerDeploymentPromotion[] + taskRunAttempts TaskRunAttempt[] + CheckpointRestoreEvent CheckpointRestoreEvent[] + taskScheduleInstances TaskScheduleInstance[] + alerts ProjectAlert[] + + sessions RuntimeEnvironmentSession[] + currentSession RuntimeEnvironmentSession? @relation("currentSession", fields: [currentSessionId], references: [id], onDelete: SetNull, onUpdate: Cascade) + currentSessionId String? + taskRunNumberCounter TaskRunNumberCounter[] + taskRunCheckpoints TaskRunCheckpoint[] + waitpoints Waitpoint[] + workerInstances WorkerInstance[] + executionSnapshots TaskRunExecutionSnapshot[] + waitpointTags WaitpointTag[] + + @@unique([projectId, slug, orgMemberId]) + @@unique([projectId, shortcode]) + @@index([parentEnvironmentId]) + @@index([projectId]) } enum RuntimeEnvironmentType { - PRODUCTION - STAGING - DEVELOPMENT - PREVIEW + PRODUCTION + STAGING + DEVELOPMENT + PREVIEW } model Project { - id String @id @default(cuid()) - slug String @unique - name String - - externalRef String @unique - - organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade, onUpdate: Cascade) - organizationId String - - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - deletedAt DateTime? - - version ProjectVersion @default(V2) - engine RunEngineVersion @default(V1) - - builderProjectId String? - - workerGroups WorkerInstanceGroup[] - workers WorkerInstance[] - - defaultWorkerGroup WorkerInstanceGroup? @relation("ProjectDefaultWorkerGroup", fields: [defaultWorkerGroupId], references: [id]) - defaultWorkerGroupId String? - - environments RuntimeEnvironment[] - backgroundWorkers BackgroundWorker[] - backgroundWorkerTasks BackgroundWorkerTask[] - taskRuns TaskRun[] - runTags TaskRunTag[] - taskQueues TaskQueue[] - environmentVariables EnvironmentVariable[] - checkpoints Checkpoint[] - WorkerDeployment WorkerDeployment[] - CheckpointRestoreEvent CheckpointRestoreEvent[] - taskSchedules TaskSchedule[] - alertChannels ProjectAlertChannel[] - alerts ProjectAlert[] - alertStorages ProjectAlertStorage[] - bulkActionGroups BulkActionGroup[] - BackgroundWorkerFile BackgroundWorkerFile[] - waitpoints Waitpoint[] - taskRunWaitpoints TaskRunWaitpoint[] - taskRunCheckpoints TaskRunCheckpoint[] - executionSnapshots TaskRunExecutionSnapshot[] - waitpointTags WaitpointTag[] + id String @id @default(cuid()) + slug String @unique + name String + + externalRef String @unique + + organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade, onUpdate: Cascade) + organizationId String + + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + deletedAt DateTime? + + version ProjectVersion @default(V2) + engine RunEngineVersion @default(V1) + + builderProjectId String? + + workerGroups WorkerInstanceGroup[] + workers WorkerInstance[] + + defaultWorkerGroup WorkerInstanceGroup? @relation("ProjectDefaultWorkerGroup", fields: [defaultWorkerGroupId], references: [id]) + defaultWorkerGroupId String? + + environments RuntimeEnvironment[] + backgroundWorkers BackgroundWorker[] + backgroundWorkerTasks BackgroundWorkerTask[] + taskRuns TaskRun[] + runTags TaskRunTag[] + taskQueues TaskQueue[] + environmentVariables EnvironmentVariable[] + checkpoints Checkpoint[] + WorkerDeployment WorkerDeployment[] + CheckpointRestoreEvent CheckpointRestoreEvent[] + taskSchedules TaskSchedule[] + alertChannels ProjectAlertChannel[] + alerts ProjectAlert[] + alertStorages ProjectAlertStorage[] + bulkActionGroups BulkActionGroup[] + BackgroundWorkerFile BackgroundWorkerFile[] + waitpoints Waitpoint[] + taskRunWaitpoints TaskRunWaitpoint[] + taskRunCheckpoints TaskRunCheckpoint[] + executionSnapshots TaskRunExecutionSnapshot[] + waitpointTags WaitpointTag[] } enum ProjectVersion { - V2 - V3 + V2 + V3 } model SecretReference { - id String @id @default(cuid()) - key String @unique - provider SecretStoreProvider @default(DATABASE) + id String @id @default(cuid()) + key String @unique + provider SecretStoreProvider @default(DATABASE) - environmentVariableValues EnvironmentVariableValue[] + environmentVariableValues EnvironmentVariableValue[] - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - OrganizationIntegration OrganizationIntegration[] + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + OrganizationIntegration OrganizationIntegration[] } enum SecretStoreProvider { - DATABASE - AWS_PARAM_STORE + DATABASE + AWS_PARAM_STORE } model SecretStore { - key String @unique - value Json - version String @default("1") + key String @unique + value Json + version String @default("1") - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt - @@index([key(ops: raw("text_pattern_ops"))], type: BTree) + @@index([key(ops: raw("text_pattern_ops"))], type: BTree) } model DataMigration { - id String @id @default(cuid()) - name String @unique + id String @id @default(cuid()) + name String @unique - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - completedAt DateTime? + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + completedAt DateTime? } // ==================================================== // v3 Models // ==================================================== model BackgroundWorker { - id String @id @default(cuid()) + id String @id @default(cuid()) - friendlyId String @unique + friendlyId String @unique - engine RunEngineVersion @default(V1) + engine RunEngineVersion @default(V1) - contentHash String - sdkVersion String @default("unknown") - cliVersion String @default("unknown") + contentHash String + sdkVersion String @default("unknown") + cliVersion String @default("unknown") - project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) - projectId String + project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) + projectId String - runtimeEnvironment RuntimeEnvironment @relation(fields: [runtimeEnvironmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) - runtimeEnvironmentId String + runtimeEnvironment RuntimeEnvironment @relation(fields: [runtimeEnvironmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) + runtimeEnvironmentId String - version String - metadata Json + version String + metadata Json - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt - tasks BackgroundWorkerTask[] - attempts TaskRunAttempt[] - lockedRuns TaskRun[] - files BackgroundWorkerFile[] - queues TaskQueue[] + tasks BackgroundWorkerTask[] + attempts TaskRunAttempt[] + lockedRuns TaskRun[] + files BackgroundWorkerFile[] + queues TaskQueue[] - deployment WorkerDeployment? + deployment WorkerDeployment? - workerGroup WorkerInstanceGroup? @relation(fields: [workerGroupId], references: [id], onDelete: SetNull, onUpdate: Cascade) - workerGroupId String? + workerGroup WorkerInstanceGroup? @relation(fields: [workerGroupId], references: [id], onDelete: SetNull, onUpdate: Cascade) + workerGroupId String? - supportsLazyAttempts Boolean @default(false) + supportsLazyAttempts Boolean @default(false) - @@unique([projectId, runtimeEnvironmentId, version]) - @@index([runtimeEnvironmentId]) - // Get the latest worker for a given environment - @@index([runtimeEnvironmentId, createdAt(sort: Desc)]) + @@unique([projectId, runtimeEnvironmentId, version]) + @@index([runtimeEnvironmentId]) + // Get the latest worker for a given environment + @@index([runtimeEnvironmentId, createdAt(sort: Desc)]) } model BackgroundWorkerFile { - id String @id @default(cuid()) + id String @id @default(cuid()) - friendlyId String @unique + friendlyId String @unique - filePath String - contentHash String - contents Bytes + filePath String + contentHash String + contents Bytes - project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) - projectId String + project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) + projectId String - backgroundWorkers BackgroundWorker[] + backgroundWorkers BackgroundWorker[] - tasks BackgroundWorkerTask[] + tasks BackgroundWorkerTask[] - createdAt DateTime @default(now()) + createdAt DateTime @default(now()) - @@unique([projectId, contentHash]) + @@unique([projectId, contentHash]) } model BackgroundWorkerTask { - id String @id @default(cuid()) - slug String + id String @id @default(cuid()) + slug String - description String? + description String? - friendlyId String @unique + friendlyId String @unique - filePath String - exportName String? + filePath String + exportName String? - worker BackgroundWorker @relation(fields: [workerId], references: [id], onDelete: Cascade, onUpdate: Cascade) - workerId String + worker BackgroundWorker @relation(fields: [workerId], references: [id], onDelete: Cascade, onUpdate: Cascade) + workerId String - project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) - projectId String + project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) + projectId String - file BackgroundWorkerFile? @relation(fields: [fileId], references: [id], onDelete: Cascade, onUpdate: Cascade) - fileId String? + file BackgroundWorkerFile? @relation(fields: [fileId], references: [id], onDelete: Cascade, onUpdate: Cascade) + fileId String? - runtimeEnvironment RuntimeEnvironment @relation(fields: [runtimeEnvironmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) - runtimeEnvironmentId String + runtimeEnvironment RuntimeEnvironment @relation(fields: [runtimeEnvironmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) + runtimeEnvironmentId String - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt - attempts TaskRunAttempt[] - runs TaskRun[] + attempts TaskRunAttempt[] + runs TaskRun[] - queueConfig Json? - retryConfig Json? - machineConfig Json? + queueConfig Json? + retryConfig Json? + machineConfig Json? - queueId String? - queue TaskQueue? @relation(fields: [queueId], references: [id], onDelete: SetNull, onUpdate: Cascade) + queueId String? + queue TaskQueue? @relation(fields: [queueId], references: [id], onDelete: SetNull, onUpdate: Cascade) - maxDurationInSeconds Int? + maxDurationInSeconds Int? - triggerSource TaskTriggerSource @default(STANDARD) + triggerSource TaskTriggerSource @default(STANDARD) - @@unique([workerId, slug]) - // Quick lookup of task identifiers - @@index([projectId, slug]) - @@index([runtimeEnvironmentId, projectId]) + @@unique([workerId, slug]) + // Quick lookup of task identifiers + @@index([projectId, slug]) + @@index([runtimeEnvironmentId, projectId]) } enum TaskTriggerSource { - STANDARD - SCHEDULED + STANDARD + SCHEDULED } model TaskRun { - id String @id @default(cuid()) + id String @id @default(cuid()) - number Int @default(0) - friendlyId String @unique + number Int @default(0) + friendlyId String @unique - engine RunEngineVersion @default(V1) + engine RunEngineVersion @default(V1) - status TaskRunStatus @default(PENDING) - statusReason String? + status TaskRunStatus @default(PENDING) + statusReason String? - idempotencyKey String? - idempotencyKeyExpiresAt DateTime? - taskIdentifier String + idempotencyKey String? + idempotencyKeyExpiresAt DateTime? + taskIdentifier String - isTest Boolean @default(false) + isTest Boolean @default(false) - payload String - payloadType String @default("application/json") - context Json? - traceContext Json? + payload String + payloadType String @default("application/json") + context Json? + traceContext Json? - traceId String - spanId String + traceId String + spanId String - runtimeEnvironment RuntimeEnvironment @relation(fields: [runtimeEnvironmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) - runtimeEnvironmentId String + runtimeEnvironment RuntimeEnvironment @relation(fields: [runtimeEnvironmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) + runtimeEnvironmentId String - environmentType RuntimeEnvironmentType? + environmentType RuntimeEnvironmentType? - project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) - projectId String + project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) + projectId String - organizationId String? + organizationId String? - // The specific queue this run is in - queue String - // The queueId is set when the run is locked to a specific queue - lockedQueueId String? + // The specific queue this run is in + queue String + // The queueId is set when the run is locked to a specific queue + lockedQueueId String? - /// The main queue that this run is part of + /// The main queue that this run is part of workerQueue String @default("main") @map("masterQueue") - /// @deprecated + /// @deprecated secondaryMasterQueue String? - /// From engine v2+ this will be defined after a run has been dequeued (starting at 1) + /// From engine v2+ this will be defined after a run has been dequeued (starting at 1) attemptNumber Int? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt - attempts TaskRunAttempt[] @relation("attempts") - tags TaskRunTag[] + attempts TaskRunAttempt[] @relation("attempts") + tags TaskRunTag[] - /// Denormized column that holds the raw tags + /// Denormized column that holds the raw tags runTags String[] - /// Denormalized version of the background worker task + /// Denormalized version of the background worker task taskVersion String? - sdkVersion String? - cliVersion String? + sdkVersion String? + cliVersion String? - checkpoints Checkpoint[] + checkpoints Checkpoint[] - /// startedAt marks the point at which a run is dequeued from MarQS + /// startedAt marks the point at which a run is dequeued from MarQS startedAt DateTime? - /// executedAt is set when the first attempt is about to execute + /// executedAt is set when the first attempt is about to execute executedAt DateTime? - completedAt DateTime? - machinePreset String? + completedAt DateTime? + machinePreset String? - usageDurationMs Int @default(0) - costInCents Float @default(0) - baseCostInCents Float @default(0) + usageDurationMs Int @default(0) + costInCents Float @default(0) + baseCostInCents Float @default(0) - lockedAt DateTime? - lockedBy BackgroundWorkerTask? @relation(fields: [lockedById], references: [id]) - lockedById String? + lockedAt DateTime? + lockedBy BackgroundWorkerTask? @relation(fields: [lockedById], references: [id]) + lockedById String? - lockedToVersion BackgroundWorker? @relation(fields: [lockedToVersionId], references: [id]) - lockedToVersionId String? + lockedToVersion BackgroundWorker? @relation(fields: [lockedToVersionId], references: [id]) + lockedToVersionId String? - /// The "priority" of the run. This is just a negative offset in ms for the queue timestamp + /// The "priority" of the run. This is just a negative offset in ms for the queue timestamp /// E.g. a value of 60_000 would put the run into the queue 60s ago. priorityMs Int @default(0) - concurrencyKey String? + concurrencyKey String? - delayUntil DateTime? - queuedAt DateTime? - ttl String? - expiredAt DateTime? - maxAttempts Int? + delayUntil DateTime? + queuedAt DateTime? + ttl String? + expiredAt DateTime? + maxAttempts Int? - /// optional token that can be used to authenticate the task run + /// optional token that can be used to authenticate the task run oneTimeUseToken String? - ///When this run is finished, the waitpoint will be marked as completed + ///When this run is finished, the waitpoint will be marked as completed associatedWaitpoint Waitpoint? @relation("CompletingRun") - ///If there are any blocked waitpoints, the run won't be executed + ///If there are any blocked waitpoints, the run won't be executed blockedByWaitpoints TaskRunWaitpoint[] - /// All waitpoints that blocked this run at some point, used for display purposes + /// All waitpoints that blocked this run at some point, used for display purposes connectedWaitpoints Waitpoint[] @relation("WaitpointRunConnections") - /// Where the logs are stored + /// Where the logs are stored taskEventStore String @default("taskEvent") - queueTimestamp DateTime? + queueTimestamp DateTime? - batchItems BatchTaskRunItem[] - dependency TaskRunDependency? - CheckpointRestoreEvent CheckpointRestoreEvent[] - executionSnapshots TaskRunExecutionSnapshot[] + batchItems BatchTaskRunItem[] + dependency TaskRunDependency? + CheckpointRestoreEvent CheckpointRestoreEvent[] + executionSnapshots TaskRunExecutionSnapshot[] - alerts ProjectAlert[] + alerts ProjectAlert[] - scheduleInstanceId String? - scheduleId String? + scheduleInstanceId String? + scheduleId String? - sourceBulkActionItems BulkActionItem[] @relation("SourceActionItemRun") - destinationBulkActionItems BulkActionItem[] @relation("DestinationActionItemRun") + sourceBulkActionItems BulkActionItem[] @relation("SourceActionItemRun") + destinationBulkActionItems BulkActionItem[] @relation("DestinationActionItemRun") - logsDeletedAt DateTime? + logsDeletedAt DateTime? - /// This represents the original task that that was triggered outside of a Trigger.dev task + /// This represents the original task that that was triggered outside of a Trigger.dev task rootTaskRun TaskRun? @relation("TaskRootRun", fields: [rootTaskRunId], references: [id], onDelete: SetNull, onUpdate: NoAction) - rootTaskRunId String? + rootTaskRunId String? - /// The root run will have a list of all the descendant runs, children, grand children, etc. + /// The root run will have a list of all the descendant runs, children, grand children, etc. descendantRuns TaskRun[] @relation("TaskRootRun") - /// The immediate parent run of this task run + /// The immediate parent run of this task run parentTaskRun TaskRun? @relation("TaskParentRun", fields: [parentTaskRunId], references: [id], onDelete: SetNull, onUpdate: NoAction) - parentTaskRunId String? + parentTaskRunId String? - /// The immediate child runs of this task run + /// The immediate child runs of this task run childRuns TaskRun[] @relation("TaskParentRun") - /// The immediate parent attempt of this task run + /// The immediate parent attempt of this task run parentTaskRunAttempt TaskRunAttempt? @relation("TaskParentRunAttempt", fields: [parentTaskRunAttemptId], references: [id], onDelete: SetNull, onUpdate: NoAction) - parentTaskRunAttemptId String? + parentTaskRunAttemptId String? - /// The batch run that this task run is a part of + /// The batch run that this task run is a part of batch BatchTaskRun? @relation(fields: [batchId], references: [id], onDelete: SetNull, onUpdate: NoAction) - batchId String? + batchId String? - /// whether or not the task run was created because of a triggerAndWait for batchTriggerAndWait + /// whether or not the task run was created because of a triggerAndWait for batchTriggerAndWait resumeParentOnCompletion Boolean @default(false) - /// The depth of this task run in the task run hierarchy + /// The depth of this task run in the task run hierarchy depth Int @default(0) - /// The span ID of the "trigger" span in the parent task run + /// The span ID of the "trigger" span in the parent task run parentSpanId String? - /// Holds the state of the run chain for deadlock detection + /// Holds the state of the run chain for deadlock detection runChainState Json? - /// seed run metadata + /// seed run metadata seedMetadata String? - seedMetadataType String @default("application/json") + seedMetadataType String @default("application/json") - /// Run metadata + /// Run metadata metadata String? - metadataType String @default("application/json") - metadataVersion Int @default(1) + metadataType String @default("application/json") + metadataVersion Int @default(1) - /// Run output + /// Run output output String? - outputType String @default("application/json") + outputType String @default("application/json") - /// Run error + /// Run error error Json? - maxDurationInSeconds Int? - - @@unique([oneTimeUseToken]) - @@unique([runtimeEnvironmentId, taskIdentifier, idempotencyKey]) - // Finding child runs - @@index([parentTaskRunId]) - // Finding ancestor runs - @@index([rootTaskRunId]) - //Schedules - @@index([scheduleId]) - // Run page inspector - @@index([spanId]) - @@index([parentSpanId]) - // Schedule list page - @@index([scheduleId, createdAt(sort: Desc)]) - // Finding runs in a batch - @@index([runTags(ops: ArrayOps)], type: Gin) - @@index([runtimeEnvironmentId, batchId]) - // This will include the createdAt index to help speed up the run list page - @@index([runtimeEnvironmentId, id(sort: Desc)]) - @@index([runtimeEnvironmentId, createdAt(sort: Desc)]) - @@index([createdAt], type: Brin) - @@index([status, runtimeEnvironmentId, createdAt, id(sort: Desc)]) + maxDurationInSeconds Int? + + @@unique([oneTimeUseToken]) + @@unique([runtimeEnvironmentId, taskIdentifier, idempotencyKey]) + // Finding child runs + @@index([parentTaskRunId]) + // Finding ancestor runs + @@index([rootTaskRunId]) + //Schedules + @@index([scheduleId]) + // Run page inspector + @@index([spanId]) + @@index([parentSpanId]) + // Schedule list page + @@index([scheduleId, createdAt(sort: Desc)]) + // Finding runs in a batch + @@index([runTags(ops: ArrayOps)], type: Gin) + @@index([runtimeEnvironmentId, batchId]) + // This will include the createdAt index to help speed up the run list page + @@index([runtimeEnvironmentId, id(sort: Desc)]) + @@index([runtimeEnvironmentId, createdAt(sort: Desc)]) + @@index([createdAt], type: Brin) + @@index([status, runtimeEnvironmentId, createdAt, id(sort: Desc)]) } enum TaskRunStatus { - /// + /// /// NON-FINAL STATUSES /// /// Task has been scheduled to run in the future DELAYED - /// Task is waiting to be executed by a worker + /// Task is waiting to be executed by a worker PENDING - /// The run is pending a version update because it cannot execute without additional information (task, queue, etc.). Replaces WAITING_FOR_DEPLOY + /// The run is pending a version update because it cannot execute without additional information (task, queue, etc.). Replaces WAITING_FOR_DEPLOY PENDING_VERSION - /// Task hasn't been deployed yet but is waiting to be executed. Deprecated in favor of PENDING_VERSION + /// Task hasn't been deployed yet but is waiting to be executed. Deprecated in favor of PENDING_VERSION WAITING_FOR_DEPLOY - /// Task is currently being executed by a worker + /// Task is currently being executed by a worker EXECUTING - /// Task has been paused by the system, and will be resumed by the system + /// Task has been paused by the system, and will be resumed by the system WAITING_TO_RESUME - /// Task has failed and is waiting to be retried + /// Task has failed and is waiting to be retried RETRYING_AFTER_FAILURE - /// Task has been paused by the user, and can be resumed by the user + /// Task has been paused by the user, and can be resumed by the user PAUSED - /// + /// /// FINAL STATUSES /// /// Task has been canceled by the user CANCELED - /// Task was interrupted during execution, mostly this happens in development environments + /// Task was interrupted during execution, mostly this happens in development environments INTERRUPTED - /// Task has been completed successfully + /// Task has been completed successfully COMPLETED_SUCCESSFULLY - /// Task has been completed with errors + /// Task has been completed with errors COMPLETED_WITH_ERRORS - /// Task has failed to complete, due to an error in the system + /// Task has failed to complete, due to an error in the system SYSTEM_FAILURE - /// Task has crashed and won't be retried, most likely the worker ran out of resources, e.g. memory or storage + /// Task has crashed and won't be retried, most likely the worker ran out of resources, e.g. memory or storage CRASHED - /// Task reached the ttl without being executed + /// Task reached the ttl without being executed EXPIRED - /// Task has been timed out when using maxDuration + /// Task has been timed out when using maxDuration TIMED_OUT } enum RunEngineVersion { - /// The original version that uses marqs v1 and Graphile + /// The original version that uses marqs v1 and Graphile V1 - V2 + V2 } /// Used by the RunEngine during TaskRun execution @@ -758,1327 +752,1327 @@ enum RunEngineVersion { /// It is optimised for performance and is designed to be cleared at some point, /// so there are no cascading relationships to other models. model TaskRunExecutionSnapshot { - id String @id @default(cuid()) + id String @id @default(cuid()) - /// This should always be 2+ (V1 didn't use the run engine or snapshots) + /// This should always be 2+ (V1 didn't use the run engine or snapshots) engine RunEngineVersion @default(V2) - /// The execution status + /// The execution status executionStatus TaskRunExecutionStatus - /// For debugging + /// For debugging description String - /// We store invalid snapshots as a record of the run state when we tried to move + /// We store invalid snapshots as a record of the run state when we tried to move isValid Boolean @default(true) - error String? + error String? - /// The previous snapshot ID + /// The previous snapshot ID previousSnapshotId String? - /// Run + /// Run runId String - run TaskRun @relation(fields: [runId], references: [id]) - runStatus TaskRunStatus + run TaskRun @relation(fields: [runId], references: [id]) + runStatus TaskRunStatus - // Batch - batchId String? - batch BatchTaskRun? @relation(fields: [batchId], references: [id]) + // Batch + batchId String? + batch BatchTaskRun? @relation(fields: [batchId], references: [id]) - /// This is the current run attempt number. Users can define how many attempts they want for a run. + /// This is the current run attempt number. Users can define how many attempts they want for a run. attemptNumber Int? - /// Environment + /// Environment environmentId String - environment RuntimeEnvironment @relation(fields: [environmentId], references: [id]) - environmentType RuntimeEnvironmentType + environment RuntimeEnvironment @relation(fields: [environmentId], references: [id]) + environmentType RuntimeEnvironmentType - projectId String - project Project @relation(fields: [projectId], references: [id]) + projectId String + project Project @relation(fields: [projectId], references: [id]) - organizationId String - organization Organization @relation(fields: [organizationId], references: [id]) + organizationId String + organization Organization @relation(fields: [organizationId], references: [id]) - /// Waitpoints that have been completed for this execution + /// Waitpoints that have been completed for this execution completedWaitpoints Waitpoint[] @relation("completedWaitpoints") - /// An array of waitpoint IDs in the correct order, used for batches + /// An array of waitpoint IDs in the correct order, used for batches completedWaitpointOrder String[] - /// Checkpoint + /// Checkpoint checkpointId String? - checkpoint TaskRunCheckpoint? @relation(fields: [checkpointId], references: [id]) + checkpoint TaskRunCheckpoint? @relation(fields: [checkpointId], references: [id]) - /// Worker + /// Worker workerId String? - worker WorkerInstance? @relation(fields: [workerId], references: [id]) + worker WorkerInstance? @relation(fields: [workerId], references: [id]) - runnerId String? + runnerId String? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt - lastHeartbeatAt DateTime? + lastHeartbeatAt DateTime? - /// Metadata used by various systems in the run engine + /// Metadata used by various systems in the run engine metadata Json? - /// Used to get the latest valid snapshot quickly + /// Used to get the latest valid snapshot quickly @@index([runId, isValid, createdAt(sort: Desc)]) } enum TaskRunExecutionStatus { - /// Run has been created + /// Run has been created RUN_CREATED - /// Run is in the RunQueue + /// Run is in the RunQueue QUEUED - /// Run is in the RunQueue, and is also executing. This happens when a run is continued cannot reacquire concurrency + /// Run is in the RunQueue, and is also executing. This happens when a run is continued cannot reacquire concurrency QUEUED_EXECUTING - /// Run has been pulled from the queue, but isn't executing yet + /// Run has been pulled from the queue, but isn't executing yet PENDING_EXECUTING - /// Run is executing on a worker + /// Run is executing on a worker EXECUTING - /// Run is executing on a worker but is waiting for waitpoints to complete + /// Run is executing on a worker but is waiting for waitpoints to complete EXECUTING_WITH_WAITPOINTS - /// Run has been suspended and may be waiting for waitpoints to complete before resuming + /// Run has been suspended and may be waiting for waitpoints to complete before resuming SUSPENDED - /// Run has been scheduled for cancellation + /// Run has been scheduled for cancellation PENDING_CANCEL - /// Run is finished (success of failure) + /// Run is finished (success of failure) FINISHED } model TaskRunCheckpoint { - id String @id @default(cuid()) + id String @id @default(cuid()) - friendlyId String @unique + friendlyId String @unique - type TaskRunCheckpointType - location String - imageRef String? - reason String? - metadata String? + type TaskRunCheckpointType + location String + imageRef String? + reason String? + metadata String? - project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) - projectId String + project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) + projectId String - runtimeEnvironment RuntimeEnvironment @relation(fields: [runtimeEnvironmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) - runtimeEnvironmentId String + runtimeEnvironment RuntimeEnvironment @relation(fields: [runtimeEnvironmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) + runtimeEnvironmentId String - executionSnapshot TaskRunExecutionSnapshot[] + executionSnapshot TaskRunExecutionSnapshot[] - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt } enum TaskRunCheckpointType { - DOCKER - KUBERNETES + DOCKER + KUBERNETES } /// A Waitpoint blocks a run from continuing until it's completed /// If there's a waitpoint blocking a run, it shouldn't be in the queue model Waitpoint { - id String @id @default(cuid()) + id String @id @default(cuid()) - friendlyId String @unique + friendlyId String @unique - type WaitpointType - status WaitpointStatus @default(PENDING) + type WaitpointType + status WaitpointStatus @default(PENDING) - completedAt DateTime? + completedAt DateTime? - /// If it's an Event type waitpoint, this is the event. It can also be provided for the DATETIME type + /// If it's an Event type waitpoint, this is the event. It can also be provided for the DATETIME type idempotencyKey String - /// If this is true then we can show it in the dashboard/return it from the SDK + /// If this is true then we can show it in the dashboard/return it from the SDK userProvidedIdempotencyKey Boolean - /// If there's a user provided idempotency key, this is the time it expires at + /// If there's a user provided idempotency key, this is the time it expires at idempotencyKeyExpiresAt DateTime? - /// If an idempotencyKey is no longer active, we store it here and generate a new one for the idempotencyKey field. + /// If an idempotencyKey is no longer active, we store it here and generate a new one for the idempotencyKey field. /// Clearing an idempotencyKey is useful for debounce or cancelling child runs. /// This is a workaround because Prisma doesn't support partial indexes. inactiveIdempotencyKey String? - /// If it's a RUN type waitpoint, this is the associated run + /// If it's a RUN type waitpoint, this is the associated run completedByTaskRunId String? @unique - completedByTaskRun TaskRun? @relation("CompletingRun", fields: [completedByTaskRunId], references: [id], onDelete: SetNull) + completedByTaskRun TaskRun? @relation("CompletingRun", fields: [completedByTaskRunId], references: [id], onDelete: SetNull) - /// If it's a DATETIME type waitpoint, this is the date. + /// If it's a DATETIME type waitpoint, this is the date. /// If it's a MANUAL waitpoint, this can be set as the `timeout`. completedAfter DateTime? - /// If it's a BATCH type waitpoint, this is the associated batch + /// If it's a BATCH type waitpoint, this is the associated batch completedByBatchId String? - completedByBatch BatchTaskRun? @relation(fields: [completedByBatchId], references: [id], onDelete: SetNull) + completedByBatch BatchTaskRun? @relation(fields: [completedByBatchId], references: [id], onDelete: SetNull) - /// The runs this waitpoint is blocking + /// The runs this waitpoint is blocking blockingTaskRuns TaskRunWaitpoint[] - /// All runs that have ever been blocked by this waitpoint, used for display purposes + /// All runs that have ever been blocked by this waitpoint, used for display purposes connectedRuns TaskRun[] @relation("WaitpointRunConnections") - /// When a waitpoint is complete + /// When a waitpoint is complete completedExecutionSnapshots TaskRunExecutionSnapshot[] @relation("completedWaitpoints") - /// When completed, an output can be stored here + /// When completed, an output can be stored here output String? - outputType String @default("application/json") - outputIsError Boolean @default(false) + outputType String @default("application/json") + outputIsError Boolean @default(false) - project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) - projectId String + project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) + projectId String - environment RuntimeEnvironment @relation(fields: [environmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) - environmentId String + environment RuntimeEnvironment @relation(fields: [environmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) + environmentId String - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt - /// Denormized column that holds the raw tags + /// Denormized column that holds the raw tags /// Denormalized column that holds the raw tags tags String[] - /// Quickly find an idempotent waitpoint + /// Quickly find an idempotent waitpoint @@unique([environmentId, idempotencyKey]) - /// Quickly find a batch waitpoint + /// Quickly find a batch waitpoint @@index([completedByBatchId]) - /// Used on the Waitpoint dashboard pages + /// Used on the Waitpoint dashboard pages /// Time period filtering @@index([environmentId, type, createdAt(sort: Desc)]) - /// Status filtering + /// Status filtering @@index([environmentId, type, status]) } enum WaitpointType { - RUN - DATETIME - MANUAL - BATCH + RUN + DATETIME + MANUAL + BATCH } enum WaitpointStatus { - PENDING - COMPLETED + PENDING + COMPLETED } model TaskRunWaitpoint { - id String @id @default(cuid()) + id String @id @default(cuid()) - taskRun TaskRun @relation(fields: [taskRunId], references: [id]) - taskRunId String + taskRun TaskRun @relation(fields: [taskRunId], references: [id]) + taskRunId String - waitpoint Waitpoint @relation(fields: [waitpointId], references: [id]) - waitpointId String + waitpoint Waitpoint @relation(fields: [waitpointId], references: [id]) + waitpointId String - project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) - projectId String + project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) + projectId String - /// This span id is completed when the waitpoint is completed. This is used with cached runs (idempotent) + /// This span id is completed when the waitpoint is completed. This is used with cached runs (idempotent) spanIdToComplete String? - //associated batch - batchId String? - batch BatchTaskRun? @relation(fields: [batchId], references: [id]) - //if there's an associated batch and this isn't set it's for the entire batch - //if it is set, it's a specific run in the batch - batchIndex Int? + //associated batch + batchId String? + batch BatchTaskRun? @relation(fields: [batchId], references: [id]) + //if there's an associated batch and this isn't set it's for the entire batch + //if it is set, it's a specific run in the batch + batchIndex Int? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt - /// There are two constraints, the one below and also one that Prisma doesn't support + /// There are two constraints, the one below and also one that Prisma doesn't support /// The second one implemented in SQL only prevents a TaskRun + Waitpoint with a null batchIndex @@unique([taskRunId, waitpointId, batchIndex]) - @@index([taskRunId]) - @@index([waitpointId]) + @@index([taskRunId]) + @@index([waitpointId]) } model WaitpointTag { - id String @id @default(cuid()) - name String + id String @id @default(cuid()) + name String - environment RuntimeEnvironment @relation(fields: [environmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) - environmentId String + environment RuntimeEnvironment @relation(fields: [environmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) + environmentId String - project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) - projectId String + project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) + projectId String - createdAt DateTime @default(now()) + createdAt DateTime @default(now()) - @@unique([environmentId, name]) + @@unique([environmentId, name]) } model FeatureFlag { - id String @id @default(cuid()) + id String @id @default(cuid()) - key String @unique - value Json? + key String @unique + value Json? } model WorkerInstance { - id String @id @default(cuid()) + id String @id @default(cuid()) - /// For example "worker-1" + /// For example "worker-1" name String - /// If managed, it will default to the name, e.g. "worker-1" + /// If managed, it will default to the name, e.g. "worker-1" /// If unmanged, it will be prefixed with the deployment ID e.g. "deploy-123-worker-1" resourceIdentifier String - metadata Json? + metadata Json? - workerGroup WorkerInstanceGroup @relation(fields: [workerGroupId], references: [id]) - workerGroupId String + workerGroup WorkerInstanceGroup @relation(fields: [workerGroupId], references: [id]) + workerGroupId String - TaskRunExecutionSnapshot TaskRunExecutionSnapshot[] + TaskRunExecutionSnapshot TaskRunExecutionSnapshot[] - organization Organization? @relation(fields: [organizationId], references: [id], onDelete: Cascade, onUpdate: Cascade) - organizationId String? + organization Organization? @relation(fields: [organizationId], references: [id], onDelete: Cascade, onUpdate: Cascade) + organizationId String? - project Project? @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) - projectId String? + project Project? @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) + projectId String? - environment RuntimeEnvironment? @relation(fields: [environmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) - environmentId String? + environment RuntimeEnvironment? @relation(fields: [environmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) + environmentId String? - deployment WorkerDeployment? @relation(fields: [deploymentId], references: [id], onDelete: SetNull, onUpdate: Cascade) - deploymentId String? + deployment WorkerDeployment? @relation(fields: [deploymentId], references: [id], onDelete: SetNull, onUpdate: Cascade) + deploymentId String? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt - lastDequeueAt DateTime? - lastHeartbeatAt DateTime? + lastDequeueAt DateTime? + lastHeartbeatAt DateTime? - @@unique([workerGroupId, resourceIdentifier]) + @@unique([workerGroupId, resourceIdentifier]) } enum WorkerInstanceGroupType { - MANAGED - UNMANAGED + MANAGED + UNMANAGED } model WorkerInstanceGroup { - id String @id @default(cuid()) - type WorkerInstanceGroupType + id String @id @default(cuid()) + type WorkerInstanceGroupType - /// For example "us-east-1" + /// For example "us-east-1" name String - /// If managed, it will default to the name, e.g. "us-east-1" + /// If managed, it will default to the name, e.g. "us-east-1" /// If unmanged, it will be prefixed with the project ID e.g. "project_1-us-east-1" masterQueue String @unique - description String? - hidden Boolean @default(false) + description String? + hidden Boolean @default(false) - token WorkerGroupToken @relation(fields: [tokenId], references: [id], onDelete: Cascade, onUpdate: Cascade) - tokenId String @unique + token WorkerGroupToken @relation(fields: [tokenId], references: [id], onDelete: Cascade, onUpdate: Cascade) + tokenId String @unique - workers WorkerInstance[] - backgroundWorkers BackgroundWorker[] + workers WorkerInstance[] + backgroundWorkers BackgroundWorker[] - defaultForProjects Project[] @relation("ProjectDefaultWorkerGroup") + defaultForProjects Project[] @relation("ProjectDefaultWorkerGroup") - organization Organization? @relation(fields: [organizationId], references: [id], onDelete: Cascade, onUpdate: Cascade) - organizationId String? + organization Organization? @relation(fields: [organizationId], references: [id], onDelete: Cascade, onUpdate: Cascade) + organizationId String? - project Project? @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) - projectId String? + project Project? @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) + projectId String? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt } model WorkerGroupToken { - id String @id @default(cuid()) + id String @id @default(cuid()) - tokenHash String @unique + tokenHash String @unique - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt - workerGroup WorkerInstanceGroup? + workerGroup WorkerInstanceGroup? } model TaskRunTag { - id String @id @default(cuid()) - name String + id String @id @default(cuid()) + name String - friendlyId String @unique + friendlyId String @unique - runs TaskRun[] + runs TaskRun[] - project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) - projectId String + project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) + projectId String - createdAt DateTime @default(now()) + createdAt DateTime @default(now()) - @@unique([projectId, name]) - //Makes run filtering by tag faster - @@index([name, id]) + @@unique([projectId, name]) + //Makes run filtering by tag faster + @@index([name, id]) } /// This is used for triggerAndWait and batchTriggerAndWait. The taskRun is the child task, it points at a parent attempt or a batch model TaskRunDependency { - id String @id @default(cuid()) + id String @id @default(cuid()) - /// The child run + /// The child run taskRun TaskRun @relation(fields: [taskRunId], references: [id], onDelete: Cascade, onUpdate: Cascade) - taskRunId String @unique + taskRunId String @unique - checkpointEvent CheckpointRestoreEvent? @relation(fields: [checkpointEventId], references: [id], onDelete: Cascade, onUpdate: Cascade) - checkpointEventId String? @unique + checkpointEvent CheckpointRestoreEvent? @relation(fields: [checkpointEventId], references: [id], onDelete: Cascade, onUpdate: Cascade) + checkpointEventId String? @unique - /// An attempt that is dependent on this task run. + /// An attempt that is dependent on this task run. dependentAttempt TaskRunAttempt? @relation(fields: [dependentAttemptId], references: [id]) - dependentAttemptId String? + dependentAttemptId String? - /// A batch run that is dependent on this task run + /// A batch run that is dependent on this task run dependentBatchRun BatchTaskRun? @relation("dependentBatchRun", fields: [dependentBatchRunId], references: [id]) - dependentBatchRunId String? + dependentBatchRunId String? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - resumedAt DateTime? + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + resumedAt DateTime? - @@index([dependentAttemptId]) - @@index([dependentBatchRunId]) + @@index([dependentAttemptId]) + @@index([dependentBatchRunId]) } /// deprecated, we hadn't included the project id in the unique constraint model TaskRunCounter { - taskIdentifier String @id - lastNumber Int @default(0) + taskIdentifier String @id + lastNumber Int @default(0) } /// Used for the TaskRun number (e.g. #1,421) model TaskRunNumberCounter { - id String @id @default(cuid()) + id String @id @default(cuid()) - taskIdentifier String - environment RuntimeEnvironment @relation(fields: [environmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) - environmentId String + taskIdentifier String + environment RuntimeEnvironment @relation(fields: [environmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) + environmentId String - lastNumber Int @default(0) + lastNumber Int @default(0) - @@unique([taskIdentifier, environmentId]) + @@unique([taskIdentifier, environmentId]) } /// This is not used from engine v2+, attempts use the TaskRunExecutionSnapshot and TaskRun model TaskRunAttempt { - id String @id @default(cuid()) - number Int @default(0) + id String @id @default(cuid()) + number Int @default(0) - friendlyId String @unique + friendlyId String @unique - taskRun TaskRun @relation("attempts", fields: [taskRunId], references: [id], onDelete: Cascade, onUpdate: Cascade) - taskRunId String + taskRun TaskRun @relation("attempts", fields: [taskRunId], references: [id], onDelete: Cascade, onUpdate: Cascade) + taskRunId String - backgroundWorker BackgroundWorker @relation(fields: [backgroundWorkerId], references: [id], onDelete: Cascade, onUpdate: Cascade) - backgroundWorkerId String + backgroundWorker BackgroundWorker @relation(fields: [backgroundWorkerId], references: [id], onDelete: Cascade, onUpdate: Cascade) + backgroundWorkerId String - backgroundWorkerTask BackgroundWorkerTask @relation(fields: [backgroundWorkerTaskId], references: [id], onDelete: Cascade, onUpdate: Cascade) - backgroundWorkerTaskId String + backgroundWorkerTask BackgroundWorkerTask @relation(fields: [backgroundWorkerTaskId], references: [id], onDelete: Cascade, onUpdate: Cascade) + backgroundWorkerTaskId String - runtimeEnvironment RuntimeEnvironment @relation(fields: [runtimeEnvironmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) - runtimeEnvironmentId String + runtimeEnvironment RuntimeEnvironment @relation(fields: [runtimeEnvironmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) + runtimeEnvironmentId String - queue TaskQueue @relation(fields: [queueId], references: [id], onDelete: Cascade, onUpdate: Cascade) - queueId String + queue TaskQueue @relation(fields: [queueId], references: [id], onDelete: Cascade, onUpdate: Cascade) + queueId String - status TaskRunAttemptStatus @default(PENDING) + status TaskRunAttemptStatus @default(PENDING) - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt - startedAt DateTime? - completedAt DateTime? + startedAt DateTime? + completedAt DateTime? - usageDurationMs Int @default(0) + usageDurationMs Int @default(0) - error Json? - output String? - outputType String @default("application/json") + error Json? + output String? + outputType String @default("application/json") - dependencies TaskRunDependency[] - batchDependencies BatchTaskRun[] + dependencies TaskRunDependency[] + batchDependencies BatchTaskRun[] - checkpoints Checkpoint[] - batchTaskRunItems BatchTaskRunItem[] - CheckpointRestoreEvent CheckpointRestoreEvent[] - alerts ProjectAlert[] - childRuns TaskRun[] @relation("TaskParentRunAttempt") + checkpoints Checkpoint[] + batchTaskRunItems BatchTaskRunItem[] + CheckpointRestoreEvent CheckpointRestoreEvent[] + alerts ProjectAlert[] + childRuns TaskRun[] @relation("TaskParentRunAttempt") - @@unique([taskRunId, number]) - @@index([taskRunId]) + @@unique([taskRunId, number]) + @@index([taskRunId]) } enum TaskRunAttemptStatus { - /// NON-FINAL + /// NON-FINAL PENDING - EXECUTING - PAUSED - /// FINAL + EXECUTING + PAUSED + /// FINAL FAILED - CANCELED - COMPLETED + CANCELED + COMPLETED } /// This is the unified otel span/log model that will eventually be replaced by clickhouse model TaskEvent { - id String @id @default(cuid()) + id String @id @default(cuid()) - /// This matches the span name for a trace event, or the log body for a log event + /// This matches the span name for a trace event, or the log body for a log event message String - traceId String - spanId String - parentId String? - tracestate String? + traceId String + spanId String + parentId String? + tracestate String? - isError Boolean @default(false) - isPartial Boolean @default(false) - isCancelled Boolean @default(false) - /// deprecated: don't use this, moving this to properties, this now uses TaskEventKind.LOG + isError Boolean @default(false) + isPartial Boolean @default(false) + isCancelled Boolean @default(false) + /// deprecated: don't use this, moving this to properties, this now uses TaskEventKind.LOG isDebug Boolean @default(false) - serviceName String - serviceNamespace String + serviceName String + serviceNamespace String - level TaskEventLevel @default(TRACE) - kind TaskEventKind @default(INTERNAL) - status TaskEventStatus @default(UNSET) + level TaskEventLevel @default(TRACE) + kind TaskEventKind @default(INTERNAL) + status TaskEventStatus @default(UNSET) - links Json? - events Json? + links Json? + events Json? - /// This is the time the event started in nanoseconds since the epoch + /// This is the time the event started in nanoseconds since the epoch startTime BigInt - /// This is the duration of the event in nanoseconds + /// This is the duration of the event in nanoseconds duration BigInt @default(0) - attemptId String? - attemptNumber Int? + attemptId String? + attemptNumber Int? - environmentId String - environmentType RuntimeEnvironmentType + environmentId String + environmentType RuntimeEnvironmentType - organizationId String + organizationId String - projectId String - projectRef String + projectId String + projectRef String - runId String - runIsTest Boolean @default(false) + runId String + runIsTest Boolean @default(false) - idempotencyKey String? + idempotencyKey String? - taskSlug String - taskPath String? - taskExportName String? + taskSlug String + taskPath String? + taskExportName String? - workerId String? - workerVersion String? + workerId String? + workerVersion String? - queueId String? - queueName String? + queueId String? + queueName String? - batchId String? + batchId String? - /// This represents all the span attributes available, like http.status_code, and special attributes like $style.icon, $output, $metadata.payload.userId, as it's used for searching and filtering + /// This represents all the span attributes available, like http.status_code, and special attributes like $style.icon, $output, $metadata.payload.userId, as it's used for searching and filtering properties Json - /// This represents all span attributes in the $metadata namespace, like $metadata.payload + /// This represents all span attributes in the $metadata namespace, like $metadata.payload metadata Json? - /// This represents all span attributes in the $style namespace, like $style + /// This represents all span attributes in the $style namespace, like $style style Json? - /// This represents all span attributes in the $output namespace, like $output + /// This represents all span attributes in the $output namespace, like $output output Json? - /// This represents the mimetype of the output, such as application/json or application/super+json + /// This represents the mimetype of the output, such as application/json or application/super+json outputType String? - payload Json? - payloadType String? + payload Json? + payloadType String? - createdAt DateTime @default(now()) + createdAt DateTime @default(now()) - // This represents the amount of "usage time" the event took, e.g. the CPU time - usageDurationMs Int @default(0) - usageCostInCents Float @default(0) + // This represents the amount of "usage time" the event took, e.g. the CPU time + usageDurationMs Int @default(0) + usageCostInCents Float @default(0) - machinePreset String? - machinePresetCpu Float? - machinePresetMemory Float? - machinePresetCentsPerMs Float? + machinePreset String? + machinePresetCpu Float? + machinePresetMemory Float? + machinePresetCentsPerMs Float? - /// Used on the run page + /// Used on the run page @@index([traceId]) - /// Used when looking up span events to complete when a run completes + /// Used when looking up span events to complete when a run completes @@index([spanId]) - // Used for getting all logs for a run - @@index([runId]) + // Used for getting all logs for a run + @@index([runId]) } enum TaskEventLevel { - TRACE - DEBUG - LOG - INFO - WARN - ERROR + TRACE + DEBUG + LOG + INFO + WARN + ERROR } enum TaskEventKind { - UNSPECIFIED - INTERNAL - SERVER - CLIENT - PRODUCER - CONSUMER - UNRECOGNIZED - LOG + UNSPECIFIED + INTERNAL + SERVER + CLIENT + PRODUCER + CONSUMER + UNRECOGNIZED + LOG } enum TaskEventStatus { - UNSET - OK - ERROR - UNRECOGNIZED + UNSET + OK + ERROR + UNRECOGNIZED } model TaskQueue { - id String @id @default(cuid()) + id String @id @default(cuid()) - friendlyId String @unique + friendlyId String @unique - name String - type TaskQueueType @default(VIRTUAL) + name String + type TaskQueueType @default(VIRTUAL) - version TaskQueueVersion @default(V1) - orderableName String? + version TaskQueueVersion @default(V1) + orderableName String? - project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) - projectId String + project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) + projectId String - runtimeEnvironment RuntimeEnvironment @relation(fields: [runtimeEnvironmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) - runtimeEnvironmentId String + runtimeEnvironment RuntimeEnvironment @relation(fields: [runtimeEnvironmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) + runtimeEnvironmentId String - concurrencyLimit Int? - rateLimit Json? + concurrencyLimit Int? + rateLimit Json? - paused Boolean @default(false) + paused Boolean @default(false) - /// If true, when a run is paused and waiting for waitpoints to be completed, the run will release the concurrency capacity. + /// If true, when a run is paused and waiting for waitpoints to be completed, the run will release the concurrency capacity. releaseConcurrencyOnWaitpoint Boolean @default(false) - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt - attempts TaskRunAttempt[] - tasks BackgroundWorkerTask[] - workers BackgroundWorker[] + attempts TaskRunAttempt[] + tasks BackgroundWorkerTask[] + workers BackgroundWorker[] - @@unique([runtimeEnvironmentId, name]) + @@unique([runtimeEnvironmentId, name]) } enum TaskQueueType { - VIRTUAL - NAMED + VIRTUAL + NAMED } enum TaskQueueVersion { - V1 - V2 + V1 + V2 } model BatchTaskRun { - id String @id @default(cuid()) - friendlyId String @unique - idempotencyKey String? - idempotencyKeyExpiresAt DateTime? - runtimeEnvironment RuntimeEnvironment @relation(fields: [runtimeEnvironmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) - status BatchTaskRunStatus @default(PENDING) - runtimeEnvironmentId String - /// This only includes new runs, not idempotent runs. + id String @id @default(cuid()) + friendlyId String @unique + idempotencyKey String? + idempotencyKeyExpiresAt DateTime? + runtimeEnvironment RuntimeEnvironment @relation(fields: [runtimeEnvironmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) + status BatchTaskRunStatus @default(PENDING) + runtimeEnvironmentId String + /// This only includes new runs, not idempotent runs. runs TaskRun[] - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt - // new columns - /// Friendly IDs + // new columns + /// Friendly IDs runIds String[] @default([]) - runCount Int @default(0) - payload String? - payloadType String @default("application/json") - options Json? - batchVersion String @default("v1") - - //engine v2 - /// Snapshots that reference this batch + runCount Int @default(0) + payload String? + payloadType String @default("application/json") + options Json? + batchVersion String @default("v1") + + //engine v2 + /// Snapshots that reference this batch executionSnapshots TaskRunExecutionSnapshot[] - /// Specific run blockers, + /// Specific run blockers, runsBlocked TaskRunWaitpoint[] - /// Waitpoints that are blocked by this batch. + /// Waitpoints that are blocked by this batch. /// When a Batch is created it blocks execution of the associated parent run (for andWait) waitpoints Waitpoint[] - // This is for v3 batches - /// sealed is set to true once no more items can be added to the batch + // This is for v3 batches + /// sealed is set to true once no more items can be added to the batch sealed Boolean @default(false) - sealedAt DateTime? - /// this is the expected number of items in the batch + sealedAt DateTime? + /// this is the expected number of items in the batch expectedCount Int @default(0) - /// this is the completed number of items in the batch. once this reaches expectedCount, and the batch is sealed, the batch is considered completed + /// this is the completed number of items in the batch. once this reaches expectedCount, and the batch is sealed, the batch is considered completed completedCount Int @default(0) - completedAt DateTime? - resumedAt DateTime? + completedAt DateTime? + resumedAt DateTime? - /// this is used to be able to "seal" this BatchTaskRun when all of the runs have been triggered asynchronously, and using the "parallel" processing strategy + /// this is used to be able to "seal" this BatchTaskRun when all of the runs have been triggered asynchronously, and using the "parallel" processing strategy processingJobsCount Int @default(0) - processingJobsExpectedCount Int @default(0) + processingJobsExpectedCount Int @default(0) - /// optional token that can be used to authenticate the task run + /// optional token that can be used to authenticate the task run oneTimeUseToken String? - ///all the below properties are engine v1 only + ///all the below properties are engine v1 only items BatchTaskRunItem[] - taskIdentifier String? - checkpointEvent CheckpointRestoreEvent? @relation(fields: [checkpointEventId], references: [id], onDelete: Cascade, onUpdate: Cascade) - checkpointEventId String? @unique - dependentTaskAttempt TaskRunAttempt? @relation(fields: [dependentTaskAttemptId], references: [id], onDelete: Cascade, onUpdate: Cascade) - dependentTaskAttemptId String? - runDependencies TaskRunDependency[] @relation("dependentBatchRun") - - @@unique([oneTimeUseToken]) - ///this is used for all engine versions + taskIdentifier String? + checkpointEvent CheckpointRestoreEvent? @relation(fields: [checkpointEventId], references: [id], onDelete: Cascade, onUpdate: Cascade) + checkpointEventId String? @unique + dependentTaskAttempt TaskRunAttempt? @relation(fields: [dependentTaskAttemptId], references: [id], onDelete: Cascade, onUpdate: Cascade) + dependentTaskAttemptId String? + runDependencies TaskRunDependency[] @relation("dependentBatchRun") + + @@unique([oneTimeUseToken]) + ///this is used for all engine versions @@unique([runtimeEnvironmentId, idempotencyKey]) - @@index([dependentTaskAttemptId]) + @@index([dependentTaskAttemptId]) } enum BatchTaskRunStatus { - PENDING - COMPLETED - ABORTED + PENDING + COMPLETED + ABORTED } ///Used in engine V1 only model BatchTaskRunItem { - id String @id @default(cuid()) + id String @id @default(cuid()) - status BatchTaskRunItemStatus @default(PENDING) + status BatchTaskRunItemStatus @default(PENDING) - batchTaskRun BatchTaskRun @relation(fields: [batchTaskRunId], references: [id], onDelete: Cascade, onUpdate: Cascade) - batchTaskRunId String + batchTaskRun BatchTaskRun @relation(fields: [batchTaskRunId], references: [id], onDelete: Cascade, onUpdate: Cascade) + batchTaskRunId String - taskRun TaskRun @relation(fields: [taskRunId], references: [id], onDelete: Cascade, onUpdate: Cascade) - taskRunId String + taskRun TaskRun @relation(fields: [taskRunId], references: [id], onDelete: Cascade, onUpdate: Cascade) + taskRunId String - taskRunAttempt TaskRunAttempt? @relation(fields: [taskRunAttemptId], references: [id], onDelete: SetNull, onUpdate: Cascade) - taskRunAttemptId String? + taskRunAttempt TaskRunAttempt? @relation(fields: [taskRunAttemptId], references: [id], onDelete: SetNull, onUpdate: Cascade) + taskRunAttemptId String? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - completedAt DateTime? + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + completedAt DateTime? - @@unique([batchTaskRunId, taskRunId]) - @@index([taskRunAttemptId], map: "idx_batchtaskrunitem_taskrunattempt") - @@index([taskRunId], map: "idx_batchtaskrunitem_taskrun") + @@unique([batchTaskRunId, taskRunId]) + @@index([taskRunAttemptId], map: "idx_batchtaskrunitem_taskrunattempt") + @@index([taskRunId], map: "idx_batchtaskrunitem_taskrun") } enum BatchTaskRunItemStatus { - PENDING - FAILED - CANCELED - COMPLETED + PENDING + FAILED + CANCELED + COMPLETED } model EnvironmentVariable { - id String @id @default(cuid()) - friendlyId String @unique - key String - project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) - projectId String - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - values EnvironmentVariableValue[] + id String @id @default(cuid()) + friendlyId String @unique + key String + project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) + projectId String + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + values EnvironmentVariableValue[] - @@unique([projectId, key]) + @@unique([projectId, key]) } model EnvironmentVariableValue { - id String @id @default(cuid()) - valueReference SecretReference? @relation(fields: [valueReferenceId], references: [id], onDelete: SetNull, onUpdate: Cascade) - valueReferenceId String? - variable EnvironmentVariable @relation(fields: [variableId], references: [id], onDelete: Cascade, onUpdate: Cascade) - variableId String - environment RuntimeEnvironment @relation(fields: [environmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) - environmentId String - - /// If true, the value is secret and cannot be revealed + id String @id @default(cuid()) + valueReference SecretReference? @relation(fields: [valueReferenceId], references: [id], onDelete: SetNull, onUpdate: Cascade) + valueReferenceId String? + variable EnvironmentVariable @relation(fields: [variableId], references: [id], onDelete: Cascade, onUpdate: Cascade) + variableId String + environment RuntimeEnvironment @relation(fields: [environmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) + environmentId String + + /// If true, the value is secret and cannot be revealed isSecret Boolean @default(false) - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt - @@unique([variableId, environmentId]) + @@unique([variableId, environmentId]) } model Checkpoint { - id String @id @default(cuid()) + id String @id @default(cuid()) - friendlyId String @unique + friendlyId String @unique - type CheckpointType - location String - imageRef String - reason String? - metadata String? + type CheckpointType + location String + imageRef String + reason String? + metadata String? - events CheckpointRestoreEvent[] + events CheckpointRestoreEvent[] - run TaskRun @relation(fields: [runId], references: [id], onDelete: Cascade, onUpdate: Cascade) - runId String + run TaskRun @relation(fields: [runId], references: [id], onDelete: Cascade, onUpdate: Cascade) + runId String - attempt TaskRunAttempt @relation(fields: [attemptId], references: [id], onDelete: Cascade, onUpdate: Cascade) - attemptId String - attemptNumber Int? + attempt TaskRunAttempt @relation(fields: [attemptId], references: [id], onDelete: Cascade, onUpdate: Cascade) + attemptId String + attemptNumber Int? - project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) - projectId String + project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) + projectId String - runtimeEnvironment RuntimeEnvironment @relation(fields: [runtimeEnvironmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) - runtimeEnvironmentId String + runtimeEnvironment RuntimeEnvironment @relation(fields: [runtimeEnvironmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) + runtimeEnvironmentId String - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt - @@index([attemptId]) - @@index([runId]) + @@index([attemptId]) + @@index([runId]) } enum CheckpointType { - DOCKER - KUBERNETES + DOCKER + KUBERNETES } model CheckpointRestoreEvent { - id String @id @default(cuid()) + id String @id @default(cuid()) - type CheckpointRestoreEventType - reason String? - metadata String? + type CheckpointRestoreEventType + reason String? + metadata String? - checkpoint Checkpoint @relation(fields: [checkpointId], references: [id], onDelete: Cascade, onUpdate: Cascade) - checkpointId String + checkpoint Checkpoint @relation(fields: [checkpointId], references: [id], onDelete: Cascade, onUpdate: Cascade) + checkpointId String - run TaskRun @relation(fields: [runId], references: [id], onDelete: Cascade, onUpdate: Cascade) - runId String + run TaskRun @relation(fields: [runId], references: [id], onDelete: Cascade, onUpdate: Cascade) + runId String - attempt TaskRunAttempt @relation(fields: [attemptId], references: [id], onDelete: Cascade, onUpdate: Cascade) - attemptId String + attempt TaskRunAttempt @relation(fields: [attemptId], references: [id], onDelete: Cascade, onUpdate: Cascade) + attemptId String - project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) - projectId String + project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) + projectId String - runtimeEnvironment RuntimeEnvironment @relation(fields: [runtimeEnvironmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) - runtimeEnvironmentId String + runtimeEnvironment RuntimeEnvironment @relation(fields: [runtimeEnvironmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) + runtimeEnvironmentId String - taskRunDependency TaskRunDependency? - batchTaskRunDependency BatchTaskRun? + taskRunDependency TaskRunDependency? + batchTaskRunDependency BatchTaskRun? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt - @@index([checkpointId]) - @@index([runId]) + @@index([checkpointId]) + @@index([runId]) } enum CheckpointRestoreEventType { - CHECKPOINT - RESTORE + CHECKPOINT + RESTORE } enum WorkerDeploymentType { - MANAGED - UNMANAGED - V1 + MANAGED + UNMANAGED + V1 } model WorkerDeployment { - id String @id @default(cuid()) + id String @id @default(cuid()) - contentHash String - friendlyId String @unique - shortCode String - version String + contentHash String + friendlyId String @unique + shortCode String + version String - imageReference String? - imagePlatform String @default("linux/amd64") + imageReference String? + imagePlatform String @default("linux/amd64") - externalBuildData Json? + externalBuildData Json? - status WorkerDeploymentStatus @default(PENDING) - type WorkerDeploymentType @default(V1) + status WorkerDeploymentStatus @default(PENDING) + type WorkerDeploymentType @default(V1) - project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) - projectId String + project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) + projectId String - environment RuntimeEnvironment @relation(fields: [environmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) - environmentId String + environment RuntimeEnvironment @relation(fields: [environmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) + environmentId String - worker BackgroundWorker? @relation(fields: [workerId], references: [id], onDelete: Cascade, onUpdate: Cascade) - workerId String? @unique + worker BackgroundWorker? @relation(fields: [workerId], references: [id], onDelete: Cascade, onUpdate: Cascade) + workerId String? @unique - triggeredBy User? @relation(fields: [triggeredById], references: [id], onDelete: SetNull, onUpdate: Cascade) - triggeredById String? + triggeredBy User? @relation(fields: [triggeredById], references: [id], onDelete: SetNull, onUpdate: Cascade) + triggeredById String? - builtAt DateTime? - deployedAt DateTime? + builtAt DateTime? + deployedAt DateTime? - failedAt DateTime? - errorData Json? + failedAt DateTime? + errorData Json? - // This is GitMeta type - git Json? + // This is GitMeta type + git Json? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt - promotions WorkerDeploymentPromotion[] - alerts ProjectAlert[] - workerInstance WorkerInstance[] + promotions WorkerDeploymentPromotion[] + alerts ProjectAlert[] + workerInstance WorkerInstance[] - @@unique([projectId, shortCode]) - @@unique([environmentId, version]) + @@unique([projectId, shortCode]) + @@unique([environmentId, version]) } enum WorkerDeploymentStatus { - PENDING - /// This is the status when the image is being built + PENDING + /// This is the status when the image is being built BUILDING - /// This is the status when the image is built and we are waiting for the indexing to finish + /// This is the status when the image is built and we are waiting for the indexing to finish DEPLOYING - /// This is the status when the image is built and indexed, meaning we have everything we need to deploy + /// This is the status when the image is built and indexed, meaning we have everything we need to deploy DEPLOYED - FAILED - CANCELED - /// This is the status when the image is built and indexing does not finish in time + FAILED + CANCELED + /// This is the status when the image is built and indexing does not finish in time TIMED_OUT } model WorkerDeploymentPromotion { - id String @id @default(cuid()) + id String @id @default(cuid()) - /// This is the promotion label, e.g. "current" + /// This is the promotion label, e.g. "current" label String - deployment WorkerDeployment @relation(fields: [deploymentId], references: [id], onDelete: Cascade, onUpdate: Cascade) - deploymentId String + deployment WorkerDeployment @relation(fields: [deploymentId], references: [id], onDelete: Cascade, onUpdate: Cascade) + deploymentId String - environment RuntimeEnvironment @relation(fields: [environmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) - environmentId String + environment RuntimeEnvironment @relation(fields: [environmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) + environmentId String - // Only one promotion per environment can be active at a time - @@unique([environmentId, label]) + // Only one promotion per environment can be active at a time + @@unique([environmentId, label]) } ///Schedules can be attached to tasks to trigger them on a schedule model TaskSchedule { - id String @id @default(cuid()) + id String @id @default(cuid()) - type ScheduleType @default(IMPERATIVE) + type ScheduleType @default(IMPERATIVE) - ///users see this as `id`. They start with schedule_ + ///users see this as `id`. They start with schedule_ friendlyId String @unique - ///a reference to a task (not a foreign key because it's across versions) + ///a reference to a task (not a foreign key because it's across versions) taskIdentifier String - ///can be provided and we won't create another with the same key + ///can be provided and we won't create another with the same key deduplicationKey String @default(cuid()) - userProvidedDeduplicationKey Boolean @default(false) + userProvidedDeduplicationKey Boolean @default(false) - ///the CRON pattern + ///the CRON pattern generatorExpression String - generatorDescription String @default("") - generatorType ScheduleGeneratorType @default(CRON) + generatorDescription String @default("") + generatorType ScheduleGeneratorType @default(CRON) - /// These are IANA format string, or the default "UTC". E.g. "America/New_York" + /// These are IANA format string, or the default "UTC". E.g. "America/New_York" timezone String @default("UTC") - ///Can be provided by the user then accessed inside a run + ///Can be provided by the user then accessed inside a run externalId String? - ///Instances of the schedule that are active + ///Instances of the schedule that are active instances TaskScheduleInstance[] - lastRunTriggeredAt DateTime? + lastRunTriggeredAt DateTime? - project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) - projectId String + project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) + projectId String - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt - active Boolean @default(true) + active Boolean @default(true) - @@unique([projectId, deduplicationKey]) - /// Dashboard list view + @@unique([projectId, deduplicationKey]) + /// Dashboard list view @@index([projectId]) - @@index([projectId, createdAt(sort: Desc)]) + @@index([projectId, createdAt(sort: Desc)]) } enum ScheduleType { - /// defined on your task using the `cron` property + /// defined on your task using the `cron` property DECLARATIVE - /// explicit calls to the SDK are used to create, or using the dashboard + /// explicit calls to the SDK are used to create, or using the dashboard IMPERATIVE } enum ScheduleGeneratorType { - CRON + CRON } ///An instance links a schedule with an environment model TaskScheduleInstance { - id String @id @default(cuid()) + id String @id @default(cuid()) - taskSchedule TaskSchedule @relation(fields: [taskScheduleId], references: [id], onDelete: Cascade, onUpdate: Cascade) - taskScheduleId String + taskSchedule TaskSchedule @relation(fields: [taskScheduleId], references: [id], onDelete: Cascade, onUpdate: Cascade) + taskScheduleId String - environment RuntimeEnvironment @relation(fields: [environmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) - environmentId String + environment RuntimeEnvironment @relation(fields: [environmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) + environmentId String - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt - active Boolean @default(true) + active Boolean @default(true) - lastScheduledTimestamp DateTime? - nextScheduledTimestamp DateTime? + lastScheduledTimestamp DateTime? + nextScheduledTimestamp DateTime? - //you can only have a schedule attached to each environment once - @@unique([taskScheduleId, environmentId]) + //you can only have a schedule attached to each environment once + @@unique([taskScheduleId, environmentId]) } model RuntimeEnvironmentSession { - id String @id @default(cuid()) + id String @id @default(cuid()) - ipAddress String + ipAddress String - environment RuntimeEnvironment @relation(fields: [environmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) - environmentId String + environment RuntimeEnvironment @relation(fields: [environmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) + environmentId String - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - disconnectedAt DateTime? + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + disconnectedAt DateTime? - currentEnvironments RuntimeEnvironment[] @relation("currentSession") + currentEnvironments RuntimeEnvironment[] @relation("currentSession") } model ProjectAlertChannel { - id String @id @default(cuid()) + id String @id @default(cuid()) - friendlyId String @unique + friendlyId String @unique - ///can be provided and we won't create another with the same key + ///can be provided and we won't create another with the same key deduplicationKey String @default(cuid()) - userProvidedDeduplicationKey Boolean @default(false) + userProvidedDeduplicationKey Boolean @default(false) - integration OrganizationIntegration? @relation(fields: [integrationId], references: [id], onDelete: SetNull, onUpdate: Cascade) - integrationId String? + integration OrganizationIntegration? @relation(fields: [integrationId], references: [id], onDelete: SetNull, onUpdate: Cascade) + integrationId String? - enabled Boolean @default(true) + enabled Boolean @default(true) - type ProjectAlertChannelType - name String - properties Json - alertTypes ProjectAlertType[] - environmentTypes RuntimeEnvironmentType[] @default([STAGING, PRODUCTION]) + type ProjectAlertChannelType + name String + properties Json + alertTypes ProjectAlertType[] + environmentTypes RuntimeEnvironmentType[] @default([STAGING, PRODUCTION]) - project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) - projectId String + project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) + projectId String - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt - alerts ProjectAlert[] - alertStorages ProjectAlertStorage[] + alerts ProjectAlert[] + alertStorages ProjectAlertStorage[] - @@unique([projectId, deduplicationKey]) + @@unique([projectId, deduplicationKey]) } enum ProjectAlertChannelType { - EMAIL - SLACK - WEBHOOK + EMAIL + SLACK + WEBHOOK } model ProjectAlert { - id String @id @default(cuid()) - friendlyId String @unique + id String @id @default(cuid()) + friendlyId String @unique - project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) - projectId String + project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) + projectId String - environment RuntimeEnvironment @relation(fields: [environmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) - environmentId String + environment RuntimeEnvironment @relation(fields: [environmentId], references: [id], onDelete: Cascade, onUpdate: Cascade) + environmentId String - channel ProjectAlertChannel @relation(fields: [channelId], references: [id], onDelete: Cascade, onUpdate: Cascade) - channelId String + channel ProjectAlertChannel @relation(fields: [channelId], references: [id], onDelete: Cascade, onUpdate: Cascade) + channelId String - status ProjectAlertStatus @default(PENDING) + status ProjectAlertStatus @default(PENDING) - type ProjectAlertType + type ProjectAlertType - taskRunAttempt TaskRunAttempt? @relation(fields: [taskRunAttemptId], references: [id], onDelete: Cascade, onUpdate: Cascade) - taskRunAttemptId String? + taskRunAttempt TaskRunAttempt? @relation(fields: [taskRunAttemptId], references: [id], onDelete: Cascade, onUpdate: Cascade) + taskRunAttemptId String? - taskRun TaskRun? @relation(fields: [taskRunId], references: [id], onDelete: Cascade, onUpdate: Cascade) - taskRunId String? + taskRun TaskRun? @relation(fields: [taskRunId], references: [id], onDelete: Cascade, onUpdate: Cascade) + taskRunId String? - workerDeployment WorkerDeployment? @relation(fields: [workerDeploymentId], references: [id], onDelete: Cascade, onUpdate: Cascade) - workerDeploymentId String? + workerDeployment WorkerDeployment? @relation(fields: [workerDeploymentId], references: [id], onDelete: Cascade, onUpdate: Cascade) + workerDeploymentId String? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt } enum ProjectAlertType { - TASK_RUN - /// deprecated, we don't send new alerts for this type + TASK_RUN + /// deprecated, we don't send new alerts for this type TASK_RUN_ATTEMPT - DEPLOYMENT_FAILURE - DEPLOYMENT_SUCCESS + DEPLOYMENT_FAILURE + DEPLOYMENT_SUCCESS } enum ProjectAlertStatus { - PENDING - SENT - FAILED + PENDING + SENT + FAILED } model ProjectAlertStorage { - id String @id @default(cuid()) + id String @id @default(cuid()) - project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) - projectId String + project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) + projectId String - alertChannel ProjectAlertChannel @relation(fields: [alertChannelId], references: [id], onDelete: Cascade, onUpdate: Cascade) - alertChannelId String + alertChannel ProjectAlertChannel @relation(fields: [alertChannelId], references: [id], onDelete: Cascade, onUpdate: Cascade) + alertChannelId String - alertType ProjectAlertType + alertType ProjectAlertType - storageId String - storageData Json + storageId String + storageData Json - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt } model OrganizationIntegration { - id String @id @default(cuid()) + id String @id @default(cuid()) - friendlyId String @unique + friendlyId String @unique - service IntegrationService + service IntegrationService - integrationData Json + integrationData Json - tokenReference SecretReference @relation(fields: [tokenReferenceId], references: [id], onDelete: Cascade, onUpdate: Cascade) - tokenReferenceId String + tokenReference SecretReference @relation(fields: [tokenReferenceId], references: [id], onDelete: Cascade, onUpdate: Cascade) + tokenReferenceId String - organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade, onUpdate: Cascade) - organizationId String + organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade, onUpdate: Cascade) + organizationId String - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt - alertChannels ProjectAlertChannel[] + alertChannels ProjectAlertChannel[] } enum IntegrationService { - SLACK + SLACK } /// Bulk actions, like canceling and replaying runs model BulkActionGroup { - id String @id @default(cuid()) + id String @id @default(cuid()) - friendlyId String @unique + friendlyId String @unique - project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) - projectId String + project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade) + projectId String - type BulkActionType - items BulkActionItem[] + type BulkActionType + items BulkActionItem[] - /// When the group is created it's pending. After we've processed all the items it's completed. This does not mean the associated runs are completed. + /// When the group is created it's pending. After we've processed all the items it's completed. This does not mean the associated runs are completed. status BulkActionStatus @default(PENDING) - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt } enum BulkActionType { - /// Cancels existing runs. This populates the destination runs. + /// Cancels existing runs. This populates the destination runs. CANCEL - /// Replays existing runs. The original runs go as source runs, and the new runs go as destination runs. + /// Replays existing runs. The original runs go as source runs, and the new runs go as destination runs. REPLAY } enum BulkActionStatus { - PENDING - COMPLETED + PENDING + COMPLETED } model BulkActionItem { - id String @id @default(cuid()) + id String @id @default(cuid()) - friendlyId String @unique + friendlyId String @unique - group BulkActionGroup @relation(fields: [groupId], references: [id], onDelete: Cascade, onUpdate: Cascade) - groupId String + group BulkActionGroup @relation(fields: [groupId], references: [id], onDelete: Cascade, onUpdate: Cascade) + groupId String - type BulkActionType + type BulkActionType - /// When the item is created it's pending. After we've processed the item it's completed. This does not mean the associated runs are completed. + /// When the item is created it's pending. After we've processed the item it's completed. This does not mean the associated runs are completed. status BulkActionItemStatus @default(PENDING) - /// The run that is the source of the action, e.g. when replaying this is the original run + /// The run that is the source of the action, e.g. when replaying this is the original run sourceRun TaskRun @relation("SourceActionItemRun", fields: [sourceRunId], references: [id], onDelete: Cascade, onUpdate: Cascade) - sourceRunId String + sourceRunId String - /// The run that's a result of the action, this will be set when the run has been created + /// The run that's a result of the action, this will be set when the run has been created destinationRun TaskRun? @relation("DestinationActionItemRun", fields: [destinationRunId], references: [id], onDelete: Cascade, onUpdate: Cascade) - destinationRunId String? + destinationRunId String? - error String? + error String? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt } enum BulkActionItemStatus { - PENDING - COMPLETED - FAILED + PENDING + COMPLETED + FAILED } model RealtimeStreamChunk { - id String @id @default(cuid()) + id String @id @default(cuid()) - key String - value String + key String + value String - sequence Int + sequence Int - runId String + runId String - createdAt DateTime @default(now()) + createdAt DateTime @default(now()) - @@index([runId]) - @@index([createdAt]) + @@index([runId]) + @@index([createdAt]) } /// This is the unified otel span/log model that will eventually be replaced by clickhouse model TaskEventPartitioned { - id String @default(cuid()) - /// This matches the span name for a trace event, or the log body for a log event + id String @default(cuid()) + /// This matches the span name for a trace event, or the log body for a log event message String - traceId String - spanId String - parentId String? - tracestate String? + traceId String + spanId String + parentId String? + tracestate String? - isError Boolean @default(false) - isPartial Boolean @default(false) - isCancelled Boolean @default(false) + isError Boolean @default(false) + isPartial Boolean @default(false) + isCancelled Boolean @default(false) - serviceName String - serviceNamespace String + serviceName String + serviceNamespace String - level TaskEventLevel @default(TRACE) - kind TaskEventKind @default(INTERNAL) - status TaskEventStatus @default(UNSET) + level TaskEventLevel @default(TRACE) + kind TaskEventKind @default(INTERNAL) + status TaskEventStatus @default(UNSET) - links Json? - events Json? + links Json? + events Json? - /// This is the time the event started in nanoseconds since the epoch + /// This is the time the event started in nanoseconds since the epoch startTime BigInt - /// This is the duration of the event in nanoseconds + /// This is the duration of the event in nanoseconds duration BigInt @default(0) - attemptId String? - attemptNumber Int? + attemptId String? + attemptNumber Int? - environmentId String - environmentType RuntimeEnvironmentType + environmentId String + environmentType RuntimeEnvironmentType - organizationId String + organizationId String - projectId String - projectRef String + projectId String + projectRef String - runId String - runIsTest Boolean @default(false) + runId String + runIsTest Boolean @default(false) - idempotencyKey String? + idempotencyKey String? - taskSlug String - taskPath String? - taskExportName String? + taskSlug String + taskPath String? + taskExportName String? - workerId String? - workerVersion String? + workerId String? + workerVersion String? - queueId String? - queueName String? + queueId String? + queueName String? - batchId String? + batchId String? - /// This represents all the span attributes available, like http.status_code, and special attributes like $style.icon, $output, $metadata.payload.userId, as it's used for searching and filtering + /// This represents all the span attributes available, like http.status_code, and special attributes like $style.icon, $output, $metadata.payload.userId, as it's used for searching and filtering properties Json - /// This represents all span attributes in the $metadata namespace, like $metadata.payload + /// This represents all span attributes in the $metadata namespace, like $metadata.payload metadata Json? - /// This represents all span attributes in the $style namespace, like $style + /// This represents all span attributes in the $style namespace, like $style style Json? - /// This represents all span attributes in the $output namespace, like $output + /// This represents all span attributes in the $output namespace, like $output output Json? - /// This represents the mimetype of the output, such as application/json or application/super+json + /// This represents the mimetype of the output, such as application/json or application/super+json outputType String? - payload Json? - payloadType String? + payload Json? + payloadType String? - createdAt DateTime @default(now()) + createdAt DateTime @default(now()) - // This represents the amount of "usage time" the event took, e.g. the CPU time - usageDurationMs Int @default(0) - usageCostInCents Float @default(0) + // This represents the amount of "usage time" the event took, e.g. the CPU time + usageDurationMs Int @default(0) + usageCostInCents Float @default(0) - machinePreset String? - machinePresetCpu Float? - machinePresetMemory Float? - machinePresetCentsPerMs Float? + machinePreset String? + machinePresetCpu Float? + machinePresetMemory Float? + machinePresetCentsPerMs Float? - @@id([id, createdAt]) - /// Used on the run page + @@id([id, createdAt]) + /// Used on the run page @@index([traceId]) - /// Used when looking up span events to complete when a run completes + /// Used when looking up span events to complete when a run completes @@index([spanId]) - // Used for getting all logs for a run - @@index([runId]) + // Used for getting all logs for a run + @@index([runId]) } \ No newline at end of file diff --git a/tests/e2e/github-repos/trigger.dev/trigger-dev.test.ts b/tests/e2e/github-repos/trigger.dev/trigger-dev.test.ts deleted file mode 100644 index 9de8d683d..000000000 --- a/tests/e2e/github-repos/trigger.dev/trigger-dev.test.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { generateTsSchema } from '@zenstackhq/testtools'; -import fs from 'node:fs'; -import path from 'node:path'; -import { describe, expect, it } from 'vitest'; - -describe('Trigger.dev e2e tests', () => { - it('has a working schema', async () => { - await expect( - generateTsSchema(fs.readFileSync(path.join(__dirname, 'schema.zmodel'), 'utf8'), 'postgresql'), - ).resolves.toBeTruthy(); - }); -}); diff --git a/tests/e2e/orm/client-api/aggregate.test.ts b/tests/e2e/orm/client-api/aggregate.test.ts index 520e12187..848e498ec 100644 --- a/tests/e2e/orm/client-api/aggregate.test.ts +++ b/tests/e2e/orm/client-api/aggregate.test.ts @@ -8,7 +8,7 @@ describe('Client aggregate tests', () => { let client: ClientContract; beforeEach(async () => { - client = await createTestClient(schema); + client = (await createTestClient(schema)) as any; }); afterEach(async () => { diff --git a/tests/e2e/orm/client-api/count.test.ts b/tests/e2e/orm/client-api/count.test.ts index 1168f9d61..3e57bf9ab 100644 --- a/tests/e2e/orm/client-api/count.test.ts +++ b/tests/e2e/orm/client-api/count.test.ts @@ -7,7 +7,7 @@ describe('Client count tests', () => { let client: ClientContract; beforeEach(async () => { - client = await createTestClient(schema); + client = (await createTestClient(schema)) as any; }); afterEach(async () => { diff --git a/tests/e2e/orm/client-api/create-many-and-return.test.ts b/tests/e2e/orm/client-api/create-many-and-return.test.ts index aa9b0b90d..f6049d5bc 100644 --- a/tests/e2e/orm/client-api/create-many-and-return.test.ts +++ b/tests/e2e/orm/client-api/create-many-and-return.test.ts @@ -7,7 +7,7 @@ describe('Client createManyAndReturn tests', () => { let client: ClientContract; beforeEach(async () => { - client = await createTestClient(schema); + client = (await createTestClient(schema)) as any; }); afterEach(async () => { @@ -59,7 +59,7 @@ describe('Client createManyAndReturn tests', () => { }); it('works with select and omit', async () => { - let r = await client.user.createManyAndReturn({ + const r = await client.user.createManyAndReturn({ data: [{ email: 'u1@test.com', name: 'name' }], select: { email: true }, }); @@ -67,12 +67,12 @@ describe('Client createManyAndReturn tests', () => { // @ts-expect-error expect(r[0]!.name).toBeUndefined(); - r = await client.user.createManyAndReturn({ + const r1 = await client.user.createManyAndReturn({ data: [{ email: 'u2@test.com', name: 'name' }], omit: { name: true }, }); - expect(r[0]!.email).toBe('u2@test.com'); + expect(r1[0]!.email).toBe('u2@test.com'); // @ts-expect-error - expect(r[0]!.name).toBeUndefined(); + expect(r1[0]!.name).toBeUndefined(); }); }); diff --git a/tests/e2e/orm/client-api/create-many.test.ts b/tests/e2e/orm/client-api/create-many.test.ts index c55f05ac4..75d93a295 100644 --- a/tests/e2e/orm/client-api/create-many.test.ts +++ b/tests/e2e/orm/client-api/create-many.test.ts @@ -7,7 +7,7 @@ describe('Client createMany tests', () => { let client: ClientContract; beforeEach(async () => { - client = await createTestClient(schema); + client = (await createTestClient(schema)) as any; }); afterEach(async () => { diff --git a/tests/e2e/orm/client-api/create.test.ts b/tests/e2e/orm/client-api/create.test.ts index dcf45edad..c47a413f3 100644 --- a/tests/e2e/orm/client-api/create.test.ts +++ b/tests/e2e/orm/client-api/create.test.ts @@ -7,7 +7,7 @@ describe('Client create tests', () => { let client: ClientContract; beforeEach(async () => { - client = await createTestClient(schema); + client = (await createTestClient(schema)) as any; }); afterEach(async () => { diff --git a/tests/e2e/orm/client-api/delegate.test.ts b/tests/e2e/orm/client-api/delegate.test.ts index 9076c60db..c5f59c70e 100644 --- a/tests/e2e/orm/client-api/delegate.test.ts +++ b/tests/e2e/orm/client-api/delegate.test.ts @@ -8,10 +8,10 @@ describe('Delegate model tests ', () => { let client: ClientContract; beforeEach(async () => { - client = await createTestClient(schema, { + client = (await createTestClient(schema, { usePrismaPush: true, schemaFile: path.join(__dirname, '../schemas/delegate/schema.zmodel'), - }); + })) as any; }); afterEach(async () => { diff --git a/tests/e2e/orm/client-api/delete-many.test.ts b/tests/e2e/orm/client-api/delete-many.test.ts index c7ea5530c..c5fc84e1c 100644 --- a/tests/e2e/orm/client-api/delete-many.test.ts +++ b/tests/e2e/orm/client-api/delete-many.test.ts @@ -7,7 +7,7 @@ describe('Client deleteMany tests', () => { let client: ClientContract; beforeEach(async () => { - client = await createTestClient(schema); + client = (await createTestClient(schema)) as any; }); afterEach(async () => { diff --git a/tests/e2e/orm/client-api/delete.test.ts b/tests/e2e/orm/client-api/delete.test.ts index e38395328..5050faadd 100644 --- a/tests/e2e/orm/client-api/delete.test.ts +++ b/tests/e2e/orm/client-api/delete.test.ts @@ -7,7 +7,7 @@ describe('Client delete tests', () => { let client: ClientContract; beforeEach(async () => { - client = await createTestClient(schema); + client = (await createTestClient(schema)) as any; }); afterEach(async () => { diff --git a/tests/e2e/orm/client-api/filter.test.ts b/tests/e2e/orm/client-api/filter.test.ts index 290977bc7..f7774291b 100644 --- a/tests/e2e/orm/client-api/filter.test.ts +++ b/tests/e2e/orm/client-api/filter.test.ts @@ -44,6 +44,7 @@ describe('Client filter tests ', () => { it('supports string filters', async () => { const user1 = await createUser('u1@test.com'); const user2 = await createUser('u2@test.com', { name: null }); + await createUser('u3%@test.com', { name: null }); // equals await expect(client.user.findFirst({ where: { id: user1.id } })).toResolveTruthy(); @@ -93,6 +94,21 @@ describe('Client filter tests ', () => { where: { email: { contains: 'test' } }, }), ).toResolveTruthy(); + await expect( + client.user.findFirst({ + where: { email: { contains: '%test' } }, + }), + ).toResolveNull(); + await expect( + client.user.findFirst({ + where: { email: { contains: 'u3%' } }, + }), + ).toResolveTruthy(); + await expect( + client.user.findFirst({ + where: { email: { contains: 'u3a' } }, + }), + ).toResolveNull(); await expect( client.user.findFirst({ where: { email: { contains: 'Test' } }, @@ -104,11 +120,26 @@ describe('Client filter tests ', () => { where: { email: { startsWith: 'u1' } }, }), ).toResolveTruthy(); + await expect( + client.user.findFirst({ + where: { email: { startsWith: '%u1' } }, + }), + ).toResolveNull(); await expect( client.user.findFirst({ where: { email: { startsWith: 'U1' } }, }), ).toResolveTruthy(); + await expect( + client.user.findFirst({ + where: { email: { startsWith: 'u3a' } }, + }), + ).toResolveNull(); + await expect( + client.user.findFirst({ + where: { email: { startsWith: 'u3%' } }, + }), + ).toResolveTruthy(); await expect( client.user.findFirst({ @@ -155,6 +186,28 @@ describe('Client filter tests ', () => { }), ).toResolveTruthy(); + await expect( + client.user.findFirst({ + where: { + email: { contains: '%u1', mode: 'insensitive' } as any, + }, + }), + ).toResolveNull(); + await expect( + client.user.findFirst({ + where: { + email: { contains: 'u3%', mode: 'insensitive' } as any, + }, + }), + ).toResolveTruthy(); + await expect( + client.user.findFirst({ + where: { + email: { contains: 'u3a', mode: 'insensitive' } as any, + }, + }), + ).toResolveNull(); + await expect( client.user.findFirst({ where: { @@ -211,7 +264,7 @@ describe('Client filter tests ', () => { ).toResolveTruthy(); await expect( client.user.findFirst({ - where: { email: { notIn: ['u1@test.com', 'u2@test.com'] } }, + where: { email: { notIn: ['u1@test.com', 'u2@test.com', 'u3%@test.com'] } }, }), ).toResolveFalsy(); await expect( @@ -230,7 +283,7 @@ describe('Client filter tests ', () => { client.user.findMany({ where: { email: { lt: 'z@test.com' } }, }), - ).toResolveWithLength(2); + ).toResolveWithLength(3); await expect( client.user.findMany({ where: { email: { lte: 'u1@test.com' } }, @@ -245,7 +298,7 @@ describe('Client filter tests ', () => { client.user.findMany({ where: { email: { gt: 'a@test.com' } }, }), - ).toResolveWithLength(2); + ).toResolveWithLength(3); await expect( client.user.findMany({ where: { email: { gt: 'z@test.com' } }, @@ -255,12 +308,12 @@ describe('Client filter tests ', () => { client.user.findMany({ where: { email: { gte: 'u1@test.com' } }, }), - ).toResolveWithLength(2); + ).toResolveWithLength(3); await expect( client.user.findMany({ where: { email: { gte: 'u2@test.com' } }, }), - ).toResolveWithLength(1); + ).toResolveWithLength(2); // contains await expect( @@ -270,7 +323,7 @@ describe('Client filter tests ', () => { ).toResolveTruthy(); await expect( client.user.findFirst({ - where: { email: { contains: '3@' } }, + where: { email: { contains: '4@' } }, }), ).toResolveFalsy(); diff --git a/tests/e2e/orm/client-api/find.test.ts b/tests/e2e/orm/client-api/find.test.ts index 765492cca..7f9df68f1 100644 --- a/tests/e2e/orm/client-api/find.test.ts +++ b/tests/e2e/orm/client-api/find.test.ts @@ -8,7 +8,7 @@ describe('Client find tests ', () => { let client: ClientContract; beforeEach(async () => { - client = await createTestClient(schema); + client = (await createTestClient(schema)) as any; }); afterEach(async () => { diff --git a/tests/e2e/orm/client-api/group-by.test.ts b/tests/e2e/orm/client-api/group-by.test.ts index fd31131ce..250bd9057 100644 --- a/tests/e2e/orm/client-api/group-by.test.ts +++ b/tests/e2e/orm/client-api/group-by.test.ts @@ -8,7 +8,7 @@ describe('Client groupBy tests', () => { let client: ClientContract; beforeEach(async () => { - client = await createTestClient(schema); + client = (await createTestClient(schema)) as any; }); afterEach(async () => { diff --git a/tests/e2e/orm/client-api/json-filter.test.ts b/tests/e2e/orm/client-api/json-filter.test.ts new file mode 100644 index 000000000..4260d439b --- /dev/null +++ b/tests/e2e/orm/client-api/json-filter.test.ts @@ -0,0 +1,1106 @@ +import { AnyNull, DbNull, JsonNull } from '@zenstackhq/orm'; +import { createTestClient, getTestDbProvider } from '@zenstackhq/testtools'; +import { describe, expect, it } from 'vitest'; +import { schema } from '../schemas/json/schema'; +import { schema as typedJsonSchema } from '../schemas/typed-json/schema'; + +describe('Json filter tests', () => { + it('works with simple equality filter', async () => { + const db = await createTestClient(schema); + await db.foo.create({ data: { data: { hello: 'world' } } }); + + await expect(db.foo.findFirst({ where: { data: { equals: { hello: 'world' } } } })).resolves.toMatchObject({ + data: { hello: 'world' }, + }); + await expect(db.foo.findFirst({ where: { data: { not: { hello: 'foo' } } } })).resolves.toMatchObject({ + data: { hello: 'world' }, + }); + await expect(db.foo.findFirst({ where: { data: { not: { hello: 'world' } } } })).toResolveNull(); + }); + + it('distinguishes between JsonNull and DbNull', async () => { + const db = await createTestClient(schema); + + // Create records with different null types + // Record 1: data contains JSON null, data1 is DB NULL (unset) + const rec1 = await db.foo.create({ data: { data: JsonNull } }); + + // Record 2: data contains object, data1 explicitly set to JSON null + const rec2 = await db.foo.create({ data: { data: { foo: 'bar' }, data1: JsonNull } }); + + // Record 3: data contains object, data1 is DB NULL (unset) + const rec3 = await db.foo.create({ data: { data: { hello: 'world' }, data1: DbNull } }); + + // Record 4: data contains object, data1 explicitly set to an object + const rec4 = await db.foo.create({ data: { data: { test: 'value' }, data1: { key: 'value' } } }); + + // Test JsonNull - should match JSON null value in data field + const jsonNullResults = await db.foo.findMany({ + where: { data: { equals: JsonNull } }, + }); + expect(jsonNullResults).toHaveLength(1); + expect(jsonNullResults[0]?.data).toBe(null); // JSON null is returned as null + expect(jsonNullResults[0]?.id).toBe(rec1.id); + + // Test JsonNull in data1 field + const jsonNullData1Results = await db.foo.findMany({ + where: { data1: { equals: JsonNull } }, + }); + expect(jsonNullData1Results).toHaveLength(1); // Only record 2 has data1 as JSON null + expect(jsonNullData1Results[0]?.data1).toBe(null); + expect(jsonNullData1Results[0]?.id).toBe(rec2.id); + + // Test NOT JsonNull - should exclude JSON null records + const notJsonNull = await db.foo.findMany({ + where: { data: { not: JsonNull } }, + }); + expect(notJsonNull).toHaveLength(3); // Should exclude the JsonNull record + expect(notJsonNull.map((r) => r.id).sort()).toEqual([rec2.id, rec3.id, rec4.id].sort()); + + // Test data1 with actual value - "not JsonNull" should match DB NULL and actual objects + const data1NotJsonNull = await db.foo.findMany({ + where: { data1: { not: JsonNull } }, + }); + // Records 1, 3 have DB NULL, record 4 has an object - all should match "not JsonNull" + expect(data1NotJsonNull.length).toBe(3); + + // Test DbNull - should match database NULL values + const dbNullResults = await db.foo.findMany({ + where: { data1: { equals: DbNull } }, + }); + // Records 1 and 3 have data1 as DB NULL + expect(dbNullResults.length).toBe(2); + expect(dbNullResults.map((r) => r.id).sort()).toEqual([rec1.id, rec3.id].sort()); + + // Test AnyNull - should match both JSON null and DB NULL + const anyNullResults = await db.foo.findMany({ + where: { data1: { equals: AnyNull } }, + }); + // Records 1, 2, and 3: rec1 (DB NULL), rec2 (JSON null), rec3 (DB NULL) + expect(anyNullResults.length).toBe(3); + expect(anyNullResults.map((r) => r.id).sort()).toEqual([rec1.id, rec2.id, rec3.id].sort()); + + // invalid input + // @ts-expect-error + await expect(db.foo.create({ data: { data: null } })).toBeRejectedByValidation(); + // @ts-expect-error + await expect(db.foo.create({ data: { data: DbNull } })).toBeRejectedByValidation(); + // @ts-expect-error + await expect(db.foo.create({ data: { data1: null } })).toBeRejectedByValidation(); + // @ts-expect-error + await expect(db.foo.update({ where: { id: rec1.id }, data: { data: null } })).toBeRejectedByValidation(); + await expect( + // @ts-expect-error + db.foo.update({ where: { id: rec1.id }, data: { data: DbNull } }), + ).toBeRejectedByValidation(); + // @ts-expect-error + await expect(db.foo.update({ where: { id: rec1.id }, data: { data1: null } })).toBeRejectedByValidation(); + }); + + it('works with updates', async () => { + const db = await createTestClient(schema); + const rec = await db.foo.create({ data: { data: { hello: 'world' }, data1: 'data1' } }); + + // Update to JSON null + await db.foo.update({ + where: { id: rec.id }, + data: { data: JsonNull }, + }); + await expect(db.foo.findUnique({ where: { id: rec.id } })).resolves.toMatchObject({ + data: null, + }); + + // Update to DB null + await db.foo.update({ + where: { id: rec.id }, + data: { data1: DbNull }, + }); + await expect(db.foo.findUnique({ where: { id: rec.id } })).resolves.toMatchObject({ + data1: null, + }); + + // Update to actual object + await db.foo.update({ + where: { id: rec.id }, + data: { data: { updated: 'value' }, data1: { another: 'value' } }, + }); + await expect(db.foo.findUnique({ where: { id: rec.id } })).resolves.toMatchObject({ + data: { updated: 'value' }, + data1: { another: 'value' }, + }); + }); + + it('works with JSON objects containing null values', async () => { + const db = await createTestClient(schema); + + // Create a record with an object containing a null property value + const rec1 = await db.foo.create({ data: { data: { key: null } } }); + expect(rec1.data).toEqual({ key: null }); + + // Create a record with nested object containing null values + const rec2 = await db.foo.create({ data: { data: { outer: { inner: null }, valid: 'value' } } }); + expect(rec2.data).toEqual({ outer: { inner: null }, valid: 'value' }); + + // Query with equality filter for object with null value + await expect(db.foo.findFirst({ where: { data: { equals: { key: null } } } })).resolves.toMatchObject({ + id: rec1.id, + data: { key: null }, + }); + + // Query with equality filter for nested object with null value + await expect( + db.foo.findFirst({ where: { data: { equals: { outer: { inner: null }, valid: 'value' } } } }), + ).resolves.toMatchObject({ + id: rec2.id, + data: { outer: { inner: null }, valid: 'value' }, + }); + + // Query with not filter for object with null value + const notResults = await db.foo.findMany({ + where: { data: { not: { key: null } } }, + }); + expect(notResults.find((r) => r.id === rec1.id)).toBeUndefined(); + expect(notResults.find((r) => r.id === rec2.id)).toBeDefined(); + }); + + it('works with JSON arrays containing null values', async () => { + const db = await createTestClient(schema); + + // Create a record with an array containing null values + const rec1 = await db.foo.create({ data: { data: [1, null, 3] } }); + expect(rec1.data).toEqual([1, null, 3]); + + // Create a record with an array of objects including null + const rec2 = await db.foo.create({ data: { data: [{ a: 1 }, null, { b: 2 }] } }); + expect(rec2.data).toEqual([{ a: 1 }, null, { b: 2 }]); + + // Create a record with nested arrays containing null + const rec3 = await db.foo.create({ + data: { + data: [ + [1, null], + [null, 2], + ], + }, + }); + expect(rec3.data).toEqual([ + [1, null], + [null, 2], + ]); + + // Query with equality filter for array with null value + await expect(db.foo.findFirst({ where: { data: { equals: [1, null, 3] } } })).resolves.toMatchObject({ + id: rec1.id, + data: [1, null, 3], + }); + + // Query with equality filter for array of objects with null + await expect( + db.foo.findFirst({ where: { data: { equals: [{ a: 1 }, null, { b: 2 }] } } }), + ).resolves.toMatchObject({ + id: rec2.id, + data: [{ a: 1 }, null, { b: 2 }], + }); + + // Query with not filter for array with null value + const notResults = await db.foo.findMany({ + where: { data: { not: [1, null, 3] } }, + }); + expect(notResults.find((r) => r.id === rec1.id)).toBeUndefined(); + expect(notResults.find((r) => r.id === rec2.id)).toBeDefined(); + expect(notResults.find((r) => r.id === rec3.id)).toBeDefined(); + }); + + it('works with filtering typed JSON fields', async () => { + const db = await createTestClient(typedJsonSchema); + + const alice = await db.user.create({ + data: { profile: { name: 'Alice', age: 25, jobs: [] } }, + }); + + await expect( + db.user.findFirst({ where: { profile: { equals: { name: 'Alice', age: 25, jobs: [] } } } }), + ).resolves.toMatchObject(alice); + + await expect(db.user.findFirst({ where: { profile: { equals: { name: 'Alice', age: 20 } } } })).toResolveNull(); + await expect( + db.user.findFirst({ where: { profile: { not: { name: 'Alice', age: 20 } } } }), + ).resolves.toMatchObject(alice); + }); + + it('works with path selection equality filter', async () => { + const db = await createTestClient(schema); + const createData = { a: { b: { c: 42 } }, x: [{ value: 1 }, { value: 2 }] }; + await db.foo.create({ + data: { data: createData }, + }); + + await expect( + db.foo.findFirst({ + where: { + data: { + equals: createData, + }, + }, + }), + ).toResolveTruthy(); + + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$', + equals: createData, + }, + }, + }), + ).toResolveTruthy(); + + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.a', + equals: createData['a'], + }, + }, + }), + ).toResolveTruthy(); + + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.a.b', + equals: createData['a']['b'], + }, + }, + }), + ).toResolveTruthy(); + + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.a.z', + equals: createData['a']['b'], + }, + }, + }), + ).toResolveNull(); + + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.x', + equals: createData['x'], + }, + }, + }), + ).toResolveTruthy(); + + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.x[1]', + equals: createData['x'][1], + }, + }, + }), + ).toResolveTruthy(); + + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.x[0]', + equals: createData['x'][1], + }, + }, + }), + ).toResolveNull(); + + // null filters for non-null value + + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.a', + equals: JsonNull, + }, + }, + }), + ).toResolveNull(); + + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.a', + equals: DbNull, + }, + }, + }), + ).toResolveNull(); + + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.a', + equals: AnyNull, + }, + }, + }), + ).toResolveNull(); + + // null filters for null value + await db.foo.deleteMany(); + + await db.foo.create({ + data: { data: { a: null } }, + }); + + // @ts-expect-error + db.foo.findFirst({ where: { data: { path: '$.a', equals: null } } }); + + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.a', + equals: JsonNull, + }, + }, + }), + ).toResolveTruthy(); + + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.a', + equals: DbNull, + }, + }, + }), + ).toResolveNull(); + + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.a', + equals: AnyNull, + }, + }, + }), + ).toResolveTruthy(); + + // null filters for top-level nulls + await db.foo.deleteMany(); + await db.foo.create({ + data: { data: JsonNull }, + }); + await expect(db.foo.findFirst({ where: { data: { equals: JsonNull } } })).toResolveTruthy(); + await expect(db.foo.findFirst({ where: { data: { equals: DbNull } } })).toResolveNull(); + await expect(db.foo.findFirst({ where: { data: { equals: AnyNull } } })).toResolveTruthy(); + await expect(db.foo.findFirst({ where: { data: { path: '$.foo', equals: JsonNull } } })).toResolveNull(); + await expect(db.foo.findFirst({ where: { data: { path: '$.foo', equals: DbNull } } })).toResolveTruthy(); + await expect(db.foo.findFirst({ where: { data: { path: '$.foo', equals: AnyNull } } })).toResolveTruthy(); + + // null filters for nulls in arrays + await db.foo.deleteMany(); + await db.foo.create({ data: { data: { arr: [1, null] } } }); + await expect( + db.foo.findFirst({ + where: { + data: { path: '$.arr[1]', equals: JsonNull }, + }, + }), + ).toResolveTruthy(); + await expect( + db.foo.findFirst({ + where: { + data: { path: '$.arr[1]', equals: DbNull }, + }, + }), + ).toResolveNull(); + await expect( + db.foo.findFirst({ + where: { + data: { path: '$.arr[1]', equals: AnyNull }, + }, + }), + ).toResolveTruthy(); + await expect( + db.foo.findFirst({ + where: { + data: { path: '$.arr[0]', equals: JsonNull }, + }, + }), + ).toResolveNull(); + await expect( + db.foo.findFirst({ + where: { + data: { path: '$.arr[0]', equals: DbNull }, + }, + }), + ).toResolveFalsy(); + await expect( + db.foo.findFirst({ + where: { + data: { path: '$.arr[0]', equals: AnyNull }, + }, + }), + ).toResolveFalsy(); + await expect( + db.foo.findFirst({ + where: { + data: { path: '$.arr[2]', equals: JsonNull }, + }, + }), + ).toResolveNull(); + await expect( + db.foo.findFirst({ + where: { + data: { path: '$.arr[2]', equals: DbNull }, + }, + }), + ).toResolveTruthy(); + await expect( + db.foo.findFirst({ + where: { + data: { path: '$.arr[2]', equals: AnyNull }, + }, + }), + ).toResolveTruthy(); + }); + + it('works with path selection string filters', async () => { + const db = await createTestClient(schema); + + await db.foo.create({ + data: { data: { name: 'John Doe', email: 'john@example.com', tags: ['developer', 'typescript'] } }, + }); + await db.foo.create({ + data: { data: { name: 'Jane Smith', email: 'jane@test.org', tags: ['designer', 'ui'] } }, + }); + await db.foo.create({ + data: { data: { name: 'Bob Johnson', email: 'bob@example.net', tags: ['manager', 'typescript'] } }, + }); + await db.foo.create({ + data: { data: { name: '%Foo', email: 'foo@example.com' } }, + }); + + // string_contains + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.name', + string_contains: 'Doe', + }, + }, + }), + ).resolves.toMatchObject({ data: { name: 'John Doe' } }); + + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.name', + string_contains: '%Doe', // % should be treated as literal + }, + }, + }), + ).toResolveNull(); + + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.name', + string_contains: 'doe', + mode: 'insensitive', // case insensitive + }, + }, + }), + ).resolves.toMatchObject({ data: { name: 'John Doe' } }); + + const provider = getTestDbProvider(); + if (provider === 'postgresql') { + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.name', + string_contains: 'doe', + }, + }, + }), + ).toResolveNull(); // case sensitive + + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.name', + string_contains: 'doe', + mode: 'default', + }, + }, + }), + ).toResolveNull(); // case sensitive + } + + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.bar', // non-existing path + string_contains: 'Doe', + }, + }, + }), + ).toResolveNull(); + + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.name', + string_contains: 'NonExistent', + }, + }, + }), + ).toResolveNull(); + + // string_starts_with + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.name', + string_starts_with: 'Jane', + }, + }, + }), + ).resolves.toMatchObject({ data: { name: 'Jane Smith' } }); + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.name', + string_starts_with: '%Jane', // % should be treated as literal + }, + }, + }), + ).toResolveNull(); + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.name', + string_starts_with: '%Smith', // % should be treated as literal + }, + }, + }), + ).toResolveNull(); + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.name', + string_starts_with: '%Foo', // % should be treated as literal + }, + }, + }), + ).resolves.toMatchObject({ data: { name: '%Foo' } }); + + // string_ends_with + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.name', + string_ends_with: 'Johnson', + }, + }, + }), + ).resolves.toMatchObject({ data: { name: 'Bob Johnson' } }); + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.name', + string_ends_with: 'Johnson%', + }, + }, + }), + ).toResolveNull(); + + // Test with array index access + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.tags[0]', + string_contains: 'velop', + }, + }, + }), + ).resolves.toMatchObject({ data: { tags: ['developer', 'typescript'] } }); + + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.tags[1]', + string_starts_with: 'type', + }, + }, + }), + ).resolves.toMatchObject({ data: { tags: ['developer', 'typescript'] } }); + + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.tags[2]', + string_starts_with: 'type', + }, + }, + }), + ).toResolveNull(); + }); + + it('works with string filter for top-level string values', async () => { + const db = await createTestClient(schema); + + await db.foo.createMany({ + data: [{ data: 'Hello World' }], + }); + + await expect( + db.foo.findFirst({ + where: { + data: { + string_contains: 'World', + }, + }, + }), + ).resolves.toMatchObject({ data: 'Hello World' }); + + await expect( + db.foo.findFirst({ + where: { + data: { + string_contains: 'World', + }, + }, + }), + ).resolves.toMatchObject({ data: 'Hello World' }); + + await expect( + db.foo.findFirst({ + where: { + data: { + string_contains: 'Foo', + }, + }, + }), + ).toResolveNull(); + }); + + it('works with path selection array filter', async () => { + const db = await createTestClient(schema); + + await db.foo.create({ + data: { + data: { + tags: ['typescript', 'react', 'node'], + numbers: [1, 2, 3, 4, 5], + nested: { items: ['alpha', 'beta', 'gamma'] }, + }, + }, + }); + await db.foo.create({ + data: { + data: { + tags: ['python', 'django', 'flask'], + numbers: [10, 20, 30], + nested: { items: ['delta', 'epsilon'] }, + }, + }, + }); + await db.foo.create({ + data: { + data: { + tags: ['java', 'spring'], + numbers: [100, 200], + nested: { items: ['zeta'] }, + }, + }, + }); + + // array_contains - check if array contains a specific value + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.tags', + array_contains: 'react', + }, + }, + }), + ).resolves.toMatchObject({ data: { tags: ['typescript', 'react', 'node'] } }); + + if ((db.$schema.provider.type as any) === 'postgresql') { + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.tags', + array_contains: ['react'], + }, + }, + }), + ).resolves.toMatchObject({ data: { tags: ['typescript', 'react', 'node'] } }); + } + + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.numbers', + array_contains: 20, + }, + }, + }), + ).resolves.toMatchObject({ data: { numbers: [10, 20, 30] } }); + + // array_contains with nested path + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.nested.items', + array_contains: 'beta', + }, + }, + }), + ).resolves.toMatchObject({ data: { nested: { items: ['alpha', 'beta', 'gamma'] } } }); + + // array_starts_with - check if array starts with a specific value + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.tags', + array_starts_with: 'typescript', + }, + }, + }), + ).resolves.toMatchObject({ data: { tags: ['typescript', 'react', 'node'] } }); + + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.numbers', + array_starts_with: 1, + }, + }, + }), + ).resolves.toMatchObject({ data: { numbers: [1, 2, 3, 4, 5] } }); + + // array_ends_with - check if array ends with a specific value + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.tags', + array_ends_with: 'node', + }, + }, + }), + ).resolves.toMatchObject({ data: { tags: ['typescript', 'react', 'node'] } }); + + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.numbers', + array_ends_with: 30, + }, + }, + }), + ).resolves.toMatchObject({ data: { numbers: [10, 20, 30] } }); + + // Negative tests - should not match + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.tags', + array_contains: 'rust', + }, + }, + }), + ).toResolveNull(); + + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.tags', + array_starts_with: 'react', + }, + }, + }), + ).toResolveNull(); + + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.numbers', + array_ends_with: 100, + }, + }, + }), + ).toResolveNull(); + + // Test with non-existent path + await expect( + db.foo.findFirst({ + where: { + data: { + path: '$.nonexistent', + array_contains: 'anything', + }, + }, + }), + ).toResolveNull(); + }); + + it('typed json direct filtering', async () => { + const db = await createTestClient(typedJsonSchema); + + await db.user.create({ + data: { + profile: { + name: 'Alice', + age: 25, + address: { country: 'US' }, + jobs: [{ title: 'Developer' }, { title: 'Designer' }], + }, + }, + }); + + await expect( + db.user.findFirst({ + where: { + profile: { + name: 'Alice', + }, + }, + }), + ).toResolveTruthy(); + + await expect( + db.user.findFirst({ + where: { + profile: { + age: { + lt: 20, + }, + }, + }, + }), + ).toResolveNull(); + + // deep field + await expect( + db.user.findFirst({ + where: { + profile: { + address: { + country: 'US', + }, + }, + }, + }), + ).toResolveTruthy(); + await expect( + db.user.findFirst({ + where: { + profile: { + is: { + address: { + country: 'US', + }, + }, + }, + }, + }), + ).toResolveTruthy(); + await expect( + db.user.findFirst({ + where: { + profile: { + isNot: { + address: { + country: 'US', + }, + }, + }, + }, + }), + ).toResolveNull(); + + // mixed shallow and deep + await expect( + db.user.findFirst({ + where: { + profile: { + name: 'Alice', + address: { + country: 'US', + }, + }, + }, + }), + ).toResolveTruthy(); + + // nullable fields + await expect( + db.user.findFirst({ + where: { + profile: { + name: 'Alice', + address: { + zip: null, + }, + }, + }, + }), + ).toResolveTruthy(); + + // array of typed json + await expect( + db.user.findFirst({ + where: { + profile: { + jobs: { + some: { + title: 'Designer', + }, + }, + }, + }, + }), + ).toResolveTruthy(); + + await expect( + db.user.findFirst({ + where: { + profile: { + jobs: { + every: { + title: 'Designer', + }, + }, + }, + }, + }), + ).toResolveNull(); + + await expect( + db.user.findFirst({ + where: { + profile: { + jobs: { + none: { + title: 'Designer', + }, + }, + }, + }, + }), + ).toResolveNull(); + + await expect( + db.user.findFirst({ + where: { + profile: { + jobs: { + every: { + title: { + startsWith: 'De', + }, + }, + }, + }, + }, + }), + ).toResolveTruthy(); + + await expect( + db.user.findFirst({ + where: { + profile: { + jobs: { + none: { + title: { + startsWith: 'De', + }, + }, + }, + }, + }, + }), + ).toResolveFalsy(); + + // mixed plain json and typed json + await expect( + db.user.findFirst({ + where: { + profile: { + // @ts-expect-error + name: 'Alice', + path: '$.name', + equals: 'Alice', + }, + }, + }), + ).toBeRejectedByValidation(); + + await db.user.deleteMany(); + await db.user.create({ + data: { + profile: { + name: 'Alice', + age: 25, + jobs: [], + address: null, + }, + }, + }); + + // null filter + await expect( + db.user.findFirst({ + where: { + profile: { + address: null, + }, + }, + }), + ).toResolveTruthy(); + }); +}); diff --git a/tests/e2e/orm/client-api/name-mapping.test.ts b/tests/e2e/orm/client-api/name-mapping.test.ts index e1ba54302..5fd699a99 100644 --- a/tests/e2e/orm/client-api/name-mapping.test.ts +++ b/tests/e2e/orm/client-api/name-mapping.test.ts @@ -8,10 +8,10 @@ describe('Name mapping tests', () => { let db: ClientContract; beforeEach(async () => { - db = await createTestClient(schema, { + db = (await createTestClient(schema, { usePrismaPush: true, schemaFile: path.join(__dirname, '../schemas/name-mapping/schema.zmodel'), - }); + })) as any; }); afterEach(async () => { diff --git a/tests/e2e/orm/client-api/raw-query.test.ts b/tests/e2e/orm/client-api/raw-query.test.ts index 7fe0ecbcd..b8de60473 100644 --- a/tests/e2e/orm/client-api/raw-query.test.ts +++ b/tests/e2e/orm/client-api/raw-query.test.ts @@ -7,7 +7,7 @@ describe('Client raw query tests', () => { let client: ClientContract; beforeEach(async () => { - client = await createTestClient(schema); + client = (await createTestClient(schema)) as any; }); afterEach(async () => { diff --git a/tests/e2e/orm/client-api/transaction.test.ts b/tests/e2e/orm/client-api/transaction.test.ts index e4f2192e8..e8ae7f94b 100644 --- a/tests/e2e/orm/client-api/transaction.test.ts +++ b/tests/e2e/orm/client-api/transaction.test.ts @@ -7,7 +7,7 @@ describe('Client raw query tests', () => { let client: ClientContract; beforeEach(async () => { - client = await createTestClient(schema); + client = (await createTestClient(schema)) as any; }); afterEach(async () => { diff --git a/tests/e2e/orm/client-api/undefined-values.test.ts b/tests/e2e/orm/client-api/undefined-values.test.ts index d2ed52f00..b1ac39626 100644 --- a/tests/e2e/orm/client-api/undefined-values.test.ts +++ b/tests/e2e/orm/client-api/undefined-values.test.ts @@ -8,7 +8,7 @@ describe('Client undefined values tests ', () => { let client: ClientContract; beforeEach(async () => { - client = await createTestClient(schema); + client = (await createTestClient(schema)) as any; }); afterEach(async () => { diff --git a/tests/e2e/orm/client-api/update-many.test.ts b/tests/e2e/orm/client-api/update-many.test.ts index 61776e3ec..a5bc2b48e 100644 --- a/tests/e2e/orm/client-api/update-many.test.ts +++ b/tests/e2e/orm/client-api/update-many.test.ts @@ -7,7 +7,7 @@ describe('Client updateMany tests', () => { let client: ClientContract; beforeEach(async () => { - client = await createTestClient(schema); + client = (await createTestClient(schema)) as any; }); afterEach(async () => { diff --git a/tests/e2e/orm/client-api/update.test.ts b/tests/e2e/orm/client-api/update.test.ts index c79396d7f..46c712889 100644 --- a/tests/e2e/orm/client-api/update.test.ts +++ b/tests/e2e/orm/client-api/update.test.ts @@ -8,7 +8,7 @@ describe('Client update tests', () => { let client: ClientContract; beforeEach(async () => { - client = await createTestClient(schema); + client = (await createTestClient(schema)) as any; }); afterEach(async () => { diff --git a/tests/e2e/orm/client-api/upsert.test.ts b/tests/e2e/orm/client-api/upsert.test.ts index 3b3cb0905..6a20de4f8 100644 --- a/tests/e2e/orm/client-api/upsert.test.ts +++ b/tests/e2e/orm/client-api/upsert.test.ts @@ -69,4 +69,113 @@ describe('Client upsert tests', () => { email: 'u1@test.com', }); }); + + it('works with upsert with empty update payload', async () => { + // Test 1: Upsert with empty update should create new record when it doesn't exist + const created = await client.user.upsert({ + where: { id: '1' }, + create: { + id: '1', + email: 'u1@test.com', + name: 'John', + }, + update: {}, + select: { id: true, email: true, name: true }, + }); + + expect(created).toMatchObject({ + id: '1', + email: 'u1@test.com', + name: 'John', + }); + + // Verify the record was created + const fetchedAfterCreate = await client.user.findUnique({ + where: { id: '1' }, + select: { id: true, email: true, name: true }, + }); + + expect(fetchedAfterCreate).toMatchObject({ + id: '1', + email: 'u1@test.com', + name: 'John', + }); + + // Test 2: Upsert with empty update should return existing record unchanged + const result = await client.user.upsert({ + where: { id: '1' }, + create: { + id: '1', + email: 'u1@test.com', + name: 'Jane', + }, + update: {}, + select: { id: true, email: true, name: true }, + }); + + expect(result).toMatchObject({ + id: '1', + email: 'u1@test.com', + name: 'John', // Should remain unchanged + }); + + // Verify the record was not modified + const fetched = await client.user.findUnique({ + where: { id: '1' }, + select: { id: true, email: true, name: true }, + }); + + expect(fetched).toMatchObject({ + id: '1', + email: 'u1@test.com', + name: 'John', + }); + }); + + it('works with upsert with empty create payload', async () => { + const db = await createTestClient( + ` +model User { + id String @id @default(cuid()) + name String? +} + `, + { dbName: 'orm_upsert_empty_create' }, + ); + + // Test 1: First upsert should create the entity with empty data + const created = await db.user.upsert({ + where: { id: '1' }, + create: {}, + update: { name: 'Updated' }, + }); + + expect(created).toBeTruthy(); + + // Verify the record was created + await expect(db.user.findFirst()).resolves.toMatchObject(created); + + // Test 2: Second upsert should update the existing entity + const updated = await db.user.upsert({ + where: { id: created.id }, + create: {}, + update: { name: 'Updated' }, + }); + + expect(updated).toMatchObject({ + id: created.id, + name: 'Updated', + }); + + // Verify the record was updated + await expect( + db.user.findUnique({ + where: { id: created.id }, + }), + ).resolves.toMatchObject({ + name: 'Updated', + }); + + await db.$disconnect(); + }); }); diff --git a/tests/e2e/orm/plugin-infra/entity-mutation-hooks.test.ts b/tests/e2e/orm/plugin-infra/entity-mutation-hooks.test.ts index 1b0eea2fe..4c97d1a9b 100644 --- a/tests/e2e/orm/plugin-infra/entity-mutation-hooks.test.ts +++ b/tests/e2e/orm/plugin-infra/entity-mutation-hooks.test.ts @@ -8,7 +8,7 @@ describe('Entity mutation hooks tests', () => { let _client: ClientContract; beforeEach(async () => { - _client = await createTestClient(schema, {}); + _client = (await createTestClient(schema, {})) as any; }); afterEach(async () => { diff --git a/tests/e2e/orm/plugin-infra/on-kysely-query.test.ts b/tests/e2e/orm/plugin-infra/on-kysely-query.test.ts index 686026133..a4a45b32b 100644 --- a/tests/e2e/orm/plugin-infra/on-kysely-query.test.ts +++ b/tests/e2e/orm/plugin-infra/on-kysely-query.test.ts @@ -8,7 +8,7 @@ describe('On kysely query tests', () => { let _client: ClientContract; beforeEach(async () => { - _client = await createTestClient(schema); + _client = (await createTestClient(schema)) as any; }); afterEach(async () => { diff --git a/tests/e2e/orm/plugin-infra/on-query-hooks.test.ts b/tests/e2e/orm/plugin-infra/on-query-hooks.test.ts index 0b74e76fc..88126c98d 100644 --- a/tests/e2e/orm/plugin-infra/on-query-hooks.test.ts +++ b/tests/e2e/orm/plugin-infra/on-query-hooks.test.ts @@ -7,7 +7,7 @@ describe('On query hooks tests', () => { let _client: ClientContract; beforeEach(async () => { - _client = await createTestClient(schema); + _client = (await createTestClient(schema)) as any; }); afterEach(async () => { diff --git a/tests/e2e/orm/policy/basic-schema-read.test.ts b/tests/e2e/orm/policy/basic-schema-read.test.ts index 7464a38ce..3b2122213 100644 --- a/tests/e2e/orm/policy/basic-schema-read.test.ts +++ b/tests/e2e/orm/policy/basic-schema-read.test.ts @@ -8,7 +8,7 @@ describe('Read policy tests', () => { let client: ClientContract; beforeEach(async () => { - client = await createTestClient(schema); + client = (await createTestClient(schema)) as any; }); afterEach(async () => { diff --git a/tests/e2e/orm/policy/crud/read.test.ts b/tests/e2e/orm/policy/crud/read.test.ts index 652e9f1e1..fd767b519 100644 --- a/tests/e2e/orm/policy/crud/read.test.ts +++ b/tests/e2e/orm/policy/crud/read.test.ts @@ -36,7 +36,8 @@ model Foo { await expect(db.foo.create({ data: { id: 1, x: 0 } })).toBeRejectedByPolicy(); await expect(db.$unuseAll().foo.count()).resolves.toBe(1); - await expect(db.foo.update({ where: { id: 1 }, data: { x: 1 } })).resolves.toMatchObject({ x: 1 }); + await db.$unuseAll().foo.update({ where: { id: 1 }, data: { x: 1 } }); + await expect(db.foo.update({ where: { id: 1 }, data: { x: 2 } })).resolves.toMatchObject({ x: 2 }); }); it('works with to-one relation optional owner-side read', async () => { @@ -61,7 +62,7 @@ model Bar { await db.foo.create({ data: { id: 1, bar: { create: { id: 1, y: 0 } } } }); await expect(db.foo.findFirst({ include: { bar: true } })).resolves.toMatchObject({ id: 1, bar: null }); - await db.bar.update({ where: { id: 1 }, data: { y: 1 } }); + await db.$unuseAll().bar.update({ where: { id: 1 }, data: { y: 1 } }); await expect(db.foo.findFirst({ include: { bar: true } })).resolves.toMatchObject({ id: 1, bar: { id: 1 }, @@ -92,7 +93,7 @@ model Bar { await db.foo.create({ data: { id: 1, bar: { create: { id: 1, y: 0 } } } }); await expect(db.foo.findFirst({ include: { bar: true } })).resolves.toMatchObject({ id: 1, bar: null }); - await db.bar.update({ where: { id: 1 }, data: { y: 1 } }); + await db.$unuseAll().bar.update({ where: { id: 1 }, data: { y: 1 } }); await expect(db.foo.findFirst({ include: { bar: true } })).resolves.toMatchObject({ id: 1, bar: { id: 1 }, @@ -121,7 +122,7 @@ model Bar { await db.foo.create({ data: { id: 1, bar: { create: { id: 1, y: 0 } } } }); await expect(db.foo.findFirst({ include: { bar: true } })).resolves.toMatchObject({ id: 1, bar: null }); - await db.bar.update({ where: { id: 1 }, data: { y: 1 } }); + await db.$unuseAll().bar.update({ where: { id: 1 }, data: { y: 1 } }); await expect(db.foo.findFirst({ include: { bar: true } })).resolves.toMatchObject({ id: 1, bar: { id: 1 }, diff --git a/tests/e2e/orm/policy/migrated/nested-to-many.test.ts b/tests/e2e/orm/policy/migrated/nested-to-many.test.ts index e6402eb3c..290b19236 100644 --- a/tests/e2e/orm/policy/migrated/nested-to-many.test.ts +++ b/tests/e2e/orm/policy/migrated/nested-to-many.test.ts @@ -668,23 +668,30 @@ describe('Policy tests to-many', () => { ], }, m3: { - create: { value: 0 }, + create: { id: 'm3', value: 0 }, }, }, }); - const r = await db.m1.update({ - where: { id: '1' }, - include: { m3: true }, - data: { - m3: { - update: { - value: 1, + await expect( + db.m1.update({ + where: { id: '1' }, + include: { m3: true }, + data: { + m3: { + update: { + value: 1, + }, }, }, - }, + }), + ).toBeRejectedNotFound(); + + // make m3 readable + await db.$unuseAll().m3.update({ + where: { id: 'm3' }, + data: { value: 2 }, }); - expect(r.m3).toBeNull(); const r1 = await db.m1.update({ where: { id: '1' }, @@ -692,16 +699,22 @@ describe('Policy tests to-many', () => { data: { m3: { update: { - value: 2, + value: 3, }, }, }, }); // m3 is ok now - expect(r1.m3.value).toBe(2); + expect(r1.m3.value).toBe(3); // m2 got filtered expect(r1.m2).toHaveLength(0); + // make m2#1 readable + await db.$unuseAll().m2.update({ + where: { id: '1' }, + data: { value: 2 }, + }); + const r2 = await db.m1.update({ where: { id: '1' }, select: { m2: true }, @@ -709,7 +722,7 @@ describe('Policy tests to-many', () => { m2: { update: { where: { id: '1' }, - data: { value: 2 }, + data: { value: 3 }, }, }, }, diff --git a/tests/e2e/orm/policy/migrated/nested-to-one.test.ts b/tests/e2e/orm/policy/migrated/nested-to-one.test.ts index 1db225698..f839336cb 100644 --- a/tests/e2e/orm/policy/migrated/nested-to-one.test.ts +++ b/tests/e2e/orm/policy/migrated/nested-to-one.test.ts @@ -184,7 +184,7 @@ describe('With Policy:nested to-one', () => { }), ).toResolveTruthy(); - // nested update denied + // nested update to m2 is filtered await expect( db.m1.update({ where: { id: '1' }, @@ -195,6 +195,8 @@ describe('With Policy:nested to-one', () => { }, }), ).toBeRejectedNotFound(); + + await expect(db.m2.findFirst()).resolves.toMatchObject({ value: 1 }); }); it('nested update id tests', async () => { diff --git a/tests/e2e/orm/policy/policy-functions.test.ts b/tests/e2e/orm/policy/policy-functions.test.ts index 6d70426e7..b48d3da3f 100644 --- a/tests/e2e/orm/policy/policy-functions.test.ts +++ b/tests/e2e/orm/policy/policy-functions.test.ts @@ -23,6 +23,23 @@ describe('policy functions tests', () => { await expect(db.foo.create({ data: { string: 'bac' } })).toResolveTruthy(); }); + it('escapes input for contains', async () => { + const db = await createPolicyTestClient( + ` + model Foo { + id String @id @default(cuid()) + string String + @@allow('all', contains(string, 'a%')) + } + `, + { debug: true }, + ); + + await expect(db.foo.create({ data: { string: 'ab' } })).toBeRejectedByPolicy(); + await expect(db.foo.create({ data: { string: 'a%' } })).toResolveTruthy(); + await expect(db.foo.create({ data: { string: 'a%b' } })).toResolveTruthy(); + }); + it('supports contains explicit case-sensitive', async () => { const db = await createPolicyTestClient( ` @@ -143,6 +160,22 @@ describe('policy functions tests', () => { await expect(anonDb.$setAuth({ id: 'user1', name: 'abc' }).foo.create({ data: {} })).toResolveTruthy(); }); + it('escapes input for startsWith', async () => { + const db = await createPolicyTestClient( + ` + model Foo { + id String @id @default(cuid()) + string String + @@allow('all', startsWith(string, '%a')) + } + `, + ); + + await expect(db.foo.create({ data: { string: 'ba' } })).toBeRejectedByPolicy(); + await expect(db.foo.create({ data: { string: '%a' } })).toResolveTruthy(); + await expect(db.foo.create({ data: { string: '%ab' } })).toResolveTruthy(); + }); + it('supports endsWith with field', async () => { const db = await createPolicyTestClient( ` diff --git a/tests/e2e/orm/schemas/auth-type/schema.ts b/tests/e2e/orm/schemas/auth-type/schema.ts index 5904569b9..c57c43903 100644 --- a/tests/e2e/orm/schemas/auth-type/schema.ts +++ b/tests/e2e/orm/schemas/auth-type/schema.ts @@ -6,11 +6,11 @@ /* eslint-disable */ import { type SchemaDef } from "@zenstackhq/orm/schema"; -const _schema = { - provider: { +export class SchemaType implements SchemaDef { + provider = { type: "sqlite" - }, - models: { + } as const; + models = { Foo: { name: "Foo", fields: { @@ -26,8 +26,8 @@ const _schema = { id: { type: "Int" } } } - }, - typeDefs: { + } as const; + typeDefs = { Permission: { name: "Permission", fields: { @@ -63,12 +63,8 @@ const _schema = { { name: "@@auth" } ] } - }, - authType: "Auth", - plugins: {} -} as const satisfies SchemaDef; -type Schema = typeof _schema & { - __brand?: "schema"; -}; -export const schema: Schema = _schema; -export type SchemaType = Schema; + } as const; + authType = "Auth" as const; + plugins = {}; +} +export const schema = new SchemaType(); diff --git a/tests/e2e/orm/schemas/basic/schema.ts b/tests/e2e/orm/schemas/basic/schema.ts index 3774b2070..5f067685e 100644 --- a/tests/e2e/orm/schemas/basic/schema.ts +++ b/tests/e2e/orm/schemas/basic/schema.ts @@ -6,11 +6,11 @@ /* eslint-disable */ import { type SchemaDef, ExpressionUtils } from "@zenstackhq/orm/schema"; -const _schema = { - provider: { +export class SchemaType implements SchemaDef { + provider = { type: "sqlite" - }, - models: { + } as const; + models = { User: { name: "User", fields: { @@ -247,8 +247,8 @@ const _schema = { userId: { type: "String" } } } - }, - typeDefs: { + } as const; + typeDefs = { CommonFields: { name: "CommonFields", fields: { @@ -272,20 +272,16 @@ const _schema = { } } } - }, - enums: { + } as const; + enums = { Role: { values: { ADMIN: "ADMIN", USER: "USER" } } - }, - authType: "User", - plugins: {} -} as const satisfies SchemaDef; -type Schema = typeof _schema & { - __brand?: "schema"; -}; -export const schema: Schema = _schema; -export type SchemaType = Schema; + } as const; + authType = "User" as const; + plugins = {}; +} +export const schema = new SchemaType(); diff --git a/tests/e2e/orm/schemas/basic/schema.zmodel b/tests/e2e/orm/schemas/basic/schema.zmodel index e6e2832b2..a831b827a 100644 --- a/tests/e2e/orm/schemas/basic/schema.zmodel +++ b/tests/e2e/orm/schemas/basic/schema.zmodel @@ -4,7 +4,7 @@ datasource db { } plugin policy { - provider = "../../dist/plugins/policy" + provider = '../../../../../packages/plugins/policy/plugin.zmodel' } enum Role { diff --git a/tests/e2e/orm/schemas/default-auth/schema.ts b/tests/e2e/orm/schemas/default-auth/schema.ts index c5610c0f8..986173e6a 100644 --- a/tests/e2e/orm/schemas/default-auth/schema.ts +++ b/tests/e2e/orm/schemas/default-auth/schema.ts @@ -6,11 +6,11 @@ /* eslint-disable */ import { type SchemaDef, ExpressionUtils } from "@zenstackhq/orm/schema"; -const _schema = { - provider: { +export class SchemaType implements SchemaDef { + provider = { type: "sqlite" - }, - models: { + } as const; + models = { User: { name: "User", fields: { @@ -115,12 +115,8 @@ const _schema = { id: { type: "Int" } } } - }, - authType: "User", - plugins: {} -} as const satisfies SchemaDef; -type Schema = typeof _schema & { - __brand?: "schema"; -}; -export const schema: Schema = _schema; -export type SchemaType = Schema; + } as const; + authType = "User" as const; + plugins = {}; +} +export const schema = new SchemaType(); diff --git a/tests/e2e/orm/schemas/delegate/schema.ts b/tests/e2e/orm/schemas/delegate/schema.ts index eaf1725ab..4ad907ed2 100644 --- a/tests/e2e/orm/schemas/delegate/schema.ts +++ b/tests/e2e/orm/schemas/delegate/schema.ts @@ -6,11 +6,11 @@ /* eslint-disable */ import { type SchemaDef, ExpressionUtils } from "@zenstackhq/orm/schema"; -const _schema = { - provider: { +export class SchemaType implements SchemaDef { + provider = { type: "sqlite" - }, - models: { + } as const; + models = { User: { name: "User", fields: { @@ -458,12 +458,8 @@ const _schema = { id: { type: "Int" } } } - }, - authType: "User", - plugins: {} -} as const satisfies SchemaDef; -type Schema = typeof _schema & { - __brand?: "schema"; -}; -export const schema: Schema = _schema; -export type SchemaType = Schema; + } as const; + authType = "User" as const; + plugins = {}; +} +export const schema = new SchemaType(); diff --git a/tests/e2e/orm/schemas/delegate/typecheck.ts b/tests/e2e/orm/schemas/delegate/typecheck.ts index c6ed453f2..9bf394766 100644 --- a/tests/e2e/orm/schemas/delegate/typecheck.ts +++ b/tests/e2e/orm/schemas/delegate/typecheck.ts @@ -16,15 +16,17 @@ async function find() { console.log(r.duration); // @ts-expect-error console.log(r.rating); - if (r.assetType === 'Video') { - // video - console.log(r.duration); - // only one choice `RatedVideo` - console.log(r.rating); - } else { - // image - console.log(r.format); - } + + // TODO: discriminated sub-model fields + // if (r.assetType === 'Video') { + // // video + // console.log(r.duration); + // // only one choice `RatedVideo` + // console.log(r.rating); + // } else { + // // image + // console.log(r.format); + // } // if fields are explicitly selected, then no sub-model fields are available const r1 = await client.asset.findFirstOrThrow({ @@ -49,15 +51,17 @@ async function find() { console.log(r2.assets[0]?.duration); // @ts-expect-error console.log(r2.assets[0]?.rating); - if (r2.assets[0]?.assetType === 'Video') { - // video - console.log(r2.assets[0]?.duration); - // only one choice `RatedVideo` - console.log(r2.assets[0]?.rating); - } else { - // image - console.log(r2.assets[0]?.format); - } + + // TODO: discriminated sub-model fields + // if (r2.assets[0]?.assetType === 'Video') { + // // video + // console.log(r2.assets[0]?.duration); + // // only one choice `RatedVideo` + // console.log(r2.assets[0]?.rating); + // } else { + // // image + // console.log(r2.assets[0]?.format); + // } // sub model behavior const r3 = await client.ratedVideo.findFirstOrThrow(); diff --git a/tests/e2e/orm/schemas/json/input.ts b/tests/e2e/orm/schemas/json/input.ts new file mode 100644 index 000000000..9564b7f27 --- /dev/null +++ b/tests/e2e/orm/schemas/json/input.ts @@ -0,0 +1,30 @@ +////////////////////////////////////////////////////////////////////////////////////////////// +// DO NOT MODIFY THIS FILE // +// This file is automatically generated by ZenStack CLI and should not be manually updated. // +////////////////////////////////////////////////////////////////////////////////////////////// + +/* eslint-disable */ + +import { type SchemaType as $Schema } from "./schema"; +import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, ClientOptions as $ClientOptions } from "@zenstackhq/orm"; +import type { SimplifiedModelResult as $SimplifiedModelResult, SelectIncludeOmit as $SelectIncludeOmit } from "@zenstackhq/orm"; +export type FooFindManyArgs = $FindManyArgs<$Schema, "Foo">; +export type FooFindUniqueArgs = $FindUniqueArgs<$Schema, "Foo">; +export type FooFindFirstArgs = $FindFirstArgs<$Schema, "Foo">; +export type FooCreateArgs = $CreateArgs<$Schema, "Foo">; +export type FooCreateManyArgs = $CreateManyArgs<$Schema, "Foo">; +export type FooCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Foo">; +export type FooUpdateArgs = $UpdateArgs<$Schema, "Foo">; +export type FooUpdateManyArgs = $UpdateManyArgs<$Schema, "Foo">; +export type FooUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "Foo">; +export type FooUpsertArgs = $UpsertArgs<$Schema, "Foo">; +export type FooDeleteArgs = $DeleteArgs<$Schema, "Foo">; +export type FooDeleteManyArgs = $DeleteManyArgs<$Schema, "Foo">; +export type FooCountArgs = $CountArgs<$Schema, "Foo">; +export type FooAggregateArgs = $AggregateArgs<$Schema, "Foo">; +export type FooGroupByArgs = $GroupByArgs<$Schema, "Foo">; +export type FooWhereInput = $WhereInput<$Schema, "Foo">; +export type FooSelect = $SelectInput<$Schema, "Foo">; +export type FooInclude = $IncludeInput<$Schema, "Foo">; +export type FooOmit = $OmitInput<$Schema, "Foo">; +export type FooGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "Foo", Options, Args>; diff --git a/tests/e2e/orm/schemas/json/models.ts b/tests/e2e/orm/schemas/json/models.ts new file mode 100644 index 000000000..24ea716d8 --- /dev/null +++ b/tests/e2e/orm/schemas/json/models.ts @@ -0,0 +1,10 @@ +////////////////////////////////////////////////////////////////////////////////////////////// +// DO NOT MODIFY THIS FILE // +// This file is automatically generated by ZenStack CLI and should not be manually updated. // +////////////////////////////////////////////////////////////////////////////////////////////// + +/* eslint-disable */ + +import { type SchemaType as $Schema } from "./schema"; +import { type ModelResult as $ModelResult } from "@zenstackhq/orm"; +export type Foo = $ModelResult<$Schema, "Foo">; diff --git a/tests/e2e/orm/schemas/json/schema.ts b/tests/e2e/orm/schemas/json/schema.ts new file mode 100644 index 000000000..b5537a9ff --- /dev/null +++ b/tests/e2e/orm/schemas/json/schema.ts @@ -0,0 +1,42 @@ +////////////////////////////////////////////////////////////////////////////////////////////// +// DO NOT MODIFY THIS FILE // +// This file is automatically generated by ZenStack CLI and should not be manually updated. // +////////////////////////////////////////////////////////////////////////////////////////////// + +/* eslint-disable */ + +import { type SchemaDef, ExpressionUtils } from "@zenstackhq/orm/schema"; +export class SchemaType implements SchemaDef { + provider = { + type: "sqlite" + } as const; + models = { + Foo: { + name: "Foo", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + data: { + name: "data", + type: "Json" + }, + data1: { + name: "data1", + type: "Json", + optional: true + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + } + } + } as const; + plugins = {}; +} +export const schema = new SchemaType(); diff --git a/tests/e2e/orm/schemas/json/schema.zmodel b/tests/e2e/orm/schemas/json/schema.zmodel new file mode 100644 index 000000000..95e42dbdd --- /dev/null +++ b/tests/e2e/orm/schemas/json/schema.zmodel @@ -0,0 +1,9 @@ +datasource db { + provider = "sqlite" +} + +model Foo { + id Int @id @default(autoincrement()) + data Json + data1 Json? +} diff --git a/tests/e2e/orm/schemas/name-mapping/schema.ts b/tests/e2e/orm/schemas/name-mapping/schema.ts index 6b154ed74..8e610ffd0 100644 --- a/tests/e2e/orm/schemas/name-mapping/schema.ts +++ b/tests/e2e/orm/schemas/name-mapping/schema.ts @@ -6,11 +6,11 @@ /* eslint-disable */ import { type SchemaDef, ExpressionUtils } from "@zenstackhq/orm/schema"; -const _schema = { - provider: { +export class SchemaType implements SchemaDef { + provider = { type: "sqlite" - }, - models: { + } as const; + models = { User: { name: "User", fields: { @@ -87,8 +87,8 @@ const _schema = { id: { type: "Int" } } } - }, - enums: { + } as const; + enums = { Role: { values: { USER: "USER", @@ -116,12 +116,8 @@ const _schema = { { name: "@@map", args: [{ name: "name", value: ExpressionUtils.literal("user_role") }] } ] } - }, - authType: "User", - plugins: {} -} as const satisfies SchemaDef; -type Schema = typeof _schema & { - __brand?: "schema"; -}; -export const schema: Schema = _schema; -export type SchemaType = Schema; + } as const; + authType = "User" as const; + plugins = {}; +} +export const schema = new SchemaType(); diff --git a/tests/e2e/orm/schemas/omit/schema.ts b/tests/e2e/orm/schemas/omit/schema.ts index 4543ccb71..60d51ad5c 100644 --- a/tests/e2e/orm/schemas/omit/schema.ts +++ b/tests/e2e/orm/schemas/omit/schema.ts @@ -6,11 +6,11 @@ /* eslint-disable */ import { type SchemaDef, ExpressionUtils } from "@zenstackhq/orm/schema"; -const _schema = { - provider: { +export class SchemaType implements SchemaDef { + provider = { type: "sqlite" - }, - models: { + } as const; + models = { User: { name: "User", fields: { @@ -131,12 +131,8 @@ const _schema = { id: { type: "Int" } } } - }, - authType: "User", - plugins: {} -} as const satisfies SchemaDef; -type Schema = typeof _schema & { - __brand?: "schema"; -}; -export const schema: Schema = _schema; -export type SchemaType = Schema; + } as const; + authType = "User" as const; + plugins = {}; +} +export const schema = new SchemaType(); diff --git a/tests/e2e/orm/schemas/petstore/schema.ts b/tests/e2e/orm/schemas/petstore/schema.ts index e3b9de6a8..795946d59 100644 --- a/tests/e2e/orm/schemas/petstore/schema.ts +++ b/tests/e2e/orm/schemas/petstore/schema.ts @@ -6,11 +6,11 @@ /* eslint-disable */ import { type SchemaDef, ExpressionUtils } from "@zenstackhq/orm/schema"; -const _schema = { - provider: { +export class SchemaType implements SchemaDef { + provider = { type: "sqlite" - }, - models: { + } as const; + models = { User: { name: "User", fields: { @@ -150,12 +150,8 @@ const _schema = { id: { type: "String" } } } - }, - authType: "User", - plugins: {} -} as const satisfies SchemaDef; -type Schema = typeof _schema & { - __brand?: "schema"; -}; -export const schema: Schema = _schema; -export type SchemaType = Schema; + } as const; + authType = "User" as const; + plugins = {}; +} +export const schema = new SchemaType(); diff --git a/tests/e2e/orm/schemas/petstore/schema.zmodel b/tests/e2e/orm/schemas/petstore/schema.zmodel index 8809445c8..52cd75054 100644 --- a/tests/e2e/orm/schemas/petstore/schema.zmodel +++ b/tests/e2e/orm/schemas/petstore/schema.zmodel @@ -3,12 +3,8 @@ datasource db { url = 'file:./petstore.db' } -generator js { - provider = 'prisma-client-js' -} - -plugin zod { - provider = '@core/zod' +plugin policy { + provider = '../../../../../packages/plugins/policy/plugin.zmodel' } model User { diff --git a/tests/e2e/orm/schemas/todo/todo.zmodel b/tests/e2e/orm/schemas/todo/todo.zmodel index faeaa660a..af8d89fde 100644 --- a/tests/e2e/orm/schemas/todo/todo.zmodel +++ b/tests/e2e/orm/schemas/todo/todo.zmodel @@ -7,8 +7,8 @@ datasource db { url = ':memory:' } -generator js { - provider = 'prisma-client-js' +plugin policy { + provider = '../../../../../packages/plugins/policy/plugin.zmodel' } /* diff --git a/tests/e2e/orm/schemas/typed-json/input.ts b/tests/e2e/orm/schemas/typed-json/input.ts new file mode 100644 index 000000000..028c2d157 --- /dev/null +++ b/tests/e2e/orm/schemas/typed-json/input.ts @@ -0,0 +1,30 @@ +////////////////////////////////////////////////////////////////////////////////////////////// +// DO NOT MODIFY THIS FILE // +// This file is automatically generated by ZenStack CLI and should not be manually updated. // +////////////////////////////////////////////////////////////////////////////////////////////// + +/* eslint-disable */ + +import { type SchemaType as $Schema } from "./schema"; +import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, ClientOptions as $ClientOptions } from "@zenstackhq/orm"; +import type { SimplifiedModelResult as $SimplifiedModelResult, SelectIncludeOmit as $SelectIncludeOmit } from "@zenstackhq/orm"; +export type UserFindManyArgs = $FindManyArgs<$Schema, "User">; +export type UserFindUniqueArgs = $FindUniqueArgs<$Schema, "User">; +export type UserFindFirstArgs = $FindFirstArgs<$Schema, "User">; +export type UserCreateArgs = $CreateArgs<$Schema, "User">; +export type UserCreateManyArgs = $CreateManyArgs<$Schema, "User">; +export type UserCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "User">; +export type UserUpdateArgs = $UpdateArgs<$Schema, "User">; +export type UserUpdateManyArgs = $UpdateManyArgs<$Schema, "User">; +export type UserUpdateManyAndReturnArgs = $UpdateManyAndReturnArgs<$Schema, "User">; +export type UserUpsertArgs = $UpsertArgs<$Schema, "User">; +export type UserDeleteArgs = $DeleteArgs<$Schema, "User">; +export type UserDeleteManyArgs = $DeleteManyArgs<$Schema, "User">; +export type UserCountArgs = $CountArgs<$Schema, "User">; +export type UserAggregateArgs = $AggregateArgs<$Schema, "User">; +export type UserGroupByArgs = $GroupByArgs<$Schema, "User">; +export type UserWhereInput = $WhereInput<$Schema, "User">; +export type UserSelect = $SelectInput<$Schema, "User">; +export type UserInclude = $IncludeInput<$Schema, "User">; +export type UserOmit = $OmitInput<$Schema, "User">; +export type UserGetPayload, Options extends $ClientOptions<$Schema> = $ClientOptions<$Schema>> = $SimplifiedModelResult<$Schema, "User", Options, Args>; diff --git a/tests/e2e/orm/schemas/typed-json/models.ts b/tests/e2e/orm/schemas/typed-json/models.ts new file mode 100644 index 000000000..2b2474faa --- /dev/null +++ b/tests/e2e/orm/schemas/typed-json/models.ts @@ -0,0 +1,15 @@ +////////////////////////////////////////////////////////////////////////////////////////////// +// DO NOT MODIFY THIS FILE // +// This file is automatically generated by ZenStack CLI and should not be manually updated. // +////////////////////////////////////////////////////////////////////////////////////////////// + +/* eslint-disable */ + +import { schema as $schema, type SchemaType as $Schema } from "./schema"; +import { type ModelResult as $ModelResult, type TypeDefResult as $TypeDefResult } from "@zenstackhq/orm"; +export type User = $ModelResult<$Schema, "User">; +export type Profile = $TypeDefResult<$Schema, "Profile">; +export type Address = $TypeDefResult<$Schema, "Address">; +export type Job = $TypeDefResult<$Schema, "Job">; +export const Gender = $schema.enums.Gender.values; +export type Gender = (typeof Gender)[keyof typeof Gender]; diff --git a/tests/e2e/orm/schemas/typed-json/schema.ts b/tests/e2e/orm/schemas/typed-json/schema.ts new file mode 100644 index 000000000..11be6f901 --- /dev/null +++ b/tests/e2e/orm/schemas/typed-json/schema.ts @@ -0,0 +1,106 @@ +////////////////////////////////////////////////////////////////////////////////////////////// +// DO NOT MODIFY THIS FILE // +// This file is automatically generated by ZenStack CLI and should not be manually updated. // +////////////////////////////////////////////////////////////////////////////////////////////// + +/* eslint-disable */ + +import { type SchemaDef, ExpressionUtils } from "@zenstackhq/orm/schema"; +export class SchemaType implements SchemaDef { + provider = { + type: "sqlite" + } as const; + models = { + User: { + name: "User", + fields: { + id: { + name: "id", + type: "Int", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("autoincrement") }] }], + default: ExpressionUtils.call("autoincrement") + }, + profile: { + name: "profile", + type: "Profile", + attributes: [{ name: "@json" }] + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "Int" } + } + } + } as const; + typeDefs = { + Profile: { + name: "Profile", + fields: { + age: { + name: "age", + type: "Int" + }, + name: { + name: "name", + type: "String" + }, + gender: { + name: "gender", + type: "Gender", + optional: true + }, + jobs: { + name: "jobs", + type: "Job", + array: true + }, + address: { + name: "address", + type: "Address", + optional: true + }, + tags: { + name: "tags", + type: "String", + optional: true, + array: true + } + } + }, + Address: { + name: "Address", + fields: { + country: { + name: "country", + type: "String" + }, + zip: { + name: "zip", + type: "String", + optional: true + } + } + }, + Job: { + name: "Job", + fields: { + title: { + name: "title", + type: "String" + } + } + } + } as const; + enums = { + Gender: { + values: { + MALE: "MALE", + FEMALE: "FEMALE" + } + } + } as const; + authType = "User" as const; + plugins = {}; +} +export const schema = new SchemaType(); diff --git a/tests/e2e/orm/schemas/typed-json/schema.zmodel b/tests/e2e/orm/schemas/typed-json/schema.zmodel new file mode 100644 index 000000000..0c4fdc75c --- /dev/null +++ b/tests/e2e/orm/schemas/typed-json/schema.zmodel @@ -0,0 +1,32 @@ +datasource db { + provider = "sqlite" + url = "file:./dev.db" +} + +model User { + id Int @id @default(autoincrement()) + profile Profile @json +} + +enum Gender { + MALE + FEMALE +} + +type Profile { + age Int + name String + gender Gender? + jobs Job[] + address Address? + tags String[]? +} + +type Address { + country String + zip String? +} + +type Job { + title String +} diff --git a/tests/e2e/orm/schemas/typing/schema.ts b/tests/e2e/orm/schemas/typing/schema.ts index 57da73ec5..a558c23c6 100644 --- a/tests/e2e/orm/schemas/typing/schema.ts +++ b/tests/e2e/orm/schemas/typing/schema.ts @@ -6,11 +6,11 @@ /* eslint-disable */ import { type SchemaDef, type OperandExpression, ExpressionUtils } from "@zenstackhq/orm/schema"; -const _schema = { - provider: { +export class SchemaType implements SchemaDef { + provider = { type: "postgresql" - }, - models: { + } as const; + models = { User: { name: "User", fields: { @@ -299,8 +299,8 @@ const _schema = { postId: { type: "Int" } } } - }, - typeDefs: { + } as const; + typeDefs = { Identity: { name: "Identity", fields: { @@ -325,8 +325,8 @@ const _schema = { } } } - }, - enums: { + } as const; + enums = { Role: { values: { ADMIN: "ADMIN", @@ -340,12 +340,8 @@ const _schema = { BANNED: "BANNED" } } - }, - authType: "User", - plugins: {} -} as const satisfies SchemaDef; -type Schema = typeof _schema & { - __brand?: "schema"; -}; -export const schema: Schema = _schema; -export type SchemaType = Schema; + } as const; + authType = "User" as const; + plugins = {}; +} +export const schema = new SchemaType(); diff --git a/tests/e2e/package.json b/tests/e2e/package.json index 2160f3f78..f72d9e565 100644 --- a/tests/e2e/package.json +++ b/tests/e2e/package.json @@ -1,11 +1,11 @@ { "name": "e2e", - "version": "3.0.0-beta.27", + "version": "3.0.0-beta.28", "private": true, "type": "module", "scripts": { "build": "pnpm test:generate && pnpm test:typecheck", - "test:generate": "tsx scripts/generate.ts", + "test:generate": "tsx ../../scripts/test-generate.ts", "test:typecheck": "tsc --noEmit", "test": "vitest run", "test:sqlite": "TEST_DB_PROVIDER=sqlite vitest run", diff --git a/tests/e2e/scripts/generate.ts b/tests/e2e/scripts/generate.ts deleted file mode 100644 index 9d01fbe4c..000000000 --- a/tests/e2e/scripts/generate.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { loadDocument } from '@zenstackhq/language'; -import type { Model } from '@zenstackhq/language/ast'; -import { TsSchemaGenerator } from '@zenstackhq/sdk'; -import { glob } from 'glob'; -import path from 'node:path'; -import { fileURLToPath } from 'node:url'; - -const dir = path.dirname(fileURLToPath(import.meta.url)); - -async function main() { - const zmodelFiles = [ - ...glob.sync(path.resolve(dir, '../orm/schemas/**/*.zmodel')), - ...glob.sync(path.resolve(dir, '../apps/**/schema.zmodel')), - ]; - for (const file of zmodelFiles) { - console.log(`Generating TS schema for: ${file}`); - await generate(file); - } -} - -async function generate(schemaPath: string) { - const generator = new TsSchemaGenerator(); - const outDir = path.dirname(schemaPath); - - // isomorphic __dirname - const _dirname = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url)); - - // plugin models - const pluginDocs = [path.resolve(_dirname, '../node_modules/@zenstackhq/plugin-policy/plugin.zmodel')]; - - const result = await loadDocument(schemaPath, pluginDocs); - if (!result.success) { - throw new Error(`Failed to load schema from ${schemaPath}: ${result.errors}`); - } - await generator.generate(result.model as Model, { outDir }); -} - -main(); diff --git a/tests/e2e/tsconfig.json b/tests/e2e/tsconfig.json index 6d8efbee8..22b23e0c9 100644 --- a/tests/e2e/tsconfig.json +++ b/tests/e2e/tsconfig.json @@ -3,6 +3,6 @@ "compilerOptions": { "noEmit": true, "noImplicitAny": false, - "types": ["@zenstackhq/testtools/types"] + "types": ["@zenstackhq/testtools/types", "node"] } } diff --git a/tests/regression/generate.ts b/tests/regression/generate.ts deleted file mode 100644 index 1a0959ed1..000000000 --- a/tests/regression/generate.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { loadDocument } from '@zenstackhq/language'; -import { TsSchemaGenerator } from '@zenstackhq/sdk'; -import { glob } from 'glob'; -import path from 'node:path'; -import { fileURLToPath } from 'node:url'; - -const dir = path.dirname(fileURLToPath(import.meta.url)); - -async function main() { - const zmodelFiles = glob.sync(path.resolve(dir, './test/**/*.zmodel')); - for (const file of zmodelFiles) { - console.log(`Generating TS schema for: ${file}`); - await generate(file); - } -} - -async function generate(schemaPath: string) { - const generator = new TsSchemaGenerator(); - const outDir = path.dirname(schemaPath); - const result = await loadDocument(schemaPath); - if (!result.success) { - throw new Error(`Failed to load schema from ${schemaPath}: ${result.errors}`); - } - await generator.generate(result.model, { outDir }); -} - -main(); diff --git a/tests/regression/package.json b/tests/regression/package.json index b1de33819..2cb125016 100644 --- a/tests/regression/package.json +++ b/tests/regression/package.json @@ -1,10 +1,10 @@ { "name": "regression", - "version": "3.0.0-beta.27", + "version": "3.0.0-beta.28", "private": true, "type": "module", "scripts": { - "generate": "tsx generate.ts", + "generate": "tsx ../../scripts/test-generate.ts ./test", "test": "pnpm generate && tsc && vitest run" }, "dependencies": { diff --git a/tests/regression/test/issue-422/schema.ts b/tests/regression/test/issue-422/schema.ts index 587f70aa2..212279b05 100644 --- a/tests/regression/test/issue-422/schema.ts +++ b/tests/regression/test/issue-422/schema.ts @@ -6,11 +6,11 @@ /* eslint-disable */ import { type SchemaDef, ExpressionUtils } from "@zenstackhq/orm/schema"; -const _schema = { - provider: { +export class SchemaType implements SchemaDef { + provider = { type: "sqlite" - }, - models: { + } as const; + models = { Session: { name: "Session", fields: { @@ -111,12 +111,8 @@ const _schema = { userId: { type: "String" } } } - }, - authType: "Session", - plugins: {} -} as const satisfies SchemaDef; -type Schema = typeof _schema & { - __brand?: "schema"; -}; -export const schema: Schema = _schema; -export type SchemaType = Schema; + } as const; + authType = "Session" as const; + plugins = {}; +} +export const schema = new SchemaType(); diff --git a/tests/regression/test/v2-migrated/issue-1647.test.ts b/tests/regression/test/v2-migrated/issue-1647.test.ts index faebabed2..f1d92ac55 100644 --- a/tests/regression/test/v2-migrated/issue-1647.test.ts +++ b/tests/regression/test/v2-migrated/issue-1647.test.ts @@ -29,11 +29,6 @@ describe.skip('Regression for issue 1647', () => { schemas = ['public', 'post'] } - generator client { - provider = 'prisma-client-js' - previewFeatures = ['multiSchema'] - } - model Asset { id Int @id type String diff --git a/tests/regression/test/v2-migrated/issue-756.test.ts b/tests/regression/test/v2-migrated/issue-756.test.ts index ae56f1302..bd304579c 100644 --- a/tests/regression/test/v2-migrated/issue-756.test.ts +++ b/tests/regression/test/v2-migrated/issue-756.test.ts @@ -5,10 +5,6 @@ describe('Regression for issue #756', () => { it('verifies issue 756', async () => { await loadSchemaWithError( ` - generator client { - provider = "prisma-client-js" - } - datasource db { provider = "postgresql" url = env("DATABASE_URL") diff --git a/tests/regression/test/v2-migrated/issue-804.test.ts b/tests/regression/test/v2-migrated/issue-804.test.ts index 8eb349e27..776a8896c 100644 --- a/tests/regression/test/v2-migrated/issue-804.test.ts +++ b/tests/regression/test/v2-migrated/issue-804.test.ts @@ -5,10 +5,6 @@ describe('Regression for issue #804', () => { it('verifies issue 804', async () => { await loadSchemaWithError( ` - generator client { - provider = "prisma-client-js" - } - datasource db { provider = "postgresql" url = env("DATABASE_URL") diff --git a/tests/regression/tsconfig.json b/tests/regression/tsconfig.json index 1dd80744b..989395683 100644 --- a/tests/regression/tsconfig.json +++ b/tests/regression/tsconfig.json @@ -4,5 +4,5 @@ "noEmit": true, "types": ["@zenstackhq/testtools/types", "node"] }, - "include": ["src/**/*.ts", "test/**/*.ts"] + "include": ["test/**/*.ts"] } diff --git a/tests/runtimes/bun/package.json b/tests/runtimes/bun/package.json index a5a29b3d5..987712fe5 100644 --- a/tests/runtimes/bun/package.json +++ b/tests/runtimes/bun/package.json @@ -1,11 +1,11 @@ { "name": "bun-e2e", - "version": "3.0.0-beta.27", + "version": "3.0.0-beta.28", "private": true, "type": "module", "scripts": { "build": "pnpm test:generate && pnpm test:typecheck", - "test:generate": "tsx scripts/generate.ts", + "test:generate": "RUNTIME=bun tsx ../../../scripts/test-generate.ts", "test:typecheck": "tsc --noEmit", "test": "bun test" }, diff --git a/tests/runtimes/bun/schemas/schema.ts b/tests/runtimes/bun/schemas/schema.ts index b7d3bfcdb..199c89967 100644 --- a/tests/runtimes/bun/schemas/schema.ts +++ b/tests/runtimes/bun/schemas/schema.ts @@ -6,11 +6,11 @@ /* eslint-disable */ import { type SchemaDef, ExpressionUtils } from "@zenstackhq/orm/schema"; -const _schema = { - provider: { +export class SchemaType implements SchemaDef { + provider = { type: "sqlite" - }, - models: { + } as const; + models = { User: { name: "User", fields: { @@ -93,12 +93,8 @@ const _schema = { id: { type: "String" } } } - }, - authType: "User", - plugins: {} -} as const satisfies SchemaDef; -type Schema = typeof _schema & { - __brand?: "schema"; -}; -export const schema: Schema = _schema; -export type SchemaType = Schema; + } as const; + authType = "User" as const; + plugins = {}; +} +export const schema = new SchemaType(); diff --git a/tests/runtimes/bun/scripts/generate.ts b/tests/runtimes/bun/scripts/generate.ts deleted file mode 100644 index 09a2ac233..000000000 --- a/tests/runtimes/bun/scripts/generate.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { glob } from 'glob'; -import { execSync } from 'node:child_process'; -import path from 'node:path'; -import { fileURLToPath } from 'node:url'; - -const dir = path.dirname(fileURLToPath(import.meta.url)); - -async function main() { - const zmodelFiles = [...glob.sync(path.resolve(dir, '../schemas/*.zmodel'))]; - for (const file of zmodelFiles) { - console.log(`Generating TS schema for: ${file}`); - await generate(file); - } -} - -async function generate(schemaPath: string) { - execSync('bunx --bun zen generate', { cwd: path.dirname(schemaPath) }); -} - -main(); diff --git a/tests/runtimes/edge-runtime/package.json b/tests/runtimes/edge-runtime/package.json index 324a21ca5..fab9cd887 100644 --- a/tests/runtimes/edge-runtime/package.json +++ b/tests/runtimes/edge-runtime/package.json @@ -1,11 +1,11 @@ { "name": "edge-runtime-e2e", - "version": "3.0.0-beta.27", + "version": "3.0.0-beta.28", "private": true, "type": "module", "scripts": { "build": "pnpm test:generate && pnpm test:typecheck", - "test:generate": "tsx scripts/generate.ts", + "test:generate": "tsx ../../../scripts/test-generate.ts", "test:typecheck": "tsc --noEmit", "test": "vitest run" }, diff --git a/tests/runtimes/edge-runtime/schemas/schema.ts b/tests/runtimes/edge-runtime/schemas/schema.ts index 7f4436f87..13425189b 100644 --- a/tests/runtimes/edge-runtime/schemas/schema.ts +++ b/tests/runtimes/edge-runtime/schemas/schema.ts @@ -6,11 +6,11 @@ /* eslint-disable */ import { type SchemaDef, ExpressionUtils } from "@zenstackhq/orm/schema"; -const _schema = { - provider: { +export class SchemaType implements SchemaDef { + provider = { type: "postgresql" - }, - models: { + } as const; + models = { User: { name: "User", fields: { @@ -93,12 +93,8 @@ const _schema = { id: { type: "String" } } } - }, - authType: "User", - plugins: {} -} as const satisfies SchemaDef; -type Schema = typeof _schema & { - __brand?: "schema"; -}; -export const schema: Schema = _schema; -export type SchemaType = Schema; + } as const; + authType = "User" as const; + plugins = {}; +} +export const schema = new SchemaType(); diff --git a/tests/runtimes/edge-runtime/scripts/generate.ts b/tests/runtimes/edge-runtime/scripts/generate.ts deleted file mode 100644 index cd68f93b5..000000000 --- a/tests/runtimes/edge-runtime/scripts/generate.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { glob } from 'glob'; -import { execSync } from 'node:child_process'; -import path from 'node:path'; -import { fileURLToPath } from 'node:url'; - -const dir = path.dirname(fileURLToPath(import.meta.url)); - -async function main() { - const zmodelFiles = [...glob.sync(path.resolve(dir, '../schemas/*.zmodel'))]; - for (const file of zmodelFiles) { - console.log(`Generating TS schema for: ${file}`); - await generate(file); - } -} - -async function generate(schemaPath: string) { - execSync('npx zen generate', { cwd: path.dirname(schemaPath) }); -} - -main();