@tailor-platform/sdk 1.59.0 → 1.60.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 CHANGED
@@ -1,5 +1,15 @@
1
1
  # @tailor-platform/sdk
2
2
 
3
+ ## 1.60.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1370](https://github.com/tailor-platform/sdk/pull/1370) [`ca4e049`](https://github.com/tailor-platform/sdk/commit/ca4e0494d8f3069e91e55c0b8ccc15ed1e6b567b) Thanks [@toiroakr](https://github.com/toiroakr)! - Add `authconnection open` command to open the auth connections page in the Tailor Platform Console. The `authconnection authorize` command now also points to this Console flow when the local callback server cannot be started, and the auth connection docs note that managing connections via `tailor.config.ts` is unreliable for shared and CI deploys (a deploy without the local `.tailor-sdk/` secret state recreates the connection and discards its token) — create connections and tokens from the Console instead.
8
+
9
+ ### Patch Changes
10
+
11
+ - [#1386](https://github.com/tailor-platform/sdk/pull/1386) [`34aba6c`](https://github.com/tailor-platform/sdk/commit/34aba6c66fd60a2614fe37a4eee07b0252592894) Thanks [@toiroakr](https://github.com/toiroakr)! - Stabilize the `withBundleConcurrency` unit tests by driving their worker delays with fake timers instead of real `setTimeout`, so they no longer flake with a 5s timeout when a CI runner is under load. No runtime behavior changes.
12
+
3
13
  ## 1.59.0
4
14
 
5
15
  ### Minor Changes
@@ -145,11 +145,16 @@ const authorizeAuthConnectionCommand = defineAppCommand({
145
145
  clearTimeout(timeout);
146
146
  });
147
147
  server.on("error", (err) => {
148
+ clearTimeout(timeout);
149
+ const code = err.code;
150
+ const portHint = code === "EADDRINUSE" || code === "EACCES" ? `Try a different port with --port, or authorize via the Console instead:` : `Authorize via the Console instead:`;
151
+ logger.warn(`Could not start the local callback server on port ${args.port}${code ? ` (${code})` : ""}.\n${portHint}\n tailor-sdk authconnection open`);
148
152
  reject(err);
149
153
  });
150
154
  server.listen(args.port, async () => {
151
155
  const authorizeUrl = authUrl.toString();
152
- logger.info(`Opening browser for authorization:\n\n${authorizeUrl}\n`);
156
+ logger.info(args["no-browser"] ? `Open this URL in your browser to authorize:\n\n${authorizeUrl}\n` : `Opening browser for authorization:\n\n${authorizeUrl}\n`);
157
+ logger.info("If this flow doesn't complete, you can authorize via the Console instead:\n tailor-sdk authconnection open");
153
158
  if (!args["no-browser"]) try {
154
159
  await open(authorizeUrl);
155
160
  } catch {
@@ -253,6 +258,43 @@ const listAuthConnectionCommand = defineAppCommand({
253
258
  }
254
259
  });
255
260
 
261
+ //#endregion
262
+ //#region src/cli/commands/authconnection/open.ts
263
+ const consoleBaseUrl$1 = "https://console.tailor.tech";
264
+ const openAuthConnectionCommand = defineAppCommand({
265
+ name: "open",
266
+ description: "Open the auth connections page in the Tailor Platform Console.",
267
+ args: z.object({ ...workspaceArgs }).strict(),
268
+ run: async (args) => {
269
+ const workspaceId = await loadWorkspaceId({
270
+ workspaceId: args["workspace-id"],
271
+ profile: args.profile
272
+ });
273
+ const consolePath = `/workspaces/${workspaceId}/settings/connections`;
274
+ const consoleUrl = new URL(consolePath, consoleBaseUrl$1).toString();
275
+ const jsonOutput = logger.jsonMode;
276
+ logger.info("Opening auth connections page in Tailor Platform Console...");
277
+ let opened = true;
278
+ try {
279
+ await open(consoleUrl);
280
+ } catch {
281
+ opened = false;
282
+ }
283
+ if (jsonOutput) {
284
+ logger.out({
285
+ consoleUrl,
286
+ workspaceId,
287
+ opened
288
+ });
289
+ return;
290
+ }
291
+ if (opened) {
292
+ logger.out(`Console URL: ${consoleUrl}`);
293
+ logger.out(`Workspace ID: ${workspaceId}`);
294
+ } else logger.warn(`Failed to open browser automatically. Please open this URL manually:\n${consoleUrl}`);
295
+ }
296
+ });
297
+
256
298
  //#endregion
257
299
  //#region src/cli/commands/authconnection/revoke.ts
258
300
  const revokeAuthConnectionCommand = defineAppCommand({
@@ -301,6 +343,7 @@ const authconnectionCommand = defineCommand({
301
343
  subCommands: {
302
344
  authorize: authorizeAuthConnectionCommand,
303
345
  list: listAuthConnectionCommand,
346
+ open: openAuthConnectionCommand,
304
347
  revoke: revokeAuthConnectionCommand,
305
348
  delete: deleteAuthConnectionCommand
306
349
  },