@tailor-platform/sdk 1.30.0 → 1.32.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 +64 -0
- package/README.md +3 -1
- package/dist/{application-Bf8SUAtR.mjs → application-B8vok3w2.mjs} +257 -42
- package/dist/application-B8vok3w2.mjs.map +1 -0
- package/dist/{application-DAQVP9CS.mjs → application-DHifc-oA.mjs} +2 -2
- package/dist/cli/index.mjs +67 -70
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +8 -8
- package/dist/cli/lib.mjs +8 -6
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/client-B0wrLUVK.mjs +6 -0
- package/dist/{client-CZmQBXAY.mjs → client-DfdgRZlQ.mjs} +25 -13
- package/dist/{client-CZmQBXAY.mjs.map → client-DfdgRZlQ.mjs.map} +1 -1
- package/dist/configure/index.d.mts +4 -4
- package/dist/configure/index.mjs +1 -1
- package/dist/{crash-report-CYrETw1c.mjs → crash-report-BMEhRxeg.mjs} +1 -1
- package/dist/{crash-report-DizNMVnm.mjs → crash-report-wNxS0IUJ.mjs} +2 -2
- package/dist/{crash-report-DizNMVnm.mjs.map → crash-report-wNxS0IUJ.mjs.map} +1 -1
- package/dist/{env-DiWYe80_.d.mts → env-BgdHfWDn.d.mts} +2 -2
- package/dist/{index-BU7Cd5I4.d.mts → index-BAud4CE7.d.mts} +15 -15
- package/dist/{index-HvMUWjvV.d.mts → index-CdDzh-T2.d.mts} +2 -2
- package/dist/{index-rH_De6hM.d.mts → index-CxgBnxKM.d.mts} +2 -2
- package/dist/{index-DCEMVfJA.d.mts → index-D4Y81vh1.d.mts} +2 -2
- package/dist/{index-2WQbf_LH.d.mts → index-FZMBoUWm.d.mts} +2 -2
- package/dist/plugin/builtin/enum-constants/index.d.mts +1 -1
- package/dist/plugin/builtin/file-utils/index.d.mts +1 -1
- package/dist/plugin/builtin/kysely-type/index.d.mts +1 -1
- package/dist/plugin/builtin/seed/index.d.mts +1 -1
- package/dist/plugin/index.d.mts +2 -2
- package/dist/{plugin-C-UdAM8C.d.mts → plugin-DyVYXZWz.d.mts} +7 -7
- package/dist/{query-C3oQTLvb.mjs → runtime-DbX_UxlC.mjs} +67 -39
- package/dist/runtime-DbX_UxlC.mjs.map +1 -0
- package/dist/{schema-BePzTFBV.mjs → schema-CNWt2FKQ.mjs} +3 -14
- package/dist/schema-CNWt2FKQ.mjs.map +1 -0
- package/dist/utils/test/index.d.mts +8 -3
- package/dist/utils/test/index.mjs +15 -1
- package/dist/utils/test/index.mjs.map +1 -1
- package/dist/{workflow.generated-C5wMcCjB.d.mts → workflow.generated-DMQ-cjyT.d.mts} +2 -2
- package/docs/quickstart.md +12 -0
- package/docs/services/resolver.md +72 -0
- package/docs/services/tailordb.md +78 -6
- package/package.json +15 -12
- package/dist/application-Bf8SUAtR.mjs.map +0 -1
- package/dist/client-CW4Oh3iz.mjs +0 -6
- package/dist/query-C3oQTLvb.mjs.map +0 -1
- package/dist/schema-BePzTFBV.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as DefinedAuth, At as BuiltinIdP, B as TailorDBField, Bt as SCIMResource, D as AuthOwnConfig, E as AuthExternalConfig, F as UserAttributeMap, Ft as SAML, G as TailorTypeGqlPermission, H as TailorDBType, I as UsernameFieldKey, It as SCIMAttribute, J as unsafeAllowAllTypePermission, K as TailorTypePermission, L as ValueOperand, Lt as SCIMAttributeMapping, M as SCIMAttributeType, Mt as IdProvider, N as UserAttributeKey, Nt as OAuth2ClientInput, O as AuthServiceInput, P as UserAttributeListKey, Pt as OIDC, R as TailorAnyDBField, Rt as SCIMAuthorization, T as AuthConfig, U as db, V as TailorDBInstance, Vt as TenantProvider, W as PermissionCondition, _ as GeneratorResult, a as PluginExecutorContext, b as TailorDBNamespaceData, c as PluginGeneratedExecutorWithFile, d as PluginNamespaceProcessContext, dt as unauthenticatedTailorUser, f as PluginOutput, g as ExecutorReadyContext, h as TypePluginOutput, i as PluginConfigs, j as OAuth2ClientGrantType, jt as IDToken, k as BeforeLoginHookArgs, l as PluginGeneratedResolver, m as TailorDBTypeForPlugin, mt as Resolver, n as Plugin, nt as TailorField, o as PluginExecutorContextBase, ot as AttributeList, p as PluginProcessContext, q as unsafeAllowAllGqlPermission, r as PluginAttachment, s as PluginGeneratedExecutor, st as AttributeMap, t as NamespacePluginOutput, u as PluginGeneratedType, ut as TailorUser, v as ResolverNamespaceData, x as TailorDBReadyContext, y as ResolverReadyContext, z as TailorAnyDBType, zt as SCIMConfig } from "../plugin-
|
|
2
|
-
import { t as Env } from "../env-
|
|
3
|
-
import { _ as IdPGqlOperations, a as ResolverExternalConfig, c as WorkflowServiceConfig, d as defineStaticWebSite, f as SecretsConfig, h as IdPExternalConfig, i as ExecutorServiceInput, l as WorkflowServiceInput, m as IdPConfig, o as ResolverServiceConfig, p as defineSecretManager, r as ExecutorServiceConfig, s as ResolverServiceInput, t as RetryPolicy, u as StaticWebsiteConfig, v as IdPGqlOperationsInput } from "../workflow.generated-
|
|
4
|
-
import { $ as AuthInvoker, A as idpUserCreatedTrigger, B as WebhookOperation, C as RecordTrigger, D as authAccessTokenIssuedTrigger, E as ResolverExecutedTrigger, F as recordUpdatedTrigger, G as WORKFLOW_TEST_ENV_KEY, H as Workflow, I as resolverExecutedTrigger, J as WorkflowJobInput, K as WorkflowJob, L as FunctionOperation, M as idpUserUpdatedTrigger, N as recordCreatedTrigger, O as authAccessTokenRefreshedTrigger, P as recordDeletedTrigger, Q as createResolver, R as GqlOperation, S as RecordDeletedArgs, T as ResolverExecutedArgs, U as WorkflowConfig, V as WorkflowOperation, W as createWorkflow, X as createWorkflowJob, Y as WorkflowJobOutput, Z as QueryType, _ as AuthAccessTokenArgs, a as defineGenerators, b as IdpUserTrigger, c as createExecutor, d as IncomingWebhookRequest, et as defineAuth, f as IncomingWebhookTrigger, g as scheduleTrigger, h as ScheduleTrigger, i as defineConfig, j as idpUserDeletedTrigger, k as authAccessTokenRevokedTrigger, l as Trigger, m as ScheduleArgs, n as output, o as definePlugins, p as incomingWebhookTrigger, q as WorkflowJobContext, r as t, s as defineIdp, t as __Infer, u as IncomingWebhookArgs, v as AuthAccessTokenTrigger, w as RecordUpdatedArgs, x as RecordCreatedArgs, y as IdpUserArgs, z as Operation } from "../index-
|
|
1
|
+
import { A as DefinedAuth, At as BuiltinIdP, B as TailorDBField, Bt as SCIMResource, D as AuthOwnConfig, E as AuthExternalConfig, F as UserAttributeMap, Ft as SAML, G as TailorTypeGqlPermission, H as TailorDBType, I as UsernameFieldKey, It as SCIMAttribute, J as unsafeAllowAllTypePermission, K as TailorTypePermission, L as ValueOperand, Lt as SCIMAttributeMapping, M as SCIMAttributeType, Mt as IdProvider, N as UserAttributeKey, Nt as OAuth2ClientInput, O as AuthServiceInput, P as UserAttributeListKey, Pt as OIDC, R as TailorAnyDBField, Rt as SCIMAuthorization, T as AuthConfig, U as db, V as TailorDBInstance, Vt as TenantProvider, W as PermissionCondition, _ as GeneratorResult, a as PluginExecutorContext, b as TailorDBNamespaceData, c as PluginGeneratedExecutorWithFile, d as PluginNamespaceProcessContext, dt as unauthenticatedTailorUser, f as PluginOutput, g as ExecutorReadyContext, h as TypePluginOutput, i as PluginConfigs, j as OAuth2ClientGrantType, jt as IDToken, k as BeforeLoginHookArgs, l as PluginGeneratedResolver, m as TailorDBTypeForPlugin, mt as Resolver, n as Plugin, nt as TailorField, o as PluginExecutorContextBase, ot as AttributeList, p as PluginProcessContext, q as unsafeAllowAllGqlPermission, r as PluginAttachment, s as PluginGeneratedExecutor, st as AttributeMap, t as NamespacePluginOutput, u as PluginGeneratedType, ut as TailorUser, v as ResolverNamespaceData, x as TailorDBReadyContext, y as ResolverReadyContext, z as TailorAnyDBType, zt as SCIMConfig } from "../plugin-DyVYXZWz.mjs";
|
|
2
|
+
import { t as Env } from "../env-BgdHfWDn.mjs";
|
|
3
|
+
import { _ as IdPGqlOperations, a as ResolverExternalConfig, c as WorkflowServiceConfig, d as defineStaticWebSite, f as SecretsConfig, h as IdPExternalConfig, i as ExecutorServiceInput, l as WorkflowServiceInput, m as IdPConfig, o as ResolverServiceConfig, p as defineSecretManager, r as ExecutorServiceConfig, s as ResolverServiceInput, t as RetryPolicy, u as StaticWebsiteConfig, v as IdPGqlOperationsInput } from "../workflow.generated-DMQ-cjyT.mjs";
|
|
4
|
+
import { $ as AuthInvoker, A as idpUserCreatedTrigger, B as WebhookOperation, C as RecordTrigger, D as authAccessTokenIssuedTrigger, E as ResolverExecutedTrigger, F as recordUpdatedTrigger, G as WORKFLOW_TEST_ENV_KEY, H as Workflow, I as resolverExecutedTrigger, J as WorkflowJobInput, K as WorkflowJob, L as FunctionOperation, M as idpUserUpdatedTrigger, N as recordCreatedTrigger, O as authAccessTokenRefreshedTrigger, P as recordDeletedTrigger, Q as createResolver, R as GqlOperation, S as RecordDeletedArgs, T as ResolverExecutedArgs, U as WorkflowConfig, V as WorkflowOperation, W as createWorkflow, X as createWorkflowJob, Y as WorkflowJobOutput, Z as QueryType, _ as AuthAccessTokenArgs, a as defineGenerators, b as IdpUserTrigger, c as createExecutor, d as IncomingWebhookRequest, et as defineAuth, f as IncomingWebhookTrigger, g as scheduleTrigger, h as ScheduleTrigger, i as defineConfig, j as idpUserDeletedTrigger, k as authAccessTokenRevokedTrigger, l as Trigger, m as ScheduleArgs, n as output, o as definePlugins, p as incomingWebhookTrigger, q as WorkflowJobContext, r as t, s as defineIdp, t as __Infer, u as IncomingWebhookArgs, v as AuthAccessTokenTrigger, w as RecordUpdatedArgs, x as RecordCreatedArgs, y as IdpUserArgs, z as Operation } from "../index-BAud4CE7.mjs";
|
|
5
5
|
export { AttributeList, AttributeMap, AuthAccessTokenArgs, AuthAccessTokenTrigger, AuthConfig, AuthExternalConfig, AuthInvoker, AuthOwnConfig, AuthServiceInput, BeforeLoginHookArgs, BuiltinIdP, DefinedAuth, Env, ExecutorReadyContext, ExecutorServiceConfig, ExecutorServiceInput, FunctionOperation, GeneratorResult, GqlOperation, IDToken, IdPConfig, IdPExternalConfig, IdPGqlOperations, IdPGqlOperationsInput as IdPGqlOperationsConfig, IdProvider as IdProviderConfig, IdpUserArgs, IdpUserTrigger, IncomingWebhookArgs, IncomingWebhookRequest, IncomingWebhookTrigger, NamespacePluginOutput, OAuth2ClientInput as OAuth2Client, OAuth2ClientGrantType, OIDC, Operation, PermissionCondition, Plugin, PluginAttachment, PluginConfigs, PluginExecutorContext, PluginExecutorContextBase, PluginGeneratedExecutor, PluginGeneratedExecutorWithFile, PluginGeneratedResolver, PluginGeneratedType, PluginNamespaceProcessContext, PluginOutput, PluginProcessContext, QueryType, RecordCreatedArgs, RecordDeletedArgs, RecordTrigger, RecordUpdatedArgs, Resolver, ResolverExecutedArgs, ResolverExecutedTrigger, ResolverExternalConfig, ResolverNamespaceData, ResolverReadyContext, ResolverServiceConfig, ResolverServiceInput, RetryPolicy, SAML, SCIMAttribute, SCIMAttributeMapping, SCIMAttributeType, SCIMAuthorization, SCIMConfig, SCIMResource, ScheduleArgs, ScheduleTrigger, SecretsConfig, StaticWebsiteConfig, TailorAnyDBField, TailorAnyDBType, TailorDBField, TailorDBInstance, TailorDBNamespaceData, TailorDBReadyContext, TailorDBType, TailorDBTypeForPlugin, TailorField, TailorTypeGqlPermission, TailorTypePermission, TailorUser, TenantProvider as TenantProviderConfig, Trigger, TypePluginOutput, UserAttributeKey, UserAttributeListKey, UserAttributeMap, UsernameFieldKey, ValueOperand, WORKFLOW_TEST_ENV_KEY, WebhookOperation, Workflow, WorkflowConfig, WorkflowJob, WorkflowJobContext, WorkflowJobInput, WorkflowJobOutput, WorkflowOperation, WorkflowServiceConfig, WorkflowServiceInput, authAccessTokenIssuedTrigger, authAccessTokenRefreshedTrigger, authAccessTokenRevokedTrigger, createExecutor, createResolver, createWorkflow, createWorkflowJob, db, defineAuth, defineConfig, defineGenerators, defineIdp, definePlugins, defineSecretManager, defineStaticWebSite, idpUserCreatedTrigger, idpUserDeletedTrigger, idpUserUpdatedTrigger, incomingWebhookTrigger, infer, output, recordCreatedTrigger, recordDeletedTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, t, unauthenticatedTailorUser, unsafeAllowAllGqlPermission, unsafeAllowAllTypePermission };
|
package/dist/configure/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-DEt8GZDa.mjs";
|
|
2
|
-
import { i as t$1, n as unsafeAllowAllGqlPermission, r as unsafeAllowAllTypePermission, t as db } from "../schema-
|
|
2
|
+
import { i as t$1, n as unsafeAllowAllGqlPermission, r as unsafeAllowAllTypePermission, t as db } from "../schema-CNWt2FKQ.mjs";
|
|
3
3
|
import { t as brandValue } from "../brand-GZnI4eYb.mjs";
|
|
4
4
|
import { n as createWorkflowJob, t as WORKFLOW_TEST_ENV_KEY } from "../job-DdfW7vH3.mjs";
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./chunk-DEt8GZDa.mjs";
|
|
2
2
|
import "./logger-CqezTedh.mjs";
|
|
3
3
|
import "./package-json-D3x2nBPB.mjs";
|
|
4
|
-
import { n as reportCrash, t as initCrashReporting } from "./crash-report-
|
|
4
|
+
import { n as reportCrash, t as initCrashReporting } from "./crash-report-wNxS0IUJ.mjs";
|
|
5
5
|
|
|
6
6
|
export { reportCrash };
|
|
@@ -385,7 +385,7 @@ async function reportCrash(error, errorType) {
|
|
|
385
385
|
].join("\n"));
|
|
386
386
|
}
|
|
387
387
|
if (config.remoteEnabled) {
|
|
388
|
-
const { userAgent } = await import("./client-
|
|
388
|
+
const { userAgent } = await import("./client-B0wrLUVK.mjs");
|
|
389
389
|
await sendCrashReport(report, await userAgent());
|
|
390
390
|
}
|
|
391
391
|
} catch {}
|
|
@@ -411,4 +411,4 @@ function initCrashReporting() {
|
|
|
411
411
|
|
|
412
412
|
//#endregion
|
|
413
413
|
export { JSON_FOOTER_MARKER as a, CRASH_LOG_EXTENSION as i, reportCrash as n, parseCrashReportConfig as o, sendCrashReport as r, initCrashReporting as t };
|
|
414
|
-
//# sourceMappingURL=crash-report-
|
|
414
|
+
//# sourceMappingURL=crash-report-wNxS0IUJ.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crash-report-DizNMVnm.mjs","names":[],"sources":["../src/cli/crash-report/config.ts","../src/cli/crash-report/writer.ts","../src/cli/crash-report/sender.ts","../src/cli/crash-report/sanitize.ts","../src/cli/crash-report/report.ts","../src/cli/crash-report/index.ts"],"sourcesContent":["import * as path from \"pathe\";\nimport { isCI } from \"std-env\";\nimport { xdgConfig } from \"xdg-basedir\";\n\nexport interface CrashReportConfig {\n readonly localEnabled: boolean;\n readonly remoteEnabled: boolean;\n readonly localDir: string;\n}\n\n/**\n * Parse crash report configuration from environment variables.\n * Local crash log writing is enabled by default (opt-out via TAILOR_CRASH_REPORTS_LOCAL=off).\n * Remote sending is disabled by default (opt-in via TAILOR_CRASH_REPORTS_REMOTE=on).\n * Both are auto-disabled in CI environments.\n * @returns Crash report configuration\n */\nexport function parseCrashReportConfig(): CrashReportConfig {\n if (isCI) {\n return {\n localEnabled: false,\n remoteEnabled: false,\n localDir: \"\",\n };\n }\n\n const localEnabled = (process.env.TAILOR_CRASH_REPORTS_LOCAL ?? \"on\").toLowerCase() !== \"off\";\n const remoteEnabled = (process.env.TAILOR_CRASH_REPORTS_REMOTE ?? \"off\").toLowerCase() === \"on\";\n const localDir = xdgConfig ? path.join(xdgConfig, \"tailor-platform\", \"crash-reports\") : \"\";\n\n return {\n localEnabled: localEnabled && localDir !== \"\",\n remoteEnabled,\n localDir,\n };\n}\n","import * as fs from \"node:fs\";\nimport * as path from \"pathe\";\nimport type { CrashReport } from \"./report\";\n\nconst MAX_CRASH_FILES = 10;\n\n/** Marker line that separates human-readable content from the JSON footer. */\nexport const JSON_FOOTER_MARKER = \"--- JSON ---\";\n\n/** File extension for crash log files. */\nexport const CRASH_LOG_EXTENSION = \".crash.log\";\n\n/**\n * Format a CrashReport as human-readable text for local crash log files.\n * @param report - Crash report to format\n * @returns Formatted text content\n */\nexport function formatCrashReport(report: CrashReport): string {\n const lines = [\n `Crash Report: ${report.id}`,\n `Timestamp: ${report.timestamp}`,\n `Error Type: ${report.errorType}`,\n \"\",\n \"--- Environment ---\",\n `SDK Version: ${report.sdkVersion}`,\n `Node Version: ${report.nodeVersion}`,\n `OS: ${report.osPlatform} ${report.osRelease}`,\n `Arch: ${report.arch}`,\n \"\",\n \"--- Command ---\",\n `Command: ${report.command}`,\n `Arguments: ${JSON.stringify(report.argv)}`,\n \"\",\n \"--- Error ---\",\n `Name: ${report.errorName}`,\n `Message: ${report.errorMessage}`,\n \"\",\n \"--- Stack Trace ---\",\n report.stackTrace || \"(no stack trace available)\",\n \"\",\n JSON_FOOTER_MARKER,\n JSON.stringify(report),\n \"\",\n ];\n return lines.join(\"\\n\");\n}\n\n/**\n * Generate a filename for a crash log file.\n * Format: {timestamp}-{shortId}.crash.log\n * @param report - Crash report to generate filename for\n * @returns Filename string\n */\nfunction generateFilename(report: CrashReport): string {\n const safeTimestamp = report.timestamp.replace(/[:.]/g, \"-\");\n const shortId = report.id.slice(0, 8);\n return `${safeTimestamp}-${shortId}${CRASH_LOG_EXTENSION}`;\n}\n\n/**\n * Remove old crash log files, keeping only the most recent ones.\n * @param dir - Crash log directory\n */\nfunction cleanupOldFiles(dir: string): void {\n try {\n const files = fs\n .readdirSync(dir)\n .filter((f) => f.endsWith(CRASH_LOG_EXTENSION))\n .sort()\n .reverse();\n\n for (const file of files.slice(MAX_CRASH_FILES)) {\n fs.unlinkSync(path.join(dir, file));\n }\n } catch {\n // Best-effort cleanup, ignore errors\n }\n}\n\n/**\n * Write a crash report to a local file.\n * Creates the directory if it doesn't exist. Keeps only the last 10 crash files.\n * Never throws - returns the file path on success or undefined on failure.\n * @param report - Crash report to write\n * @param dir - Directory to write the crash log file to\n * @returns File path on success, undefined on failure\n */\nexport function writeCrashReport(report: CrashReport, dir: string): string | undefined {\n try {\n fs.mkdirSync(dir, { recursive: true });\n\n const filename = generateFilename(report);\n const filePath = path.join(dir, filename);\n const content = formatCrashReport(report);\n\n fs.writeFileSync(filePath, content, \"utf-8\");\n cleanupOldFiles(dir);\n\n return filePath;\n } catch {\n return undefined;\n }\n}\n","import type { CrashReport } from \"./report\";\n\nconst SEND_TIMEOUT_MS = 5000;\nconst PRODUCTION_ENDPOINT = \"https://sdk-error-tracking-926vh9t4cl.erp.dev/query\";\n\nconst SUBMIT_MUTATION = `\nmutation SubmitCrashReport(\n $id: String!\n $timestamp: String!\n $sdkVersion: String!\n $nodeVersion: String!\n $osPlatform: String!\n $osRelease: String!\n $arch: String!\n $command: String!\n $argv: [String]\n $errorName: String!\n $errorMessage: String!\n $stackTrace: String\n $errorType: String!\n $userId: String\n $userEmail: String\n) {\n submitCrashReport(\n id: $id\n timestamp: $timestamp\n sdkVersion: $sdkVersion\n nodeVersion: $nodeVersion\n osPlatform: $osPlatform\n osRelease: $osRelease\n arch: $arch\n command: $command\n argv: $argv\n errorName: $errorName\n errorMessage: $errorMessage\n stackTrace: $stackTrace\n errorType: $errorType\n userId: $userId\n userEmail: $userEmail\n ) {\n success\n }\n}`;\n\n/**\n * Send a crash report to the remote endpoint via GraphQL mutation.\n * Best-effort: never throws, returns boolean success.\n * @param report - Crash report to send\n * @param ua - User-Agent header value\n * @returns true if the request succeeded, false otherwise\n */\nexport async function sendCrashReport(report: CrashReport, ua: string): Promise<boolean> {\n try {\n const endpoint = process.env.TAILOR_CRASH_REPORT_ENDPOINT || PRODUCTION_ENDPOINT;\n const response = await fetch(endpoint, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"User-Agent\": ua,\n },\n body: JSON.stringify({\n query: SUBMIT_MUTATION,\n variables: report,\n }),\n signal: AbortSignal.timeout(SEND_TIMEOUT_MS),\n });\n\n if (!response.ok) return false;\n\n const data = (await response.json()) as {\n errors?: unknown[];\n data?: { submitCrashReport: { success: boolean } };\n };\n if (data.errors?.length) return false;\n return data.data?.submitCrashReport.success === true;\n } catch {\n return false;\n }\n}\n","import * as os from \"node:os\";\n\nconst HOME_DIR = os.homedir();\n\n// Patterns for sanitization (global variants for use with .replace())\nconst UUID_PATTERN = /\\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\b/gi;\nconst LONG_HEX_PATTERN = /\\b[0-9a-fA-F]{32,}\\b/g;\nconst EMAIL_PATTERN = /\\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}\\b/g;\nconst ABSOLUTE_PATH_PATTERN = /(?:\\/(?:[\\w.@\\- ]+\\/)+[\\w.@\\- ]+)/g;\nconst WINDOWS_PATH_PATTERN = /(?:[A-Za-z]:\\\\(?:[\\w.@\\- ]+\\\\)+[\\w.@\\- ]+)/g;\nconst URL_QUERY_PATTERN = /[?&][^?\\s]*/g;\n\n// Non-global variants for single-match .test() calls (avoids lastIndex state issues)\nconst EMAIL_TEST_PATTERN = /\\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}\\b/;\nconst WINDOWS_DRIVE_TEST_PATTERN = /^[A-Za-z]:\\\\/;\n\n// SDK package path marker for relative paths\nconst SDK_PACKAGE_MARKER = \"packages/sdk/\";\n\nfunction lastSegment(filePath: string, separator: string): string {\n return filePath.split(separator).pop() ?? filePath;\n}\n\n/**\n * Sanitize a stack trace by replacing absolute paths with relative SDK paths.\n * External paths are replaced with `<external>/filename.ext`.\n * Home directories are replaced with `~/<redacted>/`.\n * @param stack - Raw stack trace string\n * @returns Sanitized stack trace\n */\nexport function sanitizeStackTrace(stack: string): string {\n // V8 stack traces start with \"ErrorType: message\\n at ...\".\n // The error message may span multiple lines before the first \" at \" frame.\n // Apply message sanitization to all message lines so secrets embedded in\n // multiline error messages are redacted consistently with errorMessage.\n const firstFrameIndex = stack.search(/\\n\\s+at /);\n let result: string;\n if (firstFrameIndex !== -1) {\n result = sanitizeMessage(stack.slice(0, firstFrameIndex)) + stack.slice(firstFrameIndex);\n } else {\n result = sanitizeMessage(stack);\n }\n\n result = result.replace(ABSOLUTE_PATH_PATTERN, (match) => {\n const sdkIndex = match.indexOf(SDK_PACKAGE_MARKER);\n if (sdkIndex !== -1) {\n return match.slice(sdkIndex);\n }\n\n if (match.startsWith(HOME_DIR)) {\n return `~/<redacted>/${lastSegment(match, \"/\")}`;\n }\n\n return `<external>/${lastSegment(match, \"/\")}`;\n });\n result = result.replace(WINDOWS_PATH_PATTERN, (match) => {\n const normalized = match.replace(/\\\\/g, \"/\");\n const sdkIndex = normalized.indexOf(SDK_PACKAGE_MARKER);\n if (sdkIndex !== -1) {\n return normalized.slice(sdkIndex);\n }\n return `<external>/${lastSegment(match, \"\\\\\")}`;\n });\n return result;\n}\n\n/**\n * Sanitize an error message by redacting sensitive information.\n * Redacts: UUIDs, long hex tokens, email addresses, absolute paths, URL query strings.\n * @param message - Raw error message\n * @returns Sanitized error message\n */\nexport function sanitizeMessage(message: string): string {\n let result = message;\n // Strip serialized request/response bodies that may contain secrets\n result = result.replace(/\\nRequest:\\s*[\\s\\S]*$/, \"\\nRequest: <redacted>\");\n result = result.replace(UUID_PATTERN, \"<uuid>\");\n result = result.replace(LONG_HEX_PATTERN, \"<redacted>\");\n result = result.replace(EMAIL_PATTERN, \"<email>\");\n result = result.replace(URL_QUERY_PATTERN, \"?<redacted>\");\n result = result.replace(ABSOLUTE_PATH_PATTERN, (match) => `<path>/${lastSegment(match, \"/\")}`);\n result = result.replace(WINDOWS_PATH_PATTERN, (match) => `<path>/${lastSegment(match, \"\\\\\")}`);\n\n return result;\n}\n\n/**\n * Sanitize process.argv by keeping command/subcommand names and redacting\n * values of sensitive flags.\n * @param argv - Raw process.argv array\n * @returns Sanitized argv array\n */\nexport function sanitizeArgv(argv: string[]): string[] {\n const result: string[] = [];\n let redactNext = false;\n\n for (const arg of argv) {\n if (redactNext) {\n // If the next token is itself a flag, treat it as a new flag rather\n // than consuming it as the previous flag's value. This avoids leaking\n // the *next* flag's value (e.g., `--verbose --workspace-id secret`\n // would otherwise expose `secret`).\n if (!arg.startsWith(\"-\")) {\n result.push(\"<redacted>\");\n redactNext = false;\n continue;\n }\n redactNext = false;\n }\n\n if (arg.startsWith(\"-\")) {\n // --flag=value: keep flag name, redact value\n const eqIndex = arg.indexOf(\"=\");\n if (eqIndex !== -1) {\n result.push(`${arg.slice(0, eqIndex)}=<redacted>`);\n continue;\n }\n\n // --flag / -f: keep flag name, redact next arg as its value\n result.push(arg);\n redactNext = true;\n continue;\n }\n\n // Redact absolute paths\n if (arg.startsWith(\"/\") && arg.includes(\"/\", 1)) {\n result.push(\"<path>\");\n continue;\n }\n\n // Redact Windows-style absolute paths\n if (WINDOWS_DRIVE_TEST_PATTERN.test(arg)) {\n result.push(\"<path>\");\n continue;\n }\n\n // Redact email addresses\n if (EMAIL_TEST_PATTERN.test(arg)) {\n result.push(\"<email>\");\n continue;\n }\n\n result.push(arg);\n }\n\n return result;\n}\n","import * as crypto from \"node:crypto\";\nimport * as fs from \"node:fs\";\nimport * as os from \"node:os\";\nimport { parseYAML } from \"confbox\";\nimport * as path from \"pathe\";\nimport { xdgConfig } from \"xdg-basedir\";\nimport { sanitizeArgv, sanitizeMessage, sanitizeStackTrace } from \"./sanitize\";\n\nexport type ErrorType = \"uncaughtException\" | \"unhandledRejection\" | \"handledError\";\n\nexport interface CrashReport {\n id: string;\n timestamp: string;\n sdkVersion: string;\n nodeVersion: string;\n osPlatform: string;\n osRelease: string;\n arch: string;\n command: string;\n argv: string[];\n errorName: string;\n errorMessage: string;\n stackTrace: string;\n errorType: ErrorType;\n userId: string | null;\n userEmail: string | null;\n}\n\ninterface BuildCrashReportOptions {\n error: unknown;\n sdkVersion: string;\n errorType: ErrorType;\n}\n\n// Maximum subcommand depth to keep (e.g., \"tailordb migrate generate\" = 3 tokens).\n// Positional arguments beyond this are potentially sensitive user input.\n// Accepted trade-off: plain-text positional args that don't match known patterns\n// (UUIDs, hex tokens, emails, paths) pass through to `command` and `argv`.\n// Full redaction would require embedding the CLI command tree here, which is fragile.\nconst MAX_COMMAND_TOKENS = 3;\n\n/**\n * Parse the command name from process.argv.\n * Extracts up to MAX_COMMAND_TOKENS non-flag arguments after the script name.\n * @returns Parsed command string\n */\nfunction parseCommand(): string {\n const args = process.argv.slice(2);\n const commandParts: string[] = [];\n for (const arg of args) {\n if (arg.startsWith(\"-\") || commandParts.length >= MAX_COMMAND_TOKENS) break;\n commandParts.push(arg);\n }\n return commandParts.join(\" \") || \"<unknown>\";\n}\n\n/**\n * Build a CrashReport data structure from an error and context.\n * All sensitive data is sanitized before inclusion.\n * @param options - Error, SDK version, and crash type\n * @returns Sanitized crash report\n */\nexport function buildCrashReport(options: BuildCrashReportOptions): CrashReport {\n const { error, sdkVersion, errorType } = options;\n\n const isError = error instanceof Error;\n const rawMessage = isError ? error.message : String(error);\n const rawStack = isError && error.stack ? error.stack : \"\";\n const errorName = isError ? error.name : \"UnknownError\";\n\n const currentUser = readCurrentUser();\n\n return {\n id: crypto.randomUUID(),\n timestamp: new Date().toISOString(),\n sdkVersion,\n nodeVersion: process.version,\n osPlatform: process.platform,\n osRelease: os.release(),\n arch: process.arch,\n command: sanitizeMessage(parseCommand()),\n argv: sanitizeArgv(process.argv),\n errorName,\n errorMessage: sanitizeMessage(rawMessage),\n stackTrace: sanitizeStackTrace(rawStack),\n errorType,\n userId: currentUser,\n userEmail: currentUser,\n };\n}\n\n/**\n * Read current_user from Tailor Platform config without side effects.\n * Unlike readPlatformConfig(), this never triggers migration or logs warnings.\n * @returns The current user email, or null if unavailable\n */\nfunction readCurrentUser(): string | null {\n try {\n if (!xdgConfig) return null;\n const configPath = path.join(xdgConfig, \"tailor-platform\", \"config.yaml\");\n if (!fs.existsSync(configPath)) return null;\n const raw = parseYAML(fs.readFileSync(configPath, \"utf-8\")) as { current_user?: string | null };\n return raw?.current_user ?? null;\n } catch {\n return null;\n }\n}\n","import { logger } from \"@/cli/shared/logger\";\nimport { readPackageJson } from \"@/cli/shared/package-json\";\nimport { parseCrashReportConfig } from \"./config\";\nimport { buildCrashReport, type ErrorType } from \"./report\";\nimport { sendCrashReport } from \"./sender\";\nimport { writeCrashReport } from \"./writer\";\n\n/**\n * Report an unexpected crash. Writes a local crash log file and optionally\n * sends the report to a remote endpoint. Displays a user-facing message\n * with the crash log path and a command to submit the report.\n *\n * Never throws - all errors are silently caught.\n * @param error - The error that caused the crash\n * @param errorType - How the error was caught\n */\nexport async function reportCrash(error: unknown, errorType: ErrorType): Promise<void> {\n try {\n const config = parseCrashReportConfig();\n if (!config.localEnabled && !config.remoteEnabled) return;\n\n const packageJson = await readPackageJson();\n const sdkVersion = packageJson.version ?? \"unknown\";\n\n const report = buildCrashReport({ error, sdkVersion, errorType });\n\n if (config.localEnabled) {\n const filePath = writeCrashReport(report, config.localDir);\n if (filePath) {\n logger.log(\n [\n \"\",\n \"An unexpected error occurred. A crash report has been saved to:\",\n ` ${filePath}`,\n \"\",\n \"To submit this report:\",\n ` tailor-sdk crash-report send --file \"${filePath}\"`,\n ].join(\"\\n\"),\n );\n }\n }\n\n if (config.remoteEnabled) {\n // Lazy import: client.ts pulls in heavy dependencies (OAuth2, Connect, Protobuf)\n // that should not be loaded on the startup critical path via initCrashReporting().\n const { userAgent } = await import(\"@/cli/shared/client\");\n const ua = await userAgent();\n await sendCrashReport(report, ua);\n }\n } catch {\n // Never throw from crash reporting\n }\n}\n\n/**\n * Register global uncaughtException and unhandledRejection handlers.\n * These catch errors outside the normal cleanup flow (e.g., during\n * argument parsing). Should be called once at CLI startup before runMain.\n */\nexport function initCrashReporting(): void {\n const config = parseCrashReportConfig();\n if (!config.localEnabled && !config.remoteEnabled) return;\n\n const handleFatal = (error: unknown, errorType: ErrorType) => {\n const message = error instanceof Error ? error.message : String(error);\n logger.error(message);\n void reportCrash(error, errorType).finally(() => {\n process.exit(1);\n });\n };\n\n process.on(\"uncaughtException\", (error) => handleFatal(error, \"uncaughtException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C,cAAc;AAC/C,WAAQ,KAAK,EAAE;IACf;;AAGJ,SAAQ,GAAG,sBAAsB,UAAU,YAAY,OAAO,oBAAoB,CAAC;AACnF,SAAQ,GAAG,uBAAuB,WAAW,YAAY,QAAQ,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"crash-report-wNxS0IUJ.mjs","names":[],"sources":["../src/cli/crash-report/config.ts","../src/cli/crash-report/writer.ts","../src/cli/crash-report/sender.ts","../src/cli/crash-report/sanitize.ts","../src/cli/crash-report/report.ts","../src/cli/crash-report/index.ts"],"sourcesContent":["import * as path from \"pathe\";\nimport { isCI } from \"std-env\";\nimport { xdgConfig } from \"xdg-basedir\";\n\nexport interface CrashReportConfig {\n readonly localEnabled: boolean;\n readonly remoteEnabled: boolean;\n readonly localDir: string;\n}\n\n/**\n * Parse crash report configuration from environment variables.\n * Local crash log writing is enabled by default (opt-out via TAILOR_CRASH_REPORTS_LOCAL=off).\n * Remote sending is disabled by default (opt-in via TAILOR_CRASH_REPORTS_REMOTE=on).\n * Both are auto-disabled in CI environments.\n * @returns Crash report configuration\n */\nexport function parseCrashReportConfig(): CrashReportConfig {\n if (isCI) {\n return {\n localEnabled: false,\n remoteEnabled: false,\n localDir: \"\",\n };\n }\n\n const localEnabled = (process.env.TAILOR_CRASH_REPORTS_LOCAL ?? \"on\").toLowerCase() !== \"off\";\n const remoteEnabled = (process.env.TAILOR_CRASH_REPORTS_REMOTE ?? \"off\").toLowerCase() === \"on\";\n const localDir = xdgConfig ? path.join(xdgConfig, \"tailor-platform\", \"crash-reports\") : \"\";\n\n return {\n localEnabled: localEnabled && localDir !== \"\",\n remoteEnabled,\n localDir,\n };\n}\n","import * as fs from \"node:fs\";\nimport * as path from \"pathe\";\nimport type { CrashReport } from \"./report\";\n\nconst MAX_CRASH_FILES = 10;\n\n/** Marker line that separates human-readable content from the JSON footer. */\nexport const JSON_FOOTER_MARKER = \"--- JSON ---\";\n\n/** File extension for crash log files. */\nexport const CRASH_LOG_EXTENSION = \".crash.log\";\n\n/**\n * Format a CrashReport as human-readable text for local crash log files.\n * @param report - Crash report to format\n * @returns Formatted text content\n */\nexport function formatCrashReport(report: CrashReport): string {\n const lines = [\n `Crash Report: ${report.id}`,\n `Timestamp: ${report.timestamp}`,\n `Error Type: ${report.errorType}`,\n \"\",\n \"--- Environment ---\",\n `SDK Version: ${report.sdkVersion}`,\n `Node Version: ${report.nodeVersion}`,\n `OS: ${report.osPlatform} ${report.osRelease}`,\n `Arch: ${report.arch}`,\n \"\",\n \"--- Command ---\",\n `Command: ${report.command}`,\n `Arguments: ${JSON.stringify(report.argv)}`,\n \"\",\n \"--- Error ---\",\n `Name: ${report.errorName}`,\n `Message: ${report.errorMessage}`,\n \"\",\n \"--- Stack Trace ---\",\n report.stackTrace || \"(no stack trace available)\",\n \"\",\n JSON_FOOTER_MARKER,\n JSON.stringify(report),\n \"\",\n ];\n return lines.join(\"\\n\");\n}\n\n/**\n * Generate a filename for a crash log file.\n * Format: {timestamp}-{shortId}.crash.log\n * @param report - Crash report to generate filename for\n * @returns Filename string\n */\nfunction generateFilename(report: CrashReport): string {\n const safeTimestamp = report.timestamp.replace(/[:.]/g, \"-\");\n const shortId = report.id.slice(0, 8);\n return `${safeTimestamp}-${shortId}${CRASH_LOG_EXTENSION}`;\n}\n\n/**\n * Remove old crash log files, keeping only the most recent ones.\n * @param dir - Crash log directory\n */\nfunction cleanupOldFiles(dir: string): void {\n try {\n const files = fs\n .readdirSync(dir)\n .filter((f) => f.endsWith(CRASH_LOG_EXTENSION))\n .sort()\n .reverse();\n\n for (const file of files.slice(MAX_CRASH_FILES)) {\n fs.unlinkSync(path.join(dir, file));\n }\n } catch {\n // Best-effort cleanup, ignore errors\n }\n}\n\n/**\n * Write a crash report to a local file.\n * Creates the directory if it doesn't exist. Keeps only the last 10 crash files.\n * Never throws - returns the file path on success or undefined on failure.\n * @param report - Crash report to write\n * @param dir - Directory to write the crash log file to\n * @returns File path on success, undefined on failure\n */\nexport function writeCrashReport(report: CrashReport, dir: string): string | undefined {\n try {\n fs.mkdirSync(dir, { recursive: true });\n\n const filename = generateFilename(report);\n const filePath = path.join(dir, filename);\n const content = formatCrashReport(report);\n\n fs.writeFileSync(filePath, content, \"utf-8\");\n cleanupOldFiles(dir);\n\n return filePath;\n } catch {\n return undefined;\n }\n}\n","import type { CrashReport } from \"./report\";\n\nconst SEND_TIMEOUT_MS = 5000;\nconst PRODUCTION_ENDPOINT = \"https://sdk-error-tracking-926vh9t4cl.erp.dev/query\";\n\nconst SUBMIT_MUTATION = `\nmutation SubmitCrashReport(\n $id: String!\n $timestamp: String!\n $sdkVersion: String!\n $nodeVersion: String!\n $osPlatform: String!\n $osRelease: String!\n $arch: String!\n $command: String!\n $argv: [String]\n $errorName: String!\n $errorMessage: String!\n $stackTrace: String\n $errorType: String!\n $userId: String\n $userEmail: String\n) {\n submitCrashReport(\n id: $id\n timestamp: $timestamp\n sdkVersion: $sdkVersion\n nodeVersion: $nodeVersion\n osPlatform: $osPlatform\n osRelease: $osRelease\n arch: $arch\n command: $command\n argv: $argv\n errorName: $errorName\n errorMessage: $errorMessage\n stackTrace: $stackTrace\n errorType: $errorType\n userId: $userId\n userEmail: $userEmail\n ) {\n success\n }\n}`;\n\n/**\n * Send a crash report to the remote endpoint via GraphQL mutation.\n * Best-effort: never throws, returns boolean success.\n * @param report - Crash report to send\n * @param ua - User-Agent header value\n * @returns true if the request succeeded, false otherwise\n */\nexport async function sendCrashReport(report: CrashReport, ua: string): Promise<boolean> {\n try {\n const endpoint = process.env.TAILOR_CRASH_REPORT_ENDPOINT || PRODUCTION_ENDPOINT;\n const response = await fetch(endpoint, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"User-Agent\": ua,\n },\n body: JSON.stringify({\n query: SUBMIT_MUTATION,\n variables: report,\n }),\n signal: AbortSignal.timeout(SEND_TIMEOUT_MS),\n });\n\n if (!response.ok) return false;\n\n const data = (await response.json()) as {\n errors?: unknown[];\n data?: { submitCrashReport: { success: boolean } };\n };\n if (data.errors?.length) return false;\n return data.data?.submitCrashReport.success === true;\n } catch {\n return false;\n }\n}\n","import * as os from \"node:os\";\n\nconst HOME_DIR = os.homedir();\n\n// Patterns for sanitization (global variants for use with .replace())\nconst UUID_PATTERN = /\\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\b/gi;\nconst LONG_HEX_PATTERN = /\\b[0-9a-fA-F]{32,}\\b/g;\nconst EMAIL_PATTERN = /\\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}\\b/g;\nconst ABSOLUTE_PATH_PATTERN = /(?:\\/(?:[\\w.@\\- ]+\\/)+[\\w.@\\- ]+)/g;\nconst WINDOWS_PATH_PATTERN = /(?:[A-Za-z]:\\\\(?:[\\w.@\\- ]+\\\\)+[\\w.@\\- ]+)/g;\nconst URL_QUERY_PATTERN = /[?&][^?\\s]*/g;\n\n// Non-global variants for single-match .test() calls (avoids lastIndex state issues)\nconst EMAIL_TEST_PATTERN = /\\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}\\b/;\nconst WINDOWS_DRIVE_TEST_PATTERN = /^[A-Za-z]:\\\\/;\n\n// SDK package path marker for relative paths\nconst SDK_PACKAGE_MARKER = \"packages/sdk/\";\n\nfunction lastSegment(filePath: string, separator: string): string {\n return filePath.split(separator).pop() ?? filePath;\n}\n\n/**\n * Sanitize a stack trace by replacing absolute paths with relative SDK paths.\n * External paths are replaced with `<external>/filename.ext`.\n * Home directories are replaced with `~/<redacted>/`.\n * @param stack - Raw stack trace string\n * @returns Sanitized stack trace\n */\nexport function sanitizeStackTrace(stack: string): string {\n // V8 stack traces start with \"ErrorType: message\\n at ...\".\n // The error message may span multiple lines before the first \" at \" frame.\n // Apply message sanitization to all message lines so secrets embedded in\n // multiline error messages are redacted consistently with errorMessage.\n const firstFrameIndex = stack.search(/\\n\\s+at /);\n let result: string;\n if (firstFrameIndex !== -1) {\n result = sanitizeMessage(stack.slice(0, firstFrameIndex)) + stack.slice(firstFrameIndex);\n } else {\n result = sanitizeMessage(stack);\n }\n\n result = result.replace(ABSOLUTE_PATH_PATTERN, (match) => {\n const sdkIndex = match.indexOf(SDK_PACKAGE_MARKER);\n if (sdkIndex !== -1) {\n return match.slice(sdkIndex);\n }\n\n if (match.startsWith(HOME_DIR)) {\n return `~/<redacted>/${lastSegment(match, \"/\")}`;\n }\n\n return `<external>/${lastSegment(match, \"/\")}`;\n });\n result = result.replace(WINDOWS_PATH_PATTERN, (match) => {\n const normalized = match.replace(/\\\\/g, \"/\");\n const sdkIndex = normalized.indexOf(SDK_PACKAGE_MARKER);\n if (sdkIndex !== -1) {\n return normalized.slice(sdkIndex);\n }\n return `<external>/${lastSegment(match, \"\\\\\")}`;\n });\n return result;\n}\n\n/**\n * Sanitize an error message by redacting sensitive information.\n * Redacts: UUIDs, long hex tokens, email addresses, absolute paths, URL query strings.\n * @param message - Raw error message\n * @returns Sanitized error message\n */\nexport function sanitizeMessage(message: string): string {\n let result = message;\n // Strip serialized request/response bodies that may contain secrets\n result = result.replace(/\\nRequest:\\s*[\\s\\S]*$/, \"\\nRequest: <redacted>\");\n result = result.replace(UUID_PATTERN, \"<uuid>\");\n result = result.replace(LONG_HEX_PATTERN, \"<redacted>\");\n result = result.replace(EMAIL_PATTERN, \"<email>\");\n result = result.replace(URL_QUERY_PATTERN, \"?<redacted>\");\n result = result.replace(ABSOLUTE_PATH_PATTERN, (match) => `<path>/${lastSegment(match, \"/\")}`);\n result = result.replace(WINDOWS_PATH_PATTERN, (match) => `<path>/${lastSegment(match, \"\\\\\")}`);\n\n return result;\n}\n\n/**\n * Sanitize process.argv by keeping command/subcommand names and redacting\n * values of sensitive flags.\n * @param argv - Raw process.argv array\n * @returns Sanitized argv array\n */\nexport function sanitizeArgv(argv: string[]): string[] {\n const result: string[] = [];\n let redactNext = false;\n\n for (const arg of argv) {\n if (redactNext) {\n // If the next token is itself a flag, treat it as a new flag rather\n // than consuming it as the previous flag's value. This avoids leaking\n // the *next* flag's value (e.g., `--verbose --workspace-id secret`\n // would otherwise expose `secret`).\n if (!arg.startsWith(\"-\")) {\n result.push(\"<redacted>\");\n redactNext = false;\n continue;\n }\n redactNext = false;\n }\n\n if (arg.startsWith(\"-\")) {\n // --flag=value: keep flag name, redact value\n const eqIndex = arg.indexOf(\"=\");\n if (eqIndex !== -1) {\n result.push(`${arg.slice(0, eqIndex)}=<redacted>`);\n continue;\n }\n\n // --flag / -f: keep flag name, redact next arg as its value\n result.push(arg);\n redactNext = true;\n continue;\n }\n\n // Redact absolute paths\n if (arg.startsWith(\"/\") && arg.includes(\"/\", 1)) {\n result.push(\"<path>\");\n continue;\n }\n\n // Redact Windows-style absolute paths\n if (WINDOWS_DRIVE_TEST_PATTERN.test(arg)) {\n result.push(\"<path>\");\n continue;\n }\n\n // Redact email addresses\n if (EMAIL_TEST_PATTERN.test(arg)) {\n result.push(\"<email>\");\n continue;\n }\n\n result.push(arg);\n }\n\n return result;\n}\n","import * as crypto from \"node:crypto\";\nimport * as fs from \"node:fs\";\nimport * as os from \"node:os\";\nimport { parseYAML } from \"confbox\";\nimport * as path from \"pathe\";\nimport { xdgConfig } from \"xdg-basedir\";\nimport { sanitizeArgv, sanitizeMessage, sanitizeStackTrace } from \"./sanitize\";\n\nexport type ErrorType = \"uncaughtException\" | \"unhandledRejection\" | \"handledError\";\n\nexport interface CrashReport {\n id: string;\n timestamp: string;\n sdkVersion: string;\n nodeVersion: string;\n osPlatform: string;\n osRelease: string;\n arch: string;\n command: string;\n argv: string[];\n errorName: string;\n errorMessage: string;\n stackTrace: string;\n errorType: ErrorType;\n userId: string | null;\n userEmail: string | null;\n}\n\ninterface BuildCrashReportOptions {\n error: unknown;\n sdkVersion: string;\n errorType: ErrorType;\n}\n\n// Maximum subcommand depth to keep (e.g., \"tailordb migrate generate\" = 3 tokens).\n// Positional arguments beyond this are potentially sensitive user input.\n// Accepted trade-off: plain-text positional args that don't match known patterns\n// (UUIDs, hex tokens, emails, paths) pass through to `command` and `argv`.\n// Full redaction would require embedding the CLI command tree here, which is fragile.\nconst MAX_COMMAND_TOKENS = 3;\n\n/**\n * Parse the command name from process.argv.\n * Extracts up to MAX_COMMAND_TOKENS non-flag arguments after the script name.\n * @returns Parsed command string\n */\nfunction parseCommand(): string {\n const args = process.argv.slice(2);\n const commandParts: string[] = [];\n for (const arg of args) {\n if (arg.startsWith(\"-\") || commandParts.length >= MAX_COMMAND_TOKENS) break;\n commandParts.push(arg);\n }\n return commandParts.join(\" \") || \"<unknown>\";\n}\n\n/**\n * Build a CrashReport data structure from an error and context.\n * All sensitive data is sanitized before inclusion.\n * @param options - Error, SDK version, and crash type\n * @returns Sanitized crash report\n */\nexport function buildCrashReport(options: BuildCrashReportOptions): CrashReport {\n const { error, sdkVersion, errorType } = options;\n\n const isError = error instanceof Error;\n const rawMessage = isError ? error.message : String(error);\n const rawStack = isError && error.stack ? error.stack : \"\";\n const errorName = isError ? error.name : \"UnknownError\";\n\n const currentUser = readCurrentUser();\n\n return {\n id: crypto.randomUUID(),\n timestamp: new Date().toISOString(),\n sdkVersion,\n nodeVersion: process.version,\n osPlatform: process.platform,\n osRelease: os.release(),\n arch: process.arch,\n command: sanitizeMessage(parseCommand()),\n argv: sanitizeArgv(process.argv),\n errorName,\n errorMessage: sanitizeMessage(rawMessage),\n stackTrace: sanitizeStackTrace(rawStack),\n errorType,\n userId: currentUser,\n userEmail: currentUser,\n };\n}\n\n/**\n * Read current_user from Tailor Platform config without side effects.\n * Unlike readPlatformConfig(), this never triggers migration or logs warnings.\n * @returns The current user email, or null if unavailable\n */\nfunction readCurrentUser(): string | null {\n try {\n if (!xdgConfig) return null;\n const configPath = path.join(xdgConfig, \"tailor-platform\", \"config.yaml\");\n if (!fs.existsSync(configPath)) return null;\n const raw = parseYAML(fs.readFileSync(configPath, \"utf-8\")) as { current_user?: string | null };\n return raw?.current_user ?? null;\n } catch {\n return null;\n }\n}\n","import { logger } from \"@/cli/shared/logger\";\nimport { readPackageJson } from \"@/cli/shared/package-json\";\nimport { parseCrashReportConfig } from \"./config\";\nimport { buildCrashReport, type ErrorType } from \"./report\";\nimport { sendCrashReport } from \"./sender\";\nimport { writeCrashReport } from \"./writer\";\n\n/**\n * Report an unexpected crash. Writes a local crash log file and optionally\n * sends the report to a remote endpoint. Displays a user-facing message\n * with the crash log path and a command to submit the report.\n *\n * Never throws - all errors are silently caught.\n * @param error - The error that caused the crash\n * @param errorType - How the error was caught\n */\nexport async function reportCrash(error: unknown, errorType: ErrorType): Promise<void> {\n try {\n const config = parseCrashReportConfig();\n if (!config.localEnabled && !config.remoteEnabled) return;\n\n const packageJson = await readPackageJson();\n const sdkVersion = packageJson.version ?? \"unknown\";\n\n const report = buildCrashReport({ error, sdkVersion, errorType });\n\n if (config.localEnabled) {\n const filePath = writeCrashReport(report, config.localDir);\n if (filePath) {\n logger.log(\n [\n \"\",\n \"An unexpected error occurred. A crash report has been saved to:\",\n ` ${filePath}`,\n \"\",\n \"To submit this report:\",\n ` tailor-sdk crash-report send --file \"${filePath}\"`,\n ].join(\"\\n\"),\n );\n }\n }\n\n if (config.remoteEnabled) {\n // Lazy import: client.ts pulls in heavy dependencies (OAuth2, Connect, Protobuf)\n // that should not be loaded on the startup critical path via initCrashReporting().\n const { userAgent } = await import(\"@/cli/shared/client\");\n const ua = await userAgent();\n await sendCrashReport(report, ua);\n }\n } catch {\n // Never throw from crash reporting\n }\n}\n\n/**\n * Register global uncaughtException and unhandledRejection handlers.\n * These catch errors outside the normal cleanup flow (e.g., during\n * argument parsing). Should be called once at CLI startup before runMain.\n */\nexport function initCrashReporting(): void {\n const config = parseCrashReportConfig();\n if (!config.localEnabled && !config.remoteEnabled) return;\n\n const handleFatal = (error: unknown, errorType: ErrorType) => {\n const message = error instanceof Error ? error.message : String(error);\n logger.error(message);\n void reportCrash(error, errorType).finally(() => {\n process.exit(1);\n });\n };\n\n process.on(\"uncaughtException\", (error) => handleFatal(error, \"uncaughtException\"));\n process.on(\"unhandledRejection\", (reason) => handleFatal(reason, \"unhandledRejection\"));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,SAAgB,yBAA4C;AAC1D,KAAI,KACF,QAAO;EACL,cAAc;EACd,eAAe;EACf,UAAU;EACX;CAGH,MAAM,gBAAgB,QAAQ,IAAI,8BAA8B,MAAM,aAAa,KAAK;CACxF,MAAM,iBAAiB,QAAQ,IAAI,+BAA+B,OAAO,aAAa,KAAK;CAC3F,MAAM,WAAW,YAAY,KAAK,KAAK,WAAW,mBAAmB,gBAAgB,GAAG;AAExF,QAAO;EACL,cAAc,gBAAgB,aAAa;EAC3C;EACA;EACD;;;;;AC9BH,MAAM,kBAAkB;;AAGxB,MAAa,qBAAqB;;AAGlC,MAAa,sBAAsB;;;;;;AAOnC,SAAgB,kBAAkB,QAA6B;AA2B7D,QA1Bc;EACZ,iBAAiB,OAAO;EACxB,cAAc,OAAO;EACrB,eAAe,OAAO;EACtB;EACA;EACA,gBAAgB,OAAO;EACvB,iBAAiB,OAAO;EACxB,OAAO,OAAO,WAAW,GAAG,OAAO;EACnC,SAAS,OAAO;EAChB;EACA;EACA,YAAY,OAAO;EACnB,cAAc,KAAK,UAAU,OAAO,KAAK;EACzC;EACA;EACA,SAAS,OAAO;EAChB,YAAY,OAAO;EACnB;EACA;EACA,OAAO,cAAc;EACrB;EACA;EACA,KAAK,UAAU,OAAO;EACtB;EACD,CACY,KAAK,KAAK;;;;;;;;AASzB,SAAS,iBAAiB,QAA6B;AAGrD,QAAO,GAFe,OAAO,UAAU,QAAQ,SAAS,IAAI,CAEpC,GADR,OAAO,GAAG,MAAM,GAAG,EAAE,GACA;;;;;;AAOvC,SAAS,gBAAgB,KAAmB;AAC1C,KAAI;EACF,MAAM,QAAQ,GACX,YAAY,IAAI,CAChB,QAAQ,MAAM,EAAE,SAAS,oBAAoB,CAAC,CAC9C,MAAM,CACN,SAAS;AAEZ,OAA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AACrB,EAAK,YAAY,OAAO,UAAU,CAAC,cAAc;AAC/C,WAAQ,KAAK,EAAE;IACf;;AAGJ,SAAQ,GAAG,sBAAsB,UAAU,YAAY,OAAO,oBAAoB,CAAC;AACnF,SAAQ,GAAG,uBAAuB,WAAW,YAAY,QAAQ,qBAAqB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ct as InferredAttributeList, lt as InferredAttributeMap } from "./plugin-
|
|
1
|
+
import { ct as InferredAttributeList, lt as InferredAttributeMap } from "./plugin-DyVYXZWz.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/configure/types/actor.d.ts
|
|
4
4
|
/** User type enum values from the Tailor Platform server. */
|
|
@@ -26,4 +26,4 @@ interface Env {}
|
|
|
26
26
|
type TailorEnv = keyof Env extends never ? Record<string, string> : Env;
|
|
27
27
|
//#endregion
|
|
28
28
|
export { TailorEnv as n, TailorActor as r, Env as t };
|
|
29
|
-
//# sourceMappingURL=env-
|
|
29
|
+
//# sourceMappingURL=env-BgdHfWDn.d.mts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as FieldOutput, A as DefinedAuth, Ct as IncomingWebhookTrigger$1, Dt as WebhookOperation$1, Et as ScheduleTriggerInput, F as UserAttributeMap, H as TailorDBType, O as AuthServiceInput, Ot as WorkflowOperation$1, P as UserAttributeListKey, Q as FieldOptions, St as IdpUserTrigger$1, Tt as ResolverExecutedTrigger$1, V as TailorDBInstance, X as DefinedFieldMetadata, Y as ArrayFieldOutput, Z as FieldMetadata, _t as AuthAccessTokenTrigger$1, at as output$1, bt as FunctionOperation$1, et as TailorFieldType, ft as AllowedValues, gt as GeneratorConfig, ht as ResolverInput, it as JsonCompatible, kt as AuthInvoker$1, mt as Resolver, n as Plugin, nt as TailorField, pt as AllowedValuesOutput, rt as InferFieldsOutput, tt as TailorAnyField, ut as TailorUser, wt as RecordTrigger$1, xt as GqlOperation$1, yt as ExecutorInput } from "./plugin-
|
|
2
|
-
import { n as TailorEnv, r as TailorActor } from "./env-
|
|
3
|
-
import { g as IdpDefinitionBrand, n as AppConfig, t as RetryPolicy, y as IdPInput } from "./workflow.generated-
|
|
1
|
+
import { $ as FieldOutput, A as DefinedAuth, Ct as IncomingWebhookTrigger$1, Dt as WebhookOperation$1, Et as ScheduleTriggerInput, F as UserAttributeMap, H as TailorDBType, O as AuthServiceInput, Ot as WorkflowOperation$1, P as UserAttributeListKey, Q as FieldOptions, St as IdpUserTrigger$1, Tt as ResolverExecutedTrigger$1, V as TailorDBInstance, X as DefinedFieldMetadata, Y as ArrayFieldOutput, Z as FieldMetadata, _t as AuthAccessTokenTrigger$1, at as output$1, bt as FunctionOperation$1, et as TailorFieldType, ft as AllowedValues, gt as GeneratorConfig, ht as ResolverInput, it as JsonCompatible, kt as AuthInvoker$1, mt as Resolver, n as Plugin, nt as TailorField, pt as AllowedValuesOutput, rt as InferFieldsOutput, tt as TailorAnyField, ut as TailorUser, wt as RecordTrigger$1, xt as GqlOperation$1, yt as ExecutorInput } from "./plugin-DyVYXZWz.mjs";
|
|
2
|
+
import { n as TailorEnv, r as TailorActor } from "./env-BgdHfWDn.mjs";
|
|
3
|
+
import { g as IdpDefinitionBrand, n as AppConfig, t as RetryPolicy, y as IdPInput } from "./workflow.generated-DMQ-cjyT.mjs";
|
|
4
4
|
import * as zod from "zod";
|
|
5
5
|
import { JsonPrimitive, Jsonifiable, Jsonify } from "type-fest";
|
|
6
6
|
import { Client } from "@urql/core";
|
|
@@ -650,16 +650,7 @@ declare function defineConfig<const Config extends AppConfig & Record<Exclude<ke
|
|
|
650
650
|
* @param configs - Generator configurations
|
|
651
651
|
* @returns Generator configurations as given
|
|
652
652
|
*/
|
|
653
|
-
declare function defineGenerators(...configs: GeneratorConfig[]): (
|
|
654
|
-
distPath: string;
|
|
655
|
-
}] | ["@tailor-platform/seed", {
|
|
656
|
-
distPath: string;
|
|
657
|
-
machineUserName?: string | undefined;
|
|
658
|
-
}] | ["@tailor-platform/enum-constants", {
|
|
659
|
-
distPath: string;
|
|
660
|
-
}] | ["@tailor-platform/file-utils", {
|
|
661
|
-
distPath: string;
|
|
662
|
-
}] | {
|
|
653
|
+
declare function defineGenerators(...configs: GeneratorConfig[]): ({
|
|
663
654
|
id: string;
|
|
664
655
|
description: string;
|
|
665
656
|
dependencies: ("executor" | "tailordb" | "resolver")[];
|
|
@@ -669,7 +660,16 @@ declare function defineGenerators(...configs: GeneratorConfig[]): (["@tailor-pla
|
|
|
669
660
|
processExecutor?: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod_v4_core0.$ZodFunctionOut> | undefined;
|
|
670
661
|
processTailorDBNamespace?: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod_v4_core0.$ZodFunctionOut> | undefined;
|
|
671
662
|
processResolverNamespace?: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod_v4_core0.$ZodFunctionOut> | undefined;
|
|
672
|
-
}
|
|
663
|
+
} | ["@tailor-platform/kysely-type", {
|
|
664
|
+
distPath: string;
|
|
665
|
+
}] | ["@tailor-platform/seed", {
|
|
666
|
+
distPath: string;
|
|
667
|
+
machineUserName?: string | undefined;
|
|
668
|
+
}] | ["@tailor-platform/enum-constants", {
|
|
669
|
+
distPath: string;
|
|
670
|
+
}] | ["@tailor-platform/file-utils", {
|
|
671
|
+
distPath: string;
|
|
672
|
+
}])[];
|
|
673
673
|
/**
|
|
674
674
|
* Define plugins to be used with the Tailor SDK.
|
|
675
675
|
* Plugins can generate additional types, resolvers, and executors
|
|
@@ -757,4 +757,4 @@ declare namespace t {
|
|
|
757
757
|
}
|
|
758
758
|
//#endregion
|
|
759
759
|
export { AuthInvoker as $, idpUserCreatedTrigger as A, WebhookOperation as B, RecordTrigger as C, authAccessTokenIssuedTrigger as D, ResolverExecutedTrigger as E, recordUpdatedTrigger as F, WORKFLOW_TEST_ENV_KEY as G, Workflow as H, resolverExecutedTrigger as I, WorkflowJobInput as J, WorkflowJob as K, FunctionOperation as L, idpUserUpdatedTrigger as M, recordCreatedTrigger as N, authAccessTokenRefreshedTrigger as O, recordDeletedTrigger as P, createResolver as Q, GqlOperation as R, RecordDeletedArgs as S, ResolverExecutedArgs as T, WorkflowConfig as U, WorkflowOperation as V, createWorkflow as W, createWorkflowJob as X, WorkflowJobOutput as Y, QueryType as Z, AuthAccessTokenArgs as _, defineGenerators as a, IdpUserTrigger as b, createExecutor as c, IncomingWebhookRequest as d, defineAuth as et, IncomingWebhookTrigger as f, scheduleTrigger as g, ScheduleTrigger as h, defineConfig as i, idpUserDeletedTrigger as j, authAccessTokenRevokedTrigger as k, Trigger as l, ScheduleArgs as m, output as n, definePlugins as o, incomingWebhookTrigger as p, WorkflowJobContext as q, t as r, defineIdp as s, infer as t, IncomingWebhookArgs as u, AuthAccessTokenTrigger as v, RecordUpdatedArgs as w, RecordCreatedArgs as x, IdpUserArgs as y, Operation as z };
|
|
760
|
-
//# sourceMappingURL=index-
|
|
760
|
+
//# sourceMappingURL=index-BAud4CE7.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as Plugin } from "./plugin-
|
|
1
|
+
import { n as Plugin } from "./plugin-DyVYXZWz.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/plugin/builtin/seed/index.d.ts
|
|
4
4
|
declare const SeedGeneratorID = "@tailor-platform/seed";
|
|
@@ -16,4 +16,4 @@ type SeedPluginOptions = {
|
|
|
16
16
|
declare function seedPlugin(options: SeedPluginOptions): Plugin<unknown, SeedPluginOptions>;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { seedPlugin as n, SeedGeneratorID as t };
|
|
19
|
-
//# sourceMappingURL=index-
|
|
19
|
+
//# sourceMappingURL=index-CdDzh-T2.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as Plugin } from "./plugin-
|
|
1
|
+
import { n as Plugin } from "./plugin-DyVYXZWz.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/plugin/builtin/kysely-type/index.d.ts
|
|
4
4
|
declare const KyselyGeneratorID = "@tailor-platform/kysely-type";
|
|
@@ -14,4 +14,4 @@ type KyselyTypePluginOptions = {
|
|
|
14
14
|
declare function kyselyTypePlugin(options: KyselyTypePluginOptions): Plugin<unknown, KyselyTypePluginOptions>;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { kyselyTypePlugin as n, KyselyGeneratorID as t };
|
|
17
|
-
//# sourceMappingURL=index-
|
|
17
|
+
//# sourceMappingURL=index-CxgBnxKM.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as Plugin } from "./plugin-
|
|
1
|
+
import { n as Plugin } from "./plugin-DyVYXZWz.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/plugin/builtin/file-utils/index.d.ts
|
|
4
4
|
declare const FileUtilsGeneratorID = "@tailor-platform/file-utils";
|
|
@@ -14,4 +14,4 @@ type FileUtilsPluginOptions = {
|
|
|
14
14
|
declare function fileUtilsPlugin(options: FileUtilsPluginOptions): Plugin<unknown, FileUtilsPluginOptions>;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { fileUtilsPlugin as n, FileUtilsGeneratorID as t };
|
|
17
|
-
//# sourceMappingURL=index-
|
|
17
|
+
//# sourceMappingURL=index-D4Y81vh1.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as Plugin } from "./plugin-
|
|
1
|
+
import { n as Plugin } from "./plugin-DyVYXZWz.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/plugin/builtin/enum-constants/index.d.ts
|
|
4
4
|
declare const EnumConstantsGeneratorID = "@tailor-platform/enum-constants";
|
|
@@ -14,4 +14,4 @@ type EnumConstantsPluginOptions = {
|
|
|
14
14
|
declare function enumConstantsPlugin(options: EnumConstantsPluginOptions): Plugin<unknown, EnumConstantsPluginOptions>;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { enumConstantsPlugin as n, EnumConstantsGeneratorID as t };
|
|
17
|
-
//# sourceMappingURL=index-
|
|
17
|
+
//# sourceMappingURL=index-FZMBoUWm.d.mts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as enumConstantsPlugin, t as EnumConstantsGeneratorID } from "../../../index-
|
|
1
|
+
import { n as enumConstantsPlugin, t as EnumConstantsGeneratorID } from "../../../index-FZMBoUWm.mjs";
|
|
2
2
|
export { EnumConstantsGeneratorID, enumConstantsPlugin };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as fileUtilsPlugin, t as FileUtilsGeneratorID } from "../../../index-
|
|
1
|
+
import { n as fileUtilsPlugin, t as FileUtilsGeneratorID } from "../../../index-D4Y81vh1.mjs";
|
|
2
2
|
export { FileUtilsGeneratorID, fileUtilsPlugin };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as kyselyTypePlugin, t as KyselyGeneratorID } from "../../../index-
|
|
1
|
+
import { n as kyselyTypePlugin, t as KyselyGeneratorID } from "../../../index-CxgBnxKM.mjs";
|
|
2
2
|
export { KyselyGeneratorID, kyselyTypePlugin };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as seedPlugin, t as SeedGeneratorID } from "../../../index-
|
|
1
|
+
import { n as seedPlugin, t as SeedGeneratorID } from "../../../index-CdDzh-T2.mjs";
|
|
2
2
|
export { SeedGeneratorID, seedPlugin };
|
package/dist/plugin/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z as TailorAnyDBType } from "../plugin-
|
|
2
|
-
import { n as TailorEnv, r as TailorActor } from "../env-
|
|
1
|
+
import { z as TailorAnyDBType } from "../plugin-DyVYXZWz.mjs";
|
|
2
|
+
import { n as TailorEnv, r as TailorActor } from "../env-BgdHfWDn.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/plugin/with-context.d.ts
|
|
5
5
|
/**
|
|
@@ -589,11 +589,6 @@ type TailorToTs = {
|
|
|
589
589
|
interface FieldMetadata {
|
|
590
590
|
description?: string;
|
|
591
591
|
required?: boolean;
|
|
592
|
-
/**
|
|
593
|
-
* Marks a field as explicitly required.
|
|
594
|
-
* Used for plugin config schemas where fields are optional by default.
|
|
595
|
-
*/
|
|
596
|
-
requiredExplicit?: boolean;
|
|
597
592
|
array?: boolean;
|
|
598
593
|
allowedValues?: AllowedValue[];
|
|
599
594
|
validate?: FieldValidateInput<any>[];
|
|
@@ -608,7 +603,6 @@ interface DefinedFieldMetadata {
|
|
|
608
603
|
}
|
|
609
604
|
type FieldOptions = {
|
|
610
605
|
optional?: boolean;
|
|
611
|
-
required?: boolean;
|
|
612
606
|
array?: boolean;
|
|
613
607
|
};
|
|
614
608
|
type FieldOutput$1<T, O extends FieldOptions> = OptionalFieldOutput<ArrayFieldOutput<T, O>, O>;
|
|
@@ -1031,6 +1025,11 @@ type TailorAnyDBType = TailorDBType$1<any, any>;
|
|
|
1031
1025
|
* Extends TailorField with database-specific features like relations, indexes, and hooks.
|
|
1032
1026
|
*/
|
|
1033
1027
|
interface TailorDBField<Defined extends DefinedDBFieldMetadata, Output> extends Omit<TailorField<Defined, Output, DBFieldMetadata, Defined["type"]>, "description" | "validate"> {
|
|
1028
|
+
/**
|
|
1029
|
+
* typeName is not available on TailorDB fields.
|
|
1030
|
+
* Use typeName on pipeline fields (t.enum / t.object) instead.
|
|
1031
|
+
*/
|
|
1032
|
+
typeName(this: never, typeName: string): never;
|
|
1034
1033
|
/** Returns a shallow copy of the raw relation config if set */
|
|
1035
1034
|
readonly rawRelation: Readonly<RawRelationConfig> | undefined;
|
|
1036
1035
|
/**
|
|
@@ -1395,6 +1394,7 @@ interface TailorDBType$1<Fields extends Record<string, TailorAnyDBField> = any,
|
|
|
1395
1394
|
/**
|
|
1396
1395
|
* Pick specific fields from the type
|
|
1397
1396
|
*/
|
|
1397
|
+
pickFields<K extends keyof Fields>(keys: K[]): Pick<Fields, K>;
|
|
1398
1398
|
pickFields<K extends keyof Fields, const Opt extends FieldOptions>(keys: K[], options: Opt): { [P in K]: Fields[P] extends TailorDBField<infer D, infer _O> ? TailorDBField<Omit<D, "array"> & {
|
|
1399
1399
|
array: Opt extends {
|
|
1400
1400
|
array: true;
|
|
@@ -2024,4 +2024,4 @@ interface Plugin<TypeConfig = unknown, PluginConfig = unknown> {
|
|
|
2024
2024
|
}
|
|
2025
2025
|
//#endregion
|
|
2026
2026
|
export { FieldOutput$1 as $, DefinedAuth as A, BuiltinIdP as At, TailorDBField as B, SCIMResource as Bt, TailorDBType as C, IncomingWebhookTrigger as Ct, AuthOwnConfig as D, WebhookOperation as Dt, AuthExternalConfig as E, ScheduleTriggerInput as Et, UserAttributeMap as F, SAML as Ft, TailorTypeGqlPermission as G, TailorDBType$1 as H, UsernameFieldKey as I, SCIMAttribute as It, unsafeAllowAllTypePermission as J, TailorTypePermission as K, ValueOperand as L, SCIMAttributeMapping as Lt, SCIMAttributeType as M, IdProvider as Mt, UserAttributeKey as N, OAuth2ClientInput as Nt, AuthServiceInput as O, WorkflowOperation as Ot, UserAttributeListKey as P, OIDC as Pt, FieldOptions as Q, TailorAnyDBField as R, SCIMAuthorization as Rt, TailorDBServiceInput as S, IdpUserTrigger as St, AuthConfig as T, ResolverExecutedTrigger as Tt, db as U, TailorDBInstance as V, TenantProvider as Vt, PermissionCondition as W, DefinedFieldMetadata as X, ArrayFieldOutput as Y, FieldMetadata as Z, GeneratorResult as _, AuthAccessTokenTrigger as _t, PluginExecutorContext as a, output as at, TailorDBNamespaceData as b, FunctionOperation as bt, PluginGeneratedExecutorWithFile as c, InferredAttributeList as ct, PluginNamespaceProcessContext as d, unauthenticatedTailorUser as dt, TailorFieldType as et, PluginOutput as f, AllowedValues as ft, ExecutorReadyContext as g, GeneratorConfig as gt, TypePluginOutput as h, ResolverInput as ht, PluginConfigs as i, JsonCompatible as it, OAuth2ClientGrantType as j, IDToken as jt, BeforeLoginHookArgs as k, AuthInvoker as kt, PluginGeneratedResolver as l, InferredAttributeMap as lt, TailorDBTypeForPlugin as m, Resolver as mt, Plugin as n, TailorField as nt, PluginExecutorContextBase as o, AttributeList as ot, PluginProcessContext as p, AllowedValuesOutput as pt, unsafeAllowAllGqlPermission as q, PluginAttachment as r, InferFieldsOutput as rt, PluginGeneratedExecutor as s, AttributeMap as st, NamespacePluginOutput as t, TailorAnyField as tt, PluginGeneratedType as u, TailorUser as ut, ResolverNamespaceData as v, Executor as vt, TypeSourceInfoEntry as w, RecordTrigger as wt, TailorDBReadyContext as x, GqlOperation as xt, ResolverReadyContext as y, ExecutorInput as yt, TailorAnyDBType as z, SCIMConfig as zt };
|
|
2027
|
-
//# sourceMappingURL=plugin-
|
|
2027
|
+
//# sourceMappingURL=plugin-DyVYXZWz.d.mts.map
|