@tailor-platform/sdk 1.19.0 → 1.20.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/{application-A6PZjujv.mjs → application-Bli2ieqY.mjs} +97952 -97659
  3. package/dist/application-Bli2ieqY.mjs.map +1 -0
  4. package/dist/{application-nPS5veK6.mjs → application-CZdieD3K.mjs} +2 -2
  5. package/dist/cli/index.mjs +117 -62
  6. package/dist/cli/index.mjs.map +1 -1
  7. package/dist/cli/lib.d.mts +116 -58
  8. package/dist/cli/lib.mjs +6 -6
  9. package/dist/cli/lib.mjs.map +1 -1
  10. package/dist/cli/skills.mjs +1 -1
  11. package/dist/cli/skills.mjs.map +1 -1
  12. package/dist/configure/index.d.mts +4 -4
  13. package/dist/configure/index.mjs.map +1 -1
  14. package/dist/{index-B91ZpOcd.d.mts → index-B86CIKCW.d.mts} +2 -2
  15. package/dist/{index-B6pvy1MK.d.mts → index-CGjiOz_W.d.mts} +2 -2
  16. package/dist/{index-CPzbMghQ.d.mts → index-CIXOwe6g.d.mts} +2 -2
  17. package/dist/{index-ClLZCbcm.d.mts → index-DcY0e3S5.d.mts} +4 -43
  18. package/dist/{index-DDqKNFh4.d.mts → index-i6QUsr5p.d.mts} +2 -2
  19. package/dist/{package-json-DUY2kB6z.mjs → package-json-3H5gfhA4.mjs} +2 -2
  20. package/dist/package-json-3H5gfhA4.mjs.map +1 -0
  21. package/dist/package-json-DTDAqRRJ.mjs +3 -0
  22. package/dist/plugin/builtin/enum-constants/index.d.mts +2 -2
  23. package/dist/plugin/builtin/file-utils/index.d.mts +2 -2
  24. package/dist/plugin/builtin/kysely-type/index.d.mts +2 -2
  25. package/dist/plugin/builtin/seed/index.d.mts +2 -2
  26. package/dist/plugin/index.d.mts +1 -1
  27. package/dist/telemetry-Dhzj9Ncm.mjs +3 -0
  28. package/dist/{telemetry-rFq0QdvJ.mjs → telemetry-DuBhnd0X.mjs} +2 -2
  29. package/dist/telemetry-DuBhnd0X.mjs.map +1 -0
  30. package/dist/{types-CJF3Y1x8.d.mts → types-C14GuyPI.d.mts} +87 -3
  31. package/dist/{types-CblXasFV.d.mts → types-CNw4p8V7.d.mts} +2 -2
  32. package/dist/{update-Cr5c7h1r.mjs → update-DkpWgrzL.mjs} +338 -160
  33. package/dist/update-DkpWgrzL.mjs.map +1 -0
  34. package/dist/utils/test/index.d.mts +3 -3
  35. package/docs/cli/application.md +2 -0
  36. package/package.json +1 -1
  37. package/dist/application-A6PZjujv.mjs.map +0 -1
  38. package/dist/package-json-DUY2kB6z.mjs.map +0 -1
  39. package/dist/package-json-Dd1AnA5F.mjs +0 -3
  40. package/dist/telemetry-9A1BZqbl.mjs +0 -3
  41. package/dist/telemetry-rFq0QdvJ.mjs.map +0 -1
  42. package/dist/update-Cr5c7h1r.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
1
  /// <reference path="./../../../user-defined.d.ts" />
2
- import "../../../types-CblXasFV.mjs";
3
- import { n as fileUtilsPlugin, t as FileUtilsGeneratorID } from "../../../index-DDqKNFh4.mjs";
2
+ import "../../../types-CNw4p8V7.mjs";
3
+ import { n as fileUtilsPlugin, t as FileUtilsGeneratorID } from "../../../index-i6QUsr5p.mjs";
4
4
  export { FileUtilsGeneratorID, fileUtilsPlugin };
