@tailor-platform/sdk 1.22.0 → 1.24.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 (69) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/dist/app-config-BNKHurwr.d.mts +174 -0
  3. package/dist/{application-CTQe2HSB.mjs → application-DThE2HW7.mjs} +200 -215
  4. package/dist/application-DThE2HW7.mjs.map +1 -0
  5. package/dist/application-P1by1htu.mjs +8 -0
  6. package/dist/{brand-DyPrAzpM.mjs → brand-64NrPh_e.mjs} +1 -1
  7. package/dist/{brand-DyPrAzpM.mjs.map → brand-64NrPh_e.mjs.map} +1 -1
  8. package/dist/cli/index.d.mts +0 -1
  9. package/dist/cli/index.mjs +7 -7
  10. package/dist/cli/index.mjs.map +1 -1
  11. package/dist/cli/lib.d.mts +8 -9
  12. package/dist/cli/lib.mjs +7 -7
  13. package/dist/cli/lib.mjs.map +1 -1
  14. package/dist/cli/skills.d.mts +0 -1
  15. package/dist/configure/index.d.mts +5 -5
  16. package/dist/configure/index.mjs +3 -3
  17. package/dist/configure/index.mjs.map +1 -1
  18. package/dist/enum-constants-B5Nl-yzx.mjs.map +1 -1
  19. package/dist/env-CHwmMyfF.d.mts +32 -0
  20. package/dist/file-utils-sEOwAdJ4.mjs.map +1 -1
  21. package/dist/{index-Cwi86SUR.d.mts → index-BrIZ1rm2.d.mts} +2 -3
  22. package/dist/{index-BiutQT7m.d.mts → index-Df0aH5zp.d.mts} +55 -5
  23. package/dist/{index-DPN_P0w3.d.mts → index-DhtKJmgi.d.mts} +2 -3
  24. package/dist/{index-ClS0NClx.d.mts → index-DkRJwNw2.d.mts} +2 -3
  25. package/dist/{index-BGPX26_D.d.mts → index-zZUL7_2B.d.mts} +2 -3
  26. package/dist/{interceptor-DiARwPfw.mjs → interceptor-B-0OmiDZ.mjs} +1 -1
  27. package/dist/{interceptor-DiARwPfw.mjs.map → interceptor-B-0OmiDZ.mjs.map} +1 -1
  28. package/dist/{job-CRavYLLk.mjs → job-CnqcfVTI.mjs} +2 -2
  29. package/dist/{job-CRavYLLk.mjs.map → job-CnqcfVTI.mjs.map} +1 -1
  30. package/dist/kysely/index.d.mts +0 -1
  31. package/dist/kysely-type-CSlcwNFH.mjs.map +1 -1
  32. package/dist/{package-json-iVBhE5Ef.mjs → package-json-4G3gLWMd.mjs} +1 -1
  33. package/dist/{package-json-iVBhE5Ef.mjs.map → package-json-4G3gLWMd.mjs.map} +1 -1
  34. package/dist/package-json-BqvUKPBM.mjs +3 -0
  35. package/dist/plugin/builtin/enum-constants/index.d.mts +2 -3
  36. package/dist/plugin/builtin/file-utils/index.d.mts +2 -3
  37. package/dist/plugin/builtin/kysely-type/index.d.mts +2 -3
  38. package/dist/plugin/builtin/seed/index.d.mts +2 -3
  39. package/dist/plugin/builtin/seed/index.mjs +1 -1
  40. package/dist/plugin/index.d.mts +2 -2
  41. package/dist/plugin/index.mjs.map +1 -1
  42. package/dist/{types-bcuNRo1Y.d.mts → plugin-CE-BZZgX.d.mts} +1069 -1763
  43. package/dist/{query-Bz2oDGhw.mjs → query-CV5n7DRd.mjs} +496 -115
  44. package/dist/query-CV5n7DRd.mjs.map +1 -0
  45. package/dist/{schema-Cjm-OvPF.mjs → schema-0ByCZ2Ym.mjs} +2 -2
  46. package/dist/schema-0ByCZ2Ym.mjs.map +1 -0
  47. package/dist/{seed-CXvCW3Xc.mjs → seed-Cl5QXYsL.mjs} +13 -3
  48. package/dist/seed-Cl5QXYsL.mjs.map +1 -0
  49. package/dist/{telemetry-C46fds1l.mjs → telemetry-BPviAbME.mjs} +2 -2
  50. package/dist/{telemetry-C46fds1l.mjs.map → telemetry-BPviAbME.mjs.map} +1 -1
  51. package/dist/telemetry-Dq5FZUH0.mjs +3 -0
  52. package/dist/utils/test/index.d.mts +3 -4
  53. package/dist/utils/test/index.mjs +2 -2
  54. package/docs/cli/tailordb.md +1 -1
  55. package/docs/cli-reference.md +8 -8
  56. package/docs/services/auth.md +2 -2
  57. package/package.json +27 -25
  58. package/postinstall.mjs +4 -14
  59. package/dist/application-CTQe2HSB.mjs.map +0 -1
  60. package/dist/application-DdSu3baZ.mjs +0 -8
  61. package/dist/package-json-BI0ng3_5.mjs +0 -3
  62. package/dist/query-Bz2oDGhw.mjs.map +0 -1
  63. package/dist/schema-Cjm-OvPF.mjs.map +0 -1
  64. package/dist/seed-CXvCW3Xc.mjs.map +0 -1
  65. package/dist/telemetry-BAxP8-PR.mjs +0 -3
  66. package/dist/types-CBTSg-LK.mjs +0 -13
  67. package/dist/types-CBTSg-LK.mjs.map +0 -1
  68. package/dist/types-DVMQNdTs.d.mts +0 -246
  69. package/dist/user-defined.d.ts +0 -13
@@ -1,585 +1,485 @@
1
- /// <reference path="./user-defined.d.ts" />
2
1
  import { z } from "zod";
3
- import { IsAny, NonEmptyObject } from "type-fest";
4
2
  import { StandardSchemaV1 } from "@standard-schema/spec";
3
+ import { IsAny, NonEmptyObject } from "type-fest";
4
+
5
+ //#region src/parser/generator-config/index.d.ts
5
6
 
