@tailor-platform/sdk 1.33.1 → 1.33.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @tailor-platform/sdk
2
2
 
3
+ ## 1.33.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#899](https://github.com/tailor-platform/sdk/pull/899) [`ce19ee7`](https://github.com/tailor-platform/sdk/commit/ce19ee7dbb5bbf45d13ad06b6a02ea770f17435b) Thanks [@remiposo](https://github.com/remiposo)! - Fix SQL query command rewriting user input, which broke INSERT/UPDATE statements and PascalCase table names
8
+
3
9
  ## 1.33.1
4
10
 
5
11
  ### Patch Changes
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { B as PATScope, D as FunctionExecution_Type, N as AuthInvokerSchema, i as fetchAll, l as initOAuth2Client, m as userAgent, n as closeConnectionPool, o as fetchPlatformMachineUserToken, s as fetchUserInfo, u as initOperatorClient } from "../client-CYGsf3Zl.mjs";
4
4
  import { n as logger, r as styles } from "../logger-qz-Y4sBV.mjs";
5
- import { At as functionExecutionStatusToString, B as updateCommand$3, Ct as startCommand, D as resumeCommand, Dt as executionsCommand, E as healthCommand, Ft as executeScript, I as showCommand, J as updateCommand$2, Jt as formatMigrationNumber, K as getCommand$4, L as logBetaWarning, M as truncateCommand, Mt as getCommand$1, P as generateCommand$1, Pt as apply, Q as getCommand$3, Qt as getMigrationFiles, Rt as parseMigrationLabelNumber, Tt as getCommand$5, U as treeCommand, W as listCommand$10, X as listCommand$9, Zt as getMigrationFilePath, _ as getCommand$6, _n as isVerbose, _t as listCommand$6, a as updateCommand$4, bt as jobsCommand, cn as sdkNameLabelKey, d as inviteCommand, en as isValidMigrationNumber, et as deleteCommand$3, fn as apiCommand, ft as generate, gn as deploymentArgs, h as listCommand$14, hn as confirmationArgs, ht as triggerCommand, i as isCLIError, it as listCommand$8, jt as formatKeyValueTable, k as listCommand$11, l as listCommand$13, ln as trnPrefix, lt as tokenCommand, mn as commonArgs, mt as webhookCommand, nt as createCommand$3, on as getNamespacesWithMigrations, ot as getCommand$2, p as restoreCommand, pn as defineAppCommand, r as queryCommand, s as removeCommand, sn as prompt, t as isNativeTypeScriptRuntime, tn as loadDiff, ut as listCommand$7, vn as workspaceArgs, w as listCommand$12, x as createCommand$4, y as deleteCommand$4, z as removeCommand$1 } from "../runtime-CDvdBV66.mjs";
5
+ import { At as functionExecutionStatusToString, B as updateCommand$3, Ct as startCommand, D as resumeCommand, Dt as executionsCommand, E as healthCommand, Ft as executeScript, I as showCommand, J as updateCommand$2, Jt as formatMigrationNumber, K as getCommand$4, L as logBetaWarning, M as truncateCommand, Mt as getCommand$1, P as generateCommand$1, Pt as apply, Q as getCommand$3, Qt as getMigrationFiles, Rt as parseMigrationLabelNumber, Tt as getCommand$5, U as treeCommand, W as listCommand$10, X as listCommand$9, Zt as getMigrationFilePath, _ as getCommand$6, _n as isVerbose, _t as listCommand$6, a as updateCommand$4, bt as jobsCommand, cn as sdkNameLabelKey, d as inviteCommand, en as isValidMigrationNumber, et as deleteCommand$3, fn as apiCommand, ft as generate, gn as deploymentArgs, h as listCommand$14, hn as confirmationArgs, ht as triggerCommand, i as isCLIError, it as listCommand$8, jt as formatKeyValueTable, k as listCommand$11, l as listCommand$13, ln as trnPrefix, lt as tokenCommand, mn as commonArgs, mt as webhookCommand, nt as createCommand$3, on as getNamespacesWithMigrations, ot as getCommand$2, p as restoreCommand, pn as defineAppCommand, r as queryCommand, s as removeCommand, sn as prompt, t as isNativeTypeScriptRuntime, tn as loadDiff, ut as listCommand$7, vn as workspaceArgs, w as listCommand$12, x as createCommand$4, y as deleteCommand$4, z as removeCommand$1 } from "../runtime-CxDrzUC0.mjs";
6
6
  import { t as readPackageJson } from "../package-json-CfUqjJaQ.mjs";
7
7
  import { C as resolveTokens, S as readPlatformConfig, T as writePlatformConfig, a as loadConfig, b as loadAccessToken, g as getDistDir, i as resolveInlineSourcemap, l as ExecutorSchema, o as WorkflowJobSchema, s as ResolverSchema, v as deleteUserTokens, w as saveUserTokens, x as loadWorkspaceId, y as fetchLatestToken } from "../application-CYPU-WIc.mjs";
