@tailor-platform/sdk 1.4.1 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,8 @@
1
1
  /// <reference path="./user-defined.d.ts" />
2
- import { Ct as TailorFieldType, Et as output$1, I as AllowedValues, L as AllowedValuesOutput, P as TailorDBType, St as FieldOutput, Tt as JsonCompatible, a as IncomingWebhookTrigger$1, bt as FieldMetadata, c as ScheduleTriggerInput, ft as TailorUser, ht as TailorField, i as GqlOperation$1, k as AuthInvoker, l as WebhookOperation$1, mt as TailorAnyField, n as ExecutorInput, o as RecordTrigger$1, r as FunctionOperation$1, s as ResolverExecutedTrigger$1, u as WorkflowOperation$1, vt as ResolverInput, wt as InferFieldsOutput, xt as FieldOptions, yt as ArrayFieldOutput } from "./types-BWzDv7TK.mjs";
2
+ import { C as WorkflowOperation$1, Ct as output$1, O as AuthInvoker, S as WebhookOperation$1, St as JsonCompatible, Tt as AllowedValuesOutput, _ as GqlOperation$1, _t as TailorField, b as ResolverExecutedTrigger$1, bt as ResolverInput, ct as FieldMetadata, dt as TailorFieldType, et as TailorDBType, g as FunctionOperation$1, gt as TailorAnyField, h as ExecutorInput, lt as FieldOptions, mt as TailorUser, n as GeneratorConfig, r as AppConfig, st as ArrayFieldOutput, ut as FieldOutput, v as IncomingWebhookTrigger$1, wt as AllowedValues, x as ScheduleTriggerInput, xt as InferFieldsOutput, y as RecordTrigger$1 } from "./index-D40SiXpf.mjs";
3
+ import * as zod0 from "zod";
3
4
  import { JsonPrimitive, Jsonifiable, Jsonify } from "type-fest";
5
+ import * as zod_v4_core0 from "zod/v4/core";
4
6
  import { Client } from "@urql/core";
5
7
  import { StandardCRON } from "ts-cron-validator";
6
8
 
@@ -144,6 +146,11 @@ type IsValidOutput<T> = T extends undefined | void ? true : T extends JsonPrimit
144
146
  * If input contains invalid types (like Date), the body type becomes `never` to cause an error.
145
147
  */
146
148
  type WorkflowJobBody<I, O> = IsValidInput<I> extends true ? IsValidOutput<O> extends true ? (input: I, context: WorkflowJobContext) => O | Promise<O> : never : never;