6
- //#region src/parser/service/tailordb/relation.d.ts
7
- declare const relationTypes: {
8
- readonly "1-1": "1-1";
9
- readonly oneToOne: "1-1";
10
- readonly "n-1": "n-1";
11
- readonly manyToOne: "n-1";
12
- readonly "N-1": "n-1";
13
- readonly keyOnly: "keyOnly";
7
+ declare const BaseGeneratorConfigSchema: z.ZodUnion<readonly [z.ZodTuple<[z.ZodLiteral<"@tailor-platform/kysely-type">, z.ZodObject<{
8
+ distPath: z.ZodString;
9
+ }, z.core.$strip>], null>, z.ZodTuple<[z.ZodLiteral<"@tailor-platform/seed">, z.ZodObject<{
10
+ distPath: z.ZodString;
11
+ machineUserName: z.ZodOptional<z.ZodString>;
12
+ }, z.core.$strip>], null>, z.ZodTuple<[z.ZodLiteral<"@tailor-platform/enum-constants">, z.ZodObject<{
13
+ distPath: z.ZodString;
14
+ }, z.core.$strip>], null>, z.ZodTuple<[z.ZodLiteral<"@tailor-platform/file-utils">, z.ZodObject<{
15
+ distPath: z.ZodString;
16
+ }, z.core.$strip>], null>, z.ZodObject<{
17
+ id: z.ZodString;
18
+ description: z.ZodString;
19
+ dependencies: z.ZodArray<z.ZodEnum<{
20
+ executor: "executor";
21
+ tailordb: "tailordb";
22
+ resolver: "resolver";
23
+ }>>;
24
+ processType: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
25
+ processResolver: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
26
+ processExecutor: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
27
+ processTailorDBNamespace: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
28
+ processResolverNamespace: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
29
+ aggregate: z.ZodFunction<z.core.$ZodFunctionArgs, z.ZodAny>;
30
+ }, z.core.$strip>]>;
31
+ //#endregion
32
+ //#region src/types/auth.generated.d.ts
33
+ type AuthInvoker = {
34
+ /** Auth namespace */
35
+ namespace: string;
36
+ /** Machine user name for authentication */
37
+ machineUserName: string;
38
+ };
39
+ type OIDC = {
40
+ /** Identity provider name */
41
+ name: string;
42
+ kind: "OIDC";
43
+ /** OAuth2 client ID */
44
+ clientID: string;
45
+ /** OAuth2 client secret */
46
+ clientSecret: {
47
+ vaultName: string;
48
+ secretKey: string;
49
+ };
50
+ /** OIDC provider URL */
51
+ providerURL: string;
52
+ /** OIDC issuer URL (defaults to providerURL) */
53
+ issuerURL?: string | undefined;
54
+ /** JWT claim to use as username */
55
+ usernameClaim?: string | undefined;
56
+ };
57
+ type SAML = {
58
+ /** Identity provider name */
59
+ name: string;
60
+ kind: "SAML";
61
+ /** Enable signing of SAML requests */
62
+ enableSignRequest: boolean;
63
+ /** URL to fetch SAML metadata (mutually exclusive with rawMetadata) */
64
+ metadataURL?: string | undefined;
65
+ /** Raw SAML metadata XML (mutually exclusive with metadataURL) */
66
+ rawMetadata?: string | undefined;
67
+ };
68
+ type IDToken = {
69
+ /** Identity provider name */
70
+ name: string;
71
+ kind: "IDToken";
72
+ /** ID token provider URL */
73
+ providerURL: string;
74
+ /** Client ID for ID token validation */
75
+ clientID: string;
76
+ /** ID token issuer URL */
77
+ issuerURL?: string | undefined;
78
+ /** JWT claim to use as username */
79
+ usernameClaim?: string | undefined;
80
+ };
81
+ type BuiltinIdP = {
82
+ /** Identity provider name */
83
+ name: string;
84
+ kind: "BuiltInIdP";
85
+ /** IdP namespace */
86
+ namespace: string;
87
+ /** OAuth2 client name in the IdP */
88
+ clientName: string;
89
+ };
90
+ type IdProvider = OIDC | SAML | IDToken | BuiltinIdP;
91
+ type OAuth2ClientInput = {
92
+ /** Allowed redirect URIs */
93
+ redirectURIs: (`https://${string}` | `http://${string}` | `${string}:url` | `${string}:url/${string}`)[];
94
+ /** Client description */
95
+ description?: string | undefined;
96
+ /** Allowed OAuth2 grant types */
97
+ grantTypes?: ("authorization_code" | "refresh_token")[] | undefined;
98
+ /** OAuth2 client type */
99
+ clientType?: "confidential" | "public" | "browser" | undefined;
100
+ /** Access token lifetime in seconds (60-86400) */
101
+ accessTokenLifetimeSeconds?: number | undefined;
102
+ /** Refresh token lifetime in seconds (60-604800) */
103
+ refreshTokenLifetimeSeconds?: number | undefined;
104
+ /** Require DPoP (Demonstrating Proof-of-Possession) for token requests */
105
+ requireDpop?: boolean | undefined;
106
+ };
107
+ type OAuth2Client = {
108
+ /** Allowed OAuth2 grant types */
109
+ grantTypes: ("authorization_code" | "refresh_token")[];
110
+ /** Allowed redirect URIs */
111
+ redirectURIs: (`https://${string}` | `http://${string}` | `${string}:url` | `${string}:url/${string}`)[];
112
+ /** Access token lifetime in seconds (60-86400) */
113
+ accessTokenLifetimeSeconds: {
114
+ seconds: bigint;
115
+ nanos: number;
116
+ } | undefined;
117
+ /** Refresh token lifetime in seconds (60-604800) */
118
+ refreshTokenLifetimeSeconds: {
119
+ seconds: bigint;
120
+ nanos: number;
121
+ } | undefined;
122
+ /** Client description */
123
+ description?: string | undefined;
124
+ /** OAuth2 client type */
125
+ clientType?: "confidential" | "public" | "browser" | undefined;
126
+ /** Require DPoP (Demonstrating Proof-of-Possession) for token requests */
127
+ requireDpop?: boolean | undefined;
128
+ };
129
+ type SCIMAuthorization = {
130
+ /** SCIM authorization type */
131
+ type: "oauth2" | "bearer";
132
+ /** Bearer token secret (required for bearer type) */
133
+ bearerSecret?: {
134
+ vaultName: string;
135
+ secretKey: string;
136
+ } | undefined;
137
+ };
138
+ type SCIMAttribute = {
139
+ /** Attribute data type */
140
+ type: "string" | "number" | "boolean" | "datetime" | "complex";
141
+ /** Attribute name */
142
+ name: string;
143
+ /** Attribute description */
144
+ description?: string | undefined;
145
+ /** Attribute mutability */
146
+ mutability?: "readOnly" | "readWrite" | "writeOnly" | undefined;
147
+ /** Whether the attribute is required */
148
+ required?: boolean | undefined;
149
+ /** Whether the attribute can have multiple values */
150
+ multiValued?: boolean | undefined;
151
+ /** Uniqueness constraint */
152
+ uniqueness?: "none" | "server" | "global" | undefined;
153
+ /** List of canonical values */
154
+ canonicalValues?: string[] | null | undefined;
155
+ subAttributes?: SCIMAttribute[] | null | undefined;
156
+ };
157
+ type SCIMAttributeMapping = {
158
+ /** TailorDB field name to map to */
159
+ tailorDBField: string;
160
+ /** SCIM attribute path */
161
+ scimPath: string;
162
+ };
163
+ type SCIMResource = {
164
+ /** SCIM resource name */
165
+ name: string;
166
+ /** TailorDB namespace for the resource */
167
+ tailorDBNamespace: string;
168
+ /** TailorDB type name for the resource */
169
+ tailorDBType: string;
170
+ /** Core SCIM schema definition */
171
+ coreSchema: {
172
+ /** SCIM resource name */
173
+ name: string;
174
+ attributes: {
175
+ type: "string" | "number" | "boolean" | "datetime" | "complex";
176
+ /** SCIM resource name */
177
+ name: string;
178
+ description?: string | undefined;
179
+ mutability?: "readOnly" | "readWrite" | "writeOnly" | undefined;
180
+ required?: boolean | undefined;
181
+ multiValued?: boolean | undefined;
182
+ uniqueness?: "none" | "server" | "global" | undefined;
183
+ canonicalValues?: string[] | null | undefined;
184
+ subAttributes?: any[] | null | undefined;
185
+ }[];
186
+ };
187
+ /** Attribute mapping configuration */
188
+ attributeMapping: {
189
+ tailorDBField: string;
190
+ scimPath: string;
191
+ }[];
192
+ };
193
+ type SCIMConfig = {
194
+ /** Machine user name for SCIM operations */
195
+ machineUserName: string;
196
+ /** SCIM authorization configuration */
197
+ authorization: {
198
+ type: "oauth2" | "bearer";
199
+ bearerSecret?: {
200
+ vaultName: string;
201
+ secretKey: string;
202
+ } | undefined;
203
+ };
204
+ /** SCIM resource definitions */
205
+ resources: {
206
+ name: string;
207
+ tailorDBNamespace: string;
208
+ tailorDBType: string;
209
+ coreSchema: {
210
+ name: string;
211
+ attributes: {
212
+ type: "string" | "number" | "boolean" | "datetime" | "complex";
213
+ name: string;
214
+ description?: string | undefined;
215
+ mutability?: "readOnly" | "readWrite" | "writeOnly" | undefined;
216
+ required?: boolean | undefined;
217
+ multiValued?: boolean | undefined;
218
+ uniqueness?: "none" | "server" | "global" | undefined;
219
+ canonicalValues?: string[] | null | undefined;
220
+ subAttributes?: any[] | null | undefined;
221
+ }[];
222
+ };
223
+ attributeMapping: {
224
+ tailorDBField: string;
225
+ scimPath: string;
226
+ }[];
227
+ }[];
228
+ };
229
+ type TenantProvider = {
230
+ /** TailorDB namespace for the tenant type */
231
+ namespace: string;
232
+ /** TailorDB type name for tenants */
233
+ type: string;
234
+ /** Field used as the tenant signature */
235
+ signatureField: string;
14
236
  };
15
- type RelationType = keyof typeof relationTypes;
16
237
  //#endregion
17
- //#region src/parser/service/tailordb/schema.d.ts
18
-
19
- /**
20
- * Schema for TailorDB type settings.
21
- * Normalizes gqlOperations from alias ("query") to object format.
22
- */
23
- declare const TailorDBTypeSettingsSchema: z.ZodObject<{
24
- pluralForm: z.ZodOptional<z.ZodString>;
25
- aggregation: z.ZodOptional<z.ZodBoolean>;
26
- bulkUpsert: z.ZodOptional<z.ZodBoolean>;
27
- gqlOperations: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"query">, z.ZodObject<{
28
- create: z.ZodOptional<z.ZodBoolean>;
29
- update: z.ZodOptional<z.ZodBoolean>;
30
- delete: z.ZodOptional<z.ZodBoolean>;
31
- read: z.ZodOptional<z.ZodBoolean>;
32
- }, z.core.$strip>]>, z.ZodTransform<GqlOperations, "query" | {
33
- create?: boolean | undefined;
34
- update?: boolean | undefined;
35
- delete?: boolean | undefined;
36
- read?: boolean | undefined;
37
- }>>>;
38
- publishEvents: z.ZodOptional<z.ZodBoolean>;
39
- }, z.core.$strip>;
40
- declare const RawPermissionsSchema: z.ZodObject<{
41
- record: z.ZodOptional<z.ZodObject<{
42
- create: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
43
- conditions: z.ZodUnion<readonly [z.ZodReadonly<z.ZodTuple<[z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
44
- user: z.ZodString;
45
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
46
- record: z.ZodString;
47
- }, z.core.$strip>, z.ZodObject<{
48
- oldRecord: z.ZodString;
49
- }, z.core.$strip>, z.ZodObject<{
50
- newRecord: z.ZodString;
51
- }, z.core.$strip>]>, z.ZodEnum<{
52
- in: "in";
53
- "=": "=";
54
- "!=": "!=";
55
- "not in": "not in";
56
- hasAny: "hasAny";
57
- "not hasAny": "not hasAny";
58
- }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
59
- user: z.ZodString;
60
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
61
- record: z.ZodString;
62
- }, z.core.$strip>, z.ZodObject<{
63
- oldRecord: z.ZodString;
64
- }, z.core.$strip>, z.ZodObject<{
65
- newRecord: z.ZodString;
66
- }, z.core.$strip>]>], null>>, z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodTuple<[z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
67
- user: z.ZodString;
68
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
69
- record: z.ZodString;
70
- }, z.core.$strip>, z.ZodObject<{
71
- oldRecord: z.ZodString;
72
- }, z.core.$strip>, z.ZodObject<{
73
- newRecord: z.ZodString;
74
- }, z.core.$strip>]>, z.ZodEnum<{
75
- in: "in";
76
- "=": "=";
77
- "!=": "!=";
78
- "not in": "not in";
79
- hasAny: "hasAny";
80
- "not hasAny": "not hasAny";
81
- }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
82
- user: z.ZodString;
83
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
84
- record: z.ZodString;
85
- }, z.core.$strip>, z.ZodObject<{
86
- oldRecord: z.ZodString;
87
- }, z.core.$strip>, z.ZodObject<{
88
- newRecord: z.ZodString;
89
- }, z.core.$strip>]>], null>>>>]>;
90
- description: z.ZodOptional<z.ZodString>;
91
- permit: z.ZodOptional<z.ZodBoolean>;
92
- }, z.core.$strip>, z.ZodReadonly<z.ZodTuple<[z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
93
- user: z.ZodString;
94
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
95
- record: z.ZodString;
96
- }, z.core.$strip>, z.ZodObject<{
97
- oldRecord: z.ZodString;
98
- }, z.core.$strip>, z.ZodObject<{
99
- newRecord: z.ZodString;
100
- }, z.core.$strip>]>, z.ZodEnum<{
101
- in: "in";
102
- "=": "=";
103
- "!=": "!=";
104
- "not in": "not in";
105
- hasAny: "hasAny";
106
- "not hasAny": "not hasAny";
107
- }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
108
- user: z.ZodString;
109
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
110
- record: z.ZodString;
111
- }, z.core.$strip>, z.ZodObject<{
112
- oldRecord: z.ZodString;
113
- }, z.core.$strip>, z.ZodObject<{
114
- newRecord: z.ZodString;
115
- }, z.core.$strip>]>], null>>, z.ZodReadonly<z.ZodTuple<[z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
116
- user: z.ZodString;
117
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
118
- record: z.ZodString;
119
- }, z.core.$strip>, z.ZodObject<{
120
- oldRecord: z.ZodString;
121
- }, z.core.$strip>, z.ZodObject<{
122
- newRecord: z.ZodString;
123
- }, z.core.$strip>]>, z.ZodEnum<{
124
- in: "in";
125
- "=": "=";
126
- "!=": "!=";
127
- "not in": "not in";
128
- hasAny: "hasAny";
129
- "not hasAny": "not hasAny";
130
- }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
131
- user: z.ZodString;
132
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
133
- record: z.ZodString;
134
- }, z.core.$strip>, z.ZodObject<{
135
- oldRecord: z.ZodString;
136
- }, z.core.$strip>, z.ZodObject<{
137
- newRecord: z.ZodString;
138
- }, z.core.$strip>]>, z.ZodBoolean], null>>, z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodTuple<[z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
139
- user: z.ZodString;
140
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
141
- record: z.ZodString;
142
- }, z.core.$strip>, z.ZodObject<{
143
- oldRecord: z.ZodString;
144
- }, z.core.$strip>, z.ZodObject<{
145
- newRecord: z.ZodString;
146
- }, z.core.$strip>]>, z.ZodEnum<{
147
- in: "in";
148
- "=": "=";
149
- "!=": "!=";
150
- "not in": "not in";
151
- hasAny: "hasAny";
152
- "not hasAny": "not hasAny";
153
- }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
154
- user: z.ZodString;
155
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
156
- record: z.ZodString;
157
- }, z.core.$strip>, z.ZodObject<{
158
- oldRecord: z.ZodString;
159
- }, z.core.$strip>, z.ZodObject<{
160
- newRecord: z.ZodString;
161
- }, z.core.$strip>]>], null>>, z.ZodBoolean]>>>]>>>;
162
- read: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
163
- conditions: z.ZodUnion<readonly [z.ZodReadonly<z.ZodTuple<[z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
164
- user: z.ZodString;
165
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
166
- record: z.ZodString;
167
- }, z.core.$strip>, z.ZodObject<{
168
- oldRecord: z.ZodString;
169
- }, z.core.$strip>, z.ZodObject<{
170
- newRecord: z.ZodString;
171
- }, z.core.$strip>]>, z.ZodEnum<{
172
- in: "in";
173
- "=": "=";
174
- "!=": "!=";
175
- "not in": "not in";
176
- hasAny: "hasAny";
177
- "not hasAny": "not hasAny";
178
- }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
179
- user: z.ZodString;
180
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
181
- record: z.ZodString;
182
- }, z.core.$strip>, z.ZodObject<{
183
- oldRecord: z.ZodString;
184
- }, z.core.$strip>, z.ZodObject<{
185
- newRecord: z.ZodString;
186
- }, z.core.$strip>]>], null>>, z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodTuple<[z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
187
- user: z.ZodString;
188
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
189
- record: z.ZodString;
190
- }, z.core.$strip>, z.ZodObject<{
191
- oldRecord: z.ZodString;
192
- }, z.core.$strip>, z.ZodObject<{
193
- newRecord: z.ZodString;
194
- }, z.core.$strip>]>, z.ZodEnum<{
195
- in: "in";
196
- "=": "=";
197
- "!=": "!=";
198
- "not in": "not in";
199
- hasAny: "hasAny";
200
- "not hasAny": "not hasAny";
201
- }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
202
- user: z.ZodString;
203
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
204
- record: z.ZodString;
205
- }, z.core.$strip>, z.ZodObject<{
206
- oldRecord: z.ZodString;
207
- }, z.core.$strip>, z.ZodObject<{
208
- newRecord: z.ZodString;
209
- }, z.core.$strip>]>], null>>>>]>;
210
- description: z.ZodOptional<z.ZodString>;
211
- permit: z.ZodOptional<z.ZodBoolean>;
212
- }, z.core.$strip>, z.ZodReadonly<z.ZodTuple<[z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
213
- user: z.ZodString;
214
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
215
- record: z.ZodString;
216
- }, z.core.$strip>, z.ZodObject<{
217
- oldRecord: z.ZodString;
218
- }, z.core.$strip>, z.ZodObject<{
219
- newRecord: z.ZodString;
220
- }, z.core.$strip>]>, z.ZodEnum<{
221
- in: "in";
222
- "=": "=";
223
- "!=": "!=";
224
- "not in": "not in";
225
- hasAny: "hasAny";
226
- "not hasAny": "not hasAny";
227
- }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
228
- user: z.ZodString;
229
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
230
- record: z.ZodString;
231
- }, z.core.$strip>, z.ZodObject<{
232
- oldRecord: z.ZodString;
233
- }, z.core.$strip>, z.ZodObject<{
234
- newRecord: z.ZodString;
235
- }, z.core.$strip>]>], null>>, z.ZodReadonly<z.ZodTuple<[z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
236
- user: z.ZodString;
237
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
238
- record: z.ZodString;
239
- }, z.core.$strip>, z.ZodObject<{
240
- oldRecord: z.ZodString;
241
- }, z.core.$strip>, z.ZodObject<{
242
- newRecord: z.ZodString;
243
- }, z.core.$strip>]>, z.ZodEnum<{
244
- in: "in";
245
- "=": "=";
246
- "!=": "!=";
247
- "not in": "not in";
248
- hasAny: "hasAny";
249
- "not hasAny": "not hasAny";
250
- }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
251
- user: z.ZodString;
252
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
253
- record: z.ZodString;
254
- }, z.core.$strip>, z.ZodObject<{
255
- oldRecord: z.ZodString;
256
- }, z.core.$strip>, z.ZodObject<{
257
- newRecord: z.ZodString;
258
- }, z.core.$strip>]>, z.ZodBoolean], null>>, z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodTuple<[z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
259
- user: z.ZodString;
260
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
261
- record: z.ZodString;
262
- }, z.core.$strip>, z.ZodObject<{
263
- oldRecord: z.ZodString;
264
- }, z.core.$strip>, z.ZodObject<{
265
- newRecord: z.ZodString;
266
- }, z.core.$strip>]>, z.ZodEnum<{
267
- in: "in";
268
- "=": "=";
269
- "!=": "!=";
270
- "not in": "not in";
271
- hasAny: "hasAny";
272
- "not hasAny": "not hasAny";
273
- }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
274
- user: z.ZodString;
275
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
276
- record: z.ZodString;
277
- }, z.core.$strip>, z.ZodObject<{
278
- oldRecord: z.ZodString;
279
- }, z.core.$strip>, z.ZodObject<{
280
- newRecord: z.ZodString;
281
- }, z.core.$strip>]>], null>>, z.ZodBoolean]>>>]>>>;
282
- update: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
283
- conditions: z.ZodUnion<readonly [z.ZodReadonly<z.ZodTuple<[z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
284
- user: z.ZodString;
285
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
286
- record: z.ZodString;
287
- }, z.core.$strip>, z.ZodObject<{
288
- oldRecord: z.ZodString;
289
- }, z.core.$strip>, z.ZodObject<{
290
- newRecord: z.ZodString;
291
- }, z.core.$strip>]>, z.ZodEnum<{
292
- in: "in";
293
- "=": "=";
294
- "!=": "!=";
295
- "not in": "not in";
296
- hasAny: "hasAny";
297
- "not hasAny": "not hasAny";
298
- }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
299
- user: z.ZodString;
300
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
301
- record: z.ZodString;
302
- }, z.core.$strip>, z.ZodObject<{
303
- oldRecord: z.ZodString;
304
- }, z.core.$strip>, z.ZodObject<{
305
- newRecord: z.ZodString;
306
- }, z.core.$strip>]>], null>>, z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodTuple<[z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
307
- user: z.ZodString;
308
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
309
- record: z.ZodString;
310
- }, z.core.$strip>, z.ZodObject<{
311
- oldRecord: z.ZodString;
312
- }, z.core.$strip>, z.ZodObject<{
313
- newRecord: z.ZodString;
314
- }, z.core.$strip>]>, z.ZodEnum<{
315
- in: "in";
316
- "=": "=";
317
- "!=": "!=";
318
- "not in": "not in";
319
- hasAny: "hasAny";
320
- "not hasAny": "not hasAny";
321
- }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
322
- user: z.ZodString;
323
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
324
- record: z.ZodString;
325
- }, z.core.$strip>, z.ZodObject<{
326
- oldRecord: z.ZodString;
327
- }, z.core.$strip>, z.ZodObject<{
328
- newRecord: z.ZodString;
329
- }, z.core.$strip>]>], null>>>>]>;
330
- description: z.ZodOptional<z.ZodString>;
331
- permit: z.ZodOptional<z.ZodBoolean>;
332
- }, z.core.$strip>, z.ZodReadonly<z.ZodTuple<[z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
333
- user: z.ZodString;
334
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
335
- record: z.ZodString;
336
- }, z.core.$strip>, z.ZodObject<{
337
- oldRecord: z.ZodString;
338
- }, z.core.$strip>, z.ZodObject<{
339
- newRecord: z.ZodString;
340
- }, z.core.$strip>]>, z.ZodEnum<{
341
- in: "in";
342
- "=": "=";
343
- "!=": "!=";
344
- "not in": "not in";
345
- hasAny: "hasAny";
346
- "not hasAny": "not hasAny";
347
- }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
348
- user: z.ZodString;
349
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
350
- record: z.ZodString;
351
- }, z.core.$strip>, z.ZodObject<{
352
- oldRecord: z.ZodString;
353
- }, z.core.$strip>, z.ZodObject<{
354
- newRecord: z.ZodString;
355
- }, z.core.$strip>]>], null>>, z.ZodReadonly<z.ZodTuple<[z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
356
- user: z.ZodString;
357
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
358
- record: z.ZodString;
359
- }, z.core.$strip>, z.ZodObject<{
360
- oldRecord: z.ZodString;
361
- }, z.core.$strip>, z.ZodObject<{
362
- newRecord: z.ZodString;
363
- }, z.core.$strip>]>, z.ZodEnum<{
364
- in: "in";
365
- "=": "=";
366
- "!=": "!=";
367
- "not in": "not in";
368
- hasAny: "hasAny";
369
- "not hasAny": "not hasAny";
370
- }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
371
- user: z.ZodString;
372
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
373
- record: z.ZodString;
374
- }, z.core.$strip>, z.ZodObject<{
375
- oldRecord: z.ZodString;
376
- }, z.core.$strip>, z.ZodObject<{
377
- newRecord: z.ZodString;
378
- }, z.core.$strip>]>, z.ZodBoolean], null>>, z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodTuple<[z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
379
- user: z.ZodString;
380
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
381
- record: z.ZodString;
382
- }, z.core.$strip>, z.ZodObject<{
383
- oldRecord: z.ZodString;
384
- }, z.core.$strip>, z.ZodObject<{
385
- newRecord: z.ZodString;
386
- }, z.core.$strip>]>, z.ZodEnum<{
387
- in: "in";
388
- "=": "=";
389
- "!=": "!=";
390
- "not in": "not in";
391
- hasAny: "hasAny";
392
- "not hasAny": "not hasAny";
393
- }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
394
- user: z.ZodString;
395
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
396
- record: z.ZodString;
397
- }, z.core.$strip>, z.ZodObject<{
398
- oldRecord: z.ZodString;
399
- }, z.core.$strip>, z.ZodObject<{
400
- newRecord: z.ZodString;
401
- }, z.core.$strip>]>], null>>, z.ZodBoolean]>>>]>>>;
402
- delete: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
403
- conditions: z.ZodUnion<readonly [z.ZodReadonly<z.ZodTuple<[z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
404
- user: z.ZodString;
405
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
406
- record: z.ZodString;
407
- }, z.core.$strip>, z.ZodObject<{
408
- oldRecord: z.ZodString;
409
- }, z.core.$strip>, z.ZodObject<{
410
- newRecord: z.ZodString;
411
- }, z.core.$strip>]>, z.ZodEnum<{
412
- in: "in";
413
- "=": "=";
414
- "!=": "!=";
415
- "not in": "not in";
416
- hasAny: "hasAny";
417
- "not hasAny": "not hasAny";
418
- }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
419
- user: z.ZodString;
420
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
421
- record: z.ZodString;
422
- }, z.core.$strip>, z.ZodObject<{
423
- oldRecord: z.ZodString;
424
- }, z.core.$strip>, z.ZodObject<{
425
- newRecord: z.ZodString;
426
- }, z.core.$strip>]>], null>>, z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodTuple<[z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
427
- user: z.ZodString;
428
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
429
- record: z.ZodString;
430
- }, z.core.$strip>, z.ZodObject<{
431
- oldRecord: z.ZodString;
432
- }, z.core.$strip>, z.ZodObject<{
433
- newRecord: z.ZodString;
434
- }, z.core.$strip>]>, z.ZodEnum<{
435
- in: "in";
436
- "=": "=";
437
- "!=": "!=";
438
- "not in": "not in";
439
- hasAny: "hasAny";
440
- "not hasAny": "not hasAny";
441
- }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
442
- user: z.ZodString;
443
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
444
- record: z.ZodString;
445
- }, z.core.$strip>, z.ZodObject<{
446
- oldRecord: z.ZodString;
447
- }, z.core.$strip>, z.ZodObject<{
448
- newRecord: z.ZodString;
449
- }, z.core.$strip>]>], null>>>>]>;
450
- description: z.ZodOptional<z.ZodString>;
451
- permit: z.ZodOptional<z.ZodBoolean>;
452
- }, z.core.$strip>, z.ZodReadonly<z.ZodTuple<[z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
453
- user: z.ZodString;
454
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
455
- record: z.ZodString;
456
- }, z.core.$strip>, z.ZodObject<{
457
- oldRecord: z.ZodString;
458
- }, z.core.$strip>, z.ZodObject<{
459
- newRecord: z.ZodString;
460
- }, z.core.$strip>]>, z.ZodEnum<{
461
- in: "in";
462
- "=": "=";
463
- "!=": "!=";
464
- "not in": "not in";
465
- hasAny: "hasAny";
466
- "not hasAny": "not hasAny";
467
- }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
468
- user: z.ZodString;
469
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
470
- record: z.ZodString;
471
- }, z.core.$strip>, z.ZodObject<{
472
- oldRecord: z.ZodString;
473
- }, z.core.$strip>, z.ZodObject<{
474
- newRecord: z.ZodString;
475
- }, z.core.$strip>]>], null>>, z.ZodReadonly<z.ZodTuple<[z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
476
- user: z.ZodString;
477
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
478
- record: z.ZodString;
479
- }, z.core.$strip>, z.ZodObject<{
480
- oldRecord: z.ZodString;
481
- }, z.core.$strip>, z.ZodObject<{
482
- newRecord: z.ZodString;
483
- }, z.core.$strip>]>, z.ZodEnum<{
484
- in: "in";
485
- "=": "=";
486
- "!=": "!=";
487
- "not in": "not in";
488
- hasAny: "hasAny";
489
- "not hasAny": "not hasAny";
490
- }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
491
- user: z.ZodString;
492
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
493
- record: z.ZodString;
494
- }, z.core.$strip>, z.ZodObject<{
495
- oldRecord: z.ZodString;
496
- }, z.core.$strip>, z.ZodObject<{
497
- newRecord: z.ZodString;
498
- }, z.core.$strip>]>, z.ZodBoolean], null>>, z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodTuple<[z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
499
- user: z.ZodString;
500
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
501
- record: z.ZodString;
502
- }, z.core.$strip>, z.ZodObject<{
503
- oldRecord: z.ZodString;
504
- }, z.core.$strip>, z.ZodObject<{
505
- newRecord: z.ZodString;
506
- }, z.core.$strip>]>, z.ZodEnum<{
507
- in: "in";
508
- "=": "=";
509
- "!=": "!=";
510
- "not in": "not in";
511
- hasAny: "hasAny";
512
- "not hasAny": "not hasAny";
513
- }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
514
- user: z.ZodString;
515
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodObject<{
516
- record: z.ZodString;
517
- }, z.core.$strip>, z.ZodObject<{
518
- oldRecord: z.ZodString;
519
- }, z.core.$strip>, z.ZodObject<{
520
- newRecord: z.ZodString;
521
- }, z.core.$strip>]>], null>>, z.ZodBoolean]>>>]>>>;
522
- }, z.core.$strip>>;
523
- gql: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
524
- conditions: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodTuple<[z.ZodUnion<readonly [z.ZodObject<{
525
- user: z.ZodString;
526
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>, z.ZodEnum<{
527
- in: "in";
528
- "=": "=";
529
- "!=": "!=";
530
- "not in": "not in";
531
- hasAny: "hasAny";
532
- "not hasAny": "not hasAny";
533
- }>, z.ZodUnion<readonly [z.ZodObject<{
534
- user: z.ZodString;
535
- }, z.core.$strict>, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodBoolean>]>], null>>>>;
536
- actions: z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodReadonly<z.ZodArray<z.ZodEnum<{
537
- create: "create";
538
- update: "update";
539
- delete: "delete";
540
- read: "read";
541
- aggregate: "aggregate";
542
- bulkUpsert: "bulkUpsert";
543
- }>>>]>;
544
- permit: z.ZodOptional<z.ZodBoolean>;
545
- description: z.ZodOptional<z.ZodString>;
546
- }, z.core.$strip>>>>;
547
- }, z.core.$strip>;
548
- /**
549
- * Schema for TailorDB service configuration.
550
- * Normalizes gqlOperations from alias ("query") to object format.
551
- */
552
- declare const TailorDBServiceConfigSchema: z.ZodObject<{
553
- files: z.ZodArray<z.ZodString>;
554
- ignores: z.ZodOptional<z.ZodArray<z.ZodString>>;
555
- erdSite: z.ZodOptional<z.ZodString>;
556
- migration: z.ZodOptional<z.ZodObject<{
557
- directory: z.ZodString;
558
- machineUser: z.ZodOptional<z.ZodString>;
559
- }, z.core.$strip>>;
560
- gqlOperations: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"query">, z.ZodObject<{
561
- create: z.ZodOptional<z.ZodBoolean>;
562
- update: z.ZodOptional<z.ZodBoolean>;
563
- delete: z.ZodOptional<z.ZodBoolean>;
564
- read: z.ZodOptional<z.ZodBoolean>;
565
- }, z.core.$strip>]>, z.ZodTransform<GqlOperations, "query" | {
566
- create?: boolean | undefined;
567
- update?: boolean | undefined;
568
- delete?: boolean | undefined;
569
- read?: boolean | undefined;
570
- }>>>;
571
- }, z.core.$strip>;
572
- /**
573
- * Input type for TailorDB service configuration (before schema parsing).
574
- * gqlOperations accepts both alias ("query") and object format.
575
- */
576
- type TailorDBServiceConfigInput = z.input<typeof TailorDBServiceConfigSchema>;
577
- type TailorDBExternalConfig = {
578
- external: true;
238
+ //#region src/types/executor.generated.d.ts
239
+ type RecordTrigger = {
240
+ /** Record event type */
241
+ kind: "recordCreated" | "recordUpdated" | "recordDeleted";
242
+ /** TailorDB type name to watch for events */
243
+ typeName: string;
244
+ /** Condition function to filter events */
245
+ condition?: Function | undefined;
579
246
  };
580
- type TailorDBServiceInput = {
581
- [namespace: string]: TailorDBServiceConfigInput | TailorDBExternalConfig;
247
+ type ResolverExecutedTrigger = {
248
+ kind: "resolverExecuted";
249
+ /** Name of the resolver to trigger on */
250
+ resolverName: string;
251
+ /** Condition function to filter events */
252
+ condition?: Function | undefined;
253
+ };
254
+ type ScheduleTriggerInput = {
255
+ kind: "schedule";
256
+ /** CRON expression for the schedule */
257
+ cron: string;
258
+ /** Timezone for the CRON schedule (default: UTC) */
259
+ timezone?: string | undefined;
260
+ };
261
+ type IncomingWebhookTrigger = {
262
+ kind: "incomingWebhook";
263
+ };
264
+ type IdpUserTrigger = {
265
+ /** IdP user event type */
266
+ kind: "idpUserCreated" | "idpUserUpdated" | "idpUserDeleted";
267
+ };
268
+ type AuthAccessTokenTrigger = {
269
+ /** Auth access token event type */
270
+ kind: "authAccessTokenIssued" | "authAccessTokenRefreshed" | "authAccessTokenRevoked";
271
+ };
272
+ type FunctionOperation = {
273
+ kind: "function" | "jobFunction";
274
+ /** Function implementation */
275
+ body: Function;
276
+ /** Auth invoker for the function execution */
277
+ authInvoker?: {
278
+ namespace: string;
279
+ machineUserName: string;
280
+ } | undefined;
281
+ };
282
+ type GqlOperation = {
283
+ kind: "graphql";
284
+ query: string;
285
+ /** Target application name for the GraphQL query */
286
+ appName?: string | undefined;
287
+ /** Function to compute GraphQL variables */
288
+ variables?: Function | undefined;
289
+ /** Auth invoker for the GraphQL execution */
290
+ authInvoker?: {
291
+ namespace: string;
292
+ machineUserName: string;
293
+ } | undefined;
294
+ };
295
+ type WebhookOperation = {
296
+ kind: "webhook";
297
+ /** Function returning the webhook URL */
298
+ url: Function;
299
+ /** Function to compute the request body */
300
+ requestBody?: Function | undefined;
301
+ /** HTTP headers for the webhook request */
302
+ headers?: {
303
+ [x: string]: string | {
304
+ vault: string;
305
+ key: string;
306
+ };
307
+ } | undefined;
308
+ };
309
+ type WorkflowOperation = {
310
+ kind: "workflow";
311
+ workflowName: string;
312
+ args?: Function | {
313
+ [x: string]: unknown;
314
+ } | undefined;
315
+ authInvoker?: {
316
+ namespace: string;
317
+ machineUserName: string;
318
+ } | undefined;
319
+ };
320
+ type ExecutorInput = {
321
+ /** Executor name */
322
+ name: string;
323
+ /** Event trigger configuration */
324
+ trigger: {
325
+ kind: "recordCreated" | "recordUpdated" | "recordDeleted";
326
+ typeName: string;
327
+ condition?: Function | undefined;
328
+ } | {
329
+ kind: "resolverExecuted";
330
+ resolverName: string;
331
+ condition?: Function | undefined;
332
+ } | {
333
+ kind: "schedule";
334
+ cron: string;
335
+ timezone?: string | undefined;
336
+ } | {
337
+ kind: "incomingWebhook";
338
+ } | {
339
+ kind: "idpUserCreated" | "idpUserUpdated" | "idpUserDeleted";
340
+ } | {
341
+ kind: "authAccessTokenIssued" | "authAccessTokenRefreshed" | "authAccessTokenRevoked";
342
+ };
343
+ /** Operation to execute when triggered */
344
+ operation: unknown;
345
+ /** Executor description */
346
+ description?: string | undefined;
347
+ /** Whether the executor is disabled */
348
+ disabled?: boolean | undefined;
349
+ };
350
+ type Executor = {
351
+ /** Executor name */
352
+ name: string;
353
+ /** Whether the executor is disabled */
354
+ disabled: boolean;
355
+ /** Event trigger configuration */
356
+ trigger: {
357
+ kind: "recordCreated" | "recordUpdated" | "recordDeleted";
358
+ typeName: string;
359
+ condition?: Function | undefined;
360
+ } | {
361
+ kind: "resolverExecuted";
362
+ resolverName: string;
363
+ condition?: Function | undefined;
364
+ } | {
365
+ kind: "schedule";
366
+ cron: string;
367
+ timezone: string;
368
+ } | {
369
+ kind: "incomingWebhook";
370
+ } | {
371
+ kind: "idpUserCreated" | "idpUserUpdated" | "idpUserDeleted";
372
+ } | {
373
+ kind: "authAccessTokenIssued" | "authAccessTokenRefreshed" | "authAccessTokenRevoked";
374
+ };
375
+ /** Operation to execute when triggered */
376
+ operation: {
377
+ kind: "workflow";
378
+ workflowName: string;
379
+ args?: Function | {
380
+ [x: string]: unknown;
381
+ } | undefined;
382
+ authInvoker?: {
383
+ namespace: string;
384
+ machineUserName: string;
385
+ } | undefined;
386
+ } | {
387
+ kind: "function" | "jobFunction";
388
+ body: Function;
389
+ authInvoker?: {
390
+ namespace: string;
391
+ machineUserName: string;
392
+ } | undefined;
393
+ } | {
394
+ kind: "graphql";
395
+ query: string;
396
+ appName?: string | undefined;
397
+ variables?: Function | undefined;
398
+ authInvoker?: {
399
+ namespace: string;
400
+ machineUserName: string;
401
+ } | undefined;
402
+ } | {
403
+ kind: "webhook";
404
+ url: Function;
405
+ requestBody?: Function | undefined;
406
+ headers?: {
407
+ [x: string]: string | {
408
+ vault: string;
409
+ key: string;
410
+ };
411
+ } | undefined;
412
+ };
413
+ /** Executor description */
414
+ description?: string | undefined;
415
+ };
416
+ //#endregion
417
+ //#region src/types/generator-config.d.ts
418
+ type GeneratorConfig = z.input<typeof BaseGeneratorConfigSchema>;
419
+ //#endregion
420
+ //#region src/types/resolver.generated.d.ts
421
+ type TailorFieldInput = {
422
+ /** Field data type */
423
+ type: "string" | "boolean" | "uuid" | "integer" | "float" | "decimal" | "enum" | "date" | "datetime" | "time" | "nested";
424
+ /** Field metadata configuration */
425
+ metadata: {
426
+ required?: boolean | undefined;
427
+ array?: boolean | undefined;
428
+ description?: string | undefined;
429
+ allowedValues?: {
430
+ value: string;
431
+ description?: string | undefined;
432
+ }[] | undefined;
433
+ hooks?: {
434
+ create?: Function | undefined;
435
+ update?: Function | undefined;
436
+ } | undefined;
437
+ typeName?: string | undefined;
438
+ };
439
+ fields: {
440
+ [x: string]: TailorFieldInput;
441
+ };
442
+ };
443
+ type Resolver = {
444
+ /** GraphQL operation type (query or mutation) */
445
+ operation: "query" | "mutation";
446
+ /** Resolver name */
447
+ name: string;
448
+ /** Resolver implementation function */
449
+ body: Function;
450
+ /** Output field definition */
451
+ output: {
452
+ type: "string" | "boolean" | "date" | "enum" | "uuid" | "integer" | "float" | "decimal" | "datetime" | "time" | "nested";
453
+ metadata: {
454
+ required?: boolean | undefined;
455
+ array?: boolean | undefined;
456
+ /** Resolver description */
457
+ description?: string | undefined;
458
+ allowedValues?: {
459
+ value: string;
460
+ /** Resolver description */
461
+ description?: string | undefined;
462
+ }[] | undefined;
463
+ hooks?: {
464
+ create?: Function | undefined;
465
+ update?: Function | undefined;
466
+ } | undefined;
467
+ typeName?: string | undefined;
468
+ };
469
+ fields: {
470
+ [x: string]: any;
471
+ };
472
+ };
473
+ /** Resolver description */
474
+ description?: string | undefined;
475
+ /** Input field definitions */
476
+ input?: {
477
+ [x: string]: any;
478
+ } | undefined;
479
+ /** Enable publishing events from this resolver */
480
+ publishEvents?: boolean | undefined;
582
481
  };
482
+ type ResolverInput = Resolver;
583
483
  //#endregion
584
484
  //#region src/configure/types/field.d.ts
585
485
  type AllowedValue = EnumValue;
@@ -623,34 +523,6 @@ type TailorUser = {
623
523
  /** Represents an unauthenticated user in the Tailor platform. */
624
524
  declare const unauthenticatedTailorUser: TailorUser;
625
525
  //#endregion
626
- //#region src/configure/types/actor.d.ts
627
- /** User type enum values from the Tailor Platform server. */
628
- type TailorActorType = "USER_TYPE_USER" | "USER_TYPE_MACHINE_USER" | "USER_TYPE_UNSPECIFIED";
629
- /** Represents an actor in event triggers. */
630
- type TailorActor = {
631
- /** The ID of the workspace the user belongs to. */
632
- workspaceId: string;
633
- /** The ID of the user. */
634
- userId: string;
635
- /**
636
- * A map of the user's attributes.
637
- * Maps from server's `attributeMap` field.
638
- */
639
- attributes: InferredAttributeMap | null;
640
- /**
641
- * A list of the user's attributes.
642
- * Maps from server's `attributes` field.
643
- */
644
- attributeList: InferredAttributeList;
645
- /** The type of the user. */
646
- userType: TailorActorType;
647
- };
648
- //#endregion
649
- //#region src/configure/types/env.d.ts
650
- interface Env {}
651
- /** Represents environment variables in the Tailor platform. */
652
- type TailorEnv = keyof Env extends never ? Record<string, string> : Env;
653
- //#endregion
654
526
  //#region src/configure/types/helpers.d.ts
655
527
  type Prettify<T> = { [K in keyof T as string extends K ? never : K]: T[K] } & {};
656
528
  type DeepWritable<T> = T extends Date | RegExp | Function ? T : T extends object ? { -readonly [P in keyof T]: DeepWritable<T[P]> } & {} : T;
@@ -672,122 +544,6 @@ type JsonCompatible<T> = T extends string | number | boolean | null | undefined
672
544
  toJSON: () => unknown;
673
545
  } ? never : { [K in keyof T]: JsonCompatible<T[K]> } : never;
674
546
  //#endregion
675
- //#region src/parser/service/resolver/schema.d.ts
676
- declare const QueryTypeSchema: z.ZodUnion<readonly [z.ZodLiteral<"query">, z.ZodLiteral<"mutation">]>;
677
- declare const TailorFieldSchema: z.ZodObject<{
678
- type: z.ZodEnum<{
679
- string: "string";
680
- boolean: "boolean";
681
- uuid: "uuid";
682
- integer: "integer";
683
- float: "float";
684
- decimal: "decimal";
685
- enum: "enum";
686
- date: "date";
687
- datetime: "datetime";
688
- time: "time";
689
- nested: "nested";
690
- }>;
691
- metadata: z.ZodObject<{
692
- required: z.ZodOptional<z.ZodBoolean>;
693
- array: z.ZodOptional<z.ZodBoolean>;
694
- description: z.ZodOptional<z.ZodString>;
695
- allowedValues: z.ZodOptional<z.ZodArray<z.ZodObject<{
696
- value: z.ZodString;
697
- description: z.ZodOptional<z.ZodString>;
698
- }, z.core.$strip>>>;
699
- hooks: z.ZodOptional<z.ZodObject<{
700
- create: z.ZodOptional<z.ZodCustom<Function, Function>>;
701
- update: z.ZodOptional<z.ZodCustom<Function, Function>>;
702
- }, z.core.$strip>>;
703
- typeName: z.ZodOptional<z.ZodString>;
704
- }, z.core.$strip>;
705
- fields: z.ZodRecord<z.ZodString, z.ZodObject< /*elided*/any, z.core.$strip>>;
706
- }, z.core.$strip>;
707
- declare const ResolverSchema: z.ZodObject<{
708
- operation: z.ZodUnion<readonly [z.ZodLiteral<"query">, z.ZodLiteral<"mutation">]>;
709
- name: z.ZodString;
710
- description: z.ZodOptional<z.ZodString>;
711
- input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
712
- type: z.ZodEnum<{
713
- string: "string";
714
- boolean: "boolean";
715
- uuid: "uuid";
716
- integer: "integer";
717
- float: "float";
718
- decimal: "decimal";
719
- enum: "enum";
720
- date: "date";
721
- datetime: "datetime";
722
- time: "time";
723
- nested: "nested";
724
- }>;
725
- metadata: z.ZodObject<{
726
- required: z.ZodOptional<z.ZodBoolean>;
727
- array: z.ZodOptional<z.ZodBoolean>;
728
- description: z.ZodOptional<z.ZodString>;
729
- allowedValues: z.ZodOptional<z.ZodArray<z.ZodObject<{
730
- value: z.ZodString;
731
- description: z.ZodOptional<z.ZodString>;
732
- }, z.core.$strip>>>;
733
- hooks: z.ZodOptional<z.ZodObject<{
734
- create: z.ZodOptional<z.ZodCustom<Function, Function>>;
735
- update: z.ZodOptional<z.ZodCustom<Function, Function>>;
736
- }, z.core.$strip>>;
737
- typeName: z.ZodOptional<z.ZodString>;
738
- }, z.core.$strip>;
739
- fields: z.ZodRecord<z.ZodString, z.ZodObject< /*elided*/any, z.core.$strip>>;
740
- }, z.core.$strip>>>;
741
- body: z.ZodCustom<Function, Function>;
742
- output: z.ZodObject<{
743
- type: z.ZodEnum<{
744
- string: "string";
745
- boolean: "boolean";
746
- uuid: "uuid";
747
- integer: "integer";
748
- float: "float";
749
- decimal: "decimal";
750
- enum: "enum";
751
- date: "date";
752
- datetime: "datetime";
753
- time: "time";
754
- nested: "nested";
755
- }>;
756
- metadata: z.ZodObject<{
757
- required: z.ZodOptional<z.ZodBoolean>;
758
- array: z.ZodOptional<z.ZodBoolean>;
759
- description: z.ZodOptional<z.ZodString>;
760
- allowedValues: z.ZodOptional<z.ZodArray<z.ZodObject<{
761
- value: z.ZodString;
762
- description: z.ZodOptional<z.ZodString>;
763
- }, z.core.$strip>>>;
764
- hooks: z.ZodOptional<z.ZodObject<{
765
- create: z.ZodOptional<z.ZodCustom<Function, Function>>;
766
- update: z.ZodOptional<z.ZodCustom<Function, Function>>;
767
- }, z.core.$strip>>;
768
- typeName: z.ZodOptional<z.ZodString>;
769
- }, z.core.$strip>;
770
- fields: z.ZodRecord<z.ZodString, z.ZodObject< /*elided*/any, z.core.$strip>>;
771
- }, z.core.$strip>;
772
- publishEvents: z.ZodOptional<z.ZodBoolean>;
773
- }, z.core.$strip>;
774
- //#endregion
775
- //#region src/parser/service/resolver/types.d.ts
776
- type TailorFieldInput = z.input<typeof TailorFieldSchema>;
777
- type QueryType = z.output<typeof QueryTypeSchema>;
778
- type ResolverInput = z.input<typeof ResolverSchema>;
779
- type Resolver = z.output<typeof ResolverSchema>;
780
- type ResolverServiceConfig = {
781
- files: string[];
782
- ignores?: string[];
783
- };
784
- type ResolverExternalConfig = {
785
- external: true;
786
- };
787
- type ResolverServiceInput = {
788
- [namespace: string]: ResolverServiceConfig | ResolverExternalConfig;
789
- };
790
- //#endregion
791
547
  //#region src/configure/types/type.d.ts
792
548
  type TailorAnyField = TailorField<any>;
793
549
  type FieldParseArgs = {
@@ -1028,7 +784,7 @@ type HasAnyCondition<Level extends "record" | "gql", User extends object, Update
1028
784
  /**
1029
785
  * Type representing a permission condition that combines user attributes, record fields, and literal values using comparison operators.
1030
786
  *
1031
- * The User type is extended by `user-defined.d.ts`, which is automatically generated when running `tailor-sdk generate`.
787
+ * The User type is extended by `tailor.d.ts`, which is automatically generated when running `tailor-sdk generate`.
1032
788
  * Attributes enabled in the config file's `auth.userProfile.attributes` (or
1033
789
  * `auth.machineUserAttributes` when userProfile is omitted) become available as types.
1034
790
  * @example
@@ -1063,6 +819,221 @@ declare const unsafeAllowAllTypePermission: TailorTypePermission;
1063
819
  */
1064
820
  declare const unsafeAllowAllGqlPermission: TailorTypeGqlPermission;
1065
821
  //#endregion
822
+ //#region src/types/tailordb.generated.d.ts
823
+ /**
824
+ * Configuration for GraphQL operations on a TailorDB type.
825
+ * All operations are enabled by default (undefined or true = enabled, false = disabled).
826
+ */
827
+ type GqlOperationsInput = "query" | {
828
+ create?: boolean | undefined;
829
+ update?: boolean | undefined;
830
+ delete?: boolean | undefined;
831
+ read?: boolean | undefined;
832
+ };
833
+ type TailorDBTypeParsedSettings = {
834
+ /** Custom plural form of the type name for GraphQL */
835
+ pluralForm?: string | undefined;
836
+ /** Enable aggregation queries for this type */
837
+ aggregation?: boolean | undefined;
838
+ /** Enable bulk upsert mutation for this type */
839
+ bulkUpsert?: boolean | undefined;
840
+ /** Configure GraphQL operations for this type. Use "query" for read-only mode, or an object for granular control. */
841
+ gqlOperations?: {
842
+ create?: boolean | undefined;
843
+ update?: boolean | undefined;
844
+ delete?: boolean | undefined;
845
+ read?: boolean | undefined;
846
+ } | undefined;
847
+ /**
848
+ * Enable publishing events for this type.
849
+ * When enabled, record creation/update/deletion events are published.
850
+ * If not specified, this is automatically set to true when an executor uses this type
851
+ * with recordCreated/recordUpdated/recordDeleted triggers. If explicitly set to false
852
+ * while an executor uses this type, an error will be thrown during apply.
853
+ */
854
+ publishEvents?: boolean | undefined;
855
+ };
856
+ type RawPermissions = {
857
+ record?: {
858
+ create: readonly (readonly (string | boolean | string[] | boolean[] | {
859
+ user: string;
860
+ } | {
861
+ record: string;
862
+ } | {
863
+ oldRecord: string;
864
+ } | {
865
+ newRecord: string;
866
+ })[] | readonly (boolean | readonly (string | boolean | string[] | boolean[] | {
867
+ user: string;
868
+ } | {
869
+ record: string;
870
+ } | {
871
+ oldRecord: string;
872
+ } | {
873
+ newRecord: string;
874
+ })[])[] | {
875
+ conditions: readonly (string | boolean | string[] | boolean[] | {
876
+ user: string;
877
+ } | {
878
+ record: string;
879
+ } | {
880
+ oldRecord: string;
881
+ } | {
882
+ newRecord: string;
883
+ })[] | readonly (readonly (string | boolean | string[] | boolean[] | {
884
+ user: string;
885
+ } | {
886
+ record: string;
887
+ } | {
888
+ oldRecord: string;
889
+ } | {
890
+ newRecord: string;
891
+ })[])[];
892
+ description?: string | undefined;
893
+ permit?: boolean | undefined;
894
+ })[];
895
+ read: readonly (readonly (string | boolean | string[] | boolean[] | {
896
+ user: string;
897
+ } | {
898
+ record: string;
899
+ } | {
900
+ oldRecord: string;
901
+ } | {
902
+ newRecord: string;
903
+ })[] | readonly (boolean | readonly (string | boolean | string[] | boolean[] | {
904
+ user: string;
905
+ } | {
906
+ record: string;
907
+ } | {
908
+ oldRecord: string;
909
+ } | {
910
+ newRecord: string;
911
+ })[])[] | {
912
+ conditions: readonly (string | boolean | string[] | boolean[] | {
913
+ user: string;
914
+ } | {
915
+ record: string;
916
+ } | {
917
+ oldRecord: string;
918
+ } | {
919
+ newRecord: string;
920
+ })[] | readonly (readonly (string | boolean | string[] | boolean[] | {
921
+ user: string;
922
+ } | {
923
+ record: string;
924
+ } | {
925
+ oldRecord: string;
926
+ } | {
927
+ newRecord: string;
928
+ })[])[];
929
+ description?: string | undefined;
930
+ permit?: boolean | undefined;
931
+ })[];
932
+ update: readonly (readonly (string | boolean | string[] | boolean[] | {
933
+ user: string;
934
+ } | {
935
+ record: string;
936
+ } | {
937
+ oldRecord: string;
938
+ } | {
939
+ newRecord: string;
940
+ })[] | readonly (boolean | readonly (string | boolean | string[] | boolean[] | {
941
+ user: string;
942
+ } | {
943
+ record: string;
944
+ } | {
945
+ oldRecord: string;
946
+ } | {
947
+ newRecord: string;
948
+ })[])[] | {
949
+ conditions: readonly (string | boolean | string[] | boolean[] | {
950
+ user: string;
951
+ } | {
952
+ record: string;
953
+ } | {
954
+ oldRecord: string;
955
+ } | {
956
+ newRecord: string;
957
+ })[] | readonly (readonly (string | boolean | string[] | boolean[] | {
958
+ user: string;
959
+ } | {
960
+ record: string;
961
+ } | {
962
+ oldRecord: string;
963
+ } | {
964
+ newRecord: string;
965
+ })[])[];
966
+ description?: string | undefined;
967
+ permit?: boolean | undefined;
968
+ })[];
969
+ delete: readonly (readonly (string | boolean | string[] | boolean[] | {
970
+ user: string;
971
+ } | {
972
+ record: string;
973
+ } | {
974
+ oldRecord: string;
975
+ } | {
976
+ newRecord: string;
977
+ })[] | readonly (boolean | readonly (string | boolean | string[] | boolean[] | {
978
+ user: string;
979
+ } | {
980
+ record: string;
981
+ } | {
982
+ oldRecord: string;
983
+ } | {
984
+ newRecord: string;
985
+ })[])[] | {
986
+ conditions: readonly (string | boolean | string[] | boolean[] | {
987
+ user: string;
988
+ } | {
989
+ record: string;
990
+ } | {
991
+ oldRecord: string;
992
+ } | {
993
+ newRecord: string;
994
+ })[] | readonly (readonly (string | boolean | string[] | boolean[] | {
995
+ user: string;
996
+ } | {
997
+ record: string;
998
+ } | {
999
+ oldRecord: string;
1000
+ } | {
1001
+ newRecord: string;
1002
+ })[])[];
1003
+ description?: string | undefined;
1004
+ permit?: boolean | undefined;
1005
+ })[];
1006
+ } | undefined;
1007
+ gql?: readonly {
1008
+ conditions: readonly (readonly (string | boolean | string[] | boolean[] | {
1009
+ user: string;
1010
+ })[])[];
1011
+ actions: "all" | readonly ("create" | "read" | "update" | "delete" | "aggregate" | "bulkUpsert")[];
1012
+ permit?: boolean | undefined;
1013
+ description?: string | undefined;
1014
+ }[] | undefined;
1015
+ };
1016
+ type TailorDBServiceConfigInput = {
1017
+ /** Glob patterns for TailorDB type definition files */
1018
+ files: string[];
1019
+ /** Glob patterns to exclude from type discovery */
1020
+ ignores?: string[] | undefined;
1021
+ /** URL for the ERD (Entity Relationship Diagram) site */
1022
+ erdSite?: string | undefined;
1023
+ /** Migration configuration */
1024
+ migration?: {
1025
+ directory: string;
1026
+ machineUser?: string | undefined;
1027
+ } | undefined;
1028
+ /** Default GraphQL operations for all types in this service */
1029
+ gqlOperations?: "query" | {
1030
+ create?: boolean | undefined;
1031
+ update?: boolean | undefined;
1032
+ delete?: boolean | undefined;
1033
+ read?: boolean | undefined;
1034
+ } | undefined;
1035
+ };
1036
+ //#endregion
1066
1037
  //#region src/configure/services/tailordb/types.d.ts
1067
1038
  type SerialConfig<T extends "string" | "integer" = "string" | "integer"> = Prettify<{
1068
1039
  start: number;
@@ -1121,29 +1092,7 @@ type IndexDef<T extends {
1121
1092
  unique?: boolean;
1122
1093
  name?: string;
1123
1094
  };
1124
- /**
1125
- * Configuration for GraphQL operations on a TailorDB type.
1126
- * All operations are enabled by default (undefined or true = enabled, false = disabled).
1127
- */
1128
- interface GqlOperations {
1129
- /** Enable create mutation (default: true) */
1130
- create?: boolean;
1131
- /** Enable update mutation (default: true) */
1132
- update?: boolean;
1133
- /** Enable delete mutation (default: true) */
1134
- delete?: boolean;
1135
- /** Enable read queries - get, list, aggregation (default: true) */
1136
- read?: boolean;
1137
- }
1138
- /**
1139
- * Alias for common GqlOperations configurations.
1140
- * - "query": Read-only mode - disables all mutations (create, update, delete)
1141
- */
1142
- type GqlOperationsAliasQuery = "query";
1143
- /**
1144
- * Configuration for GraphQL operations - either an alias string or detailed object.
1145
- */
1146
- type GqlOperationsConfig = GqlOperationsAliasQuery | GqlOperations;
1095
+ type GqlOperationsConfig = GqlOperationsInput;
1147
1096
  interface TypeFeatures {
1148
1097
  pluralForm?: string;
1149
1098
  aggregation?: true;
@@ -1160,979 +1109,24 @@ interface TypeFeatures {
1160
1109
  publishEvents?: boolean;
1161
1110
  }
1162
1111
  //#endregion
1163
- //#region src/parser/generator-config/types.d.ts
1164
- type GeneratorConfig = z.input<typeof BaseGeneratorConfigSchema>;
1165
- //#endregion
1166
- //#region src/parser/generator-config/index.d.ts
1167
- declare const BaseGeneratorConfigSchema: z.ZodUnion<readonly [z.ZodTuple<[z.ZodLiteral<"@tailor-platform/kysely-type">, z.ZodObject<{
1168
- distPath: z.ZodString;
1169
- }, z.core.$strip>], null>, z.ZodTuple<[z.ZodLiteral<"@tailor-platform/seed">, z.ZodObject<{
1170
- distPath: z.ZodString;
1171
- machineUserName: z.ZodOptional<z.ZodString>;
1172
- }, z.core.$strip>], null>, z.ZodTuple<[z.ZodLiteral<"@tailor-platform/enum-constants">, z.ZodObject<{
1173
- distPath: z.ZodString;
1174
- }, z.core.$strip>], null>, z.ZodTuple<[z.ZodLiteral<"@tailor-platform/file-utils">, z.ZodObject<{
1175
- distPath: z.ZodString;
1176
- }, z.core.$strip>], null>, z.ZodObject<{
1177
- id: z.ZodString;
1178
- description: z.ZodString;
1179
- dependencies: z.ZodArray<z.ZodEnum<{
1180
- executor: "executor";
1181
- tailordb: "tailordb";
1182
- resolver: "resolver";
1183
- }>>;
1184
- processType: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
1185
- processResolver: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
1186
- processExecutor: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
1187
- processTailorDBNamespace: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
1188
- processResolverNamespace: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
1189
- aggregate: z.ZodFunction<z.core.$ZodFunctionArgs, z.ZodAny>;
1190
- }, z.core.$strip>]>;
1191
- //#endregion
1192
- //#region src/parser/service/auth/schema.d.ts
1193
- declare const AuthInvokerSchema: z.ZodObject<{
1194
- namespace: z.ZodString;
1195
- machineUserName: z.ZodString;
1196
- }, z.core.$strip>;
1197
- declare const OIDCSchema: z.ZodObject<{
1198
- name: z.ZodString;
1199
- kind: z.ZodLiteral<"OIDC">;
1200
- clientID: z.ZodString;
1201
- clientSecret: z.ZodObject<{
1202
- vaultName: z.ZodString;
1203
- secretKey: z.ZodString;
1204
- }, z.core.$strip>;
1205
- providerURL: z.ZodString;
1206
- issuerURL: z.ZodOptional<z.ZodString>;
1207
- usernameClaim: z.ZodOptional<z.ZodString>;
1208
- }, z.core.$strip>;
1209
- declare const SAMLSchema: z.ZodObject<{
1210
- name: z.ZodString;
1211
- kind: z.ZodLiteral<"SAML">;
1212
- enableSignRequest: z.ZodDefault<z.ZodBoolean>;
1213
- metadataURL: z.ZodOptional<z.ZodString>;
1214
- rawMetadata: z.ZodOptional<z.ZodString>;
1215
- }, z.core.$strip>;
1216
- declare const IDTokenSchema: z.ZodObject<{
1217
- name: z.ZodString;
1218
- kind: z.ZodLiteral<"IDToken">;
1219
- providerURL: z.ZodString;
1220
- issuerURL: z.ZodOptional<z.ZodString>;
1221
- clientID: z.ZodString;
1222
- usernameClaim: z.ZodOptional<z.ZodString>;
1223
- }, z.core.$strip>;
1224
- declare const BuiltinIdPSchema: z.ZodObject<{
1225
- name: z.ZodString;
1226
- kind: z.ZodLiteral<"BuiltInIdP">;
1227
- namespace: z.ZodString;
1228
- clientName: z.ZodString;
1229
- }, z.core.$strip>;
1230
- declare const IdProviderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1231
- name: z.ZodString;
1232
- kind: z.ZodLiteral<"OIDC">;
1233
- clientID: z.ZodString;
1234
- clientSecret: z.ZodObject<{
1235
- vaultName: z.ZodString;
1236
- secretKey: z.ZodString;
1237
- }, z.core.$strip>;
1238
- providerURL: z.ZodString;
1239
- issuerURL: z.ZodOptional<z.ZodString>;
1240
- usernameClaim: z.ZodOptional<z.ZodString>;
1241
- }, z.core.$strip>, z.ZodObject<{
1242
- name: z.ZodString;
1243
- kind: z.ZodLiteral<"SAML">;
1244
- enableSignRequest: z.ZodDefault<z.ZodBoolean>;
1245
- metadataURL: z.ZodOptional<z.ZodString>;
1246
- rawMetadata: z.ZodOptional<z.ZodString>;
1247
- }, z.core.$strip>, z.ZodObject<{
1248
- name: z.ZodString;
1249
- kind: z.ZodLiteral<"IDToken">;
1250
- providerURL: z.ZodString;
1251
- issuerURL: z.ZodOptional<z.ZodString>;
1252
- clientID: z.ZodString;
1253
- usernameClaim: z.ZodOptional<z.ZodString>;
1254
- }, z.core.$strip>, z.ZodObject<{
1255
- name: z.ZodString;
1256
- kind: z.ZodLiteral<"BuiltInIdP">;
1257
- namespace: z.ZodString;
1258
- clientName: z.ZodString;
1259
- }, z.core.$strip>], "kind">;
1260
- declare const OAuth2ClientGrantTypeSchema: z.ZodUnion<readonly [z.ZodLiteral<"authorization_code">, z.ZodLiteral<"refresh_token">]>;
1261
- declare const OAuth2ClientSchema: z.ZodObject<{
1262
- description: z.ZodOptional<z.ZodString>;
1263
- grantTypes: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"authorization_code">, z.ZodLiteral<"refresh_token">]>>>;
1264
- redirectURIs: z.ZodArray<z.ZodUnion<readonly [z.ZodTemplateLiteral<`https://${string}`>, z.ZodTemplateLiteral<`http://${string}`>, z.ZodTemplateLiteral<`${string}:url`>, z.ZodTemplateLiteral<`${string}:url/${string}`>]>>;
1265
- clientType: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"confidential">, z.ZodLiteral<"public">, z.ZodLiteral<"browser">]>>;
1266
- accessTokenLifetimeSeconds: z.ZodPipe<z.ZodOptional<z.ZodNumber>, z.ZodTransform<{
1267
- seconds: bigint;
1268
- nanos: number;
1269
- } | undefined, number | undefined>>;
1270
- refreshTokenLifetimeSeconds: z.ZodPipe<z.ZodOptional<z.ZodNumber>, z.ZodTransform<{
1271
- seconds: bigint;
1272
- nanos: number;
1273
- } | undefined, number | undefined>>;
1274
- requireDpop: z.ZodOptional<z.ZodBoolean>;
1275
- }, z.core.$strip>;
1276
- declare const SCIMAuthorizationSchema: z.ZodObject<{
1277
- type: z.ZodUnion<readonly [z.ZodLiteral<"oauth2">, z.ZodLiteral<"bearer">]>;
1278
- bearerSecret: z.ZodOptional<z.ZodObject<{
1279
- vaultName: z.ZodString;
1280
- secretKey: z.ZodString;
1281
- }, z.core.$strip>>;
1282
- }, z.core.$strip>;
1283
- declare const SCIMAttributeTypeSchema: z.ZodUnion<readonly [z.ZodLiteral<"string">, z.ZodLiteral<"number">, z.ZodLiteral<"boolean">, z.ZodLiteral<"datetime">, z.ZodLiteral<"complex">]>;
1284
- declare const SCIMAttributeSchema: z.ZodObject<{
1285
- type: z.ZodUnion<readonly [z.ZodLiteral<"string">, z.ZodLiteral<"number">, z.ZodLiteral<"boolean">, z.ZodLiteral<"datetime">, z.ZodLiteral<"complex">]>;
1286
- name: z.ZodString;
1287
- description: z.ZodOptional<z.ZodString>;
1288
- mutability: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"readOnly">, z.ZodLiteral<"readWrite">, z.ZodLiteral<"writeOnly">]>>;
1289
- required: z.ZodOptional<z.ZodBoolean>;
1290
- multiValued: z.ZodOptional<z.ZodBoolean>;
1291
- uniqueness: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"server">, z.ZodLiteral<"global">]>>;
1292
- canonicalValues: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
1293
- subAttributes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject< /*elided*/any, z.core.$strip>>>>;
1294
- }, z.core.$strip>;
1295
- declare const SCIMAttributeMappingSchema: z.ZodObject<{
1296
- tailorDBField: z.ZodString;
1297
- scimPath: z.ZodString;
1298
- }, z.core.$strip>;
1299
- declare const SCIMResourceSchema: z.ZodObject<{
1300
- name: z.ZodString;
1301
- tailorDBNamespace: z.ZodString;
1302
- tailorDBType: z.ZodString;
1303
- coreSchema: z.ZodObject<{
1304
- name: z.ZodString;
1305
- attributes: z.ZodArray<z.ZodObject<{
1306
- type: z.ZodUnion<readonly [z.ZodLiteral<"string">, z.ZodLiteral<"number">, z.ZodLiteral<"boolean">, z.ZodLiteral<"datetime">, z.ZodLiteral<"complex">]>;
1307
- name: z.ZodString;
1308
- description: z.ZodOptional<z.ZodString>;
1309
- mutability: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"readOnly">, z.ZodLiteral<"readWrite">, z.ZodLiteral<"writeOnly">]>>;
1310
- required: z.ZodOptional<z.ZodBoolean>;
1311
- multiValued: z.ZodOptional<z.ZodBoolean>;
1312
- uniqueness: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"server">, z.ZodLiteral<"global">]>>;
1313
- canonicalValues: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
1314
- subAttributes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject< /*elided*/any, z.core.$strip>>>>;
1315
- }, z.core.$strip>>;
1316
- }, z.core.$strip>;
1317
- attributeMapping: z.ZodArray<z.ZodObject<{
1318
- tailorDBField: z.ZodString;
1319
- scimPath: z.ZodString;
1320
- }, z.core.$strip>>;
1321
- }, z.core.$strip>;
1322
- declare const SCIMSchema: z.ZodObject<{
1323
- machineUserName: z.ZodString;
1324
- authorization: z.ZodObject<{
1325
- type: z.ZodUnion<readonly [z.ZodLiteral<"oauth2">, z.ZodLiteral<"bearer">]>;
1326
- bearerSecret: z.ZodOptional<z.ZodObject<{
1327
- vaultName: z.ZodString;
1328
- secretKey: z.ZodString;
1329
- }, z.core.$strip>>;
1330
- }, z.core.$strip>;
1331
- resources: z.ZodArray<z.ZodObject<{
1332
- name: z.ZodString;
1333
- tailorDBNamespace: z.ZodString;
1334
- tailorDBType: z.ZodString;
1335
- coreSchema: z.ZodObject<{
1336
- name: z.ZodString;
1337
- attributes: z.ZodArray<z.ZodObject<{
1338
- type: z.ZodUnion<readonly [z.ZodLiteral<"string">, z.ZodLiteral<"number">, z.ZodLiteral<"boolean">, z.ZodLiteral<"datetime">, z.ZodLiteral<"complex">]>;
1339
- name: z.ZodString;
1340
- description: z.ZodOptional<z.ZodString>;
1341
- mutability: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"readOnly">, z.ZodLiteral<"readWrite">, z.ZodLiteral<"writeOnly">]>>;
1342
- required: z.ZodOptional<z.ZodBoolean>;
1343
- multiValued: z.ZodOptional<z.ZodBoolean>;
1344
- uniqueness: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"server">, z.ZodLiteral<"global">]>>;
1345
- canonicalValues: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
1346
- subAttributes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject< /*elided*/any, z.core.$strip>>>>;
1347
- }, z.core.$strip>>;
1348
- }, z.core.$strip>;
1349
- attributeMapping: z.ZodArray<z.ZodObject<{
1350
- tailorDBField: z.ZodString;
1351
- scimPath: z.ZodString;
1352
- }, z.core.$strip>>;
1353
- }, z.core.$strip>>;
1354
- }, z.core.$strip>;
1355
- declare const TenantProviderSchema: z.ZodObject<{
1356
- namespace: z.ZodString;
1357
- type: z.ZodString;
1358
- signatureField: z.ZodString;
1359
- }, z.core.$strip>;
1360
- //#endregion
1361
- //#region src/parser/service/auth/types.d.ts
1362
- type AuthInvoker = z.output<typeof AuthInvokerSchema>;
1363
- type AuthInvokerWithName<M extends string> = Omit<AuthInvoker, "machineUserName"> & {
1364
- machineUserName: M;
1365
- };
1366
- type OIDC = z.output<typeof OIDCSchema>;
1367
- type SAML = z.output<typeof SAMLSchema>;
1368
- type IDToken = z.output<typeof IDTokenSchema>;
1369
- type BuiltinIdP = z.output<typeof BuiltinIdPSchema>;
1370
- type IdProviderConfig = z.output<typeof IdProviderSchema>;
1371
- type OAuth2ClientGrantType = z.output<typeof OAuth2ClientGrantTypeSchema>;
1372
- type OAuth2ClientInput = z.input<typeof OAuth2ClientSchema>;
1373
- type SCIMAuthorization = z.output<typeof SCIMAuthorizationSchema>;
1374
- type SCIMAttributeType = z.output<typeof SCIMAttributeTypeSchema>;
1375
- type SCIMAttribute = z.output<typeof SCIMAttributeSchema>;
1376
- type SCIMAttributeMapping = z.output<typeof SCIMAttributeMappingSchema>;
1377
- type SCIMResource = z.output<typeof SCIMResourceSchema>;
1378
- type SCIMConfig = z.output<typeof SCIMSchema>;
1379
- type TenantProviderConfig = z.output<typeof TenantProviderSchema>;
1380
- type ValueOperand = string | boolean | string[] | boolean[];
1381
- type AuthAttributeValue = ValueOperand | null | undefined;
1382
- type UserFieldKeys<User extends TailorDBInstance> = keyof output<User> & string;
1383
- type FieldDefined<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = User["fields"][Key] extends {
1384
- _defined: infer Defined;
1385
- } ? Defined : never;
1386
- type FieldOutput<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = output<User>[Key];
1387
- type FieldIsRequired<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = undefined extends FieldOutput<User, Key> ? false : true;
1388
- type FieldIsOfType<User extends TailorDBInstance, Key extends UserFieldKeys<User>, Type extends string> = FieldDefined<User, Key> extends {
1389
- type: Type;
1390
- } ? true : false;
1391
- type FieldIsArray<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = FieldDefined<User, Key> extends {
1392
- array: true;
1393
- } ? true : false;
1394
- type FieldIsUnique<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = FieldDefined<User, Key> extends {
1395
- unique: true;
1396
- } ? true : false;
1397
- type FieldSupportsValueOperand<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = FieldOutput<User, Key> extends ValueOperand | null | undefined ? true : false;
1398
- 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>];
1399
- 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>];
1400
- 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>];
1401
- type UserAttributeMap<User extends TailorDBInstance> = { [K in UserAttributeKey<User>]?: true };
1402
- type DisallowExtraKeys<T, Allowed extends PropertyKey> = T & { [K in Exclude<keyof T, Allowed>]: never };
1403
- type AttributeListValue<User extends TailorDBInstance, Key extends UserAttributeListKey<User>> = Key extends keyof output<User> ? output<User>[Key] : never;
1404
- type AttributeListToTuple<User extends TailorDBInstance, AttributeList$1 extends readonly UserAttributeListKey<User>[]> = { [Index in keyof AttributeList$1]: AttributeList$1[Index] extends UserAttributeListKey<User> ? AttributeListValue<User, AttributeList$1[Index]> : never };
1405
- type AttributeMapSelectedKeys<User extends TailorDBInstance, AttributeMap$1 extends UserAttributeMap<User>> = Extract<{ [K in keyof AttributeMap$1]-?: undefined extends AttributeMap$1[K] ? never : K }[keyof AttributeMap$1], UserAttributeKey<User>>;
1406
- type UserProfile<User extends TailorDBInstance, AttributeMap$1 extends UserAttributeMap<User>, AttributeList$1 extends UserAttributeListKey<User>[]> = {
1407
- /**
1408
- * TailorDB namespace where the user type is defined.
1409
- *
1410
- * Usually auto-resolved, so you don't need to specify this.
1411
- * Required only when multiple TailorDBs exist and the type is in an external TailorDB.
1412
- */
1413
- namespace?: string;
1414
- type: User;
1415
- usernameField: UsernameFieldKey<User>;
1416
- attributes?: DisallowExtraKeys<AttributeMap$1, UserAttributeKey<User>>;
1417
- attributeList?: AttributeList$1;
1418
- };
1419
- type MachineUserAttributeFields = Record<string, TailorField<DefinedFieldMetadata, unknown, FieldMetadata, TailorFieldType>>;
1420
- type TailorFieldOutputValue<Field> = Field extends TailorField<DefinedFieldMetadata, infer Output, FieldMetadata, TailorFieldType> ? Output : never;
1421
- type MachineUserAttributeValues<Fields extends MachineUserAttributeFields> = { [K in keyof Fields]: TailorFieldOutputValue<Fields[K]> extends ValueOperand | null | undefined ? TailorFieldOutputValue<Fields[K]> : never };
1422
- type MachineUserFromAttributes<Fields extends MachineUserAttributeFields> = (keyof Fields extends never ? {
1423
- attributes?: never;
1424
- } : {
1425
- attributes: DisallowExtraKeys<MachineUserAttributeValues<Fields>, keyof Fields>;
1426
- }) & {
1427
- attributeList?: string[];
1428
- };
1429
- type MachineUser<User extends TailorDBInstance, AttributeMap$1 extends UserAttributeMap<User> = UserAttributeMap<User>, AttributeList$1 extends UserAttributeListKey<User>[] = [], MachineUserAttributes extends MachineUserAttributeFields | undefined = undefined> = IsAny<MachineUserAttributes> extends true ? IsAny<User> extends true ? {
1430
- attributes: Record<string, AuthAttributeValue>;
1431
- attributeList?: string[];
1432
- } : (AttributeMapSelectedKeys<User, AttributeMap$1> extends never ? {
1433
- attributes?: never;
1434
- } : {
1435
- attributes: { [K in AttributeMapSelectedKeys<User, AttributeMap$1>]: K extends keyof output<User> ? output<User>[K] : never } & { [K in Exclude<keyof output<User>, AttributeMapSelectedKeys<User, AttributeMap$1>>]?: never };
1436
- }) & ([] extends AttributeList$1 ? {
1437
- attributeList?: never;
1438
- } : {
1439
- attributeList: AttributeListToTuple<User, AttributeList$1>;
1440
- }) : [MachineUserAttributes] extends [MachineUserAttributeFields] ? MachineUserFromAttributes<MachineUserAttributes> : IsAny<User> extends true ? {
1441
- attributes: Record<string, AuthAttributeValue>;
1442
- attributeList?: string[];
1443
- } : (AttributeMapSelectedKeys<User, AttributeMap$1> extends never ? {
1444
- attributes?: never;
1445
- } : {
1446
- attributes: { [K in AttributeMapSelectedKeys<User, AttributeMap$1>]: K extends keyof output<User> ? output<User>[K] : never } & { [K in Exclude<keyof output<User>, AttributeMapSelectedKeys<User, AttributeMap$1>>]?: never };
1447
- }) & ([] extends AttributeList$1 ? {
1448
- attributeList?: never;
1449
- } : {
1450
- attributeList: AttributeListToTuple<User, AttributeList$1>;
1451
- });
1452
- type AuthServiceInput<User extends TailorDBInstance, AttributeMap$1 extends UserAttributeMap<User>, AttributeList$1 extends UserAttributeListKey<User>[], MachineUserNames extends string, MachineUserAttributes extends MachineUserAttributeFields | undefined = MachineUserAttributeFields | undefined> = {
1453
- userProfile?: UserProfile<User, AttributeMap$1, AttributeList$1>;
1454
- machineUserAttributes?: MachineUserAttributes;
1455
- machineUsers?: Record<MachineUserNames, MachineUser<User, AttributeMap$1, AttributeList$1, MachineUserAttributes>>;
1456
- oauth2Clients?: Record<string, OAuth2ClientInput>;
1457
- idProvider?: IdProviderConfig;
1458
- scim?: SCIMConfig;
1459
- tenantProvider?: TenantProviderConfig;
1460
- publishSessionEvents?: boolean;
1461
- };
1462
- declare const authDefinitionBrand: unique symbol;
1463
- type AuthDefinitionBrand = {
1464
- readonly [authDefinitionBrand]: true;
1465
- };
1466
- type DefinedAuth<Name extends string, Config, MachineUserNames extends string> = Config & {
1467
- name: Name;
1468
- invoker<M extends MachineUserNames>(machineUser: M): AuthInvokerWithName<M>;
1469
- } & AuthDefinitionBrand;
1470
- type AuthExternalConfig = {
1471
- name: string;
1472
- external: true;
1473
- };
1474
- type AuthServiceInputLoose = AuthServiceInput<any, any, any, string, any>;
1475
- type AuthOwnConfig = DefinedAuth<string, AuthServiceInputLoose, string>;
1476
- type AuthConfig = AuthOwnConfig | AuthExternalConfig;
1477
- //#endregion
1478
- //#region src/parser/service/executor/schema.d.ts
1479
- declare const RecordTriggerSchema: z.ZodObject<{
1480
- kind: z.ZodEnum<{
1481
- recordCreated: "recordCreated";
1482
- recordUpdated: "recordUpdated";
1483
- recordDeleted: "recordDeleted";
1484
- }>;
1485
- typeName: z.ZodString;
1486
- condition: z.ZodOptional<z.ZodCustom<Function, Function>>;
1487
- }, z.core.$strip>;
1488
- declare const ResolverExecutedTriggerSchema: z.ZodObject<{
1489
- kind: z.ZodLiteral<"resolverExecuted">;
1490
- resolverName: z.ZodString;
1491
- condition: z.ZodOptional<z.ZodCustom<Function, Function>>;
1492
- }, z.core.$strip>;
1493
- declare const ScheduleTriggerSchema: z.ZodObject<{
1494
- kind: z.ZodLiteral<"schedule">;
1495
- cron: z.ZodString;
1496
- timezone: z.ZodDefault<z.ZodOptional<z.ZodString>>;
1497
- }, z.core.$strip>;
1498
- declare const IncomingWebhookTriggerSchema: z.ZodObject<{
1499
- kind: z.ZodLiteral<"incomingWebhook">;
1500
- }, z.core.$strip>;
1501
- declare const IdpUserTriggerSchema: z.ZodObject<{
1502
- kind: z.ZodEnum<{
1503
- idpUserCreated: "idpUserCreated";
1504
- idpUserUpdated: "idpUserUpdated";
1505
- idpUserDeleted: "idpUserDeleted";
1506
- }>;
1507
- }, z.core.$strip>;
1508
- declare const AuthAccessTokenTriggerSchema: z.ZodObject<{
1509
- kind: z.ZodEnum<{
1510
- authAccessTokenIssued: "authAccessTokenIssued";
1511
- authAccessTokenRefreshed: "authAccessTokenRefreshed";
1512
- authAccessTokenRevoked: "authAccessTokenRevoked";
1513
- }>;
1514
- }, z.core.$strip>;
1515
- declare const FunctionOperationSchema: z.ZodObject<{
1516
- kind: z.ZodEnum<{
1517
- function: "function";
1518
- jobFunction: "jobFunction";
1519
- }>;
1520
- body: z.ZodCustom<Function, Function>;
1521
- authInvoker: z.ZodOptional<z.ZodObject<{
1522
- namespace: z.ZodString;
1523
- machineUserName: z.ZodString;
1524
- }, z.core.$strip>>;
1525
- }, z.core.$strip>;
1526
- declare const GqlOperationSchema: z.ZodObject<{
1527
- kind: z.ZodLiteral<"graphql">;
1528
- appName: z.ZodOptional<z.ZodString>;
1529
- query: z.ZodPipe<z.ZodTransform<string, unknown>, z.ZodString>;
1530
- variables: z.ZodOptional<z.ZodCustom<Function, Function>>;
1531
- authInvoker: z.ZodOptional<z.ZodObject<{
1532
- namespace: z.ZodString;
1533
- machineUserName: z.ZodString;
1534
- }, z.core.$strip>>;
1535
- }, z.core.$strip>;
1536
- declare const WebhookOperationSchema: z.ZodObject<{
1537
- kind: z.ZodLiteral<"webhook">;
1538
- url: z.ZodCustom<Function, Function>;
1539
- requestBody: z.ZodOptional<z.ZodCustom<Function, Function>>;
1540
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1541
- vault: z.ZodString;
1542
- key: z.ZodString;
1543
- }, z.core.$strip>]>>>;
1544
- }, z.core.$strip>;
1545
- declare const WorkflowOperationSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodObject<{
1546
- kind: z.ZodLiteral<"workflow">;
1547
- workflowName: z.ZodString;
1548
- args: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodCustom<Function, Function>]>>;
1549
- authInvoker: z.ZodOptional<z.ZodObject<{
1550
- namespace: z.ZodString;
1551
- machineUserName: z.ZodString;
1552
- }, z.core.$strip>>;
1553
- }, z.core.$strip>>;
1554
- declare const ExecutorSchema: z.ZodObject<{
1555
- name: z.ZodString;
1556
- description: z.ZodOptional<z.ZodString>;
1557
- disabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1558
- trigger: z.ZodDiscriminatedUnion<[z.ZodObject<{
1559
- kind: z.ZodEnum<{
1560
- recordCreated: "recordCreated";
1561
- recordUpdated: "recordUpdated";
1562
- recordDeleted: "recordDeleted";
1563
- }>;
1564
- typeName: z.ZodString;
1565
- condition: z.ZodOptional<z.ZodCustom<Function, Function>>;
1566
- }, z.core.$strip>, z.ZodObject<{
1567
- kind: z.ZodLiteral<"resolverExecuted">;
1568
- resolverName: z.ZodString;
1569
- condition: z.ZodOptional<z.ZodCustom<Function, Function>>;
1570
- }, z.core.$strip>, z.ZodObject<{
1571
- kind: z.ZodLiteral<"schedule">;
1572
- cron: z.ZodString;
1573
- timezone: z.ZodDefault<z.ZodOptional<z.ZodString>>;
1574
- }, z.core.$strip>, z.ZodObject<{
1575
- kind: z.ZodLiteral<"incomingWebhook">;
1576
- }, z.core.$strip>, z.ZodObject<{
1577
- kind: z.ZodEnum<{
1578
- idpUserCreated: "idpUserCreated";
1579
- idpUserUpdated: "idpUserUpdated";
1580
- idpUserDeleted: "idpUserDeleted";
1581
- }>;
1582
- }, z.core.$strip>, z.ZodObject<{
1583
- kind: z.ZodEnum<{
1584
- authAccessTokenIssued: "authAccessTokenIssued";
1585
- authAccessTokenRefreshed: "authAccessTokenRefreshed";
1586
- authAccessTokenRevoked: "authAccessTokenRevoked";
1587
- }>;
1588
- }, z.core.$strip>], "kind">;
1589
- operation: z.ZodUnion<readonly [z.ZodObject<{
1590
- kind: z.ZodEnum<{
1591
- function: "function";
1592
- jobFunction: "jobFunction";
1593
- }>;
1594
- body: z.ZodCustom<Function, Function>;
1595
- authInvoker: z.ZodOptional<z.ZodObject<{
1596
- namespace: z.ZodString;
1597
- machineUserName: z.ZodString;
1598
- }, z.core.$strip>>;
1599
- }, z.core.$strip>, z.ZodObject<{
1600
- kind: z.ZodLiteral<"graphql">;
1601
- appName: z.ZodOptional<z.ZodString>;
1602
- query: z.ZodPipe<z.ZodTransform<string, unknown>, z.ZodString>;
1603
- variables: z.ZodOptional<z.ZodCustom<Function, Function>>;
1604
- authInvoker: z.ZodOptional<z.ZodObject<{
1605
- namespace: z.ZodString;
1606
- machineUserName: z.ZodString;
1607
- }, z.core.$strip>>;
1608
- }, z.core.$strip>, z.ZodObject<{
1609
- kind: z.ZodLiteral<"webhook">;
1610
- url: z.ZodCustom<Function, Function>;
1611
- requestBody: z.ZodOptional<z.ZodCustom<Function, Function>>;
1612
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1613
- vault: z.ZodString;
1614
- key: z.ZodString;
1615
- }, z.core.$strip>]>>>;
1616
- }, z.core.$strip>, z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodObject<{
1617
- kind: z.ZodLiteral<"workflow">;
1618
- workflowName: z.ZodString;
1619
- args: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodCustom<Function, Function>]>>;
1620
- authInvoker: z.ZodOptional<z.ZodObject<{
1621
- namespace: z.ZodString;
1622
- machineUserName: z.ZodString;
1623
- }, z.core.$strip>>;
1624
- }, z.core.$strip>>]>;
1625
- }, z.core.$strip>;
1626
- //#endregion
1627
- //#region src/parser/service/executor/types.d.ts
1628
- type RecordTrigger = z.infer<typeof RecordTriggerSchema>;
1629
- type ResolverExecutedTrigger = z.infer<typeof ResolverExecutedTriggerSchema>;
1630
- type ScheduleTriggerInput = z.input<typeof ScheduleTriggerSchema>;
1631
- type IncomingWebhookTrigger = z.infer<typeof IncomingWebhookTriggerSchema>;
1632
- type IdpUserTrigger = z.infer<typeof IdpUserTriggerSchema>;
1633
- type AuthAccessTokenTrigger = z.infer<typeof AuthAccessTokenTriggerSchema>;
1634
- type FunctionOperation = z.infer<typeof FunctionOperationSchema>;
1635
- type GqlOperation = z.infer<typeof GqlOperationSchema>;
1636
- type WebhookOperation = z.infer<typeof WebhookOperationSchema>;
1637
- type WorkflowOperation = z.infer<typeof WorkflowOperationSchema>;
1638
- type Executor = z.infer<typeof ExecutorSchema>;
1639
- type ExecutorInput = z.input<typeof ExecutorSchema>;
1640
- type ExecutorServiceConfig = {
1641
- files: string[];
1642
- ignores?: string[];
1643
- };
1644
- type ExecutorServiceInput = ExecutorServiceConfig;
1645
- //#endregion
1646
- //#region src/parser/plugin-config/generation-types.d.ts
1647
- /**
1648
- * A single generated file to write to disk.
1649
- */
1650
- interface GeneratedFile {
1651
- path: string;
1652
- content: string;
1653
- skipIfExists?: boolean;
1654
- executable?: boolean;
1655
- }
1656
- /**
1657
- * Result returned by generation-time hooks.
1658
- */
1659
- interface GeneratorResult {
1660
- files: GeneratedFile[];
1661
- errors?: string[];
1662
- }
1663
- /**
1664
- * Auth configuration available to generation-time hooks.
1665
- */
1666
- interface GeneratorAuthInput {
1667
- name: string;
1668
- userProfile?: {
1669
- typeName: string;
1670
- namespace: string;
1671
- usernameField: string;
1672
- };
1673
- machineUsers?: Record<string, {
1674
- attributes: Record<string, unknown>;
1675
- }>;
1676
- oauth2Clients?: Record<string, OAuth2ClientInput>;
1677
- idProvider?: IdProviderConfig;
1678
- }
1679
- /**
1680
- * Namespace-level TailorDB data available to generation-time hooks.
1681
- */
1682
- interface TailorDBNamespaceData {
1683
- /** Namespace name */
1684
- namespace: string;
1685
- /** All TailorDB types in this namespace, keyed by type name */
1686
- types: Record<string, TailorDBType>;
1687
- /** Source info for each type (file path, export name, plugin info) */
1688
- sourceInfo: ReadonlyMap<string, TypeSourceInfoEntry>;
1689
- /** Plugin attachments configured on each type via .plugin() method */
1690
- pluginAttachments: ReadonlyMap<string, readonly PluginAttachment[]>;
1691
- }
1692
- /**
1693
- * Namespace-level resolver data available to generation-time hooks.
1694
- */
1695
- interface ResolverNamespaceData {
1696
- /** Namespace name */
1697
- namespace: string;
1698
- /** All resolvers in this namespace, keyed by resolver name */
1699
- resolvers: Record<string, Resolver>;
1700
- }
1701
- /**
1702
- * Context passed to plugin's onTailorDBReady hook.
1703
- * Called after all TailorDB types are loaded and finalized.
1704
- * @template PluginConfig - Plugin-level configuration type
1705
- */
1706
- interface TailorDBReadyContext<PluginConfig = unknown> {
1707
- /** All TailorDB namespaces with their types and metadata */
1708
- tailordb: TailorDBNamespaceData[];
1709
- /** Auth configuration */
1710
- auth?: GeneratorAuthInput;
1711
- /** Base directory for generated files */
1712
- baseDir: string;
1713
- /** Path to tailor.config.ts */
1714
- configPath: string;
1715
- /** Plugin-level configuration passed via definePlugins() */
1716
- pluginConfig: PluginConfig;
1717
- }
1718
- /**
1719
- * Context passed to plugin's onResolverReady hook.
1720
- * Called after all resolvers are loaded and finalized.
1721
- * @template PluginConfig - Plugin-level configuration type
1722
- */
1723
- interface ResolverReadyContext<PluginConfig = unknown> {
1724
- /** All TailorDB namespaces with their types and metadata */
1725
- tailordb: TailorDBNamespaceData[];
1726
- /** All resolver namespaces with their resolvers */
1727
- resolvers: ResolverNamespaceData[];
1728
- /** Auth configuration */
1729
- auth?: GeneratorAuthInput;
1730
- /** Base directory for generated files */
1731
- baseDir: string;
1732
- /** Path to tailor.config.ts */
1733
- configPath: string;
1734
- /** Plugin-level configuration passed via definePlugins() */
1735
- pluginConfig: PluginConfig;
1736
- }
1737
- /**
1738
- * Context passed to plugin's onExecutorReady hook.
1739
- * Called after all executors are loaded and finalized.
1740
- * @template PluginConfig - Plugin-level configuration type
1741
- */
1742
- interface ExecutorReadyContext<PluginConfig = unknown> {
1743
- /** All TailorDB namespaces with their types and metadata */
1744
- tailordb: TailorDBNamespaceData[];
1745
- /** All resolver namespaces with their resolvers */
1746
- resolvers: ResolverNamespaceData[];
1747
- /** All executors, keyed by executor name */
1748
- executors: Record<string, Executor>;
1749
- /** Auth configuration */
1750
- auth?: GeneratorAuthInput;
1751
- /** Base directory for generated files */
1752
- baseDir: string;
1753
- /** Path to tailor.config.ts */
1754
- configPath: string;
1755
- /** Plugin-level configuration passed via definePlugins() */
1756
- pluginConfig: PluginConfig;
1757
- }
1758
- //#endregion
1759
- //#region src/parser/plugin-config/types.d.ts
1760
- type TypeConfigRequired<PluginConfig = unknown> = boolean | ((pluginConfig: PluginConfig | undefined) => boolean);
1761
- /**
1762
- * Interface for plugin configuration mapping.
1763
- * Extend this interface via declaration merging to add typed plugin configs.
1764
- *
1765
- * The `Fields` type parameter provides field names from the type being configured,
1766
- * enabling type-safe field references in plugin configs.
1767
- * @example
1768
- * ```typescript
1769
- * // In your plugin package or types file:
1770
- * declare module "@tailor-platform/sdk" {
1771
- * interface PluginConfigs<Fields extends string> {
1772
- * "@my-company/i18n": {
1773
- * labels: Partial<Record<Fields, { ja: string; en: string }>>;
1774
- * };
1775
- * }
1776
- * }
1777
- * ```
1778
- */
1779
- interface PluginConfigs<Fields extends string = string> {}
1780
- /**
1781
- * Plugin attachment stored on TailorAnyDBType instances.
1782
- * This is the configuration passed via `.plugin()` method.
1783
- */
1784
- interface PluginAttachment {
1785
- pluginId: string;
1786
- config: unknown;
1787
- }
1788
- /**
1789
- * Context passed to plugin's process method
1790
- */
1791
- interface PluginProcessContext<TypeConfig = unknown, PluginConfig = unknown> {
1792
- /** The raw TailorDB type being processed */
1793
- type: TailorAnyDBType;
1794
- /** Per-type configuration passed via .plugin() method */
1795
- typeConfig: TypeConfig;
1796
- /** Plugin-level configuration passed via definePlugins() */
1797
- pluginConfig: PluginConfig;
1798
- /** Namespace of the TailorDB type */
1799
- namespace: string;
1800
- }
1801
- /**
1802
- * Context passed to plugin's onNamespaceLoaded hook.
1803
- * Used for plugins that operate on a namespace without requiring a source type.
1804
- */
1805
- interface PluginNamespaceProcessContext<PluginConfig = unknown> {
1806
- /** Plugin-level configuration passed via definePlugins() */
1807
- pluginConfig: PluginConfig;
1808
- /** Target namespace for generated types */
1809
- namespace: string;
1810
- }
1811
- /**
1812
- * Interface representing a TailorDB type for plugin output.
1813
- * This interface is satisfied by db.type() instances.
1814
- */
1815
- interface TailorDBTypeForPlugin {
1816
- /** The name of the type */
1817
- readonly name: string;
1818
- /** The field definitions */
1819
- readonly fields: Record<string, unknown>;
1820
- }
1821
- /**
1822
- * Type generated by a plugin - use db.type() to create these.
1823
- */
1824
- type PluginGeneratedType = TailorDBTypeForPlugin;
1825
- /**
1826
- * Map of generated types keyed by kind identifier.
1827
- * The kind is used to generate distinct TypeScript type files for each generated type.
1828
- * @example
1829
- * ```typescript
1830
- * {
1831
- * request: changeRequest,
1832
- * step: changeStep,
1833
- * approval: changeApproval,
1834
- * }
1835
- * ```
1836
- */
1837
- type PluginGeneratedTypes = Record<string, PluginGeneratedType>;
1838
- /**
1839
- * Resolver definition generated by a plugin.
1840
- * Fields can be TailorDB field instances or raw field definitions.
1841
- */
1842
- interface PluginGeneratedResolver {
1843
- name: string;
1844
- operation: "query" | "mutation";
1845
- inputFields?: Record<string, unknown>;
1846
- outputFields: Record<string, unknown>;
1847
- /** Function body code as string */
1848
- body: string;
1849
- }
1850
- /**
1851
- * Record trigger configuration for plugin-generated executors
1852
- */
1853
- interface PluginRecordTriggerConfig {
1854
- kind: "recordCreated" | "recordUpdated" | "recordDeleted";
1855
- /** TailorDB type name for record triggers */
1856
- typeName: string;
1857
- }
1858
- /**
1859
- * Schedule trigger configuration for plugin-generated executors
1860
- */
1861
- interface PluginScheduleTriggerConfig {
1862
- kind: "schedule";
1863
- /** Cron expression */
1864
- cron: string;
1865
- /** Timezone (defaults to UTC) */
1866
- timezone?: string;
1867
- }
1868
- /**
1869
- * Incoming webhook trigger configuration for plugin-generated executors
1870
- */
1871
- interface PluginIncomingWebhookTriggerConfig {
1872
- kind: "incomingWebhook";
1873
- }
1874
- /**
1875
- * Trigger configuration for plugin-generated executors
1876
- */
1877
- type PluginTriggerConfig = PluginRecordTriggerConfig | PluginScheduleTriggerConfig | PluginIncomingWebhookTriggerConfig;
1878
- /**
1879
- * Inject value types supported for plugin executor injection.
1880
- * These values are serialized as const declarations in the generated file.
1881
- */
1882
- type PluginInjectValue = string | number | boolean | null;
1883
- /**
1884
- * Inject map for plugin executor.
1885
- * Keys become const variable names in the generated file.
1886
- */
1887
- type PluginInjectMap = Record<string, PluginInjectValue>;
1888
- /**
1889
- * Function operation configuration for plugin-generated executors
1890
- */
1891
- interface PluginFunctionOperationConfig {
1892
- kind: "function";
1893
- /** Function body code as string */
1894
- body: string;
1895
- /**
1896
- * Variables to inject into the generated file scope.
1897
- * These become const declarations at the top of the generated file,
1898
- * allowing the function body to reference them.
1899
- * @example { namespace: "tailordb", historyTypeName: "CustomerHistory" }
1900
- */
1901
- inject?: PluginInjectMap;
1902
- }
1903
- /**
1904
- * GraphQL operation configuration for plugin-generated executors
1905
- */
1906
- interface PluginGraphQLOperationConfig {
1907
- kind: "graphql";
1908
- /** GraphQL query string */
1909
- query: string;
1910
- /** App name for the GraphQL endpoint */
1911
- appName?: string;
1912
- /**
1913
- * Variables expression as a string function.
1914
- * Receives the executor args object and returns the variables object.
1915
- * @example "(args) => ({ input: { recordId: args.newRecord.id } })"
1916
- */
1917
- variables?: string;
1918
- }
1919
- /**
1920
- * Webhook operation configuration for plugin-generated executors
1921
- */
1922
- interface PluginWebhookOperationConfig {
1923
- kind: "webhook";
1924
- /** Webhook URL */
1925
- url: string;
1926
- }
1927
- /**
1928
- * Workflow operation configuration for plugin-generated executors
1929
- */
1930
- interface PluginWorkflowOperationConfig {
1931
- kind: "workflow";
1932
- /** Workflow name */
1933
- workflowName: string;
1934
- }
1935
- /**
1936
- * Operation configuration for plugin-generated executors
1937
- */
1938
- type PluginOperationConfig = PluginFunctionOperationConfig | PluginGraphQLOperationConfig | PluginWebhookOperationConfig | PluginWorkflowOperationConfig;
1939
- /**
1940
- * Context value types for plugin executor context.
1941
- * Supports primitive values and type references.
1942
- */
1943
- type PluginExecutorContextValue = TailorAnyDBType | string | number | boolean | null | undefined;
1944
- /**
1945
- * Base executor context that can include type references and other values.
1946
- * Type objects (TailorAnyDBType) will be handled specially by the generator
1947
- * to create appropriate import statements.
1948
- *
1949
- * Plugin authors should extend this interface for their specific context needs.
1950
- */
1951
- interface PluginExecutorContextBase {
1952
- /** Source type that the plugin is attached to. Null for namespace executors. */
1953
- sourceType: TailorAnyDBType | null;
1954
- /** TailorDB namespace for data operations */
1955
- namespace: string;
1956
- }
1957
- /**
1958
- * Flexible executor context type that allows additional properties.
1959
- * Used as the context type in PluginGeneratedExecutorWithFile.
1960
- */
1961
- type PluginExecutorContext = PluginExecutorContextBase & {
1962
- [key: string]: PluginExecutorContextValue;
1963
- };
1964
- /**
1965
- * Module shape returned by plugin executor resolve().
1966
- * The concrete context type is intentionally erased at this boundary.
1967
- */
1968
- interface PluginExecutorModule {
1969
- default: unknown;
1970
- }
1971
- /**
1972
- * Executor definition with dynamic import reference (new format).
1973
- * Used with withPluginContext for type-safe executor definitions in separate files.
1974
- */
1975
- interface PluginGeneratedExecutorWithFile<Ctx = PluginExecutorContext> {
1976
- /** Executor name (used for generated file name) */
1977
- name: string;
1978
- /**
1979
- * Resolver function for the executor module.
1980
- * Should return a dynamic import to the executor file.
1981
- * Relative import specifiers are resolved from the plugin's importPath base.
1982
- * @example `async () => await import("./executors/on-create")`
1983
- */
1984
- resolve: () => Promise<PluginExecutorModule>;
1985
- /**
1986
- * Context to pass to the executor factory.
1987
- * Can include TailorAnyDBType objects - these will be handled specially
1988
- * by the generator to create appropriate import statements.
1989
- */
1990
- context: Ctx;
1991
- }
1992
- /**
1993
- * Executor definition generated by a plugin (legacy format).
1994
- * @deprecated Use PluginGeneratedExecutorWithFile with withPluginContext instead.
1995
- */
1996
- interface PluginGeneratedExecutorLegacy {
1997
- name: string;
1998
- description?: string;
1999
- trigger: PluginTriggerConfig;
2000
- operation: PluginOperationConfig;
2001
- }
2002
- /**
2003
- * Executor definition generated by a plugin.
2004
- * Supports both legacy format (inline trigger/operation) and new format (executorFile/context).
2005
- */
2006
- type PluginGeneratedExecutor = PluginGeneratedExecutorWithFile | PluginGeneratedExecutorLegacy;
2007
- /**
2008
- * Extension options for modifying the source type
2009
- */
2010
- interface PluginExtends {
2011
- /**
2012
- * Fields to add to the source type.
2013
- * These fields will be merged into the original type's fields.
2014
- * Existing fields (from original definition or earlier plugins) take precedence.
2015
- */
2016
- fields?: Record<string, TailorAnyDBField>;
2017
- }
2018
- /**
2019
- * Base output returned by a plugin's definition-time hooks.
2020
- * Used by both onTypeLoaded and onNamespaceLoaded.
2021
- */
2022
- interface PluginOutput {
2023
- /**
2024
- * Additional TailorDB types to generate, keyed by kind identifier.
2025
- * The kind is used to generate distinct TypeScript type files.
2026
- * @example { request: changeRequest, step: changeStep }
2027
- */
2028
- types?: PluginGeneratedTypes;
2029
- /** Additional resolvers to generate */
2030
- resolvers?: PluginGeneratedResolver[];
2031
- /** Additional executors to generate */
2032
- executors?: PluginGeneratedExecutor[];
2033
- }
2034
- /**
2035
- * Output returned by a plugin's onTypeLoaded hook.
2036
- * Extends PluginOutput with the ability to add fields to the source type.
2037
- */
2038
- interface TypePluginOutput extends PluginOutput {
2039
- /** Extensions to apply to the source type */
2040
- extends?: PluginExtends;
2041
- }
2042
- /**
2043
- * Output returned by a plugin's onNamespaceLoaded hook.
2044
- * Alias for PluginOutput (namespace plugins cannot extend a source type).
2045
- */
2046
- type NamespacePluginOutput = PluginOutput;
2047
- /**
2048
- * Plugin interface that all plugins must implement.
2049
- * Plugins can hook into two lifecycle phases:
2050
- * - **Definition-time hooks** (`onTypeLoaded`, `onNamespaceLoaded`): Generate TailorDB types, resolvers, and executors
2051
- * - **Generation-time hooks** (`onTailorDBReady`, `onResolverReady`, `onExecutorReady`): Process finalized artifacts and produce output files
2052
- * @template TypeConfig - Type for per-type configuration passed via .plugin() method
2053
- * @template PluginConfig - Type for plugin-level configuration passed via definePlugins()
2054
- */
2055
- interface Plugin<TypeConfig = unknown, PluginConfig = unknown> {
2056
- /** Unique identifier for the plugin */
2057
- readonly id: string;
2058
- /** Human-readable description of the plugin */
2059
- readonly description: string;
2060
- /**
2061
- * Import path for this plugin's public API.
2062
- * Used by code generators to create correct import statements
2063
- * (e.g., plugin executors and seed schema generation).
2064
- * Required when plugin has definition-time hooks (onTypeLoaded/onNamespaceLoaded).
2065
- * Optional for generation-only plugins.
2066
- */
2067
- readonly importPath?: string;
2068
- /**
2069
- * Controls whether per-type plugin config is required when attaching via .plugin().
2070
- * If a function is provided, it receives pluginConfig from definePlugins().
2071
- * Default is optional when not provided.
2072
- */
2073
- readonly typeConfigRequired?: TypeConfigRequired<PluginConfig>;
2074
- /**
2075
- * Plugin-level configuration passed via definePlugins().
2076
- * This config is stored when the plugin is registered and made available
2077
- * to all hook methods.
2078
- */
2079
- readonly pluginConfig?: PluginConfig;
2080
- /**
2081
- * Process a single TailorDB type and generate outputs.
2082
- * Called for each type that has this plugin attached via .plugin().
2083
- * @param context - Context containing the type, config, pluginConfig, and namespace
2084
- * @returns Plugin output with generated types, resolvers, and executors
2085
- */
2086
- onTypeLoaded?(context: PluginProcessContext<TypeConfig, PluginConfig>): TypePluginOutput | Promise<TypePluginOutput>;
2087
- /**
2088
- * Process plugin for a namespace without requiring a source type.
2089
- * Called once per namespace for plugins configured via definePlugins().
2090
- * Use this for plugins that generate types independently of user-defined types.
2091
- * @param context - Context containing the plugin config and namespace
2092
- * @returns Plugin output with generated types, resolvers, and executors
2093
- */
2094
- onNamespaceLoaded?(context: PluginNamespaceProcessContext<PluginConfig>): NamespacePluginOutput | Promise<NamespacePluginOutput>;
2095
- /**
2096
- * Called after all TailorDB types are loaded and finalized.
2097
- * Receives all TailorDB namespaces and their types.
2098
- * @param context - Context containing all TailorDB data, auth, and output paths
2099
- * @returns Generated files and optional errors
2100
- */
2101
- onTailorDBReady?(context: TailorDBReadyContext<PluginConfig>): GeneratorResult | Promise<GeneratorResult>;
2102
- /**
2103
- * Called after all resolvers are loaded and finalized.
2104
- * Receives all TailorDB data plus resolver data.
2105
- * @param context - Context containing TailorDB data, resolvers, auth, and output paths
2106
- * @returns Generated files and optional errors
2107
- */
2108
- onResolverReady?(context: ResolverReadyContext<PluginConfig>): GeneratorResult | Promise<GeneratorResult>;
2109
- /**
2110
- * Called after all executors are loaded and finalized.
2111
- * Receives all TailorDB data, resolver data, plus executor data.
2112
- * @param context - Context containing all service data, auth, and output paths
2113
- * @returns Generated files and optional errors
2114
- */
2115
- onExecutorReady?(context: ExecutorReadyContext<PluginConfig>): GeneratorResult | Promise<GeneratorResult>;
2116
- }
2117
- //#endregion
2118
- //#region src/configure/services/tailordb/schema.d.ts
2119
- interface RelationConfig<S extends RelationType, T extends TailorDBType$1> {
2120
- type: S;
2121
- toward: {
2122
- type: T;
2123
- as?: string;
2124
- key?: keyof T["fields"] & string;
2125
- };
2126
- backward?: string;
2127
- }
2128
- type RelationSelfConfig = {
2129
- type: RelationType;
2130
- toward: {
2131
- type: "self";
2132
- as?: string;
2133
- key?: string;
2134
- };
2135
- backward?: string;
1112
+ //#region src/configure/services/tailordb/schema.d.ts
1113
+ interface RelationConfig<S extends RelationType, T extends TailorDBType$1> {
1114
+ type: S;
1115
+ toward: {
1116
+ type: T;
1117
+ as?: string;
1118
+ key?: keyof T["fields"] & string;
1119
+ };
1120
+ backward?: string;
1121
+ }
1122
+ type RelationSelfConfig = {
1123
+ type: RelationType;
1124
+ toward: {
1125
+ type: "self";
1126
+ as?: string;
1127
+ key?: string;
1128
+ };
1129
+ backward?: string;
2136
1130
  };
2137
1131
  type TailorAnyDBField = TailorDBField<any, any>;
2138
1132
  type TailorAnyDBType = TailorDBType$1<any, any>;
@@ -2616,53 +1610,135 @@ declare const db: {
2616
1610
  };
2617
1611
  };
