@tailor-platform/sdk 1.78.0 → 1.79.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 (46) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/application-BB6BlUfk.mjs +3 -0
  3. package/dist/{application-CUxVA7Fs.mjs → application-fjqb-Gh8.mjs} +50 -3
  4. package/dist/application-fjqb-Gh8.mjs.map +1 -0
  5. package/dist/cli/index.mjs +13 -35
  6. package/dist/cli/index.mjs.map +1 -1
  7. package/dist/cli/lib.mjs +2 -2
  8. package/dist/completion/zsh-worker.zsh +1 -1
  9. package/dist/configure/index.mjs +7 -6
  10. package/dist/configure/index.mjs.map +1 -1
  11. package/dist/configure/services/tailordb/schema.d.mts +1 -7
  12. package/dist/configure/services/workflow/execution-policy.d.mts +2 -2
  13. package/dist/configure/types/type.d.mts +1 -9
  14. package/dist/{globals-CvizbGLY.mjs → globals-B-n_3uYu.mjs} +11 -5
  15. package/dist/globals-B-n_3uYu.mjs.map +1 -0
  16. package/dist/{registry-CYBRvfaU.mjs → registry-CXi7rJq7.mjs} +3 -2
  17. package/dist/registry-CXi7rJq7.mjs.map +1 -0
  18. package/dist/runtime/field-parse.d.mts +11 -0
  19. package/dist/runtime/globals.d.mts +4 -1
  20. package/dist/runtime/index.mjs +1 -1
  21. package/dist/runtime/workflow.d.mts +79 -15
  22. package/dist/runtime/workflow.mjs +2 -2
  23. package/dist/{runtime-BD2vYJFT.mjs → runtime-CjMeYuPA.mjs} +4 -4
  24. package/dist/{runtime-BD2vYJFT.mjs.map → runtime-CjMeYuPA.mjs.map} +1 -1
  25. package/dist/{schema-U6DxoZ8D.mjs → schema-CYrle8JZ.mjs} +42 -24
  26. package/dist/schema-CYrle8JZ.mjs.map +1 -0
  27. package/dist/vitest/environment.mjs +1 -1
  28. package/dist/vitest/index.mjs +36 -10
  29. package/dist/vitest/index.mjs.map +1 -1
  30. package/dist/vitest/mocks/workflow.d.mts +29 -15
  31. package/dist/vitest/setup.mjs +1 -1
  32. package/dist/workflow-CkIDJpdg.mjs +69 -0
  33. package/dist/workflow-CkIDJpdg.mjs.map +1 -0
  34. package/docs/runtime.md +2 -2
  35. package/docs/services/tailordb.md +2 -0
  36. package/docs/services/workflow.md +2 -2
  37. package/docs/testing.md +2 -2
  38. package/package.json +1 -1
  39. package/dist/application-CUxVA7Fs.mjs.map +0 -1
  40. package/dist/application-Dp_-ioiP.mjs +0 -3
  41. package/dist/configure/types/field-runtime.d.mts +0 -17
  42. package/dist/globals-CvizbGLY.mjs.map +0 -1
  43. package/dist/registry-CYBRvfaU.mjs.map +0 -1
  44. package/dist/schema-U6DxoZ8D.mjs.map +0 -1
  45. package/dist/workflow-DSwnYPPP.mjs +0 -45
  46. package/dist/workflow-DSwnYPPP.mjs.map +0 -1
@@ -1,9 +1,10 @@
1
1
  #!/usr/bin/env node
2
+ import { r as parseInputFields } from "../schema-CYrle8JZ.mjs";
2
3
  import { St as AuthInvokerSchema, T as CustomDomainStatus, U as FunctionExecution_Type, kt as PATScope } from "../workspace_resource_pb-Db3fv68L.mjs";
3
4
  import { t as assertDefined } from "../assert-DBxo8jPo.mjs";
4
5
  import { n as logger, r as styles } from "../logger-BwS4ppwO.mjs";