149
+ /**
150
+ * Environment variable key for workflow testing.
151
+ * Contains JSON-serialized TailorEnv object.
152
+ */
153
+ declare const WORKFLOW_TEST_ENV_KEY = "TAILOR_TEST_WORKFLOW_ENV";
147
154
  declare const createWorkflowJob: <const Name extends string, I = undefined, O = undefined>(config: {
148
155
  readonly name: Name;
149
156
  readonly body: WorkflowJobBody<I, O>;
@@ -167,6 +174,7 @@ interface WorkflowDefinition<Job extends WorkflowJob<any, any, any>> {
167
174
  }
168
175
  /**
169
176
  * Create a workflow definition that can be triggered via the Tailor SDK.
177
+ * In production, bundler transforms .trigger() calls to tailor.workflow.triggerWorkflow().
170
178
  * @template Job
171
179
  * @param config - Workflow configuration
172
180
  * @returns Defined workflow
@@ -359,6 +367,40 @@ declare function createExecutor<Args, O extends Operation<Args> | {
359
367
  workflow: Workflow;
360
368
  }>(config: Executor<Args, O>): Executor<Args, O>;
361
369
  //#endregion
370
+ //#region src/configure/config.d.ts
371
+ /**
372
+ * Define a Tailor SDK application configuration with shallow exactness.
373
+ * @template Config
374
+ * @param config - Application configuration
375
+ * @returns The same configuration object
376
+ */
377
+ declare function defineConfig<const Config extends AppConfig & Record<Exclude<keyof Config, keyof AppConfig>, never>>(config: Config): Config;
378
+ /**
379
+ * Define generators to be used with the Tailor SDK.
380
+ * @param configs - Generator configurations
381
+ * @returns Generator configurations as given
382
+ */
383
+ declare function defineGenerators(...configs: GeneratorConfig[]): (["@tailor-platform/kysely-type", {
384
+ distPath: string;
385
+ }] | ["@tailor-platform/seed", {
386
+ distPath: string;
387
+ machineUserName?: string | undefined;
388
+ }] | ["@tailor-platform/enum-constants", {
389
+ distPath: string;
390
+ }] | ["@tailor-platform/file-utils", {
391
+ distPath: string;
392
+ }] | {
393
+ id: string;
394
+ description: string;
395
+ dependencies: ("tailordb" | "resolver" | "executor")[];
396
+ aggregate: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod0.ZodAny>;
397
+ processType?: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod_v4_core0.$ZodFunctionOut> | undefined;
398
+ processResolver?: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod_v4_core0.$ZodFunctionOut> | undefined;
399
+ processExecutor?: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod_v4_core0.$ZodFunctionOut> | undefined;
400
+ processTailorDBNamespace?: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod_v4_core0.$ZodFunctionOut> | undefined;
401
+ processResolverNamespace?: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod_v4_core0.$ZodFunctionOut> | undefined;
402
+ })[];
403
+ //#endregion
362
404
  //#region src/configure/index.d.ts
363
405
  type TailorOutput<T> = output$1<T>;
364
406
  type infer<T> = TailorOutput<T>;
@@ -430,5 +472,5 @@ declare namespace t {
430
472
  type infer<T> = TailorOutput<T>;
431
473
  }
432
474
  //#endregion
433
- export { createWorkflow as A, FunctionOperation as C, WorkflowOperation as D, WebhookOperation as E, WorkflowJobOutput as F, createWorkflowJob as I, createResolver as L, WorkflowJob as M, WorkflowJobContext as N, Workflow as O, WorkflowJobInput as P, Env as R, resolverExecutedTrigger as S, Operation as T, ResolverExecutedArgs as _, Trigger as a, recordDeletedTrigger as b, IncomingWebhookTrigger as c, ScheduleTrigger as d, scheduleTrigger as f, RecordUpdatedArgs as g, RecordTrigger as h, createExecutor as i, WORKFLOW_JOB_BRAND as j, WorkflowConfig as k, incomingWebhookTrigger as l, RecordDeletedArgs as m, output as n, IncomingWebhookArgs as o, RecordCreatedArgs as p, t as r, IncomingWebhookRequest as s, infer as t, ScheduleArgs as u, ResolverExecutedTrigger as v, GqlOperation as w, recordUpdatedTrigger as x, recordCreatedTrigger as y };
434
- //# sourceMappingURL=index-lDsl6VDv.d.mts.map
475
+ export { Workflow as A, createResolver as B, recordUpdatedTrigger as C, Operation as D, GqlOperation as E, WorkflowJob as F, WorkflowJobContext as I, WorkflowJobInput as L, createWorkflow as M, WORKFLOW_JOB_BRAND as N, WebhookOperation as O, WORKFLOW_TEST_ENV_KEY as P, WorkflowJobOutput as R, recordDeletedTrigger as S, FunctionOperation as T, Env as V, RecordTrigger as _, defineGenerators as a, ResolverExecutedTrigger as b, IncomingWebhookArgs as c, incomingWebhookTrigger as d, ScheduleArgs as f, RecordDeletedArgs as g, RecordCreatedArgs as h, defineConfig as i, WorkflowConfig as j, WorkflowOperation as k, IncomingWebhookRequest as l, scheduleTrigger as m, output as n, createExecutor as o, ScheduleTrigger as p, t as r, Trigger as s, infer as t, IncomingWebhookTrigger as u, RecordUpdatedArgs as v, resolverExecutedTrigger as w, recordCreatedTrigger as x, ResolverExecutedArgs as y, createWorkflowJob as z };
476
+ //# sourceMappingURL=index-bRPODqag.d.mts.map
@@ -4479,4 +4479,4 @@ var init_jiti = __esmMin((() => {
4479
4479
  //#endregion
4480
4480
  init_jiti();
4481
4481
  export { createJiti };
4482
- //# sourceMappingURL=jiti-31_Wx1yz.mjs.map
4482
+ //# sourceMappingURL=jiti-BUw4tcVQ.mjs.map