@tailor-platform/sdk 1.25.2 → 1.25.3

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.25.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#749](https://github.com/tailor-platform/sdk/pull/749) [`5cf46ec`](https://github.com/tailor-platform/sdk/commit/5cf46ec88d7d7517300b916b02249d9ffaf8a083) Thanks [@toiroakr](https://github.com/toiroakr)! - Replace consola dependency with @inquirer/prompts for interactive prompts and direct stderr logging
8
+
3
9
  ## 1.25.2
4
10
 
5
11
  ### Patch Changes
@@ -12,9 +12,7 @@ import { formatWithOptions } from "node:util";
12
12
  import * as path from "pathe";
13
13
  import { join, resolve } from "pathe";
14
14
  import chalk from "chalk";
15
- import { createConsola } from "consola";
16
15
  import { formatDistanceToNowStrict } from "date-fns";
17
- import { isCI } from "std-env";
18
16
  import { getBorderCharacters, table } from "table";
19
17
  import { OAuth2Client } from "@badgateway/oauth2-client";
20
18
  import { MethodOptions_IdempotencyLevel, file_google_protobuf_descriptor, file_google_protobuf_duration, file_google_protobuf_field_mask, file_google_protobuf_struct, file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt";
@@ -103,26 +101,6 @@ const TYPE_COLORS = {
103
101
  log: (text) => text
104
102
  };
105
103
  /**
106
- * Parses a log tag in "mode:indent" format
107
- * @param tag - Tag string (e.g., "default:4", "stream:2", "plain:0")
108
- * @returns Parsed mode and indent values
109
- */
110
- function parseLogTag(tag) {
111
- const [mode, indentStr] = (tag || "default:0").split(":");
112
- return {
113
- mode,
114
- indent: Number(indentStr) || 0
115
- };
116
- }
117
- /**
118
- * Builds a log tag from LogOptions
119
- * @param opts - Log options
120
- * @returns Tag string in "mode:indent" format
121
- */
122
- function buildLogTag(opts) {
123
- return `${opts?.mode ?? "default"}:${opts?.indent ?? 0}`;
124
- }
125
- /**
126
104
  * Formats a log line with the appropriate prefix and indentation
127
105
  * @param opts - Formatting options
128
106
  * @returns Formatted log line
@@ -137,39 +115,22 @@ function formatLogLine(opts) {
137
115
  return `${indentPrefix}${timestamp ?? ""}${coloredOutput}\n`;
138
116
  }
139
117
  /**
140
- * Creates a reporter that handles all log output modes.
141
- *
142
- * Supports three modes controlled via logObj.tag:
143
- * - "default": Colored icons and messages, no timestamp, dynamic line wrapping
144
- * - "stream": Colored icons with timestamps, for streaming/polling operations
145
- * - "plain": Colored messages only, no icons, no timestamp
146
- * @returns A ConsolaReporter instance
147
- */
148
- function createReporter() {
149
- return { log(logObj, ctx) {
150
- const { mode, indent } = parseLogTag(logObj.tag);
151
- const stdout = ctx.options.stdout || process.stdout;
152
- const stderr = ctx.options.stderr || process.stderr;
153
- const formatOptions = ctx.options.formatOptions;
154
- const message = formatWithOptions({
155
- breakLength: stdout.columns || 80,
156
- compact: formatOptions.compact
157
- }, ...logObj.args);
158
- const timestamp = mode === "stream" && logObj.date ? `${logObj.date.toLocaleTimeString()} ` : "";
159
- const output = formatLogLine({
160
- mode,
161
- indent,
162
- type: logObj.type,
163
- message,
164
- timestamp
165
- });
166
- stderr.write(output);
167
- } };
118
+ * Writes a formatted log line to stderr.
119
+ * @param type - Log type (info, success, warn, error, log)
120
+ * @param message - Log message
121
+ * @param opts - Log options (mode and indent)
122
+ */
123
+ function writeLog(type, message, opts) {
124
+ const mode = opts?.mode ?? "default";
125
+ const output = formatLogLine({
126
+ mode,
127
+ indent: opts?.indent ?? 0,
128
+ type,
129
+ message: formatWithOptions({ breakLength: process.stdout.columns || 80 }, message),
130
+ timestamp: mode === "stream" ? `${(/* @__PURE__ */ new Date()).toLocaleTimeString()} ` : ""
131
+ });
132
+ process.stderr.write(output);
168
133
  }
169
- const consola = createConsola({
170
- reporters: [createReporter()],
171
- formatOptions: { date: true }
172
- });
173
134
  const logger = {
174
135
  get jsonMode() {
175
136
  return _jsonMode;
@@ -178,25 +139,25 @@ const logger = {
178
139
  _jsonMode = value;
179
140
  },
180
141
  info(message, opts) {
181
- consola.withTag(buildLogTag(opts)).info(message);
142
+ writeLog("info", message, opts);
182
143
  },
183
144
  success(message, opts) {
184
- consola.withTag(buildLogTag(opts)).success(message);
145
+ writeLog("success", message, opts);
185
146
  },
186
147
  warn(message, opts) {
187
- consola.withTag(buildLogTag(opts)).warn(message);
148
+ writeLog("warn", message, opts);
188
149
  },
189
150
  error(message, opts) {
190
- consola.withTag(buildLogTag(opts)).error(message);
151
+ writeLog("error", message, opts);
191
152
  },
192
153
  log(message) {
193
- consola.withTag("plain").log(message);
154
+ writeLog("log", message, { mode: "plain" });
194
155
  },
195
156
  newline() {
196
- consola.withTag("plain").log("");
157
+ process.stderr.write("\n");
197
158
  },
198
159
  debug(message) {
199
- if (process.env.DEBUG === "true") consola.withTag("plain").log(styles.dim(message));
160
+ if (process.env.DEBUG === "true") writeLog("log", styles.dim(message), { mode: "plain" });
200
161
  },
201
162
  out(data, options) {
202
163
  if (typeof data === "string") {
@@ -242,10 +203,6 @@ const logger = {
242
203
  }
243
204
  });
244
205
  process.stdout.write(t);
245
- },
246
- prompt(message, options) {
247
- if (isCI) throw new CIPromptError();
248
- return consola.prompt(message, options);
249
206
  }
250
207
  };
251
208
 
@@ -5767,5 +5724,5 @@ async function loadApplication(params) {
5767
5724
  }
5768
5725
 
5769
5726
  //#endregion
5770
- export { AuthSCIMAttribute_Uniqueness as $, userAgent as A, PipelineResolver_OperationType as B, fetchAll as C, initOperatorClient as D, initOAuth2Client as E, TailorDBGQLPermission_Operator as F, ExecutorTargetType as G, FunctionExecution_Status as H, TailorDBGQLPermission_Permit as I, AuthInvokerSchema$1 as J, ExecutorTriggerType as K, TailorDBType_Permission_Operator as L, WorkflowExecution_Status as M, WorkflowJobExecution_Status as N, platformBaseUrl as O, TailorDBGQLPermission_Action as P, AuthSCIMAttribute_Type as Q, TailorDBType_Permission_Permit as R, writePlatformConfig as S, fetchUserInfo as T, FunctionExecution_Type as U, IdPLang as V, ExecutorJobStatus as W, AuthOAuth2Client_GrantType as X, AuthOAuth2Client_ClientType as Y, AuthSCIMAttribute_Mutability as Z, hashFile as _, loadConfig as a, ConditionSchema as at, loadWorkspaceId as b, ExecutorSchema as c, PageDirection as ct, TailorDBTypeSchema as d, logger as dt, AuthSCIMConfig_AuthorizationType as et, stringifyFunction as f, styles as ft, getDistDir as g, createBundleCache as h, resolveInlineSourcemap as i, GetApplicationSchemaHealthResponse_ApplicationSchemaHealthStatus as it, WorkspacePlatformUserRole as j, resolveStaticWebsiteUrls as k, OAuth2ClientSchema as l, ApplicationSchemaUpdateAttemptStatus as lt, loadFilesWithIgnores as m, generatePluginFilesIfNeeded as n, TenantProviderConfig_TenantProviderType as nt, WorkflowJobSchema as o, Condition_Operator as ot, tailorUserMap as p, symbols as pt, AuthIDPConfig_AuthType as q, loadApplication as r, UserProfileProviderConfig_UserProfileProviderType as rt, createExecutorService as s, FilterSchema as st, defineApplication as t, PATScope as tt, ResolverSchema as u, Subgraph_ServiceType as ut, fetchLatestToken as v, fetchMachineUserToken as w, readPlatformConfig as x, loadAccessToken as y, TailorDBType_PermitAction as z };
5771
- //# sourceMappingURL=application-BGO3TtXi.mjs.map
5727
+ export { AuthSCIMAttribute_Uniqueness as $, userAgent as A, PipelineResolver_OperationType as B, fetchAll as C, initOperatorClient as D, initOAuth2Client as E, TailorDBGQLPermission_Operator as F, ExecutorTargetType as G, FunctionExecution_Status as H, TailorDBGQLPermission_Permit as I, AuthInvokerSchema$1 as J, ExecutorTriggerType as K, TailorDBType_Permission_Operator as L, WorkflowExecution_Status as M, WorkflowJobExecution_Status as N, platformBaseUrl as O, TailorDBGQLPermission_Action as P, AuthSCIMAttribute_Type as Q, TailorDBType_Permission_Permit as R, writePlatformConfig as S, fetchUserInfo as T, FunctionExecution_Type as U, IdPLang as V, ExecutorJobStatus as W, AuthOAuth2Client_GrantType as X, AuthOAuth2Client_ClientType as Y, AuthSCIMAttribute_Mutability as Z, hashFile as _, loadConfig as a, ConditionSchema as at, loadWorkspaceId as b, ExecutorSchema as c, PageDirection as ct, TailorDBTypeSchema as d, CIPromptError as dt, AuthSCIMConfig_AuthorizationType as et, stringifyFunction as f, logger as ft, getDistDir as g, createBundleCache as h, resolveInlineSourcemap as i, GetApplicationSchemaHealthResponse_ApplicationSchemaHealthStatus as it, WorkspacePlatformUserRole as j, resolveStaticWebsiteUrls as k, OAuth2ClientSchema as l, ApplicationSchemaUpdateAttemptStatus as lt, loadFilesWithIgnores as m, symbols as mt, generatePluginFilesIfNeeded as n, TenantProviderConfig_TenantProviderType as nt, WorkflowJobSchema as o, Condition_Operator as ot, tailorUserMap as p, styles as pt, AuthIDPConfig_AuthType as q, loadApplication as r, UserProfileProviderConfig_UserProfileProviderType as rt, createExecutorService as s, FilterSchema as st, defineApplication as t, PATScope as tt, ResolverSchema as u, Subgraph_ServiceType as ut, fetchLatestToken as v, fetchMachineUserToken as w, readPlatformConfig as x, loadAccessToken as y, TailorDBType_PermitAction as z };
5728
+ //# sourceMappingURL=application-91Th6tm6.mjs.map