@tailor-platform/sdk 1.51.2 → 1.52.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 (137) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist/{actor-Nag62ZDM.d.mts → actor-DwAh0Dij.d.mts} +3 -8
  3. package/dist/application-B_yEREFy.mjs +4 -0
  4. package/dist/{application-Z-fNwyZB.mjs → application-CECifcE9.mjs} +11 -11
  5. package/dist/{application-Z-fNwyZB.mjs.map → application-CECifcE9.mjs.map} +1 -1
  6. package/dist/{authconnection-BUko4V6H.mjs → authconnection-D8SJGMpj.mjs} +2 -2
  7. package/dist/{authconnection-BUko4V6H.mjs.map → authconnection-D8SJGMpj.mjs.map} +1 -1
  8. package/dist/{authconnection-BDFTabLQ.d.mts → authconnection-TsdLYaLs.d.mts} +1 -1
  9. package/dist/{brand-Ll48SMXe.mjs → brand-DlnJ375c.mjs} +1 -1
  10. package/dist/{brand-Ll48SMXe.mjs.map → brand-DlnJ375c.mjs.map} +1 -1
  11. package/dist/cli/index.mjs +16 -16
  12. package/dist/cli/lib.d.mts +7 -7
  13. package/dist/cli/lib.mjs +8 -8
  14. package/dist/cli/skills.mjs +1 -1
  15. package/dist/{client-BwV17byk.mjs → client-CKlZhiq4.mjs} +4 -4
  16. package/dist/{client-BwV17byk.mjs.map → client-CKlZhiq4.mjs.map} +1 -1
  17. package/dist/{client-D_a50aIg.mjs → client-btP2hNF1.mjs} +1 -1
  18. package/dist/configure/index.d.mts +4 -4
  19. package/dist/configure/index.mjs +4 -4
  20. package/dist/{context-BXDgEQK9.d.mts → context-CUBwSBq4.d.mts} +1 -1
  21. package/dist/{context-BP5BUdcq.mjs → context-s0lxhu8_.mjs} +2 -2
  22. package/dist/{context-BP5BUdcq.mjs.map → context-s0lxhu8_.mjs.map} +1 -1
  23. package/dist/{crashreport-C4EbRoku.mjs → crashreport-CGE6P9Kf.mjs} +1 -1
  24. package/dist/{crashreport-DauPOrKn.mjs → crashreport-DJ5SS5Q-.mjs} +5 -5
  25. package/dist/{crashreport-DauPOrKn.mjs.map → crashreport-DJ5SS5Q-.mjs.map} +1 -1
  26. package/dist/{enum-constants-DI85-fPE.mjs → enum-constants-C7DaWeQo.mjs} +1 -1
  27. package/dist/{enum-constants-DI85-fPE.mjs.map → enum-constants-C7DaWeQo.mjs.map} +1 -1
  28. package/dist/env-B-g-qgE4.d.mts +7 -0
  29. package/dist/{errors-C4cJ0M2K.mjs → errors-EsY4XO6O.mjs} +1 -1
  30. package/dist/{errors-C4cJ0M2K.mjs.map → errors-EsY4XO6O.mjs.map} +1 -1
  31. package/dist/{field-BY2vbJ8f.mjs → field-C4zdJLW5.mjs} +1 -1
  32. package/dist/{field-BY2vbJ8f.mjs.map → field-C4zdJLW5.mjs.map} +1 -1
  33. package/dist/{file-Dc4_QrlQ.d.mts → file-DaCYOLPz.d.mts} +1 -1
  34. package/dist/{file-BE5Sy7lP.mjs → file-umdycPAF.mjs} +2 -2
  35. package/dist/{file-BE5Sy7lP.mjs.map → file-umdycPAF.mjs.map} +1 -1
  36. package/dist/{file-utils-BM8t5jCy.mjs → file-utils-BHPxPXmn.mjs} +2 -2
  37. package/dist/{file-utils-BM8t5jCy.mjs.map → file-utils-BHPxPXmn.mjs.map} +1 -1
  38. package/dist/{iconv-BFNfdlIS.d.mts → iconv-Chu6Hit2.d.mts} +1 -1
  39. package/dist/{iconv-D0yL88Il.mjs → iconv-DreIffeM.mjs} +2 -2
  40. package/dist/{iconv-D0yL88Il.mjs.map → iconv-DreIffeM.mjs.map} +1 -1
  41. package/dist/{idp-B1b4O7ia.d.mts → idp-CbxR6A_0.d.mts} +1 -1
  42. package/dist/{idp-CM7N7iID.mjs → idp-Ch95ag8h.mjs} +2 -2
  43. package/dist/{idp-CM7N7iID.mjs.map → idp-Ch95ag8h.mjs.map} +1 -1
  44. package/dist/{index-CYAZkd4b.d.mts → index-BCJtNXKo.d.mts} +2 -2
  45. package/dist/{index-aiIbrFGw.d.mts → index-BIbKrme4.d.mts} +2 -2
  46. package/dist/{index-BXwAT_oE.d.mts → index-BL5LQnBX.d.mts} +2 -2
  47. package/dist/{index-CfSjuxzK.d.mts → index-DW6gAGmC.d.mts} +2 -2
  48. package/dist/{index-BD99GoHO.d.mts → index-UySZfxON.d.mts} +8 -6
  49. package/dist/{index-Dy3ZH5Wm.d.mts → index-wuuZLoFt.d.mts} +8 -8
  50. package/dist/{interceptor-Cr3kZWMc.mjs → interceptor-DOqRkCya.mjs} +1 -1
  51. package/dist/{interceptor-Cr3kZWMc.mjs.map → interceptor-DOqRkCya.mjs.map} +1 -1
  52. package/dist/{job-4GOnasfT.mjs → job-CEAJLiGp.mjs} +8 -5
  53. package/dist/job-CEAJLiGp.mjs.map +1 -0
  54. package/dist/kysely/index.mjs.map +1 -1
  55. package/dist/{kysely-type-BUoVDC5r.mjs → kysely-type-D1e0Vwkd.mjs} +2 -2
  56. package/dist/{kysely-type-BUoVDC5r.mjs.map → kysely-type-D1e0Vwkd.mjs.map} +1 -1
  57. package/dist/{logger-B1g4I9wT.mjs → logger-DpJyJvNz.mjs} +1 -1
  58. package/dist/{logger-B1g4I9wT.mjs.map → logger-DpJyJvNz.mjs.map} +1 -1
  59. package/dist/{mock-B2t5gDMl.mjs → mock-BabuSqbj.mjs} +20 -1
  60. package/dist/mock-BabuSqbj.mjs.map +1 -0
  61. package/dist/{multiline-G1yF18OH.mjs → multiline-Cf9ODpr1.mjs} +1 -1
  62. package/dist/{multiline-G1yF18OH.mjs.map → multiline-Cf9ODpr1.mjs.map} +1 -1
  63. package/dist/{package-json-ZL0MkZOO.mjs → package-json-DcQApfPQ.mjs} +1 -1
  64. package/dist/{package-json-ZL0MkZOO.mjs.map → package-json-DcQApfPQ.mjs.map} +1 -1
  65. package/dist/package-json-wzO6nV9O.mjs +4 -0
  66. package/dist/plugin/builtin/enum-constants/index.d.mts +1 -1
  67. package/dist/plugin/builtin/enum-constants/index.mjs +1 -1
  68. package/dist/plugin/builtin/file-utils/index.d.mts +1 -1
  69. package/dist/plugin/builtin/file-utils/index.mjs +1 -1
  70. package/dist/plugin/builtin/kysely-type/index.d.mts +1 -1
  71. package/dist/plugin/builtin/kysely-type/index.mjs +1 -1
  72. package/dist/plugin/builtin/seed/index.d.mts +1 -1
  73. package/dist/plugin/builtin/seed/index.mjs +1 -1
  74. package/dist/plugin/index.d.mts +3 -2
  75. package/dist/{repl-editor-yAjwS5_M.mjs → repl-editor-ihh8koiR.mjs} +1 -1
  76. package/dist/{repl-editor-yAjwS5_M.mjs.map → repl-editor-ihh8koiR.mjs.map} +1 -1
  77. package/dist/runtime/authconnection.d.mts +1 -1
  78. package/dist/runtime/authconnection.mjs +1 -1
  79. package/dist/runtime/context.d.mts +1 -1
  80. package/dist/runtime/context.mjs +1 -1
  81. package/dist/runtime/file.d.mts +1 -1
  82. package/dist/runtime/file.mjs +1 -1
  83. package/dist/runtime/globals.d.mts +6 -6
  84. package/dist/runtime/iconv.d.mts +1 -1
  85. package/dist/runtime/iconv.mjs +1 -1
  86. package/dist/runtime/idp.d.mts +1 -1
  87. package/dist/runtime/idp.mjs +1 -1
  88. package/dist/runtime/index.d.mts +8 -8
  89. package/dist/runtime/index.mjs +7 -7
  90. package/dist/runtime/secretmanager.d.mts +1 -1
  91. package/dist/runtime/secretmanager.mjs +1 -1
  92. package/dist/runtime/workflow.d.mts +1 -1
  93. package/dist/runtime/workflow.mjs +1 -1
  94. package/dist/{runtime-1NlbDNN0.mjs → runtime-BN484A6U.mjs} +264 -42
  95. package/dist/runtime-BN484A6U.mjs.map +1 -0
  96. package/dist/{schema-DBq6hr6h.mjs → schema-CQrYG_55.mjs} +3 -3
  97. package/dist/{schema-DBq6hr6h.mjs.map → schema-CQrYG_55.mjs.map} +1 -1
  98. package/dist/{secret-file-DnbmTWec.mjs → secret-file-CWzF8rry.mjs} +1 -1
  99. package/dist/{secret-file-DnbmTWec.mjs.map → secret-file-CWzF8rry.mjs.map} +1 -1
  100. package/dist/{secretmanager-CQTTuCmn.mjs → secretmanager-B9h-U_8U.mjs} +2 -2
  101. package/dist/{secretmanager-CQTTuCmn.mjs.map → secretmanager-B9h-U_8U.mjs.map} +1 -1
  102. package/dist/{secretmanager-Cjq3s2aU.d.mts → secretmanager-BhpDmxwT.d.mts} +1 -1
  103. package/dist/{seed-kNk-xLoB.mjs → seed-DfLyRh63.mjs} +2 -2
  104. package/dist/{seed-kNk-xLoB.mjs.map → seed-DfLyRh63.mjs.map} +1 -1
  105. package/dist/{service-DHgJ4YEF.mjs → service-aPT0fx3y.mjs} +3 -3
  106. package/dist/{service-DHgJ4YEF.mjs.map → service-aPT0fx3y.mjs.map} +1 -1
  107. package/dist/{tailor-db-field-BhWvOyky.d.mts → tailor-db-field-Y_zEoGu1.d.mts} +1 -1
  108. package/dist/{telemetry-C8xKz3GM.mjs → telemetry-BQbbVo2t.mjs} +2 -2
  109. package/dist/{telemetry-C8xKz3GM.mjs.map → telemetry-BQbbVo2t.mjs.map} +1 -1
  110. package/dist/telemetry-w92bvGdC.mjs +4 -0
  111. package/dist/test-env-key-CSnK4W1Y.mjs +30 -0
  112. package/dist/test-env-key-CSnK4W1Y.mjs.map +1 -0
  113. package/dist/{types-Duhhsx3R.mjs → types-BinLwXM9.mjs} +2 -2
  114. package/dist/{types-Duhhsx3R.mjs.map → types-BinLwXM9.mjs.map} +1 -1
  115. package/dist/types-UeXbHFXW.mjs +5 -0
  116. package/dist/utils/test/index.d.mts +3 -3
  117. package/dist/utils/test/index.mjs +1 -1
  118. package/dist/vitest/environment.mjs +1 -1
  119. package/dist/vitest/index.d.mts +7 -7
  120. package/dist/vitest/index.mjs +1 -1
  121. package/dist/vitest/setup.mjs +1 -1
  122. package/dist/{workflow-DJRr-0nl.mjs → workflow--aPbA8Uq.mjs} +2 -2
  123. package/dist/{workflow-DJRr-0nl.mjs.map → workflow--aPbA8Uq.mjs.map} +1 -1
  124. package/dist/{workflow-DV_88JEf.d.mts → workflow-dYYH7QFa.d.mts} +1 -1
  125. package/dist/{workflow.generated-DV87DJfO.d.mts → workflow.generated-BIY41La-.d.mts} +2 -2
  126. package/docs/cli/application.md +15 -6
  127. package/docs/cli/completion.md +5 -3
  128. package/docs/testing.md +13 -13
  129. package/package.json +13 -13
  130. package/dist/application-Bcx-FbDE.mjs +0 -4
  131. package/dist/job-4GOnasfT.mjs.map +0 -1
  132. package/dist/mock-B2t5gDMl.mjs.map +0 -1
  133. package/dist/package-json-CAGKAJff.mjs +0 -4
  134. package/dist/runtime-1NlbDNN0.mjs.map +0 -1
  135. package/dist/telemetry-DQl47E1s.mjs +0 -4
  136. package/dist/types-BnphjkIJ.mjs +0 -5
  137. /package/dist/{chunk-DLeslSnM.mjs → chunk-BkoGK1jX.mjs} +0 -0
