@tailor-platform/sdk 1.54.3 → 1.55.1
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.
- package/CHANGELOG.md +36 -0
- package/dist/{actor-Cjae_LGD.d.mts → actor-J2gJ0eK5.d.mts} +2 -2
- package/dist/application-DM8q9GDI.mjs +4 -0
- package/dist/{application-BfGje3iZ.mjs → application-DzUlASfA.mjs} +333 -4
- package/dist/application-DzUlASfA.mjs.map +1 -0
- package/dist/brand-DlnJ375c.mjs.map +1 -1
- package/dist/cli/index.mjs +101 -38
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +1334 -176
- package/dist/cli/lib.mjs +3 -3
- package/dist/{client-CGO7gniI.mjs → client-DLPEPJ_s.mjs} +24 -19
- package/dist/client-DLPEPJ_s.mjs.map +1 -0
- package/dist/{client-yfFdZU9s.mjs → client-DrzwCD1W.mjs} +1 -1
- package/dist/configure/index.d.mts +5 -4
- package/dist/configure/index.mjs +47 -1
- package/dist/configure/index.mjs.map +1 -1
- package/dist/{crashreport-DGdAgX8Y.mjs → crashreport-Bm2mN5tg.mjs} +2 -2
- package/dist/{crashreport-DGdAgX8Y.mjs.map → crashreport-Bm2mN5tg.mjs.map} +1 -1
- package/dist/{crashreport-DnwIxpzF.mjs → crashreport-C5oHvHUC.mjs} +1 -1
- package/dist/{index-qQYMbkT-.d.mts → index-BE-fpxIo.d.mts} +2 -2
- package/dist/{index-DJUoIn_v.d.mts → index-BLsnrEtc.d.mts} +97 -5
- package/dist/{index-DrYHpTja.d.mts → index-D9xG-a6Y.d.mts} +2 -2
- package/dist/{index-CyyoHrPK.d.mts → index-S6-FtUpA.d.mts} +2 -2
- package/dist/{index-Cf1Lo_XT.d.mts → index-cHqh66cF.d.mts} +2 -2
- package/dist/plugin/builtin/enum-constants/index.d.mts +1 -1
- package/dist/plugin/builtin/file-utils/index.d.mts +1 -1
- package/dist/plugin/builtin/kysely-type/index.d.mts +1 -1
- package/dist/plugin/builtin/seed/index.d.mts +1 -1
- package/dist/plugin/index.d.mts +2 -2
- package/dist/plugin-BuE5ZOnW.d.mts +634 -0
- package/dist/{runtime-DpbAj_8a.mjs → runtime-CgGeIoxi.mjs} +366 -164
- package/dist/runtime-CgGeIoxi.mjs.map +1 -0
- package/dist/seed-DfLyRh63.mjs.map +1 -1
- package/dist/tailordb-BlBGmQK-.d.mts +863 -0
- package/dist/utils/test/index.d.mts +3 -3
- package/dist/vitest/index.d.mts +25 -1
- package/dist/vitest/index.mjs +57 -12
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/{workflow.generated-CWi2rivQ.d.mts → workflow.generated-CQg1_Ami.d.mts} +183 -8
- package/docs/cli-reference.md +12 -0
- package/docs/services/http-adapter.md +100 -0
- package/package.json +11 -11
- package/dist/application-BfGje3iZ.mjs.map +0 -1
- package/dist/application-BsipSxp3.mjs +0 -4
- package/dist/client-CGO7gniI.mjs.map +0 -1
- package/dist/runtime-DpbAj_8a.mjs.map +0 -1
- package/dist/tailor-db-field-D0qg8s4U.d.mts +0 -1639
|
@@ -0,0 +1,634 @@
|
|
|
1
|
+
import { _ as PluginAttachment, a as TypeSourceInfoEntry, c as TailorAnyDBType, i as TailorDBType, s as TailorAnyDBField } from "./tailordb-BlBGmQK-.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/types/auth.generated.d.ts
|
|
4
|
+
type AuthInvokerObject = {
|
|
5
|
+
/** Auth namespace */namespace: string; /** Machine user name for authentication */
|
|
6
|
+
machineUserName: string;
|
|
7
|
+
};
|
|
8
|
+
type AuthInvoker = AuthInvokerObject;
|
|
9
|
+
type OIDC = {
|
|
10
|
+
/** Identity provider name */name: string;
|
|
11
|
+
kind: "OIDC"; /** OAuth2 client ID */
|
|
12
|
+
clientID: string; /** OAuth2 client secret */
|
|
13
|
+
clientSecret: {
|
|
14
|
+
vaultName: string;
|
|
15
|
+
secretKey: string;
|
|
16
|
+
}; /** OIDC provider URL */
|
|
17
|
+
providerURL: string; /** OIDC issuer URL (defaults to providerURL) */
|
|
18
|
+
issuerURL?: string | undefined; /** JWT claim to use as username */
|
|
19
|
+
usernameClaim?: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
type SAML = {
|
|
22
|
+
/** Identity provider name */name: string;
|
|
23
|
+
kind: "SAML"; /** Enable signing of SAML requests */
|
|
24
|
+
enableSignRequest: boolean; /** URL to fetch SAML metadata (mutually exclusive with rawMetadata) */
|
|
25
|
+
metadataURL?: string | undefined; /** Raw SAML metadata XML (mutually exclusive with metadataURL) */
|
|
26
|
+
rawMetadata?: string | undefined; /** URL to redirect to when SAML ACS receives a response with an empty RelayState. */
|
|
27
|
+
defaultRedirectURL?: string | undefined;
|
|
28
|
+
};
|
|
29
|
+
type IDToken = {
|
|
30
|
+
/** Identity provider name */name: string;
|
|
31
|
+
kind: "IDToken"; /** ID token provider URL */
|
|
32
|
+
providerURL: string; /** Client ID for ID token validation */
|
|
33
|
+
clientID: string; /** ID token issuer URL */
|
|
34
|
+
issuerURL?: string | undefined; /** JWT claim to use as username */
|
|
35
|
+
usernameClaim?: string | undefined;
|
|
36
|
+
};
|
|
37
|
+
type BuiltinIdP = {
|
|
38
|
+
/** Identity provider name */name: string;
|
|
39
|
+
kind: "BuiltInIdP"; /** IdP namespace */
|
|
40
|
+
namespace: string; /** OAuth2 client name in the IdP */
|
|
41
|
+
clientName: string;
|
|
42
|
+
};
|
|
43
|
+
type IdProvider = OIDC | SAML | IDToken | BuiltinIdP;
|
|
44
|
+
type OAuth2ClientInput = {
|
|
45
|
+
/** Allowed redirect URIs */redirectURIs: (`https://${string}` | `http://${string}` | `${string}:url` | `${string}:url/${string}`)[]; /** Client description */
|
|
46
|
+
description?: string | undefined; /** Allowed OAuth2 grant types */
|
|
47
|
+
grantTypes?: ("authorization_code" | "refresh_token")[] | undefined; /** OAuth2 client type */
|
|
48
|
+
clientType?: "confidential" | "public" | "browser" | undefined; /** Access token lifetime in seconds (60-86400) */
|
|
49
|
+
accessTokenLifetimeSeconds?: number | undefined; /** Refresh token lifetime in seconds (60-604800) */
|
|
50
|
+
refreshTokenLifetimeSeconds?: number | undefined; /** Require DPoP (Demonstrating Proof-of-Possession) for token requests */
|
|
51
|
+
requireDpop?: boolean | undefined;
|
|
52
|
+
};
|
|
53
|
+
type OAuth2Client = {
|
|
54
|
+
/** Allowed OAuth2 grant types */grantTypes: ("authorization_code" | "refresh_token")[]; /** Allowed redirect URIs */
|
|
55
|
+
redirectURIs: (`https://${string}` | `http://${string}` | `${string}:url` | `${string}:url/${string}`)[]; /** Access token lifetime in seconds (60-86400) */
|
|
56
|
+
accessTokenLifetimeSeconds: {
|
|
57
|
+
seconds: bigint;
|
|
58
|
+
nanos: number;
|
|
59
|
+
} | undefined; /** Refresh token lifetime in seconds (60-604800) */
|
|
60
|
+
refreshTokenLifetimeSeconds: {
|
|
61
|
+
seconds: bigint;
|
|
62
|
+
nanos: number;
|
|
63
|
+
} | undefined; /** Client description */
|
|
64
|
+
description?: string | undefined; /** OAuth2 client type */
|
|
65
|
+
clientType?: "confidential" | "public" | "browser" | undefined; /** Require DPoP (Demonstrating Proof-of-Possession) for token requests */
|
|
66
|
+
requireDpop?: boolean | undefined;
|
|
67
|
+
};
|
|
68
|
+
type SCIMAuthorization = {
|
|
69
|
+
/** SCIM authorization type */type: "oauth2" | "bearer"; /** Bearer token secret (required for bearer type) */
|
|
70
|
+
bearerSecret?: {
|
|
71
|
+
vaultName: string;
|
|
72
|
+
secretKey: string;
|
|
73
|
+
} | undefined;
|
|
74
|
+
};
|
|
75
|
+
type SCIMAttribute = {
|
|
76
|
+
/** Attribute data type */type: "string" | "number" | "boolean" | "datetime" | "complex"; /** Attribute name */
|
|
77
|
+
name: string; /** Attribute description */
|
|
78
|
+
description?: string | undefined; /** Attribute mutability */
|
|
79
|
+
mutability?: "readOnly" | "readWrite" | "writeOnly" | undefined; /** Whether the attribute is required */
|
|
80
|
+
required?: boolean | undefined; /** Whether the attribute can have multiple values */
|
|
81
|
+
multiValued?: boolean | undefined; /** Uniqueness constraint */
|
|
82
|
+
uniqueness?: "none" | "server" | "global" | undefined; /** List of canonical values */
|
|
83
|
+
canonicalValues?: string[] | null | undefined;
|
|
84
|
+
subAttributes?: SCIMAttribute[] | null | undefined;
|
|
85
|
+
};
|
|
86
|
+
type SCIMAttributeMapping = {
|
|
87
|
+
/** TailorDB field name to map to */tailorDBField: string; /** SCIM attribute path */
|
|
88
|
+
scimPath: string;
|
|
89
|
+
};
|
|
90
|
+
type SCIMResource = {
|
|
91
|
+
/** SCIM resource name */name: string; /** TailorDB namespace for the resource */
|
|
92
|
+
tailorDBNamespace: string; /** TailorDB type name for the resource */
|
|
93
|
+
tailorDBType: string; /** Core SCIM schema definition */
|
|
94
|
+
coreSchema: {
|
|
95
|
+
/** SCIM resource name */name: string;
|
|
96
|
+
attributes: {
|
|
97
|
+
type: "string" | "number" | "boolean" | "datetime" | "complex"; /** SCIM resource name */
|
|
98
|
+
name: string;
|
|
99
|
+
description?: string | undefined;
|
|
100
|
+
mutability?: "readOnly" | "readWrite" | "writeOnly" | undefined;
|
|
101
|
+
required?: boolean | undefined;
|
|
102
|
+
multiValued?: boolean | undefined;
|
|
103
|
+
uniqueness?: "none" | "server" | "global" | undefined;
|
|
104
|
+
canonicalValues?: string[] | null | undefined;
|
|
105
|
+
subAttributes?: any[] | null | undefined;
|
|
106
|
+
}[];
|
|
107
|
+
}; /** Attribute mapping configuration */
|
|
108
|
+
attributeMapping: {
|
|
109
|
+
tailorDBField: string;
|
|
110
|
+
scimPath: string;
|
|
111
|
+
}[];
|
|
112
|
+
};
|
|
113
|
+
type SCIMConfig = {
|
|
114
|
+
/** Machine user name for SCIM operations */machineUserName: string; /** SCIM authorization configuration */
|
|
115
|
+
authorization: {
|
|
116
|
+
type: "oauth2" | "bearer";
|
|
117
|
+
bearerSecret?: {
|
|
118
|
+
vaultName: string;
|
|
119
|
+
secretKey: string;
|
|
120
|
+
} | undefined;
|
|
121
|
+
}; /** SCIM resource definitions */
|
|
122
|
+
resources: {
|
|
123
|
+
name: string;
|
|
124
|
+
tailorDBNamespace: string;
|
|
125
|
+
tailorDBType: string;
|
|
126
|
+
coreSchema: {
|
|
127
|
+
name: string;
|
|
128
|
+
attributes: {
|
|
129
|
+
type: "string" | "number" | "boolean" | "datetime" | "complex";
|
|
130
|
+
name: string;
|
|
131
|
+
description?: string | undefined;
|
|
132
|
+
mutability?: "readOnly" | "readWrite" | "writeOnly" | undefined;
|
|
133
|
+
required?: boolean | undefined;
|
|
134
|
+
multiValued?: boolean | undefined;
|
|
135
|
+
uniqueness?: "none" | "server" | "global" | undefined;
|
|
136
|
+
canonicalValues?: string[] | null | undefined;
|
|
137
|
+
subAttributes?: any[] | null | undefined;
|
|
138
|
+
}[];
|
|
139
|
+
};
|
|
140
|
+
attributeMapping: {
|
|
141
|
+
tailorDBField: string;
|
|
142
|
+
scimPath: string;
|
|
143
|
+
}[];
|
|
144
|
+
}[];
|
|
145
|
+
};
|
|
146
|
+
type TenantProvider = {
|
|
147
|
+
/** TailorDB namespace for the tenant type */namespace: string; /** TailorDB type name for tenants */
|
|
148
|
+
type: string; /** Field used as the tenant signature */
|
|
149
|
+
signatureField: string;
|
|
150
|
+
};
|
|
151
|
+
//#endregion
|
|
152
|
+
//#region src/types/executor.generated.d.ts
|
|
153
|
+
type TailorDBTrigger = {
|
|
154
|
+
/** TailorDB record event trigger */kind: "tailordb"; /** TailorDB event types to trigger on */
|
|
155
|
+
events: ("tailordb.type_record.created" | "tailordb.type_record.updated" | "tailordb.type_record.deleted")[]; /** TailorDB type name to watch for events */
|
|
156
|
+
typeName: string; /** Condition function to filter events */
|
|
157
|
+
condition?: Function | undefined;
|
|
158
|
+
};
|
|
159
|
+
type ResolverExecutedTrigger = {
|
|
160
|
+
kind: "resolverExecuted"; /** Name of the resolver to trigger on */
|
|
161
|
+
resolverName: string; /** Condition function to filter events */
|
|
162
|
+
condition?: Function | undefined;
|
|
163
|
+
};
|
|
164
|
+
type ScheduleTriggerInput = {
|
|
165
|
+
kind: "schedule"; /** CRON expression for the schedule */
|
|
166
|
+
cron: string; /** Timezone for the CRON schedule (default: UTC) */
|
|
167
|
+
timezone?: string | undefined;
|
|
168
|
+
};
|
|
169
|
+
type IncomingWebhookTrigger = {
|
|
170
|
+
kind: "incomingWebhook"; /** Response configuration */
|
|
171
|
+
response?: {
|
|
172
|
+
body?: Function | undefined;
|
|
173
|
+
statusCode?: number | undefined;
|
|
174
|
+
} | undefined;
|
|
175
|
+
};
|
|
176
|
+
type IdpUserTrigger = {
|
|
177
|
+
/** IdP user event trigger */kind: "idpUser"; /** IdP user event types to trigger on */
|
|
178
|
+
events: ("idp.user.created" | "idp.user.updated" | "idp.user.deleted")[]; /** IdP namespace name to subscribe to. If omitted, the project's only IdP is used; throws when multiple IdPs exist. */
|
|
179
|
+
idp?: string | undefined;
|
|
180
|
+
};
|
|
181
|
+
type AuthAccessTokenTrigger = {
|
|
182
|
+
/** Auth access token event trigger */kind: "authAccessToken"; /** Auth access token event types to trigger on */
|
|
183
|
+
events: ("auth.access_token.issued" | "auth.access_token.refreshed" | "auth.access_token.revoked")[];
|
|
184
|
+
};
|
|
185
|
+
type FunctionOperation = {
|
|
186
|
+
kind: "function" | "jobFunction"; /** Function implementation */
|
|
187
|
+
body: Function; /** Auth invoker for the function execution */
|
|
188
|
+
authInvoker?: string | {
|
|
189
|
+
namespace: string;
|
|
190
|
+
machineUserName: string;
|
|
191
|
+
} | undefined;
|
|
192
|
+
};
|
|
193
|
+
type GqlOperation = {
|
|
194
|
+
kind: "graphql";
|
|
195
|
+
query: string; /** Target application name for the GraphQL query */
|
|
196
|
+
appName?: string | undefined; /** Function to compute GraphQL variables */
|
|
197
|
+
variables?: Function | undefined; /** Auth invoker for the GraphQL execution */
|
|
198
|
+
authInvoker?: string | {
|
|
199
|
+
namespace: string;
|
|
200
|
+
machineUserName: string;
|
|
201
|
+
} | undefined;
|
|
202
|
+
};
|
|
203
|
+
type WebhookOperation = {
|
|
204
|
+
kind: "webhook"; /** Function returning the webhook URL */
|
|
205
|
+
url: Function; /** Function to compute the request body */
|
|
206
|
+
requestBody?: Function | undefined; /** HTTP headers for the webhook request */
|
|
207
|
+
headers?: {
|
|
208
|
+
[x: string]: string | {
|
|
209
|
+
vault: string;
|
|
210
|
+
key: string;
|
|
211
|
+
};
|
|
212
|
+
} | undefined;
|
|
213
|
+
};
|
|
214
|
+
type WorkflowOperation = {
|
|
215
|
+
kind: "workflow";
|
|
216
|
+
workflowName: string;
|
|
217
|
+
args?: Function | {
|
|
218
|
+
[x: string]: unknown;
|
|
219
|
+
} | undefined;
|
|
220
|
+
authInvoker?: string | {
|
|
221
|
+
namespace: string;
|
|
222
|
+
machineUserName: string;
|
|
223
|
+
} | undefined;
|
|
224
|
+
};
|
|
225
|
+
type ExecutorInput = {
|
|
226
|
+
/** Executor name */name: string; /** Event trigger configuration */
|
|
227
|
+
trigger: {
|
|
228
|
+
kind: "tailordb";
|
|
229
|
+
events: ("tailordb.type_record.created" | "tailordb.type_record.updated" | "tailordb.type_record.deleted")[];
|
|
230
|
+
typeName: string;
|
|
231
|
+
condition?: Function | undefined;
|
|
232
|
+
} | {
|
|
233
|
+
kind: "resolverExecuted";
|
|
234
|
+
resolverName: string;
|
|
235
|
+
condition?: Function | undefined;
|
|
236
|
+
} | {
|
|
237
|
+
kind: "schedule";
|
|
238
|
+
cron: string;
|
|
239
|
+
timezone?: string | undefined;
|
|
240
|
+
} | {
|
|
241
|
+
kind: "incomingWebhook";
|
|
242
|
+
response?: {
|
|
243
|
+
body?: Function | undefined;
|
|
244
|
+
statusCode?: number | undefined;
|
|
245
|
+
} | undefined;
|
|
246
|
+
} | {
|
|
247
|
+
kind: "idpUser";
|
|
248
|
+
events: ("idp.user.created" | "idp.user.updated" | "idp.user.deleted")[];
|
|
249
|
+
idp?: string | undefined;
|
|
250
|
+
} | {
|
|
251
|
+
kind: "authAccessToken";
|
|
252
|
+
events: ("auth.access_token.issued" | "auth.access_token.refreshed" | "auth.access_token.revoked")[];
|
|
253
|
+
}; /** Operation to execute when triggered */
|
|
254
|
+
operation: unknown; /** Executor description */
|
|
255
|
+
description?: string | undefined; /** Whether the executor is disabled */
|
|
256
|
+
disabled?: boolean | undefined;
|
|
257
|
+
};
|
|
258
|
+
type Executor = {
|
|
259
|
+
/** Executor name */name: string; /** Whether the executor is disabled */
|
|
260
|
+
disabled: boolean; /** Event trigger configuration */
|
|
261
|
+
trigger: {
|
|
262
|
+
kind: "tailordb";
|
|
263
|
+
events: ("tailordb.type_record.created" | "tailordb.type_record.updated" | "tailordb.type_record.deleted")[];
|
|
264
|
+
typeName: string;
|
|
265
|
+
condition?: Function | undefined;
|
|
266
|
+
} | {
|
|
267
|
+
kind: "resolverExecuted";
|
|
268
|
+
resolverName: string;
|
|
269
|
+
condition?: Function | undefined;
|
|
270
|
+
} | {
|
|
271
|
+
kind: "schedule";
|
|
272
|
+
cron: string;
|
|
273
|
+
timezone: string;
|
|
274
|
+
} | {
|
|
275
|
+
kind: "incomingWebhook";
|
|
276
|
+
response?: {
|
|
277
|
+
body?: Function | undefined;
|
|
278
|
+
statusCode?: number | undefined;
|
|
279
|
+
} | undefined;
|
|
280
|
+
} | {
|
|
281
|
+
kind: "idpUser";
|
|
282
|
+
events: ("idp.user.created" | "idp.user.updated" | "idp.user.deleted")[];
|
|
283
|
+
idp?: string | undefined;
|
|
284
|
+
} | {
|
|
285
|
+
kind: "authAccessToken";
|
|
286
|
+
events: ("auth.access_token.issued" | "auth.access_token.refreshed" | "auth.access_token.revoked")[];
|
|
287
|
+
}; /** Operation to execute when triggered */
|
|
288
|
+
operation: {
|
|
289
|
+
kind: "workflow";
|
|
290
|
+
workflowName: string;
|
|
291
|
+
args?: Function | {
|
|
292
|
+
[x: string]: unknown;
|
|
293
|
+
} | undefined;
|
|
294
|
+
authInvoker?: string | {
|
|
295
|
+
namespace: string;
|
|
296
|
+
machineUserName: string;
|
|
297
|
+
} | undefined;
|
|
298
|
+
} | {
|
|
299
|
+
kind: "function" | "jobFunction";
|
|
300
|
+
body: Function;
|
|
301
|
+
authInvoker?: string | {
|
|
302
|
+
namespace: string;
|
|
303
|
+
machineUserName: string;
|
|
304
|
+
} | undefined;
|
|
305
|
+
} | {
|
|
306
|
+
kind: "graphql";
|
|
307
|
+
query: string;
|
|
308
|
+
appName?: string | undefined;
|
|
309
|
+
variables?: Function | undefined;
|
|
310
|
+
authInvoker?: string | {
|
|
311
|
+
namespace: string;
|
|
312
|
+
machineUserName: string;
|
|
313
|
+
} | undefined;
|
|
314
|
+
} | {
|
|
315
|
+
kind: "webhook";
|
|
316
|
+
url: Function;
|
|
317
|
+
requestBody?: Function | undefined;
|
|
318
|
+
headers?: {
|
|
319
|
+
[x: string]: string | {
|
|
320
|
+
vault: string;
|
|
321
|
+
key: string;
|
|
322
|
+
};
|
|
323
|
+
} | undefined;
|
|
324
|
+
}; /** Executor description */
|
|
325
|
+
description?: string | undefined;
|
|
326
|
+
};
|
|
327
|
+
//#endregion
|
|
328
|
+
//#region src/types/generator-config.generated.d.ts
|
|
329
|
+
type BaseGeneratorConfig = ["@tailor-platform/kysely-type", {
|
|
330
|
+
distPath: string;
|
|
331
|
+
}] | ["@tailor-platform/seed", {
|
|
332
|
+
distPath: string;
|
|
333
|
+
machineUserName?: string | undefined;
|
|
334
|
+
disableIdpUserSync?: {
|
|
335
|
+
userToIdp?: boolean | undefined;
|
|
336
|
+
idpToUser?: boolean | undefined;
|
|
337
|
+
} | undefined;
|
|
338
|
+
}] | ["@tailor-platform/enum-constants", {
|
|
339
|
+
distPath: string;
|
|
340
|
+
}] | ["@tailor-platform/file-utils", {
|
|
341
|
+
distPath: string;
|
|
342
|
+
}] | {
|
|
343
|
+
id: string;
|
|
344
|
+
description: string;
|
|
345
|
+
dependencies: ("tailordb" | "resolver" | "executor")[];
|
|
346
|
+
aggregate: Function;
|
|
347
|
+
processType?: Function | undefined;
|
|
348
|
+
processResolver?: Function | undefined;
|
|
349
|
+
processExecutor?: Function | undefined;
|
|
350
|
+
processTailorDBNamespace?: Function | undefined;
|
|
351
|
+
processResolverNamespace?: Function | undefined;
|
|
352
|
+
};
|
|
353
|
+
type BaseGeneratorConfigInput = BaseGeneratorConfig;
|
|
354
|
+
//#endregion
|
|
355
|
+
//#region src/types/generator-config.d.ts
|
|
356
|
+
type GeneratorConfig = BaseGeneratorConfigInput;
|
|
357
|
+
//#endregion
|
|
358
|
+
//#region src/types/resolver.generated.d.ts
|
|
359
|
+
type Resolver = {
|
|
360
|
+
/** GraphQL operation type (query or mutation) */operation: "query" | "mutation"; /** Resolver name */
|
|
361
|
+
name: string; /** Resolver implementation function */
|
|
362
|
+
body: Function; /** Output field definition */
|
|
363
|
+
output: {
|
|
364
|
+
type: "string" | "boolean" | "date" | "enum" | "uuid" | "integer" | "float" | "decimal" | "datetime" | "time" | "nested";
|
|
365
|
+
metadata: {
|
|
366
|
+
required?: boolean | undefined;
|
|
367
|
+
array?: boolean | undefined; /** Resolver description */
|
|
368
|
+
description?: string | undefined;
|
|
369
|
+
allowedValues?: {
|
|
370
|
+
value: string; /** Resolver description */
|
|
371
|
+
description?: string | undefined;
|
|
372
|
+
}[] | undefined;
|
|
373
|
+
hooks?: {
|
|
374
|
+
create?: Function | undefined;
|
|
375
|
+
update?: Function | undefined;
|
|
376
|
+
} | undefined;
|
|
377
|
+
typeName?: string | undefined;
|
|
378
|
+
};
|
|
379
|
+
fields: {
|
|
380
|
+
[x: string]: any;
|
|
381
|
+
};
|
|
382
|
+
}; /** Resolver description */
|
|
383
|
+
description?: string | undefined; /** Input field definitions */
|
|
384
|
+
input?: {
|
|
385
|
+
[x: string]: any;
|
|
386
|
+
} | undefined; /** Enable publishing events from this resolver */
|
|
387
|
+
publishEvents?: boolean | undefined; /** Machine user to execute this resolver as */
|
|
388
|
+
authInvoker?: string | {
|
|
389
|
+
namespace: string;
|
|
390
|
+
machineUserName: string;
|
|
391
|
+
} | undefined;
|
|
392
|
+
};
|
|
393
|
+
type ResolverInput = Resolver;
|
|
394
|
+
//#endregion
|
|
395
|
+
//#region src/types/plugin-generation.d.ts
|
|
396
|
+
/**
|
|
397
|
+
* A single generated file to write to disk.
|
|
398
|
+
*/
|
|
399
|
+
interface GeneratedFile {
|
|
400
|
+
path: string;
|
|
401
|
+
content: string;
|
|
402
|
+
skipIfExists?: boolean;
|
|
403
|
+
executable?: boolean;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Result returned by generation-time hooks.
|
|
407
|
+
*/
|
|
408
|
+
interface GeneratorResult {
|
|
409
|
+
files: GeneratedFile[];
|
|
410
|
+
errors?: string[];
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Auth configuration available to generation-time hooks.
|
|
414
|
+
*/
|
|
415
|
+
interface GeneratorAuthInput {
|
|
416
|
+
name: string;
|
|
417
|
+
userProfile?: {
|
|
418
|
+
typeName: string;
|
|
419
|
+
namespace: string;
|
|
420
|
+
usernameField: string;
|
|
421
|
+
};
|
|
422
|
+
machineUsers?: Record<string, {
|
|
423
|
+
attributes: Record<string, unknown>;
|
|
424
|
+
}>;
|
|
425
|
+
oauth2Clients?: Record<string, OAuth2ClientInput>;
|
|
426
|
+
idProvider?: IdProvider;
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Namespace-level TailorDB data available to generation-time hooks.
|
|
430
|
+
*/
|
|
431
|
+
interface TailorDBNamespaceData {
|
|
432
|
+
/** Namespace name */
|
|
433
|
+
namespace: string;
|
|
434
|
+
/** All TailorDB types in this namespace, keyed by type name */
|
|
435
|
+
types: Record<string, TailorDBType>;
|
|
436
|
+
/** Source info for each type (file path, export name, plugin info) */
|
|
437
|
+
sourceInfo: ReadonlyMap<string, TypeSourceInfoEntry>;
|
|
438
|
+
/** Plugin attachments configured on each type via .plugin() method */
|
|
439
|
+
pluginAttachments: ReadonlyMap<string, readonly PluginAttachment[]>;
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Namespace-level resolver data available to generation-time hooks.
|
|
443
|
+
*/
|
|
444
|
+
interface ResolverNamespaceData {
|
|
445
|
+
/** Namespace name */
|
|
446
|
+
namespace: string;
|
|
447
|
+
/** All resolvers in this namespace, keyed by resolver name */
|
|
448
|
+
resolvers: Record<string, Resolver>;
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Context passed to plugin's onTailorDBReady hook.
|
|
452
|
+
* @template PluginConfig - Plugin-level configuration type
|
|
453
|
+
*/
|
|
454
|
+
interface TailorDBReadyContext<PluginConfig = unknown> {
|
|
455
|
+
/** All TailorDB namespaces with their types and metadata */
|
|
456
|
+
tailordb: TailorDBNamespaceData[];
|
|
457
|
+
/** Auth configuration */
|
|
458
|
+
auth?: GeneratorAuthInput;
|
|
459
|
+
/** Base directory for generated files */
|
|
460
|
+
baseDir: string;
|
|
461
|
+
/** Path to tailor.config.ts */
|
|
462
|
+
configPath: string;
|
|
463
|
+
/** Plugin-level configuration passed via definePlugins() */
|
|
464
|
+
pluginConfig: PluginConfig;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Context passed to plugin's onResolverReady hook.
|
|
468
|
+
* @template PluginConfig - Plugin-level configuration type
|
|
469
|
+
*/
|
|
470
|
+
interface ResolverReadyContext<PluginConfig = unknown> {
|
|
471
|
+
/** All TailorDB namespaces with their types and metadata */
|
|
472
|
+
tailordb: TailorDBNamespaceData[];
|
|
473
|
+
/** All resolver namespaces with their resolvers */
|
|
474
|
+
resolvers: ResolverNamespaceData[];
|
|
475
|
+
/** Auth configuration */
|
|
476
|
+
auth?: GeneratorAuthInput;
|
|
477
|
+
/** Base directory for generated files */
|
|
478
|
+
baseDir: string;
|
|
479
|
+
/** Path to tailor.config.ts */
|
|
480
|
+
configPath: string;
|
|
481
|
+
/** Plugin-level configuration passed via definePlugins() */
|
|
482
|
+
pluginConfig: PluginConfig;
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Context passed to plugin's onExecutorReady hook.
|
|
486
|
+
* @template PluginConfig - Plugin-level configuration type
|
|
487
|
+
*/
|
|
488
|
+
interface ExecutorReadyContext<PluginConfig = unknown> {
|
|
489
|
+
/** All TailorDB namespaces with their types and metadata */
|
|
490
|
+
tailordb: TailorDBNamespaceData[];
|
|
491
|
+
/** All resolver namespaces with their resolvers */
|
|
492
|
+
resolvers: ResolverNamespaceData[];
|
|
493
|
+
/** All executors, keyed by executor name */
|
|
494
|
+
executors: Record<string, Executor>;
|
|
495
|
+
/** Auth configuration */
|
|
496
|
+
auth?: GeneratorAuthInput;
|
|
497
|
+
/** Base directory for generated files */
|
|
498
|
+
baseDir: string;
|
|
499
|
+
/** Path to tailor.config.ts */
|
|
500
|
+
configPath: string;
|
|
501
|
+
/** Plugin-level configuration passed via definePlugins() */
|
|
502
|
+
pluginConfig: PluginConfig;
|
|
503
|
+
}
|
|
504
|
+
//#endregion
|
|
505
|
+
//#region src/types/plugin.d.ts
|
|
506
|
+
type TypeConfigRequired<PluginConfig = unknown> = boolean | ((pluginConfig: PluginConfig | undefined) => boolean);
|
|
507
|
+
/**
|
|
508
|
+
* Interface for plugin configuration mapping.
|
|
509
|
+
* Extend this interface via declaration merging to add typed plugin configs.
|
|
510
|
+
*/
|
|
511
|
+
interface PluginConfigs<Fields extends string = string> {}
|
|
512
|
+
/**
|
|
513
|
+
* Context passed to plugin's process method
|
|
514
|
+
*/
|
|
515
|
+
interface PluginProcessContext<TypeConfig = unknown, PluginConfig = unknown> {
|
|
516
|
+
type: TailorAnyDBType;
|
|
517
|
+
typeConfig: TypeConfig;
|
|
518
|
+
pluginConfig: PluginConfig;
|
|
519
|
+
namespace: string;
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Context passed to plugin's onNamespaceLoaded hook.
|
|
523
|
+
*/
|
|
524
|
+
interface PluginNamespaceProcessContext<PluginConfig = unknown> {
|
|
525
|
+
pluginConfig: PluginConfig;
|
|
526
|
+
namespace: string;
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Interface representing a TailorDB type for plugin output.
|
|
530
|
+
*/
|
|
531
|
+
interface TailorDBTypeForPlugin {
|
|
532
|
+
readonly name: string;
|
|
533
|
+
readonly fields: Record<string, unknown>;
|
|
534
|
+
}
|
|
535
|
+
type PluginGeneratedType = TailorDBTypeForPlugin;
|
|
536
|
+
type PluginGeneratedTypes = Record<string, PluginGeneratedType>;
|
|
537
|
+
interface PluginGeneratedResolver {
|
|
538
|
+
name: string;
|
|
539
|
+
operation: "query" | "mutation";
|
|
540
|
+
inputFields?: Record<string, unknown>;
|
|
541
|
+
outputFields: Record<string, unknown>;
|
|
542
|
+
body: string;
|
|
543
|
+
}
|
|
544
|
+
interface PluginRecordTriggerConfig {
|
|
545
|
+
kind: "tailordb";
|
|
546
|
+
events: ("tailordb.type_record.created" | "tailordb.type_record.updated" | "tailordb.type_record.deleted")[];
|
|
547
|
+
typeName: string;
|
|
548
|
+
}
|
|
549
|
+
interface PluginScheduleTriggerConfig {
|
|
550
|
+
kind: "schedule";
|
|
551
|
+
cron: string;
|
|
552
|
+
timezone?: string;
|
|
553
|
+
}
|
|
554
|
+
interface PluginIncomingWebhookTriggerConfig {
|
|
555
|
+
kind: "incomingWebhook";
|
|
556
|
+
}
|
|
557
|
+
type PluginTriggerConfig = PluginRecordTriggerConfig | PluginScheduleTriggerConfig | PluginIncomingWebhookTriggerConfig;
|
|
558
|
+
type PluginInjectValue = string | number | boolean | null;
|
|
559
|
+
type PluginInjectMap = Record<string, PluginInjectValue>;
|
|
560
|
+
interface PluginFunctionOperationConfig {
|
|
561
|
+
kind: "function";
|
|
562
|
+
body: string;
|
|
563
|
+
inject?: PluginInjectMap;
|
|
564
|
+
}
|
|
565
|
+
interface PluginGraphQLOperationConfig {
|
|
566
|
+
kind: "graphql";
|
|
567
|
+
query: string;
|
|
568
|
+
appName?: string;
|
|
569
|
+
variables?: string;
|
|
570
|
+
}
|
|
571
|
+
interface PluginWebhookOperationConfig {
|
|
572
|
+
kind: "webhook";
|
|
573
|
+
url: string;
|
|
574
|
+
}
|
|
575
|
+
interface PluginWorkflowOperationConfig {
|
|
576
|
+
kind: "workflow";
|
|
577
|
+
workflowName: string;
|
|
578
|
+
}
|
|
579
|
+
type PluginOperationConfig = PluginFunctionOperationConfig | PluginGraphQLOperationConfig | PluginWebhookOperationConfig | PluginWorkflowOperationConfig;
|
|
580
|
+
type PluginExecutorContextValue = TailorAnyDBType | string | number | boolean | null | undefined;
|
|
581
|
+
interface PluginExecutorContextBase {
|
|
582
|
+
sourceType: TailorAnyDBType | null;
|
|
583
|
+
namespace: string;
|
|
584
|
+
}
|
|
585
|
+
type PluginExecutorContext = PluginExecutorContextBase & {
|
|
586
|
+
[key: string]: PluginExecutorContextValue;
|
|
587
|
+
};
|
|
588
|
+
interface PluginExecutorModule {
|
|
589
|
+
default: unknown;
|
|
590
|
+
}
|
|
591
|
+
interface PluginGeneratedExecutorWithFile<Ctx = PluginExecutorContext> {
|
|
592
|
+
name: string;
|
|
593
|
+
resolve: () => Promise<PluginExecutorModule>;
|
|
594
|
+
context: Ctx;
|
|
595
|
+
}
|
|
596
|
+
interface PluginGeneratedExecutorLegacy {
|
|
597
|
+
name: string;
|
|
598
|
+
description?: string;
|
|
599
|
+
trigger: PluginTriggerConfig;
|
|
600
|
+
operation: PluginOperationConfig;
|
|
601
|
+
}
|
|
602
|
+
type PluginGeneratedExecutor = PluginGeneratedExecutorWithFile | PluginGeneratedExecutorLegacy;
|
|
603
|
+
interface PluginExtends {
|
|
604
|
+
fields?: Record<string, TailorAnyDBField>;
|
|
605
|
+
}
|
|
606
|
+
interface PluginOutput {
|
|
607
|
+
types?: PluginGeneratedTypes;
|
|
608
|
+
resolvers?: PluginGeneratedResolver[];
|
|
609
|
+
executors?: PluginGeneratedExecutor[];
|
|
610
|
+
}
|
|
611
|
+
interface TypePluginOutput extends PluginOutput {
|
|
612
|
+
extends?: PluginExtends;
|
|
613
|
+
}
|
|
614
|
+
type NamespacePluginOutput = PluginOutput;
|
|
615
|
+
/**
|
|
616
|
+
* Plugin interface that all plugins must implement.
|
|
617
|
+
* @template TypeConfig - Type for per-type configuration passed via .plugin() method
|
|
618
|
+
* @template PluginConfig - Type for plugin-level configuration passed via definePlugins()
|
|
619
|
+
*/
|
|
620
|
+
interface Plugin<TypeConfig = unknown, PluginConfig = unknown> {
|
|
621
|
+
readonly id: string;
|
|
622
|
+
readonly description: string;
|
|
623
|
+
readonly importPath?: string;
|
|
624
|
+
readonly typeConfigRequired?: TypeConfigRequired<PluginConfig>;
|
|
625
|
+
readonly pluginConfig?: PluginConfig;
|
|
626
|
+
onTypeLoaded?(context: PluginProcessContext<TypeConfig, PluginConfig>): TypePluginOutput | Promise<TypePluginOutput>;
|
|
627
|
+
onNamespaceLoaded?(context: PluginNamespaceProcessContext<PluginConfig>): NamespacePluginOutput | Promise<NamespacePluginOutput>;
|
|
628
|
+
onTailorDBReady?(context: TailorDBReadyContext<PluginConfig>): GeneratorResult | Promise<GeneratorResult>;
|
|
629
|
+
onResolverReady?(context: ResolverReadyContext<PluginConfig>): GeneratorResult | Promise<GeneratorResult>;
|
|
630
|
+
onExecutorReady?(context: ExecutorReadyContext<PluginConfig>): GeneratorResult | Promise<GeneratorResult>;
|
|
631
|
+
}
|
|
632
|
+
//#endregion
|
|
633
|
+
export { IdpUserTrigger as A, IdProvider as B, GeneratorConfig as C, ExecutorInput as D, Executor as E, WebhookOperation as F, SCIMAttribute as G, OAuth2ClientInput as H, WorkflowOperation as I, SCIMConfig as J, SCIMAttributeMapping as K, AuthInvoker as L, ResolverExecutedTrigger as M, ScheduleTriggerInput as N, FunctionOperation as O, TailorDBTrigger as P, BuiltinIdP as R, ResolverInput as S, AuthAccessTokenTrigger as T, OIDC as U, OAuth2Client as V, SAML as W, TenantProvider as X, SCIMResource as Y, ResolverNamespaceData as _, PluginExecutorContextBase as a, TailorDBReadyContext as b, PluginGeneratedResolver as c, PluginOutput as d, PluginProcessContext as f, GeneratorResult as g, ExecutorReadyContext as h, PluginExecutorContext as i, IncomingWebhookTrigger as j, GqlOperation as k, PluginGeneratedType as l, TypePluginOutput as m, Plugin as n, PluginGeneratedExecutor as o, TailorDBTypeForPlugin as p, SCIMAuthorization as q, PluginConfigs as r, PluginGeneratedExecutorWithFile as s, NamespacePluginOutput as t, PluginNamespaceProcessContext as u, ResolverReadyContext as v, BaseGeneratorConfig as w, Resolver as x, TailorDBNamespaceData as y, IDToken as z };
|
|
634
|
+
//# sourceMappingURL=plugin-BuE5ZOnW.d.mts.map
|