@tailor-platform/sdk 1.80.1 → 1.82.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/dist/application-CP0W2sQo.mjs +3 -0
- package/dist/{application-C1d52JP9.mjs → application-CVeA53ok.mjs} +172 -27
- package/dist/application-CVeA53ok.mjs.map +1 -0
- package/dist/cli/index.mjs +19 -34
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.mjs +2 -2
- package/dist/cli/skills.mjs +1 -1
- package/dist/completion/zsh-worker.zsh +1 -1
- package/dist/configure/config/types.d.mts +3 -1
- package/dist/configure/index.d.mts +2 -1
- package/dist/configure/index.mjs +9 -0
- package/dist/configure/index.mjs.map +1 -1
- package/dist/configure/services/idp/permission.d.mts +1 -16
- package/dist/configure/services/index.d.mts +2 -1
- package/dist/configure/services/resolver/index.d.mts +2 -1
- package/dist/configure/services/resolver/permission.d.mts +64 -0
- package/dist/configure/services/resolver/resolver.d.mts +14 -2
- package/dist/configure/services/tailordb/permission.d.mts +1 -16
- package/dist/configure/types/permission-operand.types.d.mts +20 -0
- package/dist/{crashreport-BNWUM6Kf.mjs → crashreport-DMYuHnBN.mjs} +2 -2
- package/dist/{crashreport-BNWUM6Kf.mjs.map → crashreport-DMYuHnBN.mjs.map} +1 -1
- package/dist/{crashreport-BafWvjjX.mjs → crashreport-ecqnz51B.mjs} +1 -1
- package/dist/{globals-DVJ8RVvm.mjs → globals-DUqEetIh.mjs} +11 -2
- package/dist/{globals-DVJ8RVvm.mjs.map → globals-DUqEetIh.mjs.map} +1 -1
- package/dist/{logger-BwS4ppwO.mjs → logger-CXQq9YIp.mjs} +110 -13
- package/dist/logger-CXQq9YIp.mjs.map +1 -0
- package/dist/logger-t5ASCDZm.mjs +49 -0
- package/dist/logger-t5ASCDZm.mjs.map +1 -0
- package/dist/{register-typescript-runtime-Bd4bcLbW.mjs → register-typescript-runtime-O7zQNif0.mjs} +44 -17
- package/dist/register-typescript-runtime-O7zQNif0.mjs.map +1 -0
- package/dist/runtime/globals.d.mts +7 -0
- package/dist/runtime/index.d.mts +3 -1
- package/dist/runtime/index.mjs +2 -1
- package/dist/runtime/logger.d.mts +98 -0
- package/dist/runtime/logger.mjs +3 -0
- package/dist/{service-CDPatibu.mjs → service-B0MaodSg.mjs} +2 -2
- package/dist/{service-CDPatibu.mjs.map → service-B0MaodSg.mjs.map} +1 -1
- package/dist/{service-Cp0I7ZFe.mjs → service-CIGSGg9I.mjs} +2 -2
- package/dist/{service-Cp0I7ZFe.mjs.map → service-CIGSGg9I.mjs.map} +1 -1
- package/dist/service-KnAiVofD.mjs +3 -0
- package/dist/{service_pb-BoLM0X4K.mjs → service_pb-BwZRiNug.mjs} +2 -2
- package/dist/{service_pb-BoLM0X4K.mjs.map → service_pb-BwZRiNug.mjs.map} +1 -1
- package/dist/{service_pb-r1T7kpJc.mjs → service_pb-wRkxUta6.mjs} +1 -1
- package/dist/types/auth.generated.d.mts +14 -2
- package/dist/types/executor.generated.d.mts +19 -0
- package/dist/types/http-adapter.generated.d.mts +5 -0
- package/dist/types/idp.generated.d.mts +30 -0
- package/dist/types/resolver.generated.d.mts +28 -2
- package/dist/types/tailordb.generated.d.mts +15 -1
- package/dist/vitest/environment.mjs +1 -1
- package/dist/vitest/index.d.mts +4 -2
- package/dist/vitest/index.mjs +83 -2
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/mock.d.mts +2 -1
- package/dist/vitest/mocks/file.d.mts +1 -1
- package/dist/vitest/mocks/logger.d.mts +45 -0
- package/dist/vitest/setup.mjs +1 -1
- package/dist/{workspace_resource_pb-Db3fv68L.mjs → workspace_resource_pb-UGK1SSn_.mjs} +7 -2
- package/dist/{workspace_resource_pb-Db3fv68L.mjs.map → workspace_resource_pb-UGK1SSn_.mjs.map} +1 -1
- package/docs/configuration.md +3 -1
- package/docs/runtime.md +4 -0
- package/docs/services/resolver.md +54 -0
- package/docs/testing.md +23 -2
- package/package.json +11 -6
- package/dist/application-C1d52JP9.mjs.map +0 -1
- package/dist/application-Nlh9BHQf.mjs +0 -3
- package/dist/logger-BwS4ppwO.mjs.map +0 -1
- package/dist/register-typescript-runtime-Bd4bcLbW.mjs.map +0 -1
- package/dist/service-Cg7Qibit.mjs +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger-CXQq9YIp.mjs","names":[],"sources":["../src/cli/shared/ascii-table.ts","../src/cli/shared/parse-boolean.ts","../src/cli/shared/logger.ts"],"sourcesContent":["import { eastAsianWidth } from \"get-east-asian-width\";\n\n// eslint-disable-next-line no-control-regex\nconst ANSI_ESCAPE_PATTERN = /\\x1b\\[[0-9;]*m/g;\nconst CARRIAGE_RETURN_PATTERN = /\\r\\n?/g;\n\nconst graphemeSegmenter = new Intl.Segmenter(undefined, { granularity: \"grapheme\" });\n\nexport interface AsciiTableConfig {\n /** Suppress horizontal lines between rows, keeping only the outer border. */\n singleLine?: boolean;\n /** Decide whether to draw the horizontal line at `lineIndex` (range `[0, rowCount]` inclusive). */\n drawHorizontalLine?: (lineIndex: number, rowCount: number) => boolean;\n}\n\ninterface CellLine {\n text: string;\n width: number;\n}\n\nfunction maxOf(values: number[], fallback = 0): number {\n return values.reduce((max, value) => (value > max ? value : max), fallback);\n}\n\nconst TAB_WIDTH = 8;\n\nfunction isStrippableControlCharacter(char: string): boolean {\n const codePoint = char.codePointAt(0) ?? 0;\n if (char === \"\\n\") {\n return false;\n }\n return codePoint <= 0x1f || codePoint === 0x7f;\n}\n\n// Only SGR (color/style) escape sequences are meant to survive; a bare ESC\n// that isn't part of a recognized SGR sequence (e.g. a screen-clear CSI\n// sequence, or a BEL-terminated OSC sequence) is treated like any other\n// control character below and stripped, rather than passed through to the\n// terminal or left with its terminator removed.\nfunction normalizeControlCharacters(value: string): string {\n const sgrSequences = value.match(ANSI_ESCAPE_PATTERN) ?? [];\n return value\n .split(ANSI_ESCAPE_PATTERN)\n .map((segment) => {\n const chars: string[] = [];\n for (const char of segment) {\n if (char === \"\\t\") {\n chars.push(\" \".repeat(TAB_WIDTH));\n } else if (!isStrippableControlCharacter(char)) {\n chars.push(char);\n }\n }\n return chars.join(\"\");\n })\n .reduce((result, segment, i) => result + segment + (sgrSequences[i] ?? \"\"), \"\");\n}\n\nfunction sanitizeCell(cell: unknown): string {\n return normalizeControlCharacters(String(cell ?? \"\").replace(CARRIAGE_RETURN_PATTERN, \"\\n\"));\n}\n\n// Clusters made up entirely of non-printing code points (lone joiners,\n// variation selectors, combining marks, etc.) render with no visible glyph.\nconst ZERO_WIDTH_CLUSTER_PATTERN =\n /^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Format}|\\p{Nonspacing_Mark}|\\p{Enclosing_Mark}|\\p{Surrogate})+$/v;\n// RGI_Emoji covers flags, keycaps, and VS16-forced presentation sequences,\n// which render as 2 columns in terminals even though their first code point\n// alone would measure as narrow/neutral.\nconst RGI_EMOJI_PATTERN = /^\\p{RGI_Emoji}$/v;\n\nfunction displayWidth(value: string): number {\n let width = 0;\n for (const { segment } of graphemeSegmenter.segment(value.replace(ANSI_ESCAPE_PATTERN, \"\"))) {\n if (ZERO_WIDTH_CLUSTER_PATTERN.test(segment)) {\n continue;\n }\n if (RGI_EMOJI_PATTERN.test(segment)) {\n width += 2;\n continue;\n }\n const codePoint = segment.codePointAt(0);\n width += codePoint === undefined ? 0 : eastAsianWidth(codePoint);\n }\n return width;\n}\n\nfunction toCellLines(cell: string): CellLine[] {\n return cell.split(\"\\n\").map((text) => ({ text, width: displayWidth(text) }));\n}\n\nfunction padCell(cellLine: CellLine, width: number): string {\n return cellLine.text + \" \".repeat(Math.max(0, width - cellLine.width));\n}\n\nfunction renderBorder(left: string, join: string, right: string, columnWidths: number[]): string {\n return left + columnWidths.map((width) => \"─\".repeat(width + 2)).join(join) + right;\n}\n\nfunction validateConsistentColumnCount(rows: string[][]): void {\n const columnCount = rows[0]?.length;\n if (columnCount === undefined) {\n return;\n }\n rows.forEach((row, index) => {\n if (row.length !== columnCount) {\n throw new Error(\n `renderTable: all rows must have the same number of columns (expected ${columnCount}, row ${index} has ${row.length}).`,\n );\n }\n });\n}\n\n/**\n * Renders a 2D array of values as a table using single-line Unicode box-drawing borders.\n * Column widths account for East Asian wide characters (measured per grapheme cluster,\n * so combining marks and ZWJ emoji sequences aren't overcounted, non-printing clusters\n * such as a lone joiner or combining mark measure as 0, and flags, keycaps, and\n * VS16-forced emoji presentation are measured as 2 columns) and strip ANSI SGR (color/style)\n * escape codes before measuring. Use this instead of importing a table-rendering package\n * directly.\n * @param data - Table rows; every row must have the same number of columns. Each cell is\n * stringified (`null`/`undefined` become an empty string rather than the literal text\n * \"null\"/\"undefined\"), may contain embedded newlines, has `\\r`/`\\r\\n` normalized to `\\n`,\n * has tabs expanded to spaces, and has other control characters stripped.\n * @param config - Rendering options\n * @returns The rendered table terminated with a trailing newline, or `\"\"` when there are no\n * rows or no columns to display\n */\nexport function renderTable(data: unknown[][], config: AsciiTableConfig = {}): string {\n const rows = data.map((row) => row.map(sanitizeCell));\n validateConsistentColumnCount(rows);\n\n const rowCount = rows.length;\n const columnCount = rows[0]?.length ?? 0;\n if (rowCount === 0 || columnCount === 0) {\n return \"\";\n }\n\n const rowsCellLines = rows.map((row) =>\n Array.from({ length: columnCount }, (_, col) => toCellLines(row[col] ?? \"\")),\n );\n const columnWidths = Array.from({ length: columnCount }, (_, col) =>\n maxOf(rowsCellLines.map((row) => maxOf((row[col] ?? []).map((line) => line.width)))),\n );\n\n const shouldDrawLine = (lineIndex: number): boolean =>\n config.singleLine\n ? lineIndex === 0 || lineIndex === rowCount\n : (config.drawHorizontalLine ?? (() => true))(lineIndex, rowCount);\n\n const lines: string[] = [];\n if (shouldDrawLine(0)) {\n lines.push(renderBorder(\"┌\", \"┬\", \"┐\", columnWidths));\n }\n\n rowsCellLines.forEach((cellLines, rowIndex) => {\n const rowHeight = maxOf(\n cellLines.map((columnLines) => columnLines.length),\n 1,\n );\n for (let line = 0; line < rowHeight; line++) {\n const cells = cellLines.map((columnLines, col) =>\n padCell(columnLines[line] ?? { text: \"\", width: 0 }, columnWidths[col] ?? 0),\n );\n lines.push(`│ ${cells.join(\" │ \")} │`);\n }\n if (rowIndex < rowCount - 1 && shouldDrawLine(rowIndex + 1)) {\n lines.push(renderBorder(\"├\", \"┼\", \"┤\", columnWidths));\n }\n });\n\n if (shouldDrawLine(rowCount)) {\n lines.push(renderBorder(\"└\", \"┴\", \"┘\", columnWidths));\n }\n\n return `${lines.join(\"\\n\")}\\n`;\n}\n","const TRUTHY_VALUES = new Set([\"true\", \"t\", \"yes\", \"y\", \"on\", \"1\"]);\nconst FALSY_VALUES = new Set([\"false\", \"f\", \"no\", \"n\", \"off\", \"0\"]);\n\n/**\n * Parse a string value as a boolean.\n *\n * Recognized values (case-insensitive, trimmed) follow Python's\n * `distutils.util.strtobool` convention:\n * - truthy: `true, t, yes, y, on, 1`\n * - falsy: `false, f, no, n, off, 0`\n *\n * Undefined, empty strings, and unrecognized values return `undefined` so\n * that callers can fall back to their own defaults.\n * @param value - The input string (e.g. an environment variable or CLI flag value)\n * @returns `true`, `false`, or `undefined` when the value is unset or unrecognized\n */\nexport function parseBoolean(value: string | undefined): boolean | undefined {\n if (value === undefined) return undefined;\n const normalized = value.trim().toLowerCase();\n if (normalized === \"\") return undefined;\n if (TRUTHY_VALUES.has(normalized)) return true;\n if (FALSY_VALUES.has(normalized)) return false;\n return undefined;\n}\n","import { formatWithOptions, type InspectOptions } from \"node:util\";\nimport chalk from \"chalk\";\nimport { formatDistanceToNowStrict } from \"date-fns\";\nimport { renderTable } from \"./ascii-table\";\nimport { parseBoolean } from \"./parse-boolean\";\n\n/**\n * Error thrown when a prompt is attempted in a non-interactive environment\n */\nexport class CIPromptError extends Error {\n constructor(message?: string) {\n super(\n message ??\n \"Interactive prompts are not available in this environment. Provide the required options explicitly.\",\n );\n this.name = \"CIPromptError\";\n }\n}\n\n/**\n * Semantic style functions for inline text styling\n */\nexport const styles = {\n // Status colors\n success: chalk.green,\n error: chalk.red,\n warning: chalk.yellow,\n info: chalk.cyan,\n\n // Action colors (for change sets)\n create: chalk.green,\n update: chalk.yellow,\n delete: chalk.red,\n unchanged: chalk.gray,\n\n // Emphasis\n bold: chalk.bold,\n dim: chalk.gray,\n highlight: chalk.cyanBright,\n successBright: chalk.greenBright,\n errorBright: chalk.redBright,\n\n // Resource types\n resourceType: chalk.bold,\n resourceName: chalk.cyan,\n\n // File paths\n path: chalk.cyan,\n\n // Values\n value: chalk.white,\n placeholder: chalk.gray.italic,\n};\n\n/**\n * Standardized symbols for CLI output\n */\nexport const symbols = {\n success: chalk.green(\"\\u2713\"),\n error: chalk.red(\"\\u2716\"),\n warning: chalk.yellow(\"\\u26a0\"),\n info: chalk.cyan(\"i\"),\n create: chalk.green(\"+\"),\n update: chalk.yellow(\"~\"),\n delete: chalk.red(\"-\"),\n replace: chalk.magenta(\"\\u00b1\"),\n bullet: chalk.gray(\"\\u2022\"),\n arrow: chalk.gray(\"\\u2192\"),\n};\n\n/**\n * Log output modes\n */\nexport type LogMode = \"default\" | \"stream\" | \"plain\";\n\nexport interface LogOptions {\n /** Output mode (default: \"default\") */\n mode?: LogMode;\n /** Number of spaces to indent the entire line (default: 0) */\n indent?: number;\n}\n\n/** Field transformer function. null excludes the field from table output. */\nexport type FieldTransformer = ((value: unknown, item: object) => string) | null;\n\nexport interface OutOptions {\n /** Table display field transform/exclude settings. Only applied in table mode (not JSON). */\n display?: Record<string, FieldTransformer>;\n\n /** Show null values in table output (default: false) */\n showNull?: boolean;\n}\n\n// In JSON mode, all logs go to stderr to keep stdout clean for JSON data\nlet _jsonMode = false;\n\n// Type icons for log output\nconst TYPE_ICONS: Record<string, string> = {\n info: \"ℹ\",\n success: \"✔\",\n warn: \"⚠\",\n error: \"✖\",\n debug: \"⚙\",\n trace: \"→\",\n log: \"\",\n};\n\n// Color functions for icon and message text\nconst TYPE_COLORS: Record<string, (text: string) => string> = {\n info: chalk.cyan,\n success: chalk.green,\n warn: chalk.yellow,\n error: chalk.red,\n debug: chalk.gray,\n trace: chalk.gray,\n log: (text) => text,\n};\n\ninterface FormatLogLineOptions {\n mode: string;\n indent: number;\n type: string;\n message: string;\n timestamp?: string;\n}\n\n/**\n * Formats a log line with the appropriate prefix and indentation\n * @param opts - Formatting options\n * @returns Formatted log line\n */\nexport function formatLogLine(opts: FormatLogLineOptions): string {\n const { mode, indent, type, message, timestamp } = opts;\n const indentPrefix = indent > 0 ? \" \".repeat(indent) : \"\";\n const colorFn = TYPE_COLORS[type] || ((text: string) => text);\n\n // Plain mode: color only, no icon, no timestamp\n if (mode === \"plain\") {\n return `${indentPrefix}${colorFn(message)}\\n`;\n }\n\n // Default/Stream mode: with icon and color\n const icon = TYPE_ICONS[type] || \"\";\n const prefix = icon ? `${icon} ` : \"\";\n const coloredOutput = colorFn(`${prefix}${message}`);\n const timestampPrefix = timestamp ?? \"\";\n\n return `${indentPrefix}${timestampPrefix}${coloredOutput}\\n`;\n}\n\n/**\n * Writes a formatted log line to stderr.\n * @param type - Log type (info, success, warn, error, log)\n * @param message - Log message\n * @param opts - Log options (mode and indent)\n */\nfunction writeLog(type: string, message: string, opts?: LogOptions): void {\n const mode = opts?.mode ?? \"default\";\n const indent = opts?.indent ?? 0;\n const inspectOpts: InspectOptions = {\n breakLength: process.stdout.columns || 80,\n };\n const formattedMessage = formatWithOptions(inspectOpts, message);\n const timestamp = mode === \"stream\" ? `${new Date().toLocaleTimeString()} ` : \"\";\n const output = formatLogLine({ mode, indent, type, message: formattedMessage, timestamp });\n process.stderr.write(output);\n}\n\nexport const logger = {\n get jsonMode(): boolean {\n return _jsonMode;\n },\n set jsonMode(value: boolean) {\n _jsonMode = value;\n },\n\n info(message: string, opts?: LogOptions): void {\n writeLog(\"info\", message, opts);\n },\n\n success(message: string, opts?: LogOptions): void {\n writeLog(\"success\", message, opts);\n },\n\n warn(message: string, opts?: LogOptions): void {\n writeLog(\"warn\", message, opts);\n },\n\n error(message: string, opts?: LogOptions): void {\n writeLog(\"error\", message, opts);\n },\n\n log(message: string): void {\n writeLog(\"log\", message, { mode: \"plain\" });\n },\n\n newline(): void {\n process.stderr.write(\"\\n\");\n },\n\n debug(message: string): void {\n if (parseBoolean(process.env.DEBUG) === true) {\n writeLog(\"log\", styles.dim(message), { mode: \"plain\" });\n }\n },\n\n out(data: string | object | object[], options?: OutOptions): void {\n if (typeof data === \"string\") {\n process.stdout.write(data.endsWith(\"\\n\") ? data : data + \"\\n\");\n return;\n }\n\n if (this.jsonMode) {\n // eslint-disable-next-line no-restricted-syntax\n console.log(JSON.stringify(data));\n return;\n }\n\n const display = options?.display;\n\n // Helper to format a value for table display\n const formatValue = (value: unknown, pretty = false): string => {\n if (options?.showNull && value === null) return \"NULL\";\n if (value === null || value === undefined) return \"N/A\";\n if (value instanceof Date) {\n return formatDistanceToNowStrict(value, { addSuffix: true });\n }\n if (typeof value === \"object\") {\n return pretty ? JSON.stringify(value, null, 2) : JSON.stringify(value);\n }\n return String(value);\n };\n\n // Helper to check if field should be excluded\n const isExcluded = (key: string): boolean => {\n return display !== undefined && key in display && display[key] === null;\n };\n\n // Helper to apply transformer or default formatting\n const transformValue = (key: string, value: unknown, item: object, pretty = false): string => {\n if (display && key in display) {\n const transformer = display[key];\n if (transformer) {\n return transformer(value, item);\n }\n }\n return formatValue(value, pretty);\n };\n\n if (!Array.isArray(data)) {\n const entries = Object.entries(data).filter(([key]) => !isExcluded(key));\n const formattedEntries = entries.map(([key, value]) => [\n key,\n transformValue(key, value, data, true),\n ]);\n const t = renderTable(formattedEntries, { singleLine: false });\n process.stdout.write(t);\n return;\n }\n\n if (data.length === 0) {\n return;\n }\n\n const allHeaders = Array.from(new Set(data.flatMap((item) => Object.keys(item))));\n const headers = allHeaders.filter((h) => !isExcluded(h));\n if (headers.length === 0) {\n return;\n }\n const rows = data.map((item) =>\n headers.map((header) =>\n transformValue(header, (item as Record<string, unknown>)[header], item),\n ),\n );\n\n const t = renderTable([head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EACF;EAEA,IAAI,KAAK,WAAW,GAClB;EAIF,MAAM,UADa,MAAM,KAAK,IAAI,IAAI,KAAK,SAAS,SAAS,OAAO,KAAK,IAAI,CAAC,CAAC,CACtD,CAAC,CAAC,QAAQ,MAAM,CAAC,WAAW,CAAC,CAAC;EACvD,IAAI,QAAQ,WAAW,GACrB;EAQF,MAAM,IAAI,YAAY,CAAC,SAAS,GANnB,KAAK,KAAK,SACrB,QAAQ,KAAK,WACX,eAAe,QAAS,KAAiC,SAAS,IAAI,CACxE,CAGoC,CAAC,GAAG,EACxC,qBAAqB,WAAW,aAAa;GAC3C,OAAO,cAAc,KAAK,cAAc,KAAK,cAAc;EAC7D,EACF,CAAC;EACD,QAAQ,OAAO,MAAM,CAAC;CACxB;AACF"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-DXywRVcq.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/runtime/logger.ts
|
|
4
|
+
var logger_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
+
debug: () => debug,
|
|
6
|
+
error: () => error,
|
|
7
|
+
info: () => info,
|
|
8
|
+
setAttributes: () => setAttributes,
|
|
9
|
+
warn: () => warn
|
|
10
|
+
});
|
|
11
|
+
/**
|
|
12
|
+
* See {@link TailorLoggerAPI.debug}.
|
|
13
|
+
* @param args - Forwarded to {@link TailorLoggerAPI.debug}
|
|
14
|
+
*/
|
|
15
|
+
const debug = (...args) => {
|
|
16
|
+
globalThis.tailor.logger.debug(...args);
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* See {@link TailorLoggerAPI.info}.
|
|
20
|
+
* @param args - Forwarded to {@link TailorLoggerAPI.info}
|
|
21
|
+
*/
|
|
22
|
+
const info = (...args) => {
|
|
23
|
+
globalThis.tailor.logger.info(...args);
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* See {@link TailorLoggerAPI.warn}.
|
|
27
|
+
* @param args - Forwarded to {@link TailorLoggerAPI.warn}
|
|
28
|
+
*/
|
|
29
|
+
const warn = (...args) => {
|
|
30
|
+
globalThis.tailor.logger.warn(...args);
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* See {@link TailorLoggerAPI.error}.
|
|
34
|
+
* @param args - Forwarded to {@link TailorLoggerAPI.error}
|
|
35
|
+
*/
|
|
36
|
+
const error = (...args) => {
|
|
37
|
+
globalThis.tailor.logger.error(...args);
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* See {@link TailorLoggerAPI.setAttributes}.
|
|
41
|
+
* @param args - Forwarded to {@link TailorLoggerAPI.setAttributes}
|
|
42
|
+
*/
|
|
43
|
+
const setAttributes = (...args) => {
|
|
44
|
+
globalThis.tailor.logger.setAttributes(...args);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
export { setAttributes as a, logger_exports as i, error as n, warn as o, info as r, debug as t };
|
|
49
|
+
//# sourceMappingURL=logger-t5ASCDZm.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger-t5ASCDZm.mjs","names":[],"sources":["../src/runtime/logger.ts"],"sourcesContent":["/**\n * Structured logging utilities.\n *\n * Thin typed wrapper around the platform-provided `tailor.logger` runtime API.\n * At runtime this delegates to `globalThis.tailor.logger`. Use `mockLogger`\n * from `@tailor-platform/sdk/vitest` to mock these calls in unit tests.\n *\n * Unlike `console.*`, each call carries a severity and structured attributes.\n * The message is written to standard output, and the full entry with its\n * attributes is exported over OpenTelemetry, where the attributes are queryable.\n * @example\n * import { logger } from \"@tailor-platform/sdk/runtime\";\n *\n * logger.setAttributes({ requestId: \"r-123\" });\n * logger.info(\"order processed\", { orderId: \"o-1\", total: 99.5 });\n */\n\n/**\n * A single log attribute value. Values outside this union (`null`, nested\n * objects, mixed-type arrays) are silently dropped by the platform.\n */\nexport type LogAttributeValue =\n | string\n | number\n | boolean\n | readonly string[]\n | readonly number[]\n | readonly boolean[];\n\n/**\n * Structured attributes attached to a log entry. The platform keeps at most 32\n * entries, drops any entry whose key exceeds 128 bytes, and truncates string\n * values over 4096 bytes and arrays over 64 elements.\n */\nexport type LogAttributes = Record<string, LogAttributeValue>;\n\n/**\n * Platform API surface for `tailor.logger`. Describes the shape the platform\n * runtime injects on `globalThis.tailor.logger`.\n *\n * Each method below is also re-exported as a top-level named export from this\n * module so callers can either `import * as logger from\n * \"@tailor-platform/sdk/runtime/logger\"` or pick individual methods.\n */\nexport interface TailorLoggerAPI {\n /**\n * Emits a `debug`-severity log entry.\n * @param message - The log message\n * @param attributes - Structured attributes to attach to this entry\n */\n debug(message: string, attributes?: LogAttributes): void;\n\n /**\n * Emits an `info`-severity log entry.\n * @param message - The log message\n * @param attributes - Structured attributes to attach to this entry\n */\n info(message: string, attributes?: LogAttributes): void;\n\n /**\n * Emits a `warn`-severity log entry.\n * @param message - The log message\n * @param attributes - Structured attributes to attach to this entry\n */\n warn(message: string, attributes?: LogAttributes): void;\n\n /**\n * Emits an `error`-severity log entry.\n * @param message - The log message\n * @param attributes - Structured attributes to attach to this entry\n */\n error(message: string, attributes?: LogAttributes): void;\n\n /**\n * Merges attributes into every subsequent log entry from the current\n * execution. Later keys overwrite earlier ones; per-call attributes passed to\n * `debug`/`info`/`warn`/`error` take precedence.\n * @param attributes - Attributes to attach to subsequent entries\n */\n setAttributes(attributes: LogAttributes): void;\n}\n\n// Each wrapper below inlines the `(globalThis as GlobalWithLogger).tailor.logger` cast\n// (rather than sharing a helper) so bundle-log-level.ts's manualPureFunctions\n// can statically match the callee and tree-shake calls below the build's logLevel.\ntype GlobalWithLogger = { tailor: { logger: TailorLoggerAPI } };\n\n/**\n * See {@link TailorLoggerAPI.debug}.\n * @param args - Forwarded to {@link TailorLoggerAPI.debug}\n */\nexport const debug: TailorLoggerAPI[\"debug\"] = (...args) => {\n (globalThis as GlobalWithLogger).tailor.logger.debug(...args);\n};\n\n/**\n * See {@link TailorLoggerAPI.info}.\n * @param args - Forwarded to {@link TailorLoggerAPI.info}\n */\nexport const info: TailorLoggerAPI[\"info\"] = (...args) => {\n (globalThis as GlobalWithLogger).tailor.logger.info(...args);\n};\n\n/**\n * See {@link TailorLoggerAPI.warn}.\n * @param args - Forwarded to {@link TailorLoggerAPI.warn}\n */\nexport const warn: TailorLoggerAPI[\"warn\"] = (...args) => {\n (globalThis as GlobalWithLogger).tailor.logger.warn(...args);\n};\n\n/**\n * See {@link TailorLoggerAPI.error}.\n * @param args - Forwarded to {@link TailorLoggerAPI.error}\n */\nexport const error: TailorLoggerAPI[\"error\"] = (...args) => {\n (globalThis as GlobalWithLogger).tailor.logger.error(...args);\n};\n\n/**\n * See {@link TailorLoggerAPI.setAttributes}.\n * @param args - Forwarded to {@link TailorLoggerAPI.setAttributes}\n */\nexport const setAttributes: TailorLoggerAPI[\"setAttributes\"] = (...args) => {\n (globalThis as GlobalWithLogger).tailor.logger.setAttributes(...args);\n};\n"],"mappings":";;;;;;;;;;;;;;AA2FA,MAAa,SAAmC,GAAG,SAAS;CAC1D,AAAC,WAAgC,OAAO,OAAO,MAAM,GAAG,IAAI;AAC9D;;;;;AAMA,MAAa,QAAiC,GAAG,SAAS;CACxD,AAAC,WAAgC,OAAO,OAAO,KAAK,GAAG,IAAI;AAC7D;;;;;AAMA,MAAa,QAAiC,GAAG,SAAS;CACxD,AAAC,WAAgC,OAAO,OAAO,KAAK,GAAG,IAAI;AAC7D;;;;;AAMA,MAAa,SAAmC,GAAG,SAAS;CAC1D,AAAC,WAAgC,OAAO,OAAO,MAAM,GAAG,IAAI;AAC9D;;;;;AAMA,MAAa,iBAAmD,GAAG,SAAS;CAC1E,AAAC,WAAgC,OAAO,OAAO,cAAc,GAAG,IAAI;AACtE"}
|
package/dist/{register-typescript-runtime-Bd4bcLbW.mjs → register-typescript-runtime-O7zQNif0.mjs}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as db } from "./schema-CYrle8JZ.mjs";
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as CreateAuthHookRequestSchema, B as IdPLang, Bt as Subgraph_ServiceType, C as CreateStaticWebsiteRequestSchema, Ct as AuthInvokerSchema, D as CreateSecretManagerSecretRequestSchema, Dt as AuthSCIMAttribute_Type, Et as AuthSCIMAttribute_Mutability, Ft as CreateApplicationRequestSchema, H as IdPPermissionPermit, Ht as UpdateAIGatewayRequestSchema, I as PipelineResolver_OperationType, It as GetApplicationSchemaHealthResponse_ApplicationSchemaHealthStatus, Jt as FilterSchema, K as CreateExecutorExecutorRequestSchema, Kt as ConditionSchema, L as CreateIdPServiceRequestSchema, Lt as UpdateApplicationRequestSchema, M as CreatePipelineServiceRequestSchema, Mt as UserProfileProviderConfig_UserProfileProviderType, N as UpdatePipelineResolverRequestSchema, O as CreateSecretManagerVaultRequestSchema, Ot as AuthSCIMAttribute_Uniqueness, P as UpdatePipelineServiceRequestSchema, Q as CreateAuthConnectionRequestSchema, R as UpdateIdPServiceRequestSchema, S as AddCustomDomainRequestSchema, St as AuthIDPConfig_AuthType, Tt as AuthOAuth2Client_GrantType, U as FunctionExecution_Status, V as IdPPermissionOperator, Vt as CreateAIGatewayRequestSchema, X as ExecutorTargetType, Y as ExecutorJobStatus, Yt as PageDirection, Z as ExecutorTriggerType, _ as TailorDBGQLPermission_Permit, _t as UpdateUserProfileConfigRequestSchema, a as CreateWorkflowRequestSchema, at as CreateAuthServiceRequestSchema, b as TailorDBType_Permission_Permit, bt as AuthConnection_Type, ct as UpdateAuthConnectionRequestSchema, d as CreateTailorDBServiceRequestSchema, dt as UpdateAuthMachineUserRequestSchema, et as CreateAuthIDPConfigRequestSchema, f as CreateTailorDBTypeRequestSchema, ft as UpdateAuthOAuth2ClientRequestSchema, g as TailorDBGQLPermission_Operator, gt as UpdateTenantConfigRequestSchema, h as TailorDBGQLPermission_Action, ht as UpdateAuthServiceRequestSchema, i as CreateWorkflowJobFunctionRequestSchema, it as CreateAuthSCIMResourceRequestSchema, j as CreatePipelineResolverRequestSchema, jt as TenantProviderConfig_TenantProviderType, k as UpdateSecretManagerSecretRequestSchema, kt as AuthSCIMConfig_AuthorizationType, l as WorkflowExecution_Status, lt as UpdateAuthHookRequestSchema, mt as UpdateAuthSCIMResourceRequestSchema, nt as CreateAuthOAuth2ClientRequestSchema, o as UpdateWorkflowJobFunctionExecutionPolicyRequestSchema, ot as CreateTenantConfigRequestSchema, p as UpdateTailorDBTypeRequestSchema, pt as UpdateAuthSCIMConfigRequestSchema, q as UpdateExecutorExecutorRequestSchema, qt as Condition_Operator, r as CreateWorkflowJobFunctionExecutionPolicyRequestSchema, rt as CreateAuthSCIMConfigRequestSchema, s as UpdateWorkflowRequestSchema, st as CreateUserProfileConfigRequestSchema, t as WorkspacePlatformUserRole, tt as CreateAuthMachineUserRequestSchema, u as WorkflowJobExecution_Status, ut as UpdateAuthIDPConfigRequestSchema, v as TailorDBTypeSchema, w as UpdateStaticWebsiteRequestSchema, wt as AuthOAuth2Client_ClientType, x as TailorDBType_PermitAction, xt as AuthHookPoint, y as TailorDBType_Permission_Operator, yt as AuthConnection_Status, zt as ApplicationSchemaUpdateAttemptStatus } from "./workspace_resource_pb-UGK1SSn_.mjs";
|
|
3
3
|
import { t as assertDefined } from "./assert-DBxo8jPo.mjs";
|
|
4
|
-
import { a as parseBoolean, i as symbols, n as logger, r as styles, t as CIPromptError } from "./logger-
|
|
5
|
-
import { A as
|
|
6
|
-
import { o as loadFilesWithIgnores, s as functionSchema, t as createExecutorService } from "./service-
|
|
4
|
+
import { a as parseBoolean, i as symbols, n as logger, o as renderTable, r as styles, t as CIPromptError } from "./logger-CXQq9YIp.mjs";
|
|
5
|
+
import { A as defaultPlatformBaseUrl, B as getPlatformBaseUrl, C as getPluginGenerationDependencies, D as hashContent, E as getDistDir, G as rememberPlatformConfigForToken, H as initOperatorClient, J as createApplyLimiter, K as resolveStaticWebsiteUrls, L as getConsoleBaseUrl, M as fetchAllTolerant, N as fetchMachineUserToken, O as hashFile, P as fetchPaged, R as getOAuth2ClientId, T as createBundleCache, U as isDefaultPlatform, V as initOAuth2Client, W as normalizeBaseUrl, Y as LOG_LEVELS, _ as stringifyFunction, d as buildExecutorArgsExpr, f as buildResolverOperationHookExpr, g as TailorDBTypeSchema$1, h as assertUniqueTailorDBTypeNamesWithExternal, i as resolverBundleKey, j as fetchAll, l as HTTP_METHODS, m as assertUniqueLocalTailorDBTypeNames, n as generatePluginFilesIfNeeded, o as WorkflowJobFunctionExecutionPolicySchema, q as byName, r as loadApplication, t as defineApplication, v as resolveTSConfigWithFallback, w as hasGenerationHooks, y as platformBundleDefinePlugin, z as getOrNull } from "./application-CVeA53ok.mjs";
|
|
6
|
+
import { o as loadFilesWithIgnores, s as functionSchema, t as createExecutorService } from "./service-B0MaodSg.mjs";
|
|
7
7
|
import { n as enumConstantsPlugin, t as EnumConstantsGeneratorID } from "./enum-constants-j9QBF0cB.mjs";
|
|
8
8
|
import { t as multiline } from "./multiline-sfHpTZZK.mjs";
|
|
9
9
|
import { n as fileUtilsPlugin, t as FileUtilsGeneratorID } from "./file-utils-DcyIPFQh.mjs";
|
|
@@ -25,7 +25,6 @@ import { ValueSchema, timestampDate } from "@bufbuild/protobuf/wkt";
|
|
|
25
25
|
import * as path from "pathe";
|
|
26
26
|
import { basename, dirname, join, resolve } from "pathe";
|
|
27
27
|
import { formatDistanceToNowStrict } from "date-fns";
|
|
28
|
-
import { getBorderCharacters, table } from "table";
|
|
29
28
|
import { pathToFileURL } from "node:url";
|
|
30
29
|
import * as os from "node:os";
|
|
31
30
|
import { tmpdir } from "node:os";
|
|
@@ -2096,6 +2095,21 @@ function formatPlanSummary(summary) {
|
|
|
2096
2095
|
//#endregion
|
|
2097
2096
|
//#region src/cli/commands/deploy/compare.ts
|
|
2098
2097
|
/**
|
|
2098
|
+
* Canonicalize a proto message (or init shape) into proto JSON for comparison.
|
|
2099
|
+
*
|
|
2100
|
+
* Deserialized messages materialize implicit proto3 fields with their zero
|
|
2101
|
+
* values while locally built init shapes omit them, so comparing the raw
|
|
2102
|
+
* objects reports a diff for every field the SDK does not set — including
|
|
2103
|
+
* fields newly added to the proto. Proto JSON omits implicit zero values on
|
|
2104
|
+
* both sides, which matches wire semantics (unset == zero value).
|
|
2105
|
+
* @param schema - Message schema describing the value
|
|
2106
|
+
* @param value - Message or init shape to canonicalize
|
|
2107
|
+
* @returns Proto JSON representation of the value
|
|
2108
|
+
*/
|
|
2109
|
+
function toComparableProtoJson(schema, value) {
|
|
2110
|
+
return toJson(schema, create(schema, value));
|
|
2111
|
+
}
|
|
2112
|
+
/**
|
|
2099
2113
|
* Stable JSON-like serialization that sorts object keys and ignores proto runtime metadata.
|
|
2100
2114
|
* @param value - Value to serialize
|
|
2101
2115
|
* @returns Stable serialized string
|
|
@@ -4078,8 +4092,8 @@ function normalizeComparableUserAuthPolicy(policy) {
|
|
|
4078
4092
|
passwordRequireLowercase: policy?.passwordRequireLowercase ?? false,
|
|
4079
4093
|
passwordRequireNonAlphanumeric: policy?.passwordRequireNonAlphanumeric ?? false,
|
|
4080
4094
|
passwordRequireNumeric: policy?.passwordRequireNumeric ?? false,
|
|
4081
|
-
passwordMinLength: policy?.passwordMinLength
|
|
4082
|
-
passwordMaxLength: policy?.passwordMaxLength
|
|
4095
|
+
passwordMinLength: policy?.passwordMinLength || 6,
|
|
4096
|
+
passwordMaxLength: policy?.passwordMaxLength || 4096,
|
|
4083
4097
|
allowedEmailDomains: (policy?.allowedEmailDomains ?? []).toSorted(),
|
|
4084
4098
|
allowGoogleOauth: policy?.allowGoogleOauth ?? false,
|
|
4085
4099
|
disablePasswordAuth: policy?.disablePasswordAuth ?? false,
|
|
@@ -10211,6 +10225,21 @@ async function applyTailorDB(client, result, phase = "create-update") {
|
|
|
10211
10225
|
deletedResources.reset();
|
|
10212
10226
|
migrationSnapshotCache.reset();
|
|
10213
10227
|
await executeServicesCreation(client, changeSet);
|
|
10228
|
+
const migratingNamespaces = new Set(pendingMigrations.map((m) => m.namespace));
|
|
10229
|
+
const isOutsideMigrations = (namespaceName) => namespaceName !== void 0 && !migratingNamespaces.has(namespaceName);
|
|
10230
|
+
try {
|
|
10231
|
+
for (const create of changeSet.type.creates) {
|
|
10232
|
+
if (!isOutsideMigrations(create.request.namespaceName)) continue;
|
|
10233
|
+
await client.createTailorDBType(create.request);
|
|
10234
|
+
}
|
|
10235
|
+
for (const update of changeSet.type.updates) {
|
|
10236
|
+
if (!isOutsideMigrations(update.request.namespaceName)) continue;
|
|
10237
|
+
await client.updateTailorDBType(update.request);
|
|
10238
|
+
}
|
|
10239
|
+
} catch (error) {
|
|
10240
|
+
handleOptionalToRequiredError(error, ["Run 'tailor-sdk tailordb migration generate' to create migration files.", "Migration scripts allow you to handle existing data before applying the schema change."]);
|
|
10241
|
+
}
|
|
10242
|
+
await Promise.all([...changeSet.gqlPermission.creates.filter((create) => isOutsideMigrations(create.request.namespaceName)).map((create) => client.createTailorDBGQLPermission(create.request)), ...changeSet.gqlPermission.updates.filter((update) => isOutsideMigrations(update.request.namespaceName)).map((update) => client.updateTailorDBGQLPermission(update.request))]);
|
|
10214
10243
|
const migrationsRequiringScripts = pendingMigrations.filter((m) => m.hasScript);
|
|
10215
10244
|
const migrationCtx = migrationsRequiringScripts.length > 0 ? buildMigrationContextForScripts(client, migrationContext, migrationsRequiringScripts) : void 0;
|
|
10216
10245
|
if (migrationsRequiringScripts.length > 0) {
|
|
@@ -10241,6 +10270,7 @@ async function applyTailorDB(client, result, phase = "create-update") {
|
|
|
10241
10270
|
return !deletedResources.gqlPermissions.has(permKey);
|
|
10242
10271
|
});
|
|
10243
10272
|
if (remainingGqlPermissionDeletes.length > 0) await Promise.all(remainingGqlPermissionDeletes.map((del) => client.deleteTailorDBGQLPermission(del.request)));
|
|
10273
|
+
await Promise.all(changeSet.type.deletes.filter((del) => isOutsideMigrations(del.request.namespaceName) && !deletedResources.types.has(del.name)).map((del) => client.deleteTailorDBType(del.request)));
|
|
10244
10274
|
} else {
|
|
10245
10275
|
await Promise.all([...changeSet.service.creates.map(async (create) => {
|
|
10246
10276
|
await client.createTailorDBService(create.request);
|
|
@@ -10840,7 +10870,7 @@ const tailordbCompareKnownDefaults = {
|
|
|
10840
10870
|
])
|
|
10841
10871
|
};
|
|
10842
10872
|
function normalizeComparableTailorDBType(type) {
|
|
10843
|
-
const normalized = normalizeProtoConfig(type);
|
|
10873
|
+
const normalized = normalizeProtoConfig(toComparableProtoJson(TailorDBTypeSchema, type));
|
|
10844
10874
|
return normalizeTailorDBCompareValue({
|
|
10845
10875
|
name: normalized?.name ?? "",
|
|
10846
10876
|
schema: {
|
|
@@ -10866,7 +10896,7 @@ function normalizeTailorDBCompareValue(value, path) {
|
|
|
10866
10896
|
const normalizedEntries = Object.entries(value).map(([key, entryValue]) => [key, normalizeTailorDBCompareValue(entryValue, [...path, key])]).filter(([, entryValue]) => entryValue !== void 0);
|
|
10867
10897
|
const normalizedObject = Object.fromEntries(normalizedEntries);
|
|
10868
10898
|
if (path.at(-1) === "fields" && Object.keys(normalizedObject).length === 0) return;
|
|
10869
|
-
if (path.at(-1) === "disableGqlOperations" && areNormalizedEqual(normalizedObject, tailordbCompareKnownDefaults.disableGqlOperations)) return;
|
|
10899
|
+
if (path.at(-1) === "disableGqlOperations" && (Object.keys(normalizedObject).length === 0 || areNormalizedEqual(normalizedObject, tailordbCompareKnownDefaults.disableGqlOperations))) return;
|
|
10870
10900
|
return normalizedObject;
|
|
10871
10901
|
}
|
|
10872
10902
|
function matchesNumericStringPath(path) {
|
|
@@ -12179,16 +12209,13 @@ function formatTimestamp(timestamp) {
|
|
|
12179
12209
|
}
|
|
12180
12210
|
/**
|
|
12181
12211
|
* Formats a table with consistent single-line border style.
|
|
12182
|
-
* Use this instead of importing
|
|
12212
|
+
* Use this instead of importing a table-rendering package directly.
|
|
12183
12213
|
* @param data - Table data
|
|
12184
12214
|
* @param config - Table configuration
|
|
12185
12215
|
* @returns Formatted table string
|
|
12186
12216
|
*/
|
|
12187
12217
|
function formatTable(data, config) {
|
|
12188
|
-
return
|
|
12189
|
-
...config,
|
|
12190
|
-
border: getBorderCharacters("norc")
|
|
12191
|
-
});
|
|
12218
|
+
return renderTable(data, config);
|
|
12192
12219
|
}
|
|
12193
12220
|
/**
|
|
12194
12221
|
* Formats a key-value table with single-line border style.
|
|
@@ -18922,7 +18949,7 @@ async function generate(options) {
|
|
|
18922
18949
|
if (options.init) await handleInitOption(namespacesWithMigrations, options.yes);
|
|
18923
18950
|
let pluginManager;
|
|
18924
18951
|
if (plugins.length > 0) pluginManager = new PluginManager(plugins);
|
|
18925
|
-
const { defineApplication } = await import("./application-
|
|
18952
|
+
const { defineApplication } = await import("./application-CP0W2sQo.mjs");
|
|
18926
18953
|
const application = defineApplication({
|
|
18927
18954
|
config,
|
|
18928
18955
|
pluginManager
|
|
@@ -20402,7 +20429,7 @@ async function loadTypeFieldOrder(config, namespace) {
|
|
|
20402
20429
|
try {
|
|
20403
20430
|
const module = await import(pathToFileURL(typeFile).href);
|
|
20404
20431
|
for (const exportedValue of Object.values(module)) {
|
|
20405
|
-
const result = TailorDBTypeSchema.safeParse(exportedValue);
|
|
20432
|
+
const result = TailorDBTypeSchema$1.safeParse(exportedValue);
|
|
20406
20433
|
if (!result.success) continue;
|
|
20407
20434
|
fieldOrder.set(result.data.name, Object.keys(result.data.fields));
|
|
20408
20435
|
}
|
|
@@ -21051,4 +21078,4 @@ async function registerTypeScriptRuntime(hookUrl) {
|
|
|
21051
21078
|
|
|
21052
21079
|
//#endregion
|
|
21053
21080
|
export { listFolders as $, deploymentArgs as $n, handleOptionalToRequiredError as $t, generate as A, generateUserTypes as An, startCommand as At, remove as B, loadConsoleBaseUrl as Bn, deploy as Bt, waitWorkflowExecution as C, formatDiffSummary as Cn, listCommand$8 as Ct, listWorkflows as D, resourceTrn as Dn, jobsCommand as Dt, listCommand$2 as E, getNamespacesWithMigrations as En, getExecutorWaitFailureMessage as Et, openInConfiguredEditor as F, deleteUserTokens as Fn, getWorkflowExecution as Ft, treeCommand as G, readPlatformConfig as Gn, createWorkspace$1 as Gt, updateCommand$1 as H, loadStoredUserTokens as Hn, listCommand$9 as Ht, show as I, fetchLatestToken as In, listWorkflowExecutions as It, getCommand$1 as J, writePlatformConfig as Jn, ensureConfigId as Jt, listCommand$3 as K, resolveUserTokenKey as Kn, formatKeyValueTable as Kt, showCommand as L, hasAnyUserTokenEntry as Ln, functionExecutionStatusToString as Lt, generateMigrationScript as M, apiCall as Mn, getCommand$5 as Mt, writeDbTypesFile as N, assertWritable as Nn, getWorkflow as Nt, truncate as O, sdkNameLabelKey as On, listExecutorJobs as Ot, getConfiguredEditorCommand as P, loadConfig as Pn, executionsCommand as Pt, listCommand$4 as Q, confirmationArgs as Qn, MIGRATION_LABEL_KEY as Qt, extractOwnedNamespaces as R, hasUserTokenEntry as Rn, getCommand$6 as Rt, waitCommand as S, parseMigrationNumberArg as Sn, triggerExecutor as St, resumeWorkflow as T, hasChanges as Tn, getExecutorJob as Tt, updateOrganization as U, loadWorkspaceId as Un, listWorkspaces as Ut, removeCommand$1 as V, loadMachineUserName as Vn, deployFromCLI as Vt, organizationTree as W, platformConfigFromProfile as Wn, createCommand$1 as Wt, updateCommand$2 as X, commonArgs as Xn, waitForExecution as Xt, getOrganization as Y, defineAppCommand as Yn, executeScript as Yt, updateFolder as Z, configArg as Zn, bundleMigrationScript as Zt, deleteWorkspace as _, getNextMigrationNumber as _n, getCommand$4 as _t, updateUser as a, DIFF_FILE_NAME as an, toPageDirection as ar, createFolder as at, getAppHealth as b, reconstructSnapshotFromMigrations as bn, webhookCommand as bt, listCommand as c, SCHEMA_FILE_NAME as cn, getCommand$3 as ct, inviteUser as d, compareSnapshots as dn, tokenCommand as dt, parseMigrationLabelNumber as en, isVerbose as er, getCommand$2 as et, restoreCommand as f, createSnapshotFromLocalTypes as fn, listCommand$6 as ft, deleteCommand as g, getMigrationFiles as gn, listFunctionRegistries as gt, getWorkspace as h, getMigrationFilePath as hn, listCommand$7 as ht, updateCommand as i, DB_TYPES_FILE_NAME as in, resolveMachineUserInputSource as ir, createCommand as it, generateCommand as j, prompt as jn, startWorkflow as jt, truncateCommand as k, PluginManager as kn, watchExecutorJob as kt, listUsers as l, assertValidMigrationFiles as ln, getOAuth2Client as lt, getCommand as m, getMigrationDirPath as mn, generate$1 as mt, query as n, generateAllTypeManifestsFromSnapshot as nn, pagedLogArgs as nr, deleteCommand$1 as nt, removeCommand as o, INITIAL_SCHEMA_NUMBER as on, workspaceArgs as or, listCommand$5 as ot, restoreWorkspace as p, getLatestMigrationNumber as pn, listMachineUsers as pt, listOrganizations as q, saveUserTokens as qn, workspaceNameSchema as qt, queryCommand as r, protoGqlPermission as rn, paginationArgs as rr, deleteFolder as rt, removeUser as s, MIGRATE_FILE_NAME as sn, listOAuth2Clients as st, registerTypeScriptRuntime as t, compareSnapshotWithRemote as tn, multiConfigArg as tr, getFolder as tt, inviteCommand as u, compareLocalTypesWithSnapshot as un, getMachineUserToken as ut, listApps as v, isValidMigrationNumber as vn, getFunctionRegistry as vt, resumeCommand as w, formatMigrationDiff as wn, listExecutors as wt, healthCommand as x, formatMigrationNumber as xn, triggerCommand as xt, listCommand$1 as y, loadDiff as yn, listWebhookExecutors as yt, logBetaWarning as z, loadAccessToken as zn, getExecutor as zt };
|
|
21054
|
-
//# sourceMappingURL=register-typescript-runtime-
|
|
21081
|
+
//# sourceMappingURL=register-typescript-runtime-O7zQNif0.mjs.map
|