@tailor-platform/sdk 1.47.1 → 1.48.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 (72) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/dist/{actor-jk4-f0yp.d.mts → actor-BeIEiPYM.d.mts} +2 -2
  3. package/dist/application-BNkNt47b.mjs +4 -0
  4. package/dist/{application-C7H7y0hS.mjs → application-DUENhx4Y.mjs} +80 -17
  5. package/dist/application-DUENhx4Y.mjs.map +1 -0
  6. package/dist/cli/index.mjs +12 -12
  7. package/dist/cli/index.mjs.map +1 -1
  8. package/dist/cli/lib.d.mts +6 -6
  9. package/dist/cli/lib.mjs +4 -4
  10. package/dist/{client-DCqdtFte.mjs → client-CPW1N1Rs.mjs} +1 -1
  11. package/dist/{client-DbyKSN1F.mjs → client-_kHh0Pip.mjs} +2 -2
  12. package/dist/{client-DbyKSN1F.mjs.map → client-_kHh0Pip.mjs.map} +1 -1
  13. package/dist/configure/index.d.mts +4 -4
  14. package/dist/configure/index.mjs +51 -3
  15. package/dist/configure/index.mjs.map +1 -1
  16. package/dist/{crashreport-CNSw_BrJ.mjs → crashreport-CvmdFs4i.mjs} +5 -5
  17. package/dist/crashreport-CvmdFs4i.mjs.map +1 -0
  18. package/dist/{crashreport-DXGFd16F.mjs → crashreport-DHJuSmUc.mjs} +1 -1
  19. package/dist/{errors-wNQxQQBH.mjs → errors-pMPXghkO.mjs} +1 -1
  20. package/dist/{errors-wNQxQQBH.mjs.map → errors-pMPXghkO.mjs.map} +1 -1
  21. package/dist/index-BQ4oi0AI.d.mts +48 -0
  22. package/dist/{index-BbOTbZFf.d.mts → index-BjXN1SdY.d.mts} +2 -2
  23. package/dist/{index-DB8EapT-.d.mts → index-C--7W0UO.d.mts} +5 -5
  24. package/dist/{index-BRvNi5q9.d.mts → index-VJW98BSy.d.mts} +2 -2
  25. package/dist/{index-iy-hNfGp.d.mts → index-nV4ZC_Ve.d.mts} +2 -2
  26. package/dist/{interceptor-CBsqEWDK.mjs → interceptor-DTNS0EtF.mjs} +1 -1
  27. package/dist/{interceptor-CBsqEWDK.mjs.map → interceptor-DTNS0EtF.mjs.map} +1 -1
  28. package/dist/{job-R5C2Hfcc.mjs → job-M3Avv_SV.mjs} +4 -3
  29. package/dist/{job-R5C2Hfcc.mjs.map → job-M3Avv_SV.mjs.map} +1 -1
  30. package/dist/{mock-BP-9O5On.mjs → mock-BfL09ULZ.mjs} +1 -1
  31. package/dist/{mock-BP-9O5On.mjs.map → mock-BfL09ULZ.mjs.map} +1 -1
  32. package/dist/plugin/builtin/enum-constants/index.d.mts +1 -1
  33. package/dist/plugin/builtin/file-utils/index.d.mts +1 -1
  34. package/dist/plugin/builtin/kysely-type/index.d.mts +1 -1
  35. package/dist/plugin/builtin/seed/index.d.mts +1 -1
  36. package/dist/plugin/builtin/seed/index.mjs +1 -1
  37. package/dist/plugin/index.d.mts +2 -2
  38. package/dist/{repl-editor-CZpLlOBj.mjs → repl-editor-jZ493eQI.mjs} +1 -1
  39. package/dist/{repl-editor-CZpLlOBj.mjs.map → repl-editor-jZ493eQI.mjs.map} +1 -1
  40. package/dist/{runtime-XjP6JMmP.mjs → runtime-CNg0w27y.mjs} +396 -125
  41. package/dist/runtime-CNg0w27y.mjs.map +1 -0
  42. package/dist/{tailordb-DjlNUV6u.mjs → schema-C5QjYEc-.mjs} +2 -42
  43. package/dist/schema-C5QjYEc-.mjs.map +1 -0
  44. package/dist/secret-file-BHpxGyNf.mjs +65 -0
  45. package/dist/secret-file-BHpxGyNf.mjs.map +1 -0
  46. package/dist/{seed-DrKY5yIF.mjs → seed-DjfAn0BC.mjs} +44 -19
  47. package/dist/seed-DjfAn0BC.mjs.map +1 -0
  48. package/dist/{service-obEU5gSM.mjs → service-DCgJxdg1.mjs} +2 -2
  49. package/dist/{service-obEU5gSM.mjs.map → service-DCgJxdg1.mjs.map} +1 -1
  50. package/dist/{tailor-db-field-Bn8ZC5lK.d.mts → tailor-db-field-4bMLe25-.d.mts} +5 -1
  51. package/dist/telemetry-C13VIFpT.mjs +4 -0
  52. package/dist/{telemetry-DcL8Fsm_.mjs → telemetry-C1Y56L5E.mjs} +1 -1
  53. package/dist/{telemetry-DcL8Fsm_.mjs.map → telemetry-C1Y56L5E.mjs.map} +1 -1
  54. package/dist/utils/test/index.d.mts +3 -3
  55. package/dist/utils/test/index.mjs +1 -1
  56. package/dist/vitest/environment.mjs +1 -1
  57. package/dist/vitest/index.mjs +1 -1
  58. package/dist/vitest/setup.mjs +1 -1
  59. package/dist/{workflow.generated-i7PK4fg-.d.mts → workflow.generated-OYAu_6zX.d.mts} +12 -2
  60. package/docs/cli/application.md +4 -0
  61. package/docs/configuration.md +4 -0
  62. package/docs/generator/builtin.md +35 -4
  63. package/package.json +11 -11
  64. package/postinstall.mjs +1 -1
  65. package/dist/application-C7H7y0hS.mjs.map +0 -1
  66. package/dist/application-Csq5jxYP.mjs +0 -4
  67. package/dist/crashreport-CNSw_BrJ.mjs.map +0 -1
  68. package/dist/index-BXyS7xKC.d.mts +0 -21
  69. package/dist/runtime-XjP6JMmP.mjs.map +0 -1
  70. package/dist/seed-DrKY5yIF.mjs.map +0 -1
  71. package/dist/tailordb-DjlNUV6u.mjs.map +0 -1
  72. package/dist/telemetry-21afNV9_.mjs +0 -4
