@tailor-platform/sdk 1.45.0 → 1.45.2

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 (67) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/{actor-CzX_hVOP.d.mts → actor-BmxQeMFP.d.mts} +2 -2
  3. package/dist/{application-BsSJZRCq.mjs → application-B4zVVNRS.mjs} +26 -26
  4. package/dist/application-B4zVVNRS.mjs.map +1 -0
  5. package/dist/application-BIzicxMA.mjs +4 -0
  6. package/dist/cli/index.mjs +29 -29
  7. package/dist/cli/index.mjs.map +1 -1
  8. package/dist/cli/lib.d.mts +6 -6
  9. package/dist/cli/lib.mjs +8 -8
  10. package/dist/cli/lib.mjs.map +1 -1
  11. package/dist/{client-DcuQRqSd.mjs → client-BwXkoiMq.mjs} +3 -3
  12. package/dist/{client-DcuQRqSd.mjs.map → client-BwXkoiMq.mjs.map} +1 -1
  13. package/dist/{client-IsYnTV5A.mjs → client-DTaArWQr.mjs} +1 -1
  14. package/dist/configure/index.d.mts +4 -4
  15. package/dist/{crash-report-DQen2i_W.mjs → crash-report-BUHzuzDn.mjs} +1 -1
  16. package/dist/{crash-report-DVZsX1bs.mjs → crash-report-CtYCva4d.mjs} +3 -3
  17. package/dist/{crash-report-DVZsX1bs.mjs.map → crash-report-CtYCva4d.mjs.map} +1 -1
  18. package/dist/{errors-_M2TVoWh.mjs → errors-wNQxQQBH.mjs} +1 -1
  19. package/dist/{errors-_M2TVoWh.mjs.map → errors-wNQxQQBH.mjs.map} +1 -1
  20. package/dist/{file-utils-775qWKoo.mjs → file-utils-DjNi_3U_.mjs} +9 -9
  21. package/dist/file-utils-DjNi_3U_.mjs.map +1 -0
  22. package/dist/{index-Bd-0JRjy.d.mts → index-B5_4Tzm2.d.mts} +2 -2
  23. package/dist/{index-DIz-15Cx.d.mts → index-BBvPd9Uv.d.mts} +2 -2
  24. package/dist/{index-CemBzf4z.d.mts → index-DUKJPEwq.d.mts} +4 -4
  25. package/dist/{index-SnYVi8ww.d.mts → index-DV-5OIEv.d.mts} +2 -2
  26. package/dist/{index-C_f357K2.d.mts → index-Dxe6alSZ.d.mts} +2 -2
  27. package/dist/{interceptor-4UC-KTno.mjs → interceptor-CrcDfLPq.mjs} +1 -1
  28. package/dist/{interceptor-4UC-KTno.mjs.map → interceptor-CrcDfLPq.mjs.map} +1 -1
  29. package/dist/{kysely-type-BQsYEZoY.mjs → kysely-type-B8aRz_oC.mjs} +6 -6
  30. package/dist/kysely-type-B8aRz_oC.mjs.map +1 -0
  31. package/dist/multiline-e3IpANmS.mjs +39 -0
  32. package/dist/multiline-e3IpANmS.mjs.map +1 -0
  33. package/dist/{package-json-CRzw5eUf.mjs → package-json-6Px8bDpG.mjs} +1 -1
  34. package/dist/{package-json-CRzw5eUf.mjs.map → package-json-6Px8bDpG.mjs.map} +1 -1
  35. package/dist/package-json-7sRXVndJ.mjs +4 -0
  36. package/dist/plugin/builtin/enum-constants/index.d.mts +1 -1
  37. package/dist/plugin/builtin/file-utils/index.d.mts +1 -1
  38. package/dist/plugin/builtin/file-utils/index.mjs +1 -1
  39. package/dist/plugin/builtin/kysely-type/index.d.mts +1 -1
  40. package/dist/plugin/builtin/kysely-type/index.mjs +1 -1
  41. package/dist/plugin/builtin/seed/index.d.mts +1 -1
  42. package/dist/plugin/builtin/seed/index.mjs +1 -1
  43. package/dist/plugin/index.d.mts +2 -2
  44. package/dist/{repl-editor-DjycioU-.mjs → repl-editor-BlT2dFtm.mjs} +1 -1
  45. package/dist/{repl-editor-DjycioU-.mjs.map → repl-editor-BlT2dFtm.mjs.map} +1 -1
  46. package/dist/{runtime-Bmq4L9pj.mjs → runtime-D97Ydu2S.mjs} +211 -51
  47. package/dist/runtime-D97Ydu2S.mjs.map +1 -0
  48. package/dist/{seed-BkVKgsxf.mjs → seed-DrKY5yIF.mjs} +15 -15
  49. package/dist/seed-DrKY5yIF.mjs.map +1 -0
  50. package/dist/{service-CCnx_IFw.mjs → service-CCgw66c6.mjs} +2 -2
  51. package/dist/{service-CCnx_IFw.mjs.map → service-CCgw66c6.mjs.map} +1 -1
  52. package/dist/{tailor-db-field-CY1D1PtT.d.mts → tailor-db-field-Hx9OqPWY.d.mts} +1 -1
  53. package/dist/telemetry-BvI1EgMG.mjs +4 -0
  54. package/dist/{telemetry-B6Le9XT-.mjs → telemetry-DXitz4RH.mjs} +2 -2
  55. package/dist/{telemetry-B6Le9XT-.mjs.map → telemetry-DXitz4RH.mjs.map} +1 -1
  56. package/dist/utils/test/index.d.mts +3 -3
  57. package/dist/{workflow.generated--YammZcl.d.mts → workflow.generated-DFljpJh7.d.mts} +2 -2
  58. package/docs/generator/builtin.md +36 -0
  59. package/package.json +9 -11
  60. package/dist/application-BsSJZRCq.mjs.map +0 -1
  61. package/dist/application-C0O80PUX.mjs +0 -4
  62. package/dist/file-utils-775qWKoo.mjs.map +0 -1
  63. package/dist/kysely-type-BQsYEZoY.mjs.map +0 -1
  64. package/dist/package-json-DR_mqrCW.mjs +0 -4
  65. package/dist/runtime-Bmq4L9pj.mjs.map +0 -1
  66. package/dist/seed-BkVKgsxf.mjs.map +0 -1
  67. package/dist/telemetry-C_WXxIo0.mjs +0 -4
@@ -1,3 +1,3 @@
1
1
  /// <reference types="@tailor-platform/function-types" />
2
- import { n as seedPlugin, t as SeedGeneratorID } from "../../../index-DIz-15Cx.mjs";
2
+ import { n as seedPlugin, t as SeedGeneratorID } from "../../../index-BBvPd9Uv.mjs";
3
3
  export { SeedGeneratorID, seedPlugin };
@@ -1,4 +1,4 @@
1
1
 
2
- import { n as seedPlugin, t as SeedGeneratorID } from "../../../seed-BkVKgsxf.mjs";
2
+ import { n as seedPlugin, t as SeedGeneratorID } from "../../../seed-DrKY5yIF.mjs";
3
3
 
4
4
  export { SeedGeneratorID, seedPlugin };
@@ -1,6 +1,6 @@
1
1
  /// <reference types="@tailor-platform/function-types" />
2
- import { n as TailorAnyDBType } from "../tailor-db-field-CY1D1PtT.mjs";
3
- import { r as TailorEnv, t as TailorActor } from "../actor-CzX_hVOP.mjs";
2
+ import { n as TailorAnyDBType } from "../tailor-db-field-Hx9OqPWY.mjs";
3
+ import { r as TailorEnv, t as TailorActor } from "../actor-BmxQeMFP.mjs";
4
4
 