2618
1612
  //#endregion
2619
- //#region src/parser/service/tailordb/types.d.ts
2620
- /**
2621
- * Source information for a user-defined TailorDB type.
2622
- */
1613
+ //#region src/types/auth.d.ts
1614
+ type OAuth2ClientGrantType = OAuth2Client["grantTypes"][number];
1615
+ type SCIMAttributeType = SCIMAttribute["type"];
1616
+ type AuthInvokerWithName<M extends string> = Omit<AuthInvoker, "machineUserName"> & {
1617
+ machineUserName: M;
1618
+ };
1619
+ type ValueOperand = string | boolean | string[] | boolean[];
1620
+ type AuthAttributeValue = ValueOperand | null | undefined;
1621
+ type UserFieldKeys<User extends TailorDBInstance> = keyof output<User> & string;
1622
+ type FieldDefined<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = User["fields"][Key] extends {
1623
+ _defined: infer Defined;
1624
+ } ? Defined : never;
1625
+ type FieldOutput<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = output<User>[Key];
1626
+ type FieldIsRequired<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = undefined extends FieldOutput<User, Key> ? false : true;
1627
+ type FieldIsOfType<User extends TailorDBInstance, Key extends UserFieldKeys<User>, Type extends string> = FieldDefined<User, Key> extends {
1628
+ type: Type;
1629
+ } ? true : false;
1630
+ type FieldIsArray<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = FieldDefined<User, Key> extends {
1631
+ array: true;
1632
+ } ? true : false;
1633
+ type FieldIsUnique<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = FieldDefined<User, Key> extends {
1634
+ unique: true;
1635
+ } ? true : false;
1636
+ type FieldSupportsValueOperand<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = FieldOutput<User, Key> extends ValueOperand | null | undefined ? true : false;
1637
+ 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>];
1638
+ 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>];
1639
+ 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>];
1640
+ type UserAttributeMap<User extends TailorDBInstance> = { [K in UserAttributeKey<User>]?: true };
1641
+ type DisallowExtraKeys<T, Allowed extends PropertyKey> = T & { [K in Exclude<keyof T, Allowed>]: never };
1642
+ type AttributeListValue<User extends TailorDBInstance, Key extends UserAttributeListKey<User>> = Key extends keyof output<User> ? output<User>[Key] : never;
1643
+ type AttributeListToTuple<User extends TailorDBInstance, AttributeList$1 extends readonly UserAttributeListKey<User>[]> = { [Index in keyof AttributeList$1]: AttributeList$1[Index] extends UserAttributeListKey<User> ? AttributeListValue<User, AttributeList$1[Index]> : never };
1644
+ type AttributeMapSelectedKeys<User extends TailorDBInstance, AttributeMap$1 extends UserAttributeMap<User>> = Extract<{ [K in keyof AttributeMap$1]-?: undefined extends AttributeMap$1[K] ? never : K }[keyof AttributeMap$1], UserAttributeKey<User>>;
1645
+ type UserProfile<User extends TailorDBInstance, AttributeMap$1 extends UserAttributeMap<User>, AttributeList$1 extends UserAttributeListKey<User>[]> = {
1646
+ /**
1647
+ * TailorDB namespace where the user type is defined.
1648
+ *
1649
+ * Usually auto-resolved, so you don't need to specify this.
1650
+ * Required only when multiple TailorDBs exist and the type is in an external TailorDB.
1651
+ */
1652
+ namespace?: string;
1653
+ type: User;
1654
+ usernameField: UsernameFieldKey<User>;
1655
+ attributes?: DisallowExtraKeys<AttributeMap$1, UserAttributeKey<User>>;
1656
+ attributeList?: AttributeList$1;
1657
+ };
1658
+ type MachineUserAttributeFields = Record<string, TailorField<DefinedFieldMetadata, unknown, FieldMetadata, TailorFieldType>>;
1659
+ type TailorFieldOutputValue<Field> = Field extends TailorField<DefinedFieldMetadata, infer Output, FieldMetadata, TailorFieldType> ? Output : never;
1660
+ type MachineUserAttributeValues<Fields extends MachineUserAttributeFields> = { [K in keyof Fields]: TailorFieldOutputValue<Fields[K]> extends ValueOperand | null | undefined ? TailorFieldOutputValue<Fields[K]> : never };
1661
+ type MachineUserFromAttributes<Fields extends MachineUserAttributeFields> = (keyof Fields extends never ? {
1662
+ attributes?: never;
1663
+ } : {
1664
+ attributes: DisallowExtraKeys<MachineUserAttributeValues<Fields>, keyof Fields>;
1665
+ }) & {
1666
+ attributeList?: string[];
1667
+ };
1668
+ type MachineUser<User extends TailorDBInstance, AttributeMap$1 extends UserAttributeMap<User> = UserAttributeMap<User>, AttributeList$1 extends UserAttributeListKey<User>[] = [], MachineUserAttributes extends MachineUserAttributeFields | undefined = undefined> = IsAny<MachineUserAttributes> extends true ? IsAny<User> extends true ? {
1669
+ attributes: Record<string, AuthAttributeValue>;
1670
+ attributeList?: string[];
1671
+ } : (AttributeMapSelectedKeys<User, AttributeMap$1> extends never ? {
1672
+ attributes?: never;
1673
+ } : {
1674
+ attributes: { [K in AttributeMapSelectedKeys<User, AttributeMap$1>]: K extends keyof output<User> ? output<User>[K] : never } & { [K in Exclude<keyof output<User>, AttributeMapSelectedKeys<User, AttributeMap$1>>]?: never };
1675
+ }) & ([] extends AttributeList$1 ? {
1676
+ attributeList?: never;
1677
+ } : {
1678
+ attributeList: AttributeListToTuple<User, AttributeList$1>;
1679
+ }) : [MachineUserAttributes] extends [MachineUserAttributeFields] ? MachineUserFromAttributes<MachineUserAttributes> : IsAny<User> extends true ? {
1680
+ attributes: Record<string, AuthAttributeValue>;
1681
+ attributeList?: string[];
1682
+ } : (AttributeMapSelectedKeys<User, AttributeMap$1> extends never ? {
1683
+ attributes?: never;
1684
+ } : {
1685
+ attributes: { [K in AttributeMapSelectedKeys<User, AttributeMap$1>]: K extends keyof output<User> ? output<User>[K] : never } & { [K in Exclude<keyof output<User>, AttributeMapSelectedKeys<User, AttributeMap$1>>]?: never };
1686
+ }) & ([] extends AttributeList$1 ? {
1687
+ attributeList?: never;
1688
+ } : {
1689
+ attributeList: AttributeListToTuple<User, AttributeList$1>;
1690
+ });
1691
+ type AuthServiceInput<User extends TailorDBInstance, AttributeMap$1 extends UserAttributeMap<User>, AttributeList$1 extends UserAttributeListKey<User>[], MachineUserNames extends string, MachineUserAttributes extends MachineUserAttributeFields | undefined = MachineUserAttributeFields | undefined> = {
1692
+ userProfile?: UserProfile<User, AttributeMap$1, AttributeList$1>;
1693
+ machineUserAttributes?: MachineUserAttributes;
1694
+ machineUsers?: Record<MachineUserNames, MachineUser<User, AttributeMap$1, AttributeList$1, MachineUserAttributes>>;
1695
+ oauth2Clients?: Record<string, OAuth2ClientInput>;
1696
+ idProvider?: IdProvider;
1697
+ scim?: SCIMConfig;
1698
+ tenantProvider?: TenantProvider;
1699
+ publishSessionEvents?: boolean;
1700
+ };
1701
+ declare const authDefinitionBrand: unique symbol;
1702
+ type AuthDefinitionBrand = {
1703
+ readonly [authDefinitionBrand]: true;
1704
+ };
1705
+ type DefinedAuth<Name extends string, Config, MachineUserNames extends string> = Config & {
1706
+ name: Name;
1707
+ invoker<M extends MachineUserNames>(machineUser: M): AuthInvokerWithName<M>;
1708
+ } & AuthDefinitionBrand;
1709
+ type AuthExternalConfig = {
1710
+ name: string;
1711
+ external: true;
1712
+ };
1713
+ type AuthServiceInputLoose = AuthServiceInput<any, any, any, string, any>;
1714
+ type AuthOwnConfig = DefinedAuth<string, AuthServiceInputLoose, string>;
1715
+ type AuthConfig = AuthOwnConfig | AuthExternalConfig;
1716
+ //#endregion
1717
+ //#region src/types/tailordb.d.ts
1718
+ type RelationType = "1-1" | "oneToOne" | "n-1" | "manyToOne" | "N-1" | "keyOnly";
1719
+ type TailorDBExternalConfig = {
1720
+ external: true;
1721
+ };
1722
+ type TailorDBServiceInput = {
1723
+ [namespace: string]: TailorDBServiceConfigInput | TailorDBExternalConfig;
1724
+ };
2623
1725
  interface UserDefinedTypeSource {
2624
- /** File path to import from */
2625
1726
  filePath: string;
2626
- /** Export name in the source file */
2627
1727
  exportName: string;
2628
- /** Not present for user-defined types */
2629
1728
  pluginId?: never;
2630
1729
  }