@@ -1,4 +1,4 @@
1
1
  /// <reference path="./../../../user-defined.d.ts" />
2
- import "../../../types-CblXasFV.mjs";
3
- import { n as kyselyTypePlugin, t as KyselyGeneratorID } from "../../../index-CPzbMghQ.mjs";
2
+ import "../../../types-CNw4p8V7.mjs";
3
+ import { n as kyselyTypePlugin, t as KyselyGeneratorID } from "../../../index-CIXOwe6g.mjs";
4
4
  export { KyselyGeneratorID, kyselyTypePlugin };
@@ -1,4 +1,4 @@
1
1
  /// <reference path="./../../../user-defined.d.ts" />
2
- import "../../../types-CblXasFV.mjs";
3
- import { n as seedPlugin, t as SeedGeneratorID } from "../../../index-B6pvy1MK.mjs";
2
+ import "../../../types-CNw4p8V7.mjs";
3
+ import { n as seedPlugin, t as SeedGeneratorID } from "../../../index-CGjiOz_W.mjs";
4
4
  export { SeedGeneratorID, seedPlugin };
@@ -1,5 +1,5 @@
1
1
  /// <reference path="./../user-defined.d.ts" />
2
- import { Bt as TailorActor, i as TailorAnyDBType, zt as TailorEnv } from "../types-CblXasFV.mjs";
2
+ import { Bt as TailorActor, i as TailorAnyDBType, zt as TailorEnv } from "../types-CNw4p8V7.mjs";
3
3
 
4
4
  //#region src/plugin/with-context.d.ts
5
5
 
@@ -0,0 +1,3 @@
1
+ import { n as shutdownTelemetry, r as withSpan, t as initTelemetry } from "./telemetry-DuBhnd0X.mjs";
2
+
3
+ export { initTelemetry, shutdownTelemetry };
@@ -34,7 +34,7 @@ async function initTelemetry() {
34
34
  import("@opentelemetry/exporter-trace-otlp-proto"),
35
35
  import("@opentelemetry/resources"),
36
36
  import("@opentelemetry/semantic-conventions"),
37
- import("./package-json-Dd1AnA5F.mjs")
37
+ import("./package-json-DTDAqRRJ.mjs")
38
38
  ]);
39
39
  const version = (await readPackageJson()).version ?? "unknown";