5
5
  //#region src/plugin/with-context.d.ts
6
6
  /**
@@ -252,4 +252,4 @@ function replTransform(state, event) {
252
252
 
253
253
  //#endregion
254
254
  export { highlightGraphqlLine, highlightSqlLine, replTransform };
255
- //# sourceMappingURL=repl-editor-DjycioU-.mjs.map
255
+ //# sourceMappingURL=repl-editor-BlT2dFtm.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"repl-editor-DjycioU-.mjs","names":[],"sources":["../src/cli/query/repl-editor.ts"],"sourcesContent":["import { GraphQLError, Lexer, Source, TokenKind } from \"graphql\";\nimport { getSegments } from \"sql-highlight\";\nimport type { TransformEvent, TransformState } from \"@toiroakr/read-multiline\";\n\n// ANSI colour sequences. Kept inline (rather than going through `node:util`\n// styleText) so that tests running outside a TTY still produce deterministic\n// escape sequences regardless of detected colour support.\nconst RESET = \"\\x1b[0m\";\nconst BLUE = \"\\x1b[34m\";\nconst MAGENTA = \"\\x1b[35m\";\nconst YELLOW = \"\\x1b[33m\";\nconst BRIGHT_GREEN = \"\\x1b[92m\";\nconst CYAN = \"\\x1b[36m\";\nconst BRIGHT_BLUE = \"\\x1b[94m\";\nconst BOLD_CYAN = \"\\x1b[1;36m\";\nconst BOLD_MAGENTA = \"\\x1b[1;35m\";\nconst ITALIC_YELLOW = \"\\x1b[3;33m\";\nconst GREEN = \"\\x1b[32m\";\nconst DIM = \"\\x1b[90m\";\nconst DIM_YELLOW = \"\\x1b[2;33m\";\n\nconst SQL_STYLE_MAP: Record<string, string> = {\n keyword: BLUE,\n function: MAGENTA,\n identifier: YELLOW,\n string: BRIGHT_GREEN,\n number: CYAN,\n bracket: DIM_YELLOW,\n special: DIM,\n};\n\n/**\n * Highlight a single SQL line using the `sql-highlight` tokenizer.\n * @param line - SQL text for a single editor line\n * @returns ANSI-decorated line safe for terminal output\n */\nexport function highlightSqlLine(line: string): string {\n const segments = getSegments(line);\n let result = \"\";\n for (const seg of segments) {\n const style = SQL_STYLE_MAP[seg.name];\n result += style ? style + seg.content + RESET : seg.content;\n }\n return result;\n}\n\nconst GQL_KEYWORDS = new Set([\n \"query\",\n \"mutation\",\n \"subscription\",\n \"fragment\",\n \"on\",\n \"type\",\n \"input\",\n \"enum\",\n \"interface\",\n \"union\",\n \"scalar\",\n \"extend\",\n \"schema\",\n \"directive\",\n \"implements\",\n]);\n\n// Keywords that introduce a definition name (next NAME token is the def).\nconst GQL_DEF_KEYWORDS = new Set([\"query\", \"mutation\", \"subscription\", \"fragment\"]);\n\nconst GQL_BUILTINS = new Set([\"true\", \"false\", \"null\"]);\n\n/**\n * Highlight a single GraphQL line using the official `graphql` Lexer. Tracks\n * paren depth and the previous token to provide semantic-level colouring\n * (field names vs argument names vs types).\n * @param line - GraphQL text for a single editor line\n * @returns ANSI-decorated line, or the input unchanged when the lexer rejects it\n */\nexport function highlightGraphqlLine(line: string): string {\n if (line.trimStart().startsWith(\"#\")) {\n return `${DIM}${line}${RESET}`;\n }\n\n try {\n const source = new Source(line);\n const lexer = new Lexer(source);\n let result = \"\";\n let pos = 0;\n\n let parenDepth = 0;\n let prevKind: string = \"\";\n let prevText = \"\";\n let afterColon = false;\n\n let token = lexer.advance();\n while (token.kind !== TokenKind.EOF) {\n if (token.start > pos) {\n result += line.slice(pos, token.start);\n }\n\n const text = line.slice(token.start, token.end);\n switch (token.kind) {\n case TokenKind.NAME: {\n if (prevKind === TokenKind.DOLLAR) {\n result += `${MAGENTA}${text}${RESET}`;\n } else if (prevKind === TokenKind.AT) {\n result += `${BOLD_MAGENTA}${text}${RESET}`;\n } else if (GQL_BUILTINS.has(text) || GQL_KEYWORDS.has(text)) {\n result += `${BLUE}${text}${RESET}`;\n } else if (GQL_DEF_KEYWORDS.has(prevText)) {\n result += `${BOLD_CYAN}${text}${RESET}`;\n } else if (afterColon) {\n result += `${CYAN}${text}${RESET}`;\n } else if (parenDepth > 0) {\n result += `${ITALIC_YELLOW}${text}${RESET}`;\n } else {\n result += `${BRIGHT_BLUE}${text}${RESET}`;\n }\n afterColon = false;\n break;\n }\n case TokenKind.INT:\n case TokenKind.FLOAT:\n result += `${BLUE}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.STRING:\n case TokenKind.BLOCK_STRING:\n result += `${GREEN}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.DOLLAR:\n result += `${MAGENTA}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.AT:\n result += `${BOLD_MAGENTA}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.BRACE_L:\n case TokenKind.BRACE_R:\n result += `${YELLOW}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.PAREN_L:\n parenDepth += 1;\n result += `${DIM_YELLOW}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.PAREN_R:\n parenDepth = Math.max(0, parenDepth - 1);\n result += `${DIM_YELLOW}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.BRACKET_L:\n case TokenKind.BRACKET_R:\n result += `${DIM_YELLOW}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.COLON:\n result += `${DIM}${text}${RESET}`;\n afterColon = true;\n break;\n case TokenKind.BANG:\n case TokenKind.EQUALS:\n case TokenKind.PIPE:\n case TokenKind.AMP:\n case TokenKind.SPREAD:\n result += `${DIM}${text}${RESET}`;\n afterColon = false;\n break;\n default:\n result += text;\n afterColon = false;\n }\n\n prevKind = token.kind;\n prevText = text;\n pos = token.end;\n token = lexer.advance();\n }\n\n if (pos < line.length) {\n result += line.slice(pos);\n }\n return result;\n } catch (error) {\n // The lexer throws GraphQLError on partial or invalid input (e.g. an\n // unterminated string while the user is still typing). Fall back to the\n // raw line so the editor keeps rendering without colour until the input\n // is valid. Any other error is a real bug and should surface.\n if (error instanceof GraphQLError) {\n return line;\n }\n throw error;\n }\n}\n\nconst BRACKET_PAIRS: Record<string, string> = { \"(\": \")\", \"[\": \"]\", \"{\": \"}\" };\nconst CLOSE_BRACKETS = new Set(Object.values(BRACKET_PAIRS));\n\n/**\n * Apply auto-close brackets and auto-indent on newline. Works for both SQL\n * and GraphQL because both languages share the `()`, `[]`, `{}` bracket set.\n * @param state - Editor state after the last edit\n * @param event - Event describing the edit that just occurred\n * @returns A new editor state to apply, or `undefined` to leave the state unchanged\n */\nexport function replTransform(\n state: TransformState,\n event: TransformEvent,\n): TransformState | undefined {\n const { lines, row, col } = state;\n\n if (event.type === \"insert\" && event.char in BRACKET_PAIRS) {\n const close = BRACKET_PAIRS[event.char];\n const line = lines[row];\n const newLine = line.slice(0, col) + close + line.slice(col);\n return { lines: lines.with(row, newLine), row, col };\n }\n\n if (event.type === \"insert\" && CLOSE_BRACKETS.has(event.char)) {\n const line = lines[row];\n if (line[col] === event.char) {\n const newLine = line.slice(0, col) + line.slice(col + 1);\n return { lines: lines.with(row, newLine), row, col };\n }\n }\n\n if (event.type === \"backspace\") {\n const line = lines[row];\n const beforeCursor = line.slice(0, col);\n if (beforeCursor.length >= 1 && /^ +$/.test(beforeCursor)) {\n const newIndent = beforeCursor.slice(0, -1);\n const newLine = newIndent + line.slice(col);\n return { lines: lines.with(row, newLine), row, col: newIndent.length };\n }\n }\n\n if (event.type === \"newline\" && row > 0) {\n const prevLine = lines[row - 1];\n const baseIndent = prevLine.match(/^(\\s*)/)?.[1] ?? \"\";\n const endsWithOpen = /[{([]$/.test(prevLine.trimEnd());\n const startsWithClose = /^[}\\])]/.test(lines[row].trimStart());\n\n if (endsWithOpen && startsWithClose) {\n // Bracket expansion: the cursor sits between a matching open/close\n // pair (e.g. `{|}`). Expand into a three-line block with the cursor\n // on an indented middle line.\n const innerIndent = baseIndent + \" \";\n const newLines = [...lines];\n newLines[row] = innerIndent;\n newLines.splice(row + 1, 0, baseIndent + lines[row].trimStart());\n return { lines: newLines, row, col: innerIndent.length };\n }\n if (endsWithOpen) {\n // A lone open bracket on the previous line: drop an extra indent for\n // the new line and auto-insert the matching closing bracket below.\n const openChar = prevLine.trimEnd().slice(-1);\n const closeChar = BRACKET_PAIRS[openChar] ?? \"}\";\n const indent = baseIndent + \" \";\n const newLines = [...lines];\n newLines[row] = indent + lines[row];\n newLines.splice(row + 1, 0, baseIndent + closeChar);\n return { lines: newLines, row, col: indent.length };\n }\n if (baseIndent && col === 0) {\n return { lines: lines.with(row, baseIndent + lines[row]), row, col: baseIndent.length };\n }\n }\n\n return undefined;\n}\n"],"mappings":";;;;;AAOA,MAAM,QAAQ;AACd,MAAM,OAAO;AACb,MAAM,UAAU;AAChB,MAAM,SAAS;AACf,MAAM,eAAe;AACrB,MAAM,OAAO;AACb,MAAM,cAAc;AACpB,MAAM,YAAY;AAClB,MAAM,eAAe;AACrB,MAAM,gBAAgB;AACtB,MAAM,QAAQ;AACd,MAAM,MAAM;AACZ,MAAM,aAAa;AAEnB,MAAM,gBAAwC;CAC5C,SAAS;CACT,UAAU;CACV,YAAY;CACZ,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,SAAS;CACV;;;;;;AAOD,SAAgB,iBAAiB,MAAsB;CACrD,MAAM,WAAW,YAAY,KAAK;CAClC,IAAI,SAAS;AACb,MAAK,MAAM,OAAO,UAAU;EAC1B,MAAM,QAAQ,cAAc,IAAI;AAChC,YAAU,QAAQ,QAAQ,IAAI,UAAU,QAAQ,IAAI;;AAEtD,QAAO;;AAGT,MAAM,eAAe,IAAI,IAAI;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAGF,MAAM,mBAAmB,IAAI,IAAI;CAAC;CAAS;CAAY;CAAgB;CAAW,CAAC;AAEnF,MAAM,eAAe,IAAI,IAAI;CAAC;CAAQ;CAAS;CAAO,CAAC;;;;;;;;AASvD,SAAgB,qBAAqB,MAAsB;AACzD,KAAI,KAAK,WAAW,CA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AO;GAAE,OAAO,MAAM,KAAK,KAAK,aAAa,MAAM,KAAK;GAAE;GAAK,KAAK,WAAW;GAAQ"}
1
+ {"version":3,"file":"repl-editor-BlT2dFtm.mjs","names":[],"sources":["../src/cli/query/repl-editor.ts"],"sourcesContent":["import { GraphQLError, Lexer, Source, TokenKind } from \"graphql\";\nimport { getSegments } from \"sql-highlight\";\nimport type { TransformEvent, TransformState } from \"@toiroakr/read-multiline\";\n\n// ANSI colour sequences. Kept inline (rather than going through `node:util`\n// styleText) so that tests running outside a TTY still produce deterministic\n// escape sequences regardless of detected colour support.\nconst RESET = \"\\x1b[0m\";\nconst BLUE = \"\\x1b[34m\";\nconst MAGENTA = \"\\x1b[35m\";\nconst YELLOW = \"\\x1b[33m\";\nconst BRIGHT_GREEN = \"\\x1b[92m\";\nconst CYAN = \"\\x1b[36m\";\nconst BRIGHT_BLUE = \"\\x1b[94m\";\nconst BOLD_CYAN = \"\\x1b[1;36m\";\nconst BOLD_MAGENTA = \"\\x1b[1;35m\";\nconst ITALIC_YELLOW = \"\\x1b[3;33m\";\nconst GREEN = \"\\x1b[32m\";\nconst DIM = \"\\x1b[90m\";\nconst DIM_YELLOW = \"\\x1b[2;33m\";\n\nconst SQL_STYLE_MAP: Record<string, string> = {\n keyword: BLUE,\n function: MAGENTA,\n identifier: YELLOW,\n string: BRIGHT_GREEN,\n number: CYAN,\n bracket: DIM_YELLOW,\n special: DIM,\n};\n\n/**\n * Highlight a single SQL line using the `sql-highlight` tokenizer.\n * @param line - SQL text for a single editor line\n * @returns ANSI-decorated line safe for terminal output\n */\nexport function highlightSqlLine(line: string): string {\n const segments = getSegments(line);\n let result = \"\";\n for (const seg of segments) {\n const style = SQL_STYLE_MAP[seg.name];\n result += style ? style + seg.content + RESET : seg.content;\n }\n return result;\n}\n\nconst GQL_KEYWORDS = new Set([\n \"query\",\n \"mutation\",\n \"subscription\",\n \"fragment\",\n \"on\",\n \"type\",\n \"input\",\n \"enum\",\n \"interface\",\n \"union\",\n \"scalar\",\n \"extend\",\n \"schema\",\n \"directive\",\n \"implements\",\n]);\n\n// Keywords that introduce a definition name (next NAME token is the def).\nconst GQL_DEF_KEYWORDS = new Set([\"query\", \"mutation\", \"subscription\", \"fragment\"]);\n\nconst GQL_BUILTINS = new Set([\"true\", \"false\", \"null\"]);\n\n/**\n * Highlight a single GraphQL line using the official `graphql` Lexer. Tracks\n * paren depth and the previous token to provide semantic-level colouring\n * (field names vs argument names vs types).\n * @param line - GraphQL text for a single editor line\n * @returns ANSI-decorated line, or the input unchanged when the lexer rejects it\n */\nexport function highlightGraphqlLine(line: string): string {\n if (line.trimStart().startsWith(\"#\")) {\n return `${DIM}${line}${RESET}`;\n }\n\n try {\n const source = new Source(line);\n const lexer = new Lexer(source);\n let result = \"\";\n let pos = 0;\n\n let parenDepth = 0;\n let prevKind: string = \"\";\n let prevText = \"\";\n let afterColon = false;\n\n let token = lexer.advance();\n while (token.kind !== TokenKind.EOF) {\n if (token.start > pos) {\n result += line.slice(pos, token.start);\n }\n\n const text = line.slice(token.start, token.end);\n switch (token.kind) {\n case TokenKind.NAME: {\n if (prevKind === TokenKind.DOLLAR) {\n result += `${MAGENTA}${text}${RESET}`;\n } else if (prevKind === TokenKind.AT) {\n result += `${BOLD_MAGENTA}${text}${RESET}`;\n } else if (GQL_BUILTINS.has(text) || GQL_KEYWORDS.has(text)) {\n result += `${BLUE}${text}${RESET}`;\n } else if (GQL_DEF_KEYWORDS.has(prevText)) {\n result += `${BOLD_CYAN}${text}${RESET}`;\n } else if (afterColon) {\n result += `${CYAN}${text}${RESET}`;\n } else if (parenDepth > 0) {\n result += `${ITALIC_YELLOW}${text}${RESET}`;\n } else {\n result += `${BRIGHT_BLUE}${text}${RESET}`;\n }\n afterColon = false;\n break;\n }\n case TokenKind.INT:\n case TokenKind.FLOAT:\n result += `${BLUE}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.STRING:\n case TokenKind.BLOCK_STRING:\n result += `${GREEN}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.DOLLAR:\n result += `${MAGENTA}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.AT:\n result += `${BOLD_MAGENTA}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.BRACE_L:\n case TokenKind.BRACE_R:\n result += `${YELLOW}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.PAREN_L:\n parenDepth += 1;\n result += `${DIM_YELLOW}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.PAREN_R:\n parenDepth = Math.max(0, parenDepth - 1);\n result += `${DIM_YELLOW}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.BRACKET_L:\n case TokenKind.BRACKET_R:\n result += `${DIM_YELLOW}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.COLON:\n result += `${DIM}${text}${RESET}`;\n afterColon = true;\n break;\n case TokenKind.BANG:\n case TokenKind.EQUALS:\n case TokenKind.PIPE:\n case TokenKind.AMP:\n case TokenKind.SPREAD:\n result += `${DIM}${text}${RESET}`;\n afterColon = false;\n break;\n default:\n result += text;\n afterColon = false;\n }\n\n prevKind = token.kind;\n prevText = text;\n pos = token.end;\n token = lexer.advance();\n }\n\n if (pos < line.length) {\n result += line.slice(pos);\n }\n return result;\n } catch (error) {\n // The lexer throws GraphQLError on partial or invalid input (e.g. an\n // unterminated string while the user is still typing). Fall back to the\n // raw line so the editor keeps rendering without colour until the input\n // is valid. Any other error is a real bug and should surface.\n if (error instanceof GraphQLError) {\n return line;\n }\n throw error;\n }\n}\n\nconst BRACKET_PAIRS: Record<string, string> = { \"(\": \")\", \"[\": \"]\", \"{\": \"}\" };\nconst CLOSE_BRACKETS = new Set(Object.values(BRACKET_PAIRS));\n\n/**\n * Apply auto-close brackets and auto-indent on newline. Works for both SQL\n * and GraphQL because both languages share the `()`, `[]`, `{}` bracket set.\n * @param state - Editor state after the last edit\n * @param event - Event describing the edit that just occurred\n * @returns A new editor state to apply, or `undefined` to leave the state unchanged\n */\nexport function replTransform(\n state: TransformState,\n event: TransformEvent,\n): TransformState | undefined {\n const { lines, row, col } = state;\n\n if (event.type === \"insert\" && event.char in BRACKET_PAIRS) {\n const close = BRACKET_PAIRS[event.char];\n const line = lines[row];\n const newLine = line.slice(0, col) + close + line.slice(col);\n return { lines: lines.with(row, newLine), row, col };\n }\n\n if (event.type === \"insert\" && CLOSE_BRACKETS.has(event.char)) {\n const line = lines[row];\n if (line[col] === event.char) {\n const newLine = line.slice(0, col) + line.slice(col + 1);\n return { lines: lines.with(row, newLine), row, col };\n }\n }\n\n if (event.type === \"backspace\") {\n const line = lines[row];\n const beforeCursor = line.slice(0, col);\n if (beforeCursor.length >= 1 && /^ +$/.test(beforeCursor)) {\n const newIndent = beforeCursor.slice(0, -1);\n const newLine = newIndent + line.slice(col);\n return { lines: lines.with(row, newLine), row, col: newIndent.length };\n }\n }\n\n if (event.type === \"newline\" && row > 0) {\n const prevLine = lines[row - 1];\n const baseIndent = prevLine.match(/^(\\s*)/)?.[1] ?? \"\";\n const endsWithOpen = /[{([]$/.test(prevLine.trimEnd());\n const startsWithClose = /^[}\\])]/.test(lines[row].trimStart());\n\n if (endsWithOpen && startsWithClose) {\n // Bracket expansion: the cursor sits between a matching open/close\n // pair (e.g. `{|}`). Expand into a three-line block with the cursor\n // on an indented middle line.\n const innerIndent = baseIndent + \" \";\n const newLines = [...lines];\n newLines[row] = innerIndent;\n newLines.splice(row + 1, 0, baseIndent + lines[row].trimStart());\n return { lines: newLines, row, col: innerIndent.length };\n }\n if (endsWithOpen) {\n // A lone open bracket on the previous line: drop an extra indent for\n // the new line and auto-insert the matching closing bracket below.\n const openChar = prevLine.trimEnd().slice(-1);\n const closeChar = BRACKET_PAIRS[openChar] ?? \"}\";\n const indent = baseIndent + \" \";\n const newLines = [...lines];\n newLines[row] = indent + lines[row];\n newLines.splice(row + 1, 0, baseIndent + closeChar);\n return { lines: newLines, row, col: indent.length };\n }\n if (baseIndent && col === 0) {\n return { lines: lines.with(row, ba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M,YAAY,aAAa,MAAM,GAAG,GAAG;GAC3C,MAAM,UAAU,YAAY,KAAK,MAAM,IAAI;AAC3C,UAAO;IAAE,OAAO,MAAM,KAAK,KAAK,QAAQ;IAAE;IAAK,KAAK,UAAU;IAAQ;;;AAI1E,KAAI,MAAM,SAAS,aAAa,MAAM,GAAG;EACvC,MAAM,WAAW,MAAM,MAAM;EAC7B,MAAM,aAAa,SAAS,MAAM,SAAS,GAAG,MAAM;EACpD,MAAM,eAAe,SAAS,KAAK,SAAS,SAAS,CAAC;EACtD,MAAM,kBAAkB,UAAU,KAAK,MAAM,KAAK,WAAW,CAAC;AAE9D,MAAI,gBAAgB,iBAAiB;GAInC,MAAM,cAAc,aAAa;GACjC,MAAM,WAAW,CAAC,GAAG,MAAM;AAC3B,YAAS,OAAO;AAChB,YAAS,OAAO,MAAM,GAAG,GAAG,aAAa,MAAM,KAAK,WAAW,CAAC;AAChE,UAAO;IAAE,OAAO;IAAU;IAAK,KAAK,YAAY;IAAQ;;AAE1D,MAAI,cAAc;GAIhB,MAAM,YAAY,cADD,SAAS,SAAS,CAAC,MAAM,GACF,KAAK;GAC7C,MAAM,SAAS,aAAa;GAC5B,MAAM,WAAW,CAAC,GAAG,MAAM;AAC3B,YAAS,OAAO,SAAS,MAAM;AAC/B,YAAS,OAAO,MAAM,GAAG,GAAG,aAAa,UAAU;AACnD,UAAO;IAAE,OAAO;IAAU;IAAK,KAAK,OAAO;IAAQ;;AAErD,MAAI,cAAc,QAAQ,EACxB,QAAO;GAAE,OAAO,MAAM,KAAK,KAAK,aAAa,MAAM,KAAK;GAAE;GAAK,KAAK,WAAW;GAAQ"}
@@ -1,11 +1,12 @@
1
1
 
2
- 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-DcuQRqSd.mjs";
2
+ 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-BwXkoiMq.mjs";
3
3
  import { t as db } from "./schema-DBq6hr6h.mjs";
4
4
  import { a as parseBoolean, i as symbols, n as logger, r as styles, t as CIPromptError } from "./logger-DTNAMYGy.mjs";
5
- import { C as loadWorkspaceId, D as writePlatformConfig, S as loadAccessToken, _ 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 readPlatformConfig, y as loadConfig } from "./application-BsSJZRCq.mjs";
6
- import { t as readPackageJson } from "./package-json-CRzw5eUf.mjs";
7
- import { n as isCLIError, t as createCLIError } from "./errors-_M2TVoWh.mjs";
8
- import { r as withSpan } from "./telemetry-B6Le9XT-.mjs";
5
+ import { C as loadWorkspaceId, D as writePlatformConfig, S as loadAccessToken, _ 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 readPlatformConfig, y as loadConfig } from "./application-B4zVVNRS.mjs";
6
+ import { t as multiline } from "./multiline-e3IpANmS.mjs";
7
+ import { t as readPackageJson } from "./package-json-6Px8bDpG.mjs";
8
+ import { n as isCLIError, t as createCLIError } from "./errors-wNQxQQBH.mjs";
9
+ import { r as withSpan } from "./telemetry-DXitz4RH.mjs";
9
10
  import { arg, createDefineCommand, defineCommand, runCommand } from "politty";
10
11
  import { z } from "zod";
11
12
  import * as fs$1 from "node:fs";
@@ -16,7 +17,6 @@ import * as path from "pathe";
16
17
  import { formatDistanceToNowStrict } from "date-fns";
17
18
  import { getBorderCharacters, table } from "table";
18
19
  import { pathToFileURL } from "node:url";
19
- import ml from "multiline-ts";
20
20
  import { tmpdir } from "node:os";
21
21
  import { findUpSync } from "find-up-simple";
22
22
  import { xdgConfig } from "xdg-basedir";
@@ -32,7 +32,6 @@ import * as inflection from "inflection";
32
32
  import { ExitPromptError } from "@inquirer/core";
33
33
  import { confirm, input, password } from "@inquirer/prompts";
34
34
  import { isCI } from "std-env";
35
- import ora from "ora";
36
35
  import { setTimeout as setTimeout$1 } from "timers/promises";
37
36
  import { spawn } from "node:child_process";
38
37
  import { watch } from "chokidar";
@@ -810,7 +809,7 @@ ${envFields}
810
809
  ${machineUserFields}
811
810
  }`;
812
811
  const idpNameFields = idpNames?.length ? idpNames.map((name) => ` ${isValidIdentifier(name) ? name : JSON.stringify(name)}: true;`).join("\n") : "";
813
- return ml`
812
+ return multiline`
814
813
  // This file is auto-generated by @tailor-platform/sdk
815
814
  // Do not edit this file manually
816
815
  // Regenerated automatically when running 'tailor-sdk apply' or 'tailor-sdk generate'
@@ -4126,7 +4125,7 @@ async function confirmOwnerConflict(conflicts, appName, yes) {
4126
4125
  if (!await prompt.confirm({
4127
4126
  message: promptMessage,
4128
4127
  default: false
4129
- })) throw new Error(ml`
4128
+ })) throw new Error(multiline`
4130
4129
  Apply cancelled. Resources remain managed by their current applications.
4131
4130
  To override, run again and confirm, or use --yes flag.
4132
4131
  `);
