@tailor-platform/sdk 2.4.0 → 2.6.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 +131 -0
- package/bin/tailor.mjs +3 -2
- package/dist/aigateway-DsWDjzk4.mjs +2 -0
- package/dist/{aigateway-DR4Kwuik.mjs.map → aigateway-DsWDjzk4.mjs.map} +1 -1
- package/dist/application-CNeOcaLc.mjs +1 -0
- package/dist/application-CmXOqTaK.mjs +192 -0
- package/dist/application-CmXOqTaK.mjs.map +1 -0
- package/dist/assert-WeXvmG4j.mjs +2 -0
- package/dist/{assert-DBxo8jPo.mjs.map → assert-WeXvmG4j.mjs.map} +1 -1
- package/dist/authconnection-CynFBIv8.mjs +2 -0
- package/dist/{authconnection-CZvi9ANm.mjs.map → authconnection-CynFBIv8.mjs.map} +1 -1
- package/dist/brand-C8nMKhJC.mjs +2 -0
- package/dist/{brand-Eo4pLXPJ.mjs.map → brand-C8nMKhJC.mjs.map} +1 -1
- package/dist/cli/commands/api/index.d.mts +1 -1
- package/dist/cli/commands/deploy/deploy.d.mts +2 -2
- package/dist/cli/commands/deploy/deployment-target.d.mts +2 -0
- package/dist/cli/commands/deploy/event-subscriptions.d.mts +3 -0
- package/dist/cli/commands/deploy/tailordb/apply.d.mts +3 -0
- package/dist/cli/commands/deploy/tailordb/index.d.mts +3 -10
- package/dist/cli/commands/deploy/tailordb/migration-validation.d.mts +5 -0
- package/dist/cli/commands/deploy/tailordb/plan.d.mts +8 -0
- package/dist/cli/commands/executor/jobs.d.mts +1 -1
- package/dist/cli/commands/executor/trigger.d.mts +1 -1
- package/dist/cli/commands/generate/seed/bundler.d.mts +2 -2
- package/dist/cli/commands/show.d.mts +1 -1
- package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +11 -11
- package/dist/cli/commands/tailordb/migrate/generate.d.mts +4 -0
- package/dist/cli/commands/tailordb/migrate/rename-detection.d.mts +1 -1
- package/dist/cli/commands/tailordb/migrate/snapshot-comparison.d.mts +43 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-files.d.mts +62 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-local.d.mts +12 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-migrations.d.mts +12 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-remote.d.mts +1 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-types.d.mts +3 -1
- package/dist/cli/commands/tailordb/migrate/snapshot.d.mts +5 -117
- package/dist/cli/commands/workflow/start.d.mts +1 -1
- package/dist/cli/commands/workspace/list.d.mts +1 -1
- package/dist/cli/lib.d.mts +12 -4
- package/dist/cli/lib.mjs +1 -9
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/main.d.mts +2 -0
- package/dist/cli/main.mjs +1170 -7754
- package/dist/cli/main.mjs.map +1 -1
- package/dist/cli/shared/args.d.mts +65 -1
- package/dist/cli/shared/command.d.mts +11 -0
- package/dist/cli/shared/context.d.mts +1 -1
- package/dist/cli/shared/logger.d.mts +64 -0
- package/dist/cli/shared/script-executor.d.mts +1 -1
- package/dist/cli/shared/seed-chunker.d.mts +5 -5
- package/dist/completion/zsh-worker.zsh +82 -9
- package/dist/configure/config/index.d.mts +1 -1
- package/dist/configure/config/types.d.mts +2 -2
- package/dist/configure/index.d.mts +48 -12
- package/dist/configure/index.mjs +1 -1267
- package/dist/configure/index.mjs.map +1 -1
- package/dist/configure/services/auth/types.d.mts +1 -1
- package/dist/configure/services/idp/types.d.mts +1 -1
- package/dist/configure/services/tailordb/schema.d.mts +22 -8
- package/dist/configure/services/tailordb/types.d.mts +2 -2
- package/dist/configure/services/workflow/execution-policy.d.mts +3 -3
- package/dist/configure/services/workflow/job.d.mts +12 -2
- package/dist/configure/types/field.types.d.mts +1 -1
- package/dist/configure/types/permission-operand.types.d.mts +1 -1
- package/dist/context-D0QjfxzD.mjs +2 -0
- package/dist/{context-DYQVYWqZ.mjs.map → context-D0QjfxzD.mjs.map} +1 -1
- package/dist/crashreport-BN28xp5B.mjs +42 -0
- package/dist/{crashreport-Q0pDAlrj.mjs.map → crashreport-BN28xp5B.mjs.map} +1 -1
- package/dist/crashreport-By23O2k-.mjs +1 -0
- package/dist/errors-DLsQ_-ol.mjs +2 -0
- package/dist/errors-DLsQ_-ol.mjs.map +1 -0
- package/dist/es-builtins-n3wBv4Sv.mjs +2 -0
- package/dist/es-builtins-n3wBv4Sv.mjs.map +1 -0
- package/dist/file-COPYfju_.mjs +2 -0
- package/dist/file-COPYfju_.mjs.map +1 -0
- package/dist/globals-CMHSnj4w.mjs +2 -0
- package/dist/{globals-B2nlxBrz.mjs.map → globals-CMHSnj4w.mjs.map} +1 -1
- package/dist/iconv-DlFMt2gW.mjs +2 -0
- package/dist/{iconv-QWaZh0TT.mjs.map → iconv-DlFMt2gW.mjs.map} +1 -1
- package/dist/idp-G_ojPBB5.mjs +2 -0
- package/dist/{idp-RA_swu-h.mjs.map → idp-G_ojPBB5.mjs.map} +1 -1
- package/dist/interceptor-DQg3cR_9.mjs +2 -0
- package/dist/{interceptor-e33JtsC-.mjs.map → interceptor-DQg3cR_9.mjs.map} +1 -1
- package/dist/kysely/index.mjs +1 -32
- package/dist/kysely/index.mjs.map +1 -1
- package/dist/kysely-type-BTi3BMtL.mjs +43 -0
- package/dist/kysely-type-BTi3BMtL.mjs.map +1 -0
- package/dist/logger-CCjs1DuH.mjs +9 -0
- package/dist/logger-CCjs1DuH.mjs.map +1 -0
- package/dist/logger-DP2BjQ93.mjs +2 -0
- package/dist/{logger-BtX0suGY.mjs.map → logger-DP2BjQ93.mjs.map} +1 -1
- package/dist/multiline-EyzjEwn9.mjs +3 -0
- package/dist/{multiline-sfHpTZZK.mjs.map → multiline-EyzjEwn9.mjs.map} +1 -1
- package/dist/node-builtins-oBl7EbyV.mjs +2 -0
- package/dist/{node-builtins-CmaL2Cbq.mjs.map → node-builtins-oBl7EbyV.mjs.map} +1 -1
- package/dist/package-json-C690ceex.mjs +2 -0
- package/dist/{package-json-8b0O9TlX.mjs.map → package-json-C690ceex.mjs.map} +1 -1
- package/dist/package-json-CmqhDJ__.mjs +1 -0
- package/dist/parser/service/tailordb/type-source.d.mts +5 -5
- package/dist/parser/service/tailordb/types.d.mts +4 -4
- package/dist/platform-serialize-DkiTdHOt.mjs +2 -0
- package/dist/{platform-serialize-RoRtBS0v.mjs.map → platform-serialize-DkiTdHOt.mjs.map} +1 -1
- package/dist/plugin/builtin/enum-constants/index.mjs +5 -114
- package/dist/plugin/builtin/enum-constants/index.mjs.map +1 -1
- package/dist/plugin/builtin/file-utils/index.mjs +22 -104
- package/dist/plugin/builtin/file-utils/index.mjs.map +1 -1
- package/dist/plugin/builtin/kysely-type/index.d.mts +8 -1
- package/dist/plugin/builtin/kysely-type/index.mjs +1 -275
- package/dist/plugin/builtin/seed/index.d.mts +5 -0
- package/dist/plugin/builtin/seed/index.mjs +1 -3
- package/dist/plugin/builtin/seed/seed-type-processor.d.mts +0 -2
- package/dist/plugin/{get-generated-type.d.mts → get-generated-table.d.mts} +5 -5
- package/dist/plugin/index.d.mts +3 -2
- package/dist/plugin/index.mjs +1 -251
- package/dist/plugin/index.mjs.map +1 -1
- package/dist/plugin/types.d.mts +30 -23
- package/dist/plugin/with-context.d.mts +3 -3
- package/dist/register-ts-hook-oDA2JLp2.mjs +640 -0
- package/dist/register-ts-hook-oDA2JLp2.mjs.map +1 -0
- package/dist/registry-HlEaGvl5.mjs +2 -0
- package/dist/{registry-BIGVUrMB.mjs.map → registry-HlEaGvl5.mjs.map} +1 -1
- package/dist/repl-editor-BG1aDOfH.mjs +2 -0
- package/dist/{repl-editor-F9LotMNx.mjs.map → repl-editor-BG1aDOfH.mjs.map} +1 -1
- package/dist/runtime/aigateway.mjs +1 -3
- package/dist/runtime/authconnection.mjs +1 -3
- package/dist/runtime/context.mjs +1 -3
- package/dist/runtime/file.d.mts +21 -21
- package/dist/runtime/file.mjs +1 -3
- package/dist/runtime/globals.mjs +1 -1
- package/dist/runtime/iconv.mjs +1 -3
- package/dist/runtime/idp.mjs +1 -3
- package/dist/runtime/index.mjs +1 -11
- package/dist/runtime/logger.mjs +1 -3
- package/dist/runtime/secretmanager.mjs +1 -3
- package/dist/runtime/types.d.mts +1 -1
- package/dist/runtime/workflow.mjs +1 -3
- package/dist/schema-AYG4OhXY.mjs +2 -0
- package/dist/schema-AYG4OhXY.mjs.map +1 -0
- package/dist/secret-file-C9wp_FCX.mjs +2 -0
- package/dist/{secret-file-C3J4Gy8r.mjs.map → secret-file-C9wp_FCX.mjs.map} +1 -1
- package/dist/secretmanager-5olfnI1b.mjs +2 -0
- package/dist/{secretmanager-IY4UvinW.mjs.map → secretmanager-5olfnI1b.mjs.map} +1 -1
- package/dist/secretmanager-vHQoXdQz.mjs +2 -0
- package/dist/{secretmanager-CYlpffsz.mjs.map → secretmanager-vHQoXdQz.mjs.map} +1 -1
- package/dist/seed/index.mjs +8 -244
- package/dist/seed/index.mjs.map +1 -1
- package/dist/seed-DwqRFdqP.mjs +207 -0
- package/dist/seed-DwqRFdqP.mjs.map +1 -0
- package/dist/service-CLPMoj9n.mjs +2 -0
- package/dist/{service-LTfp03ZZ.mjs.map → service-CLPMoj9n.mjs.map} +1 -1
- package/dist/service-D7iXk0BT.mjs +1 -0
- package/dist/service-YqDsHmlK.mjs +7 -0
- package/dist/service-YqDsHmlK.mjs.map +1 -0
- package/dist/service_pb-DGKCLuAs.mjs +2 -0
- package/dist/{service_pb-BEWj1pOV.mjs.map → service_pb-DGKCLuAs.mjs.map} +1 -1
- package/dist/service_pb-_aeFE-Nv.mjs +1 -0
- package/dist/shared/src/color.d.mts +5 -0
- package/dist/tailor-proto/src/tailor/v1/workspace_pb.d.mts +1 -1
- package/dist/telemetry-Bklv9kQY.mjs +2 -0
- package/dist/{telemetry-BRVdwh14.mjs.map → telemetry-Bklv9kQY.mjs.map} +1 -1
- package/dist/telemetry-DXHP3VVi.mjs +1 -0
- package/dist/type-source--ZNcV8RJ.mjs +2 -0
- package/dist/type-source--ZNcV8RJ.mjs.map +1 -0
- package/dist/types/executor.generated.d.mts +1 -1
- package/dist/user-agent-vdHYF3QL.mjs +2 -0
- package/dist/{user-agent-Bgsszb5I.mjs.map → user-agent-vdHYF3QL.mjs.map} +1 -1
- package/dist/utils/test/index.mjs +1 -109
- package/dist/utils/test/index.mjs.map +1 -1
- package/dist/vitest/environment.mjs +1 -41
- package/dist/vitest/environment.mjs.map +1 -1
- package/dist/vitest/index.mjs +1 -1986
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/mocks/file.d.mts +8 -8
- package/dist/vitest/setup.mjs +1 -140
- package/dist/vitest/setup.mjs.map +1 -1
- package/dist/wait-point-invoker-eiP-IIux.mjs +2 -0
- package/dist/wait-point-invoker-eiP-IIux.mjs.map +1 -0
- package/dist/wait-point-registry-B-ESkTZX.mjs +2 -0
- package/dist/wait-point-registry-B-ESkTZX.mjs.map +1 -0
- package/dist/workflow-Cs9ISw6j.mjs +2 -0
- package/dist/{workflow-Bamae_Yc.mjs.map → workflow-Cs9ISw6j.mjs.map} +1 -1
- package/dist/workspace_resource_pb--GeYQPXu.mjs +2 -0
- package/dist/{workspace_resource_pb-HNIL_Vfj.mjs.map → workspace_resource_pb--GeYQPXu.mjs.map} +1 -1
- package/docs/cli/function.md +66 -6
- package/docs/cli/setup.md +24 -14
- package/docs/cli/tailordb.md +2 -0
- package/docs/cli-reference.md +9 -8
- package/docs/github-actions.md +14 -12
- package/docs/migration/v2.md +18 -2
- package/docs/migration/v3.md +121 -0
- package/docs/plugin/custom.md +130 -85
- package/docs/plugin/index.md +3 -3
- package/docs/services/tailordb-migration.md +21 -7
- package/docs/services/tailordb.md +9 -7
- package/docs/services/workflow.md +10 -9
- package/package.json +14 -13
- package/postinstall.mjs +1 -1
- package/dist/aigateway-DR4Kwuik.mjs +0 -9
- package/dist/application-C8a0UJ-z.mjs +0 -6071
- package/dist/application-C8a0UJ-z.mjs.map +0 -1
- package/dist/application-D4zOiLLa.mjs +0 -3
- package/dist/assert-DBxo8jPo.mjs +0 -9
- package/dist/authconnection-CZvi9ANm.mjs +0 -9
- package/dist/brand-Eo4pLXPJ.mjs +0 -36
- package/dist/context-DYQVYWqZ.mjs +0 -23
- package/dist/crashreport-Cd4TqfZq.mjs +0 -3
- package/dist/crashreport-Q0pDAlrj.mjs +0 -427
- package/dist/errors-Bxut5_Sy.mjs +0 -89
- package/dist/errors-Bxut5_Sy.mjs.map +0 -1
- package/dist/file-BUcmVIH2.mjs +0 -58
- package/dist/file-BUcmVIH2.mjs.map +0 -1
- package/dist/globals-B2nlxBrz.mjs +0 -126
- package/dist/iconv-QWaZh0TT.mjs +0 -38
- package/dist/idp-RA_swu-h.mjs +0 -82
- package/dist/interceptor-e33JtsC-.mjs +0 -33
- package/dist/logger-BtX0suGY.mjs +0 -48
- package/dist/logger-D0bEznPv.mjs +0 -362
- package/dist/logger-D0bEznPv.mjs.map +0 -1
- package/dist/multiline-sfHpTZZK.mjs +0 -38
- package/dist/node-builtins-CmaL2Cbq.mjs +0 -36
- package/dist/package-json-8b0O9TlX.mjs +0 -17
- package/dist/package-json-Cv2Z-TqQ.mjs +0 -3
- package/dist/platform-serialize-RoRtBS0v.mjs +0 -46
- package/dist/plugin/builtin/kysely-type/index.mjs.map +0 -1
- package/dist/plugin/builtin/seed/types.d.mts +0 -2
- package/dist/register-ts-hook-Vqjza10T.mjs +0 -25679
- package/dist/register-ts-hook-Vqjza10T.mjs.map +0 -1
- package/dist/registry-BIGVUrMB.mjs +0 -54
- package/dist/repl-editor-F9LotMNx.mjs +0 -252
- package/dist/schema-D4TC4BC3.mjs +0 -640
- package/dist/schema-D4TC4BC3.mjs.map +0 -1
- package/dist/secret-file-C3J4Gy8r.mjs +0 -64
- package/dist/secretmanager-CYlpffsz.mjs +0 -13
- package/dist/secretmanager-IY4UvinW.mjs +0 -131
- package/dist/seed-Cibjmtry.mjs +0 -489
- package/dist/seed-Cibjmtry.mjs.map +0 -1
- package/dist/service-2grcAOCJ.mjs +0 -898
- package/dist/service-2grcAOCJ.mjs.map +0 -1
- package/dist/service-CaBPNDIZ.mjs +0 -3
- package/dist/service-LTfp03ZZ.mjs +0 -133
- package/dist/service_pb-BEWj1pOV.mjs +0 -167
- package/dist/service_pb-BjlhvK9E.mjs +0 -3
- package/dist/telemetry-BRVdwh14.mjs +0 -84
- package/dist/telemetry-CkbkeJxl.mjs +0 -3
- package/dist/type-source-DH_LH20p.mjs +0 -13
- package/dist/type-source-DH_LH20p.mjs.map +0 -1
- package/dist/user-agent-Bgsszb5I.mjs +0 -28
- package/dist/wait-point-invoker-__oE88_P.mjs +0 -148
- package/dist/wait-point-invoker-__oE88_P.mjs.map +0 -1
- package/dist/wait-point-registry-TL99zotw.mjs +0 -47
- package/dist/wait-point-registry-TL99zotw.mjs.map +0 -1
- package/dist/workflow-Bamae_Yc.mjs +0 -34
- package/dist/workspace_resource_pb-HNIL_Vfj.mjs +0 -860
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-BUcmVIH2.mjs","names":[],"sources":["../src/runtime/file.ts"],"sourcesContent":["/**\n * TailorDB file (BLOB) utilities.\n *\n * Thin typed wrapper around the platform-provided `tailordb.file` runtime API.\n * At runtime this delegates to `globalThis.tailordb.file`. Use `mockFile` from\n * `@tailor-platform/sdk/vitest` to mock these calls in unit tests.\n * @example\n * import { file } from \"@tailor-platform/sdk/runtime\";\n *\n * const { metadata } = await file.upload(\n * \"my-namespace\",\n * \"Document\",\n * \"attachment\",\n * recordId,\n * bytes,\n * );\n */\n\n/** Upload response metadata. */\nexport interface UploadMetadata {\n fileSize: number;\n sha256sum: string;\n}\n\n/** Download response metadata. */\nexport interface DownloadMetadata {\n contentType: string;\n fileSize: number;\n sha256sum: string;\n lastUploadedAt: string;\n}\n\n/** File metadata (for {@link TailorDBFileAPI.getMetadata}). */\nexport interface FileMetadata {\n contentType: string;\n fileSize: number;\n sha256sum: string;\n urlPath: string;\n lastUploadedAt?: string;\n}\n\n/** Upload options. */\nexport interface FileUploadOptions {\n contentType?: string;\n}\n\n/** Upload stream options. */\nexport interface FileUploadStreamOptions {\n contentType?: string;\n fileSize?: number;\n}\n\n/** Upload response. */\nexport interface FileUploadResponse {\n metadata: UploadMetadata;\n}\n\n/** Download response. */\nexport interface FileDownloadResponse {\n data: Uint8Array;\n metadata: DownloadMetadata;\n}\n\n/** Download-as-Base64 response. */\nexport interface FileDownloadAsBase64Response {\n data: string;\n metadata: DownloadMetadata;\n}\n\n/** Download stream response. */\nexport interface FileDownloadStreamResponse {\n body: ReadableStream<Uint8Array>;\n metadata: DownloadMetadata;\n}\n\n/** Error code emitted by {@link TailorDBFileError}. */\nexport type TailorDBFileErrorCode =\n | \"INVALID_PARAMS\"\n | \"INVALID_DATA_TYPE\"\n | \"OPERATION_FAILED\"\n | \"DELETE_FAILED\"\n | \"STREAM_OPEN_FAILED\"\n | \"STREAM_READ_ERROR\"\n | \"STREAM_ERROR\"\n | \"FILE_TOO_LARGE\";\n\n/**\n * Type-only shape of the `TailorDBFileError` runtime class. The class itself\n * is provided by the platform runtime (and by `injectMocks` in tests); this\n * interface mirrors it so callers can `import type { TailorDBFileError }` from\n * the wrapper module without depending on any ambient declaration.\n */\nexport interface TailorDBFileError extends Error {\n name: \"TailorDBFileError\";\n code?: TailorDBFileErrorCode;\n cause?: unknown;\n}\n\n/**\n * Platform API surface for `tailordb.file`. Describes the shape the platform\n * runtime injects on `globalThis.tailordb.file`.\n */\nexport interface TailorDBFileAPI {\n /**\n * Upload a file to TailorDB.\n * @param namespace - TailorDB namespace\n * @param typeName - TailorDB table name\n * @param fieldName - File field name on the table\n * @param recordId - Record ID owning the field\n * @param data - File contents\n * @param options - Upload options (e.g. `contentType`)\n * @returns Upload response containing the file metadata\n */\n upload(\n namespace: string,\n typeName: string,\n fieldName: string,\n recordId: string,\n data: string | ArrayBuffer | Uint8Array | number[],\n options?: FileUploadOptions,\n ): Promise<FileUploadResponse>;\n\n /**\n * Download a file from TailorDB.\n *\n * Throws `TailorDBFileError` with code `FILE_TOO_LARGE` when the file\n * exceeds 10MB — use {@link downloadStream} for large files.\n * @param namespace - TailorDB namespace\n * @param typeName - TailorDB table name\n * @param fieldName - File field name on the table\n * @param recordId - Record ID owning the field\n * @returns Bytes and metadata for the file\n */\n download(\n namespace: string,\n typeName: string,\n fieldName: string,\n recordId: string,\n ): Promise<FileDownloadResponse>;\n\n /**\n * Download a file from TailorDB as a Base64-encoded string.\n *\n * Throws `TailorDBFileError` with code `FILE_TOO_LARGE` when the file\n * exceeds 10MB — use {@link downloadStream} for large files.\n * @param namespace - TailorDB namespace\n * @param typeName - TailorDB table name\n * @param fieldName - File field name on the table\n * @param recordId - Record ID owning the field\n * @returns Base64-encoded contents and metadata for the file\n */\n downloadAsBase64(\n namespace: string,\n typeName: string,\n fieldName: string,\n recordId: string,\n ): Promise<FileDownloadAsBase64Response>;\n\n /**\n * Delete a file from TailorDB.\n * @param namespace - TailorDB namespace\n * @param typeName - TailorDB table name\n * @param fieldName - File field name on the table\n * @param recordId - Record ID owning the field\n * @returns Resolves once the file has been deleted\n */\n delete(namespace: string, typeName: string, fieldName: string, recordId: string): Promise<void>;\n\n /**\n * Get file metadata from TailorDB.\n * @param namespace - TailorDB namespace\n * @param typeName - TailorDB table name\n * @param fieldName - File field name on the table\n * @param recordId - Record ID owning the field\n * @returns Metadata for the stored file\n */\n getMetadata(\n namespace: string,\n typeName: string,\n fieldName: string,\n recordId: string,\n ): Promise<FileMetadata>;\n\n /**\n * Download a file as a ReadableStream.\n * @param namespace - TailorDB namespace\n * @param typeName - TailorDB table name\n * @param fieldName - File field name on the table\n * @param recordId - Record ID owning the field\n * @returns ReadableStream body and metadata for the file\n */\n downloadStream(\n namespace: string,\n typeName: string,\n fieldName: string,\n recordId: string,\n ): Promise<FileDownloadStreamResponse>;\n\n /**\n * Upload a file using a ReadableStream.\n * @param namespace - TailorDB namespace\n * @param typeName - TailorDB table name\n * @param fieldName - File field name on the table\n * @param recordId - Record ID owning the field\n * @param readableStream - ReadableStream providing the file data\n * @param options - Upload stream options (e.g. `contentType`, `fileSize`)\n * @returns Upload response containing the file metadata\n */\n uploadStream(\n namespace: string,\n typeName: string,\n fieldName: string,\n recordId: string,\n readableStream: ReadableStream<Uint8Array | ArrayBuffer>,\n options?: FileUploadStreamOptions,\n ): Promise<FileUploadResponse>;\n}\n\nconst api = (): TailorDBFileAPI =>\n (globalThis as unknown as { tailordb: { file: TailorDBFileAPI } }).tailordb.file;\n\n/**\n * See {@link TailorDBFileAPI.upload}.\n * @param args - Forwarded to {@link TailorDBFileAPI.upload}\n * @returns Upload response containing the file metadata\n */\nconst upload: TailorDBFileAPI[\"upload\"] = (...args) => api().upload(...args);\n\n/**\n * See {@link TailorDBFileAPI.download}.\n * @param args - Forwarded to {@link TailorDBFileAPI.download}\n * @returns Bytes and metadata for the file\n */\nconst download: TailorDBFileAPI[\"download\"] = (...args) => api().download(...args);\n\n/**\n * See {@link TailorDBFileAPI.downloadAsBase64}.\n * @param args - Forwarded to {@link TailorDBFileAPI.downloadAsBase64}\n * @returns Base64-encoded contents and metadata for the file\n */\nconst downloadAsBase64: TailorDBFileAPI[\"downloadAsBase64\"] = (...args) =>\n api().downloadAsBase64(...args);\n\n/**\n * See {@link TailorDBFileAPI.delete}.\n * @param args - Forwarded to {@link TailorDBFileAPI.delete}\n * @returns Resolves once the file has been deleted\n */\nconst deleteFile: TailorDBFileAPI[\"delete\"] = (...args) => api().delete(...args);\n\n/**\n * See {@link TailorDBFileAPI.getMetadata}.\n * @param args - Forwarded to {@link TailorDBFileAPI.getMetadata}\n * @returns Metadata for the stored file\n */\nconst getMetadata: TailorDBFileAPI[\"getMetadata\"] = (...args) => api().getMetadata(...args);\n\n/**\n * See {@link TailorDBFileAPI.downloadStream}.\n * @param args - Forwarded to {@link TailorDBFileAPI.downloadStream}\n * @returns ReadableStream body and metadata for the file\n */\nconst downloadStream: TailorDBFileAPI[\"downloadStream\"] = (...args) =>\n api().downloadStream(...args);\n\n/**\n * See {@link TailorDBFileAPI.uploadStream}.\n * @param args - Forwarded to {@link TailorDBFileAPI.uploadStream}\n * @returns Upload response containing the file metadata\n */\nconst uploadStream: TailorDBFileAPI[\"uploadStream\"] = (...args) => api().uploadStream(...args);\n\n/** Runtime wrapper namespace for `tailordb.file`. */\nexport const file = {\n upload,\n download,\n downloadAsBase64,\n delete: deleteFile,\n getMetadata,\n downloadStream,\n uploadStream,\n} as const satisfies TailorDBFileAPI;\n"],"mappings":";AA0NA,MAAM,YACH,WAAkE,SAAS;;;;;;AAO9E,MAAM,UAAqC,GAAG,SAAS,IAAI,CAAC,CAAC,OAAO,GAAG,IAAI;;;;;;AAO3E,MAAM,YAAyC,GAAG,SAAS,IAAI,CAAC,CAAC,SAAS,GAAG,IAAI;;;;;;AAOjF,MAAM,oBAAyD,GAAG,SAChE,IAAI,CAAC,CAAC,iBAAiB,GAAG,IAAI;;;;;;AAOhC,MAAM,cAAyC,GAAG,SAAS,IAAI,CAAC,CAAC,OAAO,GAAG,IAAI;;;;;;AAO/E,MAAM,eAA+C,GAAG,SAAS,IAAI,CAAC,CAAC,YAAY,GAAG,IAAI;;;;;;AAO1F,MAAM,kBAAqD,GAAG,SAC5D,IAAI,CAAC,CAAC,eAAe,GAAG,IAAI;;;;;;AAO9B,MAAM,gBAAiD,GAAG,SAAS,IAAI,CAAC,CAAC,aAAa,GAAG,IAAI;;AAG7F,MAAa,OAAO;CAClB;CACA;CACA;CACA,QAAQ;CACR;CACA;CACA;AACF"}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { t as START_DEFAULT } from "./registry-BIGVUrMB.mjs";
|
|
2
|
-
import { t as platformSerialize } from "./platform-serialize-RoRtBS0v.mjs";
|
|
3
|
-
|
|
4
|
-
//#region src/vitest/workflow-runtime.ts
|
|
5
|
-
function createDefaultWorkflowRuntime() {
|
|
6
|
-
const execJobFunction = (name) => {
|
|
7
|
-
throw new Error(`No workflow job mock for "${name}". Acquire mockWorkflow() and call setJobHandler(...) or enqueueResult(...), or use runWorkflowLocally() for local workflow execution.`);
|
|
8
|
-
};
|
|
9
|
-
const startWorkflow = async (_name, args) => {
|
|
10
|
-
platformSerialize(args);
|
|
11
|
-
return START_DEFAULT;
|
|
12
|
-
};
|
|
13
|
-
const resumeWorkflowExecution = async (executionId) => executionId;
|
|
14
|
-
return {
|
|
15
|
-
execJobFunction,
|
|
16
|
-
startWorkflow,
|
|
17
|
-
resumeWorkflowExecution,
|
|
18
|
-
wait: (key) => {
|
|
19
|
-
throw new Error(`No wait handler for "${key}". Acquire mockWorkflow() and call setWaitHandler(...).`);
|
|
20
|
-
},
|
|
21
|
-
resolve: async () => {
|
|
22
|
-
throw new Error("No resolve handler. Acquire mockWorkflow() and call setResolveHandler(...).");
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
//#region src/vitest/globals.ts
|
|
29
|
-
/**
|
|
30
|
-
* Base platform globals for the tailor-runtime test environment.
|
|
31
|
-
*
|
|
32
|
-
* This module is intentionally free of any `vitest` (`vi`) dependency so it can
|
|
33
|
-
* be imported from the Vitest *environment* module (which runs in a realm where
|
|
34
|
-
* `vi` is not available). It installs only the always-present structural pieces:
|
|
35
|
-
*
|
|
36
|
-
* - `globalThis.tailor` / `globalThis.tailordb` container objects
|
|
37
|
-
* - `globalThis.tailor.context.getInvoker` default stub
|
|
38
|
-
* - the platform error classes (`TailorErrors`,
|
|
39
|
-
* `TailorDBFileError`)
|
|
40
|
-
* - the `__tailorRuntimeActive` sentinel flag
|
|
41
|
-
*
|
|
42
|
-
* The per-namespace mock behavior (TailorDB client, workflow, secretmanager, …)
|
|
43
|
-
* is installed on demand by the `xMock()` factories in `./mock`, which run in
|
|
44
|
-
* test context where `vi` *is* available.
|
|
45
|
-
*/
|
|
46
|
-
const RUNTIME_FLAG_KEY = "__tailorRuntimeActive";
|
|
47
|
-
var TailorErrorsMock = class extends Error {
|
|
48
|
-
errors;
|
|
49
|
-
constructor(errors) {
|
|
50
|
-
if (!Array.isArray(errors)) throw new TypeError("TailorErrors: errors must be an array");
|
|
51
|
-
const validated = errors.map((e, i) => {
|
|
52
|
-
if (typeof e.message !== "string") throw new TypeError(`TailorErrors: errors[${i}].message must be a string`);
|
|
53
|
-
if (!Array.isArray(e.path)) throw new TypeError(`TailorErrors: errors[${i}].path must be an array`);
|
|
54
|
-
return {
|
|
55
|
-
message: e.message,
|
|
56
|
-
path: e.path
|
|
57
|
-
};
|
|
58
|
-
});
|
|
59
|
-
super(`TailorErrors: ${JSON.stringify({ errors: validated })}`);
|
|
60
|
-
this.name = "TailorErrors";
|
|
61
|
-
this.errors = validated;
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
var TailorDBFileErrorMock = class extends Error {
|
|
65
|
-
code;
|
|
66
|
-
cause;
|
|
67
|
-
constructor(message, code, cause) {
|
|
68
|
-
super(message);
|
|
69
|
-
this.name = "TailorDBFileError";
|
|
70
|
-
this.code = code;
|
|
71
|
-
this.cause = cause;
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
function defaultGetInvoker() {
|
|
75
|
-
return null;
|
|
76
|
-
}
|
|
77
|
-
function noop() {}
|
|
78
|
-
const defaultLogger = {
|
|
79
|
-
debug: noop,
|
|
80
|
-
info: noop,
|
|
81
|
-
warn: noop,
|
|
82
|
-
error: noop,
|
|
83
|
-
setAttributes: noop
|
|
84
|
-
};
|
|
85
|
-
/**
|
|
86
|
-
* Install the always-present base platform globals (containers, context stub,
|
|
87
|
-
* error classes, runtime flag). Per-namespace mocks are layered on top by the
|
|
88
|
-
* `xMock()` factories in `./mock`.
|
|
89
|
-
*
|
|
90
|
-
* Acquire with a `using` declaration and the globals are removed when the
|
|
91
|
-
* scope exits; alternatively call `cleanupPlatformGlobals` yourself.
|
|
92
|
-
* @param global - The global object to install into (typically `globalThis`)
|
|
93
|
-
* @returns A `Disposable` that removes the installed globals
|
|
94
|
-
*/
|
|
95
|
-
function installPlatformGlobals(global) {
|
|
96
|
-
const g = global;
|
|
97
|
-
g[RUNTIME_FLAG_KEY] = true;
|
|
98
|
-
g.tailor = {
|
|
99
|
-
context: { getInvoker: defaultGetInvoker },
|
|
100
|
-
workflow: createDefaultWorkflowRuntime(),
|
|
101
|
-
logger: { ...defaultLogger }
|
|
102
|
-
};
|
|
103
|
-
g.tailordb = {};
|
|
104
|
-
g.TailorErrors = TailorErrorsMock;
|
|
105
|
-
g.TailorDBFileError = TailorDBFileErrorMock;
|
|
106
|
-
return { [Symbol.dispose]() {
|
|
107
|
-
cleanupPlatformGlobals(global);
|
|
108
|
-
} };
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Remove the base platform globals (and anything the namespace mocks layered on
|
|
112
|
-
* top, since they live under the same containers).
|
|
113
|
-
* @param global - The global object to clean up (typically `globalThis`)
|
|
114
|
-
*/
|
|
115
|
-
function cleanupPlatformGlobals(global) {
|
|
116
|
-
const g = global;
|
|
117
|
-
delete g.tailordb;
|
|
118
|
-
delete g.tailor;
|
|
119
|
-
delete g.TailorErrors;
|
|
120
|
-
delete g.TailorDBFileError;
|
|
121
|
-
delete g[RUNTIME_FLAG_KEY];
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
//#endregion
|
|
125
|
-
export { cleanupPlatformGlobals as n, installPlatformGlobals as r, RUNTIME_FLAG_KEY as t };
|
|
126
|
-
//# sourceMappingURL=globals-B2nlxBrz.mjs.map
|
package/dist/iconv-QWaZh0TT.mjs
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
//#region src/runtime/iconv.ts
|
|
2
|
-
const api = () => globalThis.tailor.iconv;
|
|
3
|
-
const convert = (...args) => api().convert(...args);
|
|
4
|
-
const convertBuffer = (...args) => api().convertBuffer(...args);
|
|
5
|
-
const decode = (...args) => api().decode(...args);
|
|
6
|
-
const encode = (...args) => api().encode(...args);
|
|
7
|
-
const encodings = () => api().encodings();
|
|
8
|
-
/**
|
|
9
|
-
* Stateful converter for repeated conversions between a fixed encoding pair.
|
|
10
|
-
* Compatible with the `node-iconv` API surface.
|
|
11
|
-
*/
|
|
12
|
-
var Iconv = class {
|
|
13
|
-
impl;
|
|
14
|
-
constructor(fromEncoding, toEncoding) {
|
|
15
|
-
this.impl = new (api()).Iconv(fromEncoding, toEncoding);
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Convert input using this converter's fixed encoding pair.
|
|
19
|
-
* @param input - Bytes or string to convert
|
|
20
|
-
* @returns Encoded output (string for UTF-8 targets, otherwise `Uint8Array`).
|
|
21
|
-
*/
|
|
22
|
-
convert(input) {
|
|
23
|
-
return this.impl.convert(input);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
/** Runtime API for `tailor.iconv`. */
|
|
27
|
-
const iconv = {
|
|
28
|
-
convert,
|
|
29
|
-
convertBuffer,
|
|
30
|
-
decode,
|
|
31
|
-
encode,
|
|
32
|
-
encodings,
|
|
33
|
-
Iconv
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
//#endregion
|
|
37
|
-
export { iconv as t };
|
|
38
|
-
//# sourceMappingURL=iconv-QWaZh0TT.mjs.map
|
package/dist/idp-RA_swu-h.mjs
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
//#region src/runtime/idp.ts
|
|
2
|
-
/**
|
|
3
|
-
* IDP Client for user management operations.
|
|
4
|
-
*
|
|
5
|
-
* Wraps the platform-provided `tailor.idp.Client` and exposes the same surface.
|
|
6
|
-
*/
|
|
7
|
-
var Client = class {
|
|
8
|
-
#impl;
|
|
9
|
-
constructor(config) {
|
|
10
|
-
this.#impl = new globalThis.tailor.idp.Client(config);
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* List users in the namespace with optional filtering and pagination.
|
|
14
|
-
* @param options - Pagination and filter options
|
|
15
|
-
* @returns Page of users with `nextPageToken` and `totalCount`
|
|
16
|
-
*/
|
|
17
|
-
users(options) {
|
|
18
|
-
return this.#impl.users(options);
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Get a user by ID.
|
|
22
|
-
* @param userId - IDP user ID
|
|
23
|
-
* @returns The matching user
|
|
24
|
-
*/
|
|
25
|
-
user(userId) {
|
|
26
|
-
return this.#impl.user(userId);
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Get a user by name.
|
|
30
|
-
* @param name - IDP user name
|
|
31
|
-
* @returns The matching user
|
|
32
|
-
*/
|
|
33
|
-
userByName(name) {
|
|
34
|
-
return this.#impl.userByName(name);
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Create a new user.
|
|
38
|
-
* @param input - User attributes
|
|
39
|
-
* @returns The newly created user
|
|
40
|
-
*/
|
|
41
|
-
createUser(input) {
|
|
42
|
-
return this.#impl.createUser(input);
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Update an existing user.
|
|
46
|
-
* @param input - User ID plus attributes to update
|
|
47
|
-
* @returns The updated user
|
|
48
|
-
*/
|
|
49
|
-
updateUser(input) {
|
|
50
|
-
return this.#impl.updateUser(input);
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Delete a user by ID.
|
|
54
|
-
* @param userId - IDP user ID
|
|
55
|
-
* @returns `true` when the user was deleted
|
|
56
|
-
*/
|
|
57
|
-
deleteUser(userId) {
|
|
58
|
-
return this.#impl.deleteUser(userId);
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Send a password reset email to a user.
|
|
62
|
-
* @param input - Target user ID and redirect URI
|
|
63
|
-
* @returns `true` when the email was queued
|
|
64
|
-
*/
|
|
65
|
-
sendPasswordResetEmail(input) {
|
|
66
|
-
return this.#impl.sendPasswordResetEmail(input);
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Unenroll an MFA factor from a user.
|
|
70
|
-
* @param input - Target user ID and factor ID (see {@link User.mfaFactorIds})
|
|
71
|
-
* @returns `true` when the factor was removed
|
|
72
|
-
*/
|
|
73
|
-
unenrollMfa(input) {
|
|
74
|
-
return this.#impl.unenrollMfa(input);
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
/** Runtime API for `tailor.idp`. */
|
|
78
|
-
const idp = { Client };
|
|
79
|
-
|
|
80
|
-
//#endregion
|
|
81
|
-
export { idp as t };
|
|
82
|
-
//# sourceMappingURL=idp-RA_swu-h.mjs.map
|
|
@@ -1,33 +0,0 @@
|
|
|
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").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-e33JtsC-.mjs.map
|
package/dist/logger-BtX0suGY.mjs
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
//#region src/runtime/logger.ts
|
|
2
|
-
/**
|
|
3
|
-
* See {@link TailorLoggerAPI.debug}.
|
|
4
|
-
* @param args - Forwarded to {@link TailorLoggerAPI.debug}
|
|
5
|
-
*/
|
|
6
|
-
const debug = (...args) => {
|
|
7
|
-
globalThis.tailor.logger.debug(...args);
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* See {@link TailorLoggerAPI.info}.
|
|
11
|
-
* @param args - Forwarded to {@link TailorLoggerAPI.info}
|
|
12
|
-
*/
|
|
13
|
-
const info = (...args) => {
|
|
14
|
-
globalThis.tailor.logger.info(...args);
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* See {@link TailorLoggerAPI.warn}.
|
|
18
|
-
* @param args - Forwarded to {@link TailorLoggerAPI.warn}
|
|
19
|
-
*/
|
|
20
|
-
const warn = (...args) => {
|
|
21
|
-
globalThis.tailor.logger.warn(...args);
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* See {@link TailorLoggerAPI.error}.
|
|
25
|
-
* @param args - Forwarded to {@link TailorLoggerAPI.error}
|
|
26
|
-
*/
|
|
27
|
-
const error = (...args) => {
|
|
28
|
-
globalThis.tailor.logger.error(...args);
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* See {@link TailorLoggerAPI.setAttributes}.
|
|
32
|
-
* @param args - Forwarded to {@link TailorLoggerAPI.setAttributes}
|
|
33
|
-
*/
|
|
34
|
-
const setAttributes = (...args) => {
|
|
35
|
-
globalThis.tailor.logger.setAttributes(...args);
|
|
36
|
-
};
|
|
37
|
-
/** `tailor.logger` API object. See {@link TailorLoggerAPI} for method docs. */
|
|
38
|
-
const logger = {
|
|
39
|
-
debug,
|
|
40
|
-
info,
|
|
41
|
-
warn,
|
|
42
|
-
error,
|
|
43
|
-
setAttributes
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
//#endregion
|
|
47
|
-
export { setAttributes as a, logger as i, error as n, warn as o, info as r, debug as t };
|
|
48
|
-
//# sourceMappingURL=logger-BtX0suGY.mjs.map
|