@@ -1,14 +1,15 @@
1
1
 
2
- import { t as db } from "./schema-DBq6hr6h.mjs";
3
- import { $ as FilterSchema, A as FunctionExecution_Status, B as AuthOAuth2Client_GrantType, C as TailorDBType_Permission_Operator, D as IdPLang, E as PipelineResolver_OperationType, F as AuthConnection_Type, H as AuthSCIMAttribute_Type, I as AuthHookPoint, J as GetApplicationSchemaHealthResponse_ApplicationSchemaHealthStatus, K as TenantProviderConfig_TenantProviderType, L as AuthIDPConfig_AuthType, M as ExecutorJobStatus, N as ExecutorTargetType, O as IdPPermissionOperator, P as ExecutorTriggerType, Q as Condition_Operator, R as AuthInvokerSchema, S as TailorDBGQLPermission_Permit, T as TailorDBType_PermitAction, U as AuthSCIMAttribute_Uniqueness, V as AuthSCIMAttribute_Mutability, W as AuthSCIMConfig_AuthorizationType, X as Subgraph_ServiceType, Y as ApplicationSchemaUpdateAttemptStatus, Z as ConditionSchema, _ as WorkspacePlatformUserRole, a as fetchMachineUserToken, b as TailorDBGQLPermission_Action, d as initOperatorClient, et as PageDirection, g as OperatorService, h as userAgent, i as fetchAll, k as IdPPermissionPermit, m as resolveStaticWebsiteUrls, o as fetchPaged, p as platformBaseUrl, q as UserProfileProviderConfig_UserProfileProviderType, v as WorkflowExecution_Status, w as TailorDBType_Permission_Permit, x as TailorDBGQLPermission_Operator, y as WorkflowJobExecution_Status, z as AuthOAuth2Client_ClientType } from "./client-BwV17byk.mjs";
4
- import { a as parseBoolean, i as symbols, n as logger, r as styles, t as CIPromptError } from "./logger-B1g4I9wT.mjs";
5
- import { C as loadConfigPath, O as writePlatformConfig, S as loadAccessToken, T as readPlatformConfig, _ as getDistDir, d as buildResolverOperationHookExpr, f as OAuth2ClientSchema, g as createBundleCache, h as loadFilesWithIgnores, m as stringifyFunction, n as generatePluginFilesIfNeeded, p as TailorDBTypeSchema, r as loadApplication, s as createExecutorService, t as defineApplication, u as buildExecutorArgsExpr, v as hashFile, w as loadWorkspaceId, y as loadConfig } from "./application-Z-fNwyZB.mjs";
6
- import { t as multiline } from "./multiline-G1yF18OH.mjs";
7
- import { t as readPackageJson } from "./package-json-ZL0MkZOO.mjs";
8
- import { n as isCLIError, t as createCLIError } from "./errors-C4cJ0M2K.mjs";
9
- import { r as withSpan } from "./telemetry-C8xKz3GM.mjs";
2
+ import { t as db } from "./schema-CQrYG_55.mjs";
3
+ import { $ as FilterSchema, A as FunctionExecution_Status, B as AuthOAuth2Client_GrantType, C as TailorDBType_Permission_Operator, D as IdPLang, E as PipelineResolver_OperationType, F as AuthConnection_Type, H as AuthSCIMAttribute_Type, I as AuthHookPoint, J as GetApplicationSchemaHealthResponse_ApplicationSchemaHealthStatus, K as TenantProviderConfig_TenantProviderType, L as AuthIDPConfig_AuthType, M as ExecutorJobStatus, N as ExecutorTargetType, O as IdPPermissionOperator, P as ExecutorTriggerType, Q as Condition_Operator, R as AuthInvokerSchema, S as TailorDBGQLPermission_Permit, T as TailorDBType_PermitAction, U as AuthSCIMAttribute_Uniqueness, V as AuthSCIMAttribute_Mutability, W as AuthSCIMConfig_AuthorizationType, X as Subgraph_ServiceType, Y as ApplicationSchemaUpdateAttemptStatus, Z as ConditionSchema, _ as WorkspacePlatformUserRole, a as fetchMachineUserToken, b as TailorDBGQLPermission_Action, d as initOperatorClient, et as PageDirection, g as OperatorService, h as userAgent, i as fetchAll, k as IdPPermissionPermit, m as resolveStaticWebsiteUrls, o as fetchPaged, p as platformBaseUrl, q as UserProfileProviderConfig_UserProfileProviderType, v as WorkflowExecution_Status, w as TailorDBType_Permission_Permit, x as TailorDBGQLPermission_Operator, y as WorkflowJobExecution_Status, z as AuthOAuth2Client_ClientType } from "./client-CKlZhiq4.mjs";
4
+ import { a as parseBoolean, i as symbols, n as logger, r as styles, t as CIPromptError } from "./logger-DpJyJvNz.mjs";
5
+ import { C as loadConfigPath, O as writePlatformConfig, S as loadAccessToken, T as readPlatformConfig, _ as getDistDir, d as buildResolverOperationHookExpr, f as OAuth2ClientSchema, g as createBundleCache, h as loadFilesWithIgnores, m as stringifyFunction, n as generatePluginFilesIfNeeded, p as TailorDBTypeSchema, r as loadApplication, s as createExecutorService, t as defineApplication, u as buildExecutorArgsExpr, v as hashFile, w as loadWorkspaceId, y as loadConfig } from "./application-CECifcE9.mjs";
6
+ import { t as multiline } from "./multiline-Cf9ODpr1.mjs";
7
+ import { t as readPackageJson } from "./package-json-DcQApfPQ.mjs";
8
+ import { n as isCLIError, t as createCLIError } from "./errors-EsY4XO6O.mjs";
9
+ import { r as withSpan } from "./telemetry-BQbbVo2t.mjs";
10
10
  import { arg, createDefineCommand, defineCommand, runCommand } from "politty";