@@ -4154,7 +4153,7 @@ async function confirmUnmanagedResources(resources, appName, yes) {
4154
4153
  if (!await prompt.confirm({
4155
4154
  message: `Allow tailor-sdk to manage these resources for "${appName}"?`,
4156
4155
  default: false
4157
- })) throw new Error(ml`
4156
+ })) throw new Error(multiline`
4158
4157
  Apply cancelled. Resources remain unmanaged.
4159
4158
  To override, run again and confirm, or use --yes flag.
4160
4159
  `);
@@ -4179,7 +4178,7 @@ async function confirmImportantResourceDeletion(resources, yes) {
4179
4178
  if (!await prompt.confirm({
4180
4179
  message: "Are you sure you want to delete these resources?",
4181
4180
  default: false
4182
- })) throw new Error(ml`
4181
+ })) throw new Error(multiline`
4183
4182
  Apply cancelled. Resources will not be deleted.
4184
4183
  To override, run again and confirm, or use --yes flag.
4185
4184
  `);
@@ -6615,7 +6614,7 @@ async function bundleMigrationScript(sourceFile, namespace, migrationNumber) {
6615
6614
  const outputDir = path.resolve(getDistDir(), "migrations");
6616
6615
  fs$1.mkdirSync(outputDir, { recursive: true });
6617
6616
  const entryPath = path.join(outputDir, `migration_${namespace}_${migrationNumber}.entry.js`);
6618
- const entryContent = ml`
6617
+ const entryContent = multiline`
6619
6618
  import { main as _migrationMain } from "${path.resolve(sourceFile).replace(/\\/g, "/")}";
6620
6619
  import { Kysely, TailordbDialect } from "@tailor-platform/sdk/kysely";
6621
6620
 
@@ -6762,6 +6761,170 @@ async function executeScript(options) {
6762
6761
  };
6763
6762
  }