40
40
  _provider = new NodeTracerProvider({
@@ -81,4 +81,4 @@ async function withSpan(name, fn) {
81
81
 
82
82
  //#endregion
83
83
  export { shutdownTelemetry as n, withSpan as r, initTelemetry as t };
84
- //# sourceMappingURL=telemetry-rFq0QdvJ.mjs.map
84
+ //# sourceMappingURL=telemetry-DuBhnd0X.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry-DuBhnd0X.mjs","names":[],"sources":["../src/cli/telemetry/config.ts","../src/cli/telemetry/index.ts"],"sourcesContent":["/**\n * Telemetry configuration parsed from standard OpenTelemetry environment variables.\n * Tracing is enabled when OTEL_EXPORTER_OTLP_ENDPOINT is set.\n */\nexport interface TelemetryConfig {\n readonly enabled: boolean;\n readonly endpoint: string;\n}\n\n/**\n * Parse telemetry configuration from standard OpenTelemetry environment variables.\n * Tracing is enabled when OTEL_EXPORTER_OTLP_ENDPOINT is set.\n * @returns Telemetry configuration\n */\nexport function parseTelemetryConfig(): TelemetryConfig {\n const endpoint = process.env.OTEL_EXPORTER_OTLP_ENDPOINT ?? \"\";\n const enabled = endpoint.length > 0;\n\n return {\n enabled,\n endpoint,\n };\n}\n","import { trace, SpanStatusCode, type Span } from \"@opentelemetry/api\";\nimport { parseTelemetryConfig, type TelemetryConfig } from \"./config\";\n\nlet _config: TelemetryConfig | undefined;\nlet _initialized = false;\nlet _provider: { register: () => void; shutdown: () => Promise<void> } | undefined;\n\n/**\n * Check whether telemetry is currently enabled.\n * @returns true if telemetry has been initialized and is enabled\n */\nexport function isTelemetryEnabled(): boolean {\n return _config?.enabled ?? false;\n}\n\n/**\n * Initialize telemetry if OTEL_EXPORTER_OTLP_ENDPOINT is set.\n * When disabled, this is a no-op with zero overhead beyond reading env vars.\n * @returns Promise that resolves when initialization completes\n */\nexport async function initTelemetry(): Promise<void> {\n if (_initialized) return;\n _initialized = true;\n\n _config = parseTelemetryConfig();\n if (!_config.enabled) return;\n\n // Dynamic imports - only loaded when tracing is enabled\n const [\n { NodeTracerProvider, BatchSpanProcessor },\n { OTLPTraceExporter },\n { resourceFromAttributes },\n { ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION },\n { readPackageJson },\n ] = await Promise.all([\n import(\"@opentelemetry/sdk-trace-node\"),\n import(\"@opentelemetry/exporter-trace-otlp-proto\"),\n import(\"@opentelemetry/resources\"),\n import(\"@opentelemetry/semantic-conventions\"),\n import(\"@/cli/shared/package-json\"),\n ]);\n\n const packageJson = await readPackageJson();\n const version = packageJson.version ?? \"unknown\";\n\n const resource = resourceFromAttributes({\n [ATTR_SERVICE_NAME]: \"tailor-sdk\",\n [ATTR_SERVICE_VERSION]: version,\n });\n\n const exporter = new OTLPTraceExporter({\n url: `${_config.endpoint}/v1/traces`,\n });\n\n _provider = new NodeTracerProvider({\n resource,\n spanProcessors: [new BatchSpanProcessor(exporter)],\n });\n\n _provider.register();\n}\n\n/**\n * Shutdown the telemetry provider, flushing all pending spans.\n * Must be called before process exit to ensure traces are exported.\n * @returns Promise that resolves when shutdown completes\n */\nexport async function shutdownTelemetry(): Promise<void> {\n if (!_provider) return;\n await _provider.shutdown();\n}\n\n/**\n * Execute a function within a new span. Records exceptions and sets span status.\n * When no TracerProvider is registered, the OTel API automatically provides\n * noop spans with zero overhead.\n * @param name - Span name\n * @param fn - Function to execute within the span\n * @returns Result of fn\n */\nexport async function withSpan<T>(name: string, fn: (span: Span) => Promise<T>): Promise<T> {\n const tracer = trace.getTracer(\"tailor-sdk\");\n\n return tracer.startActiveSpan(name, async (span) => {\n try {\n const result = await fn(span);\n span.setStatus({ code: SpanStatusCode.OK });\n return result;\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"],"mappings":";;;;;;;;AAcA,SAAgB,uBAAwC;CACtD,MAAM,WAAW,QAAQ,IAAI,+BAA+B;AAG5D,QAAO;EACL,SAHc,SAAS,SAAS;EAIhC;EACD;;;;;AClBH,IAAI;AACJ,IAAI,eAAe;AACnB,IAAI;;;;;;AAeJ,eAAsB,gBAA+B;AACnD,KAAI,aAAc;AAClB,gBAAe;AAEf,WAAU,sBAAsB;AAChC,KAAI,CAAC,QAAQ,QAAS;CAGtB,MAAM,CACJ,EAAE,oBAAoB,sBACtB,EAAE,qBACF,EAAE,0BACF,EAAE,mBAAmB,wBACrB,EAAE,qBACA,MAAM,QAAQ,IAAI;EACpB,OAAO;EACP,OAAO;EACP,OAAO;EACP,OAAO;EACP,OAAO;EACR,CAAC;CAGF,MAAM,WADc,MAAM,iBAAiB,EACf,WAAW;AAWvC,aAAY,IAAI,mBAAmB;EACjC,UAVe,uBAAuB;IACrC,oBAAoB;IACpB,uBAAuB;GACzB,CAAC;EAQA,gBAAgB,CAAC,IAAI,mBANN,IAAI,kBAAkB,EACrC,KAAK,GAAG,QAAQ,SAAS,aAC1B,CAAC,CAIiD,CAAC;EACnD,CAAC;AAEF,WAAU,UAAU;;;;;;;AAQtB,eAAsB,oBAAmC;AACvD,KAAI,CAAC,UAAW;AAChB,OAAM,UAAU,UAAU;;;;;;;;;;AAW5B,eAAsB,SAAY,MAAc,IAA4C;AAG1F,QAFe,MAAM,UAAU,aAAa,CAE9B,gBAAgB,MAAM,OAAO,SAAS;AAClD,MAAI;GACF,MAAM,SAAS,MAAM,GAAG,KAAK;AAC7B,QAAK,UAAU,EAAE,MAAM,eAAe,IAAI,CAAC;AAC3C,UAAO;WACA,OAAO;AACd,QAAK,UAAU,EAAE,MAAM,eAAe,OAAO,CAAC;AAC9C,OAAI,iBAAiB,MACnB,MAAK,gBAAgB,MAAM;AAE7B,SAAM;YACE;AACR,QAAK,KAAK;;GAEZ"}
@@ -1,5 +1,5 @@
1
1
  /// <reference path="./user-defined.d.ts" />
2
- import { P as ExecutorServiceInput, Pt as ResolverServiceInput, W as AuthConfig, Y as BuiltinIdP, qt as TailorDBServiceInput } from "./types-CblXasFV.mjs";
2
+ import { P as ExecutorServiceInput, Pt as ResolverServiceInput, W as AuthConfig, Y as BuiltinIdP, qt as TailorDBServiceInput } from "./types-CNw4p8V7.mjs";
3
3
  import { z } from "zod";
4
4
 
5
5
  //#region src/parser/service/workflow/types.d.ts
@@ -89,8 +89,92 @@ declare const IdPSchema: z.core.$ZodBranded<z.ZodObject<{
89
89
  disablePasswordAuth?: boolean | undefined;
90
90
  }>>>;
91
91
  publishUserEvents: z.ZodOptional<z.ZodBoolean>;
92
+ gqlOperations: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"query">, z.ZodObject<{
93
+ create: z.ZodOptional<z.ZodBoolean>;
94
+ update: z.ZodOptional<z.ZodBoolean>;
95
+ delete: z.ZodOptional<z.ZodBoolean>;
96
+ read: z.ZodOptional<z.ZodBoolean>;
97
+ sendPasswordResetEmail: z.ZodOptional<z.ZodBoolean>;
98
+ }, z.core.$strip>]>, z.ZodTransform<IdPGqlOperations, "query" | {
99
+ create?: boolean | undefined;
100
+ update?: boolean | undefined;
101
+ delete?: boolean | undefined;
102
+ read?: boolean | undefined;
103
+ sendPasswordResetEmail?: boolean | undefined;
104
+ }>>>;
92
105
  }, z.core.$strip>, "IdPConfig", "out">;
93
106
  //#endregion
107
+ //#region src/configure/services/idp/index.d.ts
108
+ /**
109
+ * Configuration for GraphQL operations on IdP users.
110
+ * All operations are enabled by default (undefined or true = enabled, false = disabled).
111
+ */
112
+ interface IdPGqlOperations {
113
+ /** Enable _createUser mutation (default: true) */
114
+ create?: boolean;
115
+ /** Enable _updateUser mutation (default: true) */
116
+ update?: boolean;
117
+ /** Enable _deleteUser mutation (default: true) */
118
+ delete?: boolean;
119
+ /** Enable _users and _user queries (default: true) */
120
+ read?: boolean;
121
+ /** Enable _sendPasswordResetEmail mutation (default: true) */
122
+ sendPasswordResetEmail?: boolean;
123
+ }
124
+ /**
125
+ * Alias for common IdPGqlOperations configurations.
126
+ * - "query": Read-only mode - disables all mutations (create, update, delete, sendPasswordResetEmail)
127
+ */
128
+ type IdPGqlOperationsAliasQuery = "query";
129
+ /**
130
+ * Configuration for GraphQL operations - either an alias string or detailed object.
131
+ */
132
+ type IdPGqlOperationsConfig = IdPGqlOperationsAliasQuery | IdPGqlOperations;
133
+ /**
134
+ * Define an IdP service configuration for the Tailor SDK.
135
+ * @template TClients
136
+ * @param name - IdP service name
137
+ * @param config - IdP configuration
138
+ * @returns Defined IdP service
139
+ */
140
+ declare function defineIdp<const TClients extends string[]>(name: string, config: Omit<IdPInput, "name" | "clients"> & {
141
+ clients: TClients;
142
+ }): {
143
+ readonly name: string;
144
+ readonly provider: (providerName: string, clientName: TClients[number]) => {
145
+ readonly name: string;
146
+ readonly kind: "BuiltInIdP";
147
+ readonly namespace: string;
148
+ readonly clientName: TClients[number];
149
+ };
150
+ readonly authorization: "insecure" | "loggedIn" | {
151
+ cel: string;
152
+ };
153
+ readonly lang?: "en" | "ja" | undefined;
154
+ readonly userAuthPolicy?: {
155
+ useNonEmailIdentifier?: boolean | undefined;
156
+ allowSelfPasswordReset?: boolean | undefined;
157
+ passwordRequireUppercase?: boolean | undefined;
158
+ passwordRequireLowercase?: boolean | undefined;
159
+ passwordRequireNonAlphanumeric?: boolean | undefined;
160
+ passwordRequireNumeric?: boolean | undefined;
161
+ passwordMinLength?: number | undefined;
162
+ passwordMaxLength?: number | undefined;
163
+ allowedEmailDomains?: string[] | undefined;
164
+ allowGoogleOauth?: boolean | undefined;
165
+ disablePasswordAuth?: boolean | undefined;
166
+ } | undefined;
167
+ readonly publishUserEvents?: boolean | undefined;
168
+ readonly gqlOperations?: "query" | {
169
+ create?: boolean | undefined;
170
+ update?: boolean | undefined;
171
+ delete?: boolean | undefined;
172
+ read?: boolean | undefined;
173
+ sendPasswordResetEmail?: boolean | undefined;
174
+ } | undefined;
175
+ readonly clients: TClients;
176
+ } & IdpDefinitionBrand;
177
+ //#endregion
94
178
  //#region src/parser/service/idp/types.d.ts
95
179
  type IdPInput = z.input<typeof IdPSchema>;
96
180
  declare const idpDefinitionBrand: unique symbol;
@@ -154,5 +238,5 @@ interface AppConfig<Auth extends AuthConfig = AuthConfig, Idp extends IdPConfig[
154
238
  inlineSourcemap?: boolean;
155
239
  }
156
240
  //#endregion
157
- export { IdpDefinitionBrand as a, WorkflowServiceConfig as c, IdPInput as i, WorkflowServiceInput as l, IdPConfig as n, StaticWebsiteConfig as o, IdPExternalConfig as r, defineStaticWebSite as s, AppConfig as t };
158
- //# sourceMappingURL=types-CJF3Y1x8.d.mts.map
241
+ export { IdPGqlOperationsAliasQuery as a, StaticWebsiteConfig as c, WorkflowServiceInput as d, IdPGqlOperations as i, defineStaticWebSite as l, IdPConfig as n, IdPGqlOperationsConfig as o, IdPExternalConfig as r, defineIdp as s, AppConfig as t, WorkflowServiceConfig as u };
242
+ //# sourceMappingURL=types-C14GuyPI.d.mts.map
@@ -536,9 +536,9 @@ declare const RawPermissionsSchema: z.ZodObject<{
536
536
  create: "create";
537
537
  update: "update";
538
538
  delete: "delete";
539
+ read: "read";
539
540
  aggregate: "aggregate";
540
541
  bulkUpsert: "bulkUpsert";
541
- read: "read";
542
542
  }>>>]>;
