@tailor-platform/sdk 1.2.2 → 1.2.4
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 +48 -0
- package/dist/cli/index.mjs +56 -2
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +116 -3
- package/dist/cli/lib.mjs +2 -2
- package/dist/{config-CnvbSTIP.mjs → config-BmQRlW1j.mjs} +64 -48
- package/dist/config-BmQRlW1j.mjs.map +1 -0
- package/dist/configure/index.d.mts +2 -2
- package/dist/configure/index.mjs +71 -1
- package/dist/configure/index.mjs.map +1 -1
- package/dist/{index-aNF917Ib.d.mts → index-Dkyvjk4D.d.mts} +65 -3
- package/dist/jiti-31_Wx1yz.mjs +4482 -0
- package/dist/jiti-31_Wx1yz.mjs.map +1 -0
- package/dist/{list-CinLZzZW.mjs → list-BCSBAjwc.mjs} +3256 -2574
- package/dist/list-BCSBAjwc.mjs.map +1 -0
- package/dist/{types-C0n7Syhv.d.mts → types-BeinUo7W.d.mts} +296 -190
- package/dist/utils/test/index.d.mts +2 -2
- package/package.json +11 -9
- package/dist/config-CnvbSTIP.mjs.map +0 -1
- package/dist/jiti-1z3eKztL.mjs +0 -45561
- package/dist/jiti-1z3eKztL.mjs.map +0 -1
- package/dist/list-CinLZzZW.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,53 @@
|
|
|
1
1
|
# @tailor-platform/sdk
|
|
2
2
|
|
|
3
|
+
## 1.2.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#382](https://github.com/tailor-platform/sdk/pull/382) [`a2d0eb8`](https://github.com/tailor-platform/sdk/commit/a2d0eb86b8e606d59a1735289d7c2c6e74398039) Thanks [@riku99](https://github.com/riku99)! - Enable jsdoc/require-param and jsdoc/require-returns
|
|
8
|
+
|
|
9
|
+
- [#386](https://github.com/tailor-platform/sdk/pull/386) [`6ff9aee`](https://github.com/tailor-platform/sdk/commit/6ff9aeea68ee391e9aeb78c8081ee0a7a7e04729) Thanks [@riku99](https://github.com/riku99)! - Introduce Knip
|
|
10
|
+
|
|
11
|
+
- [#380](https://github.com/tailor-platform/sdk/pull/380) [`2718b7a`](https://github.com/tailor-platform/sdk/commit/2718b7abd8a3c2603c8cfbd234ada41bcf4d0061) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency zod to v4.3.5
|
|
12
|
+
|
|
13
|
+
- [#381](https://github.com/tailor-platform/sdk/pull/381) [`dddd908`](https://github.com/tailor-platform/sdk/commit/dddd908fce87f0dc46a96480136f847ae67a7f31) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency @typescript/native-preview to v7.0.0-dev.20260104.1
|
|
14
|
+
|
|
15
|
+
- [#385](https://github.com/tailor-platform/sdk/pull/385) [`1481cbd`](https://github.com/tailor-platform/sdk/commit/1481cbd9c2c2dfda7ee61af45b8d4881716db67e) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency aquaproj/aqua-registry to v4.452.0
|
|
16
|
+
|
|
17
|
+
- [#387](https://github.com/tailor-platform/sdk/pull/387) [`8d415c9`](https://github.com/tailor-platform/sdk/commit/8d415c9813f0bc7f4e9df67206081e9af10991cf) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency turbo to v2.7.3
|
|
18
|
+
|
|
19
|
+
- [#388](https://github.com/tailor-platform/sdk/pull/388) [`c37287c`](https://github.com/tailor-platform/sdk/commit/c37287c254bb08cebc3e97fc96192a864f9f2999) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency typescript-eslint to v8.52.0
|
|
20
|
+
|
|
21
|
+
- [#389](https://github.com/tailor-platform/sdk/pull/389) [`866596d`](https://github.com/tailor-platform/sdk/commit/866596d8648c7ada3d549c9ea68ec59c3960ba7d) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency aquaproj/aqua to v2.56.2
|
|
22
|
+
|
|
23
|
+
- [#391](https://github.com/tailor-platform/sdk/pull/391) [`b6186e0`](https://github.com/tailor-platform/sdk/commit/b6186e07f8bf8b1f78b827a871d28b6ac97b1967) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency @typescript/native-preview to v7.0.0-dev.20260106.1
|
|
24
|
+
|
|
25
|
+
- [#393](https://github.com/tailor-platform/sdk/pull/393) [`737518e`](https://github.com/tailor-platform/sdk/commit/737518e99bfbce7c3237e7344910a1510f4c16ea) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency aquaproj/aqua-registry to v4.453.0
|
|
26
|
+
|
|
27
|
+
- [#394](https://github.com/tailor-platform/sdk/pull/394) [`b70bdea`](https://github.com/tailor-platform/sdk/commit/b70bdeacdfcef6e042311592bd37ae79bb1f7372) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency knip to v5.80.0
|
|
28
|
+
|
|
29
|
+
- [#399](https://github.com/tailor-platform/sdk/pull/399) [`ec073a1`](https://github.com/tailor-platform/sdk/commit/ec073a1346066b195459976e16579adc6fef1173) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency aquaproj/aqua-registry to v4.454.0
|
|
30
|
+
|
|
31
|
+
- [#401](https://github.com/tailor-platform/sdk/pull/401) [`5744ef5`](https://github.com/tailor-platform/sdk/commit/5744ef5a6b1930e8d98aeaa92a189c5e49c21581) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update suzuki-shunsuke/commit-action action to v0.1.0
|
|
32
|
+
|
|
33
|
+
- [#402](https://github.com/tailor-platform/sdk/pull/402) [`e8e7105`](https://github.com/tailor-platform/sdk/commit/e8e7105c8553f9f258f602923e976b1455e06343) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency oxlint-tsgolint to v0.11.0
|
|
34
|
+
|
|
35
|
+
- [#406](https://github.com/tailor-platform/sdk/pull/406) [`5377f2a`](https://github.com/tailor-platform/sdk/commit/5377f2a7bca9d4090f44c502b49d82f3e253b536) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency knip to v5.80.2
|
|
36
|
+
|
|
37
|
+
- [#411](https://github.com/tailor-platform/sdk/pull/411) [`634b81d`](https://github.com/tailor-platform/sdk/commit/634b81d3beb9ced4d16b695c2c945a1af667694a) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency eslint-plugin-jsdoc to v62
|
|
38
|
+
|
|
39
|
+
- [#407](https://github.com/tailor-platform/sdk/pull/407) [`49cefda`](https://github.com/tailor-platform/sdk/commit/49cefda3d868a66122a02a5e011f5b5379f37035) Thanks [@remiposo](https://github.com/remiposo)! - Made it possible to change the OAuth2 Client ID
|
|
40
|
+
|
|
41
|
+
By setting PLATFORM_OAUTH2_CLIENT_ID, you can now change the OAuth2 Client ID used for logging into Tailor Platform. Using it in combination with PLATFORM_URL makes it easier to log into non-production Tailor Platform environments for testing. This is for internal debugging purposes and is not intended to be set by regular users.
|
|
42
|
+
|
|
43
|
+
## 1.2.3
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- [#378](https://github.com/tailor-platform/sdk/pull/378) [`20471c1`](https://github.com/tailor-platform/sdk/commit/20471c180df682a2b9ba6382039611b689ccb8e3) Thanks [@riku99](https://github.com/riku99)! - Enable the jsdoc/require-jsdoc rule
|
|
48
|
+
|
|
49
|
+
- [#362](https://github.com/tailor-platform/sdk/pull/362) [`e500267`](https://github.com/tailor-platform/sdk/commit/e5002677aded90ec8a4ab7113eb074dc537d456a) Thanks [@toiroakr](https://github.com/toiroakr)! - refactor: move relation logic from configure layer to parser layer
|
|
50
|
+
|
|
3
51
|
## 1.2.2
|
|
4
52
|
|
|
5
53
|
### Patch Changes
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import "../chunk-CIV_ash9.mjs";
|
|
3
|
-
import "../config-
|
|
4
|
-
import { $ as withCommonArgs, B as loadWorkspaceId, D as tokenCommand, F as loadConfig, G as initOAuth2Client, H as writePlatformConfig, J as PATScope, K as initOperatorClient, L as apiCommand, N as applyCommand, O as listCommand$5, Q as jsonArgs, R as fetchLatestToken, S as listCommand$6, U as fetchAll, V as readPlatformConfig, W as fetchUserInfo, X as confirmationArgs, Y as commonArgs, Z as deploymentArgs, a as createCommand$3, d as listCommand$7, et as workspaceArgs, h as executionsCommand, j as generateCommand, l as startCommand, p as getCommand$2, q as readPackageJson, r as deleteCommand$3, s as resumeCommand, t as listCommand$8, tt as logger, w as getCommand$1, x as removeCommand, y as showCommand, z as loadAccessToken } from "../list-
|
|
3
|
+
import "../config-BmQRlW1j.mjs";
|
|
4
|
+
import { $ as withCommonArgs, B as loadWorkspaceId, D as tokenCommand, F as loadConfig, G as initOAuth2Client, H as writePlatformConfig, J as PATScope, K as initOperatorClient, L as apiCommand, N as applyCommand, O as listCommand$5, Q as jsonArgs, R as fetchLatestToken, S as listCommand$6, U as fetchAll, V as readPlatformConfig, W as fetchUserInfo, X as confirmationArgs, Y as commonArgs, Z as deploymentArgs, a as createCommand$3, d as listCommand$7, et as workspaceArgs, h as executionsCommand, j as generateCommand, l as startCommand, p as getCommand$2, q as readPackageJson, r as deleteCommand$3, s as resumeCommand, t as listCommand$8, tt as logger, w as getCommand$1, x as removeCommand, y as showCommand, z as loadAccessToken } from "../list-BCSBAjwc.mjs";
|
|
5
5
|
import { register } from "node:module";
|
|
6
6
|
import { defineCommand, runCommand, runMain } from "citty";
|
|
7
7
|
import { generateCodeVerifier } from "@badgateway/oauth2-client";
|
|
@@ -514,6 +514,11 @@ function secretInfo(secret) {
|
|
|
514
514
|
updatedAt: secret.updateTime ? timestampDate(secret.updateTime).toISOString() : "N/A"
|
|
515
515
|
};
|
|
516
516
|
}
|
|
517
|
+
/**
|
|
518
|
+
* List secrets in a Secret Manager vault.
|
|
519
|
+
* @param {SecretListOptions} options - Secret listing options
|
|
520
|
+
* @returns {Promise<SecretInfo[]>} List of secrets
|
|
521
|
+
*/
|
|
517
522
|
async function secretList(options) {
|
|
518
523
|
const client = await initOperatorClient(await loadAccessToken({
|
|
519
524
|
useProfile: true,
|
|
@@ -686,6 +691,11 @@ function vaultInfo(vault) {
|
|
|
686
691
|
updatedAt: vault.updateTime ? timestampDate(vault.updateTime).toISOString() : "N/A"
|
|
687
692
|
};
|
|
688
693
|
}
|
|
694
|
+
/**
|
|
695
|
+
* List Secret Manager vaults in the workspace.
|
|
696
|
+
* @param {VaultListOptions} [options] - Vault listing options
|
|
697
|
+
* @returns {Promise<VaultInfo[]>} List of vaults
|
|
698
|
+
*/
|
|
689
699
|
async function vaultList(options) {
|
|
690
700
|
const client = await initOperatorClient(await loadAccessToken({
|
|
691
701
|
useProfile: true,
|
|
@@ -760,6 +770,12 @@ const secretCommand = defineCommand({
|
|
|
760
770
|
|
|
761
771
|
//#endregion
|
|
762
772
|
//#region src/cli/utils/progress.ts
|
|
773
|
+
/**
|
|
774
|
+
* Create a simple progress reporter that writes updates to stderr.
|
|
775
|
+
* @param {string} label - Label to prefix progress output
|
|
776
|
+
* @param {number} total - Total number of steps
|
|
777
|
+
* @returns {{ update: () => void; finish: () => void }} Progress helpers
|
|
778
|
+
*/
|
|
763
779
|
function createProgress(label, total) {
|
|
764
780
|
let current = 0;
|
|
765
781
|
const update = () => {
|
|
@@ -775,6 +791,14 @@ function createProgress(label, total) {
|
|
|
775
791
|
finish
|
|
776
792
|
};
|
|
777
793
|
}
|
|
794
|
+
/**
|
|
795
|
+
* Wrap a promise with a timeout, rejecting if the timeout elapses first.
|
|
796
|
+
* @template T
|
|
797
|
+
* @param {Promise<T>} p - Promise to await
|
|
798
|
+
* @param {number} ms - Timeout in milliseconds
|
|
799
|
+
* @param {string} message - Error message on timeout
|
|
800
|
+
* @returns {Promise<T>} Result of the original promise if it completes in time
|
|
801
|
+
*/
|
|
778
802
|
async function withTimeout(p, ms, message) {
|
|
779
803
|
return await Promise.race([p, setTimeout$1(ms).then(() => {
|
|
780
804
|
throw new Error(message);
|
|
@@ -982,6 +1006,13 @@ const getCommand = defineCommand({
|
|
|
982
1006
|
|
|
983
1007
|
//#endregion
|
|
984
1008
|
//#region src/cli/staticwebsite/list.ts
|
|
1009
|
+
/**
|
|
1010
|
+
* List static websites in the workspace.
|
|
1011
|
+
* @param {{ workspaceId?: string; profile?: string }} [options] - Static website listing options
|
|
1012
|
+
* @param {string} [options.workspaceId] - Workspace ID
|
|
1013
|
+
* @param {string} [options.profile] - Workspace profile
|
|
1014
|
+
* @returns {Promise<StaticWebsiteInfo[]>} List of static websites
|
|
1015
|
+
*/
|
|
985
1016
|
async function listStaticWebsites(options) {
|
|
986
1017
|
const client = await initOperatorClient(await loadAccessToken({
|
|
987
1018
|
useProfile: true,
|
|
@@ -1089,6 +1120,11 @@ async function getTypeNamespace(workspaceId, typeName, client, configPath) {
|
|
|
1089
1120
|
}
|
|
1090
1121
|
return null;
|
|
1091
1122
|
}
|
|
1123
|
+
/**
|
|
1124
|
+
* Truncate TailorDB data based on the given options.
|
|
1125
|
+
* @param {TruncateOptions} [options] - Truncate options (all, namespace, or types)
|
|
1126
|
+
* @returns {Promise<void>} Promise that resolves when truncation completes
|
|
1127
|
+
*/
|
|
1092
1128
|
async function truncate(options) {
|
|
1093
1129
|
const client = await initOperatorClient(await loadAccessToken({
|
|
1094
1130
|
useProfile: true,
|
|
@@ -1292,18 +1328,36 @@ function patScopeToString(scope) {
|
|
|
1292
1328
|
default: return "unknown";
|
|
1293
1329
|
}
|
|
1294
1330
|
}
|
|
1331
|
+
/**
|
|
1332
|
+
* Transform a PersonalAccessToken into CLI-friendly info.
|
|
1333
|
+
* @param {PersonalAccessToken} pat - Personal access token resource
|
|
1334
|
+
* @returns {PersonalAccessTokenInfo} Flattened token info
|
|
1335
|
+
*/
|
|
1295
1336
|
function transformPersonalAccessToken(pat) {
|
|
1296
1337
|
return {
|
|
1297
1338
|
name: pat.name,
|
|
1298
1339
|
scopes: pat.scopes.map(patScopeToString)
|
|
1299
1340
|
};
|
|
1300
1341
|
}
|
|
1342
|
+
/**
|
|
1343
|
+
* Get PAT scopes from a write flag.
|
|
1344
|
+
* @param {boolean} write - Whether write access is required
|
|
1345
|
+
* @returns {PATScope[]} Scopes to apply to the token
|
|
1346
|
+
*/
|
|
1301
1347
|
function getScopesFromWriteFlag(write) {
|
|
1302
1348
|
return write ? [PATScope.PAT_SCOPE_READ, PATScope.PAT_SCOPE_WRITE] : [PATScope.PAT_SCOPE_READ];
|
|
1303
1349
|
}
|
|
1304
1350
|
function getScopeStringsFromWriteFlag(write) {
|
|
1305
1351
|
return write ? ["read", "write"] : ["read"];
|
|
1306
1352
|
}
|
|
1353
|
+
/**
|
|
1354
|
+
* Print the created or updated personal access token to the logger.
|
|
1355
|
+
* @param {string} name - Token name
|
|
1356
|
+
* @param {string} token - Token value
|
|
1357
|
+
* @param {boolean} write - Whether the token has write scope
|
|
1358
|
+
* @param {"created" | "updated"} action - Action performed
|
|
1359
|
+
* @returns {void}
|
|
1360
|
+
*/
|
|
1307
1361
|
function printCreatedToken(name, token, write, action) {
|
|
1308
1362
|
const scopes = getScopeStringsFromWriteFlag(write);
|
|
1309
1363
|
if (logger.jsonMode) logger.out({
|