8
8
  import { a as JSON_FOOTER_MARKER, i as CRASH_LOG_EXTENSION, o as parseCrashReportConfig, r as sendCrashReport, t as initCrashReporting } from "../crash-report-OXafT1iS.mjs";
package/dist/cli/lib.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { u as initOperatorClient } from "../client-CYGsf3Zl.mjs";
3
- import { $ as getFolder, $t as getNextMigrationNumber, A as listWorkflows, Bt as DB_TYPES_FILE_NAME, C as listApps, Et as getWorkflow, F as show, Ft as executeScript, G as listOrganizations, Gt as compareLocalTypesWithSnapshot, H as organizationTree, Ht as INITIAL_SCHEMA_NUMBER, It as waitForExecution, Kt as compareSnapshots, Lt as MIGRATION_LABEL_KEY, N as generate$1, Nt as getExecutor, O as resumeWorkflow, Ot as getWorkflowExecution, Pt as apply, Qt as getMigrationFiles, R as remove, S as createWorkspace, St as watchExecutorJob, T as getAppHealth, Ut as MIGRATE_FILE_NAME, V as updateOrganization, Vt as DIFF_FILE_NAME, Wt as SCHEMA_FILE_NAME, Xt as getMigrationDirPath, Y as updateFolder, Yt as getLatestMigrationNumber, Z as listFolders, Zt as getMigrationFilePath, an as hasChanges, at as listOAuth2Clients, b as deleteWorkspace, c as removeUser, ct as getMachineUserToken, dn as apiCall, dt as listMachineUsers, f as inviteUser, ft as generate, g as listWorkspaces, gt as triggerExecutor, in as formatMigrationDiff, j as truncate, kt as listWorkflowExecutions, m as restoreWorkspace, n as query, nn as reconstructSnapshotFromMigrations, o as updateUser, on as getNamespacesWithMigrations, pt as listWebhookExecutors, q as getOrganization, qt as createSnapshotFromLocalTypes, rn as formatDiffSummary, rt as createFolder, st as getOAuth2Client, t as isNativeTypeScriptRuntime, tt as deleteFolder, u as listUsers, un as generateUserTypes, v as getWorkspace, vt as listExecutors, wt as startWorkflow, xt as listExecutorJobs, yt as getExecutorJob, zt as bundleMigrationScript } from "../runtime-CDvdBV66.mjs";
3
+ import { $ as getFolder, $t as getNextMigrationNumber, A as listWorkflows, Bt as DB_TYPES_FILE_NAME, C as listApps, Et as getWorkflow, F as show, Ft as executeScript, G as listOrganizations, Gt as compareLocalTypesWithSnapshot, H as organizationTree, Ht as INITIAL_SCHEMA_NUMBER, It as waitForExecution, Kt as compareSnapshots, Lt as MIGRATION_LABEL_KEY, N as generate$1, Nt as getExecutor, O as resumeWorkflow, Ot as getWorkflowExecution, Pt as apply, Qt as getMigrationFiles, R as remove, S as createWorkspace, St as watchExecutorJob, T as getAppHealth, Ut as MIGRATE_FILE_NAME, V as updateOrganization, Vt as DIFF_FILE_NAME, Wt as SCHEMA_FILE_NAME, Xt as getMigrationDirPath, Y as updateFolder, Yt as getLatestMigrationNumber, Z as listFolders, Zt as getMigrationFilePath, an as hasChanges, at as listOAuth2Clients, b as deleteWorkspace, c as removeUser, ct as getMachineUserToken, dn as apiCall, dt as listMachineUsers, f as inviteUser, ft as generate, g as listWorkspaces, gt as triggerExecutor, in as formatMigrationDiff, j as truncate, kt as listWorkflowExecutions, m as restoreWorkspace, n as query, nn as reconstructSnapshotFromMigrations, o as updateUser, on as getNamespacesWithMigrations, pt as listWebhookExecutors, q as getOrganization, qt as createSnapshotFromLocalTypes, rn as formatDiffSummary, rt as createFolder, st as getOAuth2Client, t as isNativeTypeScriptRuntime, tt as deleteFolder, u as listUsers, un as generateUserTypes, v as getWorkspace, vt as listExecutors, wt as startWorkflow, xt as listExecutorJobs, yt as getExecutorJob, zt as bundleMigrationScript } from "../runtime-CxDrzUC0.mjs";
4
4
  import { a as loadConfig, b as loadAccessToken, g as getDistDir, x as loadWorkspaceId } from "../application-CYPU-WIc.mjs";
5
5
  import { n as seedPlugin } from "../seed-BZIFDG27.mjs";
6
6
  import { n as enumConstantsPlugin } from "../enum-constants-DI85-fPE.mjs";
@@ -37,7 +37,7 @@ import { spawn } from "node:child_process";
37
37
  import { watch } from "chokidar";
38
38
  import * as madgeModule from "madge";
39
39
  import { createInterface } from "node:readline/promises";
