@tailor-platform/sdk 1.2.2 → 1.2.4

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.
@@ -1,5 +1,6 @@
1
1
  /// <reference path="./../user-defined.d.ts" />
2
- import { N as ParsedTailorDBType, Y as OAuth2ClientInput, d as AppConfig, m as Generator, q as IdProviderConfig, t as Executor, yt as Resolver } from "../types-C0n7Syhv.mjs";
2
+ import { H as IdProviderConfig, R as ParsedTailorDBType, W as OAuth2ClientInput, _t as Resolver, d as AppConfig, m as Generator, t as Executor } from "../types-BeinUo7W.mjs";
3
+ import "citty";
3
4
  import { z } from "zod";
4
5
  import { OAuth2Client } from "@badgateway/oauth2-client";
5
6
  import "@bufbuild/protobuf/wkt";
@@ -17,6 +18,11 @@ interface ApplyOptions {
17
18
  yes?: boolean;
18
19
  buildOnly?: boolean;
19
20
  }
21
+ /**
22
+ * Apply the configured application to the Tailor platform.
23
+ * @param {ApplyOptions} [options] - Options for apply execution
24
+ * @returns {Promise<void>} Promise that resolves when apply completes
25
+ */
20
26
  declare function apply(options?: ApplyOptions): Promise<void>;
21
27
  //#endregion
22
28
  //#region src/cli/generator/types.d.ts
@@ -95,8 +101,6 @@ interface AuthPart {
95
101
  auth?: GeneratorAuthInput;
96
102
  }
97
103
  type SelectInput<Deps extends readonly DependencyKind[], Ts, Rs, E> = (HasDependency<Deps, "tailordb"> extends true ? TailorDBInputPart<Ts> : object) & (HasDependency<Deps, "resolver"> extends true ? ResolverInputPart<Rs> : object) & (HasDependency<Deps, "executor"> extends true ? ExecutorInputPart<E> : object) & AuthPart;
98
- /** Input type for aggregate method - use with dependencies */
99
-
100
104
  /** Input type for TailorDB-only generators */
101
105
  type TailorDBInput<Ts> = TailorDBInputPart<Ts> & AuthPart;
102
106
  /** Input type for Resolver-only generators */
@@ -150,9 +154,19 @@ type GenerateOptions = {
150
154
  };
151
155
  //#endregion
152
156
  //#region src/cli/generator/index.d.ts
157
+ /**
158
+ * Run code generation using the Tailor configuration and generators.
159
+ * @param {GenerateOptions} [options] - Generation options
160
+ * @returns {Promise<void>} Promise that resolves when generation (and watch, if enabled) completes
161
+ */
153
162
  declare function generate(options?: GenerateOptions): Promise<void>;
154
163
  //#endregion
155
164
  //#region src/cli/config-loader.d.ts