@@ -82,4 +82,4 @@ async function withSpan(name, fn) {
82
82
 
83
83
  //#endregion
84
84
  export { shutdownTelemetry as n, withSpan as r, initTelemetry as t };
85
- //# sourceMappingURL=telemetry-DcL8Fsm_.mjs.map
85
+ //# sourceMappingURL=telemetry-C1Y56L5E.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"telemetry-DcL8Fsm_.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;CAG5D,OAAO;EACL,SAHc,SAAS,SAAS;EAIhC;EACD;;;;;AClBH,IAAI;AACJ,IAAI,eAAe;AACnB,IAAI;;;;;;AAeJ,eAAsB,gBAA+B;CACnD,IAAI,cAAc;CAClB,eAAe;CAEf,UAAU,sBAAsB;CAChC,IAAI,CAAC,QAAQ,SAAS;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,WAAU,MADU,iBAAiB,EACf,WAAW;CAWvC,YAAY,IAAI,mBAAmB;EACjC,UAVe,uBAAuB;IACrC,oBAAoB;IACpB,uBAAuB;GACzB,CAOS;EACR,gBAAgB,CAAC,IAAI,mBAAmB,IANrB,kBAAkB,EACrC,KAAK,GAAG,QAAQ,SAAS,aAC1B,CAIiD,CAAC,CAAC;EACnD,CAAC;CAEF,UAAU,UAAU;;;;;;;AAQtB,eAAsB,oBAAmC;CACvD,IAAI,CAAC,WAAW;CAChB,MAAM,UAAU,UAAU;;;;;;;;;;AAW5B,eAAsB,SAAY,MAAc,IAA4C;CAG1F,OAFe,MAAM,UAAU,aAElB,CAAC,gBAAgB,MAAM,OAAO,SAAS;EAClD,IAAI;GACF,MAAM,SAAS,MAAM,GAAG,KAAK;GAC7B,KAAK,UAAU,EAAE,MAAM,eAAe,IAAI,CAAC;GAC3C,OAAO;WACA,OAAO;GACd,KAAK,UAAU,EAAE,MAAM,eAAe,OAAO,CAAC;GAC9C,IAAI,iBAAiB,OACnB,KAAK,gBAAgB,MAAM;GAE7B,MAAM;YACE;GACR,KAAK,KAAK;;GAEZ"}
1
+ {"version":3,"file":"telemetry-C1Y56L5E.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;CAG5D,OAAO;EACL,SAHc,SAAS,SAAS;EAIhC;EACD;;;;;AClBH,IAAI;AACJ,IAAI,eAAe;AACnB,IAAI;;;;;;AAeJ,eAAsB,gBAA+B;CACnD,IAAI,cAAc;CAClB,eAAe;CAEf,UAAU,sBAAsB;CAChC,IAAI,CAAC,QAAQ,SAAS;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,WAAU,MADU,iBAAiB,EACf,WAAW;CAWvC,YAAY,IAAI,mBAAmB;EACjC,UAVe,uBAAuB;IACrC,oBAAoB;IACpB,uBAAuB;GACzB,CAOS;EACR,gBAAgB,CAAC,IAAI,mBAAmB,IANrB,kBAAkB,EACrC,KAAK,GAAG,QAAQ,SAAS,aAC1B,CAIiD,CAAC,CAAC;EACnD,CAAC;CAEF,UAAU,UAAU;;;;;;;AAQtB,eAAsB,oBAAmC;CACvD,IAAI,CAAC,WAAW;CAChB,MAAM,UAAU,UAAU;;;;;;;;;;AAW5B,eAAsB,SAAY,MAAc,IAA4C;CAG1F,OAFe,MAAM,UAAU,aAElB,CAAC,gBAAgB,MAAM,OAAO,SAAS;EAClD,IAAI;GACF,MAAM,SAAS,MAAM,GAAG,KAAK;GAC7B,KAAK,UAAU,EAAE,MAAM,eAAe,IAAI,CAAC;GAC3C,OAAO;WACA,OAAO;GACd,KAAK,UAAU,EAAE,MAAM,eAAe,OAAO,CAAC;GAC9C,IAAI,iBAAiB,OACnB,KAAK,gBAAgB,MAAM;GAE7B,MAAM;YACE;GACR,KAAK,KAAK;;GAEZ"}
@@ -1,7 +1,7 @@
1
1
  /// <reference types="@tailor-platform/function-types" />
2
- import { Vt as TailorInvoker } from "../../tailor-db-field-Bn8ZC5lK.mjs";
3
- import { O as TailorDBType } from "../../workflow.generated-i7PK4fg-.mjs";
4
- import { dt as WORKFLOW_TEST_ENV_KEY, n as output, xt as TailorField } from "../../index-DB8EapT-.mjs";
2
+ import { Vt as TailorInvoker } from "../../tailor-db-field-4bMLe25-.mjs";
3
+ import { O as TailorDBType } from "../../workflow.generated-OYAu_6zX.mjs";
4
+ import { dt as WORKFLOW_TEST_ENV_KEY, n as output, xt as TailorField } from "../../index-C--7W0UO.mjs";
5
5
  import { StandardSchemaV1 } from "@standard-schema/spec";
6
6
 
7
7
  //#region src/utils/test/mock.d.ts
@@ -1,5 +1,5 @@
1
1
 
2
- import { t as WORKFLOW_TEST_ENV_KEY } from "../../job-R5C2Hfcc.mjs";
2
+ import { t as WORKFLOW_TEST_ENV_KEY } from "../../job-M3Avv_SV.mjs";
3
3
  import { pathToFileURL } from "node:url";
4
4
  import * as path from "node:path";
5
5
 
@@ -1,5 +1,5 @@
1
1
 
2
- import { c as injectMocks, i as cleanupMocks, n as STATE_KEY, t as RUNTIME_FLAG_KEY } from "../mock-BP-9O5On.mjs";
2
+ import { c as injectMocks, i as cleanupMocks, n as STATE_KEY, t as RUNTIME_FLAG_KEY } from "../mock-BfL09ULZ.mjs";
3
3
  import * as globals from "globals";
4
4
 
5
5
  //#region src/vitest/environment.ts
@@ -1,5 +1,5 @@
1
1
 
2
- import { a as fileMock, d as workflowMock, l as secretmanagerMock, o as iconvMock, r as authconnectionMock, s as idpMock, u as tailordbMock } from "../mock-BP-9O5On.mjs";
2
+ import { a as fileMock, d as workflowMock, l as secretmanagerMock, o as iconvMock, r as authconnectionMock, s as idpMock, u as tailordbMock } from "../mock-BfL09ULZ.mjs";
3
3
  import { builtinModules } from "node:module";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import { dirname, isAbsolute, matchesGlob, relative, resolve } from "node:path";
@@ -1,5 +1,5 @@
1
1
 
2
- import { l as secretmanagerMock, t as RUNTIME_FLAG_KEY } from "../mock-BP-9O5On.mjs";
2
+ import { l as secretmanagerMock, t as RUNTIME_FLAG_KEY } from "../mock-BfL09ULZ.mjs";
3
3
  import { pathToFileURL } from "node:url";
4
4
  import { afterEach, beforeAll, beforeEach } from "vitest";
5
5
 
@@ -1,5 +1,5 @@
1
1
  /// <reference types="@tailor-platform/function-types" />
2
- import { A as RelationType, Bt as InferredAttributeMap, D as DefinedDBFieldMetadata, Dt as ArrayFieldOutput, E as DBFieldMetadata, F as AuthConfig, Ft as FieldValidateInput, Ht as TailorUser, It as Validators, Jt as output, M as TailorDBServiceInput, Mt as FieldOutput, O as GqlOperationsConfig, Pt as TailorToTs, Wt as InferFieldsOutput, Y as TailorField, c as PluginConfigs, ht as BuiltinIdP, i as TailorDBType$1, j as SerialConfig, jt as FieldOptions, k as IndexDef, kt as EnumValue, qt as Prettify, r as TailorDBField$1, t as TailorAnyDBField$1 } from "./tailor-db-field-Bn8ZC5lK.mjs";
2
+ import { A as RelationType, Bt as InferredAttributeMap, D as DefinedDBFieldMetadata, Dt as ArrayFieldOutput, E as DBFieldMetadata, F as AuthConfig, Ft as FieldValidateInput, Ht as TailorUser, It as Validators, Jt as output, M as TailorDBServiceInput, Mt as FieldOutput, O as GqlOperationsConfig, Pt as TailorToTs, Wt as InferFieldsOutput, Y as TailorField, c as PluginConfigs, ht as BuiltinIdP, i as TailorDBType$1, j as SerialConfig, jt as FieldOptions, k as IndexDef, kt as EnumValue, qt as Prettify, r as TailorDBField$1, t as TailorAnyDBField$1 } from "./tailor-db-field-4bMLe25-.mjs";
3
3
  import { NonEmptyObject } from "type-fest";
4
4
  import { StandardSchemaV1 } from "@standard-schema/spec";
5
5
 
@@ -1164,6 +1164,16 @@ type WorkflowServiceInput = WorkflowServiceConfig;
1164
1164
  interface AppConfig<Auth extends AuthConfig = AuthConfig, Idp extends IdPConfig[] = IdPConfig[], StaticWebsites extends StaticWebsiteConfig[] = StaticWebsiteConfig[], Env extends Record<string, string | number | boolean> = Record<string, string | number | boolean>> {
1165
1165
  /** Application name (required). */
1166
1166
  name: string;
1167
+ /**
1168
+ * Stable identifier used to track the application across renames.
1169
+ * Managed by the SDK: auto-generated and written into `tailor.config.ts`
1170
+ * on first `deploy`. Delete this field if you want the SDK to assign a
1171
+ * new id on the next `deploy` — typical case: `tailor.config.ts` was
1172
+ * copied from another project and the new application should not share
1173
+ * the original's id. Existing resources are re-tagged with the new id;
1174
+ * data is preserved.
1175
+ */
1176
+ id?: string;
1167
1177
  /** Environment variables accessible via `context.env` in resolvers and via the second argument `{ env }` in workflow job bodies. */
1168
1178
  env?: Env;
1169
1179
  /** Allowed CORS origins. Must be an array of strings, e.g. `["https://example.com"]`. */
@@ -1207,4 +1217,4 @@ type ConcurrencyPolicy = {
1207
1217
  };
1208
1218
  //#endregion
1209
1219
  export { PermissionCondition as A, IdPInput as C, TailorDBInstance as D, TailorDBField as E, AllowedValues as F, AllowedValuesOutput as I, TailorTypePermission as M, unsafeAllowAllGqlPermission as N, TailorDBType as O, unsafeAllowAllTypePermission as P, IdPGqlOperationsInput as S, TailorAnyDBType as T, IdPExternalConfig as _, ExecutorServiceInput as a, IdPEmailConfig as b, ResolverServiceInput as c, StaticWebsiteConfig as d, StaticWebsiteDefinitionBrand as f, IdPConfig as g, SecretsDefinitionBrand as h, ExecutorServiceConfig as i, TailorTypeGqlPermission as j, db as k, WorkflowServiceConfig as l, SecretsConfig as m, RetryPolicy as n, ResolverExternalConfig as o, StaticWebsiteInput as p, AppConfig as r, ResolverServiceConfig as s, ConcurrencyPolicy as t, WorkflowServiceInput as u, IdPUserField as v, TailorAnyDBField as w, IdPGqlOperations as x, IdpDefinitionBrand as y };
1210
- //# sourceMappingURL=workflow.generated-i7PK4fg-.d.mts.map
1220
+ //# sourceMappingURL=workflow.generated-OYAu_6zX.d.mts.map
@@ -136,6 +136,10 @@ See [Global Options](../cli-reference.md#global-options) for options available t
136
136
 
137
137
  <!-- politty:command:deploy:global-options-link:end -->
138
138
 
139
+ **Config File Modification:**
140
+
141
+ On first run, `deploy` automatically injects a stable `id: "<uuid>"` field into your `defineConfig({...})` call in `tailor.config.ts`. This UUID is used to track your application across renames so the SDK can recognize ownership across renames. Commit the generated id to version control. See [Configuration](../configuration.md#application-settings) for details.
142
+
139
143
  **Migration Handling:**
140
144
 
141
145
  When migrations are configured (`db.tailordb.migration` in config), the `deploy` command automatically:
@@ -19,6 +19,8 @@ For service-specific documentation, see:
19
19
  import { defineConfig } from "@tailor-platform/sdk";
20
20
 
21
21
  export default defineConfig({
22
+ // SDK-managed app id — do not edit, except when copying this config to a separate app.
23
+ // id: "<uuid>" — written here automatically on first run
22
24
  name: "my-app",
23
25
  cors: ["https://example.com"],
24
26
  allowedIpAddresses: ["192.168.1.0/24"],
@@ -28,6 +30,8 @@ export default defineConfig({
28
30
 
29
31
  **Name**: Set the application name.
30
32
 
33
+ **Id (auto-managed)**: A stable identifier used to recognize resources managed by the SDK across renames. On first `deploy`, the SDK injects an `id: "<uuid>"` field into your `defineConfig({...})` call and commits it to `tailor.config.ts`. Keep it under version control; do not edit it by hand. Delete it only if you want the SDK to assign a new id on the next `deploy` — typically when `tailor.config.ts` was copied from another project and the new application should not share the original's id. Auto-injection requires `defineConfig({...})` to be called with an inline object literal: if the argument is a separate variable (e.g. `defineConfig(config)`), or if `tailor.config.ts` is a wrapper that re-exports `defineConfig` from another file, the SDK cannot inject — add the `id` field manually to the file that contains the actual `defineConfig({...})` object literal.
34
+
31
35
  **CORS**: Specify CORS settings as an array. You can also include Static Website URL references (e.g. `website.url`) in this array; see [Static Website](./services/staticwebsite.md).
32
36
 
33
37
  **Allowed IP Addresses**: Specify IP addresses allowed to access the application in CIDR format.
@@ -183,10 +183,41 @@ Generates seed data configuration files for database initialization.
183
183
  ["@tailor-platform/seed", { distPath: "./seed", machineUserName: "admin" }];
184
184
  ```
185
185
 
186
- | Option | Type | Description |
187
- | ----------------- | -------- | -------------------------------------------------------- |
188
- | `distPath` | `string` | Output directory path (required) |
189
- | `machineUserName` | `string` | Default machine user name (can be overridden at runtime) |
186
+ | Option | Type | Description |
187
+ | -------------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
188
+ | `distPath` | `string` | Output directory path (required) |
189
+ | `machineUserName` | `string` | Default machine user name (can be overridden at runtime) |
190
+ | `disableIdpUserSync` | `{ userToIdp?: boolean; idpToUser?: boolean }` | Skip emitting individual `_User <-> userProfile` foreign keys. Both directions are emitted by default. See [IdP user synchronization](#idp-user-synchronization). |
191
+
192
+ ### IdP user synchronization
193
+
194
+ When `auth.userProfile` is configured, the seed plugin treats the userProfile
195
+ type (e.g. `User`) and the IdP-managed `_User` table as a pair. By default it
196
+ emits foreign keys in both directions so that `validate` rejects any row in
197
+ either table that does not have a matching counterpart:
198
+
199
+ | Direction | Foreign key | Catches |
200
+ | ----------- | ---------------------------------------------- | ---------------------------------------------- |
201
+ | `idpToUser` | `_User.name` → `<userProfile>.<usernameField>` | Creating an IdP credential with no profile row |
202
+ | `userToIdp` | `<userProfile>.<usernameField>` → `_User.name` | Creating a profile row with no IdP credential |
203
+
204
+ Neither direction is enforced by the runtime. In production it is normal for
205
+ one side to exist without the other — for example a userProfile row exists
206
+ the moment a user is invited, but the corresponding `_User` row appears only
207
+ after the user finishes signing up. To seed such states, set the relevant
208
+ direction in `disableIdpUserSync` to `true`:
209
+
210
+ ```typescript
211
+ // Allow seeding invited-but-not-registered userProfile rows.
212
+ // Still rejects _User rows without a matching userProfile row.
213
+ ["@tailor-platform/seed", { distPath: "./seed", disableIdpUserSync: { userToIdp: true } }];
214
+
215
+ // Allow seeding _User rows whose userProfile does not exist yet.
216
+ // Still rejects userProfile rows without a matching _User row.
217
+ ["@tailor-platform/seed", { distPath: "./seed", disableIdpUserSync: { idpToUser: true } }];
218
+ ```
219
+
220
+ Omitted directions default to `false` (FK emitted).
190
221
 
191
222
  ### Output
192
223
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/sdk",
3
- "version": "1.47.1",
3
+ "version": "1.48.0",
4
4
  "description": "Tailor Platform SDK - The SDK to work with Tailor Platform",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -21,6 +21,10 @@
21
21
  "skills"
22
22
  ],
23
23
  "type": "module",
24
+ "sideEffects": [
25
+ "./dist/cli/**/*.mjs",
26
+ "./dist/vitest/setup.mjs"
27
+ ],
24
28
  "main": "./dist/configure/index.mjs",
25
29
  "types": "./dist/configure/index.d.mts",
26
30
  "exports": {
@@ -91,8 +95,8 @@
91
95
  "@bufbuild/protobuf": "2.12.0",
92
96
  "@connectrpc/connect": "2.1.1",
93
97
  "@connectrpc/connect-node": "2.1.1",
94
- "@inquirer/core": "11.1.9",
95
- "@inquirer/prompts": "8.4.2",
98
+ "@inquirer/core": "11.1.10",
99
+ "@inquirer/prompts": "8.4.3",
96
100
  "@jridgewell/trace-mapping": "0.3.31",
97
101
  "@liam-hq/cli": "0.7.24",
98
102
  "@napi-rs/keyring": "1.3.0",
@@ -141,24 +145,19 @@
141
145
  "zod": "4.3.6"
142
146
  },
143
147
  "devDependencies": {
144
- "@eslint/js": "10.0.1",
145
148
  "@opentelemetry/sdk-trace-base": "2.7.1",
146
149
  "@types/madge": "5.0.3",
147
150
  "@types/mime-types": "3.0.1",
148
151
  "@types/node": "24.12.3",
149
152
  "@types/semver": "7.7.1",
150
- "@typescript/native-preview": "7.0.0-dev.20260503.1",
153
+ "@typescript/native-preview": "7.0.0-dev.20260516.1",
151
154
  "@vitest/coverage-v8": "4.1.5",
152
- "eslint": "10.3.0",
153
- "eslint-plugin-jsdoc": "62.9.0",
154
- "eslint-plugin-oxlint": "1.61.0",
155
155
  "oxfmt": "0.46.0",
156
156
  "oxlint": "1.61.0",
157
157
  "oxlint-tsgolint": "0.22.1",
158
158
  "sonda": "0.11.1",
159
159
  "tsdown": "0.22.0",
160
160
  "typescript": "5.9.3",
161
- "typescript-eslint": "8.59.2",
162
161
  "vitest": "4.1.5",
163
162
  "zinfer": "0.1.8"
164
163
  },
@@ -186,8 +185,9 @@
186
185
  "docs:check": "vitest run --project=unit src/cli/docs.test.ts",
187
186
  "docs:update": "POLITTY_DOCS_UPDATE=true vitest run --project=unit src/cli/docs.test.ts",
188
187
  "build": "tsdown",
189
- "lint": "oxlint --type-aware . && eslint --cache .",
190
- "lint:fix": "oxlint --type-aware . --fix && eslint --cache . --fix",
188
+ "lint": "oxlint --type-aware .",
189
+ "check:public-api-jsdoc": "tsx scripts/check-public-api-jsdoc.ts",
190
+ "lint:fix": "oxlint --type-aware . --fix",
191
191
  "typecheck": "tsc --noEmit",
192
192
  "typecheck:go": "tsgo",
193
193
  "perf:typecheck": "bash scripts/perf/exec.sh",
package/postinstall.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { existsSync } from "node:fs";
4
+ import { register } from "node:module";
4
5
  import { dirname, resolve } from "node:path";
5
6
  import { pathToFileURL } from "node:url";
6
- import { register } from "node:module";
7
7
  import { findUpSync } from "find-up-simple";
8
8
 
9
9
  const __dirname = import.meta.dirname;