@tailor-platform/sdk 1.54.2 → 1.55.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/{actor-Cjae_LGD.d.mts → actor-J2gJ0eK5.d.mts} +2 -2
  3. package/dist/application-DM8q9GDI.mjs +4 -0
  4. package/dist/{application-BfGje3iZ.mjs → application-DzUlASfA.mjs} +333 -4
  5. package/dist/application-DzUlASfA.mjs.map +1 -0
  6. package/dist/brand-DlnJ375c.mjs.map +1 -1
  7. package/dist/cli/index.mjs +5 -5
  8. package/dist/cli/index.mjs.map +1 -1
  9. package/dist/cli/lib.d.mts +1334 -176
  10. package/dist/cli/lib.mjs +3 -3
  11. package/dist/{client-CGO7gniI.mjs → client-DLPEPJ_s.mjs} +24 -19
  12. package/dist/client-DLPEPJ_s.mjs.map +1 -0
  13. package/dist/{client-yfFdZU9s.mjs → client-DrzwCD1W.mjs} +1 -1
  14. package/dist/configure/index.d.mts +5 -4
  15. package/dist/configure/index.mjs +48 -2
  16. package/dist/configure/index.mjs.map +1 -1
  17. package/dist/{crashreport-DGdAgX8Y.mjs → crashreport-Bm2mN5tg.mjs} +2 -2
  18. package/dist/{crashreport-DGdAgX8Y.mjs.map → crashreport-Bm2mN5tg.mjs.map} +1 -1
  19. package/dist/{crashreport-DnwIxpzF.mjs → crashreport-C5oHvHUC.mjs} +1 -1
  20. package/dist/{index-qQYMbkT-.d.mts → index-BE-fpxIo.d.mts} +2 -2
  21. package/dist/{index-BTLgs0DP.d.mts → index-BLsnrEtc.d.mts} +97 -5
  22. package/dist/{index-DrYHpTja.d.mts → index-D9xG-a6Y.d.mts} +2 -2
  23. package/dist/{index-CyyoHrPK.d.mts → index-S6-FtUpA.d.mts} +2 -2
  24. package/dist/{index-Cf1Lo_XT.d.mts → index-cHqh66cF.d.mts} +2 -2
  25. package/dist/plugin/builtin/enum-constants/index.d.mts +1 -1
  26. package/dist/plugin/builtin/file-utils/index.d.mts +1 -1
  27. package/dist/plugin/builtin/kysely-type/index.d.mts +1 -1
  28. package/dist/plugin/builtin/seed/index.d.mts +1 -1
  29. package/dist/plugin/index.d.mts +2 -2
  30. package/dist/plugin-BuE5ZOnW.d.mts +634 -0
  31. package/dist/{runtime-DLFzjgEo.mjs → runtime-BZsl7Mh9.mjs} +320 -155
  32. package/dist/runtime-BZsl7Mh9.mjs.map +1 -0
  33. package/dist/{schema-CQrYG_55.mjs → schema-DKsNhbav.mjs} +5 -3
  34. package/dist/{schema-CQrYG_55.mjs.map → schema-DKsNhbav.mjs.map} +1 -1
  35. package/dist/seed-DfLyRh63.mjs.map +1 -1
  36. package/dist/tailordb-BlBGmQK-.d.mts +863 -0
  37. package/dist/utils/test/index.d.mts +3 -3
  38. package/dist/vitest/index.d.mts +25 -1
  39. package/dist/vitest/index.mjs +57 -12
  40. package/dist/vitest/index.mjs.map +1 -1
  41. package/dist/{workflow.generated-dBixCwUo.d.mts → workflow.generated-CQg1_Ami.d.mts} +185 -8
  42. package/docs/services/http-adapter.md +100 -0
  43. package/package.json +1 -1
  44. package/dist/application-BfGje3iZ.mjs.map +0 -1
  45. package/dist/application-BsipSxp3.mjs +0 -4
  46. package/dist/client-CGO7gniI.mjs.map +0 -1
  47. package/dist/runtime-DLFzjgEo.mjs.map +0 -1
  48. package/dist/tailor-db-field-D0qg8s4U.d.mts +0 -1639