165
+ /**
166
+ * Load Tailor configuration file and associated generators.
167
+ * @param {string} [configPath] - Optional explicit config path
168
+ * @returns {Promise<{ config: AppConfig; generators: Generator[]; configPath: string }>} Loaded config and generators
169
+ */
156
170
  declare function loadConfig(configPath?: string): Promise<{
157
171
  config: AppConfig;
158
172
  generators: Generator[];
@@ -160,6 +174,12 @@ declare function loadConfig(configPath?: string): Promise<{
160
174
  }>;
161
175
  //#endregion
162
176
  //#region src/cli/type-generator.d.ts
177
+ /**
178
+ * Generate user type definitions from the app config and write them to disk.
179
+ * @param {AppConfig} config - Application config
180
+ * @param {string} configPath - Path to Tailor config file
181
+ * @returns {Promise<void>} Promise that resolves when types are generated
182
+ */
163
183
  declare function generateUserTypes(config: AppConfig, configPath: string): Promise<void>;
164
184
  //#endregion
165
185
  //#region src/cli/show.d.ts
@@ -179,6 +199,11 @@ interface ApplicationInfo {
179
199
  createdAt: string;
180
200
  updatedAt: string;
181
201
  }
202
+ /**
203
+ * Show applied application information for the current workspace.
204
+ * @param {ShowOptions} [options] - Show options
205
+ * @returns {Promise<ApplicationInfo>} Application information
206
+ */
182
207
  declare function show(options?: ShowOptions): Promise<ApplicationInfo>;
183
208
  //#endregion
184
209
  //#region src/cli/remove.d.ts
@@ -187,6 +212,11 @@ interface RemoveOptions {
187
212
  profile?: string;
188
213
  configPath?: string;
189
214
  }
215
+ /**
216
+ * Remove all resources managed by the current application.
217
+ * @param {RemoveOptions} [options] - Remove options
218
+ * @returns {Promise<void>} Promise that resolves when removal completes
219
+ */
190
220
  declare function remove(options?: RemoveOptions): Promise<void>;
191
221
  //#endregion
192
222
  //#region src/cli/workspace/transform.d.ts
@@ -212,12 +242,22 @@ declare const createWorkspaceOptionsSchema: z.ZodObject<{
212
242
  folderId: z.ZodOptional<z.ZodUUID>;
213
243
  }, z.core.$strip>;
214
244
  type CreateWorkspaceOptions = z.input<typeof createWorkspaceOptionsSchema>;
245
+ /**
246
+ * Create a new workspace with the given options.
247
+ * @param {CreateWorkspaceOptions} options - Workspace creation options
248
+ * @returns {Promise<WorkspaceInfo>} Created workspace info
249
+ */
215
250
  declare function createWorkspace(options: CreateWorkspaceOptions): Promise<WorkspaceInfo>;
216
251
  //#endregion
217
252
  //#region src/cli/workspace/list.d.ts
218
253
  interface ListWorkspacesOptions {
219
254
  limit?: number;
220
255
  }
256
+ /**
257
+ * List workspaces with an optional limit.
258
+ * @param {ListWorkspacesOptions} [options] - Workspace listing options
259
+ * @returns {Promise<WorkspaceInfo[]>} List of workspaces
260
+ */
221
261
  declare function listWorkspaces(options?: ListWorkspacesOptions): Promise<WorkspaceInfo[]>;
222
262
  //#endregion
223
263
  //#region src/cli/workspace/delete.d.ts
@@ -225,6 +265,11 @@ declare const deleteWorkspaceOptionsSchema: z.ZodObject<{
225
265
  workspaceId: z.ZodUUID;
226
266
  }, z.core.$strip>;
227
267
  type DeleteWorkspaceOptions = z.input<typeof deleteWorkspaceOptionsSchema>;
268
+ /**
269
+ * Delete a workspace by ID.
270
+ * @param {DeleteWorkspaceOptions} options - Workspace deletion options
271
+ * @returns {Promise<void>} Promise that resolves when deletion completes
272
+ */
228
273
  declare function deleteWorkspace(options: DeleteWorkspaceOptions): Promise<void>;
229
274
  //#endregion
230
275
  //#region src/cli/machineuser/list.d.ts
@@ -240,6 +285,11 @@ interface MachineUserInfo {
240
285
  createdAt: string;
241
286
  updatedAt: string;
242
287
  }
288
+ /**
289
+ * List machine users for the current application.
290
+ * @param {ListMachineUsersOptions} [options] - Machine user listing options
291
+ * @returns {Promise<MachineUserInfo[]>} List of machine users
292
+ */
243
293
  declare function listMachineUsers(options?: ListMachineUsersOptions): Promise<MachineUserInfo[]>;
244
294
  //#endregion
245
295
  //#region src/cli/machineuser/token.d.ts
@@ -254,6 +304,11 @@ interface MachineUserTokenInfo {
254
304
  tokenType: string;
255
305
  expiresAt: string;
256
306
  }
307
+ /**
308
+ * Get a machine user access token for the current application.
309
+ * @param {GetMachineUserTokenOptions} options - Token retrieval options
310
+ * @returns {Promise<MachineUserTokenInfo>} Machine user token info
311
+ */
257
312
  declare function getMachineUserToken(options: GetMachineUserTokenOptions): Promise<MachineUserTokenInfo>;
258
313
  //#endregion
259
314
  //#region src/cli/oauth2client/transform.d.ts
@@ -282,6 +337,11 @@ interface GetOAuth2ClientOptions {
282
337
  profile?: string;
283
338
  configPath?: string;
284
339
  }
340
+ /**
341
+ * Get OAuth2 client credentials for the current application.
342
+ * @param {GetOAuth2ClientOptions} options - OAuth2 client lookup options
343
+ * @returns {Promise<OAuth2ClientCredentials>} OAuth2 client credentials
344
+ */
285
345
  declare function getOAuth2Client(options: GetOAuth2ClientOptions): Promise<OAuth2ClientCredentials>;
286
346
  //#endregion
287
347
  //#region src/cli/oauth2client/list.d.ts
@@ -290,6 +350,11 @@ interface ListOAuth2ClientsOptions {
290
350
  profile?: string;
291
351
  configPath?: string;
292
352
  }
353
+ /**
354
+ * List OAuth2 clients for the current application.
355
+ * @param {ListOAuth2ClientsOptions} [options] - OAuth2 client listing options
356
+ * @returns {Promise<OAuth2ClientInfo[]>} List of OAuth2 clients
357
+ */
293
358
  declare function listOAuth2Clients(options?: ListOAuth2ClientsOptions): Promise<OAuth2ClientInfo[]>;
294
359
  //#endregion
295
360
  //#region src/cli/workflow/transform.d.ts
@@ -329,6 +394,11 @@ interface ListWorkflowsOptions {
329
394
  workspaceId?: string;
330
395
  profile?: string;
331
396
  }
397
+ /**
398
+ * List workflows in the workspace and return CLI-friendly info.
399
+ * @param {ListWorkflowsOptions} [options] - Workflow listing options
400
+ * @returns {Promise<WorkflowListInfo[]>} List of workflows
401
+ */
332
402
  declare function listWorkflows(options?: ListWorkflowsOptions): Promise<WorkflowListInfo[]>;
333
403
  //#endregion
334
404
  //#region src/cli/workflow/get.d.ts
@@ -337,6 +407,11 @@ interface GetWorkflowOptions {
337
407
  workspaceId?: string;
338
408
  profile?: string;
339
409
  }
410
+ /**
411
+ * Get a workflow by name and return CLI-friendly info.
412
+ * @param {GetWorkflowOptions} options - Workflow lookup options
413
+ * @returns {Promise<WorkflowInfo>} Workflow information
414
+ */
340
415
  declare function getWorkflow(options: GetWorkflowOptions): Promise<WorkflowInfo>;
341
416
  //#endregion
342
417
  //#region src/cli/workflow/start.d.ts
@@ -356,6 +431,11 @@ interface StartWorkflowResultWithWait {
356
431
  executionId: string;
357
432
  wait: (options?: WaitOptions) => Promise<WorkflowExecutionInfo>;
358
433
  }
434
+ /**
435
+ * Start a workflow and return a handle to wait for completion.
436
+ * @param {StartWorkflowOptions} options - Start options
437
+ * @returns {Promise<StartWorkflowResultWithWait>} Start result with wait helper
438
+ */
359
439
  declare function startWorkflow(options: StartWorkflowOptions): Promise<StartWorkflowResultWithWait>;
360
440
  //#endregion
361
441
  //#region src/cli/workflow/executions.d.ts
@@ -382,7 +462,17 @@ interface GetWorkflowExecutionResult {
382
462
  execution: WorkflowExecutionDetailInfo;
383
463
  wait: () => Promise<WorkflowExecutionDetailInfo>;
384
464
  }
465
+ /**
466
+ * List workflow executions with optional filters.
467
+ * @param {ListWorkflowExecutionsOptions} [options] - Workflow execution listing options
468
+ * @returns {Promise<WorkflowExecutionInfo[]>} List of workflow executions
469
+ */
385
470
  declare function listWorkflowExecutions(options?: ListWorkflowExecutionsOptions): Promise<WorkflowExecutionInfo[]>;
471
+ /**
472
+ * Get a single workflow execution with optional logs.
473
+ * @param {GetWorkflowExecutionOptions} options - Workflow execution lookup options
474
+ * @returns {Promise<GetWorkflowExecutionResult>} Workflow execution with optional logs
475
+ */
386
476
  declare function getWorkflowExecution(options: GetWorkflowExecutionOptions): Promise<GetWorkflowExecutionResult>;
387
477
  //#endregion
388
478
  //#region src/cli/workflow/resume.d.ts
@@ -396,13 +486,34 @@ interface ResumeWorkflowResultWithWait {
396
486
  executionId: string;
397
487
  wait: (options?: WaitOptions) => Promise<WorkflowExecutionInfo>;
398
488
  }
489
+ /**
490
+ * Resume a suspended workflow execution and return a handle to wait for completion.
491
+ * @param {ResumeWorkflowOptions} options - Resume options
492
+ * @returns {Promise<ResumeWorkflowResultWithWait>} Resume result with wait helper
493
+ */
399
494
  declare function resumeWorkflow(options: ResumeWorkflowOptions): Promise<ResumeWorkflowResultWithWait>;
400
495
  //#endregion
401
496
  //#region src/cli/context.d.ts
497
+ /**
498
+ * Load workspace ID from command options, environment variables, or platform config.
499
+ * Priority: opts/workspaceId > env/workspaceId > opts/profile > env/profile > error
500
+ * @param {{ workspaceId?: string; profile?: string }} [opts] - Workspace and profile options
501
+ * @param {string} [opts.workspaceId] - Workspace ID
502
+ * @param {string} [opts.profile] - Workspace profile name
503
+ * @returns {string} Resolved workspace ID
504
+ */
402
505
  declare function loadWorkspaceId(opts?: {
403
506
  workspaceId?: string;
404
507
  profile?: string;
405
508
  }): string;
509
+ /**
510
+ * Load access token from command options, environment variables, or platform config.
511
+ * Priority: env/TAILOR_PLATFORM_TOKEN > env/TAILOR_TOKEN (deprecated) > opts/profile > env/profile > config/currentUser > error
512
+ * @param {{ useProfile?: boolean; profile?: string }} [opts] - Profile options
513
+ * @param {boolean} [opts.useProfile] - Whether to use profile resolution
514
+ * @param {string} [opts.profile] - Profile name
515
+ * @returns {Promise<string>} Resolved access token
516
+ */
406
517
  declare function loadAccessToken(opts?: {
407
518
  useProfile?: boolean;
408
519
  profile?: string;
@@ -421,6 +532,8 @@ interface ApiCallResult {
421
532
  /**
422
533
  * Call Tailor Platform API endpoints directly.
423
534
  * If the endpoint doesn't contain "/", it defaults to `tailor.v1.OperatorService/{endpoint}`.
535
+ * @param {ApiCallOptions} options - API call options (profile, endpoint, body)
536
+ * @returns {Promise<ApiCallResult>} Response status and data
424
537
  */
425
538
  declare function apiCall(options: ApiCallOptions): Promise<ApiCallResult>;
426
539
  //#endregion
package/dist/cli/lib.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import "../chunk-CIV_ash9.mjs";
2
- import "../config-CnvbSTIP.mjs";
3
- import { A as generate, B as loadWorkspaceId, C as listOAuth2Clients, E as getMachineUserToken, F as loadConfig, I as apiCall, M as apply, P as generateUserTypes, T as getOAuth2Client, _ as listWorkflowExecutions, b as remove, c as resumeWorkflow, f as listWorkflows, g as getWorkflowExecution, i as deleteWorkspace, k as listMachineUsers, m as getWorkflow, n as listWorkspaces, o as createWorkspace, u as startWorkflow, v as show, z as loadAccessToken } from "../list-CinLZzZW.mjs";
2
+ import "../config-BmQRlW1j.mjs";
3
+ import { A as generate, B as loadWorkspaceId, C as listOAuth2Clients, E as getMachineUserToken, F as loadConfig, I as apiCall, M as apply, P as generateUserTypes, T as getOAuth2Client, _ as listWorkflowExecutions, b as remove, c as resumeWorkflow, f as listWorkflows, g as getWorkflowExecution, i as deleteWorkspace, k as listMachineUsers, m as getWorkflow, n as listWorkspaces, o as createWorkspace, u as startWorkflow, v as show, z as loadAccessToken } from "../list-BCSBAjwc.mjs";
4
4
  import { register } from "node:module";
5
5
 
6
6
  //#region src/cli/lib.ts
@@ -1,6 +1,9 @@
1
- import { clone } from "es-toolkit";
2
-
3
1
  //#region src/configure/types/field.ts
2
+ /**
3
+ * Normalize allowed values into EnumValue objects with descriptions.
4
+ * @param {AllowedValues} values - Allowed values as strings or EnumValue objects
5
+ * @returns {AllowedValue[]} Normalized allowed values
6
+ */
4
7
  function mapAllowedValues(values) {
5
8
  return values.map((value) => {
6
9
  if (typeof value === "string") return {
@@ -57,6 +60,11 @@ var TailorField = class TailorField {
57
60
  /**
58
61
  * Parse and validate a value against this field's validation rules
59
62
  * Returns StandardSchema Result type with success or failure
63
+ * @param {{ value: unknown; data: unknown; user: TailorUser }} args - Value, context data, and user
64
+ * @param {unknown} args.value - Value to validate
65
+ * @param {unknown} args.data - Context data
66
+ * @param {TailorUser} args.user - Tailor user information
67
+ * @returns {StandardSchemaV1.Result<Output>} Validation result
60
68
  */
61
69
  parse(args) {
62
70
  return this._parseInternal({
@@ -70,6 +78,12 @@ var TailorField = class TailorField {
70
78
  * Validate a single value (not an array element)
71
79
  * Used internally for array element validation
72
80
  * @private
81
+ * @param {{ value: TailorToTs[T]; data: unknown; user: TailorUser; pathArray: string[] }} args - Validation arguments
82
+ * @param {TailorToTs[T]} args.value - Value to validate
83
+ * @param {unknown} args.data - Context data
84
+ * @param {TailorUser} args.user - Tailor user information
85
+ * @param {string[]} args.pathArray - Field path array for nested validation
86
+ * @returns {StandardSchemaV1.Issue[]} Validation issues
73
87
  */
74
88
  _validateValue(args) {
75
89
  const { value, data, user, pathArray } = args;
@@ -172,6 +186,12 @@ var TailorField = class TailorField {
172
186
  /**
173
187
  * Internal parse method that tracks field path for nested validation
174
188
  * @private
189
+ * @param {{ value: unknown; data: unknown; user: TailorUser; pathArray: string[] }} args - Parse arguments
190
+ * @param {unknown} args.value - Value to parse
191
+ * @param {unknown} args.data - Context data
192
+ * @param {TailorUser} args.user - Tailor user information
193
+ * @param {string[]} args.pathArray - Field path array for nested validation
194
+ * @returns {StandardSchemaV1.Result<Output>} Validation result
175
195
  */
176
196
  _parseInternal(args) {
177
197
  const { value, data, user, pathArray } = args;
@@ -319,10 +339,12 @@ function isRelationSelfConfig(config) {
319
339
  return config.toward.type === "self";
320
340
  }
321
341
  var TailorDBField = class TailorDBField extends TailorField {
322
- _ref = void 0;
323
- _pendingSelfRelation = void 0;
324
- get reference() {
325
- return clone(this._ref);
342
+ _rawRelation = void 0;
343
+ get rawRelation() {
344
+ return this._rawRelation ? {
345
+ ...this._rawRelation,
346
+ toward: { ...this._rawRelation.toward }
347
+ } : void 0;
326
348
  }
327
349
  get metadata() {
328
350
  return { ...this._metadata };
@@ -337,32 +359,16 @@ var TailorDBField = class TailorDBField extends TailorField {
337
359
  return super.description(description);
338
360
  }
339
361
  relation(config) {
340
- if (!this._metadata.array) {
341
- this._metadata.index = true;
342
- this._metadata.unique = ["oneToOne", "1-1"].includes(config.type);
343
- }
344
- this._metadata.foreignKey = true;
345
- const key = config.toward.key ?? "id";
346
- const backward = config.backward ?? "";
347
- if (isRelationSelfConfig(config)) {
348
- this._pendingSelfRelation = {
349
- type: config.type,
362
+ const targetType = isRelationSelfConfig(config) ? "self" : config.toward.type.name;
363
+ this._rawRelation = {
364
+ type: config.type,
365
+ toward: {
366
+ type: targetType,
350
367
  as: config.toward.as,
351
- key,
352
- backward
353
- };
354
- return this;
355
- }
356
- this._metadata.foreignKeyType = config.toward.type.name;
357
- this._metadata.foreignKeyField = key;
358
- if (config.type === "keyOnly") return this;
359
- const forward = config.toward.as;
360
- this._ref = {
361
- type: config.toward.type,
362
- nameMap: [forward, backward],
363
- key
368
+ key: config.toward.key
369
+ },
370
+ backward: config.backward
364
371
  };
365
- this._metadata.relation = true;
366
372
  return this;
367
373
  }
368
374
  index() {
@@ -408,8 +414,10 @@ var TailorDBField = class TailorDBField extends TailorField {
408
414
  if (options.optional !== void 0) clonedField._metadata.required = !options.optional;
409
415
  if (options.array !== void 0) clonedField._metadata.array = options.array;
410
416
  }
411
- if (this._ref) clonedField._ref = clone(this._ref);
412
- if (this._pendingSelfRelation) clonedField._pendingSelfRelation = { ...this._pendingSelfRelation };
417
+ if (this._rawRelation) clonedField._rawRelation = {
418
+ ...this._rawRelation,
419
+ toward: { ...this._rawRelation.toward }
420
+ };
413
421
  return clonedField;
414
422
  }
415
423
  };
@@ -459,21 +467,6 @@ var TailorDBType = class {
459
467
  if (name === options.pluralForm) throw new Error(`The name and the plural form must be different. name=${name}`);
460
468
  this._settings.pluralForm = options.pluralForm;
461
469
  }
462
- Object.entries(this.fields).forEach(([fieldName, field]) => {
463
- const f = field;
464
- const pending = f._pendingSelfRelation;
465
- if (pending) {
466
- f._metadata.foreignKeyType = this.name;
467
- f._metadata.foreignKeyField = pending.key;
468
- if (pending.type === "keyOnly") return this;
469
- const forward = pending.as ?? fieldName.replace(/(ID|Id|id)$/u, "");
470
- f._ref = {
471
- type: this,
472
- nameMap: [forward, pending.backward],
473
- key: pending.key
474
- };
475
- }
476
- });
477
470
  }
478
471
  get metadata() {
479
472
  const indexes = {};
@@ -605,6 +598,18 @@ const db = {
605
598
 
606
599
  //#endregion
607
600
  //#region src/configure/services/auth/index.ts
601
+ /**
602
+ * Define an auth service for the Tailor SDK.
603
+ * @template Name
604
+ * @template User
605
+ * @template AttributeMap
606
+ * @template AttributeList
607
+ * @template MachineUserNames
608
+ * @template M
609
+ * @param {Name} name - Auth service name
610
+ * @param {AuthServiceInput<User, AttributeMap, AttributeList, MachineUserNames>} config - Auth service configuration
611
+ * @returns {AuthDefinitionBrand & AuthServiceInput<User, AttributeMap, AttributeList, MachineUserNames> & { name: string; invoker<M extends MachineUserNames>(machineUser: M): AuthInvoker<M> }} Defined auth service
612
+ */
608
613
  function defineAuth(name, config) {
609
614
  return {
610
615
  ...config,
@@ -647,13 +652,24 @@ const getDistDir = () => {
647
652
  else if (distPath === null) distPath = configured || ".tailor-sdk";
648
653
  return distPath;
649
654
  };
655
+ /**
656
+ * Define a Tailor SDK application configuration with shallow exactness.
657
+ * @template Config
658
+ * @param {Config} config - Application configuration
659
+ * @returns {Config} The same configuration object
660
+ */
650
661
  function defineConfig(config) {
651
662
  return config;
652
663
  }
664
+ /**
665
+ * Define generators to be used with the Tailor SDK.
666
+ * @param {...GeneratorConfig} configs - Generator configurations
667
+ * @returns {GeneratorConfig[]} Generator configurations as given
668
+ */
653
669
  function defineGenerators(...configs) {
654
670
  return configs;
655
671
  }
656
672
 
657
673
  //#endregion
658
674
  export { createWorkflowJob as a, unsafeAllowAllGqlPermission as c, TailorField as d, t as f, WORKFLOW_JOB_BRAND as i, unsafeAllowAllTypePermission as l, defineGenerators as n, defineAuth as o, getDistDir as r, db as s, defineConfig as t, unauthenticatedTailorUser as u };
659
- //# sourceMappingURL=config-CnvbSTIP.mjs.map
675
+ //# sourceMappingURL=config-BmQRlW1j.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-BmQRlW1j.mjs","names":["type: T","fields: Record<string, TailorAnyField>","issues: StandardSchemaV1.Issue[]","createField","uuid","string","bool","int","float","date","datetime","time","_enum","object","unauthenticatedTailorUser: TailorUser","unsafeAllowAllTypePermission: TailorTypePermission","unsafeAllowAllGqlPermission: TailorTypeGqlPermission","name: string","fields: Fields","indexes: Record<string, { fields: string[]; unique?: boolean }>","validators","description: string | undefined","fieldDef: F","distPath: string | null"],"sources":["../src/configure/types/field.ts","../src/configure/types/type.ts","../src/configure/types/user.ts","../src/configure/services/tailordb/permission.ts","../src/configure/services/tailordb/schema.ts","../src/configure/services/auth/index.ts","../src/configure/services/workflow/job.ts","../src/configure/config.ts"],"sourcesContent":["import { type EnumValue } from \"@/parser/service/tailordb/types\";\n\nexport type AllowedValue = EnumValue;\n\nexport type AllowedValues = [string | EnumValue, ...(string | EnumValue)[]];\n\n/**\n * Normalize allowed values into EnumValue objects with descriptions.\n * @param {AllowedValues} values - Allowed values as strings or EnumValue objects\n * @returns {AllowedValue[]} Normalized allowed values\n */\nexport function mapAllowedValues(values: AllowedValues): AllowedValue[] {\n return values.map((value) => {\n if (typeof value === \"string\") {\n return { value, description: \"\" };\n }\n return { ...value, description: value.description ?? \"\" };\n });\n}\n\nexport type AllowedValuesOutput<V extends AllowedValues> = V[number] extends infer T\n ? T extends string\n ? T\n : T extends { value: infer K }\n ? K\n : never\n : never;\n","import { type AllowedValues, type AllowedValuesOutput, mapAllowedValues } from \"./field\";\nimport {\n type TailorFieldType,\n type TailorToTs,\n type FieldMetadata,\n type DefinedFieldMetadata,\n type FieldOptions,\n type FieldOutput,\n} from \"./types\";\nimport type { Prettify, InferFieldsOutput } from \"./helpers\";\nimport type { FieldValidateInput } from \"./validation\";\nimport type { TailorUser } from \"@/configure/types\";\nimport type { TailorFieldInput } from \"@/parser/service/resolver/types\";\nimport type { StandardSchemaV1 } from \"@standard-schema/spec\";\n\nconst regex = {\n uuid: /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,\n date: /^(?<year>\\d{4})-(?<month>\\d{2})-(?<day>\\d{2})$/,\n time: /^(?<hour>\\d{2}):(?<minute>\\d{2})$/,\n datetime:\n /^(?<year>\\d{4})-(?<month>\\d{2})-(?<day>\\d{2})T(?<hour>\\d{2}):(?<minute>\\d{2}):(?<second>\\d{2})(.(?<millisec>\\d{3}))?Z$/,\n} as const;\n\n// This helper type intentionally uses `any` as a placeholder for unknown field output.\n// oxlint-disable-next-line no-explicit-any\nexport type TailorAnyField = TailorField<any>;\n\nexport class TailorField<\n const Defined extends DefinedFieldMetadata = DefinedFieldMetadata,\n // Generic default output type (kept loose on purpose for library ergonomics).\n // oxlint-disable-next-line no-explicit-any\n const Output = any,\n M extends FieldMetadata = FieldMetadata,\n T extends TailorFieldType = TailorFieldType,\n> implements TailorFieldInput {\n protected _metadata: M;\n public readonly _defined: Defined = undefined as unknown as Defined;\n public readonly _output = undefined as Output;\n\n get metadata() {\n return { ...this._metadata };\n }\n\n protected constructor(\n public readonly type: T,\n options?: FieldOptions,\n public readonly fields: Record<string, TailorAnyField> = {},\n values?: AllowedValues,\n ) {\n this._metadata = { required: true } as M;\n if (options) {\n if (options.optional === true) {\n this._metadata.required = false;\n }\n if (options.array === true) {\n this._metadata.array = true;\n }\n }\n if (values) {\n this._metadata.allowedValues = mapAllowedValues(values);\n }\n }\n\n static create<\n const TType extends TailorFieldType,\n const TOptions extends FieldOptions,\n const OutputBase = TailorToTs[TType],\n >(\n type: TType,\n options?: TOptions,\n fields?: Record<string, TailorAnyField>,\n values?: AllowedValues,\n ) {\n return new TailorField<\n { type: TType; array: TOptions extends { array: true } ? true : false },\n FieldOutput<OutputBase, TOptions>\n >(type, options, fields, values);\n }\n\n description<CurrentDefined extends Defined>(\n this: CurrentDefined extends { description: unknown }\n ? never\n : TailorField<CurrentDefined, Output>,\n description: string,\n ) {\n this._metadata.description = description;\n return this as TailorField<Prettify<CurrentDefined & { description: true }>, Output>;\n }\n\n typeName<CurrentDefined extends Defined>(\n this: CurrentDefined extends { typeName: unknown }\n ? never\n : CurrentDefined extends { type: \"enum\" | \"nested\" }\n ? TailorField<CurrentDefined, Output>\n : never,\n typeName: string,\n ) {\n this._metadata.typeName = typeName;\n return this as TailorField<Prettify<CurrentDefined & { typeName: true }>, Output>;\n }\n\n validate<CurrentDefined extends Defined>(\n this: CurrentDefined extends { validate: unknown }\n ? never\n : TailorField<CurrentDefined, Output>,\n ...validate: FieldValidateInput<Output>[]\n ) {\n this._metadata.validate = validate;\n return this as TailorField<Prettify<CurrentDefined & { validate: true }>, Output>;\n }\n\n /**\n * Parse and validate a value against this field's validation rules\n * Returns StandardSchema Result type with success or failure\n * @param {{ value: unknown; data: unknown; user: TailorUser }} args - Value, context data, and user\n * @param {unknown} args.value - Value to validate\n * @param {unknown} args.data - Context data\n * @param {TailorUser} args.user - Tailor user information\n * @returns {StandardSchemaV1.Result<Output>} Validation result\n */\n parse(args: {\n value: unknown;\n data: unknown;\n user: TailorUser;\n }): StandardSchemaV1.Result<Output> {\n return this._parseInternal({\n value: args.value,\n data: args.data,\n user: args.user,\n pathArray: [],\n });\n }\n\n /**\n * Validate a single value (not an array element)\n * Used internally for array element validation\n * @private\n * @param {{ value: TailorToTs[T]; data: unknown; user: TailorUser; pathArray: string[] }} args - Validation arguments\n * @param {TailorToTs[T]} args.value - Value to validate\n * @param {unknown} args.data - Context data\n * @param {TailorUser} args.user - Tailor user information\n * @param {string[]} args.pathArray - Field path array for nested validation\n * @returns {StandardSchemaV1.Issue[]} Validation issues\n */\n private _validateValue(args: {\n value: TailorToTs[T];\n data: unknown;\n user: TailorUser;\n pathArray: string[];\n }): StandardSchemaV1.Issue[] {\n const { value, data, user, pathArray } = args;\n const issues: StandardSchemaV1.Issue[] = [];\n\n // Type-specific validation\n switch (this.type) {\n case \"string\":\n if (typeof value !== \"string\") {\n issues.push({\n message: `Expected a string: received ${String(value)}`,\n path: pathArray.length > 0 ? pathArray : undefined,\n });\n }\n break;\n\n case \"integer\":\n if (typeof value !== \"number\" || !Number.isInteger(value)) {\n issues.push({\n message: `Expected an integer: received ${String(value)}`,\n path: pathArray.length > 0 ? pathArray : undefined,\n });\n }\n break;\n\n case \"float\":\n if (typeof value !== \"number\" || !Number.isFinite(value)) {\n issues.push({\n message: `Expected a number: received ${String(value)}`,\n path: pathArray.length > 0 ? pathArray : undefined,\n });\n }\n break;\n\n case \"boolean\":\n if (typeof value !== \"boolean\") {\n issues.push({\n message: `Expected a boolean: received ${String(value)}`,\n path: pathArray.length > 0 ? pathArray : undefined,\n });\n }\n break;\n\n case \"uuid\":\n if (typeof value !== \"string\" || !regex.uuid.test(value)) {\n issues.push({\n message: `Expected a valid UUID: received ${String(value)}`,\n path: pathArray.length > 0 ? pathArray : undefined,\n });\n }\n break;\n case \"date\":\n if (typeof value !== \"string\" || !regex.date.test(value)) {\n issues.push({\n message: `Expected to match \"yyyy-MM-dd\" format: received ${String(value)}`,\n path: pathArray.length > 0 ? pathArray : undefined,\n });\n }\n break;\n case \"datetime\":\n if (typeof value !== \"string\" || !regex.datetime.test(value)) {\n issues.push({\n message: `Expected to match ISO format: received ${String(value)}`,\n path: pathArray.length > 0 ? pathArray : undefined,\n });\n }\n break;\n case \"time\":\n if (typeof value !== \"string\" || !regex.time.test(value)) {\n issues.push({\n message: `Expected to match \"HH:mm\" format: received ${String(value)}`,\n path: pathArray.length > 0 ? pathArray : undefined,\n });\n }\n break;\n case \"enum\":\n if (this.metadata.allowedValues) {\n const allowedValues = this.metadata.allowedValues.map((v) => v.value);\n if (typeof value !== \"string\" || !allowedValues.includes(value)) {\n issues.push({\n message: `Must be one of [${allowedValues.join(\", \")}]: received ${String(value)}`,\n path: pathArray.length > 0 ? pathArray : undefined,\n });\n }\n }\n break;\n\n case \"nested\":\n // Validate nested object fields\n if (\n typeof value !== \"object\" ||\n value === null ||\n Array.isArray(value) ||\n value instanceof Date\n ) {\n issues.push({\n message: `Expected an object: received ${String(value)}`,\n path: pathArray.length > 0 ? pathArray : undefined,\n });\n } else if (this.fields && Object.keys(this.fields).length > 0) {\n for (const [fieldName, field] of Object.entries(this.fields)) {\n const fieldValue = value?.[fieldName];\n const result = field._parseInternal({\n value: fieldValue,\n data,\n user,\n pathArray: pathArray.concat(fieldName),\n });\n if (result.issues) {\n issues.push(...result.issues);\n }\n }\n }\n break;\n }\n\n // Custom validation functions\n const validateFns = this.metadata.validate;\n if (validateFns && validateFns.length > 0) {\n for (const validateInput of validateFns) {\n const { fn, message } =\n typeof validateInput === \"function\"\n ? { fn: validateInput, message: \"Validation failed\" }\n : { fn: validateInput[0], message: validateInput[1] };\n\n if (!fn({ value, data, user })) {\n issues.push({\n message,\n path: pathArray.length > 0 ? pathArray : undefined,\n });\n }\n }\n }\n\n return issues;\n }\n\n /**\n * Internal parse method that tracks field path for nested validation\n * @private\n * @param {{ value: unknown; data: unknown; user: TailorUser; pathArray: string[] }} args - Parse arguments\n * @param {unknown} args.value - Value to parse\n * @param {unknown} args.data - Context data\n * @param {TailorUser} args.user - Tailor user information\n * @param {string[]} args.pathArray - Field path array for nested validation\n * @returns {StandardSchemaV1.Result<Output>} Validation result\n */\n private _parseInternal(args: {\n // Runtime input is unknown/untyped; we validate and narrow it inside the parser.\n // oxlint-disable-next-line no-explicit-any\n value: any;\n data: unknown;\n user: TailorUser;\n pathArray: string[];\n }): StandardSchemaV1.Result<Output> {\n const { value, data, user, pathArray } = args;\n const issues: StandardSchemaV1.Issue[] = [];\n\n // 1. Check required/optional\n const isNullOrUndefined = value === null || value === undefined;\n if (this.metadata.required && isNullOrUndefined) {\n issues.push({\n message: \"Required field is missing\",\n path: pathArray.length > 0 ? pathArray : undefined,\n });\n return { issues };\n }\n\n // If optional and null/undefined, skip further validation\n if (!this.metadata.required && isNullOrUndefined) {\n return { value };\n }\n\n // 2. Check array type\n if (this.metadata.array) {\n if (!Array.isArray(value)) {\n issues.push({\n message: \"Expected an array\",\n path: pathArray.length > 0 ? pathArray : undefined,\n });\n return { issues };\n }\n\n // Validate each array element (without array flag)\n for (let i = 0; i < value.length; i++) {\n const elementValue = value[i];\n const elementPath = pathArray.concat(`[${i}]`);\n\n // Validate element with same type but without array flag\n const elementIssues = this._validateValue({\n value: elementValue,\n data,\n user,\n pathArray: elementPath,\n });\n if (elementIssues.length > 0) {\n issues.push(...elementIssues);\n }\n }\n\n if (issues.length > 0) {\n return { issues };\n }\n return { value: value as Output };\n }\n\n // 3. Type-specific validation and custom validation\n const valueIssues = this._validateValue({ value, data, user, pathArray });\n issues.push(...valueIssues);\n\n if (issues.length > 0) {\n return { issues };\n }\n\n return { value };\n }\n}\n\nconst createField = TailorField.create;\nfunction uuid<const Opt extends FieldOptions>(options?: Opt) {\n return createField(\"uuid\", options);\n}\n\nfunction string<const Opt extends FieldOptions>(options?: Opt) {\n return createField(\"string\", options);\n}\n\nfunction bool<const Opt extends FieldOptions>(options?: Opt) {\n return createField(\"boolean\", options);\n}\n\nfunction int<const Opt extends FieldOptions>(options?: Opt) {\n return createField(\"integer\", options);\n}\n\nfunction float<const Opt extends FieldOptions>(options?: Opt) {\n return createField(\"float\", options);\n}\n\nfunction date<const Opt extends FieldOptions>(options?: Opt) {\n return createField(\"date\", options);\n}\n\nfunction datetime<const Opt extends FieldOptions>(options?: Opt) {\n return createField(\"datetime\", options);\n}\n\nfunction time<const Opt extends FieldOptions>(options?: Opt) {\n return createField(\"time\", options);\n}\n\nfunction _enum<const V extends AllowedValues, const Opt extends FieldOptions>(\n values: V,\n options?: Opt,\n): TailorField<\n { type: \"enum\"; array: Opt extends { array: true } ? true : false },\n FieldOutput<AllowedValuesOutput<V>, Opt>\n> {\n return createField<\"enum\", Opt, AllowedValuesOutput<V>>(\"enum\", options, undefined, values);\n}\n\nfunction object<const F extends Record<string, TailorAnyField>, const Opt extends FieldOptions>(\n fields: F,\n options?: Opt,\n) {\n const objectField = createField(\"nested\", options, fields) as TailorField<\n { type: \"nested\"; array: Opt extends { array: true } ? true : false },\n FieldOutput<InferFieldsOutput<F>, Opt>\n >;\n return objectField;\n}\n\nexport const t = {\n uuid,\n string,\n bool,\n int,\n float,\n date,\n datetime,\n time,\n enum: _enum,\n object,\n};\n","// Interfaces for module augmentation\n// Users can extend these via: declare module \"@tailor-platform/sdk\" { interface AttributeMap { ... } }\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface AttributeMap {}\nexport interface AttributeList {\n __tuple?: []; // Marker for tuple type\n}\n\nexport type InferredAttributeMap = keyof AttributeMap extends never\n ? Record<string, string | string[] | boolean | boolean[] | undefined>\n : AttributeMap;\n\nexport type InferredAttributeList = AttributeList[\"__tuple\"] extends []\n ? string[]\n : AttributeList[\"__tuple\"];\n\n/** Represents a user in the Tailor platform. */\nexport type TailorUser = {\n /**\n * The ID of the user.\n * For unauthenticated users, this will be a nil UUID.\n */\n id: string;\n /**\n * The type of the user.\n * For unauthenticated users, this will be an empty string.\n */\n type: \"user\" | \"machine_user\" | \"\";\n /** The ID of the workspace the user belongs to. */\n workspaceId: string;\n /**\n * A map of the user's attributes.\n * For unauthenticated users, this will be null.\n */\n attributes: InferredAttributeMap | null;\n /**\n * A list of the user's attributes.\n * For unauthenticated users, this will be an empty array.\n */\n attributeList: InferredAttributeList;\n};\n\n/** Represents an unauthenticated user in the Tailor platform. */\nexport const unauthenticatedTailorUser: TailorUser = {\n id: \"00000000-0000-0000-0000-000000000000\",\n type: \"\",\n workspaceId: \"00000000-0000-0000-0000-000000000000\",\n attributes: null,\n attributeList: [],\n};\n","import type { InferredAttributeMap } from \"../../types\";\n\nexport type TailorTypePermission<\n User extends object = InferredAttributeMap,\n Type extends object = object,\n> = {\n create: readonly ActionPermission<\"record\", User, Type, false>[];\n read: readonly ActionPermission<\"record\", User, Type, false>[];\n update: readonly ActionPermission<\"record\", User, Type, true>[];\n delete: readonly ActionPermission<\"record\", User, Type, false>[];\n};\n\ntype ActionPermission<\n Level extends \"record\" | \"gql\" = \"record\" | \"gql\",\n User extends object = InferredAttributeMap,\n Type extends object = object,\n Update extends boolean = boolean,\n> =\n | {\n conditions:\n | PermissionCondition<Level, User, Update, Type>\n | readonly PermissionCondition<Level, User, Update, Type>[];\n description?: string | undefined;\n permit?: boolean;\n }\n | readonly [...PermissionCondition<Level, User, Update, Type>, ...([] | [boolean])] // single array condition\n | readonly [...PermissionCondition<Level, User, Update, Type>[], ...([] | [boolean])]; // multiple array condition\n\nexport type TailorTypeGqlPermission<\n User extends object = InferredAttributeMap,\n Type extends object = object,\n> = readonly GqlPermissionPolicy<User, Type>[];\n\ntype GqlPermissionPolicy<\n User extends object = InferredAttributeMap,\n Type extends object = object,\n> = {\n conditions: readonly PermissionCondition<\"gql\", User, boolean, Type>[];\n actions: \"all\" | readonly GqlPermissionAction[];\n permit?: boolean;\n description?: string;\n};\n\ntype GqlPermissionAction = \"read\" | \"create\" | \"update\" | \"delete\" | \"aggregate\" | \"bulkUpsert\";\n\ntype EqualityOperator = \"=\" | \"!=\";\ntype ContainsOperator = \"in\" | \"not in\";\n\n// Helper types for User field extraction\ntype StringFieldKeys<User extends object> = {\n [K in keyof User]: User[K] extends string ? K : never;\n}[keyof User];\n\ntype StringArrayFieldKeys<User extends object> = {\n [K in keyof User]: User[K] extends string[] ? K : never;\n}[keyof User];\n\ntype BooleanFieldKeys<User extends object> = {\n [K in keyof User]: User[K] extends boolean ? K : never;\n}[keyof User];\n\ntype BooleanArrayFieldKeys<User extends object> = {\n [K in keyof User]: User[K] extends boolean[] ? K : never;\n}[keyof User];\n\ntype UserStringOperand<User extends object = InferredAttributeMap> = {\n user: StringFieldKeys<User> | \"id\";\n};\n\ntype UserStringArrayOperand<User extends object = InferredAttributeMap> = {\n user: StringArrayFieldKeys<User>;\n};\n\ntype UserBooleanOperand<User extends object = InferredAttributeMap> = {\n user: BooleanFieldKeys<User> | \"_loggedIn\";\n};\n\ntype UserBooleanArrayOperand<User extends object = InferredAttributeMap> = {\n user: BooleanArrayFieldKeys<User>;\n};\n\ntype RecordOperand<Type extends object, Update extends boolean = false> = Update extends true\n ? { oldRecord: (keyof Type & string) | \"id\" } | { newRecord: (keyof Type & string) | \"id\" }\n : { record: (keyof Type & string) | \"id\" };\n\ntype StringEqualityCondition<\n Level extends \"record\" | \"gql\",\n User extends object,\n Update extends boolean,\n Type extends object,\n> =\n | (Level extends \"gql\" ? readonly [string, EqualityOperator, boolean] : never)\n | readonly [string, EqualityOperator, string]\n | readonly [UserStringOperand<User>, EqualityOperator, string]\n | readonly [string, EqualityOperator, UserStringOperand<User>]\n | (Level extends \"record\"\n ?\n | readonly [\n RecordOperand<Type, Update>,\n EqualityOperator,\n string | UserStringOperand<User>,\n ]\n | readonly [\n string | UserStringOperand<User>,\n EqualityOperator,\n RecordOperand<Type, Update>,\n ]\n : never);\n\ntype BooleanEqualityCondition<\n Level extends \"record\" | \"gql\",\n User extends object,\n Update extends boolean,\n Type extends object,\n> =\n | readonly [boolean, EqualityOperator, boolean]\n | readonly [UserBooleanOperand<User>, EqualityOperator, boolean]\n | readonly [boolean, EqualityOperator, UserBooleanOperand<User>]\n | (Level extends \"record\"\n ?\n | readonly [\n RecordOperand<Type, Update>,\n EqualityOperator,\n boolean | UserBooleanOperand<User>,\n ]\n | readonly [\n boolean | UserBooleanOperand<User>,\n EqualityOperator,\n RecordOperand<Type, Update>,\n ]\n : never);\n\ntype EqualityCondition<\n Level extends \"record\" | \"gql\" = \"record\",\n User extends object = InferredAttributeMap,\n Update extends boolean = boolean,\n Type extends object = object,\n> =\n | StringEqualityCondition<Level, User, Update, Type>\n | BooleanEqualityCondition<Level, User, Update, Type>;\n\ntype StringContainsCondition<\n Level extends \"record\" | \"gql\",\n User extends object,\n Update extends boolean,\n Type extends object,\n> =\n | readonly [string, ContainsOperator, string[]]\n | readonly [UserStringOperand<User>, ContainsOperator, string[]]\n | readonly [string, ContainsOperator, UserStringArrayOperand<User>]\n | (Level extends \"record\"\n ?\n | readonly [\n RecordOperand<Type, Update>,\n ContainsOperator,\n string[] | UserStringArrayOperand<User>,\n ]\n | readonly [\n string | UserStringOperand<User>,\n ContainsOperator,\n RecordOperand<Type, Update>,\n ]\n : never);\n\ntype BooleanContainsCondition<\n Level extends \"record\" | \"gql\",\n User extends object,\n Update extends boolean,\n Type extends object,\n> =\n | (Level extends \"gql\" ? readonly [string, ContainsOperator, boolean[]] : never)\n | readonly [boolean, ContainsOperator, boolean[]]\n | readonly [UserBooleanOperand<User>, ContainsOperator, boolean[]]\n | readonly [boolean, ContainsOperator, UserBooleanArrayOperand<User>]\n | (Level extends \"record\"\n ?\n | readonly [\n RecordOperand<Type, Update>,\n ContainsOperator,\n boolean[] | UserBooleanArrayOperand<User>,\n ]\n | readonly [\n boolean | UserBooleanOperand<User>,\n ContainsOperator,\n RecordOperand<Type, Update>,\n ]\n : never);\n\ntype ContainsCondition<\n Level extends \"record\" | \"gql\" = \"record\",\n User extends object = InferredAttributeMap,\n Update extends boolean = boolean,\n Type extends object = object,\n> =\n | StringContainsCondition<Level, User, Update, Type>\n | BooleanContainsCondition<Level, User, Update, Type>;\n\n/**\n * Type representing a permission condition that combines user attributes, record fields, and literal values using comparison operators.\n *\n * The User type is extended by `user-defined.d.ts`, which is automatically generated when running `tailor-sdk generate`.\n * Attributes enabled in the config file's `auth.userProfile.attributes` become available as types.\n * @example\n * ```ts\n * // tailor.config.ts\n * export const auth = defineAuth(\"my-auth\", {\n * userProfile: {\n * type: user,\n * attributes: {\n * isAdmin: true,\n * roles: true,\n * }\n * }\n * });\n * ```\n */\nexport type PermissionCondition<\n Level extends \"record\" | \"gql\" = \"record\",\n User extends object = InferredAttributeMap,\n Update extends boolean = boolean,\n Type extends object = object,\n> = EqualityCondition<Level, User, Update, Type> | ContainsCondition<Level, User, Update, Type>;\n\n/**\n * Grants full record-level access without any conditions.\n *\n * Unsafe and intended only for local development, prototyping, or tests.\n * Do not use this in production environments, as it effectively disables\n * authorization checks.\n */\nexport const unsafeAllowAllTypePermission: TailorTypePermission = {\n create: [{ conditions: [], permit: true }],\n read: [{ conditions: [], permit: true }],\n update: [{ conditions: [], permit: true }],\n delete: [{ conditions: [], permit: true }],\n};\n\n/**\n * Grants full GraphQL access (all actions) without any conditions.\n *\n * Unsafe and intended only for local development, prototyping, or tests.\n * Do not use this in production environments, as it effectively disables\n * authorization checks.\n */\nexport const unsafeAllowAllGqlPermission: TailorTypeGqlPermission = [\n { conditions: [], actions: \"all\", permit: true },\n];\n","import { type AllowedValues, type AllowedValuesOutput } from \"@/configure/types/field\";\nimport { TailorField } from \"@/configure/types/type\";\nimport {\n type FieldOptions,\n type FieldOutput,\n type TailorFieldType,\n type TailorToTs,\n} from \"@/configure/types/types\";\nimport {\n type TailorDBTypeMetadata,\n type RawPermissions,\n type RawRelationConfig,\n type RelationType,\n} from \"@/parser/service/tailordb/types\";\nimport { type TailorTypeGqlPermission, type TailorTypePermission } from \"./permission\";\nimport {\n type DBFieldMetadata,\n type DefinedDBFieldMetadata,\n type Hooks,\n type Hook,\n type SerialConfig,\n type IndexDef,\n type TypeFeatures,\n type ExcludeNestedDBFields,\n} from \"./types\";\nimport type { InferredAttributeMap } from \"@/configure/types\";\nimport type { Prettify, output, InferFieldsOutput } from \"@/configure/types/helpers\";\nimport type { FieldValidateInput, ValidateConfig, Validators } from \"@/configure/types/validation\";\n\ninterface RelationConfig<S extends RelationType, T extends TailorDBType> {\n type: S;\n toward: {\n type: T;\n as?: string;\n key?: keyof T[\"fields\"] & string;\n };\n backward?: string;\n}\n\n// Special config variant for self-referencing relations\ntype RelationSelfConfig = {\n type: RelationType;\n toward: {\n type: \"self\";\n as?: string;\n key?: string;\n };\n backward?: string;\n};\n\nfunction isRelationSelfConfig(\n config: RelationConfig<RelationType, TailorDBType> | RelationSelfConfig,\n): config is RelationSelfConfig {\n return config.toward.type === \"self\";\n}\n\n// Helper alias: DB fields can be arbitrarily nested, so we intentionally keep this loose.\n// oxlint-disable-next-line no-explicit-any\nexport type TailorAnyDBField = TailorDBField<any, any>;\n\nexport class TailorDBField<\n const Defined extends DefinedDBFieldMetadata,\n const Output,\n> extends TailorField<Defined, Output, DBFieldMetadata> {\n private _rawRelation: RawRelationConfig | undefined = undefined;\n\n get rawRelation(): Readonly<RawRelationConfig> | undefined {\n return this._rawRelation\n ? { ...this._rawRelation, toward: { ...this._rawRelation.toward } }\n : undefined;\n }\n\n get metadata() {\n return { ...this._metadata };\n }\n\n private constructor(\n type: TailorFieldType,\n options?: FieldOptions,\n fields?: Record<string, TailorAnyDBField>,\n values?: AllowedValues,\n ) {\n super(type, options, fields, values);\n }\n\n static create<\n const T extends TailorFieldType,\n const TOptions extends FieldOptions,\n const OutputBase = TailorToTs[T],\n >(\n type: T,\n options?: TOptions,\n fields?: Record<string, TailorAnyDBField>,\n values?: AllowedValues,\n ) {\n return new TailorDBField<\n { type: T; array: TOptions extends { array: true } ? true : false },\n FieldOutput<OutputBase, TOptions>\n >(type, options, fields, values);\n }\n\n description<CurrentDefined extends Defined>(\n this: CurrentDefined extends { description: unknown }\n ? never\n : TailorField<CurrentDefined, Output>,\n description: string,\n ): TailorDBField<Prettify<CurrentDefined & { description: true }>, Output> {\n // Fluent API: TS can't express the refined return type through the base method.\n // oxlint-disable-next-line no-explicit-any\n return super.description(description) as any;\n }\n\n relation<S extends RelationType, T extends TailorAnyDBType, CurrentDefined extends Defined>(\n this: CurrentDefined extends { relation: unknown }\n ? never\n : TailorDBField<CurrentDefined, Output>,\n config: RelationConfig<S, T>,\n ): TailorDBField<\n S extends \"oneToOne\" | \"1-1\"\n ? Prettify<CurrentDefined & { unique: true; index: true; relation: true }>\n : Prettify<CurrentDefined & { index: true; relation: true }>,\n Output\n >;\n\n // Overload: self-referencing variant\n relation<S extends RelationSelfConfig, CurrentDefined extends Defined>(\n this: CurrentDefined extends { relation: unknown }\n ? never\n : TailorDBField<CurrentDefined, Output>,\n config: S,\n ): TailorDBField<\n S[\"type\"] extends \"oneToOne\" | \"1-1\"\n ? Prettify<CurrentDefined & { unique: true; index: true; relation: true }>\n : Prettify<CurrentDefined & { index: true; relation: true }>,\n Output\n >;\n\n // Implementation\n relation<CurrentDefined extends Defined>(\n this: CurrentDefined extends { relation: unknown }\n ? never\n : TailorDBField<CurrentDefined, Output>,\n config: RelationConfig<RelationType, TailorDBType> | RelationSelfConfig,\n ): TailorDBField<DefinedDBFieldMetadata, Output> {\n // Store raw relation config - all processing happens in parser layer\n const targetType = isRelationSelfConfig(config) ? \"self\" : config.toward.type.name;\n this._rawRelation = {\n type: config.type,\n toward: {\n type: targetType,\n as: config.toward.as,\n key: config.toward.key,\n },\n backward: config.backward,\n };\n return this;\n }\n\n index<CurrentDefined extends Defined>(\n this: CurrentDefined extends { index: unknown }\n ? never\n : CurrentDefined extends { array: true }\n ? never\n : TailorDBField<CurrentDefined, Output>,\n ) {\n this._metadata.index = true;\n return this as TailorDBField<Prettify<CurrentDefined & { index: true }>, Output>;\n }\n\n unique<CurrentDefined extends Defined>(\n this: CurrentDefined extends { unique: unknown }\n ? never\n : CurrentDefined extends { array: true }\n ? never\n : TailorDBField<CurrentDefined, Output>,\n ) {\n this._metadata.unique = true;\n this._metadata.index = true;\n return this as TailorDBField<Prettify<CurrentDefined & { unique: true; index: true }>, Output>;\n }\n\n vector<CurrentDefined extends Defined>(\n this: CurrentDefined extends { vector: unknown }\n ? never\n : CurrentDefined extends { type: \"string\"; array: false }\n ? TailorDBField<CurrentDefined, Output>\n : never,\n ) {\n this._metadata.vector = true;\n return this as TailorDBField<Prettify<CurrentDefined & { vector: true }>, Output>;\n }\n\n hooks<CurrentDefined extends Defined, const H extends Hook<unknown, Output>>(\n this: CurrentDefined extends { hooks: unknown }\n ? never\n : CurrentDefined extends { type: \"nested\" }\n ? never\n : TailorDBField<CurrentDefined, Output>,\n hooks: H,\n ) {\n this._metadata.hooks = hooks;\n return this as TailorDBField<\n Prettify<\n CurrentDefined & {\n hooks?: {\n create: H extends { create: unknown } ? true : false;\n update: H extends { update: unknown } ? true : false;\n };\n serial: false;\n }\n >,\n Output\n >;\n }\n\n validate<CurrentDefined extends Defined>(\n this: CurrentDefined extends { validate: unknown }\n ? never\n : TailorDBField<CurrentDefined, Output>,\n ...validate: FieldValidateInput<Output>[]\n ) {\n this._metadata.validate = validate;\n return this as TailorDBField<Prettify<CurrentDefined & { validate: true }>, Output>;\n }\n\n serial<CurrentDefined extends Defined>(\n this: CurrentDefined extends { serial: unknown }\n ? never\n : Output extends null\n ? never\n : CurrentDefined extends { type: \"integer\" | \"string\"; array: false }\n ? TailorDBField<CurrentDefined, Output>\n : never,\n config: SerialConfig<CurrentDefined[\"type\"] & (\"integer\" | \"string\")>,\n ) {\n (this as TailorDBField<CurrentDefined, Output>)._metadata.serial = config;\n return this as TailorDBField<\n Prettify<\n CurrentDefined & {\n serial: true;\n hooks: { create: false; update: false };\n }\n >,\n Output\n >;\n }\n\n /**\n * Clone the field with optional overrides for field options\n * @param {FieldOptions} [options] - Optional field options to override\n * @returns {TailorDBField<unknown, unknown>} A new TailorDBField instance with the same configuration\n */\n clone<const NewOpt extends FieldOptions>(\n options?: NewOpt,\n ): TailorDBField<\n Prettify<\n Omit<Defined, \"array\"> & {\n array: NewOpt extends { array: true } ? true : Defined[\"array\"];\n }\n >,\n FieldOutput<TailorToTs[Defined[\"type\"]], NewOpt>\n > {\n // Create a clone using Object.create to preserve prototype chain\n const clonedField = Object.create(Object.getPrototypeOf(this)) as TailorDBField<\n Defined,\n Output\n >;\n\n // Copy all properties\n Object.assign(clonedField, {\n type: this.type,\n fields: this.fields,\n _defined: this._defined,\n _output: this._output,\n });\n\n // Clone and merge metadata with new options\n clonedField._metadata = { ...this._metadata };\n if (options) {\n if (options.optional !== undefined) {\n clonedField._metadata.required = !options.optional;\n }\n if (options.array !== undefined) {\n clonedField._metadata.array = options.array;\n }\n }\n\n // Copy internal state\n if (this._rawRelation) {\n clonedField._rawRelation = {\n ...this._rawRelation,\n toward: { ...this._rawRelation.toward },\n };\n }\n\n return clonedField as TailorAnyDBField;\n }\n}\n\nconst createField = TailorDBField.create;\nfunction uuid<const Opt extends FieldOptions>(options?: Opt) {\n return createField(\"uuid\", options);\n}\n\nfunction string<const Opt extends FieldOptions>(options?: Opt) {\n return createField(\"string\", options);\n}\n\nfunction bool<const Opt extends FieldOptions>(options?: Opt) {\n return createField(\"boolean\", options);\n}\n\nfunction int<const Opt extends FieldOptions>(options?: Opt) {\n return createField(\"integer\", options);\n}\n\nfunction float<const Opt extends FieldOptions>(options?: Opt) {\n return createField(\"float\", options);\n}\n\nfunction date<const Opt extends FieldOptions>(options?: Opt) {\n return createField(\"date\", options);\n}\n\nfunction datetime<const Opt extends FieldOptions>(options?: Opt) {\n return createField(\"datetime\", options);\n}\n\nfunction time<const Opt extends FieldOptions>(options?: Opt) {\n return createField(\"time\", options);\n}\n\nfunction _enum<const V extends AllowedValues, const Opt extends FieldOptions>(\n values: V,\n options?: Opt,\n): TailorDBField<\n { type: \"enum\"; array: Opt extends { array: true } ? true : false },\n FieldOutput<AllowedValuesOutput<V>, Opt>\n> {\n return createField<\"enum\", Opt, AllowedValuesOutput<V>>(\"enum\", options, undefined, values);\n}\n\nfunction object<\n const F extends Record<string, TailorAnyDBField> & ExcludeNestedDBFields<F>,\n const Opt extends FieldOptions,\n>(fields: F, options?: Opt) {\n return createField(\"nested\", options, fields) as unknown as TailorDBField<\n { type: \"nested\"; array: Opt extends { array: true } ? true : false },\n FieldOutput<InferFieldsOutput<F>, Opt>\n >;\n}\n\n// Helper alias\n// oxlint-disable-next-line no-explicit-any\nexport type TailorAnyDBType = TailorDBType<any, any>;\n\nexport class TailorDBType<\n // Default kept loose to avoid forcing callers to supply generics.\n // oxlint-disable-next-line no-explicit-any\n const Fields extends Record<string, TailorAnyDBField> = any,\n User extends object = InferredAttributeMap,\n> {\n public readonly _output = null as unknown as InferFieldsOutput<Fields>;\n public _description?: string;\n private _settings: TypeFeatures = {};\n private _indexes: IndexDef<this>[] = [];\n private _permissions: RawPermissions = {};\n private _files: Record<string, string> = {};\n\n constructor(\n public readonly name: string,\n public readonly fields: Fields,\n options: { pluralForm?: string; description?: string },\n ) {\n this._description = options.description;\n\n if (options.pluralForm) {\n if (name === options.pluralForm) {\n throw new Error(`The name and the plural form must be different. name=${name}`);\n }\n this._settings.pluralForm = options.pluralForm;\n }\n }\n\n get metadata(): TailorDBTypeMetadata {\n // Convert indexes to the format expected by the manifest\n const indexes: Record<string, { fields: string[]; unique?: boolean }> = {};\n if (this._indexes && this._indexes.length > 0) {\n this._indexes.forEach((index) => {\n const fieldNames = index.fields.map((field) => String(field));\n const key = index.name || `idx_${fieldNames.join(\"_\")}`;\n indexes[key] = {\n fields: fieldNames,\n unique: index.unique,\n };\n });\n }\n\n return {\n name: this.name,\n description: this._description,\n settings: this._settings,\n permissions: this._permissions,\n files: this._files,\n ...(Object.keys(indexes).length > 0 && { indexes }),\n };\n }\n\n hooks(hooks: Hooks<Fields>) {\n // `Hooks<Fields>` is strongly typed, but `Object.entries()` loses that information.\n // oxlint-disable-next-line no-explicit-any\n Object.entries(hooks).forEach(([fieldName, fieldHooks]: [string, any]) => {\n this.fields[fieldName].hooks(fieldHooks);\n });\n return this;\n }\n\n validate(validators: Validators<Fields>) {\n Object.entries(validators).forEach(([fieldName, fieldValidators]) => {\n const field = this.fields[fieldName] as TailorAnyDBField;\n\n const validators = fieldValidators as\n | FieldValidateInput<unknown>\n | FieldValidateInput<unknown>[];\n\n const isValidateConfig = (v: unknown): v is ValidateConfig<unknown> => {\n return Array.isArray(v) && v.length === 2 && typeof v[1] === \"string\";\n };\n\n if (Array.isArray(validators)) {\n if (isValidateConfig(validators)) {\n field.validate(validators);\n } else {\n field.validate(...validators);\n }\n } else {\n field.validate(validators);\n }\n });\n return this;\n }\n\n features(features: Omit<TypeFeatures, \"pluralForm\">) {\n this._settings = { ...this._settings, ...features };\n return this;\n }\n\n indexes(...indexes: IndexDef<this>[]) {\n this._indexes = indexes;\n return this;\n }\n\n files<const F extends string>(\n files: Record<F, string> & Partial<Record<keyof output<this>, never>>,\n ) {\n this._files = files;\n return this;\n }\n\n permission<\n U extends object = User,\n P extends TailorTypePermission<U, output<this>> = TailorTypePermission<U, output<this>>,\n >(permission: P) {\n const ret = this as TailorDBType<Fields, U>;\n ret._permissions.record = permission;\n return ret;\n }\n\n gqlPermission<\n U extends object = User,\n P extends TailorTypeGqlPermission<U> = TailorTypeGqlPermission<U>,\n >(permission: P) {\n const ret = this as TailorDBType<Fields, U>;\n ret._permissions.gql = permission;\n return ret;\n }\n\n description(description: string) {\n this._description = description;\n return this;\n }\n\n /**\n * Pick specific fields from the type\n * @param {(keyof Fields)[]} keys - Array of field keys to pick\n * @param {FieldOptions} options - Optional field options to apply to picked fields\n * @returns {Record<string, TailorDBField<unknown, unknown>>} An object containing only the specified fields\n */\n pickFields<K extends keyof Fields, const Opt extends FieldOptions>(keys: K[], options: Opt) {\n const result = {} as Record<K, TailorAnyDBField>;\n for (const key of keys) {\n if (options) {\n result[key] = this.fields[key].clone(options);\n } else {\n result[key] = this.fields[key];\n }\n }\n return result as {\n [P in K]: Fields[P] extends TailorDBField<infer D, infer _O>\n ? TailorDBField<\n Omit<D, \"array\"> & {\n array: Opt extends { array: true } ? true : D[\"array\"];\n },\n FieldOutput<TailorToTs[D[\"type\"]], Opt>\n >\n : never;\n };\n }\n\n /**\n * Omit specific fields from the type\n * @template K\n * @param {(keyof Fields)[]} keys - Array of field keys to omit\n * @returns {Omit<Fields, K>} An object containing all fields except the specified ones\n */\n omitFields<K extends keyof Fields>(keys: K[]): Omit<Fields, K> {\n const keysSet = new Set(keys);\n const result = {} as Record<string, TailorAnyDBField>;\n for (const key in this.fields) {\n if (Object.hasOwn(this.fields, key) && !keysSet.has(key as unknown as K)) {\n result[key] = this.fields[key];\n }\n }\n return result as Omit<Fields, K>;\n }\n}\n\nexport type TailorDBInstance<\n // Default kept loose for convenience; callers still get fully inferred types from `db.type()`.\n // oxlint-disable-next-line no-explicit-any\n Fields extends Record<string, TailorAnyDBField> = any,\n User extends object = InferredAttributeMap,\n> = InstanceType<typeof TailorDBType<Fields, User>>;\n\nconst idField = uuid();\ntype idField = typeof idField;\ntype DBType<F extends { id?: never } & Record<string, TailorAnyDBField>> = TailorDBInstance<\n { id: idField } & F\n>;\n\n/**\n * Creates a new database type with the specified fields\n * @param {string | [string, string]} name - The name of the type, or a tuple of [name, pluralForm]\n * @param {Record<string, TailorDBField<unknown, unknown>>} fields - The field definitions for the type\n * @returns {DBType<F>} A new TailorDBType instance\n */\nfunction dbType<const F extends { id?: never } & Record<string, TailorAnyDBField>>(\n name: string | [string, string],\n fields: F,\n): DBType<F>;\n/**\n * Creates a new database type with the specified fields and description\n * @param {string | [string, string]} name - The name of the type, or a tuple of [name, pluralForm]\n * @param {string} description - A description of the type\n * @param {Record<string, TailorDBField<unknown, unknown>>} fields - The field definitions for the type\n * @returns {DBType<F>} A new TailorDBType instance\n */\nfunction dbType<const F extends { id?: never } & Record<string, TailorAnyDBField>>(\n name: string | [string, string],\n description: string,\n fields: F,\n): DBType<F>;\nfunction dbType<const F extends { id?: never } & Record<string, TailorAnyDBField>>(\n name: string | [string, string],\n fieldsOrDescription: string | F,\n fields?: F,\n): DBType<F> {\n const typeName = Array.isArray(name) ? name[0] : name;\n const pluralForm = Array.isArray(name) ? name[1] : undefined;\n\n let description: string | undefined;\n let fieldDef: F;\n if (typeof fieldsOrDescription === \"string\") {\n description = fieldsOrDescription;\n fieldDef = fields as F;\n } else {\n fieldDef = fieldsOrDescription;\n }\n return new TailorDBType<{ id: idField } & F>(\n typeName,\n {\n id: idField,\n ...fieldDef,\n },\n { pluralForm, description },\n ) as DBType<F>;\n}\n\nexport const db = {\n type: dbType,\n uuid,\n string,\n bool,\n int,\n float,\n date,\n datetime,\n time,\n enum: _enum,\n object,\n fields: {\n timestamps: () => ({\n createdAt: datetime()\n .hooks({ create: () => new Date() })\n .description(\"Record creation timestamp\"),\n updatedAt: datetime({ optional: true })\n .hooks({ update: () => new Date() })\n .description(\"Record last update timestamp\"),\n }),\n },\n};\n","import { type TailorDBInstance } from \"../tailordb/schema\";\nimport type {\n AuthInvoker as ParserAuthInvoker,\n AuthServiceInput,\n UserAttributeListKey,\n UserAttributeMap,\n} from \"@/parser/service/auth/types\";\n\ndeclare const authDefinitionBrand: unique symbol;\ntype AuthDefinitionBrand = { readonly [authDefinitionBrand]: true };\n\nexport type {\n OIDC,\n SAML,\n IDToken,\n BuiltinIdP,\n IdProviderConfig,\n OAuth2ClientGrantType,\n OAuth2ClientInput as OAuth2Client,\n SCIMAuthorization,\n SCIMAttributeType,\n SCIMAttribute,\n SCIMAttributeMapping,\n SCIMResource,\n SCIMConfig,\n TenantProviderConfig,\n ValueOperand,\n UsernameFieldKey,\n UserAttributeKey,\n UserAttributeListKey,\n UserAttributeMap,\n AuthServiceInput,\n} from \"@/parser/service/auth/types\";\n\n/**\n * Invoker type compatible with tailor.v1.AuthInvoker\n * - namespace: auth service name\n * - machineUserName: machine user name\n */\nexport type AuthInvoker<M extends string> = Omit<ParserAuthInvoker, \"machineUserName\"> & {\n machineUserName: M;\n};\n\n/**\n * Define an auth service for the Tailor SDK.\n * @template Name\n * @template User\n * @template AttributeMap\n * @template AttributeList\n * @template MachineUserNames\n * @template M\n * @param {Name} name - Auth service name\n * @param {AuthServiceInput<User, AttributeMap, AttributeList, MachineUserNames>} config - Auth service configuration\n * @returns {AuthDefinitionBrand & AuthServiceInput<User, AttributeMap, AttributeList, MachineUserNames> & { name: string; invoker<M extends MachineUserNames>(machineUser: M): AuthInvoker<M> }} Defined auth service\n */\nexport function defineAuth<\n const Name extends string,\n const User extends TailorDBInstance,\n const AttributeMap extends UserAttributeMap<User>,\n const AttributeList extends UserAttributeListKey<User>[],\n const MachineUserNames extends string,\n>(name: Name, config: AuthServiceInput<User, AttributeMap, AttributeList, MachineUserNames>) {\n const result = {\n ...config,\n name,\n invoker<M extends MachineUserNames>(machineUser: M) {\n return { namespace: name, machineUserName: machineUser } as const;\n },\n } as const satisfies AuthServiceInput<User, AttributeMap, AttributeList, MachineUserNames> & {\n name: string;\n invoker<M extends MachineUserNames>(machineUser: M): AuthInvoker<M>;\n };\n\n return result as typeof result & AuthDefinitionBrand;\n}\n\nexport type AuthExternalConfig = { name: string; external: true };\n\n// We intentionally use `any` placeholders here to avoid re-exporting a large generic surface.\n// oxlint-disable-next-line no-explicit-any\nexport type AuthOwnConfig = ReturnType<typeof defineAuth<string, any, any, any, string>>;\n\nexport type AuthConfig = AuthOwnConfig | AuthExternalConfig;\n","import type { TailorEnv } from \"@/configure/types/env\";\nimport type { JsonCompatible } from \"@/configure/types/helpers\";\nimport type { Jsonifiable, Jsonify, JsonPrimitive } from \"type-fest\";\n\n/**\n * Symbol used to brand WorkflowJob objects created by createWorkflowJob.\n * This enables reliable runtime detection of workflow jobs regardless of\n * how they were imported or assigned (variable reassignment, destructuring, etc.)\n */\nexport const WORKFLOW_JOB_BRAND = Symbol.for(\"tailor:workflow-job\");\n\n/**\n * Context object passed as the second argument to workflow job body functions.\n */\nexport type WorkflowJobContext = {\n env: TailorEnv;\n};\n\n/**\n * Allowed output types for workflow job body functions.\n * Includes Jsonifiable (JSON-serializable values including objects with toJSON like Date),\n * undefined, and void.\n */\nexport type WorkflowJobOutput = Jsonifiable | undefined | void;\n\n/**\n * Convert output type to what trigger returns after JSON serialization.\n * - Jsonifiable values are converted via Jsonify (Date -> string, etc.)\n * - undefined remains undefined\n * - void becomes void\n */\ntype JsonifyOutput<T> = T extends Jsonifiable ? Jsonify<T> : T;\n\n/**\n * Input type constraint for workflow jobs.\n * Accepts any type that is JSON-compatible (primitives, arrays, objects with JSON-compatible values).\n * Excludes objects with toJSON method (like Date) since they won't be serialized in input.\n */\nexport type WorkflowJobInput = undefined | JsonCompatible<unknown>;\n\n/**\n * WorkflowJob represents a job that can be triggered in a workflow.\n *\n * Type constraints:\n * - Input: Must be JSON-compatible (no Date/toJSON objects) or undefined. Interfaces are allowed.\n * - Output: Must be Jsonifiable, undefined, or void\n * - Trigger returns Jsonify<Output> (Date becomes string after JSON.stringify)\n */\nexport interface WorkflowJob<Name extends string = string, Input = undefined, Output = undefined> {\n readonly [WORKFLOW_JOB_BRAND]?: true;\n name: Name;\n /**\n * Trigger this job with the given input.\n * At runtime, this is a placeholder that calls the body function.\n * During bundling, calls to .trigger() are transformed to\n * tailor.workflow.triggerJobFunction(\"<job-name>\", args).\n *\n * Returns Jsonify<Output> because the value passes through JSON.stringify.\n */\n trigger: [Input] extends [undefined]\n ? () => Promise<JsonifyOutput<Awaited<Output>>>\n : (input: Input) => Promise<JsonifyOutput<Awaited<Output>>>;\n body: (input: Input, context: WorkflowJobContext) => Output | Promise<Output>;\n}\n\n/**\n * Check if a type contains any non-JSON-compatible values.\n * Returns `true` if the type is valid for input, `false` otherwise.\n */\ntype IsValidInput<T> = T extends undefined\n ? true\n : T extends JsonPrimitive\n ? true\n : T extends readonly (infer U)[]\n ? IsValidInput<U>\n : T extends object\n ? T extends { toJSON: () => unknown }\n ? false\n : { [K in keyof T]: IsValidInput<T[K]> }[keyof T] extends true\n ? true\n : false\n : false;\n\n/**\n * Check if a type is valid for output.\n * Returns `true` if the type is valid, `false` otherwise.\n */\ntype IsValidOutput<T> = T extends undefined | void\n ? true\n : T extends JsonPrimitive\n ? true\n : T extends readonly (infer U)[]\n ? IsValidOutput<U>\n : T extends object\n ? { [K in keyof T]: IsValidOutput<T[K]> }[keyof T] extends true\n ? true\n : false\n : false;\n\n/**\n * Body function type with conditional constraint.\n * If input contains invalid types (like Date), the body type becomes `never` to cause an error.\n */\ntype WorkflowJobBody<I, O> =\n IsValidInput<I> extends true\n ? IsValidOutput<O> extends true\n ? (input: I, context: WorkflowJobContext) => O | Promise<O>\n : never\n : never;\n\nexport const createWorkflowJob = <const Name extends string, I = undefined, O = undefined>(config: {\n readonly name: Name;\n readonly body: WorkflowJobBody<I, O>;\n}): WorkflowJob<Name, I, Awaited<O>> => {\n return {\n [WORKFLOW_JOB_BRAND]: true,\n name: config.name,\n // JSON.parse(JSON.stringify(...)) ensures the return value matches Jsonify<Output> type.\n // This converts Date objects to strings, matching actual runtime behavior.\n trigger: async (args?: unknown) => {\n const ret = await tailor.workflow.triggerJobFunction(config.name, args);\n return ret ? JSON.parse(JSON.stringify(ret)) : ret;\n },\n body: config.body,\n } as WorkflowJob<Name, I, Awaited<O>>;\n};\n","import type { AuthConfig } from \"@/configure/services/auth\";\nimport type { ExecutorServiceInput } from \"@/configure/services/executor/types\";\nimport type { IdPConfig } from \"@/configure/services/idp\";\nimport type { ResolverServiceInput } from \"@/configure/services/resolver/types\";\nimport type { StaticWebsiteConfig } from \"@/configure/services/staticwebsite\";\nimport type { TailorDBServiceInput } from \"@/configure/services/tailordb/types\";\nimport type { WorkflowServiceInput } from \"@/configure/services/workflow/types\";\nimport type { GeneratorConfig } from \"@/parser/generator-config/types\";\n\nexport interface AppConfig<\n Auth extends AuthConfig = AuthConfig,\n Idp extends IdPConfig[] = IdPConfig[],\n StaticWebsites extends StaticWebsiteConfig[] = StaticWebsiteConfig[],\n Env extends Record<string, string | number | boolean> = Record<string, string | number | boolean>,\n> {\n name: string;\n env?: Env;\n cors?: string[];\n allowedIpAddresses?: string[];\n disableIntrospection?: boolean;\n db?: TailorDBServiceInput;\n resolver?: ResolverServiceInput;\n idp?: Idp;\n auth?: Auth;\n executor?: ExecutorServiceInput;\n workflow?: WorkflowServiceInput;\n staticWebsites?: StaticWebsites;\n}\n\nlet distPath: string | null = null;\nexport const getDistDir = (): string => {\n const configured = process.env.TAILOR_SDK_OUTPUT_DIR;\n if (configured && configured !== distPath) {\n distPath = configured;\n } else if (distPath === null) {\n distPath = configured || \".tailor-sdk\";\n }\n return distPath;\n};\n\n/**\n * Define a Tailor SDK application configuration with shallow exactness.\n * @template Config\n * @param {Config} config - Application configuration\n * @returns {Config} The same configuration object\n */\nexport function defineConfig<\n const Config extends AppConfig &\n // type-fest's Exact works recursively and causes type errors, so we use a shallow version here.\n Record<Exclude<keyof Config, keyof AppConfig>, never>,\n>(config: Config) {\n return config;\n}\n\n/**\n * Define generators to be used with the Tailor SDK.\n * @param {...GeneratorConfig} configs - Generator configurations\n * @returns {GeneratorConfig[]} Generator configurations as given\n */\nexport function defineGenerators(...configs: GeneratorConfig[]) {\n return configs;\n}\n"],"mappings":";;;;;;AAWA,SAAgB,iBAAiB,QAAuC;AACtE,QAAO,OAAO,KAAK,UAAU;AAC3B,MAAI,OAAO,UAAU,SACnB,QAAO;GAAE;GAAO,aAAa;GAAI;AAEnC,SAAO;GAAE,GAAG;GAAO,aAAa,MAAM,eAAe;GAAI;GACzD;;;;;ACFJ,MAAM,QAAQ;CACZ,MAAM;CACN,MAAM;CACN,MAAM;CACN,UACE;CACH;AAMD,IAAa,cAAb,MAAa,YAOiB;CAC5B,AAAU;CACV,AAAgB,WAAoB;CACpC,AAAgB,UAAU;CAE1B,IAAI,WAAW;AACb,SAAO,EAAE,GAAG,KAAK,WAAW;;CAG9B,AAAU,YACR,AAAgBA,MAChB,SACA,AAAgBC,SAAyC,EAAE,EAC3D,QACA;EAJgB;EAEA;AAGhB,OAAK,YAAY,EAAE,UAAU,MAAM;AACnC,MAAI,SAAS;AACX,OAAI,QAAQ,aAAa,KACvB,MAAK,UAAU,WAAW;AAE5B,OAAI,QAAQ,UAAU,KACpB,MAAK,UAAU,QAAQ;;AAG3B,MAAI,OACF,MAAK,UAAU,gBAAgB,iBAAiB,OAAO;;CAI3D,OAAO,OAKL,MACA,SACA,QACA,QACA;AACA,SAAO,IAAI,YAGT,MAAM,SAAS,QAAQ,OAAO;;CAGlC,YAIE,aACA;AACA,OAAK,UAAU,cAAc;AAC7B,SAAO;;CAGT,SAME,UACA;AACA,OAAK,UAAU,WAAW;AAC1B,SAAO;;CAGT,SAIE,GAAG,UACH;AACA,OAAK,UAAU,WAAW;AAC1B,SAAO;;;;;;;;;;;CAYT,MAAM,MAI8B;AAClC,SAAO,KAAK,eAAe;GACzB,OAAO,KAAK;GACZ,MAAM,KAAK;GACX,MAAM,KAAK;GACX,WAAW,EAAE;GACd,CAAC;;;;;;;;;;;;;CAcJ,AAAQ,eAAe,MAKM;EAC3B,MAAM,EAA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AAE,CAAC,CACnC,YAAY,+BAA+B;EAC/C,GACF;CACF;;;;;;;;;;;;;;;;AC3iBD,SAAgB,WAMd,MAAY,QAA+E;AAY3F,QAXe;EACb,GAAG;EACH;EACA,QAAoC,aAAgB;AAClD,UAAO;IAAE,WAAW;IAAM,iBAAiB;IAAa;;EAE3D;;;;;;;;;;AC3DH,MAAa,qBAAqB,OAAO,IAAI,sBAAsB;AAqGnE,MAAa,qBAA8E,WAGnD;AACtC,QAAO;GACJ,qBAAqB;EACtB,MAAM,OAAO;EAGb,SAAS,OAAO,SAAmB;GACjC,MAAM,MAAM,MAAM,OAAO,SAAS,mBAAmB,OAAO,MAAM,KAAK;AACvE,UAAO,MAAM,KAAK,MAAM,KAAK,UAAU,IAAI,CAAC,GAAG;;EAEjD,MAAM,OAAO;EACd;;;;;AC/FH,IAAIC,WAA0B;AAC9B,MAAa,mBAA2B;CACtC,MAAM,aAAa,QAAQ,IAAI;AAC/B,KAAI,cAAc,eAAe,SAC/B,YAAW;UACF,aAAa,KACtB,YAAW,cAAc;AAE3B,QAAO;;;;;;;;AAST,SAAgB,aAId,QAAgB;AAChB,QAAO;;;;;;;AAQT,SAAgB,iBAAiB,GAAG,SAA4B;AAC9D,QAAO"}
@@ -1,4 +1,4 @@
1
1
  /// <reference path="./../user-defined.d.ts" />
2
- import { $ as SCIMAttributeMapping, A as db, B as AuthExternalConfig, C as ResolverServiceConfig, D as TailorDBField, E as ExecutorServiceInput, F as TailorTypeGqlPermission, G as BuiltinIdP, H as AuthOwnConfig, I as TailorTypePermission, J as OAuth2ClientGrantType, K as IDToken, L as unsafeAllowAllGqlPermission, O as TailorDBInstance, P as PermissionCondition, Q as SCIMAttribute, R as unsafeAllowAllTypePermission, S as ResolverExternalConfig, T as ExecutorServiceConfig, U as defineAuth, V as AuthInvoker, W as AuthServiceInput, X as OIDC, Y as OAuth2ClientInput, Z as SAML, _ as StaticWebsiteConfig, _t as TailorField, at as UserAttributeKey, b as IdPExternalConfig, ct as UsernameFieldKey, et as SCIMAttributeType, f as defineConfig, ft as AttributeList, g as WorkflowServiceInput, h as WorkflowServiceConfig, ht as unauthenticatedTailorUser, it as TenantProviderConfig, k as TailorDBType, lt as ValueOperand, mt as TailorUser, nt as SCIMConfig, ot as UserAttributeListKey, p as defineGenerators, pt as AttributeMap, q as IdProviderConfig, rt as SCIMResource, st as UserAttributeMap, tt as SCIMAuthorization, ut as Env, v as defineStaticWebSite, vt as QueryType, w as ResolverServiceInput, x as defineIdp, y as IdPConfig, yt as Resolver, z as AuthConfig } from "../types-C0n7Syhv.mjs";
3
- import { A as createWorkflow, C as FunctionOperation, D as WorkflowOperation, E as WebhookOperation, F as WorkflowJobOutput, I as createWorkflowJob, L as createResolver, M as WorkflowJob, N as WorkflowJobContext, O as Workflow, P as WorkflowJobInput, S as resolverExecutedTrigger, T as Operation, _ as ResolverExecutedArgs, a as Trigger, b as recordDeletedTrigger, c as IncomingWebhookTrigger, d as ScheduleTrigger, f as scheduleTrigger, g as RecordUpdatedArgs, h as RecordTrigger, i as createExecutor, j as WORKFLOW_JOB_BRAND, k as WorkflowConfig, l as incomingWebhookTrigger, m as RecordDeletedArgs, n as output, o as IncomingWebhookArgs, p as RecordCreatedArgs, r as t, s as IncomingWebhookRequest, t as infer, u as ScheduleArgs, v as ResolverExecutedTrigger, w as GqlOperation, x as recordUpdatedTrigger, y as recordCreatedTrigger } from "../index-aNF917Ib.mjs";
2
+ import { $ as TenantProviderConfig, A as AuthOwnConfig, B as BuiltinIdP, C as ResolverServiceConfig, D as AuthConfig, E as ExecutorServiceInput, F as db, G as OIDC, H as IdProviderConfig, J as SCIMAttributeMapping, K as SAML, M as TailorDBField, N as TailorDBInstance, O as AuthExternalConfig, P as TailorDBType, Q as SCIMResource, S as ResolverExternalConfig, T as ExecutorServiceConfig, U as OAuth2ClientGrantType, V as IDToken, W as OAuth2ClientInput, X as SCIMAuthorization, Y as SCIMAttributeType, Z as SCIMConfig, _ as StaticWebsiteConfig, _t as Resolver, at as PermissionCondition, b as IdPExternalConfig, ct as unsafeAllowAllGqlPermission, dt as AttributeMap, et as UserAttributeKey, f as defineConfig, ft as TailorUser, g as WorkflowServiceInput, gt as QueryType, h as WorkflowServiceConfig, ht as TailorField, it as ValueOperand, j as defineAuth, k as AuthInvoker, lt as unsafeAllowAllTypePermission, nt as UserAttributeMap, ot as TailorTypeGqlPermission, p as defineGenerators, pt as unauthenticatedTailorUser, q as SCIMAttribute, rt as UsernameFieldKey, st as TailorTypePermission, tt as UserAttributeListKey, ut as AttributeList, v as defineStaticWebSite, w as ResolverServiceInput, x as defineIdp, y as IdPConfig, z as AuthServiceInput } from "../types-BeinUo7W.mjs";
3
+ import { A as createWorkflow, C as FunctionOperation, D as WorkflowOperation, E as WebhookOperation, F as WorkflowJobOutput, I as createWorkflowJob, L as createResolver, M as WorkflowJob, N as WorkflowJobContext, O as Workflow, P as WorkflowJobInput, R as Env, S as resolverExecutedTrigger, T as Operation, _ as ResolverExecutedArgs, a as Trigger, b as recordDeletedTrigger, c as IncomingWebhookTrigger, d as ScheduleTrigger, f as scheduleTrigger, g as RecordUpdatedArgs, h as RecordTrigger, i as createExecutor, j as WORKFLOW_JOB_BRAND, k as WorkflowConfig, l as incomingWebhookTrigger, m as RecordDeletedArgs, n as output, o as IncomingWebhookArgs, p as RecordCreatedArgs, r as t, s as IncomingWebhookRequest, t as infer, u as ScheduleArgs, v as ResolverExecutedTrigger, w as GqlOperation, x as recordUpdatedTrigger, y as recordCreatedTrigger } from "../index-Dkyvjk4D.mjs";
4
4
  export { AttributeList, AttributeMap, AuthConfig, AuthExternalConfig, AuthInvoker, AuthOwnConfig, AuthServiceInput, BuiltinIdP, Env, ExecutorServiceConfig, ExecutorServiceInput, FunctionOperation, GqlOperation, IDToken, IdPConfig, IdPExternalConfig, IdProviderConfig, IncomingWebhookArgs, IncomingWebhookRequest, IncomingWebhookTrigger, OAuth2ClientInput as OAuth2Client, OAuth2ClientGrantType, OIDC, Operation, PermissionCondition, QueryType, RecordCreatedArgs, RecordDeletedArgs, RecordTrigger, RecordUpdatedArgs, Resolver, ResolverExecutedArgs, ResolverExecutedTrigger, ResolverExternalConfig, ResolverServiceConfig, ResolverServiceInput, SAML, SCIMAttribute, SCIMAttributeMapping, SCIMAttributeType, SCIMAuthorization, SCIMConfig, SCIMResource, ScheduleArgs, ScheduleTrigger, StaticWebsiteConfig, TailorDBField, TailorDBInstance, TailorDBType, TailorField, TailorTypeGqlPermission, TailorTypePermission, TailorUser, TenantProviderConfig, Trigger, UserAttributeKey, UserAttributeListKey, UserAttributeMap, UsernameFieldKey, ValueOperand, WORKFLOW_JOB_BRAND, WebhookOperation, Workflow, WorkflowConfig, WorkflowJob, WorkflowJobContext, WorkflowJobInput, WorkflowJobOutput, WorkflowOperation, WorkflowServiceConfig, WorkflowServiceInput, createExecutor, createResolver, createWorkflow, createWorkflowJob, db, defineAuth, defineConfig, defineGenerators, defineIdp, defineStaticWebSite, incomingWebhookTrigger, infer, output, recordCreatedTrigger, recordDeletedTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, t, unauthenticatedTailorUser, unsafeAllowAllGqlPermission, unsafeAllowAllTypePermission };