5
- import { $n as deploymentArgs, $t as handleOptionalToRequiredError, An as generateUserTypes, At as startCommand, Bn as loadConsoleBaseUrl, Ct as listCommand$7, Dn as resourceTrn, Dt as jobsCommand, E as listCommand$13, En as getNamespacesWithMigrations, F as openInConfiguredEditor, Fn as deleteUserTokens, G as treeCommand, Gn as readPlatformConfig, H as updateCommand$3, Hn as loadStoredUserTokens, Ht as listCommand$16, In as fetchLatestToken, J as getCommand$5, Jn as writePlatformConfig, Jt as ensureConfigId, K as listCommand$12, Kn as resolveUserTokenKey, Kt as formatKeyValueTable, L as showCommand, Ln as hasAnyUserTokenEntry, Lt as functionExecutionStatusToString, M as generateMigrationScript, Mn as apiCall, Mt as getCommand$6, N as writeDbTypesFile, Nn as assertWritable, On as sdkNameLabelKey, P as getConfiguredEditorCommand, Pn as loadConfig, Pt as executionsCommand, Q as listCommand$11, Qn as confirmationArgs, Qt as MIGRATION_LABEL_KEY, R as extractOwnedNamespaces, Rn as hasUserTokenEntry, Rt as getCommand$1, S as waitCommand, Sn as parseMigrationNumberArg, Tn as hasChanges, Un as loadWorkspaceId, V as removeCommand$1, Vn as loadMachineUserName, Vt as deployFromCLI, Wn as platformConfigFromProfile, Wt as createCommand$4, X as updateCommand$2, Xn as commonArgs, Yn as defineAppCommand, Yt as executeScript, Zn as configArg, _t as getCommand$2, ar as toPageDirection, bn as reconstructSnapshotFromMigrations, bt as webhookCommand, c as listCommand$15, ct as getCommand$3, dt as tokenCommand, en as parseMigrationLabelNumber, er as isVerbose, et as getCommand$4, f as restoreCommand, fn as createSnapshotFromLocalTypes, ft as listCommand$9, g as deleteCommand$5, gn as getMigrationFiles, hn as getMigrationFilePath, ht as listCommand$8, i as updateCommand$4, ir as resolveMachineUserInputSource, it as createCommand$3, j as generateCommand$1, jn as prompt, k as truncateCommand, kn as PluginManager, ln as assertValidMigrationFiles, m as getCommand$7, mt as generate, nn as generateAllTypeManifestsFromSnapshot, nr as pagedLogArgs, nt as deleteCommand$4, o as removeCommand, on as INITIAL_SCHEMA_NUMBER, or as workspaceArgs, ot as listCommand$10, pn as getLatestMigrationNumber, qn as saveUserTokens, qt as workspaceNameSchema, r as queryCommand, rn as protoGqlPermission, rr as paginationArgs, t as isNativeTypeScriptRuntime, tn as compareSnapshotWithRemote, tr as multiConfigArg, u as inviteCommand, un as compareLocalTypesWithSnapshot, vn as isValidMigrationNumber, w as resumeCommand, wn as formatMigrationDiff, x as healthCommand, xn as formatMigrationNumber, xt as triggerCommand, y as listCommand$14, yn as loadDiff, z as logBetaWarning, zn as loadAccessToken } from "../runtime-BD2vYJFT.mjs";
6
- import { A as fetchAllTolerant, B as initOperatorClient, D as closeConnectionPool, L as getOrNull, M as fetchPaged, N as fetchPlatformMachineUserToken, O as defaultPlatformBaseUrl, P as fetchUserInfo, T as hashContent$1, V as isDefaultPlatform, _ as platformBundleDefinePlugin, a as resolveInlineSourcemap, b as resolveBundleLogLevel, c as ResolverSchema, k as fetchAll, s as WorkflowJobSchema, t as defineApplication, u as INVOKER_EXPR, v as composeFunctionTreeshakeOptions, w as getDistDir, y as createLogLevelTreeshakeOptions, z as initOAuth2Client } from "../application-CUxVA7Fs.mjs";
6
+ import { $n as deploymentArgs, $t as handleOptionalToRequiredError, An as generateUserTypes, At as startCommand, Bn as loadConsoleBaseUrl, Ct as listCommand$7, Dn as resourceTrn, Dt as jobsCommand, E as listCommand$13, En as getNamespacesWithMigrations, F as openInConfiguredEditor, Fn as deleteUserTokens, G as treeCommand, Gn as readPlatformConfig, H as updateCommand$3, Hn as loadStoredUserTokens, Ht as listCommand$16, In as fetchLatestToken, J as getCommand$5, Jn as writePlatformConfig, Jt as ensureConfigId, K as listCommand$12, Kn as resolveUserTokenKey, Kt as formatKeyValueTable, L as showCommand, Ln as hasAnyUserTokenEntry, Lt as functionExecutionStatusToString, M as generateMigrationScript, Mn as apiCall, Mt as getCommand$6, N as writeDbTypesFile, Nn as assertWritable, On as sdkNameLabelKey, P as getConfiguredEditorCommand, Pn as loadConfig, Pt as executionsCommand, Q as listCommand$11, Qn as confirmationArgs, Qt as MIGRATION_LABEL_KEY, R as extractOwnedNamespaces, Rn as hasUserTokenEntry, Rt as getCommand$1, S as waitCommand, Sn as parseMigrationNumberArg, Tn as hasChanges, Un as loadWorkspaceId, V as removeCommand$1, Vn as loadMachineUserName, Vt as deployFromCLI, Wn as platformConfigFromProfile, Wt as createCommand$4, X as updateCommand$2, Xn as commonArgs, Yn as defineAppCommand, Yt as executeScript, Zn as configArg, _t as getCommand$2, ar as toPageDirection, bn as reconstructSnapshotFromMigrations, bt as webhookCommand, c as listCommand$15, ct as getCommand$3, dt as tokenCommand, en as parseMigrationLabelNumber, er as isVerbose, et as getCommand$4, f as restoreCommand, fn as createSnapshotFromLocalTypes, ft as listCommand$9, g as deleteCommand$5, gn as getMigrationFiles, hn as getMigrationFilePath, ht as listCommand$8, i as updateCommand$4, ir as resolveMachineUserInputSource, it as createCommand$3, j as generateCommand$1, jn as prompt, k as truncateCommand, kn as PluginManager, ln as assertValidMigrationFiles, m as getCommand$7, mt as generate, nn as generateAllTypeManifestsFromSnapshot, nr as pagedLogArgs, nt as deleteCommand$4, o as removeCommand, on as INITIAL_SCHEMA_NUMBER, or as workspaceArgs, ot as listCommand$10, pn as getLatestMigrationNumber, qn as saveUserTokens, qt as workspaceNameSchema, r as queryCommand, rn as protoGqlPermission, rr as paginationArgs, t as isNativeTypeScriptRuntime, tn as compareSnapshotWithRemote, tr as multiConfigArg, u as inviteCommand, un as compareLocalTypesWithSnapshot, vn as isValidMigrationNumber, w as resumeCommand, wn as formatMigrationDiff, x as healthCommand, xn as formatMigrationNumber, xt as triggerCommand, y as listCommand$14, yn as loadDiff, z as logBetaWarning, zn as loadAccessToken } from "../runtime-CjMeYuPA.mjs";
7
+ import { A as fetchAllTolerant, B as initOperatorClient, D as closeConnectionPool, L as getOrNull, M as fetchPaged, N as fetchPlatformMachineUserToken, O as defaultPlatformBaseUrl, P as fetchUserInfo, T as hashContent$1, V as isDefaultPlatform, _ as platformBundleDefinePlugin, a as resolveInlineSourcemap, b as resolveBundleLogLevel, c as ResolverSchema, k as fetchAll, s as WorkflowJobSchema, t as defineApplication, u as INVOKER_EXPR, v as composeFunctionTreeshakeOptions, w as getDistDir, y as createLogLevelTreeshakeOptions, z as initOAuth2Client } from "../application-fjqb-Gh8.mjs";
7
8
  import { n as ExecutorSchema } from "../service-D12iQGcS.mjs";
