@tailor-platform/sdk 1.17.1 → 1.19.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 +37 -0
- package/dist/{application-BMDE8KqK.mjs → application-A6PZjujv.mjs} +192 -1673
- package/dist/application-A6PZjujv.mjs.map +1 -0
- package/dist/application-nPS5veK6.mjs +9 -0
- package/dist/brand-BZJCv6UY.mjs +28 -0
- package/dist/brand-BZJCv6UY.mjs.map +1 -0
- package/dist/cli/index.mjs +40 -20
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +16 -33
- package/dist/cli/lib.mjs +12 -5
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/configure/index.d.mts +4 -4
- package/dist/configure/index.mjs +10 -19
- package/dist/configure/index.mjs.map +1 -1
- package/dist/enum-constants-CGVvu3dd.mjs +115 -0
- package/dist/enum-constants-CGVvu3dd.mjs.map +1 -0
- package/dist/file-utils-GX_tGWl4.mjs +139 -0
- package/dist/file-utils-GX_tGWl4.mjs.map +1 -0
- package/dist/index-B6pvy1MK.d.mts +20 -0
- package/dist/index-B91ZpOcd.d.mts +18 -0
- package/dist/index-CPzbMghQ.d.mts +18 -0
- package/dist/{index-CVcYqZSf.d.mts → index-ClLZCbcm.d.mts} +18 -5
- package/dist/index-DDqKNFh4.d.mts +18 -0
- package/dist/interceptor-D8MeZOxX.mjs +33 -0
- package/dist/interceptor-D8MeZOxX.mjs.map +1 -0
- package/dist/{jiti-BrELlEYT.mjs → jiti-DfS9jItj.mjs} +2 -2
- package/dist/{jiti-BrELlEYT.mjs.map → jiti-DfS9jItj.mjs.map} +1 -1
- package/dist/{job-CULA2Pvf.mjs → job-2Q82qQ6N.mjs} +27 -5
- package/dist/job-2Q82qQ6N.mjs.map +1 -0
- package/dist/kysely-type-Cpq5TNGY.mjs +260 -0
- package/dist/kysely-type-Cpq5TNGY.mjs.map +1 -0
- package/dist/package-json-DUY2kB6z.mjs +17 -0
- package/dist/package-json-DUY2kB6z.mjs.map +1 -0
- package/dist/package-json-Dd1AnA5F.mjs +3 -0
- package/dist/plugin/builtin/enum-constants/index.d.mts +4 -0
- package/dist/plugin/builtin/enum-constants/index.mjs +3 -0
- package/dist/plugin/builtin/file-utils/index.d.mts +4 -0
- package/dist/plugin/builtin/file-utils/index.mjs +3 -0
- package/dist/plugin/builtin/kysely-type/index.d.mts +4 -0
- package/dist/plugin/builtin/kysely-type/index.mjs +3 -0
- package/dist/plugin/builtin/seed/index.d.mts +4 -0
- package/dist/plugin/builtin/seed/index.mjs +3 -0
- package/dist/plugin/index.d.mts +3 -3
- package/dist/plugin/index.mjs +11 -11
- package/dist/plugin/index.mjs.map +1 -1
- package/dist/{schema-R5TxC5Pn.mjs → schema-D5Cpd8fQ.mjs} +48 -5
- package/dist/schema-D5Cpd8fQ.mjs.map +1 -0
- package/dist/seed-CeUEANfQ.mjs +1050 -0
- package/dist/seed-CeUEANfQ.mjs.map +1 -0
- package/dist/{src-DMROgdcL.mjs → src-Bb1UVstT.mjs} +2 -2
- package/dist/{src-DMROgdcL.mjs.map → src-Bb1UVstT.mjs.map} +1 -1
- package/dist/telemetry-9A1BZqbl.mjs +3 -0
- package/dist/telemetry-rFq0QdvJ.mjs +84 -0
- package/dist/telemetry-rFq0QdvJ.mjs.map +1 -0
- package/dist/types-CJF3Y1x8.d.mts +158 -0
- package/dist/{types-CZZBCaxB.d.mts → types-CblXasFV.d.mts} +1405 -1045
- package/dist/{types-b-ig8nW_.mjs → types-ClK_HJ0G.mjs} +1 -1
- package/dist/{types-b-ig8nW_.mjs.map → types-ClK_HJ0G.mjs.map} +1 -1
- package/dist/{update-CUBVjZbL.mjs → update-Cr5c7h1r.mjs} +485 -244
- package/dist/update-Cr5c7h1r.mjs.map +1 -0
- package/dist/utils/test/index.d.mts +4 -4
- package/dist/utils/test/index.mjs +3 -2
- package/dist/utils/test/index.mjs.map +1 -1
- package/docs/cli/application.md +106 -14
- package/docs/cli/auth.md +92 -12
- package/docs/cli/completion.md +18 -2
- package/docs/cli/executor.md +122 -14
- package/docs/cli/function.md +32 -4
- package/docs/cli/secret.md +134 -18
- package/docs/cli/staticwebsite.md +60 -8
- package/docs/cli/tailordb.md +148 -20
- package/docs/cli/user.md +154 -22
- package/docs/cli/workflow.md +100 -12
- package/docs/cli/workspace.md +274 -38
- package/docs/generator/custom.md +2 -2
- package/docs/plugin/custom.md +270 -163
- package/docs/plugin/index.md +48 -2
- package/package.json +28 -2
- package/dist/application-BMDE8KqK.mjs.map +0 -1
- package/dist/application-Dni_W16P.mjs +0 -4
- package/dist/job-CULA2Pvf.mjs.map +0 -1
- package/dist/schema-R5TxC5Pn.mjs.map +0 -1
- package/dist/types-DthzUFfx.d.mts +0 -372
- package/dist/update-CUBVjZbL.mjs.map +0 -1
- /package/dist/{chunk-GMkBE123.mjs → chunk-CqAI0b6X.mjs} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference path="./user-defined.d.ts" />
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { A as AuthAccessTokenTrigger$1, B as ResolverExecutedTrigger$1, Bt as TailorActor, Ct as FieldMetadata, Dt as TailorAnyField, Et as TailorFieldType, F as FunctionOperation$1, Ft as InferFieldsOutput, Gt as AllowedValues, H as WebhookOperation$1, I as GqlOperation$1, It as JsonCompatible, J as AuthServiceInput, K as AuthInvoker$1, Kt as AllowedValuesOutput, L as IdpUserTrigger$1, Lt as output$1, M as ExecutorInput, Mt as ResolverInput, Ot as TailorField, R as IncomingWebhookTrigger$1, St as DefinedFieldMetadata, Tt as FieldOutput, U as WorkflowOperation$1, Ut as TailorUser, V as ScheduleTriggerInput, X as DefinedAuth, dt as UserAttributeListKey, ft as UserAttributeMap, ht as GeneratorConfig, o as TailorDBInstance, s as TailorDBType, u as Plugin, wt as FieldOptions, xt as ArrayFieldOutput, z as RecordTrigger$1, zt as TailorEnv } from "./types-CblXasFV.mjs";
|
|
3
|
+
import { a as IdpDefinitionBrand, i as IdPInput, t as AppConfig } from "./types-CJF3Y1x8.mjs";
|
|
4
4
|
import * as zod0 from "zod";
|
|
5
5
|
import { JsonPrimitive, Jsonifiable, Jsonify } from "type-fest";
|
|
6
6
|
import { Client } from "@urql/core";
|
|
@@ -110,6 +110,7 @@ type ResolverConfig = ReturnType<typeof createResolver<any, any>>;
|
|
|
110
110
|
*/
|
|
111
111
|
type WorkflowJobContext = {
|
|
112
112
|
env: TailorEnv;
|
|
113
|
+
user: TailorUser;
|
|
113
114
|
};
|
|
114
115
|
/**
|
|
115
116
|
* Allowed output types for workflow job body functions.
|
|
@@ -213,6 +214,11 @@ type WorkflowJobBody<I, O> = IsValidInput<I> extends true ? IsValidOutput<O> ext
|
|
|
213
214
|
* Contains JSON-serialized TailorEnv object.
|
|
214
215
|
*/
|
|
215
216
|
declare const WORKFLOW_TEST_ENV_KEY = "TAILOR_TEST_WORKFLOW_ENV";
|
|
217
|
+
/**
|
|
218
|
+
* Environment variable key for workflow user testing.
|
|
219
|
+
* Contains JSON-serialized TailorUser object.
|
|
220
|
+
*/
|
|
221
|
+
declare const WORKFLOW_TEST_USER_KEY = "TAILOR_TEST_WORKFLOW_USER";
|
|
216
222
|
/**
|
|
217
223
|
* Create a workflow job definition.
|
|
218
224
|
*
|
|
@@ -627,6 +633,7 @@ declare function defineIdp<const TClients extends string[]>(name: string, config
|
|
|
627
633
|
declare function defineConfig<const Config extends AppConfig & Record<Exclude<keyof Config, keyof AppConfig>, never>>(config: Config): Config;
|
|
628
634
|
/**
|
|
629
635
|
* Define generators to be used with the Tailor SDK.
|
|
636
|
+
* @deprecated Use definePlugins() with generation hooks (onTypeLoaded, generate, etc.) instead.
|
|
630
637
|
* @param configs - Generator configurations
|
|
631
638
|
* @returns Generator configurations as given
|
|
632
639
|
*/
|
|
@@ -657,7 +664,7 @@ declare function defineGenerators(...configs: GeneratorConfig[]): (["@tailor-pla
|
|
|
657
664
|
* @param configs - Plugin configurations
|
|
658
665
|
* @returns Plugin configurations as given
|
|
659
666
|
*/
|
|
660
|
-
declare function definePlugins(...configs: Plugin[]): Plugin<
|
|
667
|
+
declare function definePlugins(...configs: Plugin<any, any>[]): Plugin<any, any>[];
|
|
661
668
|
//#endregion
|
|
662
669
|
//#region src/configure/index.d.ts
|
|
663
670
|
type TailorOutput<T> = output$1<T>;
|
|
@@ -694,6 +701,12 @@ declare const t: {
|
|
|
694
701
|
array: true;
|
|
695
702
|
} ? true : false;
|
|
696
703
|
}, Opt["optional"] extends true ? ArrayFieldOutput<number, Opt> | null : ArrayFieldOutput<number, Opt>, FieldMetadata, TailorFieldType>;
|
|
704
|
+
decimal: <const Opt extends FieldOptions>(options?: Opt) => TailorField<{
|
|
705
|
+
type: "decimal";
|
|
706
|
+
array: Opt extends {
|
|
707
|
+
array: true;
|
|
708
|
+
} ? true : false;
|
|
709
|
+
}, Opt["optional"] extends true ? ArrayFieldOutput<string, Opt> | null : ArrayFieldOutput<string, Opt>, FieldMetadata, TailorFieldType>;
|
|
697
710
|
date: <const Opt extends FieldOptions>(options?: Opt) => TailorField<{
|
|
698
711
|
type: "date";
|
|
699
712
|
array: Opt extends {
|
|
@@ -730,5 +743,5 @@ declare namespace t {
|
|
|
730
743
|
type infer<T> = TailorOutput<T>;
|
|
731
744
|
}
|
|
732
745
|
//#endregion
|
|
733
|
-
export {
|
|
734
|
-
//# sourceMappingURL=index-
|
|
746
|
+
export { AuthInvoker as $, idpUserCreatedTrigger as A, WebhookOperation as B, RecordTrigger as C, authAccessTokenIssuedTrigger as D, ResolverExecutedTrigger as E, recordUpdatedTrigger as F, WORKFLOW_TEST_ENV_KEY as G, Workflow as H, resolverExecutedTrigger as I, WorkflowJobContext as J, WORKFLOW_TEST_USER_KEY as K, FunctionOperation as L, idpUserUpdatedTrigger as M, recordCreatedTrigger as N, authAccessTokenRefreshedTrigger as O, recordDeletedTrigger as P, createResolver as Q, GqlOperation as R, RecordDeletedArgs as S, ResolverExecutedArgs as T, WorkflowConfig as U, WorkflowOperation as V, createWorkflow as W, WorkflowJobOutput as X, WorkflowJobInput as Y, createWorkflowJob as Z, AuthAccessTokenArgs as _, defineGenerators as a, IdpUserTrigger as b, createExecutor as c, IncomingWebhookRequest as d, defineAuth as et, IncomingWebhookTrigger as f, scheduleTrigger as g, ScheduleTrigger as h, defineConfig as i, idpUserDeletedTrigger as j, authAccessTokenRevokedTrigger as k, Trigger as l, ScheduleArgs as m, output as n, definePlugins as o, incomingWebhookTrigger as p, WorkflowJob as q, t as r, defineIdp as s, infer as t, IncomingWebhookArgs as u, AuthAccessTokenTrigger as v, RecordUpdatedArgs as w, RecordCreatedArgs as x, IdpUserArgs as y, Operation as z };
|
|
747
|
+
//# sourceMappingURL=index-ClLZCbcm.d.mts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference path="./user-defined.d.ts" />
|
|
2
|
+
import { u as Plugin } from "./types-CblXasFV.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/plugin/builtin/file-utils/index.d.ts
|
|
5
|
+
declare const FileUtilsGeneratorID = "@tailor-platform/file-utils";
|
|
6
|
+
type FileUtilsPluginOptions = {
|
|
7
|
+
distPath: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Plugin that generates TypeWithFiles interface from TailorDB type definitions.
|
|
11
|
+
* @param options - Plugin options
|
|
12
|
+
* @param options.distPath - Output file path for generated file utilities
|
|
13
|
+
* @returns Plugin instance with onTailorDBReady hook
|
|
14
|
+
*/
|
|
15
|
+
declare function fileUtilsPlugin(options: FileUtilsPluginOptions): Plugin<unknown, FileUtilsPluginOptions>;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { fileUtilsPlugin as n, FileUtilsGeneratorID as t };
|
|
18
|
+
//# sourceMappingURL=index-DDqKNFh4.d.mts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
2
|
+
|
|
3
|
+
//#region src/cli/telemetry/interceptor.ts
|
|
4
|
+
/**
|
|
5
|
+
* Create a Connect-RPC interceptor that records OTLP spans for each RPC call.
|
|
6
|
+
* When no TracerProvider is registered, the OTel API automatically provides
|
|
7
|
+
* noop spans with zero overhead.
|
|
8
|
+
* @returns Tracing interceptor
|
|
9
|
+
*/
|
|
10
|
+
function createTracingInterceptor() {
|
|
11
|
+
return (next) => async (req) => {
|
|
12
|
+
return trace.getTracer("tailor-sdk").startActiveSpan(`rpc.${req.method.name}`, async (span) => {
|
|
13
|
+
span.setAttribute("rpc.method", req.method.name);
|
|
14
|
+
span.setAttribute("rpc.service", "OperatorService");
|
|
15
|
+
span.setAttribute("rpc.system", "connect-rpc");
|
|
16
|
+
try {
|
|
17
|
+
const response = await next(req);
|
|
18
|
+
span.setStatus({ code: SpanStatusCode.OK });
|
|
19
|
+
return response;
|
|
20
|
+
} catch (error) {
|
|
21
|
+
span.setStatus({ code: SpanStatusCode.ERROR });
|
|
22
|
+
if (error instanceof Error) span.recordException(error);
|
|
23
|
+
throw error;
|
|
24
|
+
} finally {
|
|
25
|
+
span.end();
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { createTracingInterceptor };
|
|
33
|
+
//# sourceMappingURL=interceptor-D8MeZOxX.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interceptor-D8MeZOxX.mjs","names":[],"sources":["../src/cli/telemetry/interceptor.ts"],"sourcesContent":["import { trace, SpanStatusCode } from \"@opentelemetry/api\";\nimport type { Interceptor } from \"@connectrpc/connect\";\n\n/**\n * Create a Connect-RPC interceptor that records OTLP spans for each RPC call.\n * When no TracerProvider is registered, the OTel API automatically provides\n * noop spans with zero overhead.\n * @returns Tracing interceptor\n */\nexport function createTracingInterceptor(): Interceptor {\n return (next) => async (req) => {\n const tracer = trace.getTracer(\"tailor-sdk\");\n\n return tracer.startActiveSpan(`rpc.${req.method.name}`, async (span) => {\n span.setAttribute(\"rpc.method\", req.method.name);\n span.setAttribute(\"rpc.service\", \"OperatorService\");\n span.setAttribute(\"rpc.system\", \"connect-rpc\");\n\n try {\n const response = await next(req);\n span.setStatus({ code: SpanStatusCode.OK });\n return response;\n } catch (error) {\n span.setStatus({ code: SpanStatusCode.ERROR });\n if (error instanceof Error) {\n span.recordException(error);\n }\n throw error;\n } finally {\n span.end();\n }\n });\n };\n}\n"],"mappings":";;;;;;;;;AASA,SAAgB,2BAAwC;AACtD,SAAQ,SAAS,OAAO,QAAQ;AAG9B,SAFe,MAAM,UAAU,aAAa,CAE9B,gBAAgB,OAAO,IAAI,OAAO,QAAQ,OAAO,SAAS;AACtE,QAAK,aAAa,cAAc,IAAI,OAAO,KAAK;AAChD,QAAK,aAAa,eAAe,kBAAkB;AACnD,QAAK,aAAa,cAAc,cAAc;AAE9C,OAAI;IACF,MAAM,WAAW,MAAM,KAAK,IAAI;AAChC,SAAK,UAAU,EAAE,MAAM,eAAe,IAAI,CAAC;AAC3C,WAAO;YACA,OAAO;AACd,SAAK,UAAU,EAAE,MAAM,eAAe,OAAO,CAAC;AAC9C,QAAI,iBAAiB,MACnB,MAAK,gBAAgB,MAAM;AAE7B,UAAM;aACE;AACR,SAAK,KAAK;;IAEZ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as __require, n as __esmMin, o as __toESM, t as __commonJSMin } from "./chunk-
|
|
1
|
+
import { i as __require, n as __esmMin, o as __toESM, t as __commonJSMin } from "./chunk-CqAI0b6X.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
|
|
4
4
|
//#region ../../node_modules/jiti/dist/jiti.cjs
|
|
@@ -4479,4 +4479,4 @@ var init_jiti = __esmMin((() => {
|
|
|
4479
4479
|
//#endregion
|
|
4480
4480
|
init_jiti();
|
|
4481
4481
|
export { createJiti };
|
|
4482
|
-
//# sourceMappingURL=jiti-
|
|
4482
|
+
//# sourceMappingURL=jiti-DfS9jItj.mjs.map
|