11
11
  import { z } from "zod";
12
+ import { ScalarType, create, fromJson, toJson } from "@bufbuild/protobuf";
12
13
  import * as fs$1 from "node:fs";
13
14
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
14
15
  import { parseEnv } from "node:util";
@@ -22,7 +23,6 @@ import { findUpSync } from "find-up-simple";
22
23
  import { xdgConfig } from "xdg-basedir";
23
24
  import { Code, ConnectError } from "@connectrpc/connect";
24
25
  import { resolveTSConfig } from "pkg-types";
25
- import { ScalarType, create, fromJson, toJson } from "@bufbuild/protobuf";
26
26
  import * as crypto$1 from "node:crypto";
27
27
  import { createHash } from "node:crypto";
28
28
  import { ExitPromptError } from "@inquirer/core";
@@ -335,19 +335,150 @@ async function apiCall(options) {
335
335
 
336
336
  //#endregion
337
337
  //#region src/cli/commands/api/proto-reflect.ts
338
- function unaryMethods() {
339
- return OperatorService.methods.filter((m) => m.methodKind === "unary");
340
- }
338
+ const UNARY_METHODS = OperatorService.methods.filter((m) => m.methodKind === "unary");
341
339
  function listMethodNames() {
342
- return unaryMethods().map((m) => m.name).sort();
340
+ return UNARY_METHODS.map((m) => m.name).sort();
341
+ }
342
+ /**
343
+ * Returns every accepted form of the `endpoint` positional — bare method name
344
+ * and fully-qualified `service/Method`. politty's expand completion keys its
345
+ * static table by the literal endpoint string, so both forms must appear in
346
+ * `choices` or the user typing the fully-qualified name gets no `--field`
347
+ * completion candidates back at TAB time.
348
+ * @returns Sorted list of accepted endpoint values
349
+ */
350
+ function listMethodChoices() {
351
+ return UNARY_METHODS.flatMap((m) => [m.name, `${OperatorService.typeName}/${m.name}`]).sort();
343
352
  }
344
353
  function getMethodDescriptor(methodName) {
345
- return unaryMethods().find((m) => m.name === methodName);
354
+ return UNARY_METHODS.find((m) => m.name === methodName);
346
355
  }
347
356
  function extractMethodName(endpoint) {
348
357
  if (!endpoint.includes("/")) return endpoint;
349
358
  return endpoint.split("/").pop() ?? endpoint;
350
359
  }
360
+ /**
361
+ * Returns the nested message descriptor when the field is a message, a list of
362
+ * messages, or a map with message values. Otherwise returns undefined.
363
+ * @param field - The proto field descriptor to inspect
364
+ * @returns The nested message descriptor, or undefined when the field isn't message-shaped
365
+ */
366
+ function nestedMessage(field) {
367
+ if (field.fieldKind === "message") return field.message;
368
+ if (field.fieldKind === "list" && field.listKind === "message") return field.message;
369
+ if (field.fieldKind === "map" && field.mapKind === "message") return field.message;
370
+ }
371
+ /**
372
+ * Most `google.protobuf.*` well-known types serialize as scalars in proto JSON
373
+ * (Timestamp/Duration → RFC3339/duration string, FieldMask → comma-joined
374
+ * string, *Value wrappers → underlying primitive, etc.), so we must not let
375
+ * `--field` drill into their internal fields. Treating them as leaves keeps
376
+ * the completion and the body shape consistent with what the server expects.
377
+ * @param message - The proto message descriptor to inspect
378
+ * @returns True when the message is a well-known type
379
+ */
380
+ function isWellKnownType(message) {
381
+ return message.typeName.startsWith("google.protobuf.");
382
+ }
383
+ const UNREPRESENTABLE_WELL_KNOWN_TYPES = new Set([
384
+ "google.protobuf.Struct",
385
+ "google.protobuf.Value",
386
+ "google.protobuf.ListValue",
387
+ "google.protobuf.NullValue",
388
+ "google.protobuf.Any",
389
+ "google.protobuf.Empty"
390
+ ]);
391
+ /**
392
+ * @param message - The proto message descriptor to inspect
393
+ * @returns True when the message is a well-known type that `--field` cannot represent
394
+ */
395
+ function isUnrepresentableWellKnownType(message) {
396
+ return UNREPRESENTABLE_WELL_KNOWN_TYPES.has(message.typeName);
397
+ }
398
+ /**
399
+ * Pre-enumerates every `--field` completion candidate for `methodName`,
400
+ * walking the input message tree to produce a flat list that the shell can
401
+ * prefix-filter at TAB time. Used by the `expand` completion variant so no
402
+ * Node process is spawned per keystroke.
403
+ *
404
+ * For each leaf field, emits `key=` (key completion). Enum leaves additionally
405
+ * emit `key=ENUM_VALUE` per value, bool leaves emit `key=true` and
406
+ * `key=false`. For nested messages, emits `key.` (drill-down) and recurses.
407
+ *
408
+ * Returns an empty array when `methodName` is unknown so the `expand`
409
+ * generator stays exception-free at script-generation time.
410
+ * @param methodName - Name of the unary RPC whose input message is being walked
411
+ * @returns Flat list of `{ value, description }` candidates
412
+ */
413
+ function enumerateAllFieldCompletions(methodName) {
414
+ const method = getMethodDescriptor(methodName);
415
+ if (!method) return [];
416
+ const candidates = [];
417
+ const visited = /* @__PURE__ */ new Set();
418
+ function walk(message, prefix) {
419
+ visited.add(message);
420
+ for (const field of message.fields) {
421
+ if (field.fieldKind === "list" || field.fieldKind === "map") continue;
422
+ const fullKey = prefix + field.localName;
423
+ if (field.fieldKind === "message") {
424
+ if (isUnrepresentableWellKnownType(field.message)) continue;
425
+ if (!isWellKnownType(field.message)) {
426
+ const nested = field.message;
427
+ candidates.push({
428
+ value: `${fullKey}.`,
429
+ description: `${fullKey} (message)`
430
+ });
431
+ if (!visited.has(nested)) walk(nested, `${fullKey}.`);
432
+ continue;
433
+ }
434
+ }
435
+ candidates.push({
436
+ value: `${fullKey}=`,
437
+ description: `Set ${fullKey}`
438
+ });
439
+ if (field.fieldKind === "enum") for (const v of field.enum.values) candidates.push({
440
+ value: `${fullKey}=${v.name}`,
441
+ description: v.name
442
+ });
443
+ else if (field.fieldKind === "scalar" && field.scalar === ScalarType.BOOL) {
444
+ candidates.push({
445
+ value: `${fullKey}=true`,
446
+ description: "true"
447
+ });
448
+ candidates.push({
449
+ value: `${fullKey}=false`,
450
+ description: "false"
451
+ });
452
+ }
453
+ }
454
+ visited.delete(message);
455
+ }
456
+ walk(method.input, "");
457
+ return candidates;
458
+ }
459
+ /**
460
+ * Resolves the leaf `DescField` at a dotted `--field` path within an input
461
+ * message tree. Returns undefined when any segment is missing or when a
462
+ * non-leaf segment isn't a singular message — callers fall back to treating
463
+ * the value as a string in that case.
464
+ * @param input - The RPC input message descriptor
465
+ * @param path - Dot-split path segments to follow (e.g. ["application", "name"])
466
+ * @returns The leaf field descriptor, or undefined when the path doesn't resolve
467
+ */
468
+ function resolveLeafField(input, path) {
469
+ let message = input;
470
+ for (let i = 0; i < path.length; i++) {
471
+ const field = message.fields.find((f) => f.localName === path[i]);
472
+ if (!field) return void 0;
473
+ if (i === path.length - 1) {
474
+ if (field.fieldKind === "message" && isUnrepresentableWellKnownType(field.message)) return;
475
+ return field;
476
+ }
477
+ if (field.fieldKind !== "message") return void 0;
478
+ if (isWellKnownType(field.message)) return void 0;
479
+ message = field.message;
480
+ }
481
+ }
351
482
 
352
483
  //#endregion
353
484
  //#region src/cli/commands/api/render.ts
@@ -405,11 +536,6 @@ function describeFieldType(field) {
405
536
  default: return "<unknown>";
406
537
  }
407
538
  }