543
543
  permit: z.ZodOptional<z.ZodBoolean>;
544
544
  description: z.ZodOptional<z.ZodString>;
@@ -2799,4 +2799,4 @@ interface TailorDBType {
2799
2799
  }
2800
2800
  //#endregion
2801
2801
  export { OAuth2ClientGrantType as $, AuthAccessTokenTrigger as A, Resolver as At, ResolverExecutedTrigger as B, TailorActor as Bt, TypePluginOutput as C, FieldMetadata as Ct, ResolverReadyContext as D, TailorAnyField as Dt, ResolverNamespaceData as E, TailorFieldType as Et, FunctionOperation as F, InferFieldsOutput as Ft, AuthExternalConfig as G, AllowedValues as Gt, WebhookOperation as H, AttributeMap as Ht, GqlOperation as I, JsonCompatible as It, AuthServiceInput as J, AuthInvoker as K, AllowedValuesOutput as Kt, IdpUserTrigger as L, output as Lt, ExecutorInput as M, ResolverInput as Mt, ExecutorServiceConfig as N, ResolverServiceConfig as Nt, TailorDBNamespaceData as O, TailorField as Ot, ExecutorServiceInput as P, ResolverServiceInput as Pt, IdProviderConfig as Q, IncomingWebhookTrigger as R, Env as Rt, TailorDBTypeForPlugin as S, DefinedFieldMetadata as St, GeneratorResult as T, FieldOutput$1 as Tt, WorkflowOperation as U, TailorUser as Ut, ScheduleTriggerInput as V, AttributeList as Vt, AuthConfig as W, unauthenticatedTailorUser as Wt, DefinedAuth as X, BuiltinIdP as Y, IDToken as Z, PluginGeneratedResolver as _, TailorTypeGqlPermission as _t, TailorDBField as a, SCIMAttributeType as at, PluginOutput as b, unsafeAllowAllTypePermission as bt, db as c, SCIMResource as ct, PluginAttachment as d, UserAttributeListKey as dt, OAuth2ClientInput as et, PluginConfigs as f, UserAttributeMap as ft, PluginGeneratedExecutorWithFile as g, PermissionCondition as gt, PluginGeneratedExecutor as h, GeneratorConfig as ht, TailorAnyDBType as i, SCIMAttributeMapping as it, Executor as j, ResolverExternalConfig as jt, TailorDBReadyContext as k, QueryType as kt, NamespacePluginOutput as l, TenantProviderConfig as lt, PluginExecutorContextBase as m, ValueOperand as mt, TypeSourceInfoEntry as n, SAML as nt, TailorDBInstance as o, SCIMAuthorization as ot, PluginExecutorContext as p, UsernameFieldKey as pt, AuthOwnConfig as q, TailorDBServiceInput as qt, TailorAnyDBField as r, SCIMAttribute as rt, TailorDBType$1 as s, SCIMConfig as st, TailorDBType as t, OIDC as tt, Plugin as u, UserAttributeKey as ut, PluginGeneratedType as v, TailorTypePermission as vt, ExecutorReadyContext as w, FieldOptions as wt, PluginProcessContext as x, ArrayFieldOutput as xt, PluginNamespaceProcessContext as y, unsafeAllowAllGqlPermission as yt, RecordTrigger as z, TailorEnv as zt };
2802
- //# sourceMappingURL=types-CblXasFV.d.mts.map
2802
+ //# sourceMappingURL=types-CNw4p8V7.d.mts.map