8
9
  import { t as multiline } from "../multiline-sfHpTZZK.mjs";
9
10
  import { t as isPluginGeneratedType } from "../type-source-DH_LH20p.mjs";
@@ -1023,35 +1024,6 @@ const crashReportCommand = defineCommand({
1023
1024
  }
1024
1025
  });
1025
1026
 
1026
- //#endregion
1027
- //#region src/parser/service/resolver/local-input-parser.ts
1028
- /**
1029
- * Build a local, in-process validator for a resolver's declared input fields.
1030
- * Each field already carries its own bound `_parseInternal` (attached when the
1031
- * user's resolver module was loaded via dynamic import), so this only needs to
1032
- * orchestrate calling every field and collecting issues.
1033
- * @param fields - Resolver's raw input field definitions (already-built TailorField instances)
1034
- * @returns An object exposing a `.parse()` method for local format detection
1035
- */
1036
- function buildLocalInputParser(fields) {
1037
- return { parse(args) {
1038
- const { value, data, user } = args;
1039
- if (typeof value !== "object" || value === null || Array.isArray(value) || value instanceof Date) return { issues: [{ message: `Expected an object: received ${String(value)}` }] };
1040
- const record = value;
1041
- const issues = [];
1042
- for (const [name, field] of Object.entries(fields)) {
1043
- const result = field._parseInternal({
1044
- value: record[name],
1045
- data,
1046
- user,
1047
- pathArray: [name]
1048
- });
1049
- if (result.issues) issues.push(...result.issues);
1050
- }
1051
- return issues.length > 0 ? { issues } : {};
1052
- } };
1053
- }
1054
-
1055
1027
  //#endregion
