@tailor-platform/sdk 1.70.1 → 1.72.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 +32 -0
- package/dist/{authconnection-BIYzEh2p.d.mts → authconnection-CqfaJfrC.d.mts} +8 -15
- package/dist/{authconnection-Ds2Ahpum.mjs → authconnection-D7lsvsKY.mjs} +2 -2
- package/dist/authconnection-D7lsvsKY.mjs.map +1 -0
- package/dist/cli/index.mjs +781 -185
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +7 -6
- package/dist/cli/lib.mjs +1 -1
- package/dist/completion/zsh-worker.zsh +124 -25
- package/dist/configure/index.d.mts +5 -4
- package/dist/configure/index.mjs.map +1 -1
- package/dist/{index-C-vsbx27.d.mts → index-BDBU7x-i.d.mts} +2 -2
- package/dist/{index-dKNk8hjo.d.mts → index-BSlv_YrG.d.mts} +2 -2
- package/dist/{index-BAEaAqmz.d.mts → index-BzGqTY5x.d.mts} +16 -4
- package/dist/{index-CKI0eZP6.d.mts → index-D3_Au3wu.d.mts} +2 -2
- package/dist/{index-CrqOgUF2.d.mts → index-DtFRlrww.d.mts} +2 -2
- package/dist/{index-DESLU9kI.d.mts → index-jeE3UvF2.d.mts} +2 -2
- package/dist/mock-wf5qeZLi.mjs.map +1 -1
- 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/runtime/authconnection.d.mts +1 -1
- package/dist/runtime/authconnection.mjs +1 -1
- package/dist/runtime/globals.d.mts +1 -1
- package/dist/runtime/index.d.mts +2 -2
- package/dist/runtime/index.mjs +1 -1
- package/dist/{runtime-BpHVwifd.mjs → runtime-Cd375HD-.mjs} +23 -10
- package/dist/runtime-Cd375HD-.mjs.map +1 -0
- package/dist/{types-Dynq4AJv.d.mts → types-aqnqTCfO.d.mts} +4 -342
- package/dist/types-v_ErzNUF.d.mts +345 -0
- package/dist/utils/test/index.d.mts +2 -2
- package/dist/vitest/index.d.mts +4 -3
- package/dist/{workflow.generated-DJULCuRr.d.mts → workflow.generated-Da1zECDw.d.mts} +3 -2
- package/docs/cli/setup.md +129 -19
- package/docs/cli-reference.md +9 -4
- package/docs/services/auth.md +10 -8
- package/docs/testing.md +1 -1
- package/package.json +1 -1
- package/dist/authconnection-Ds2Ahpum.mjs.map +0 -1
- package/dist/runtime-BpHVwifd.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @tailor-platform/sdk
|
|
2
2
|
|
|
3
|
+
## 1.72.0
|
|
4
|
+
### Minor Changes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
- [#1576](https://github.com/tailor-platform/sdk/pull/1576) [`e01a5bd`](https://github.com/tailor-platform/sdk/commit/e01a5bdea6e4c75a5e3c6ed0c29880426806436e) Thanks [@toiroakr](https://github.com/toiroakr)! - Add `tailor-install`, `tailor-notify`, and `tailor-drift-check` steps to generated branch/tag workflow templates. Generated workflows now pin to a SHA-addressed version of `tailor-platform/actions`.
|
|
9
|
+
|
|
10
|
+
Add `setup check --ci` flag: WORKSPACE_ID check is skipped in CI (handled by the runtime) and enforced only in local environments.
|
|
11
|
+
|
|
12
|
+
Add `setup check` Slack partial-config detection: errors when exactly one of `TAILOR_SLACK_BOT_TOKEN` / `TAILOR_SLACK_CHANNEL_ID` is set.
|
|
13
|
+
|
|
14
|
+
Add drift checks: `migration-drift`, `seed-validate`, and `static-websites` rules detect when config changes require re-running setup. Slack partial-config (exactly one of `TAILOR_SLACK_BOT_TOKEN` / `TAILOR_SLACK_CHANNEL_ID` set) is a preflight error, not a drift finding.
|
|
15
|
+
|
|
16
|
+
Add `setup action` subcommand: generates a per-app composite action under `.github/actions/tailor-<name>/action.yml` that wraps `tailor-platform/actions/deploy`. Includes `user-mapping` input for Slack notifications and an optional `build-site` user-owned slot for static website asset builds.
|
|
17
|
+
|
|
18
|
+
Add `setup coordinate` subcommand: generates a coordinator workflow that orchestrates multiple per-app composite actions in a single branch or tag deploy pipeline.
|
|
19
|
+
|
|
20
|
+
**Breaking change (beta)**: Tag workflow files are now named `tailor-<name>-tag.yml` instead of `tailor-<name>.yml`. Re-run `tailor-sdk setup tag` to generate the new file, then manually delete the old `tailor-<name>.yml` workflow.
|
|
21
|
+
|
|
22
|
+
## 1.71.0
|
|
23
|
+
### Minor Changes
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
- [#1605](https://github.com/tailor-platform/sdk/pull/1605) [`6eda76b`](https://github.com/tailor-platform/sdk/commit/6eda76b1ca59d39c0a7fe093dcb39b7e2427f006) Thanks [@toiroakr](https://github.com/toiroakr)! - Narrow auth connection names when calling `getConnectionToken()` outside of `defineAuth()`. When you call `tailor.authconnection.getConnectionToken(...)` or `authconnection.getConnectionToken(...)` (imported from `@tailor-platform/sdk/runtime`), the connection name is now type-checked and autocompleted against the connections defined in `defineAuth()`'s `connections` field, and the resolved token is typed instead of `any`. Run `tailor-sdk generate` (or `deploy`) to refresh `tailor.d.ts` after defining new connections.
|
|
28
|
+
|
|
29
|
+
Deprecate `auth.getConnectionToken()` (the method on `defineAuth()`'s return value). Prefer `authconnection.getConnectionToken(...)` from `@tailor-platform/sdk/runtime` — it does not require importing `auth` from `tailor.config.ts` into runtime files, avoiding bundling config-layer (Node-only) dependencies, the same reasoning behind the existing `auth.invoker()` deprecation.
|
|
30
|
+
|
|
31
|
+
Fix the resolved token type to match what the platform actually returns: only `access_token`. The previous type also listed `refresh_token`, `token_type`, and `expiry`, none of which are ever present in the response.
|
|
32
|
+
|
|
33
|
+
Fix connection name narrowing to also apply when only `@tailor-platform/sdk/runtime` is imported (without ever importing from the main `@tailor-platform/sdk` entry). `mockAuthconnection()` (from `@tailor-platform/sdk/vitest`) is now typed the same way, replacing its previous `any`-typed token payload.
|
|
34
|
+
|
|
3
35
|
## 1.70.1
|
|
4
36
|
### Patch Changes
|
|
5
37
|
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
+
import { n as AuthConnectionTokenResult$1 } from "./types-v_ErzNUF.mjs";
|
|
2
|
+
import { ConnectionName } from "@tailor-platform/sdk";
|
|
3
|
+
|
|
4
|
+
//#region src/runtime/authconnection.d.ts
|
|
1
5
|
declare namespace authconnection_d_exports {
|
|
2
6
|
export { TailorAuthconnectionAPI, getConnectionToken };
|
|
3
7
|
}
|
|
4
|
-
/**
|
|
5
|
-
* Auth connection utilities.
|
|
6
|
-
*
|
|
7
|
-
* Thin typed wrapper around the platform-provided `tailor.authconnection` runtime API.
|
|
8
|
-
* At runtime this delegates to `globalThis.tailor.authconnection`. Use
|
|
9
|
-
* `mockAuthconnection` from `@tailor-platform/sdk/vitest` to mock in unit tests.
|
|
10
|
-
* @example
|
|
11
|
-
* import { authconnection } from "@tailor-platform/sdk/runtime";
|
|
12
|
-
*
|
|
13
|
-
* const token = await authconnection.getConnectionToken("my-connection");
|
|
14
|
-
*/
|
|
15
8
|
/**
|
|
16
9
|
* Platform API surface for `tailor.authconnection`. Describes the shape the
|
|
17
10
|
* platform runtime injects on `globalThis.tailor.authconnection`.
|
|
@@ -24,16 +17,16 @@ interface TailorAuthconnectionAPI {
|
|
|
24
17
|
/**
|
|
25
18
|
* Returns the access token for the given auth connection.
|
|
26
19
|
* @param connectionName - Auth connection name as defined in tailor.config
|
|
27
|
-
* @returns Token payload
|
|
20
|
+
* @returns Token payload
|
|
28
21
|
*/
|
|
29
|
-
getConnectionToken(connectionName:
|
|
22
|
+
getConnectionToken(connectionName: ConnectionName): Promise<AuthConnectionTokenResult$1>;
|
|
30
23
|
}
|
|
31
24
|
/**
|
|
32
25
|
* See {@link TailorAuthconnectionAPI.getConnectionToken}.
|
|
33
26
|
* @param args - Forwarded to {@link TailorAuthconnectionAPI.getConnectionToken}
|
|
34
|
-
* @returns Token payload
|
|
27
|
+
* @returns Token payload
|
|
35
28
|
*/
|
|
36
29
|
declare const getConnectionToken: TailorAuthconnectionAPI["getConnectionToken"];
|
|
37
30
|
//#endregion
|
|
38
31
|
export { authconnection_d_exports as n, getConnectionToken as r, TailorAuthconnectionAPI as t };
|
|
39
|
-
//# sourceMappingURL=authconnection-
|
|
32
|
+
//# sourceMappingURL=authconnection-CqfaJfrC.d.mts.map
|
|
@@ -7,10 +7,10 @@ const api = () => globalThis.tailor.authconnection;
|
|
|
7
7
|
/**
|
|
8
8
|
* See {@link TailorAuthconnectionAPI.getConnectionToken}.
|
|
9
9
|
* @param args - Forwarded to {@link TailorAuthconnectionAPI.getConnectionToken}
|
|
10
|
-
* @returns Token payload
|
|
10
|
+
* @returns Token payload
|
|
11
11
|
*/
|
|
12
12
|
const getConnectionToken = (...args) => api().getConnectionToken(...args);
|
|
13
13
|
|
|
14
14
|
//#endregion
|
|
15
15
|
export { getConnectionToken as n, authconnection_exports as t };
|
|
16
|
-
//# sourceMappingURL=authconnection-
|
|
16
|
+
//# sourceMappingURL=authconnection-D7lsvsKY.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authconnection-D7lsvsKY.mjs","names":[],"sources":["../src/runtime/authconnection.ts"],"sourcesContent":["/**\n * Auth connection utilities.\n *\n * Thin typed wrapper around the platform-provided `tailor.authconnection` runtime API.\n * At runtime this delegates to `globalThis.tailor.authconnection`. Use\n * `mockAuthconnection` from `@tailor-platform/sdk/vitest` to mock in unit tests.\n *\n * `connectionName` is narrowed to the connection names defined in `defineAuth()`'s\n * `connections` once `tailor.d.ts` has been generated (via `tailor-sdk deploy`/`generate`).\n * @example\n * import { authconnection } from \"@tailor-platform/sdk/runtime\";\n *\n * const token = await authconnection.getConnectionToken(\"my-connection\");\n */\n\nimport type { AuthConnectionTokenResult } from \"#/configure/services/auth/types\";\n// Import from the public entry (not `#/configure/types/connection-name`) so this d.ts\n// references `@tailor-platform/sdk` externally instead of inlining the registry — a single\n// generated `declare module \"@tailor-platform/sdk\"` then narrows this entry too.\nimport type { ConnectionName } from \"@tailor-platform/sdk\";\n\n/**\n * Platform API surface for `tailor.authconnection`. Describes the shape the\n * platform runtime injects on `globalThis.tailor.authconnection`.\n *\n * Each method below is also re-exported as a top-level named export from this\n * module so callers can either `import * as authconnection from\n * \"@tailor-platform/sdk/runtime/authconnection\"` or pick individual methods.\n */\nexport interface TailorAuthconnectionAPI {\n /**\n * Returns the access token for the given auth connection.\n * @param connectionName - Auth connection name as defined in tailor.config\n * @returns Token payload\n */\n getConnectionToken(connectionName: ConnectionName): Promise<AuthConnectionTokenResult>;\n}\n\nconst api = (): TailorAuthconnectionAPI =>\n (globalThis as { tailor: { authconnection: TailorAuthconnectionAPI } }).tailor.authconnection;\n\n/**\n * See {@link TailorAuthconnectionAPI.getConnectionToken}.\n * @param args - Forwarded to {@link TailorAuthconnectionAPI.getConnectionToken}\n * @returns Token payload\n */\nexport const getConnectionToken: TailorAuthconnectionAPI[\"getConnectionToken\"] = (...args) =>\n api().getConnectionToken(...args);\n"],"mappings":";;;;;AAsCA,MAAM,YACH,WAAuE,OAAO;;;;;;AAOjF,MAAa,sBAAqE,GAAG,SACnF,IAAI,CAAC,CAAC,mBAAmB,GAAG,IAAI"}
|