@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/docs/cli/auth.md CHANGED
@@ -32,6 +32,7 @@ tailor-sdk authconnection [command]
32
32
  | ------------------------------------------------------- | ------------------------------------------------------------------------------------- |
33
33
  | [`authconnection authorize`](#authconnection-authorize) | Authorize an auth connection via OAuth2 flow. |
34
34
  | [`authconnection list`](#authconnection-list) | List all auth connections. |
35
+ | [`authconnection open`](#authconnection-open) | Open the auth connections page in the Tailor Platform Console. |
35
36
  | [`authconnection revoke`](#authconnection-revoke) | Revoke an auth connection's tokens (keeps the connection; use 'delete' to remove it). |
36
37
  | [`authconnection delete`](#authconnection-delete) | Delete an auth connection entirely. |
37
38
 
@@ -165,6 +166,45 @@ tailor-sdk authconnection list [options]
165
166
  See [Global Options](../cli-reference.md#global-options) for options available to all commands.
166
167
 
167
168
  <!-- politty:command:authconnection list:global-options-link:end -->
169
+ <!-- politty:command:authconnection open:heading:start -->
170
+
171
+ ### authconnection open
172
+
173
+ <!-- politty:command:authconnection open:heading:end -->
174
+
175
+ <!-- politty:command:authconnection open:description:start -->
176
+
177
+ Open the auth connections page in the Tailor Platform Console.
178
+
179
+ <!-- politty:command:authconnection open:description:end -->
180
+
181
+ <!-- politty:command:authconnection open:usage:start -->
182
+
183
+ **Usage**
184
+
185
+ ```
186
+ tailor-sdk authconnection open [options]
187
+ ```
188
+
189
+ <!-- politty:command:authconnection open:usage:end -->
190
+
191
+ <!-- politty:command:authconnection open:options:start -->
192
+
193
+ **Options**
194
+
195
+ | Option | Alias | Description | Required | Default | Env |
196
+ | ------------------------------- | ----- | ----------------- | -------- | ------- | ------------------------------ |
197
+ | `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - | `TAILOR_PLATFORM_WORKSPACE_ID` |
198
+ | `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
199
+
200
+ <!-- politty:command:authconnection open:options:end -->
201
+
202
+ <!-- politty:command:authconnection open:global-options-link:start -->
203
+
204
+ See [Global Options](../cli-reference.md#global-options) for options available to all commands.
205
+
206
+ <!-- politty:command:authconnection open:global-options-link:end -->
207
+
168
208
  <!-- politty:command:authconnection revoke:heading:start -->
169
209
 
170
210
  ### authconnection revoke
@@ -204,6 +204,7 @@ Commands for managing Auth service resources.
204
204
  | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------- |
205
205
  | [authconnection authorize](./cli/auth.md#authconnection-authorize) | Authorize an auth connection via OAuth2 flow. |
206
206
  | [authconnection list](./cli/auth.md#authconnection-list) | List all auth connections. |
207
+ | [authconnection open](./cli/auth.md#authconnection-open) | Open the auth connections page in the Tailor Platform Console. |
207
208
  | [authconnection revoke](./cli/auth.md#authconnection-revoke) | Revoke an auth connection's tokens (keeps the connection; use 'delete' to remove it). |
208
209
  | [authconnection delete](./cli/auth.md#authconnection-delete) | Delete an auth connection entirely. |
209
210
  | [machineuser list](./cli/auth.md#machineuser-list) | List all machine users in the application. |
@@ -369,6 +369,18 @@ Auth connections enable OAuth2 authentication with external providers (Google, M
369
369
 
370
370
  For the official Tailor Platform documentation, see [AuthConnection Guide](https://docs.tailor.tech/guides/auth/authconnection).
371
371
 
372
+ > [!WARNING]
373
+ > **Managing connections through `tailor.config.ts` is unreliable for shared and CI deploys.**
374
+ > A deploy revokes and recreates the connection — discarding the token obtained via `authconnection authorize` — whenever it cannot confirm the secret is unchanged. That check relies on a hash stored locally in `.tailor-sdk/secrets-state.json`, which is gitignored and therefore not shared across machines. So a deploy from CI, a clean checkout, another developer's machine, or after deleting `.tailor-sdk/` recreates the connection and drops its token. Only repeated deploys from the same machine that still holds that state keep the token.
375
+ >
376
+ > Because of this, prefer to **create the connection and its token from the Console**. You can jump to the connections page with:
377
+ >
378
+ > ```bash
379
+ > tailor-sdk authconnection open
380
+ > ```
381
+ >
382
+ > The `connections` field in `defineAuth()` and the `authconnection authorize` flow are documented below for reference.
383
+
372
384
  ### Setup Flow
373
385
 
374
386
  Setting up an auth connection requires two steps:
@@ -424,6 +436,9 @@ The authorize command opens a browser for the OAuth2 flow. The authorization cod
424
436
 
425
437
  The SDK uses hash-based change detection for connection configs. Only connections whose configuration has changed since the last `apply` are updated (revoked and recreated). Deleting the `.tailor-sdk/` directory forces all connections to be re-sent.
426
438
 
439
+ > [!WARNING]
440
+ > The secret hash lives in `.tailor-sdk/secrets-state.json`, which is gitignored and not shared across machines or CI. When that state is missing — a clean checkout, CI, another machine, or after deleting `.tailor-sdk/` — a deploy cannot confirm the secret is unchanged, so it revokes and recreates the connection and discards the token stored by `authconnection authorize`. For shared and CI workflows, manage the connection and create its token from the Console (`tailor-sdk authconnection open`) instead.
441
+
427
442
  ### `auth.getConnectionToken()`
428
443
 
429
444
  `auth.getConnectionToken()` retrieves connection tokens at runtime by calling `tailor.authconnection.getConnectionToken()` internally. When `connections` is defined in `defineAuth()`, the connection name is type-checked and autocompleted against the defined keys:
@@ -449,6 +464,9 @@ See [Built-in Interfaces](https://docs.tailor.tech/guides/function/builtin-inter
449
464
  Auth connections can also be managed via the CLI:
450
465
 
451
466
  ```bash
467
+ # Open the connections page in the Console (recommended for creating connections/tokens)
468
+ tailor-sdk authconnection open
469
+
452
470
  # Authorize (opens browser for OAuth2 flow)
453
471
  tailor-sdk authconnection authorize --name google-connection
454
472
 
@@ -459,7 +477,7 @@ tailor-sdk authconnection list
459
477
  tailor-sdk authconnection revoke --name google-connection
460
478
  ```
461
479
 
462
- Connection creation is handled by `tailor-sdk deploy` via the config.
480
+ Connection creation is handled by `tailor-sdk deploy` via the config, but recreation on deploy can drop the authorized token (see the warning at the top of this section) — for shared and CI workflows, create connections and tokens from the Console (`tailor-sdk authconnection open`) instead.
463
481
 
464
482
  See [Auth Resource Commands](../cli/auth.md) for full CLI documentation.
465
483
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/sdk",
3
- "version": "1.59.0",
3
+ "version": "1.60.0",
4
4
  "description": "Tailor Platform SDK - The SDK to work with Tailor Platform",
5
5
  "license": "MIT",
6
6
  "repository": {