1056
1028
  //#region src/cli/commands/deploy/index.ts
1057
1029
  const deployCommand$1 = defineAppCommand({
@@ -1893,7 +1865,13 @@ async function detectFunctionType(options) {
1893
1865
  if (resolverResult.success) {
1894
1866
  const rawInput = module.default.input;
1895
1867
  let inputSchema;
1896
- if (rawInput) inputSchema = buildLocalInputParser(rawInput);
1868
+ if (rawInput) {
1869
+ const fields = rawInput;
1870
+ inputSchema = { parse: (args) => parseInputFields({
1871
+ ...args,
1872
+ fields
1873
+ }) };
1874
+ }
1897
1875
  return {
1898
1876
  type: "resolver",
1899
1877
  name: resolverResult.data.name,
@@ -2225,7 +2203,7 @@ function resolveResolverArg(argStr, inputSchema, machineUser, workspaceId) {
2225
2203
  id: machineUser.id,
2226
2204
  type: "machine_user",
2227
2205
  workspaceId,
2228
- attributes: machineUser.attributes ?? null,
2206
+ attributes: machineUser.attributes,
2229
2207
  attributeList: machineUser.attributeList
2230
2208
  };
2231
2209
  if (!inputSchema.parse({
@@ -2233,7 +2211,7 @@ function resolveResolverArg(argStr, inputSchema, machineUser, workspaceId) {
2233
2211
  data: parsed,
2234
2212
  user
2235
2213
  }).issues) return argStr;
2236
- if (Object.keys(parsed).length === 1 && parsed.input != null && typeof parsed.input === "object" && !Array.isArray(parsed.input)) {
2214
+ if (typeof parsed === "object" && parsed !== null && Object.keys(parsed).length === 1 && parsed.input != null && typeof parsed.input === "object" && !Array.isArray(parsed.input)) {
2237
2215
  if (!inputSchema.parse({
2238
2216
  value: parsed.input,
2239
2217
  data: parsed.input,
@@ -6825,7 +6803,7 @@ async function fetchRemoteTypes(client, workspaceId, namespace) {
6825
6803
  async function assertMigrationsReproduceLocalTypes(loaded, target) {
6826
6804
  const { config, plugins } = loaded;
6827
6805
  const pluginManager = plugins.length > 0 ? new PluginManager(plugins) : void 0;
6828
- const { defineApplication, generatePluginFilesIfNeeded } = await import("../application-Dp_-ioiP.mjs");
6806
+ const { defineApplication, generatePluginFilesIfNeeded } = await import("../application-BB6BlUfk.mjs");
6829
6807
  const application = defineApplication({
6830
6808
  config,
6831
6809
  pluginManager