@@ -1,1639 +0,0 @@
1
- import { n as TailorEnv } from "./env-B-g-qgE4.mjs";
2
- import { IsAny, JsonObject, NonEmptyObject } from "type-fest";
3
-
4
- //#region src/types/helpers.d.ts
5
- type Prettify<T> = { [K in keyof T as string extends K ? never : K]: T[K] } & {};
6
- type DeepWritable<T> = T extends Date | RegExp | Function ? T : T extends object ? { -readonly [P in keyof T]: DeepWritable<T[P]> } & {} : T;
7
- type output<T> = T extends {
8
- _output: infer U;
9
- } ? DeepWritable<U> : never;
10
- type NullableToOptional<T> = { [K in keyof T as null extends T[K] ? never : K]: T[K] } & { [K in keyof T as null extends T[K] ? K : never]?: T[K] };
11
- type InferFieldsOutput<F extends Record<string, {
12
- _output: any;
13
- [key: string]: any;
14
- }>> = DeepWritable<Prettify<NullableToOptional<{ [K in keyof F]: output<F[K]> }>>>;
15
- type JsonValue = string | number | boolean | null | JsonValue[] | {
16
- [key: string]: JsonValue;
17
- };
18
- /**
19
- * A looser version of JsonValue that accepts interfaces.
20
- * TypeScript interfaces don't have index signatures by default, so they can't
21
- * be assigned to JsonValue's `{ [key: string]: JsonValue }`. This type uses a
22
- * recursive structural check instead.
23
- *
24
- * Rejection rules:
25
- * - Functions are rejected (top-level or as property values).
26
- * - Objects with a `toJSON` method are rejected (can't faithfully round-trip).
27
- * - Class instances that expose methods are rejected via the property walk
28
- * (methods are function-typed properties, which resolve to `never`).
29
- *
30
- * Limitation: class instances whose declared type has only data properties
31
- * (for example `Error`, or user-defined DTO classes) are structurally
32
- * indistinguishable from plain objects and cannot be rejected here. The
33
- * platform performs the authoritative check at runtime.
34
- */
35
- type JsonCompatible<T> = T extends string | number | boolean | null | undefined ? T : T extends readonly (infer U)[] ? JsonCompatible<U>[] : T extends Function ? never : T extends object ? T extends {
36
- toJSON: () => unknown;
37
- } ? never : { [K in keyof T]: JsonCompatible<T[K]> } : never;
38
- //#endregion
39
- //#region src/types/user.d.ts
40
- interface AttributeMap {}
41
- interface AttributeList {
42
- __tuple?: [];
43
- }
44
- type InferredAttributeMap = keyof AttributeMap extends never ? Record<string, string | string[] | boolean | boolean[] | undefined> : AttributeMap;
45
- type InferredAttributeList = AttributeList["__tuple"] extends [] ? string[] : AttributeList["__tuple"];
46
- /** Represents a user in the Tailor platform. */
47
- type TailorUser = {
48
- /**
49
- * The ID of the user.
50
- * For unauthenticated users, this will be a nil UUID.
51
- */
52
- id: string;
53
- /**
54
- * The type of the user.
55
- * For unauthenticated users, this will be an empty string.
56
- */
57
- type: "user" | "machine_user" | ""; /** The ID of the workspace the user belongs to. */
58
- workspaceId: string;
59
- /**
60
- * A map of the user's attributes.
61
- * For unauthenticated users, this will be null.
62
- */
63
- attributes: InferredAttributeMap | null;
64
- /**
65
- * A list of the user's attributes.
66
- * For unauthenticated users, this will be an empty array.
67
- */
68
- attributeList: InferredAttributeList;
69
- };
70
- /** Represents an unauthenticated user in the Tailor platform. */
71
- declare const unauthenticatedTailorUser: TailorUser;
72
- /**
73
- * The invoker of the current function execution.
74
- *
75
- * Reflects `authInvoker` delegation: when `authInvoker` is specified, this is
76
- * the machine user; otherwise it is the calling user.
77
- * Distinct from resolver's `user` (the authenticated caller) and executor's
78
- * `actor` (the subject of the event).
79
- *
80
- * `null` for anonymous requests.
81
- *
82
- * TODO(v2): unify with `TailorUser` — same underlying principal shape.
83
- */
84
- type TailorInvoker = {
85
- /** The ID of the invoker (user ID or machine user ID). */id: string; /** The type of the invoker. */
86
- type: "user" | "machine_user"; /** The ID of the workspace the invoker belongs to. */
87
- workspaceId: string; /** A map of the invoker's attributes. */
88
- attributes: InferredAttributeMap; /** A list of the invoker's attribute IDs. */
89
- attributeList: InferredAttributeList;
90
- } | null;
91
- //#endregion
92
- //#region src/types/validation.d.ts
93
- /**
94
- * Validation function type
95
- */
96
- type ValidateFn<O, D = unknown> = (args: {
97
- value: O;
98
- data: D;
99
- user: TailorUser;
100
- }) => boolean;
101
- /**
102
- * Validation configuration with custom error message
103
- */
104
- type ValidateConfig<O, D = unknown> = [ValidateFn<O, D>, string];
105
- /**
106
- * Field-level validation function
107
- */
108
- type FieldValidateFn<O> = ValidateFn<O>;
109
- /**
110
- * Field-level validation configuration
111
- */
112
- type FieldValidateConfig<O> = ValidateConfig<O>;
113
- /**
114
- * Input type for field validation - can be either a function or a tuple of [function, errorMessage]
115
- */
116
- type FieldValidateInput<O> = FieldValidateFn<O> | FieldValidateConfig<O>;
117
- /**
118
- * Base validators type for field collections
119
- * @template F - Record of fields
120
- * @template ExcludeKeys - Keys to exclude from validation (default: "id" for TailorDB)
121
- */
122
- type ValidatorsBase<F extends Record<string, {
123
- _defined: any;
124
- _output: any;
125
- [key: string]: any;
126
- }>, ExcludeKeys extends string = "id"> = NonEmptyObject<{ [K in Exclude<keyof F, ExcludeKeys> as F[K]["_defined"] extends {
127
- validate: unknown;
128
- } ? never : K]?: ValidateFn<output<F[K]>, InferFieldsOutput<F>> | ValidateConfig<output<F[K]>, InferFieldsOutput<F>> | (ValidateFn<output<F[K]>, InferFieldsOutput<F>> | ValidateConfig<output<F[K]>, InferFieldsOutput<F>>)[] }>;
129
- /**
130
- * Validators type (by default excludes "id" field for TailorDB compatibility)
131
- * Can be used with both TailorField and TailorDBField
132
- */
133
- type Validators<F extends Record<string, {
134
- _defined: any;
135
- _output: any;
136
- [key: string]: any;
137
- }>> = ValidatorsBase<F, "id">;
138
- //#endregion
139
- //#region src/types/field-types.d.ts
140
- interface EnumValue {
141
- value: string;
142
- description?: string;
143
- }
144
- type TailorFieldType = "uuid" | "string" | "boolean" | "integer" | "float" | "decimal" | "enum" | "date" | "datetime" | "time" | "nested";
145
- type TailorToTs = {
146
- string: string;
147
- integer: number;
148
- float: number;
149
- decimal: string;
150
- boolean: boolean;
151
- uuid: string;
152
- date: string;
153
- datetime: string | Date;
154
- time: string;
155
- enum: string;
156
- object: Record<string, unknown>;
157
- nested: Record<string, unknown>;
158
- } & Record<TailorFieldType, unknown>;
159
- interface FieldMetadata {
160
- description?: string;
161
- required?: boolean;
162
- array?: boolean;
163
- allowedValues?: EnumValue[];
164
- validate?: FieldValidateInput<any>[];
165
- typeName?: string;
166
- }
167
- interface DefinedFieldMetadata {
168
- type: TailorFieldType;
169
- array: boolean;
170
- description?: boolean;
171
- validate?: boolean;
172
- typeName?: boolean;
173
- }
174
- type FieldOptions = {
175
- optional?: boolean;
176
- array?: boolean;
177
- };
178
- type FieldOutput$1<T, O extends FieldOptions> = OptionalFieldOutput<ArrayFieldOutput<T, O>, O>;
179
- type OptionalFieldOutput<T, O extends FieldOptions> = O["optional"] extends true ? T | null : T;
180
- type ArrayFieldOutput<T, O extends FieldOptions> = [O] extends [{
181
- array: true;
182
- }] ? T[] : T;
183
- //#endregion
184
- //#region src/types/auth.generated.d.ts
185
- type AuthInvokerObject = {
186
- /** Auth namespace */namespace: string; /** Machine user name for authentication */
187
- machineUserName: string;
188
- };
189
- type AuthInvoker = AuthInvokerObject;
190
- type OIDC = {
191
- /** Identity provider name */name: string;
192
- kind: "OIDC"; /** OAuth2 client ID */
193
- clientID: string; /** OAuth2 client secret */
194
- clientSecret: {
195
- vaultName: string;
196
- secretKey: string;
197
- }; /** OIDC provider URL */
198
- providerURL: string; /** OIDC issuer URL (defaults to providerURL) */
199
- issuerURL?: string | undefined; /** JWT claim to use as username */
200
- usernameClaim?: string | undefined;
201
- };
202
- type SAML = {
203
- /** Identity provider name */name: string;
204
- kind: "SAML"; /** Enable signing of SAML requests */
205
- enableSignRequest: boolean; /** URL to fetch SAML metadata (mutually exclusive with rawMetadata) */
206
- metadataURL?: string | undefined; /** Raw SAML metadata XML (mutually exclusive with metadataURL) */
207
- rawMetadata?: string | undefined; /** URL to redirect to when SAML ACS receives a response with an empty RelayState. */
208
- defaultRedirectURL?: string | undefined;
209
- };
210
- type IDToken = {
211
- /** Identity provider name */name: string;
212
- kind: "IDToken"; /** ID token provider URL */
213
- providerURL: string; /** Client ID for ID token validation */
214
- clientID: string; /** ID token issuer URL */
215
- issuerURL?: string | undefined; /** JWT claim to use as username */
216
- usernameClaim?: string | undefined;
217
- };
218
- type BuiltinIdP = {
219
- /** Identity provider name */name: string;
220
- kind: "BuiltInIdP"; /** IdP namespace */
221
- namespace: string; /** OAuth2 client name in the IdP */
222
- clientName: string;
223
- };
224
- type IdProvider = OIDC | SAML | IDToken | BuiltinIdP;
225
- type OAuth2ClientInput = {
226
- /** Allowed redirect URIs */redirectURIs: (`https://${string}` | `http://${string}` | `${string}:url` | `${string}:url/${string}`)[]; /** Client description */
227
- description?: string | undefined; /** Allowed OAuth2 grant types */
228
- grantTypes?: ("authorization_code" | "refresh_token")[] | undefined; /** OAuth2 client type */
229
- clientType?: "confidential" | "public" | "browser" | undefined; /** Access token lifetime in seconds (60-86400) */
230
- accessTokenLifetimeSeconds?: number | undefined; /** Refresh token lifetime in seconds (60-604800) */
231
- refreshTokenLifetimeSeconds?: number | undefined; /** Require DPoP (Demonstrating Proof-of-Possession) for token requests */
232
- requireDpop?: boolean | undefined;
233
- };
234
- type OAuth2Client = {
235
- /** Allowed OAuth2 grant types */grantTypes: ("authorization_code" | "refresh_token")[]; /** Allowed redirect URIs */
236
- redirectURIs: (`https://${string}` | `http://${string}` | `${string}:url` | `${string}:url/${string}`)[]; /** Access token lifetime in seconds (60-86400) */
237
- accessTokenLifetimeSeconds: {
238
- seconds: bigint;
239
- nanos: number;
240
- } | undefined; /** Refresh token lifetime in seconds (60-604800) */
241
- refreshTokenLifetimeSeconds: {
242
- seconds: bigint;
243
- nanos: number;
244
- } | undefined; /** Client description */
245
- description?: string | undefined; /** OAuth2 client type */
246
- clientType?: "confidential" | "public" | "browser" | undefined; /** Require DPoP (Demonstrating Proof-of-Possession) for token requests */
247
- requireDpop?: boolean | undefined;
248
- };
249
- type SCIMAuthorization = {
250
- /** SCIM authorization type */type: "oauth2" | "bearer"; /** Bearer token secret (required for bearer type) */
251
- bearerSecret?: {
252
- vaultName: string;
253
- secretKey: string;
254
- } | undefined;
255
- };
256
- type SCIMAttribute = {
257
- /** Attribute data type */type: "string" | "number" | "boolean" | "datetime" | "complex"; /** Attribute name */
258
- name: string; /** Attribute description */
259
- description?: string | undefined; /** Attribute mutability */
260
- mutability?: "readOnly" | "readWrite" | "writeOnly" | undefined; /** Whether the attribute is required */
261
- required?: boolean | undefined; /** Whether the attribute can have multiple values */
262
- multiValued?: boolean | undefined; /** Uniqueness constraint */
263
- uniqueness?: "none" | "server" | "global" | undefined; /** List of canonical values */
264
- canonicalValues?: string[] | null | undefined;
265
- subAttributes?: SCIMAttribute[] | null | undefined;
266
- };
267
- type SCIMAttributeMapping = {
268
- /** TailorDB field name to map to */tailorDBField: string; /** SCIM attribute path */
269
- scimPath: string;
270
- };
271
- type SCIMResource = {
272
- /** SCIM resource name */name: string; /** TailorDB namespace for the resource */
273
- tailorDBNamespace: string; /** TailorDB type name for the resource */
274
- tailorDBType: string; /** Core SCIM schema definition */
275
- coreSchema: {
276
- /** SCIM resource name */name: string;
277
- attributes: {
278
- type: "string" | "number" | "boolean" | "datetime" | "complex"; /** SCIM resource name */
279
- name: string;
280
- description?: string | undefined;
281
- mutability?: "readOnly" | "readWrite" | "writeOnly" | undefined;
282
- required?: boolean | undefined;
283
- multiValued?: boolean | undefined;
284
- uniqueness?: "none" | "server" | "global" | undefined;
285
- canonicalValues?: string[] | null | undefined;
286
- subAttributes?: any[] | null | undefined;
287
- }[];
288
- }; /** Attribute mapping configuration */
289
- attributeMapping: {
290
- tailorDBField: string;
291
- scimPath: string;
292
- }[];
293
- };
294
- type SCIMConfig = {
295
- /** Machine user name for SCIM operations */machineUserName: string; /** SCIM authorization configuration */
296
- authorization: {
297
- type: "oauth2" | "bearer";
298
- bearerSecret?: {
299
- vaultName: string;
300
- secretKey: string;
301
- } | undefined;
302
- }; /** SCIM resource definitions */
303
- resources: {
304
- name: string;
305
- tailorDBNamespace: string;
306
- tailorDBType: string;
307
- coreSchema: {
308
- name: string;
309
- attributes: {
310
- type: "string" | "number" | "boolean" | "datetime" | "complex";
311
- name: string;
312
- description?: string | undefined;
313
- mutability?: "readOnly" | "readWrite" | "writeOnly" | undefined;
314
- required?: boolean | undefined;
315
- multiValued?: boolean | undefined;
316
- uniqueness?: "none" | "server" | "global" | undefined;
317
- canonicalValues?: string[] | null | undefined;
318
- subAttributes?: any[] | null | undefined;
319
- }[];
320
- };
321
- attributeMapping: {
322
- tailorDBField: string;
323
- scimPath: string;
324
- }[];
325
- }[];
326
- };
327
- type TenantProvider = {
328
- /** TailorDB namespace for the tenant type */namespace: string; /** TailorDB type name for tenants */
329
- type: string; /** Field used as the tenant signature */
330
- signatureField: string;
331
- };
332
- //#endregion
333
- //#region src/types/executor.generated.d.ts
334
- type TailorDBTrigger = {
335
- /** TailorDB record event trigger */kind: "tailordb"; /** TailorDB event types to trigger on */
336
- events: ("tailordb.type_record.created" | "tailordb.type_record.updated" | "tailordb.type_record.deleted")[]; /** TailorDB type name to watch for events */
337
- typeName: string; /** Condition function to filter events */
338
- condition?: Function | undefined;
339
- };
340
- type ResolverExecutedTrigger = {
341
- kind: "resolverExecuted"; /** Name of the resolver to trigger on */
342
- resolverName: string; /** Condition function to filter events */
343
- condition?: Function | undefined;
344
- };
345
- type ScheduleTriggerInput = {
346
- kind: "schedule"; /** CRON expression for the schedule */
347
- cron: string; /** Timezone for the CRON schedule (default: UTC) */
348
- timezone?: string | undefined;
349
- };
350
- type IncomingWebhookTrigger = {
351
- kind: "incomingWebhook"; /** Response configuration */
352
- response?: {
353
- body?: Function | undefined;
354
- statusCode?: number | undefined;
355
- } | undefined;
356
- };
357
- type IdpUserTrigger = {
358
- /** IdP user event trigger */kind: "idpUser"; /** IdP user event types to trigger on */
359
- events: ("idp.user.created" | "idp.user.updated" | "idp.user.deleted")[]; /** IdP namespace name to subscribe to. If omitted, the project's only IdP is used; throws when multiple IdPs exist. */
360
- idp?: string | undefined;
361
- };
362
- type AuthAccessTokenTrigger = {
363
- /** Auth access token event trigger */kind: "authAccessToken"; /** Auth access token event types to trigger on */
364
- events: ("auth.access_token.issued" | "auth.access_token.refreshed" | "auth.access_token.revoked")[];
365
- };
366
- type FunctionOperation = {
367
- kind: "function" | "jobFunction"; /** Function implementation */
368
- body: Function; /** Auth invoker for the function execution */
369
- authInvoker?: string | {
370
- namespace: string;
371
- machineUserName: string;
372
- } | undefined;
373
- };
374
- type GqlOperation = {
375
- kind: "graphql";
376
- query: string; /** Target application name for the GraphQL query */
377
- appName?: string | undefined; /** Function to compute GraphQL variables */
378
- variables?: Function | undefined; /** Auth invoker for the GraphQL execution */
379
- authInvoker?: string | {
380
- namespace: string;
381
- machineUserName: string;
382
- } | undefined;
383
- };
384
- type WebhookOperation = {
385
- kind: "webhook"; /** Function returning the webhook URL */
386
- url: Function; /** Function to compute the request body */
387
- requestBody?: Function | undefined; /** HTTP headers for the webhook request */
388
- headers?: {
389
- [x: string]: string | {
390
- vault: string;
391
- key: string;
392
- };
393
- } | undefined;
394
- };
395
- type WorkflowOperation = {
396
- kind: "workflow";
397
- workflowName: string;
398
- args?: Function | {
399
- [x: string]: unknown;
400
- } | undefined;
401
- authInvoker?: string | {
402
- namespace: string;
403
- machineUserName: string;
404
- } | undefined;
405
- };
406
- type ExecutorInput = {
407
- /** Executor name */name: string; /** Event trigger configuration */
408
- trigger: {
409
- kind: "tailordb";
410
- events: ("tailordb.type_record.created" | "tailordb.type_record.updated" | "tailordb.type_record.deleted")[];
411
- typeName: string;
412
- condition?: Function | undefined;
413
- } | {
414
- kind: "resolverExecuted";
415
- resolverName: string;
416
- condition?: Function | undefined;
417
- } | {
418
- kind: "schedule";
419
- cron: string;
420
- timezone?: string | undefined;
421
- } | {
422
- kind: "incomingWebhook";
423
- response?: {
424
- body?: Function | undefined;
425
- statusCode?: number | undefined;
426
- } | undefined;
427
- } | {
428
- kind: "idpUser";
429
- events: ("idp.user.created" | "idp.user.updated" | "idp.user.deleted")[];
430
- idp?: string | undefined;
431
- } | {
432
- kind: "authAccessToken";
433
- events: ("auth.access_token.issued" | "auth.access_token.refreshed" | "auth.access_token.revoked")[];
434
- }; /** Operation to execute when triggered */
435
- operation: unknown; /** Executor description */
436
- description?: string | undefined; /** Whether the executor is disabled */
437
- disabled?: boolean | undefined;
438
- };
439
- type Executor = {
440
- /** Executor name */name: string; /** Whether the executor is disabled */
441
- disabled: boolean; /** Event trigger configuration */
442
- trigger: {
443
- kind: "tailordb";
444
- events: ("tailordb.type_record.created" | "tailordb.type_record.updated" | "tailordb.type_record.deleted")[];
445
- typeName: string;
446
- condition?: Function | undefined;
447
- } | {
448
- kind: "resolverExecuted";
449
- resolverName: string;
450
- condition?: Function | undefined;
451
- } | {
452
- kind: "schedule";
453
- cron: string;
454
- timezone: string;
455
- } | {
456
- kind: "incomingWebhook";
457
- response?: {
458
- body?: Function | undefined;
459
- statusCode?: number | undefined;
460
- } | undefined;
461
- } | {
462
- kind: "idpUser";
463
- events: ("idp.user.created" | "idp.user.updated" | "idp.user.deleted")[];
464
- idp?: string | undefined;
465
- } | {
466
- kind: "authAccessToken";
467
- events: ("auth.access_token.issued" | "auth.access_token.refreshed" | "auth.access_token.revoked")[];
468
- }; /** Operation to execute when triggered */
469
- operation: {
470
- kind: "workflow";
471
- workflowName: string;
472
- args?: Function | {
473
- [x: string]: unknown;
474
- } | undefined;
475
- authInvoker?: string | {
476
- namespace: string;
477
- machineUserName: string;
478
- } | undefined;
479
- } | {
480
- kind: "function" | "jobFunction";
481
- body: Function;
482
- authInvoker?: string | {
483
- namespace: string;
484
- machineUserName: string;
485
- } | undefined;
486
- } | {
487
- kind: "graphql";
488
- query: string;
489
- appName?: string | undefined;
490
- variables?: Function | undefined;
491
- authInvoker?: string | {
492
- namespace: string;
493
- machineUserName: string;
494
- } | undefined;
495
- } | {
496
- kind: "webhook";
497
- url: Function;
498
- requestBody?: Function | undefined;
499
- headers?: {
500
- [x: string]: string | {
501
- vault: string;
502
- key: string;
503
- };
504
- } | undefined;
505
- }; /** Executor description */
506
- description?: string | undefined;
507
- };
508
- //#endregion
509
- //#region src/types/generator-config.generated.d.ts
510
- type BaseGeneratorConfig = ["@tailor-platform/kysely-type", {
511
- distPath: string;
512
- }] | ["@tailor-platform/seed", {
513
- distPath: string;
514
- machineUserName?: string | undefined;
515
- disableIdpUserSync?: {
516
- userToIdp?: boolean | undefined;
517
- idpToUser?: boolean | undefined;
518
- } | undefined;
519
- }] | ["@tailor-platform/enum-constants", {
520
- distPath: string;
521
- }] | ["@tailor-platform/file-utils", {
522
- distPath: string;
523
- }] | {
524
- id: string;
525
- description: string;
526
- dependencies: ("tailordb" | "resolver" | "executor")[];
527
- aggregate: Function;
528
- processType?: Function | undefined;
529
- processResolver?: Function | undefined;
530
- processExecutor?: Function | undefined;
531
- processTailorDBNamespace?: Function | undefined;
532
- processResolverNamespace?: Function | undefined;
533
- };
534
- type BaseGeneratorConfigInput = BaseGeneratorConfig;
535
- //#endregion
536
- //#region src/types/generator-config.d.ts
537
- type GeneratorConfig = BaseGeneratorConfigInput;
538
- //#endregion
539
- //#region src/types/resolver.generated.d.ts
540
- type Resolver = {
541
- /** GraphQL operation type (query or mutation) */operation: "query" | "mutation"; /** Resolver name */
542
- name: string; /** Resolver implementation function */
543
- body: Function; /** Output field definition */
544
- output: {
545
- type: "string" | "boolean" | "date" | "enum" | "uuid" | "integer" | "float" | "decimal" | "datetime" | "time" | "nested";
546
- metadata: {
547
- required?: boolean | undefined;
548
- array?: boolean | undefined; /** Resolver description */
549
- description?: string | undefined;
550
- allowedValues?: {
551
- value: string; /** Resolver description */
552
- description?: string | undefined;
553
- }[] | undefined;
554
- hooks?: {
555
- create?: Function | undefined;
556
- update?: Function | undefined;
557
- } | undefined;
558
- typeName?: string | undefined;
559
- };
560
- fields: {
561
- [x: string]: any;
562
- };
563
- }; /** Resolver description */
564
- description?: string | undefined; /** Input field definitions */
565
- input?: {
566
- [x: string]: any;
567
- } | undefined; /** Enable publishing events from this resolver */
568
- publishEvents?: boolean | undefined; /** Machine user to execute this resolver as */
569
- authInvoker?: string | {
570
- namespace: string;
571
- machineUserName: string;
572
- } | undefined;
573
- };
574
- type ResolverInput = Resolver;
575
- //#endregion
576
- //#region src/types/auth-connection.generated.d.ts
577
- type AuthConnectionOAuth2Config = {
578
- /** OAuth2 provider URL */providerUrl: string; /** OAuth2 issuer URL */
579
- issuerUrl: string; /** OAuth2 client ID */
580
- clientId: string; /** OAuth2 client secret */
581
- clientSecret: string; /** OAuth2 authorization endpoint override */
582
- authUrl?: string | undefined; /** OAuth2 token endpoint override */
583
- tokenUrl?: string | undefined;
584
- };
585
- type AuthConnectionConfig = {
586
- type: "oauth2";
587
- providerUrl: string;
588
- issuerUrl: string;
589
- clientId: string;
590
- clientSecret: string;
591
- authUrl?: string | undefined;
592
- tokenUrl?: string | undefined;
593
- };
594
- //#endregion
595
- //#region src/types/tailor-field.d.ts
596
- /**
597
- * Minimal structural interface for TailorField.
598
- * Defines only the properties needed by parser, plugin, cli, and types layers.
599
- * The full interface with builder methods (description, typeName, validate, parse)
600
- * is defined in configure/types/type.ts.
601
- */
602
- interface TailorField<Defined extends DefinedFieldMetadata = DefinedFieldMetadata, Output = any, M extends FieldMetadata = FieldMetadata, T extends TailorFieldType = TailorFieldType> {
603
- readonly type: T;
604
- readonly fields: Record<string, TailorAnyField>;
605
- readonly _defined: Defined;
606
- readonly _output: Output;
607
- readonly metadata: M;
608
- }
609
- type TailorAnyField = TailorField<any>;
610
- //#endregion
611
- //#region src/types/auth.d.ts
612
- type OAuth2ClientGrantType = OAuth2Client["grantTypes"][number];
613
- type SCIMAttributeType = SCIMAttribute["type"];
614
- type AuthInvokerWithName<M extends string> = Omit<AuthInvoker, "machineUserName"> & {
615
- machineUserName: M;
616
- };
617
- /** Result of retrieving a connection token at runtime. */
618
- type AuthConnectionTokenResult = {
619
- access_token: string;
620
- refresh_token?: string;
621
- token_type?: string;
622
- expiry?: string;
623
- };
624
- type ValueOperand = string | boolean | string[] | boolean[];
625
- type AuthAttributeValue = ValueOperand | null | undefined;
626
- type UserFieldKeys<User extends TailorDBInstance> = keyof output<User> & string;
627
- type FieldDefined<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = User["fields"][Key] extends {
628
- _defined: infer Defined;
629
- } ? Defined : never;
630
- type FieldOutput<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = output<User>[Key];
631
- type FieldIsRequired<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = undefined extends FieldOutput<User, Key> ? false : true;
632
- type FieldIsOfType<User extends TailorDBInstance, Key extends UserFieldKeys<User>, Type extends string> = FieldDefined<User, Key> extends {
633
- type: Type;
634
- } ? true : false;
635
- type FieldIsArray<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = FieldDefined<User, Key> extends {
636
- array: true;
637
- } ? true : false;
638
- type FieldIsUnique<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = FieldDefined<User, Key> extends {
639
- unique: true;
640
- } ? true : false;
641
- type FieldSupportsValueOperand<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = FieldOutput<User, Key> extends ValueOperand | null | undefined ? true : false;
642
- type UsernameFieldKey<User extends TailorDBInstance> = IsAny<User> extends true ? string : { [K in UserFieldKeys<User>]: FieldIsRequired<User, K> extends true ? FieldIsOfType<User, K, "string"> extends true ? FieldIsArray<User, K> extends true ? never : FieldIsUnique<User, K> extends true ? K : never : never : never }[UserFieldKeys<User>];
643
- type UserAttributeKey<User extends TailorDBInstance> = { [K in UserFieldKeys<User>]: K extends "id" ? never : FieldSupportsValueOperand<User, K> extends true ? FieldIsOfType<User, K, "datetime" | "date" | "time"> extends true ? never : K : never }[UserFieldKeys<User>];
644
- type UserAttributeListKey<User extends TailorDBInstance> = { [K in UserFieldKeys<User>]: K extends "id" ? never : FieldIsOfType<User, K, "uuid"> extends true ? FieldIsArray<User, K> extends true ? never : K : never }[UserFieldKeys<User>];
645
- type UserAttributeMap<User extends TailorDBInstance> = { [K in UserAttributeKey<User>]?: true };
646
- type DisallowExtraKeys<T, Allowed extends PropertyKey> = T & { [K in Exclude<keyof T, Allowed>]: never };
647
- type AttributeListValue<User extends TailorDBInstance, Key extends UserAttributeListKey<User>> = Key extends keyof output<User> ? output<User>[Key] : never;
648
- type AttributeListToTuple<User extends TailorDBInstance, AttributeList extends readonly UserAttributeListKey<User>[]> = { [Index in keyof AttributeList]: AttributeList[Index] extends UserAttributeListKey<User> ? AttributeListValue<User, AttributeList[Index]> : never };
649
- type AttributeMapSelectedKeys<User extends TailorDBInstance, AttributeMap extends UserAttributeMap<User>> = Extract<{ [K in keyof AttributeMap]-?: undefined extends AttributeMap[K] ? never : K }[keyof AttributeMap], UserAttributeKey<User>>;
650
- type UserProfile<User extends TailorDBInstance, AttributeMap extends UserAttributeMap<User>, AttributeList extends UserAttributeListKey<User>[]> = {
651
- /**
652
- * TailorDB namespace where the user type is defined.
653
- *
654
- * Usually auto-resolved, so you don't need to specify this.
655
- * Required only when multiple TailorDBs exist and the type is in an external TailorDB.
656
- */
657
- namespace?: string;
658
- type: User;
659
- usernameField: UsernameFieldKey<User>;
660
- attributes?: DisallowExtraKeys<AttributeMap, UserAttributeKey<User>>;
661
- attributeList?: AttributeList;
662
- };
663
- type MachineUserAttributeFields = Record<string, TailorField<DefinedFieldMetadata, unknown, FieldMetadata, TailorFieldType>>;
664
- type TailorFieldOutputValue<Field> = Field extends TailorField<DefinedFieldMetadata, infer Output, FieldMetadata, TailorFieldType> ? Output : never;
665
- type MachineUserAttributeValues<Fields extends MachineUserAttributeFields> = { [K in keyof Fields]: TailorFieldOutputValue<Fields[K]> extends ValueOperand | null | undefined ? TailorFieldOutputValue<Fields[K]> : never };
666
- type MachineUserFromAttributes<Fields extends MachineUserAttributeFields> = (keyof Fields extends never ? {
667
- attributes?: never;
668
- } : {
669
- attributes: DisallowExtraKeys<MachineUserAttributeValues<Fields>, keyof Fields>;
670
- }) & {
671
- attributeList?: string[];
672
- };
673
- type MachineUser<User extends TailorDBInstance, AttributeMap extends UserAttributeMap<User> = UserAttributeMap<User>, AttributeList extends UserAttributeListKey<User>[] = [], MachineUserAttributes extends MachineUserAttributeFields | undefined = undefined> = IsAny<MachineUserAttributes> extends true ? IsAny<User> extends true ? {
674
- attributes: Record<string, AuthAttributeValue>;
675
- attributeList?: string[];
676
- } : (AttributeMapSelectedKeys<User, AttributeMap> extends never ? {
677
- attributes?: never;
678
- } : {
679
- attributes: { [K in AttributeMapSelectedKeys<User, AttributeMap>]: K extends keyof output<User> ? output<User>[K] : never } & { [K in Exclude<keyof output<User>, AttributeMapSelectedKeys<User, AttributeMap>>]?: never };
680
- }) & ([] extends AttributeList ? {
681
- attributeList?: never;
682
- } : {
683
- attributeList: AttributeListToTuple<User, AttributeList>;
684
- }) : [MachineUserAttributes] extends [MachineUserAttributeFields] ? MachineUserFromAttributes<MachineUserAttributes> : IsAny<User> extends true ? {
685
- attributes: Record<string, AuthAttributeValue>;
686
- attributeList?: string[];
687
- } : (AttributeMapSelectedKeys<User, AttributeMap> extends never ? {
688
- attributes?: never;
689
- } : {
690
- attributes: { [K in AttributeMapSelectedKeys<User, AttributeMap>]: K extends keyof output<User> ? output<User>[K] : never } & { [K in Exclude<keyof output<User>, AttributeMapSelectedKeys<User, AttributeMap>>]?: never };
691
- }) & ([] extends AttributeList ? {
692
- attributeList?: never;
693
- } : {
694
- attributeList: AttributeListToTuple<User, AttributeList>;
695
- });
696
- type BeforeLoginHookArgs = {
697
- claims: JsonObject;
698
- idpConfigName: string; /** Environment variables defined in `defineConfig({ env })`. */
699
- env: TailorEnv;
700
- };
701
- type BeforeLoginHook<MachineUserNames extends string> = {
702
- handler(args: BeforeLoginHookArgs): Promise<void>;
703
- invoker: NoInfer<MachineUserNames>;
704
- };
705
- type AuthHooks<MachineUserNames extends string> = {
706
- beforeLogin?: BeforeLoginHook<MachineUserNames>;
707
- };
708
- type AuthServiceInput<User extends TailorDBInstance, AttributeMap extends UserAttributeMap<User>, AttributeList extends UserAttributeListKey<User>[], MachineUserNames extends string, MachineUserAttributes extends MachineUserAttributeFields | undefined = MachineUserAttributeFields | undefined, ConnectionNames extends string = string> = {
709
- hooks?: AuthHooks<MachineUserNames>;
710
- userProfile?: UserProfile<User, AttributeMap, AttributeList>;
711
- machineUserAttributes?: MachineUserAttributes;
712
- machineUsers?: Record<MachineUserNames, MachineUser<User, AttributeMap, AttributeList, MachineUserAttributes>>;
713
- oauth2Clients?: Record<string, OAuth2ClientInput>;
714
- idProvider?: IdProvider;
715
- scim?: SCIMConfig;
716
- tenantProvider?: TenantProvider;
717
- connections?: Record<ConnectionNames, AuthConnectionConfig>;
718
- publishSessionEvents?: boolean;
719
- };
720
- declare const authDefinitionBrand: unique symbol;
721
- type AuthDefinitionBrand = {
722
- readonly [authDefinitionBrand]: true;
723
- };
724
- type ConnectionNames<Config> = Config extends {
725
- connections?: Record<infer K, unknown>;
726
- } ? K & string : string;
727
- type DefinedAuth<Name extends string, Config, MachineUserNames extends string> = Config & {
728
- name: Name;
729
- /**
730
- * @deprecated Pass the machine user name directly as a string instead, e.g. `authInvoker: "machine-user-name"`.
731
- * Using this function pulls config-layer (Node-only) dependencies into runtime bundles.
732
- */
733
- invoker<M extends MachineUserNames>(machineUser: M): AuthInvokerWithName<M>;
734
- getConnectionToken<C extends ConnectionNames<Config>>(connectionName: C): Promise<AuthConnectionTokenResult>;
735
- } & AuthDefinitionBrand;
736
- type AuthExternalConfig = {
737
- name: string;
738
- external: true;
739
- };
740
- type AuthServiceInputLoose = AuthServiceInput<any, any, any, string, any>;
741
- type AuthOwnConfig = DefinedAuth<string, AuthServiceInputLoose, string>;
742
- type AuthConfig = AuthOwnConfig | AuthExternalConfig;
743
- //#endregion
744
- //#region src/types/tailordb.generated.d.ts
745
- /**
746
- * Configuration for GraphQL operations on a TailorDB type.
747
- * All operations are enabled by default (undefined or true = enabled, false = disabled).
748
- */
749
- type GqlOperationsInput = "query" | {
750
- create?: boolean | undefined;
751
- update?: boolean | undefined;
752
- delete?: boolean | undefined;
753
- read?: boolean | undefined;
754
- };
755
- type DBFieldMetadata$1 = {
756
- /** Whether the field is required */required?: boolean | undefined; /** Whether the field is an array */
757
- array?: boolean | undefined; /** Field description */
758
- description?: string | undefined; /** Type name for nested or enum fields */
759
- typeName?: string | undefined; /** Allowed values for enum fields */
760
- allowedValues?: {
761
- value: string; /** Field description */
762
- description?: string | undefined;
763
- }[] | undefined; /** Whether the field is indexed for faster queries */
764
- index?: boolean | undefined; /** Whether the field value must be unique */
765
- unique?: boolean | undefined; /** Whether the field is a vector field for similarity search */
766
- vector?: boolean | undefined; /** Whether the field is a foreign key */
767
- foreignKey?: boolean | undefined; /** Target type name for foreign key relations */
768
- foreignKeyType?: string | undefined; /** Target field name for foreign key relations */
769
- foreignKeyField?: string | undefined; /** Lifecycle hooks for the field */
770
- hooks?: {
771
- create?: Function | undefined;
772
- update?: Function | undefined;
773
- } | undefined; /** Validation functions for the field */
774
- validate?: (Function | [Function, string])[] | undefined; /** Serial (auto-increment) configuration */
775
- serial?: {
776
- start: number;
777
- maxValue?: number | undefined;
778
- format?: string | undefined;
779
- } | undefined; /** Decimal scale (number of digits after decimal point, 0-12) */
780
- scale?: number | undefined;
781
- };
782
- type TailorDBTypeParsedSettings = {
783
- /** Custom plural form of the type name for GraphQL */pluralForm?: string | undefined; /** Enable aggregation queries for this type */
784
- aggregation?: boolean | undefined; /** Enable bulk upsert mutation for this type */
785
- bulkUpsert?: boolean | undefined; /** Configure GraphQL operations for this type. Use "query" for read-only mode, or an object for granular control. */
786
- gqlOperations?: {
787
- create?: boolean | undefined;
788
- update?: boolean | undefined;
789
- delete?: boolean | undefined;
790
- read?: boolean | undefined;
791
- } | undefined;
792
- /**
793
- * Enable publishing events for this type.
794
- * When enabled, record creation/update/deletion events are published.
795
- * If not specified, this is automatically set to true when an executor uses this type
796
- * with recordCreated/recordUpdated/recordDeleted triggers. If explicitly set to false
797
- * while an executor uses this type, an error will be thrown during apply.
798
- */
799
- publishEvents?: boolean | undefined;
800
- };
801
- type RawPermissions = {
802
- record?: {
803
- create: readonly (readonly [(string | boolean | string[] | boolean[] | {
804
- user: string;
805
- } | {
806
- record: string;
807
- } | {
808
- oldRecord: string;
809
- } | {
810
- newRecord: string;
811
- }), "=" | "!=" | "in" | "not in" | "hasAny" | "not hasAny", (string | boolean | string[] | boolean[] | {
812
- user: string;
813
- } | {
814
- record: string;
815
- } | {
816
- oldRecord: string;
817
- } | {
818
- newRecord: string;
819
- })] | readonly [(string | boolean | string[] | boolean[] | {
820
- user: string;
821
- } | {
822
- record: string;
823
- } | {
824
- oldRecord: string;
825
- } | {
826
- newRecord: string;
827
- }), "=" | "!=" | "in" | "not in" | "hasAny" | "not hasAny", (string | boolean | string[] | boolean[] | {
828
- user: string;
829
- } | {
830
- record: string;
831
- } | {
832
- oldRecord: string;
833
- } | {
834
- newRecord: string;
835
- }), boolean] | readonly (boolean | readonly [(string | boolean | string[] | boolean[] | {
836
- user: string;
837
- } | {
838
- record: string;
839
- } | {
840
- oldRecord: string;
841
- } | {
842
- newRecord: string;
843
- }), "=" | "!=" | "in" | "not in" | "hasAny" | "not hasAny", (string | boolean | string[] | boolean[] | {
844
- user: string;
845
- } | {
846
- record: string;
847
- } | {
848
- oldRecord: string;
849
- } | {
850
- newRecord: string;
851
- })])[] | {
852
- conditions: readonly [(string | boolean | string[] | boolean[] | {
853
- user: string;
854
- } | {
855
- record: string;
856
- } | {
857
- oldRecord: string;
858
- } | {
859
- newRecord: string;
860
- }), "=" | "!=" | "in" | "not in" | "hasAny" | "not hasAny", (string | boolean | string[] | boolean[] | {
861
- user: string;
862
- } | {
863
- record: string;
864
- } | {
865
- oldRecord: string;
866
- } | {
867
- newRecord: string;
868
- })] | readonly (readonly [(string | boolean | string[] | boolean[] | {
869
- user: string;
870
- } | {
871
- record: string;
872
- } | {
873
- oldRecord: string;
874
- } | {
875
- newRecord: string;
876
- }), "=" | "!=" | "in" | "not in" | "hasAny" | "not hasAny", (string | boolean | string[] | boolean[] | {
877
- user: string;
878
- } | {
879
- record: string;
880
- } | {
881
- oldRecord: string;
882
- } | {
883
- newRecord: string;
884
- })])[];
885
- description?: string | undefined;
886
- permit?: boolean | undefined;
887
- })[];
888
- read: readonly (readonly [(string | boolean | string[] | boolean[] | {
889
- user: string;
890
- } | {
891
- record: string;
892
- } | {
893
- oldRecord: string;
894
- } | {
895
- newRecord: string;
896
- }), "=" | "!=" | "in" | "not in" | "hasAny" | "not hasAny", (string | boolean | string[] | boolean[] | {
897
- user: string;
898
- } | {
899
- record: string;
900
- } | {
901
- oldRecord: string;
902
- } | {
903
- newRecord: string;
904
- })] | readonly [(string | boolean | string[] | boolean[] | {
905
- user: string;
906
- } | {
907
- record: string;
908
- } | {
909
- oldRecord: string;
910
- } | {
911
- newRecord: string;
912
- }), "=" | "!=" | "in" | "not in" | "hasAny" | "not hasAny", (string | boolean | string[] | boolean[] | {
913
- user: string;
914
- } | {
915
- record: string;
916
- } | {
917
- oldRecord: string;
918
- } | {
919
- newRecord: string;
920
- }), boolean] | readonly (boolean | readonly [(string | boolean | string[] | boolean[] | {
921
- user: string;
922
- } | {
923
- record: string;
924
- } | {
925
- oldRecord: string;
926
- } | {
927
- newRecord: string;
928
- }), "=" | "!=" | "in" | "not in" | "hasAny" | "not hasAny", (string | boolean | string[] | boolean[] | {
929
- user: string;
930
- } | {
931
- record: string;
932
- } | {
933
- oldRecord: string;
934
- } | {
935
- newRecord: string;
936
- })])[] | {
937
- conditions: readonly [(string | boolean | string[] | boolean[] | {
938
- user: string;
939
- } | {
940
- record: string;
941
- } | {
942
- oldRecord: string;
943
- } | {
944
- newRecord: string;
945
- }), "=" | "!=" | "in" | "not in" | "hasAny" | "not hasAny", (string | boolean | string[] | boolean[] | {
946
- user: string;
947
- } | {
948
- record: string;
949
- } | {
950
- oldRecord: string;
951
- } | {
952
- newRecord: string;
953
- })] | readonly (readonly [(string | boolean | string[] | boolean[] | {
954
- user: string;
955
- } | {
956
- record: string;
957
- } | {
958
- oldRecord: string;
959
- } | {
960
- newRecord: string;
961
- }), "=" | "!=" | "in" | "not in" | "hasAny" | "not hasAny", (string | boolean | string[] | boolean[] | {
962
- user: string;
963
- } | {
964
- record: string;
965
- } | {
966
- oldRecord: string;
967
- } | {
968
- newRecord: string;
969
- })])[];
970
- description?: string | undefined;
971
- permit?: boolean | undefined;
972
- })[];
973
- update: readonly (readonly [(string | boolean | string[] | boolean[] | {
974
- user: string;
975
- } | {
976
- record: string;
977
- } | {
978
- oldRecord: string;
979
- } | {
980
- newRecord: string;
981
- }), "=" | "!=" | "in" | "not in" | "hasAny" | "not hasAny", (string | boolean | string[] | boolean[] | {
982
- user: string;
983
- } | {
984
- record: string;
985
- } | {
986
- oldRecord: string;
987
- } | {
988
- newRecord: string;
989
- })] | readonly [(string | boolean | string[] | boolean[] | {
990
- user: string;
991
- } | {
992
- record: string;
993
- } | {
994
- oldRecord: string;
995
- } | {
996
- newRecord: string;
997
- }), "=" | "!=" | "in" | "not in" | "hasAny" | "not hasAny", (string | boolean | string[] | boolean[] | {
998
- user: string;
999
- } | {
1000
- record: string;
1001
- } | {
1002
- oldRecord: string;
1003
- } | {
1004
- newRecord: string;
1005
- }), boolean] | readonly (boolean | readonly [(string | boolean | string[] | boolean[] | {
1006
- user: string;
1007
- } | {
1008
- record: string;
1009
- } | {
1010
- oldRecord: string;
1011
- } | {
1012
- newRecord: string;
1013
- }), "=" | "!=" | "in" | "not in" | "hasAny" | "not hasAny", (string | boolean | string[] | boolean[] | {
1014
- user: string;
1015
- } | {
1016
- record: string;
1017
- } | {
1018
- oldRecord: string;
1019
- } | {
1020
- newRecord: string;
1021
- })])[] | {
1022
- conditions: readonly [(string | boolean | string[] | boolean[] | {
1023
- user: string;
1024
- } | {
1025
- record: string;
1026
- } | {
1027
- oldRecord: string;
1028
- } | {
1029
- newRecord: string;
1030
- }), "=" | "!=" | "in" | "not in" | "hasAny" | "not hasAny", (string | boolean | string[] | boolean[] | {
1031
- user: string;
1032
- } | {
1033
- record: string;
1034
- } | {
1035
- oldRecord: string;
1036
- } | {
1037
- newRecord: string;
1038
- })] | readonly (readonly [(string | boolean | string[] | boolean[] | {
1039
- user: string;
1040
- } | {
1041
- record: string;
1042
- } | {
1043
- oldRecord: string;
1044
- } | {
1045
- newRecord: string;
1046
- }), "=" | "!=" | "in" | "not in" | "hasAny" | "not hasAny", (string | boolean | string[] | boolean[] | {
1047
- user: string;
1048
- } | {
1049
- record: string;
1050
- } | {
1051
- oldRecord: string;
1052
- } | {
1053
- newRecord: string;
1054
- })])[];
1055
- description?: string | undefined;
1056
- permit?: boolean | undefined;
1057
- })[];
1058
- delete: readonly (readonly [(string | boolean | string[] | boolean[] | {
1059
- user: string;
1060
- } | {
1061
- record: string;
1062
- } | {
1063
- oldRecord: string;
1064
- } | {
1065
- newRecord: string;
1066
- }), "=" | "!=" | "in" | "not in" | "hasAny" | "not hasAny", (string | boolean | string[] | boolean[] | {
1067
- user: string;
1068
- } | {
1069
- record: string;
1070
- } | {
1071
- oldRecord: string;
1072
- } | {
1073
- newRecord: string;
1074
- })] | readonly [(string | boolean | string[] | boolean[] | {
1075
- user: string;
1076
- } | {
1077
- record: string;
1078
- } | {
1079
- oldRecord: string;
1080
- } | {
1081
- newRecord: string;
1082
- }), "=" | "!=" | "in" | "not in" | "hasAny" | "not hasAny", (string | boolean | string[] | boolean[] | {
1083
- user: string;
1084
- } | {
1085
- record: string;
1086
- } | {
1087
- oldRecord: string;
1088
- } | {
1089
- newRecord: string;
1090
- }), boolean] | readonly (boolean | readonly [(string | boolean | string[] | boolean[] | {
1091
- user: string;
1092
- } | {
1093
- record: string;
1094
- } | {
1095
- oldRecord: string;
1096
- } | {
1097
- newRecord: string;
1098
- }), "=" | "!=" | "in" | "not in" | "hasAny" | "not hasAny", (string | boolean | string[] | boolean[] | {
1099
- user: string;
1100
- } | {
1101
- record: string;
1102
- } | {
1103
- oldRecord: string;
1104
- } | {
1105
- newRecord: string;
1106
- })])[] | {
1107
- conditions: readonly [(string | boolean | string[] | boolean[] | {
1108
- user: string;
1109
- } | {
1110
- record: string;
1111
- } | {
1112
- oldRecord: string;
1113
- } | {
1114
- newRecord: string;
1115
- }), "=" | "!=" | "in" | "not in" | "hasAny" | "not hasAny", (string | boolean | string[] | boolean[] | {
1116
- user: string;
1117
- } | {
1118
- record: string;
1119
- } | {
1120
- oldRecord: string;
1121
- } | {
1122
- newRecord: string;
1123
- })] | readonly (readonly [(string | boolean | string[] | boolean[] | {
1124
- user: string;
1125
- } | {
1126
- record: string;
1127
- } | {
1128
- oldRecord: string;
1129
- } | {
1130
- newRecord: string;
1131
- }), "=" | "!=" | "in" | "not in" | "hasAny" | "not hasAny", (string | boolean | string[] | boolean[] | {
1132
- user: string;
1133
- } | {
1134
- record: string;
1135
- } | {
1136
- oldRecord: string;
1137
- } | {
1138
- newRecord: string;
1139
- })])[];
1140
- description?: string | undefined;
1141
- permit?: boolean | undefined;
1142
- })[];
1143
- } | undefined;
1144
- gql?: readonly {
1145
- conditions: readonly (readonly [(string | boolean | string[] | boolean[] | {
1146
- user: string;
1147
- }), "=" | "!=" | "in" | "not in" | "hasAny" | "not hasAny", (string | boolean | string[] | boolean[] | {
1148
- user: string;
1149
- })])[];
1150
- actions: "all" | readonly ("create" | "read" | "update" | "delete" | "aggregate" | "bulkUpsert")[];
1151
- permit?: boolean | undefined;
1152
- description?: string | undefined;
1153
- }[] | undefined;
1154
- };
1155
- type TailorDBServiceConfigInput = {
1156
- /** Glob patterns for TailorDB type definition files */files: string[]; /** Glob patterns to exclude from type discovery */
1157
- ignores?: string[] | undefined; /** URL for the ERD (Entity Relationship Diagram) site */
1158
- erdSite?: string | undefined; /** Migration configuration */
1159
- migration?: {
1160
- directory: string;
1161
- machineUser?: string | undefined;
1162
- } | undefined; /** Default GraphQL operations for all types in this service */
1163
- gqlOperations?: "query" | {
1164
- create?: boolean | undefined;
1165
- update?: boolean | undefined;
1166
- delete?: boolean | undefined;
1167
- read?: boolean | undefined;
1168
- } | undefined;
1169
- };
1170
- //#endregion
1171
- //#region src/types/tailordb.d.ts
1172
- type SerialConfig<T extends "string" | "integer" = "string" | "integer"> = Prettify<{
1173
- start: number;
1174
- maxValue?: number;
1175
- } & (T extends "string" ? {
1176
- format?: string;
1177
- } : object)>;
1178
- interface DBFieldMetadata extends FieldMetadata {
1179
- index?: boolean;
1180
- unique?: boolean;
1181
- vector?: boolean;
1182
- foreignKey?: boolean;
1183
- foreignKeyType?: string;
1184
- foreignKeyField?: string;
1185
- /** Lifecycle hooks for the field */
1186
- hooks?: DBFieldMetadata$1["hooks"];
1187
- serial?: SerialConfig;
1188
- relation?: boolean;
1189
- scale?: number;
1190
- }
1191
- interface DefinedDBFieldMetadata extends DefinedFieldMetadata {
1192
- index?: boolean;
1193
- unique?: boolean;
1194
- vector?: boolean;
1195
- foreignKey?: boolean;
1196
- foreignKeyType?: boolean;
1197
- validate?: boolean;
1198
- hooks?: {
1199
- create: boolean;
1200
- update: boolean;
1201
- };
1202
- serial?: boolean;
1203
- relation?: boolean;
1204
- }
1205
- type IndexDef<T extends {
1206
- fields: Record<PropertyKey, unknown>;
1207
- }> = {
1208
- fields: [keyof T["fields"], keyof T["fields"], ...(keyof T["fields"])[]];
1209
- unique?: boolean;
1210
- name?: string;
1211
- };
1212
- type GqlOperationsConfig = GqlOperationsInput;
1213
- type RelationType = "1-1" | "oneToOne" | "n-1" | "manyToOne" | "N-1" | "keyOnly";
1214
- type TailorDBExternalConfig = {
1215
- external: true;
1216
- };
1217
- type TailorDBServiceInput = {
1218
- [namespace: string]: TailorDBServiceConfigInput | TailorDBExternalConfig;
1219
- };
1220
- interface UserDefinedTypeSource {
1221
- filePath: string;
1222
- exportName: string;
1223
- pluginId?: never;
1224
- }
1225
- interface PluginGeneratedTypeSource {
1226
- filePath?: never;
1227
- exportName: string;
1228
- pluginId: string;
1229
- pluginImportPath: string;
1230
- originalFilePath: string;
1231
- originalExportName: string;
1232
- generatedTypeKind?: string;
1233
- pluginConfig?: unknown;
1234
- namespace?: string;
1235
- }
1236
- type TypeSourceInfoEntry = UserDefinedTypeSource | PluginGeneratedTypeSource;
1237
- interface Script {
1238
- expr: string;
1239
- }
1240
- interface OperatorValidateConfig {
1241
- script: Script;
1242
- errorMessage: string;
1243
- }
1244
- interface OperatorFieldHook {
1245
- create?: Script;
1246
- update?: Script;
1247
- }
1248
- interface RawRelationConfig {
1249
- type: "1-1" | "n-1" | "keyOnly" | "oneToOne" | "manyToOne" | "N-1";
1250
- toward: {
1251
- type: string;
1252
- as?: string;
1253
- key?: string;
1254
- };
1255
- backward?: string;
1256
- }
1257
- interface OperatorFieldConfig {
1258
- type: string;
1259
- required?: boolean;
1260
- description?: string;
1261
- allowedValues?: EnumValue[];
1262
- array?: boolean;
1263
- index?: boolean;
1264
- unique?: boolean;
1265
- vector?: boolean;
1266
- foreignKey?: boolean;
1267
- foreignKeyType?: string;
1268
- foreignKeyField?: string;
1269
- rawRelation?: RawRelationConfig;
1270
- validate?: OperatorValidateConfig[];
1271
- hooks?: OperatorFieldHook;
1272
- serial?: {
1273
- start: number;
1274
- maxValue?: number;
1275
- format?: string;
1276
- };
1277
- scale?: number;
1278
- fields?: Record<string, OperatorFieldConfig>;
1279
- }
1280
- type GqlPermissionAction = "read" | "create" | "update" | "delete" | "aggregate" | "bulkUpsert";
1281
- type StandardPermissionOperator = "eq" | "ne" | "in" | "nin" | "hasAny" | "nhasAny";
1282
- type UserOperand = {
1283
- user: string;
1284
- };
1285
- type StandardRecordOperand<Update extends boolean = false> = Update extends true ? {
1286
- oldRecord: string;
1287
- } | {
1288
- newRecord: string;
1289
- } : {
1290
- record: string;
1291
- };
1292
- type PermissionOperand<Level extends "record" | "gql" = "record" | "gql", Update extends boolean = boolean> = UserOperand | ValueOperand | (Level extends "record" ? StandardRecordOperand<Update> : never);
1293
- type StandardPermissionCondition<Level extends "record" | "gql" = "record" | "gql", Update extends boolean = boolean> = readonly [PermissionOperand<Level, Update>, StandardPermissionOperator, PermissionOperand<Level, Update>];
1294
- type StandardActionPermission<Level extends "record" | "gql" = "record" | "gql", Update extends boolean = boolean> = {
1295
- conditions: readonly StandardPermissionCondition<Level, Update>[];
1296
- description?: string;
1297
- permit: "allow" | "deny";
1298
- };
1299
- type StandardTailorTypePermission = {
1300
- create: readonly StandardActionPermission<"record", false>[];
1301
- read: readonly StandardActionPermission<"record", false>[];
1302
- update: readonly StandardActionPermission<"record", true>[];
1303
- delete: readonly StandardActionPermission<"record", false>[];
1304
- };
1305
- type StandardGqlPermissionPolicy = {
1306
- conditions: readonly StandardPermissionCondition<"gql">[];
1307
- actions: readonly ["all"] | readonly GqlPermissionAction[];
1308
- permit: "allow" | "deny";
1309
- description?: string;
1310
- };
1311
- type StandardTailorTypeGqlPermission = readonly StandardGqlPermissionPolicy[];
1312
- interface Permissions {
1313
- record?: StandardTailorTypePermission;
1314
- gql?: StandardTailorTypeGqlPermission;
1315
- }
1316
- interface TailorDBTypeMetadata {
1317
- name: string;
1318
- description?: string;
1319
- settings?: {
1320
- pluralForm?: string;
1321
- aggregation?: boolean;
1322
- bulkUpsert?: boolean;
1323
- gqlOperations?: GqlOperationsConfig;
1324
- publishEvents?: boolean;
1325
- };
1326
- permissions: RawPermissions;
1327
- files: Record<string, string>;
1328
- indexes?: Record<string, {
1329
- fields: string[];
1330
- unique?: boolean;
1331
- }>;
1332
- }
1333
- interface ParsedField {
1334
- name: string;
1335
- config: OperatorFieldConfig;
1336
- relation?: {
1337
- targetType: string;
1338
- forwardName: string;
1339
- backwardName: string;
1340
- key: string;
1341
- unique: boolean;
1342
- };
1343
- }
1344
- interface ParsedRelationship {
1345
- name: string;
1346
- targetType: string;
1347
- targetField: string;
1348
- sourceField: string;
1349
- isArray: boolean;
1350
- description: string;
1351
- }
1352
- interface TailorDBType$1 {
1353
- name: string;
1354
- pluralForm: string;
1355
- description?: string;
1356
- fields: Record<string, ParsedField>;
1357
- forwardRelationships: Record<string, ParsedRelationship>;
1358
- backwardRelationships: Record<string, ParsedRelationship>;
1359
- settings: TailorDBTypeParsedSettings;
1360
- permissions: Permissions;
1361
- indexes?: TailorDBTypeMetadata["indexes"];
1362
- files?: TailorDBTypeMetadata["files"];
1363
- }
1364
- //#endregion
1365
- //#region src/types/plugin-generation.d.ts
1366
- /**
1367
- * A single generated file to write to disk.
1368
- */
1369
- interface GeneratedFile {
1370
- path: string;
1371
- content: string;
1372
- skipIfExists?: boolean;
1373
- executable?: boolean;
1374
- }
1375
- /**
1376
- * Result returned by generation-time hooks.
1377
- */
1378
- interface GeneratorResult {
1379
- files: GeneratedFile[];
1380
- errors?: string[];
1381
- }
1382
- /**
1383
- * Auth configuration available to generation-time hooks.
1384
- */
1385
- interface GeneratorAuthInput {
1386
- name: string;
1387
- userProfile?: {
1388
- typeName: string;
1389
- namespace: string;
1390
- usernameField: string;
1391
- };
1392
- machineUsers?: Record<string, {
1393
- attributes: Record<string, unknown>;
1394
- }>;
1395
- oauth2Clients?: Record<string, OAuth2ClientInput>;
1396
- idProvider?: IdProvider;
1397
- }
1398
- /**
1399
- * Namespace-level TailorDB data available to generation-time hooks.
1400
- */
1401
- interface TailorDBNamespaceData {
1402
- /** Namespace name */
1403
- namespace: string;
1404
- /** All TailorDB types in this namespace, keyed by type name */
1405
- types: Record<string, TailorDBType$1>;
1406
- /** Source info for each type (file path, export name, plugin info) */
1407
- sourceInfo: ReadonlyMap<string, TypeSourceInfoEntry>;
1408
- /** Plugin attachments configured on each type via .plugin() method */
1409
- pluginAttachments: ReadonlyMap<string, readonly PluginAttachment[]>;
1410
- }
1411
- /**
1412
- * Namespace-level resolver data available to generation-time hooks.
1413
- */
1414
- interface ResolverNamespaceData {
1415
- /** Namespace name */
1416
- namespace: string;
1417
- /** All resolvers in this namespace, keyed by resolver name */
1418
- resolvers: Record<string, Resolver>;
1419
- }
1420
- /**
1421
- * Context passed to plugin's onTailorDBReady hook.
1422
- * @template PluginConfig - Plugin-level configuration type
1423
- */
1424
- interface TailorDBReadyContext<PluginConfig = unknown> {
1425
- /** All TailorDB namespaces with their types and metadata */
1426
- tailordb: TailorDBNamespaceData[];
1427
- /** Auth configuration */
1428
- auth?: GeneratorAuthInput;
1429
- /** Base directory for generated files */
1430
- baseDir: string;
1431
- /** Path to tailor.config.ts */
1432
- configPath: string;
1433
- /** Plugin-level configuration passed via definePlugins() */
1434
- pluginConfig: PluginConfig;
1435
- }
1436
- /**
1437
- * Context passed to plugin's onResolverReady hook.
1438
- * @template PluginConfig - Plugin-level configuration type
1439
- */
1440
- interface ResolverReadyContext<PluginConfig = unknown> {
1441
- /** All TailorDB namespaces with their types and metadata */
1442
- tailordb: TailorDBNamespaceData[];
1443
- /** All resolver namespaces with their resolvers */
1444
- resolvers: ResolverNamespaceData[];
1445
- /** Auth configuration */
1446
- auth?: GeneratorAuthInput;
1447
- /** Base directory for generated files */
1448
- baseDir: string;
1449
- /** Path to tailor.config.ts */
1450
- configPath: string;
1451
- /** Plugin-level configuration passed via definePlugins() */
1452
- pluginConfig: PluginConfig;
1453
- }
1454
- /**
1455
- * Context passed to plugin's onExecutorReady hook.
1456
- * @template PluginConfig - Plugin-level configuration type
1457
- */
1458
- interface ExecutorReadyContext<PluginConfig = unknown> {
1459
- /** All TailorDB namespaces with their types and metadata */
1460
- tailordb: TailorDBNamespaceData[];
1461
- /** All resolver namespaces with their resolvers */
1462
- resolvers: ResolverNamespaceData[];
1463
- /** All executors, keyed by executor name */
1464
- executors: Record<string, Executor>;
1465
- /** Auth configuration */
1466
- auth?: GeneratorAuthInput;
1467
- /** Base directory for generated files */
1468
- baseDir: string;
1469
- /** Path to tailor.config.ts */
1470
- configPath: string;
1471
- /** Plugin-level configuration passed via definePlugins() */
1472
- pluginConfig: PluginConfig;
1473
- }
1474
- //#endregion
1475
- //#region src/types/plugin.d.ts
1476
- type TypeConfigRequired<PluginConfig = unknown> = boolean | ((pluginConfig: PluginConfig | undefined) => boolean);
1477
- /**
1478
- * Interface for plugin configuration mapping.
1479
- * Extend this interface via declaration merging to add typed plugin configs.
1480
- */
1481
- interface PluginConfigs<Fields extends string = string> {}
1482
- /**
1483
- * Plugin attachment stored on TailorAnyDBType instances.
1484
- */
1485
- interface PluginAttachment {
1486
- pluginId: string;
1487
- config: unknown;
1488
- }
1489
- /**
1490
- * Context passed to plugin's process method
1491
- */
1492
- interface PluginProcessContext<TypeConfig = unknown, PluginConfig = unknown> {
1493
- type: TailorAnyDBType;
1494
- typeConfig: TypeConfig;
1495
- pluginConfig: PluginConfig;
1496
- namespace: string;
1497
- }
1498
- /**
1499
- * Context passed to plugin's onNamespaceLoaded hook.
1500
- */
1501
- interface PluginNamespaceProcessContext<PluginConfig = unknown> {
1502
- pluginConfig: PluginConfig;
1503
- namespace: string;
1504
- }
1505
- /**
1506
- * Interface representing a TailorDB type for plugin output.
1507
- */
1508
- interface TailorDBTypeForPlugin {
1509
- readonly name: string;
1510
- readonly fields: Record<string, unknown>;
1511
- }
1512
- type PluginGeneratedType = TailorDBTypeForPlugin;
1513
- type PluginGeneratedTypes = Record<string, PluginGeneratedType>;
1514
- interface PluginGeneratedResolver {
1515
- name: string;
1516
- operation: "query" | "mutation";
1517
- inputFields?: Record<string, unknown>;
1518
- outputFields: Record<string, unknown>;
1519
- body: string;
1520
- }
1521
- interface PluginRecordTriggerConfig {
1522
- kind: "tailordb";
1523
- events: ("tailordb.type_record.created" | "tailordb.type_record.updated" | "tailordb.type_record.deleted")[];
1524
- typeName: string;
1525
- }
1526
- interface PluginScheduleTriggerConfig {
1527
- kind: "schedule";
1528
- cron: string;
1529
- timezone?: string;
1530
- }
1531
- interface PluginIncomingWebhookTriggerConfig {
1532
- kind: "incomingWebhook";
1533
- }
1534
- type PluginTriggerConfig = PluginRecordTriggerConfig | PluginScheduleTriggerConfig | PluginIncomingWebhookTriggerConfig;
1535
- type PluginInjectValue = string | number | boolean | null;
1536
- type PluginInjectMap = Record<string, PluginInjectValue>;
1537
- interface PluginFunctionOperationConfig {
1538
- kind: "function";
1539
- body: string;
1540
- inject?: PluginInjectMap;
1541
- }
1542
- interface PluginGraphQLOperationConfig {
1543
- kind: "graphql";
1544
- query: string;
1545
- appName?: string;
1546
- variables?: string;
1547
- }
1548
- interface PluginWebhookOperationConfig {
1549
- kind: "webhook";
1550
- url: string;
1551
- }
1552
- interface PluginWorkflowOperationConfig {
1553
- kind: "workflow";
1554
- workflowName: string;
1555
- }
1556
- type PluginOperationConfig = PluginFunctionOperationConfig | PluginGraphQLOperationConfig | PluginWebhookOperationConfig | PluginWorkflowOperationConfig;
1557
- type PluginExecutorContextValue = TailorAnyDBType | string | number | boolean | null | undefined;
1558
- interface PluginExecutorContextBase {
1559
- sourceType: TailorAnyDBType | null;
1560
- namespace: string;
1561
- }
1562
- type PluginExecutorContext = PluginExecutorContextBase & {
1563
- [key: string]: PluginExecutorContextValue;
1564
- };
1565
- interface PluginExecutorModule {
1566
- default: unknown;
1567
- }
1568
- interface PluginGeneratedExecutorWithFile<Ctx = PluginExecutorContext> {
1569
- name: string;
1570
- resolve: () => Promise<PluginExecutorModule>;
1571
- context: Ctx;
1572
- }
1573
- interface PluginGeneratedExecutorLegacy {
1574
- name: string;
1575
- description?: string;
1576
- trigger: PluginTriggerConfig;
1577
- operation: PluginOperationConfig;
1578
- }
1579
- type PluginGeneratedExecutor = PluginGeneratedExecutorWithFile | PluginGeneratedExecutorLegacy;
1580
- interface PluginExtends {
1581
- fields?: Record<string, TailorAnyDBField>;
1582
- }
1583
- interface PluginOutput {
1584
- types?: PluginGeneratedTypes;
1585
- resolvers?: PluginGeneratedResolver[];
1586
- executors?: PluginGeneratedExecutor[];
1587
- }
1588
- interface TypePluginOutput extends PluginOutput {
1589
- extends?: PluginExtends;
1590
- }
1591
- type NamespacePluginOutput = PluginOutput;
1592
- /**
1593
- * Plugin interface that all plugins must implement.
1594
- * @template TypeConfig - Type for per-type configuration passed via .plugin() method
1595
- * @template PluginConfig - Type for plugin-level configuration passed via definePlugins()
1596
- */
1597
- interface Plugin<TypeConfig = unknown, PluginConfig = unknown> {
1598
- readonly id: string;
1599
- readonly description: string;
1600
- readonly importPath?: string;
1601
- readonly typeConfigRequired?: TypeConfigRequired<PluginConfig>;
1602
- readonly pluginConfig?: PluginConfig;
1603
- onTypeLoaded?(context: PluginProcessContext<TypeConfig, PluginConfig>): TypePluginOutput | Promise<TypePluginOutput>;
1604
- onNamespaceLoaded?(context: PluginNamespaceProcessContext<PluginConfig>): NamespacePluginOutput | Promise<NamespacePluginOutput>;
1605
- onTailorDBReady?(context: TailorDBReadyContext<PluginConfig>): GeneratorResult | Promise<GeneratorResult>;
1606
- onResolverReady?(context: ResolverReadyContext<PluginConfig>): GeneratorResult | Promise<GeneratorResult>;
1607
- onExecutorReady?(context: ExecutorReadyContext<PluginConfig>): GeneratorResult | Promise<GeneratorResult>;
1608
- }
1609
- //#endregion
1610
- //#region src/types/tailor-db-field.d.ts
1611
- /**
1612
- * Minimal structural interface for TailorDBField.
1613
- * Defines only the properties needed by parser, plugin, cli, and types layers.
1614
- * The full interface with builder methods (relation, index, unique, hooks, validate, etc.)
1615
- * is defined in configure/services/tailordb/schema.ts.
1616
- */
1617
- interface TailorDBField<Defined extends DefinedDBFieldMetadata = DefinedDBFieldMetadata, Output = any> extends Omit<TailorField<Defined, Output, DBFieldMetadata, Defined["type"]>, "fields"> {
1618
- readonly fields: Record<string, TailorAnyDBField>;
1619
- readonly rawRelation: Readonly<RawRelationConfig> | undefined;
1620
- }
1621
- type TailorAnyDBField = TailorDBField<any, any>;
1622
- /**
1623
- * Minimal structural interface for TailorDBType.
1624
- * Defines only the properties needed by parser, plugin, cli, and types layers.
1625
- * The full interface with builder methods (hooks, validate, features, permission, etc.)
1626
- * is defined in configure/services/tailordb/schema.ts.
1627
- */
1628
- interface TailorDBType<Fields extends Record<string, TailorAnyDBField> = any, User extends object = InferredAttributeMap> {
1629
- readonly name: string;
1630
- readonly fields: Fields;
1631
- readonly _output: InferFieldsOutput<Fields>;
1632
- readonly metadata: TailorDBTypeMetadata;
1633
- readonly plugins: PluginAttachment[];
1634
- }
1635
- type TailorAnyDBType = TailorDBType<any, any>;
1636
- type TailorDBInstance<Fields extends Record<string, TailorAnyDBField> = any, User extends object = InferredAttributeMap> = TailorDBType<Fields, User>;
1637
- //#endregion
1638
- export { ResolverInput as $, RelationType as A, FieldMetadata as At, BeforeLoginHookArgs as B, InferredAttributeMap as Bt, ResolverReadyContext as C, SCIMAuthorization as Ct, DefinedDBFieldMetadata as D, ArrayFieldOutput as Dt, DBFieldMetadata as E, TenantProvider as Et, AuthConfig as F, FieldValidateInput as Ft, UserAttributeListKey as G, JsonCompatible as Gt, OAuth2ClientGrantType as H, TailorUser as Ht, AuthConnectionTokenResult as I, Validators as It, ValueOperand as J, output as Jt, UserAttributeMap as K, JsonValue as Kt, AuthExternalConfig as L, AttributeList as Lt, TailorDBServiceInput as M, FieldOutput$1 as Mt, TailorDBType$1 as N, TailorFieldType as Nt, GqlOperationsConfig as O, DefinedFieldMetadata as Ot, TypeSourceInfoEntry as P, TailorToTs as Pt, Resolver as Q, AuthOwnConfig as R, AttributeMap as Rt, ResolverNamespaceData as S, SCIMAttributeMapping as St, TailorDBReadyContext as T, SCIMResource as Tt, SCIMAttributeType as U, unauthenticatedTailorUser as Ut, DefinedAuth as V, TailorInvoker as Vt, UserAttributeKey as W, InferFieldsOutput as Wt, AuthConnectionConfig as X, TailorField as Y, AuthConnectionOAuth2Config as Z, PluginProcessContext as _, IdProvider as _t, NamespacePluginOutput as a, FunctionOperation as at, ExecutorReadyContext as b, SAML as bt, PluginConfigs as c, IncomingWebhookTrigger as ct, PluginGeneratedExecutor as d, TailorDBTrigger as dt, GeneratorConfig as et, PluginGeneratedExecutorWithFile as f, WebhookOperation as ft, PluginOutput as g, IDToken as gt, PluginNamespaceProcessContext as h, BuiltinIdP as ht, TailorDBType as i, ExecutorInput as it, SerialConfig as j, FieldOptions as jt, IndexDef as k, EnumValue as kt, PluginExecutorContext as l, ResolverExecutedTrigger as lt, PluginGeneratedType as m, AuthInvoker as mt, TailorAnyDBType as n, AuthAccessTokenTrigger as nt, Plugin as o, GqlOperation as ot, PluginGeneratedResolver as p, WorkflowOperation as pt, UsernameFieldKey as q, Prettify as qt, TailorDBField as r, Executor as rt, PluginAttachment as s, IdpUserTrigger as st, TailorAnyDBField as t, BaseGeneratorConfig as tt, PluginExecutorContextBase as u, ScheduleTriggerInput as ut, TailorDBTypeForPlugin as v, OAuth2ClientInput as vt, TailorDBNamespaceData as w, SCIMConfig as wt, GeneratorResult as x, SCIMAttribute as xt, TypePluginOutput as y, OIDC as yt, AuthServiceInput as z, InferredAttributeList as zt };
1639
- //# sourceMappingURL=tailor-db-field-D0qg8s4U.d.mts.map