2631
- /**
2632
- * Source information for a plugin-generated TailorDB type.
2633
- */
2634
1730
  interface PluginGeneratedTypeSource {
2635
- /** Not present for plugin-generated types */
2636
1731
  filePath?: never;
2637
- /** Export name of the generated type */
2638
1732
  exportName: string;
2639
- /** Plugin ID that generated this type */
2640
1733
  pluginId: string;
2641
- /** Plugin import path for code generators */
2642
1734
  pluginImportPath: string;
2643
- /** Original type's file path */
2644
1735
  originalFilePath: string;
2645
- /** Original type's export name */
2646
1736
  originalExportName: string;
2647
- /** Generated type kind for getGeneratedType() API (e.g., "request", "step") */
2648
1737
  generatedTypeKind?: string;
2649
- /** Plugin config used to generate this type */
2650
1738
  pluginConfig?: unknown;
2651
- /** Namespace where this type was generated */
2652
1739
  namespace?: string;
2653
1740
  }
2654
- /**
2655
- * Source information for a TailorDB type.
2656
- * Discriminated union: use `pluginId` to distinguish between user-defined and plugin-generated types.
2657
- */
2658
1741
  type TypeSourceInfoEntry = UserDefinedTypeSource | PluginGeneratedTypeSource;
2659
- /**
2660
- * Parsed and normalized settings for TailorDB type.
2661
- * gqlOperations is normalized from alias to object format.
2662
- * @public
2663
- */
2664
- type TailorDBTypeParsedSettings = z.output<typeof TailorDBTypeSettingsSchema>;
2665
- type RawPermissions = z.output<typeof RawPermissionsSchema>;
2666
1742
  interface Script {
2667
1743
  expr: string;
2668
1744
  }