408
- function nestedMessageForInspect(field) {
409
- if (field.fieldKind === "message") return field.message;
410
- if (field.fieldKind === "list" && field.listKind === "message") return field.message;
411
- if (field.fieldKind === "map" && field.mapKind === "message") return field.message;
412
- }
413
539
  function fieldToJson(field, visited) {
414
540
  const json = {
415
541
  name: field.localName,
@@ -421,7 +547,7 @@ function fieldToJson(field, visited) {
421
547
  if (field.oneof) json.oneof = field.oneof.name;
422
548
  const fieldEnum = enumOf(field);
423
549
  if (fieldEnum) json.enumValues = fieldEnum.values.map((v) => v.name);
424
- const nested = nestedMessageForInspect(field);
550
+ const nested = nestedMessage(field);
425
551
  if (nested && !visited.has(nested)) {
426
552
  visited.add(nested);
427
553
  json.message = {
@@ -456,7 +582,7 @@ function renderFieldText(field, indent, visited) {
456
582
  const values = fieldEnum.values.map((v) => v.name).join(", ");
457
583
  lines.push(`${indent} values: ${values}`);
458
584
  }
459
- const nested = nestedMessageForInspect(field);
585
+ const nested = nestedMessage(field);
460
586
  if (nested && !visited.has(nested)) {
461
587
  visited.add(nested);
462
588
  for (const sub of nested.fields) lines.push(...renderFieldText(sub, `${indent} `, visited));
@@ -555,6 +681,85 @@ function parseBodyAsObject(body) {
555
681
  if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) return;
556
682
  return parsed;
557
683
  }
684
+ /**
685
+ * Set a dotted path on a body object, replacing non-object intermediates as
686
+ * needed. `--field` takes precedence over `--body`, so collisions overwrite.
687
+ * @param obj - The body object to mutate
688
+ * @param path - Dot-split path segments (e.g. ["application", "name"])
689
+ * @param value - Value to assign at the leaf
690
+ */
691
+ function setNestedPath(obj, path, value) {
692
+ let cursor = obj;
693
+ for (let i = 0; i < path.length - 1; i++) {
694
+ const key = path[i];
695
+ const next = cursor[key];
696
+ if (typeof next !== "object" || next === null || Array.isArray(next)) cursor[key] = {};
697
+ cursor = cursor[key];
698
+ }
699
+ cursor[path[path.length - 1]] = value;
700
+ }
701
+ /**
702
+ * Coerces a raw `--field` string value to match the leaf proto type so the
703
+ * JSON body sends a properly typed value. Today we only coerce bool — the
704
+ * completion candidates explicitly suggest `=true`/`=false`, so sending the
705
+ * literal string "true" would be a visible mismatch. Other scalars are left
706
+ * as strings: proto JSON accepts string forms for ints/floats/int64/etc.,
707
+ * and we'd rather pass through what the user typed than silently coerce.
708
+ * @param field - The resolved leaf field descriptor, or undefined when the path didn't resolve
709
+ * @param raw - The raw string value after `=`
710
+ * @returns The value to write into the body object
711
+ */
712
+ function coerceFieldValue(field, raw) {
713
+ if (field && field.fieldKind === "scalar" && field.scalar === ScalarType.BOOL) {
714
+ if (raw === "true") return true;
715
+ if (raw === "false") return false;
716
+ throw new Error(`Invalid value for bool field: '${raw}'. Expected 'true' or 'false'.`);
717
+ }
718
+ return raw;
719
+ }
720
+ const FORBIDDEN_SEGMENTS = new Set([
721
+ "__proto__",
722
+ "constructor",
723
+ "prototype"
724
+ ]);
725
+ const fieldArg = z.string().transform((val, ctx) => {
726
+ const eq = val.indexOf("=");
727
+ if (eq < 0) {
728
+ ctx.addIssue({
729
+ code: z.ZodIssueCode.custom,
730
+ message: `Invalid field format: '${val}'. Expected format: 'key=value' or 'a.b.c=value'`
731
+ });
732
+ return z.NEVER;
733
+ }
734
+ const key = val.slice(0, eq);
735
+ if (key.length === 0) {
736
+ ctx.addIssue({
737
+ code: z.ZodIssueCode.custom,
738
+ message: "Field key cannot be empty"
739
+ });
740
+ return z.NEVER;
741
+ }
742
+ const segments = key.split(".");
743
+ if (segments.some((seg) => seg.length === 0)) {
744
+ ctx.addIssue({
745
+ code: z.ZodIssueCode.custom,
746
+ message: `Invalid field key: '${key}'. Dotted segments cannot be empty`
747
+ });
748
+ return z.NEVER;
749
+ }
750
+ const forbidden = segments.find((seg) => FORBIDDEN_SEGMENTS.has(seg));
751
+ if (forbidden) {
752
+ ctx.addIssue({
753
+ code: z.ZodIssueCode.custom,
754
+ message: `Invalid field key: '${key}'. Segment '${forbidden}' is not allowed.`
755
+ });
756
+ return z.NEVER;
757
+ }
758
+ return {
759
+ path: segments,
760
+ value: val.slice(eq + 1)
761
+ };
762
+ });
558
763
  const apiCommand = defineAppCommand({
559
764
  name: "api",
560
765
  description: "Call Tailor Platform API endpoints directly.",
@@ -567,12 +772,18 @@ The request body is inferred from the proto definition of the target endpoint, a
567
772
  - Auth / Tenant / UserProfile endpoints use \`auth.name\`.
568
773
  - IdP / TailorDB / Pipeline endpoints use the sole configured namespace when exactly one is defined.
569
774
 
570
- Values already present in \`--body\` are never overridden. If a value cannot be resolved (e.g. no config found), injection is silently skipped and the server-side validation error takes precedence.`,
775
+ Values already present in \`--body\` are never overridden. If a value cannot be resolved (e.g. no config found), injection is silently skipped and the server-side validation error takes precedence.
776
+
777
+ Use \`--field key=value\` (repeatable) to set request body fields without writing JSON. Dotted keys (e.g. \`application.name=foo\`) build nested objects. \`--field\` overrides matching fields in \`--body\` and tab-completes from the endpoint's proto schema.`,
571
778
  examples: [
572
779
  {
573
780
  cmd: "GetApplication -b '{\"applicationName\":\"app-1\"}'",
574
781
  desc: "Call an endpoint; workspaceId is auto-injected."
575
782
  },
783
+ {
784
+ cmd: "GetApplication -f applicationName=app-1",
785
+ desc: "Same as above, using --field instead of --body."
786
+ },
576
787
  {
577
788
  cmd: "list",
578
789
  desc: "List all invocable OperatorService methods."
@@ -593,10 +804,18 @@ Values already present in \`--body\` are never overridden. If a value cannot be
593
804
  alias: "b",
594
805
  description: "Request body as JSON."
595
806
  }),
807
+ field: arg(fieldArg.array().optional(), {
808
+ alias: "f",
809
+ description: "Set a body field as `key=value` (repeatable; dotted keys nest). Overrides --body.",
810
+ completion: { custom: { expand: {
811
+ dependsOn: ["endpoint"],
812
+ enumerate: ({ endpoint }) => enumerateAllFieldCompletions(extractMethodName(endpoint ?? ""))
813
+ } } }
814
+ }),
596
815
  endpoint: arg(z.string(), {
597
816
  positional: true,
598
817
  description: "API endpoint to call (e.g., 'GetApplication' or 'tailor.v1.OperatorService/GetApplication').",
599
- completion: { custom: { choices: listMethodNames() } }
818
+ completion: { custom: { choices: listMethodChoices() } }
600
819
  })
601
820
  }).strict(),
602
821
  run: async (args) => {
@@ -605,6 +824,14 @@ Values already present in \`--body\` are never overridden. If a value cannot be
605
824
  const method = getMethodDescriptor(methodName);
606
825
  const parsedBody = parseBodyAsObject(args.body);
607
826
  let mutated = false;
827
+ if (args.field && args.field.length > 0) {
828
+ if (!parsedBody) throw new Error("--field requires --body to be a JSON object (or omitted).");
829
+ for (const f of args.field) {
830
+ const leaf = method ? resolveLeafField(method.input, f.path) : void 0;
831
+ setNestedPath(parsedBody, f.path, coerceFieldValue(leaf, f.value));
832
+ }
833
+ mutated = true;
834
+ }
608
835
  if (parsedBody && method) {
609
836
  const fieldNames = method.input.fields.map((f) => f.localName);
610
837
  if (fieldNames.includes("workspaceId") && !("workspaceId" in parsedBody)) try {
@@ -7864,31 +8091,26 @@ async function validateAndDetectMigrations(client, workspaceId, typesByNamespace
7864
8091
  };
7865
8092
  }
7866
8093
  /**
7867
- * Reconcile the on-remote migration label with the working tree's latest
7868
- * migration number for each namespace.
7869
- *
7870
- * Used after a `--no-schema-check` apply: that flag skips the local/remote
7871
- * snapshot drift checks, but if it also leaves the label untouched the remote
7872
- * label can drift past the working tree's latest migration (e.g. when
7873
- * checking out an older revision and re-deploying). A subsequent run would
7874
- * then reconstruct the expected snapshot at a label that no longer exists in
7875
- * the working tree, triggering a false drift error.
8094
+ * Force each namespace's `sdk-migration` label to the working tree's latest
8095
+ * migration number after a create-update apply.
7876
8096
  *
7877
- * Always force `label = working_tree_max` regardless of the previous label so
7878
- * the invariant `label <= working_tree_max` is preserved.
8097
+ * This records the initial baseline (`0000`), which is deployed via the normal
8098
+ * flow and never bumps the label itself, and keeps the label `<= working_tree_max`
8099
+ * after a `--no-schema-check` deploy from an older revision. Namespaces without a
8100
+ * baseline are skipped so no phantom label is written.
7879
8101
  * @param client - Operator client instance
7880
8102
  * @param workspaceId - Workspace ID
7881
8103
  * @param namespacesWithMigrations - Namespaces that have migration directories configured
7882
8104
  */
7883
8105
  async function reconcileMigrationLabels(client, workspaceId, namespacesWithMigrations) {
7884
8106
  for (const { namespace, migrationsDir } of namespacesWithMigrations) {
8107
+ if (getMigrationFiles(migrationsDir).length === 0) continue;
7885
8108
  const targetVersion = getLatestMigrationNumber(migrationsDir);
7886
8109
  const currentVersion = await getRemoteMigrationNumber(client, workspaceId, namespace);
8110
+ if (currentVersion === targetVersion) continue;
7887
8111
  await updateMigrationLabel(client, workspaceId, namespace, targetVersion);
7888
- if (currentVersion !== targetVersion) {
7889
- const from = currentVersion === null ? "<unset>" : formatMigrationNumber(currentVersion);
7890
- logger.info(`Migration label for namespace ${namespace} reconciled: ${from} → ${formatMigrationNumber(targetVersion)}.`);
7891
- }
8112
+ const from = currentVersion === null ? "<unset>" : formatMigrationNumber(currentVersion);
8113
+ logger.info(`Migration label for namespace ${namespace} reconciled: ${from} ${formatMigrationNumber(targetVersion)}.`);
7892
8114
  }
7893
8115
  }
7894
8116
  /**
@@ -7963,7 +8185,7 @@ async function applyTailorDB(client, result, phase = "create-update") {
7963
8185
  await Promise.all(changeSet.gqlPermission.deletes.map((del) => client.deleteTailorDBGQLPermission(del.request)));
7964
8186
  await Promise.all(changeSet.type.deletes.map((del) => client.deleteTailorDBType(del.request)));
7965
8187
  }
7966
- if (migrationContext.noSchemaCheck && namespacesWithMigrations.length > 0) await reconcileMigrationLabels(client, migrationContext.workspaceId, namespacesWithMigrations);
8188
+ if (namespacesWithMigrations.length > 0 && (migrationContext.noSchemaCheck || pendingMigrations.length === 0)) await reconcileMigrationLabels(client, migrationContext.workspaceId, namespacesWithMigrations);
7967
8189
  } else if (phase === "delete-resources") {
7968
8190
  await Promise.all(changeSet.gqlPermission.deletes.map((del) => client.deleteTailorDBGQLPermission(del.request)));
7969
8191
  await Promise.all(changeSet.type.deletes.map((del) => client.deleteTailorDBType(del.request)));
@@ -14024,7 +14246,7 @@ async function generate(options) {
14024
14246
  if (options.init) await handleInitOption(namespacesWithMigrations, options.yes);
14025
14247
  let pluginManager;
14026
14248
  if (plugins.length > 0) pluginManager = new PluginManager(plugins);
14027
- const { defineApplication } = await import("./application-Bcx-FbDE.mjs");
14249
+ const { defineApplication } = await import("./application-B_yEREFy.mjs");
14028
14250
  const application = defineApplication({
14029
14251
  config,
14030
14252
  pluginManager
@@ -15877,7 +16099,7 @@ async function runRepl(options) {
15877
16099
  const execute = await prepareQueryExecutor(options);
15878
16100
  const historyPath = getReplHistoryPath(options.engine, options.profile, options.workspaceId);
15879
16101
  const validate = createReplValidator(options.engine);
15880
- const { highlightSqlLine, highlightGraphqlLine, replTransform } = await import("./repl-editor-yAjwS5_M.mjs");
16102
+ const { highlightSqlLine, highlightGraphqlLine, replTransform } = await import("./repl-editor-ihh8koiR.mjs");
15881
16103
  const highlight = options.engine === "sql" ? highlightSqlLine : highlightGraphqlLine;
15882
16104
  const prompt = createPrompt({
15883
16105
  prefix: "",
@@ -16211,4 +16433,4 @@ function isDeno() {
16211
16433
 
16212
16434
  //#endregion
16213
16435
  export { listCommand$5 as $, compareSnapshots as $t, truncate as A, workspaceArgs as An, startCommand as At, logBetaWarning as B, getExecutor as Bt, listCommand$2 as C, configArg as Cn, triggerExecutor as Ct, resumeWorkflow as D, pagedLogArgs as Dn, jobsCommand as Dt, resumeCommand as E, isVerbose as En, getExecutorJob as Et, writeDbTypesFile as F, getWorkflowExecution as Ft, organizationTree as G, parseMigrationLabelNumber as Gt, removeCommand$1 as H, executeScript as Ht, getConfiguredEditorCommand as I, listWorkflowExecutions as It, listOrganizations as J, DIFF_FILE_NAME as Jt, treeCommand as K, bundleMigrationScript as Kt, openInConfiguredEditor as L, functionExecutionStatusToString as Lt, generate as M, getCommand$5 as Mt, generateCommand as N, getWorkflow as Nt, listCommand$3 as O, paginationArgs as On, listExecutorJobs as Ot, generateMigrationScript as P, executionsCommand as Pt, updateFolder as Q, compareLocalTypesWithSnapshot as Qt, show as R, formatKeyValueTable as Rt, listApps as S, commonArgs as Sn, triggerCommand as St, healthCommand as T, deploymentArgs as Tn, listExecutors as Tt, updateCommand$1 as U, waitForExecution$1 as Ut, remove as V, deploy as Vt, updateOrganization as W, MIGRATION_LABEL_KEY as Wt, getOrganization as X, MIGRATE_FILE_NAME as Xt, getCommand$1 as Y, INITIAL_SCHEMA_NUMBER as Yt, updateCommand$2 as Z, SCHEMA_FILE_NAME as Zt, getWorkspace as _, prompt as _n, listFunctionRegistries as _t, updateUser as a, getMigrationFiles as an, createCommand$1 as at, createCommand as b, assertWritable as bn, listWebhookExecutors as bt, listCommand as c, loadDiff as cn, listOAuth2Clients as ct, inviteUser as d, formatMigrationDiff as dn, getMachineUserToken as dt, createSnapshotFromLocalTypes as en, listFolders as et, restoreCommand as f, hasChanges as fn, tokenCommand as ft, getCommand as g, generateUserTypes as gn, listCommand$8 as gt, listWorkspaces as h, trnPrefix as hn, generate$1 as ht, updateCommand as i, getMigrationFilePath as in, deleteFolder as it, truncateCommand as j, startWorkflow as jt, listWorkflows as k, toPageDirection as kn, watchExecutorJob as kt, listUsers as l, reconstructSnapshotFromMigrations as ln, getCommand$3 as lt, listCommand$1 as m, sdkNameLabelKey as mn, listMachineUsers as mt, query as n, getLatestMigrationNumber as nn, getFolder as nt, removeCommand as o, getNextMigrationNumber as on, createFolder as ot, restoreWorkspace as p, getNamespacesWithMigrations as pn, listCommand$7 as pt, listCommand$4 as q, DB_TYPES_FILE_NAME as qt, queryCommand as r, getMigrationDirPath as rn, deleteCommand$1 as rt, removeUser as s, isValidMigrationNumber as sn, listCommand$6 as st, isNativeTypeScriptRuntime as t, formatMigrationNumber as tn, getCommand$2 as tt, inviteCommand as u, formatDiffSummary as un, getOAuth2Client as ut, deleteCommand as v, apiCommand as vn, getCommand$4 as vt, getAppHealth as w, confirmationArgs as wn, listCommand$9 as wt, createWorkspace as x, defineAppCommand as xn, webhookCommand as xt, deleteWorkspace as y, apiCall as yn, getFunctionRegistry as yt, showCommand as z, getCommand$6 as zt };
16214
- //# sourceMappingURL=runtime-1NlbDNN0.mjs.map
16436
+ //# sourceMappingURL=runtime-BN484A6U.mjs.map