6764
6763
 
6764
+ //#endregion
6765
+ //#region src/cli/shared/spinner.ts
6766
+ const FRAMES = [
6767
+ "⠋",
6768
+ "⠙",
6769
+ "⠹",
6770
+ "⠸",
6771
+ "⠼",
6772
+ "⠴",
6773
+ "⠦",
6774
+ "⠧",
6775
+ "⠇",
6776
+ "⠏"
6777
+ ];
6778
+ const FRAME_INTERVAL_MS = 80;
6779
+ const CURSOR_HIDE = "\x1B[?25l";
6780
+ const CURSOR_SHOW = "\x1B[?25h";
6781
+ const CLEAR_LINE = "\x1B[2K";
6782
+ const CURSOR_TO_START = "\r";
6783
+ const CURSOR_UP = "\x1B[1A";
6784
+ const SYNC_BEGIN = "\x1B[?2026h";
6785
+ const SYNC_END = "\x1B[?2026l";
6786
+ const ANSI_RE = /\u001B\[[0-9;]*[a-zA-Z]/g;
6787
+ function visibleLength(s) {
6788
+ return s.replace(ANSI_RE, "").length;
6789
+ }
6790
+ const activeSpinners = /* @__PURE__ */ new Set();
6791
+ let exitHookInstalled = false;
6792
+ let signalHookInstalled = false;
6793
+ function installExitHook() {
6794
+ if (exitHookInstalled) return;
6795
+ exitHookInstalled = true;
6796
+ process.on("exit", () => {
6797
+ for (const s of activeSpinners) s.cleanupOnExit();
6798
+ });
6799
+ }
6800
+ function installSignalHook() {
6801
+ if (signalHookInstalled) return;
6802
+ signalHookInstalled = true;
6803
+ const handler = () => {
6804
+ for (const s of [...activeSpinners]) s.stop();
6805
+ };
6806
+ process.prependListener("SIGINT", handler);
6807
+ process.prependListener("SIGTERM", handler);
6808
+ }
6809
+ var Spinner = class {
6810
+ text;
6811
+ #indent;
6812
+ #stream;
6813
+ #isEnabled;
6814
+ #frame = 0;
6815
+ #timer;
6816
+ #linesDrawn = 0;
6817
+ #started = false;
6818
+ constructor(options = {}) {
6819
+ this.text = "";
6820
+ this.#indent = options.indent ?? 0;
6821
+ this.#stream = options.stream ?? process.stderr;
6822
+ this.#isEnabled = Boolean(this.#stream.isTTY);
6823
+ }
6824
+ start(text) {
6825
+ if (text !== void 0) this.text = text;
6826
+ if (!this.#isEnabled) {
6827
+ this.#writeLine(`- ${this.text}`);
6828
+ return this;
6829
+ }
6830
+ if (this.#started) return this;
6831
+ installExitHook();
6832
+ installSignalHook();
6833
+ activeSpinners.add(this);
6834
+ this.#started = true;
6835
+ this.#stream.write(CURSOR_HIDE);
6836
+ this.#renderFrame();
6837
+ this.#timer = setInterval(() => this.#renderFrame(), FRAME_INTERVAL_MS);
6838
+ if (typeof this.#timer.unref === "function") this.#timer.unref();
6839
+ return this;
6840
+ }
6841
+ stop() {
6842
+ if (!this.#started) return this;
6843
+ this.#started = false;
6844
+ if (this.#timer) {
6845
+ clearInterval(this.#timer);
6846
+ this.#timer = void 0;
6847
+ }
6848
+ if (this.#isEnabled) {
6849
+ this.#clearDrawn();
6850
+ this.#stream.write(CURSOR_SHOW);
6851
+ }
6852
+ activeSpinners.delete(this);
6853
+ return this;
6854
+ }
6855
+ succeed(text) {
6856
+ return this.#stopAndPersist(symbols.success, text);
6857
+ }
6858
+ fail(text) {
6859
+ return this.#stopAndPersist(symbols.error, text);
6860
+ }
6861
+ warn(text) {
6862
+ return this.#stopAndPersist(symbols.warning, text);
6863
+ }
6864
+ /**
6865
+ * Called by the global exit hook to restore the cursor.
6866
+ * @internal
6867
+ */
6868
+ cleanupOnExit() {
6869
+ if (this.#timer) {
6870
+ clearInterval(this.#timer);
6871
+ this.#timer = void 0;
6872
+ }
6873
+ if (this.#isEnabled) this.#stream.write(CURSOR_SHOW);
6874
+ }
6875
+ #stopAndPersist(symbol, text) {
6876
+ if (text !== void 0) this.text = text;
6877
+ if (this.#started) {
6878
+ this.#started = false;
6879
+ if (this.#timer) {
6880
+ clearInterval(this.#timer);
6881
+ this.#timer = void 0;
6882
+ }
6883
+ if (this.#isEnabled) {
6884
+ this.#clearDrawn();
6885
+ this.#stream.write(CURSOR_SHOW);
6886
+ }
6887
+ activeSpinners.delete(this);
6888
+ }
6889
+ this.#writeLine(`${symbol} ${this.text}`);
6890
+ return this;
6891
+ }
6892
+ #renderFrame() {
6893
+ this.#stream.write(SYNC_BEGIN);
6894
+ this.#clearDrawn();
6895
+ const frame = styles.info(FRAMES[this.#frame] ?? FRAMES[0]);
6896
+ this.#frame = (this.#frame + 1) % FRAMES.length;
6897
+ const line = `${" ".repeat(this.#indent)}${frame} ${this.text}`;
6898
+ this.#stream.write(line);
6899
+ this.#stream.write(SYNC_END);
6900
+ const cols = this.#stream.columns || 80;
6901
+ this.#linesDrawn = Math.max(1, Math.ceil(visibleLength(line) / cols));
6902
+ }
6903
+ #clearDrawn() {
6904
+ if (this.#linesDrawn === 0) return;
6905
+ this.#stream.write(CURSOR_TO_START);
6906
+ this.#stream.write(CLEAR_LINE);
6907
+ for (let i = 1; i < this.#linesDrawn; i++) {
6908
+ this.#stream.write(CURSOR_UP);
6909
+ this.#stream.write(CLEAR_LINE);
6910
+ }
6911
+ this.#linesDrawn = 0;
6912
+ }
6913
+ #writeLine(content) {
6914
+ const indent = " ".repeat(this.#indent);
6915
+ this.#stream.write(`${indent}${content}\n`);
6916
+ }
6917
+ };
6918
+ /**
6919
+ * Create a terminal spinner. Falls back to a single line write in non-TTY
6920
+ * environments so output stays useful in CI logs.
6921
+ * @param options - Spinner options
6922
+ * @returns A Spinner instance
6923
+ */
6924
+ function spinner(options) {
6925
+ return new Spinner(options);
6926
+ }
6927
+
6765
6928
  //#endregion
6766
6929
  //#region src/cli/commands/apply/tailordb/migration.ts
6767
6930
  /**
@@ -6895,16 +7058,13 @@ async function executeMigrations(context, migrations) {
6895
7058
  logger.info(`Using machine user: ${styles.bold(machineUserName)} for namespace '${namespace}'`);
6896
7059
  for (const migration of namespaceMigrations) {
6897
7060
  const migrationLabel = `${migration.namespace}/${formatMigrationNumber(migration.number)}`;
6898
- const spinner = ora({
6899
- text: `Executing migration ${migrationLabel}...`,
6900
- prefixText: ""
6901
- }).start();
7061
+ const sp = spinner().start(`Executing migration ${migrationLabel}...`);
6902
7062
  const result = await executeSingleMigration(options, migration);
6903
7063
  if (result.success) {
6904
- spinner.succeed(`Migration ${migrationLabel} completed successfully`);
7064
+ sp.succeed(`Migration ${migrationLabel} completed successfully`);
6905
7065
  if (result.logs && result.logs.trim()) logger.log(`Logs:\n${result.logs}`);
6906
7066
  } else {
6907
- spinner.fail(`Migration ${migrationLabel} failed`);
7067
+ sp.fail(`Migration ${migrationLabel} failed`);
6908
7068
  if (result.logs) logger.error(`Logs:\n${result.logs}`);
6909
7069
  throw new Error(result.error ?? "Migration failed");
6910
7070
  }
@@ -9531,19 +9691,19 @@ async function getWorkflowExecution(options) {
9531
9691
  };
9532
9692
  }
9533
9693
  async function waitWithSpinner(waitFn, interval, json) {
9534
- const spinner = !json ? ora().start("Waiting for workflow to complete...") : null;
9694
+ const sp = !json ? spinner().start("Waiting for workflow to complete...") : null;
9535
9695
  const updateInterval = setInterval(() => {
9536
- if (spinner) spinner.text = `Waiting for workflow to complete... (${formatTime$2(/* @__PURE__ */ new Date())})`;
9696
+ if (sp) sp.text = `Waiting for workflow to complete... (${formatTime$2(/* @__PURE__ */ new Date())})`;
9537
9697
  }, interval);
9538
9698
  try {
9539
9699
  const result = await waitFn();
9540
9700
  const coloredStatus = colorizeStatus$1(WorkflowExecution_Status[result.status]);
9541
- if (result.status === "SUCCESS") spinner?.succeed(`Completed: ${coloredStatus}`);
9542
- else spinner?.fail(`Completed: ${coloredStatus}`);
9701
+ if (result.status === "SUCCESS") sp?.succeed(`Completed: ${coloredStatus}`);
9702
+ else sp?.fail(`Completed: ${coloredStatus}`);
9543
9703
  return result;
9544
9704
  } finally {
9545
9705
  clearInterval(updateInterval);
9546
- spinner?.stop();
9706
+ sp?.stop();
9547
9707
  }
9548
9708
  }
9549
9709
  /**
@@ -9713,7 +9873,7 @@ async function waitForExecution(options) {
9713
9873
  const { client, workspaceId, executionId, interval, showProgress, trackJobs } = options;
9714
9874
  let lastStatus;
9715
9875
  let lastRunningJobs;
9716
- const spinner = showProgress ? ora({ indent: 2 }).start("Waiting for workflow to complete...") : null;
9876
+ const sp = showProgress ? spinner({ indent: 2 }).start("Waiting for workflow to complete...") : null;
9717
9877
  try {
9718
9878
  while (true) {
9719
9879
  const { execution } = await client.getWorkflowExecution({
@@ -9721,19 +9881,19 @@ async function waitForExecution(options) {
9721
9881
  executionId
9722
9882
  });
9723
9883
  if (!execution) {
9724
- spinner?.fail(`Execution '${executionId}' not found.`);
9884
+ sp?.fail(`Execution '${executionId}' not found.`);
9725
9885
  throw new Error(`Execution '${executionId}' not found.`);
9726
9886
  }
9727
9887
  const now = formatTime$1(/* @__PURE__ */ new Date());
9728
9888
  const coloredStatus = colorizeStatus(execution.status);
9729
9889
  if (execution.status !== lastStatus) {
9730
9890
  if (showProgress) {
9731
- spinner?.stop();
9891
+ sp?.stop();
9732
9892
  logger.info(`Status: ${coloredStatus}`, {
9733
9893
  mode: "stream",
9734
9894
  indent: 2
9735
9895
  });
9736
- spinner?.start(`Waiting for workflow to complete...`);
9896
+ sp?.start(`Waiting for workflow to complete...`);
9737
9897
  }
9738
9898
  lastStatus = execution.status;
9739
9899
  }
@@ -9741,27 +9901,27 @@ async function waitForExecution(options) {
9741
9901
  const runningJobs = getRunningJobs(execution);
9742
9902
  if (runningJobs && runningJobs !== lastRunningJobs) {
9743
9903
  if (showProgress) {
9744
- spinner?.stop();
9904
+ sp?.stop();
9745
9905
  logger.info(`Job | ${runningJobs}: ${coloredStatus}`, {
9746
9906
  mode: "stream",
9747
9907
  indent: 2
9748
9908
  });
9749
- spinner?.start(`Waiting for workflow to complete...`);
9909
+ sp?.start(`Waiting for workflow to complete...`);
9750
9910
  }
9751
9911
  lastRunningJobs = runningJobs;
9752
9912
  }
9753
9913
  }
9754
- if (spinner) spinner.text = `Waiting for workflow to complete... (${now})`;
9914
+ if (sp) sp.text = `Waiting for workflow to complete... (${now})`;
9755
9915
  if (isTerminalStatus(execution.status)) {
9756
- if (execution.status === WorkflowExecution_Status.SUCCESS) spinner?.succeed(`Completed: ${coloredStatus}`);
9757
- else if (execution.status === WorkflowExecution_Status.FAILED) spinner?.fail(`Completed: ${coloredStatus}`);
9758
- else spinner?.warn(`Completed: ${coloredStatus}`);
9916
+ if (execution.status === WorkflowExecution_Status.SUCCESS) sp?.succeed(`Completed: ${coloredStatus}`);
9917
+ else if (execution.status === WorkflowExecution_Status.FAILED) sp?.fail(`Completed: ${coloredStatus}`);
9918
+ else sp?.warn(`Completed: ${coloredStatus}`);
9759
9919
  return toWorkflowExecutionInfo(execution);
9760
9920
  }
9761
9921
  await sleep(interval);
9762
9922
  }
9763
9923
  } catch (error) {
9764
- spinner?.stop();
9924
+ sp?.stop();
9765
9925
  throw error;
9766
9926
  }
9767
9927
  }
@@ -9984,7 +10144,7 @@ async function watchExecutorJob(options) {
9984
10144
  profile: options.profile
9985
10145
  });
9986
10146
  const interval = options.interval ?? 3e3;
9987
- const spinner = ora().start("Waiting for executor job to complete...");
10147
+ const sp = spinner().start("Waiting for executor job to complete...");
9988
10148
  try {
9989
10149
  const { executor } = await client.getExecutorExecutor({
9990
10150
  workspaceId,
@@ -10002,13 +10162,13 @@ async function watchExecutorJob(options) {
10002
10162
  })).job;
10003
10163
  if (!job) throw new Error(`Job '${options.jobId}' not found.`);
10004
10164
  if (isExecutorJobTerminalStatus(job.status)) break;
10005
- spinner.text = `Waiting for executor job... (${formatTime(/* @__PURE__ */ new Date())})`;
10165
+ sp.text = `Waiting for executor job... (${formatTime(/* @__PURE__ */ new Date())})`;
10006
10166
  await setTimeout$1(interval);
10007
10167
  }
10008
10168
  const jobInfo = toExecutorJobInfo(job);
10009
10169
  const coloredStatus = colorizeExecutorJobStatus(jobInfo.status);
10010
- if (job.status === ExecutorJobStatus.SUCCESS) spinner.succeed(`Executor job completed: ${coloredStatus}`);
10011
- else spinner.fail(`Executor job completed: ${coloredStatus}`);
10170
+ if (job.status === ExecutorJobStatus.SUCCESS) sp.succeed(`Executor job completed: ${coloredStatus}`);
10171
+ else sp.fail(`Executor job completed: ${coloredStatus}`);
10012
10172
  const attemptInfos = (await fetchAll(async (pageToken, maxPageSize) => {
10013
10173
  const { attempts, nextPageToken } = await client.listExecutorJobAttempts({
10014
10174
  workspaceId,
@@ -10026,7 +10186,7 @@ async function watchExecutorJob(options) {
10026
10186
  const operationReference = attemptInfos[0]?.operationReference;
10027
10187
  if (operationReference) switch (targetType) {
10028
10188
  case ExecutorTargetType.WORKFLOW:
10029
- spinner.stop();
10189
+ sp.stop();
10030
10190
  try {
10031
10191
  const executionResult = await waitForExecution({
10032
10192
  client,
@@ -10067,7 +10227,7 @@ async function watchExecutorJob(options) {
10067
10227
  }
10068
10228
  case ExecutorTargetType.FUNCTION:
10069
10229
  case ExecutorTargetType.JOB_FUNCTION:
10070
- spinner.start(`Waiting for function execution ${operationReference}...`);
10230
+ sp.start(`Waiting for function execution ${operationReference}...`);
10071
10231
  try {
10072
10232
  while (true) {
10073
10233
  const { execution } = await client.getFunctionExecution({
@@ -10078,8 +10238,8 @@ async function watchExecutorJob(options) {
10078
10238
  if (isFunctionExecutionTerminalStatus(execution.status)) {
10079
10239
  const statusStr = functionExecutionStatusToString(execution.status);
10080
10240
  const coloredFnStatus = colorizeFunctionExecutionStatus(statusStr);
10081
- if (execution.status === FunctionExecution_Status.SUCCESS) spinner.succeed(`Function execution completed: ${coloredFnStatus}`);
10082
- else spinner.fail(`Function execution completed: ${coloredFnStatus}`);
10241
+ if (execution.status === FunctionExecution_Status.SUCCESS) sp.succeed(`Function execution completed: ${coloredFnStatus}`);
10242
+ else sp.fail(`Function execution completed: ${coloredFnStatus}`);
10083
10243
  return {
10084
10244
  job: jobDetail,
10085
10245
  targetType: targetTypeStr,
@@ -10088,11 +10248,11 @@ async function watchExecutorJob(options) {
10088
10248
  functionLogs: options.logs ? execution.logs || void 0 : void 0
10089
10249
  };
10090
10250
  }
10091
- spinner.text = `Waiting for function execution... (${formatTime(/* @__PURE__ */ new Date())})`;
10251
+ sp.text = `Waiting for function execution... (${formatTime(/* @__PURE__ */ new Date())})`;
10092
10252
  await setTimeout$1(interval);
10093
10253
  }
10094
10254
  } catch (error) {
10095
- spinner.warn(`Could not track function execution: ${error instanceof Error ? error.message : error}`);
10255
+ sp.warn(`Could not track function execution: ${error instanceof Error ? error.message : error}`);
10096
10256
  return {
10097
10257
  job: jobDetail,
10098
10258
  targetType: targetTypeStr,
@@ -10107,7 +10267,7 @@ async function watchExecutorJob(options) {
10107
10267
  targetType: targetTypeStr
10108
10268
  };
10109
10269
  } finally {
10110
- spinner.stop();
10270
+ sp.stop();
10111
10271
  }
10112
10272
  }
10113
10273
  function printJobWithAttempts(job) {
@@ -12480,7 +12640,7 @@ const removeCommand$1 = defineAppCommand({
12480
12640
  if (!await prompt.confirm({
12481
12641
  message: "Are you sure you want to remove all resources?",
12482
12642
  default: false
12483
- })) throw new Error(ml`
12643
+ })) throw new Error(multiline`
12484
12644
  Remove cancelled. No resources were deleted.
12485
12645
  To override, run again and confirm, or use --yes flag.
12486
12646
  `);
@@ -13131,7 +13291,7 @@ async function generate(options) {
13131
13291
  if (options.init) await handleInitOption(namespacesWithMigrations, options.yes);
13132
13292
  let pluginManager;
13133
13293
  if (plugins.length > 0) pluginManager = new PluginManager(plugins);
13134
- const { defineApplication } = await import("./application-C0O80PUX.mjs");
13294
+ const { defineApplication } = await import("./application-BIzicxMA.mjs");
13135
13295
  const application = defineApplication({
13136
13296
  config,
13137
13297
  pluginManager
@@ -14339,7 +14499,7 @@ const updateCommand = defineAppCommand({
14339
14499
  //#endregion
14340
14500
  //#region src/cli/bundler/query/query-bundler.ts
14341
14501
  function createSqlEntry() {
14342
- return ml`
14502
+ return multiline`
14343
14503
  import { Kysely, sql, TailordbDialect } from "@tailor-platform/sdk/kysely";
14344
14504
 
14345
14505
  type QueryInput = {
@@ -14370,7 +14530,7 @@ function createSqlEntry() {
14370
14530
  `;
14371
14531
  }
14372
14532
  function createGqlEntry() {
14373
- return ml`
14533
+ return multiline`
14374
14534
  type QueryInput = {
14375
14535
  endpoint: string;
14376
14536
  accessToken: string;
@@ -14946,7 +15106,7 @@ async function runRepl(options) {
14946
15106
  const execute = await prepareQueryExecutor(options);
14947
15107
  const historyPath = getReplHistoryPath(options.engine, options.profile, options.workspaceId);
14948
15108
  const validate = createReplValidator(options.engine);
14949
- const { highlightSqlLine, highlightGraphqlLine, replTransform } = await import("./repl-editor-DjycioU-.mjs");
15109
+ const { highlightSqlLine, highlightGraphqlLine, replTransform } = await import("./repl-editor-BlT2dFtm.mjs");
14950
15110
  const highlight = options.engine === "sql" ? highlightSqlLine : highlightGraphqlLine;
14951
15111
  const prompt = createPrompt({
14952
15112
  prefix: "",
@@ -15280,4 +15440,4 @@ function isDeno() {
15280
15440
 
15281
15441
  //#endregion
15282
15442
  export { deleteCommand$1 as $, getMigrationDirPath as $t, truncate as A, executionsCommand as At, updateOrganization as B, MIGRATION_LABEL_KEY as Bt, listCommand$2 as C, toPageDirection as Cn, jobsCommand as Ct, resumeWorkflow as D, startWorkflow as Dt, resumeCommand as E, startCommand as Et, showCommand as F, getCommand$6 as Ft, getCommand$1 as G, INITIAL_SCHEMA_NUMBER as Gt, treeCommand as H, bundleMigrationScript as Ht, logBetaWarning as I, getExecutor as It, updateFolder as J, compareLocalTypesWithSnapshot as Jt, getOrganization as K, MIGRATE_FILE_NAME as Kt, remove as L, apply as Lt, generate as M, listWorkflowExecutions as Mt, generateCommand as N, functionExecutionStatusToString as Nt, listCommand$3 as O, getCommand$5 as Ot, show as P, formatKeyValueTable as Pt, getFolder as Q, getLatestMigrationNumber as Qt, removeCommand$1 as R, executeScript as Rt, listApps as S, paginationArgs as Sn, getExecutorJob as St, healthCommand as T, watchExecutorJob as Tt, listCommand$4 as U, DB_TYPES_FILE_NAME as Ut, organizationTree as V, parseMigrationLabelNumber as Vt, listOrganizations as W, DIFF_FILE_NAME as Wt, listFolders as X, createSnapshotFromLocalTypes as Xt, listCommand$5 as Y, compareSnapshots as Yt, getCommand$2 as Z, formatMigrationNumber as Zt, getWorkspace as _, commonArgs as _n, webhookCommand as _t, updateUser as a, reconstructSnapshotFromMigrations as an, getCommand$3 as at, createCommand as b, isVerbose as bn, listCommand$9 as bt, listCommand as c, hasChanges as cn, tokenCommand as ct, inviteUser as d, sdkNameLabelKey as dn, generate$1 as dt, getMigrationFilePath as en, deleteFolder as et, restoreCommand as f, trnPrefix as fn, listCommand$8 as ft, getCommand as g, defineAppCommand as gn, listWebhookExecutors as gt, listWorkspaces as h, apiCall as hn, getFunctionRegistry as ht, updateCommand as i, loadDiff as in, listOAuth2Clients as it, truncateCommand as j, getWorkflowExecution as jt, listWorkflows as k, getWorkflow as kt, listUsers as l, getNamespacesWithMigrations as ln, listCommand$7 as lt, listCommand$1 as m, apiCommand as mn, getCommand$4 as mt, query as n, getNextMigrationNumber as nn, createFolder as nt, removeCommand as o, formatDiffSummary as on, getOAuth2Client as ot, restoreWorkspace as p, generateUserTypes as pn, listFunctionRegistries as pt, updateCommand$2 as q, SCHEMA_FILE_NAME as qt, queryCommand as r, isValidMigrationNumber as rn, listCommand$6 as rt, removeUser as s, formatMigrationDiff as sn, getMachineUserToken as st, isNativeTypeScriptRuntime as t, getMigrationFiles as tn, createCommand$1 as tt, inviteCommand as u, prompt as un, listMachineUsers as ut, deleteCommand as v, confirmationArgs as vn, triggerCommand as vt, getAppHealth as w, workspaceArgs as wn, listExecutorJobs as wt, createWorkspace as x, pagedLogArgs as xn, listExecutors as xt, deleteWorkspace as y, deploymentArgs as yn, triggerExecutor as yt, updateCommand$1 as z, waitForExecution$1 as zt };
15283
- //# sourceMappingURL=runtime-Bmq4L9pj.mjs.map
15443
+ //# sourceMappingURL=runtime-D97Ydu2S.mjs.map