@@ -2678,13 +1754,8 @@ interface OperatorFieldHook {
2678
1754
  create?: Script;
2679
1755
  update?: Script;
2680
1756
  }
2681
- /**
2682
- * Raw relation config stored in configure layer, processed in parser layer.
2683
- * This is the serialized form of RelationConfig from schema.ts where
2684
- * the TailorDBType reference is replaced with the type name string.
2685
- */
2686
1757
  interface RawRelationConfig {
2687
- type: RelationType;
1758
+ type: "1-1" | "n-1" | "keyOnly" | "oneToOne" | "manyToOne" | "N-1";
2688
1759
  toward: {
2689
1760
  type: string;
2690
1761
  as?: string;
@@ -2768,9 +1839,6 @@ interface TailorDBTypeMetadata {
2768
1839
  unique?: boolean;
2769
1840
  }>;
2770
1841
  }
2771
- /**
2772
- * Parsed and normalized TailorDB field information
2773
- */
2774
1842
  interface ParsedField {
2775
1843
  name: string;
2776
1844
  config: OperatorFieldConfig;
@@ -2782,9 +1850,6 @@ interface ParsedField {
2782
1850
  unique: boolean;
2783
1851
  };
2784
1852
  }
2785
- /**
2786
- * Parsed and normalized TailorDB relationship information
2787
- */
2788
1853
  interface ParsedRelationship {
2789
1854
  name: string;
2790
1855
  targetType: string;
@@ -2793,9 +1858,6 @@ interface ParsedRelationship {
2793
1858
  isArray: boolean;
2794
1859
  description: string;
2795
1860
  }
2796
- /**
2797
- * Parsed and normalized TailorDB type information
2798
- */
2799
1861
  interface TailorDBType {
2800
1862
  name: string;
2801
1863
  pluralForm: string;
@@ -2809,5 +1871,249 @@ interface TailorDBType {
2809
1871
  files?: TailorDBTypeMetadata["files"];
2810
1872
  }
2811
1873
  //#endregion
2812
- export { OAuth2ClientGrantType as $, AuthAccessTokenTrigger as A, Resolver as At, ResolverExecutedTrigger as B, TailorActor as Bt, TypePluginOutput as C, FieldMetadata as Ct, ResolverReadyContext as D, TailorAnyField as Dt, ResolverNamespaceData as E, TailorFieldType as Et, FunctionOperation as F, InferFieldsOutput as Ft, AuthExternalConfig as G, AllowedValues as Gt, WebhookOperation as H, AttributeMap as Ht, GqlOperation as I, JsonCompatible as It, AuthServiceInput as J, AuthInvoker as K, AllowedValuesOutput as Kt, IdpUserTrigger as L, output as Lt, ExecutorInput as M, ResolverInput as Mt, ExecutorServiceConfig as N, ResolverServiceConfig as Nt, TailorDBNamespaceData as O, TailorField as Ot, ExecutorServiceInput as P, ResolverServiceInput as Pt, IdProviderConfig as Q, IncomingWebhookTrigger as R, Env as Rt, TailorDBTypeForPlugin as S, DefinedFieldMetadata as St, GeneratorResult as T, FieldOutput$1 as Tt, WorkflowOperation as U, TailorUser as Ut, ScheduleTriggerInput as V, AttributeList as Vt, AuthConfig as W, unauthenticatedTailorUser as Wt, DefinedAuth as X, BuiltinIdP as Y, IDToken as Z, PluginGeneratedResolver as _, TailorTypeGqlPermission as _t, TailorDBField as a, SCIMAttributeType as at, PluginOutput as b, unsafeAllowAllTypePermission as bt, db as c, SCIMResource as ct, PluginAttachment as d, UserAttributeListKey as dt, OAuth2ClientInput as et, PluginConfigs as f, UserAttributeMap as ft, PluginGeneratedExecutorWithFile as g, PermissionCondition as gt, PluginGeneratedExecutor as h, GeneratorConfig as ht, TailorAnyDBType as i, SCIMAttributeMapping as it, Executor as j, ResolverExternalConfig as jt, TailorDBReadyContext as k, QueryType as kt, NamespacePluginOutput as l, TenantProviderConfig as lt, PluginExecutorContextBase as m, ValueOperand as mt, TypeSourceInfoEntry as n, SAML as nt, TailorDBInstance as o, SCIMAuthorization as ot, PluginExecutorContext as p, UsernameFieldKey as pt, AuthOwnConfig as q, TailorDBServiceInput as qt, TailorAnyDBField as r, SCIMAttribute as rt, TailorDBType$1 as s, SCIMConfig as st, TailorDBType as t, OIDC as tt, Plugin as u, UserAttributeKey as ut, PluginGeneratedType as v, TailorTypePermission as vt, ExecutorReadyContext as w, FieldOptions as wt, PluginProcessContext as x, ArrayFieldOutput as xt, PluginNamespaceProcessContext as y, unsafeAllowAllGqlPermission as yt, RecordTrigger as z, TailorEnv as zt };
2813
- //# sourceMappingURL=types-bcuNRo1Y.d.mts.map
1874
+ //#region src/types/plugin-generation.d.ts
1875
+ /**
1876
+ * A single generated file to write to disk.
1877
+ */
1878
+ interface GeneratedFile {
1879
+ path: string;
1880
+ content: string;
1881
+ skipIfExists?: boolean;
1882
+ executable?: boolean;
1883
+ }
1884
+ /**
1885
+ * Result returned by generation-time hooks.
1886
+ */
1887
+ interface GeneratorResult {
1888
+ files: GeneratedFile[];
1889
+ errors?: string[];
1890
+ }
1891
+ /**
1892
+ * Auth configuration available to generation-time hooks.
1893
+ */
1894
+ interface GeneratorAuthInput {
1895
+ name: string;
1896
+ userProfile?: {
1897
+ typeName: string;
1898
+ namespace: string;
1899
+ usernameField: string;
1900
+ };
1901
+ machineUsers?: Record<string, {
1902
+ attributes: Record<string, unknown>;
1903
+ }>;
1904
+ oauth2Clients?: Record<string, OAuth2ClientInput>;
1905
+ idProvider?: IdProvider;
1906
+ }
1907
+ /**
1908
+ * Namespace-level TailorDB data available to generation-time hooks.
1909
+ */
1910
+ interface TailorDBNamespaceData {
1911
+ /** Namespace name */
1912
+ namespace: string;
1913
+ /** All TailorDB types in this namespace, keyed by type name */
1914
+ types: Record<string, TailorDBType>;
1915
+ /** Source info for each type (file path, export name, plugin info) */
1916
+ sourceInfo: ReadonlyMap<string, TypeSourceInfoEntry>;
1917
+ /** Plugin attachments configured on each type via .plugin() method */
1918
+ pluginAttachments: ReadonlyMap<string, readonly PluginAttachment[]>;
1919
+ }
1920
+ /**
1921
+ * Namespace-level resolver data available to generation-time hooks.
1922
+ */
1923
+ interface ResolverNamespaceData {
1924
+ /** Namespace name */
1925
+ namespace: string;
1926
+ /** All resolvers in this namespace, keyed by resolver name */
1927
+ resolvers: Record<string, Resolver>;
1928
+ }
1929
+ /**
1930
+ * Context passed to plugin's onTailorDBReady hook.
1931
+ * @template PluginConfig - Plugin-level configuration type
1932
+ */
1933
+ interface TailorDBReadyContext<PluginConfig = unknown> {
1934
+ /** All TailorDB namespaces with their types and metadata */
1935
+ tailordb: TailorDBNamespaceData[];
1936
+ /** Auth configuration */
1937
+ auth?: GeneratorAuthInput;
1938
+ /** Base directory for generated files */
1939
+ baseDir: string;
1940
+ /** Path to tailor.config.ts */
1941
+ configPath: string;
1942
+ /** Plugin-level configuration passed via definePlugins() */
1943
+ pluginConfig: PluginConfig;
1944
+ }
1945
+ /**
1946
+ * Context passed to plugin's onResolverReady hook.
1947
+ * @template PluginConfig - Plugin-level configuration type
1948
+ */
1949
+ interface ResolverReadyContext<PluginConfig = unknown> {
1950
+ /** All TailorDB namespaces with their types and metadata */
1951
+ tailordb: TailorDBNamespaceData[];
1952
+ /** All resolver namespaces with their resolvers */
1953
+ resolvers: ResolverNamespaceData[];
1954
+ /** Auth configuration */
1955
+ auth?: GeneratorAuthInput;
1956
+ /** Base directory for generated files */
1957
+ baseDir: string;
1958
+ /** Path to tailor.config.ts */
1959
+ configPath: string;
1960
+ /** Plugin-level configuration passed via definePlugins() */
1961
+ pluginConfig: PluginConfig;
1962
+ }
1963
+ /**
1964
+ * Context passed to plugin's onExecutorReady hook.
1965
+ * @template PluginConfig - Plugin-level configuration type
1966
+ */
1967
+ interface ExecutorReadyContext<PluginConfig = unknown> {
1968
+ /** All TailorDB namespaces with their types and metadata */
1969
+ tailordb: TailorDBNamespaceData[];
1970
+ /** All resolver namespaces with their resolvers */
1971
+ resolvers: ResolverNamespaceData[];
1972
+ /** All executors, keyed by executor name */
1973
+ executors: Record<string, Executor>;
1974
+ /** Auth configuration */
1975
+ auth?: GeneratorAuthInput;
1976
+ /** Base directory for generated files */
1977
+ baseDir: string;
1978
+ /** Path to tailor.config.ts */
1979
+ configPath: string;
1980
+ /** Plugin-level configuration passed via definePlugins() */
1981
+ pluginConfig: PluginConfig;
1982
+ }
1983
+ //#endregion
1984
+ //#region src/types/plugin.d.ts
1985
+ type TypeConfigRequired<PluginConfig = unknown> = boolean | ((pluginConfig: PluginConfig | undefined) => boolean);
1986
+ /**
1987
+ * Interface for plugin configuration mapping.
1988
+ * Extend this interface via declaration merging to add typed plugin configs.
1989
+ */
1990
+ interface PluginConfigs<Fields extends string = string> {}
1991
+ /**
1992
+ * Plugin attachment stored on TailorAnyDBType instances.
1993
+ */
1994
+ interface PluginAttachment {
1995
+ pluginId: string;
1996
+ config: unknown;
1997
+ }
1998
+ /**
1999
+ * Context passed to plugin's process method
2000
+ */
2001
+ interface PluginProcessContext<TypeConfig = unknown, PluginConfig = unknown> {
2002
+ type: TailorAnyDBType;
2003
+ typeConfig: TypeConfig;
2004
+ pluginConfig: PluginConfig;
2005
+ namespace: string;
2006
+ }
2007
+ /**
2008
+ * Context passed to plugin's onNamespaceLoaded hook.
2009
+ */
2010
+ interface PluginNamespaceProcessContext<PluginConfig = unknown> {
2011
+ pluginConfig: PluginConfig;
2012
+ namespace: string;
2013
+ }
2014
+ /**
2015
+ * Interface representing a TailorDB type for plugin output.
2016
+ */
2017
+ interface TailorDBTypeForPlugin {
2018
+ readonly name: string;
2019
+ readonly fields: Record<string, unknown>;
2020
+ }
2021
+ type PluginGeneratedType = TailorDBTypeForPlugin;
2022
+ type PluginGeneratedTypes = Record<string, PluginGeneratedType>;
2023
+ interface PluginGeneratedResolver {
2024
+ name: string;
2025
+ operation: "query" | "mutation";
2026
+ inputFields?: Record<string, unknown>;
2027
+ outputFields: Record<string, unknown>;
2028
+ body: string;
2029
+ }
2030
+ interface PluginRecordTriggerConfig {
2031
+ kind: "recordCreated" | "recordUpdated" | "recordDeleted";
2032
+ typeName: string;
2033
+ }
2034
+ interface PluginScheduleTriggerConfig {
2035
+ kind: "schedule";
2036
+ cron: string;
2037
+ timezone?: string;
2038
+ }
2039
+ interface PluginIncomingWebhookTriggerConfig {
2040
+ kind: "incomingWebhook";
2041
+ }
2042
+ type PluginTriggerConfig = PluginRecordTriggerConfig | PluginScheduleTriggerConfig | PluginIncomingWebhookTriggerConfig;
2043
+ type PluginInjectValue = string | number | boolean | null;
2044
+ type PluginInjectMap = Record<string, PluginInjectValue>;
2045
+ interface PluginFunctionOperationConfig {
2046
+ kind: "function";
2047
+ body: string;
2048
+ inject?: PluginInjectMap;
2049
+ }
2050
+ interface PluginGraphQLOperationConfig {
2051
+ kind: "graphql";
2052
+ query: string;
2053
+ appName?: string;
2054
+ variables?: string;
2055
+ }
2056
+ interface PluginWebhookOperationConfig {
2057
+ kind: "webhook";
2058
+ url: string;
2059
+ }
2060
+ interface PluginWorkflowOperationConfig {
2061
+ kind: "workflow";
2062
+ workflowName: string;
2063
+ }
2064
+ type PluginOperationConfig = PluginFunctionOperationConfig | PluginGraphQLOperationConfig | PluginWebhookOperationConfig | PluginWorkflowOperationConfig;
2065
+ type PluginExecutorContextValue = TailorAnyDBType | string | number | boolean | null | undefined;
2066
+ interface PluginExecutorContextBase {
2067
+ sourceType: TailorAnyDBType | null;
2068
+ namespace: string;
2069
+ }
2070
+ type PluginExecutorContext = PluginExecutorContextBase & {
2071
+ [key: string]: PluginExecutorContextValue;
2072
+ };
2073
+ interface PluginExecutorModule {
2074
+ default: unknown;
2075
+ }
2076
+ interface PluginGeneratedExecutorWithFile<Ctx = PluginExecutorContext> {
2077
+ name: string;
2078
+ resolve: () => Promise<PluginExecutorModule>;
2079
+ context: Ctx;
2080
+ }
2081
+ interface PluginGeneratedExecutorLegacy {
2082
+ name: string;
2083
+ description?: string;
2084
+ trigger: PluginTriggerConfig;
2085
+ operation: PluginOperationConfig;
2086
+ }
2087
+ type PluginGeneratedExecutor = PluginGeneratedExecutorWithFile | PluginGeneratedExecutorLegacy;
2088
+ interface PluginExtends {
2089
+ fields?: Record<string, TailorAnyDBField>;
2090
+ }
2091
+ interface PluginOutput {
2092
+ types?: PluginGeneratedTypes;
2093
+ resolvers?: PluginGeneratedResolver[];
2094
+ executors?: PluginGeneratedExecutor[];
2095
+ }
2096
+ interface TypePluginOutput extends PluginOutput {
2097
+ extends?: PluginExtends;
2098
+ }
2099
+ type NamespacePluginOutput = PluginOutput;
2100
+ /**
2101
+ * Plugin interface that all plugins must implement.
2102
+ * @template TypeConfig - Type for per-type configuration passed via .plugin() method
2103
+ * @template PluginConfig - Type for plugin-level configuration passed via definePlugins()
2104
+ */
2105
+ interface Plugin<TypeConfig = unknown, PluginConfig = unknown> {
2106
+ readonly id: string;
2107
+ readonly description: string;
2108
+ readonly importPath?: string;
2109
+ readonly typeConfigRequired?: TypeConfigRequired<PluginConfig>;
2110
+ readonly pluginConfig?: PluginConfig;
2111
+ onTypeLoaded?(context: PluginProcessContext<TypeConfig, PluginConfig>): TypePluginOutput | Promise<TypePluginOutput>;
2112
+ onNamespaceLoaded?(context: PluginNamespaceProcessContext<PluginConfig>): NamespacePluginOutput | Promise<NamespacePluginOutput>;
2113
+ onTailorDBReady?(context: TailorDBReadyContext<PluginConfig>): GeneratorResult | Promise<GeneratorResult>;
2114
+ onResolverReady?(context: ResolverReadyContext<PluginConfig>): GeneratorResult | Promise<GeneratorResult>;
2115
+ onExecutorReady?(context: ExecutorReadyContext<PluginConfig>): GeneratorResult | Promise<GeneratorResult>;
2116
+ }
2117
+ //#endregion
2118
+ export { TailorFieldType as $, OAuth2ClientGrantType as A, IDToken as At, TailorDBInstance as B, TenantProvider as Bt, TailorDBType as C, RecordTrigger as Ct, AuthOwnConfig as D, WorkflowOperation as Dt, AuthExternalConfig as E, WebhookOperation as Et, UsernameFieldKey as F, SCIMAttribute as Ft, TailorTypePermission as G, db as H, ValueOperand as I, SCIMAttributeMapping as It, ArrayFieldOutput as J, unsafeAllowAllGqlPermission as K, TailorAnyDBField as L, SCIMAuthorization as Lt, UserAttributeKey as M, OAuth2ClientInput as Mt, UserAttributeListKey as N, OIDC as Nt, AuthServiceInput as O, AuthInvoker as Ot, UserAttributeMap as P, SAML as Pt, FieldOutput$1 as Q, TailorAnyDBType as R, SCIMConfig as Rt, TailorDBServiceInput as S, IncomingWebhookTrigger as St, AuthConfig as T, ScheduleTriggerInput as Tt, PermissionCondition as U, TailorDBType$1 as V, TailorTypeGqlPermission as W, FieldMetadata as X, DefinedFieldMetadata as Y, FieldOptions as Z, GeneratorResult as _, Executor as _t, PluginExecutorContext as a, AttributeList as at, TailorDBNamespaceData as b, GqlOperation as bt, PluginGeneratedExecutorWithFile as c, InferredAttributeMap as ct, PluginNamespaceProcessContext as d, AllowedValues as dt, TailorAnyField as et, PluginOutput as f, AllowedValuesOutput as ft, ExecutorReadyContext as g, AuthAccessTokenTrigger as gt, TypePluginOutput as h, GeneratorConfig as ht, PluginConfigs as i, output as it, SCIMAttributeType as j, IdProvider as jt, DefinedAuth as k, BuiltinIdP as kt, PluginGeneratedResolver as l, TailorUser as lt, TailorDBTypeForPlugin as m, ResolverInput as mt, Plugin as n, InferFieldsOutput as nt, PluginExecutorContextBase as o, AttributeMap as ot, PluginProcessContext as p, Resolver as pt, unsafeAllowAllTypePermission as q, PluginAttachment as r, JsonCompatible as rt, PluginGeneratedExecutor as s, InferredAttributeList as st, NamespacePluginOutput as t, TailorField as tt, PluginGeneratedType as u, unauthenticatedTailorUser as ut, ResolverNamespaceData as v, ExecutorInput as vt, TypeSourceInfoEntry as w, ResolverExecutedTrigger as wt, TailorDBReadyContext as x, IdpUserTrigger as xt, ResolverReadyContext as y, FunctionOperation as yt, TailorDBField as z, SCIMResource as zt };
2119
+ //# sourceMappingURL=plugin-CE-BZZgX.d.mts.map