40
- import { astVisitor, parse, toSql } from "pgsql-ast-parser";
40
+ import { astVisitor, parse } from "pgsql-ast-parser";
41
41
  import { parse as parse$1 } from "@0no-co/graphql.web";
42
42
 
43
43
  //#region src/cli/shared/args.ts
@@ -13819,14 +13819,12 @@ function printSingleSqlResult(execResult, options = {}) {
13819
13819
  logger.out(`rows: ${execResult.rowCount}`);
13820
13820
  }
13821
13821
  function splitSqlStatements(query) {
13822
- try {
13823
- const statements = parse(query);
13824
- if (statements.length === 0) return [];
13825
- return statements.map((s) => toSql.statement(s));
13826
- } catch {
13827
- const trimmed = query.trim();
13828
- return trimmed.length > 0 ? [trimmed] : [];
13829
- }
13822
+ const statements = parse(query, { locationTracking: true });
13823
+ return statements.map((s, i) => {
13824
+ const start = s._location.start;
13825
+ const end = i + 1 < statements.length ? statements[i + 1]._location.start : query.length;
13826
+ return query.substring(start, end);
13827
+ });
13830
13828
  }
13831
13829
  function isSQLExecutionResultArray(value) {
13832
13830
  return Array.isArray(value) && value.length > 0 && value.every(isSQLExecutionResult);
@@ -13896,4 +13894,4 @@ function isDeno() {
13896
13894
 
13897
13895
  //#endregion
13898
13896
  export { getFolder as $, getNextMigrationNumber as $t, listWorkflows as A, functionExecutionStatusToString as At, updateCommand$1 as B, DB_TYPES_FILE_NAME as Bt, listApps as C, startCommand as Ct, resumeCommand as D, executionsCommand as Dt, healthCommand as E, getWorkflow as Et, show as F, executeScript as Ft, listOrganizations as G, compareLocalTypesWithSnapshot as Gt, organizationTree as H, INITIAL_SCHEMA_NUMBER as Ht, showCommand as I, waitForExecution$1 as It, updateCommand$2 as J, formatMigrationNumber as Jt, getCommand$1 as K, compareSnapshots as Kt, logBetaWarning as L, MIGRATION_LABEL_KEY as Lt, truncateCommand as M, getCommand$5 as Mt, generate as N, getExecutor as Nt, resumeWorkflow as O, getWorkflowExecution as Ot, generateCommand as P, apply as Pt, getCommand$2 as Q, getMigrationFiles as Qt, remove as R, parseMigrationLabelNumber as Rt, createWorkspace as S, watchExecutorJob as St, getAppHealth as T, getCommand$4 as Tt, treeCommand as U, MIGRATE_FILE_NAME as Ut, updateOrganization as V, DIFF_FILE_NAME as Vt, listCommand$4 as W, SCHEMA_FILE_NAME as Wt, listCommand$5 as X, getMigrationDirPath as Xt, updateFolder as Y, getLatestMigrationNumber as Yt, listFolders as Z, getMigrationFilePath as Zt, getCommand as _, isVerbose as _n, listCommand$8 as _t, updateCommand as a, hasChanges as an, listOAuth2Clients as at, deleteWorkspace as b, jobsCommand as bt, removeUser as c, sdkNameLabelKey as cn, getMachineUserToken as ct, inviteCommand as d, apiCall as dn, listMachineUsers as dt, isValidMigrationNumber as en, deleteCommand$1 as et, inviteUser as f, apiCommand as fn, generate$1 as ft, listWorkspaces as g, deploymentArgs as gn, triggerExecutor as gt, listCommand$1 as h, confirmationArgs as hn, triggerCommand as ht, isCLIError as i, formatMigrationDiff as in, listCommand$6 as it, truncate as j, formatKeyValueTable as jt, listCommand$3 as k, listWorkflowExecutions as kt, listCommand as l, trnPrefix as ln, tokenCommand as lt, restoreWorkspace as m, commonArgs as mn, webhookCommand as mt, query as n, reconstructSnapshotFromMigrations as nn, createCommand$1 as nt, updateUser as o, getNamespacesWithMigrations as on, getCommand$3 as ot, restoreCommand as p, defineAppCommand as pn, listWebhookExecutors as pt, getOrganization as q, createSnapshotFromLocalTypes as qt, queryCommand as r, formatDiffSummary as rn, createFolder as rt, removeCommand as s, prompt as sn, getOAuth2Client as st, isNativeTypeScriptRuntime as t, loadDiff as tn, deleteFolder as tt, listUsers as u, generateUserTypes as un, listCommand$7 as ut, getWorkspace as v, workspaceArgs as vn, listExecutors as vt, listCommand$2 as w, startWorkflow as wt, createCommand as x, listExecutorJobs as xt, deleteCommand as y, getExecutorJob as yt, removeCommand$1 as z, bundleMigrationScript as zt };
13899
- //# sourceMappingURL=runtime-CDvdBV66.mjs.map
13897
+ //# sourceMappingURL=runtime-CxDrzUC0.mjs.map