@tailor-platform/sdk 1.73.3 → 1.74.1
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 +44 -0
- package/dist/{application-DgTCDMZY.mjs → application-BsH6tkZC.mjs} +96 -17
- package/dist/application-BsH6tkZC.mjs.map +1 -0
- package/dist/application-CSUhZMb5.mjs +3 -0
- package/dist/cli/commands/deploy/apply-phases.d.mts +1 -0
- package/dist/cli/commands/executor/trigger.d.mts +1 -1
- package/dist/cli/commands/tailordb/migrate/snapshot.d.mts +1 -16
- package/dist/cli/index.mjs +121 -43
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +4 -4
- package/dist/cli/lib.mjs +3 -3
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/shared/client.d.mts +1 -1
- package/dist/completion/zsh-worker.zsh +28 -3
- package/dist/configure/index.mjs +2 -2
- package/dist/configure/services/tailordb/schema.d.mts +5 -19
- package/dist/configure/types/field-runtime.d.mts +17 -0
- package/dist/configure/types/type.d.mts +1 -18
- package/dist/field-runtime-9bfXBAOK.mjs +183 -0
- package/dist/field-runtime-9bfXBAOK.mjs.map +1 -0
- package/dist/plugin/builtin/seed/index.mjs +1 -1
- package/dist/{repl-editor-BmQOyZJd.mjs → repl-editor-BCozyiNq.mjs} +3 -2
- package/dist/{repl-editor-BmQOyZJd.mjs.map → repl-editor-BCozyiNq.mjs.map} +1 -1
- package/dist/{runtime-SxHHEzVb.mjs → runtime-DV1EnfMs.mjs} +2130 -1538
- package/dist/runtime-DV1EnfMs.mjs.map +1 -0
- package/dist/{schema-DAdZSFOd.mjs → schema-Dl_y0m9e.mjs} +8 -167
- package/dist/schema-Dl_y0m9e.mjs.map +1 -0
- package/dist/secretmanager-Bd45j7an.mjs +98 -0
- package/dist/secretmanager-Bd45j7an.mjs.map +1 -0
- package/dist/{seed-DoMTMLcm.mjs → seed-fm0LeYP2.mjs} +14 -3
- package/dist/seed-fm0LeYP2.mjs.map +1 -0
- package/dist/{service-DiEtAsvc.mjs → service-BCRJ-3NV.mjs} +18 -1
- package/dist/{service-DiEtAsvc.mjs.map → service-BCRJ-3NV.mjs.map} +1 -1
- package/dist/service-CPMlIg3X.mjs +3 -0
- package/dist/tailor-proto/src/tailor/v1/aigateway_pb.d.mts +2 -2
- package/dist/tailor-proto/src/tailor/v1/aigateway_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/application_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/application_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/auth_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/auth_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/events_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/events_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/executor_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/executor_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/function_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/function_registry_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/function_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/http_adapter_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/idp_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/idp_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/metadata_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/metadata_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/meter_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/pipeline_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/pipeline_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/secret_manager_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/secret_manager_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +2 -2
- package/dist/tailor-proto/src/tailor/v1/stateflow_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/stateflow_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/staticwebsite_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/staticwebsite_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/tailordb_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/tailordb_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/telemetryrouter_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/telemetryrouter_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/workflow_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/workflow_resource_pb.d.mts +1 -1
- package/dist/tailor-proto/src/tailor/v1/workspace_pb.d.mts +2 -2
- package/dist/tailor-proto/src/tailor/v1/workspace_resource_pb.d.mts +1 -1
- package/dist/types-BwzB2okW.mjs +199 -0
- package/dist/types-BwzB2okW.mjs.map +1 -0
- package/dist/types-KlawuVKa.mjs +4 -0
- package/dist/vitest/index.d.mts +8 -1
- package/dist/vitest/index.mjs +778 -2
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/mock.d.mts +8 -363
- package/dist/vitest/mocks/aigateway.d.mts +30 -0
- package/dist/vitest/mocks/authconnection.d.mts +28 -0
- package/dist/vitest/mocks/file.d.mts +41 -0
- package/dist/vitest/mocks/iconv.d.mts +27 -0
- package/dist/vitest/mocks/idp.d.mts +44 -0
- package/dist/vitest/mocks/secretmanager.d.mts +33 -0
- package/dist/vitest/mocks/tailordb.d.mts +71 -0
- package/dist/vitest/mocks/workflow.d.mts +115 -0
- package/dist/vitest/setup.mjs +1 -1
- package/docs/cli/application.md +21 -11
- package/docs/cli/setup.md +25 -0
- package/docs/cli-reference.md +1 -0
- package/package.json +15 -15
- package/dist/application-BAo_zFA4.mjs +0 -3
- package/dist/application-DgTCDMZY.mjs.map +0 -1
- package/dist/field-DOsJCPFa.mjs +0 -22
- package/dist/field-DOsJCPFa.mjs.map +0 -1
- package/dist/mock-Ce1GCi4-.mjs +0 -871
- package/dist/mock-Ce1GCi4-.mjs.map +0 -1
- package/dist/runtime-SxHHEzVb.mjs.map +0 -1
- package/dist/schema-DAdZSFOd.mjs.map +0 -1
- package/dist/seed-DoMTMLcm.mjs.map +0 -1
- package/dist/service-BXmdFwSH.mjs +0 -3
- package/dist/types-qhFZ8y9B.mjs +0 -4
- package/dist/types-ywCGpzDZ.mjs +0 -360
- package/dist/types-ywCGpzDZ.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,49 @@
|
|
|
1
1
|
# @tailor-platform/sdk
|
|
2
2
|
|
|
3
|
+
## 1.74.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1669](https://github.com/tailor-platform/sdk/pull/1669) [`6313353`](https://github.com/tailor-platform/sdk/commit/6313353a81642a8d52d4559dc37044c9365ca241) Thanks [@dqn](https://github.com/dqn)! - Preserve special characters when exporting TailorDB ERD viewer HTML and generated seed scripts.
|
|
8
|
+
|
|
9
|
+
- [#1670](https://github.com/tailor-platform/sdk/pull/1670) [`8c18c3b`](https://github.com/tailor-platform/sdk/commit/8c18c3bc1ee3a37e3258def1d15b9cc05b33aec4) Thanks [@dqn](https://github.com/dqn)! - Keep resolver and TailorDB field parsing behavior aligned.
|
|
10
|
+
|
|
11
|
+
- [#1682](https://github.com/tailor-platform/sdk/pull/1682) [`1e9ef08`](https://github.com/tailor-platform/sdk/commit/1e9ef0874f4ccea99874baf160d70d9ad8ad9688) Thanks [@toiroakr](https://github.com/toiroakr)! - Fix a type error introduced in a previous release where an array field's `.index()`/`.unique()`/`.clone()`/`pickFields()` typing could become incompatible with itself when a field's shape flowed through an unresolved generic (e.g. a module-authoring helper's `ReturnType<typeof genericFn>` with no explicit type arguments). This could surface as a spurious `TS2322`/`TS2345` type error when wiring a `db.type()` result produced by one generic helper into another.
|
|
12
|
+
|
|
13
|
+
- [#1668](https://github.com/tailor-platform/sdk/pull/1668) [`abcdca5`](https://github.com/tailor-platform/sdk/commit/abcdca5808e487547030ac6163bf4429d976bb54) Thanks [@dqn](https://github.com/dqn)! - Remove the obsolete `MigrationInfo` type export from `@tailor-platform/sdk/cli`.
|
|
14
|
+
|
|
15
|
+
- [#1661](https://github.com/tailor-platform/sdk/pull/1661) [`3ccbae3`](https://github.com/tailor-platform/sdk/commit/3ccbae3f02cdaddbacd8849a8c097101e3c8a050) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency tsx to v4.22.5
|
|
16
|
+
|
|
17
|
+
- [#1666](https://github.com/tailor-platform/sdk/pull/1666) [`1d61fed`](https://github.com/tailor-platform/sdk/commit/1d61fed82e6433dd90f2137dbd2049bc3c74b706) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update @opentelemetry
|
|
18
|
+
|
|
19
|
+
- [#1667](https://github.com/tailor-platform/sdk/pull/1667) [`2110fd1`](https://github.com/tailor-platform/sdk/commit/2110fd1f4e27733934179f02af503efc175ee280) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency undici to v8.6.0
|
|
20
|
+
|
|
21
|
+
- [#1675](https://github.com/tailor-platform/sdk/pull/1675) [`15e721c`](https://github.com/tailor-platform/sdk/commit/15e721c610123395ccd0fa44c4bf8895d84b6584) Thanks [@dqn](https://github.com/dqn)! - Refactor Vitest mock helpers without changing their public APIs or behavior.
|
|
22
|
+
|
|
23
|
+
## 1.74.0
|
|
24
|
+
|
|
25
|
+
### Minor Changes
|
|
26
|
+
|
|
27
|
+
- [#1652](https://github.com/tailor-platform/sdk/pull/1652) [`6c33b01`](https://github.com/tailor-platform/sdk/commit/6c33b01eedfbf85382f1d51d45496b79a372dca7) Thanks [@toiroakr](https://github.com/toiroakr)! - Add `tailor-sdk setup delete <file...>` to cleanly remove generated CI workflow/action files together with their `.github/tailor-sdk.lock` entries. It only deletes files recorded in the lock, warns when an action is still referenced by a `setup coordinate` workflow, and removes the composite action's directory once it is empty.
|
|
28
|
+
|
|
29
|
+
- [#1612](https://github.com/tailor-platform/sdk/pull/1612) [`7e7f00e`](https://github.com/tailor-platform/sdk/commit/7e7f00ee769d561abf12fc588ad10accd78770f2) Thanks [@dqn](https://github.com/dqn)! - Allow `tailor-sdk deploy --config` to accept comma-separated config paths so interdependent apps can be deployed together. Application, executor, workflow, workflow job, StaticWebsite, TailorDB, Auth, Auth connection, IdP, Resolver, AIGateway, and Secret Manager vault names must be unique across all configs passed to a single deploy, and resources still owned by another config in the same deploy are no longer deleted.
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- [#1646](https://github.com/tailor-platform/sdk/pull/1646) [`6ea74c1`](https://github.com/tailor-platform/sdk/commit/6ea74c11bd3d7a9e44e1afdedaf6328203f7745a) Thanks [@dqn](https://github.com/dqn)! - Keep deploy ownership handling consistent across resource types without changing deploy behavior.
|
|
34
|
+
|
|
35
|
+
- [#1655](https://github.com/tailor-platform/sdk/pull/1655) [`db7cbef`](https://github.com/tailor-platform/sdk/commit/db7cbef744240795c6b1281dc96f8e9edd8e83f9) Thanks [@toiroakr](https://github.com/toiroakr)! - Reject duplicate executor names, and duplicate resolver names within the same namespace, with a clear error at load time instead of silently deploying only one of them.
|
|
36
|
+
|
|
37
|
+
- [#1648](https://github.com/tailor-platform/sdk/pull/1648) [`f7eb527`](https://github.com/tailor-platform/sdk/commit/f7eb527be823a5cafc94717118a97cc7c450ef80) Thanks [@dqn](https://github.com/dqn)! - Keep resolver bundle cache entries separate across namespaces.
|
|
38
|
+
|
|
39
|
+
- [#1626](https://github.com/tailor-platform/sdk/pull/1626) [`06cc5f2`](https://github.com/tailor-platform/sdk/commit/06cc5f2960c5a09e9783d6b0923ed8c1b3d606a8) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency politty to v0.11.0
|
|
40
|
+
|
|
41
|
+
- [#1645](https://github.com/tailor-platform/sdk/pull/1645) [`fecb691`](https://github.com/tailor-platform/sdk/commit/fecb691a4cedf01d65eec51c39712b23065ed36b) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update oxc
|
|
42
|
+
|
|
43
|
+
- [#1660](https://github.com/tailor-platform/sdk/pull/1660) [`5b7801f`](https://github.com/tailor-platform/sdk/commit/5b7801f82dec177fa9dc7b7eb8eeec7536dbbcb5) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency rolldown to v1.1.4
|
|
44
|
+
|
|
45
|
+
- [#1650](https://github.com/tailor-platform/sdk/pull/1650) [`d42477b`](https://github.com/tailor-platform/sdk/commit/d42477bfedb4463bec9345c91a15ea5431bc877c) Thanks [@toiroakr](https://github.com/toiroakr)! - Fix schema snapshot normalization mutating the input snapshot in place, which could cause a caller-held `SchemaSnapshot` reference to silently change after normalization.
|
|
46
|
+
|
|
3
47
|
## 1.73.3
|
|
4
48
|
### Patch Changes
|
|
5
49
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { n as isSdkBranded } from "./brand-Eo4pLXPJ.mjs";
|
|
2
2
|
import { t as assertDefined } from "./assert-DBxo8jPo.mjs";
|
|
3
3
|
import { a as parseBoolean, n as logger, r as styles } from "./logger-BEiZZ3qT.mjs";
|
|
4
|
-
import { a as TailorFieldSchema, i as AuthInvokerSchema, n as ExecutorSchema, o as loadFilesWithIgnores, r as AuthConfigSchema, s as functionSchema, t as createExecutorService } from "./service-
|
|
4
|
+
import { a as TailorFieldSchema, i as AuthInvokerSchema, n as ExecutorSchema, o as loadFilesWithIgnores, r as AuthConfigSchema, s as functionSchema, t as createExecutorService } from "./service-BCRJ-3NV.mjs";
|
|
5
5
|
import { n as enumConstantsPlugin, t as EnumConstantsGeneratorID } from "./enum-constants-j9QBF0cB.mjs";
|
|
6
6
|
import { t as multiline } from "./multiline-sfHpTZZK.mjs";
|
|
7
7
|
import { n as fileUtilsPlugin, t as FileUtilsGeneratorID } from "./file-utils-DcyIPFQh.mjs";
|
|
8
8
|
import { n as kyselyTypePlugin, t as KyselyGeneratorID } from "./kysely-type-D-zflMGf.mjs";
|
|
9
|
-
import { n as seedPlugin, r as isPluginGeneratedType, t as SeedGeneratorID } from "./seed-
|
|
9
|
+
import { n as seedPlugin, r as isPluginGeneratedType, t as SeedGeneratorID } from "./seed-fm0LeYP2.mjs";
|
|
10
10
|
import { t as readPackageJson } from "./package-json-8b0O9TlX.mjs";
|
|
11
11
|
import { i as userAgent, n as tightenSecretFilePermissions, r as writeSecretFile } from "./secret-file-VSVGy1V0.mjs";
|
|
12
12
|
import { t as createCLIError } from "./errors-Dtf2WPaW.mjs";
|
|
@@ -606,6 +606,44 @@ async function fetchAll(fn) {
|
|
|
606
606
|
return items;
|
|
607
607
|
}
|
|
608
608
|
/**
|
|
609
|
+
* @internal
|
|
610
|
+
* @param error - Error value to inspect
|
|
611
|
+
* @returns Whether the error is a Connect NotFound error
|
|
612
|
+
*/
|
|
613
|
+
function isNotFoundError(error) {
|
|
614
|
+
return error instanceof ConnectError && error.code === Code.NotFound;
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* Fetch all paginated resources, treating an absent resource group as empty.
|
|
618
|
+
* @template T
|
|
619
|
+
* @param fn - Page fetcher returning items and next page token
|
|
620
|
+
* @returns Items fetched before pagination completes or the fetcher raises NotFound
|
|
621
|
+
*/
|
|
622
|
+
async function fetchAllTolerant(fn) {
|
|
623
|
+
return await fetchAll(async (pageToken, maxPageSize) => {
|
|
624
|
+
try {
|
|
625
|
+
return await fn(pageToken, maxPageSize);
|
|
626
|
+
} catch (error) {
|
|
627
|
+
if (isNotFoundError(error)) return [[], ""];
|
|
628
|
+
throw error;
|
|
629
|
+
}
|
|
630
|
+
});
|
|
631
|
+
}
|
|
632
|
+
/**
|
|
633
|
+
* Fetch a single resource, treating NotFound as an absent value.
|
|
634
|
+
* @template T
|
|
635
|
+
* @param fn - Resource getter
|
|
636
|
+
* @returns Fetched resource, or undefined when the getter raises NotFound
|
|
637
|
+
*/
|
|
638
|
+
async function getOrNull(fn) {
|
|
639
|
+
try {
|
|
640
|
+
return await fn();
|
|
641
|
+
} catch (error) {
|
|
642
|
+
if (isNotFoundError(error)) return;
|
|
643
|
+
throw error;
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
609
647
|
* Fetch paginated resources with an optional upper bound on the number of
|
|
610
648
|
* items returned. When `limit` is 0 or undefined the function behaves
|
|
611
649
|
* like `fetchAll` and returns every page. When `limit` is positive the
|
|
@@ -676,7 +714,7 @@ async function resolveStaticWebsiteUrls(client, workspaceId, urls, context, opti
|
|
|
676
714
|
logger.warn(`Static website "${siteName}" has no URL assigned yet. Excluding from ${context}.`);
|
|
677
715
|
return [];
|
|
678
716
|
} catch (error) {
|
|
679
|
-
if (error
|
|
717
|
+
if (isNotFoundError(error) && expectedLocalNames?.has(siteName)) return [url];
|
|
680
718
|
logger.warn(`Static website "${siteName}" not found for ${context} configuration. Excluding from ${context}.`);
|
|
681
719
|
return [];
|
|
682
720
|
}
|
|
@@ -1540,8 +1578,8 @@ function createDepCollectorPlugin() {
|
|
|
1540
1578
|
|
|
1541
1579
|
//#endregion
|
|
1542
1580
|
//#region src/cli/cache/bundle-cache.ts
|
|
1543
|
-
function buildCacheKey(kind, name) {
|
|
1544
|
-
return `${kind}:${name}`;
|
|
1581
|
+
function buildCacheKey(kind, name, namespace) {
|
|
1582
|
+
return namespace ? `${kind}:${namespace}:${name}` : `${kind}:${name}`;
|
|
1545
1583
|
}
|
|
1546
1584
|
function combineHash(fileHash, contextHash) {
|
|
1547
1585
|
if (!contextHash) return fileHash;
|
|
@@ -1568,10 +1606,11 @@ function computeBundlerContextHash(params) {
|
|
|
1568
1606
|
* @returns The bundled code string
|
|
1569
1607
|
*/
|
|
1570
1608
|
async function withCache(params) {
|
|
1571
|
-
const { cache, kind, name, sourceFile, contextHash, build } = params;
|
|
1609
|
+
const { cache, kind, namespace, name, sourceFile, contextHash, build } = params;
|
|
1572
1610
|
if (!cache) return await build([]);
|
|
1573
1611
|
const content = cache.tryRestore({
|
|
1574
1612
|
kind,
|
|
1613
|
+
namespace,
|
|
1575
1614
|
name,
|
|
1576
1615
|
contextHash
|
|
1577
1616
|
});
|
|
@@ -1583,6 +1622,7 @@ async function withCache(params) {
|
|
|
1583
1622
|
const code = await build([plugin]);
|
|
1584
1623
|
cache.save({
|
|
1585
1624
|
kind,
|
|
1625
|
+
namespace,
|
|
1586
1626
|
name,
|
|
1587
1627
|
sourceFile,
|
|
1588
1628
|
content: code,
|
|
@@ -1598,7 +1638,7 @@ async function withCache(params) {
|
|
|
1598
1638
|
*/
|
|
1599
1639
|
function createBundleCache(store) {
|
|
1600
1640
|
function tryRestore(params) {
|
|
1601
|
-
const cacheKey = buildCacheKey(params.kind, params.name);
|
|
1641
|
+
const cacheKey = buildCacheKey(params.kind, params.name, params.namespace);
|
|
1602
1642
|
const entry = store.getEntry(cacheKey);
|
|
1603
1643
|
if (!entry) return;
|
|
1604
1644
|
let currentHash;
|
|
@@ -1611,8 +1651,8 @@ function createBundleCache(store) {
|
|
|
1611
1651
|
return store.restoreBundleContent(cacheKey);
|
|
1612
1652
|
}
|
|
1613
1653
|
function save(params) {
|
|
1614
|
-
const { kind, name, sourceFile, content, dependencyPaths, contextHash } = params;
|
|
1615
|
-
const cacheKey = buildCacheKey(kind, name);
|
|
1654
|
+
const { kind, namespace, name, sourceFile, content, dependencyPaths, contextHash } = params;
|
|
1655
|
+
const cacheKey = buildCacheKey(kind, name, namespace);
|
|
1616
1656
|
const allDeps = dependencyPaths.includes(sourceFile) ? dependencyPaths : [sourceFile, ...dependencyPaths];
|
|
1617
1657
|
const inputHash = combineHash(hashFiles(allDeps), contextHash);
|
|
1618
1658
|
const contentHash = hashContent(content);
|
|
@@ -4358,7 +4398,7 @@ async function fetchExternalTailorDBTypeNameSources(args) {
|
|
|
4358
4398
|
});
|
|
4359
4399
|
return [tailordbTypes, nextPageToken ?? ""];
|
|
4360
4400
|
} catch (error) {
|
|
4361
|
-
if (error
|
|
4401
|
+
if (isNotFoundError(error)) return [[], ""];
|
|
4362
4402
|
throw error;
|
|
4363
4403
|
}
|
|
4364
4404
|
});
|
|
@@ -4403,8 +4443,23 @@ function assertUniqueLocalTailorDBTypeNames(args) {
|
|
|
4403
4443
|
*/
|
|
4404
4444
|
async function assertUniqueTailorDBTypeNamesWithExternal(args) {
|
|
4405
4445
|
const localSources = collectLocalTailorDBTypeNameSources(args);
|
|
4406
|
-
const
|
|
4407
|
-
|
|
4446
|
+
const plannedExternalServices = args.plannedExternalTailorDBServices ?? [];
|
|
4447
|
+
const plannedExternalNamespaces = new Set(plannedExternalServices.map((service) => service.namespace));
|
|
4448
|
+
const plannedExternalSources = collectLocalTailorDBTypeNameSources({ tailorDBServices: plannedExternalServices }).map((source) => ({
|
|
4449
|
+
...source,
|
|
4450
|
+
kind: "external"
|
|
4451
|
+
}));
|
|
4452
|
+
const remoteExternalNamespaces = args.externalTailorDBNamespaces.filter((namespace) => !plannedExternalNamespaces.has(namespace));
|
|
4453
|
+
const externalSources = remoteExternalNamespaces.length > 0 ? await fetchExternalTailorDBTypeNameSources({
|
|
4454
|
+
client: args.client,
|
|
4455
|
+
workspaceId: args.workspaceId,
|
|
4456
|
+
externalTailorDBNamespaces: remoteExternalNamespaces
|
|
4457
|
+
}) : [];
|
|
4458
|
+
assertUniqueTailorDBTypeNames({ sources: [
|
|
4459
|
+
...localSources,
|
|
4460
|
+
...plannedExternalSources,
|
|
4461
|
+
...externalSources
|
|
4462
|
+
] });
|
|
4408
4463
|
}
|
|
4409
4464
|
function formatTailorDBTypeNameSource(source) {
|
|
4410
4465
|
const namespaceLabel = source.kind === "external" ? `external namespace "${source.namespace}"` : `namespace "${source.namespace}"`;
|
|
@@ -5257,12 +5312,12 @@ async function bundleResolvers(namespace, config, triggerContext, cache, inlineS
|
|
|
5257
5312
|
} catch {
|
|
5258
5313
|
tsconfig = void 0;
|
|
5259
5314
|
}
|
|
5260
|
-
const results = await withBundleConcurrency(resolvers, (resolver) => bundleSingleResolver(resolver, outputDir, tsconfig, triggerContext, cache, inlineSourcemap, bundleLogLevel));
|
|
5315
|
+
const results = await withBundleConcurrency(resolvers, (resolver) => bundleSingleResolver(namespace, resolver, outputDir, tsconfig, triggerContext, cache, inlineSourcemap, bundleLogLevel));
|
|
5261
5316
|
for (const [name, code] of results) bundledCode.set(name, code);
|
|
5262
5317
|
logger.log(`${styles.success("Bundled")} ${styles.info(`"${namespace}"`)}`);
|
|
5263
5318
|
return bundledCode;
|
|
5264
5319
|
}
|
|
5265
|
-
async function bundleSingleResolver(resolver, outputDir, tsconfig, triggerContext, cache, inlineSourcemap, bundleLogLevel = "DEBUG") {
|
|
5320
|
+
async function bundleSingleResolver(namespace, resolver, outputDir, tsconfig, triggerContext, cache, inlineSourcemap, bundleLogLevel = "DEBUG") {
|
|
5266
5321
|
const serializedTriggerContext = serializeTriggerContext(triggerContext);
|
|
5267
5322
|
const contextHash = computeBundlerContextHash({
|
|
5268
5323
|
sourceFile: resolver.sourceFile,
|
|
@@ -5274,6 +5329,7 @@ async function bundleSingleResolver(resolver, outputDir, tsconfig, triggerContex
|
|
|
5274
5329
|
const code = await withCache({
|
|
5275
5330
|
cache,
|
|
5276
5331
|
kind: "resolver",
|
|
5332
|
+
namespace,
|
|
5277
5333
|
name: resolver.name,
|
|
5278
5334
|
sourceFile: resolver.sourceFile,
|
|
5279
5335
|
contextHash,
|
|
@@ -5368,9 +5424,26 @@ function createResolverService(namespace, config) {
|
|
|
5368
5424
|
const resolverFiles = loadFilesWithIgnores(config);
|
|
5369
5425
|
logger.log(`Found ${styles.highlight(resolverFiles.length.toString())} resolver files for service ${styles.highlight(`"${namespace}"`)}`);
|
|
5370
5426
|
await Promise.all(resolverFiles.map((resolverFile) => loadResolverForFile(resolverFile)));
|
|
5427
|
+
assertUniqueResolverNames(resolvers, namespace);
|
|
5371
5428
|
}
|
|
5372
5429
|
};
|
|
5373
5430
|
}
|
|
5431
|
+
/**
|
|
5432
|
+
* Assert that every loaded resolver in a namespace has a unique name.
|
|
5433
|
+
* Resolvers are stored by source file, so two files declaring the same
|
|
5434
|
+
* `name` would otherwise silently share a single bundle cache entry.
|
|
5435
|
+
* @param resolvers - Loaded resolvers keyed by source file
|
|
5436
|
+
* @param namespace - The namespace the resolvers belong to
|
|
5437
|
+
*/
|
|
5438
|
+
function assertUniqueResolverNames(resolvers, namespace) {
|
|
5439
|
+
const seenNames = /* @__PURE__ */ new Map();
|
|
5440
|
+
for (const [file, resolver] of Object.entries(resolvers)) {
|
|
5441
|
+
const relativePath = path.relative(process.cwd(), file);
|
|
5442
|
+
const existing = seenNames.get(resolver.name);
|
|
5443
|
+
if (existing) throw new Error(`Duplicate resolver name "${resolver.name}" found in namespace "${namespace}":\n - ${existing}\n - ${relativePath}\nEach resolver must have a unique name within a namespace.`);
|
|
5444
|
+
seenNames.set(resolver.name, relativePath);
|
|
5445
|
+
}
|
|
5446
|
+
}
|
|
5374
5447
|
|
|
5375
5448
|
//#endregion
|
|
5376
5449
|
//#region src/cli/services/workflow/source-transformer.ts
|
|
@@ -5937,6 +6010,12 @@ function resolveInlineSourcemap(configValue) {
|
|
|
5937
6010
|
return true;
|
|
5938
6011
|
}
|
|
5939
6012
|
|
|
6013
|
+
//#endregion
|
|
6014
|
+
//#region src/cli/shared/resolver-bundle-key.ts
|
|
6015
|
+
function resolverBundleKey(namespace, resolverName) {
|
|
6016
|
+
return `${namespace}:${resolverName}`;
|
|
6017
|
+
}
|
|
6018
|
+
|
|
5940
6019
|
//#endregion
|
|
5941
6020
|
//#region src/parser/service/aigateway/schema.ts
|
|
5942
6021
|
const NAME_PATTERN = /^[a-z0-9][a-z0-9-]{1,28}[a-z0-9]$/;
|
|
@@ -6424,7 +6503,7 @@ async function loadApplication(params) {
|
|
|
6424
6503
|
};
|
|
6425
6504
|
for (const pipeline of resolverResult.resolverServices) {
|
|
6426
6505
|
const resolverBundles = await bundleResolvers(pipeline.namespace, pipeline.config, triggerContext, bundleCache, inlineSourcemap, bundleLogLevel);
|
|
6427
|
-
for (const [name, code] of resolverBundles) bundledScripts.resolvers.set(name, code);
|
|
6506
|
+
for (const [name, code] of resolverBundles) bundledScripts.resolvers.set(resolverBundleKey(pipeline.namespace, name), code);
|
|
6428
6507
|
}
|
|
6429
6508
|
if (executorService) bundledScripts.executors = await bundleExecutors({
|
|
6430
6509
|
config: executorService.config,
|
|
@@ -6491,5 +6570,5 @@ async function loadApplication(params) {
|
|
|
6491
6570
|
}
|
|
6492
6571
|
|
|
6493
6572
|
//#endregion
|
|
6494
|
-
export {
|
|
6495
|
-
//# sourceMappingURL=application-
|
|
6573
|
+
export { getOrNull as $, hasUserTokenEntry as A, resolveUserTokenKey as B, getDistDir as C, deleteUserTokens as D, loadConfig as E, loadPlatformClientConfig as F, fetchAll as G, writePlatformConfig as H, loadStoredUserTokens as I, fetchPaged as J, fetchAllTolerant as K, loadWorkspaceId as L, loadConfigPath as M, loadConsoleBaseUrl as N, fetchLatestToken as O, loadMachineUserName as P, getOAuth2ClientId as Q, platformConfigFromProfile as R, createBundleCache as S, hashFile as T, closeConnectionPool as U, saveUserTokens as V, defaultPlatformBaseUrl as W, fetchUserInfo as X, fetchPlatformMachineUserToken as Y, getConsoleBaseUrl as Z, composeFunctionTreeshakeOptions as _, resolveInlineSourcemap as a, byName as at, getPluginGenerationDependencies as b, HTTP_METHODS as c, buildResolverOperationHookExpr as d, getPlatformBaseUrl as et, assertUniqueLocalTailorDBTypeNames as f, platformBundleDefinePlugin as g, stringifyFunction as h, resolverBundleKey as i, resolveStaticWebsiteUrls as it, loadAccessToken as j, hasAnyUserTokenEntry as k, INVOKER_EXPR as l, TailorDBTypeSchema as m, generatePluginFilesIfNeeded as n, initOperatorClient as nt, WorkflowJobSchema as o, assertUniqueTailorDBTypeNamesWithExternal as p, fetchMachineUserToken as q, loadApplication as r, isDefaultPlatform as rt, ResolverSchema as s, defineApplication as t, initOAuth2Client as tt, buildExecutorArgsExpr as u, createLogLevelTreeshakeOptions as v, hashContent as w, hasGenerationHooks as x, resolveBundleLogLevel as y, readPlatformConfig as z };
|
|
6574
|
+
//# sourceMappingURL=application-BsH6tkZC.mjs.map
|