@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.
- package/CHANGELOG.md +42 -0
- package/dist/auth-CZPUwA1p.mjs +801 -0
- package/dist/auth-CZPUwA1p.mjs.map +1 -0
- package/dist/cli/index.mjs +37 -2
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +7 -8
- package/dist/cli/lib.mjs +3 -2
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/configure/index.d.mts +3 -3
- package/dist/configure/index.mjs +29 -5
- package/dist/configure/index.mjs.map +1 -1
- package/dist/{types-BWzDv7TK.d.mts → index-D40SiXpf.d.mts} +897 -865
- package/dist/{index-lDsl6VDv.d.mts → index-bRPODqag.d.mts} +45 -3
- package/dist/{jiti-31_Wx1yz.mjs → jiti-BUw4tcVQ.mjs} +1 -1
- package/dist/{jiti-31_Wx1yz.mjs.map → jiti-BUw4tcVQ.mjs.map} +1 -1
- package/dist/job-CX4l7Myn.mjs +28 -0
- package/dist/job-CX4l7Myn.mjs.map +1 -0
- package/dist/{list-CafRw3ao.mjs → list-Dr8070QZ.mjs} +1607 -1562
- package/dist/list-Dr8070QZ.mjs.map +1 -0
- package/dist/{src-Bhwd-tei.mjs → src-Bu0051gO.mjs} +1 -1
- package/dist/{src-Bhwd-tei.mjs.map → src-Bu0051gO.mjs.map} +1 -1
- package/dist/utils/test/index.d.mts +4 -3
- package/dist/utils/test/index.mjs +3 -1
- package/dist/utils/test/index.mjs.map +1 -1
- package/docs/cli/application.md +14 -0
- package/docs/cli/workspace.md +2 -0
- package/docs/services/auth.md +35 -1
- package/docs/testing.md +81 -0
- package/package.json +1 -1
- package/dist/config-CBpYlVa-.mjs +0 -664
- package/dist/config-CBpYlVa-.mjs.map +0 -1
- package/dist/list-CafRw3ao.mjs.map +0 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference path="./user-defined.d.ts" />
|
|
2
|
-
import {
|
|
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 {
|
|
434
|
-
//# sourceMappingURL=index-
|
|
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
|