@tailor-platform/sdk 1.56.1 → 1.58.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/README.md +0 -23
- package/dist/{application-DuT_ae02.mjs → application-B59TaTk_.mjs} +10 -6
- package/dist/application-B59TaTk_.mjs.map +1 -0
- package/dist/application-gO_pa5BO.mjs +4 -0
- package/dist/cli/erd-viewer-assets/app.js +1181 -0
- package/dist/cli/erd-viewer-assets/index.html +73 -0
- package/dist/cli/erd-viewer-assets/serve.json +13 -0
- package/dist/cli/erd-viewer-assets/styles.css +789 -0
- package/dist/cli/index.mjs +847 -355
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +587 -3
- package/dist/cli/lib.mjs +3 -3
- package/dist/{client-DLPEPJ_s.mjs → client-62B-r3MN.mjs} +39 -10
- package/dist/client-62B-r3MN.mjs.map +1 -0
- package/dist/{client-DrzwCD1W.mjs → client-BWl3f1XS.mjs} +1 -1
- package/dist/configure/index.d.mts +2 -2
- package/dist/{crashreport-Bm2mN5tg.mjs → crashreport-CCGpLUlP.mjs} +2 -2
- package/dist/{crashreport-Bm2mN5tg.mjs.map → crashreport-CCGpLUlP.mjs.map} +1 -1
- package/dist/{crashreport-C5oHvHUC.mjs → crashreport-CXD_Kjk-.mjs} +1 -1
- package/dist/{index-B61gFI9a.d.mts → index-BWoHfE-i.d.mts} +3 -2
- package/dist/{runtime-745lvg7i.mjs → runtime-BC-FbQkg.mjs} +179 -190
- package/dist/runtime-BC-FbQkg.mjs.map +1 -0
- package/dist/utils/test/index.d.mts +2 -2
- package/dist/{workflow.generated-Kz-nQrTf.d.mts → workflow.generated-CV77NlFp.d.mts} +3 -2
- package/docs/cli/application.md +5 -5
- package/docs/cli/auth.md +55 -6
- package/docs/cli/function.md +2 -2
- package/docs/cli/staticwebsite.md +137 -0
- package/docs/cli/tailordb.md +31 -26
- package/docs/cli-reference.md +19 -16
- package/docs/generator/builtin.md +1 -1
- package/docs/services/auth.md +0 -11
- package/docs/services/staticwebsite.md +13 -0
- package/package.json +4 -6
- package/dist/application-CC3oaSay.mjs +0 -4
- package/dist/application-DuT_ae02.mjs.map +0 -1
- package/dist/client-DLPEPJ_s.mjs.map +0 -1
- package/dist/runtime-745lvg7i.mjs.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
import { t as db } from "./schema-DKsNhbav.mjs";
|
|
3
|
-
import { $ as
|
|
3
|
+
import { $ as Condition_Operator, A as IdPPermissionPermit, B as AuthOAuth2Client_ClientType, C as TailorDBType_Permission_Operator, D as PipelineResolver_OperationType, F as ExecutorTriggerType, G as AuthSCIMConfig_AuthorizationType, H as AuthSCIMAttribute_Mutability, I as AuthConnection_Type, J as UserProfileProviderConfig_UserProfileProviderType, L as AuthHookPoint, N as ExecutorJobStatus, O as IdPLang, P as ExecutorTargetType, Q as ConditionSchema, R as AuthIDPConfig_AuthType, S as TailorDBGQLPermission_Permit, T as TailorDBType_PermitAction, U as AuthSCIMAttribute_Type, V as AuthOAuth2Client_GrantType, W as AuthSCIMAttribute_Uniqueness, X as ApplicationSchemaUpdateAttemptStatus, Y as GetApplicationSchemaHealthResponse_ApplicationSchemaHealthStatus, Z as Subgraph_ServiceType, _ as WorkspacePlatformUserRole, a as fetchMachineUserToken, b as TailorDBGQLPermission_Action, d as initOperatorClient, et as FilterSchema, g as OperatorService, h as userAgent, i as fetchAll, j as FunctionExecution_Status, k as IdPPermissionOperator, m as resolveStaticWebsiteUrls, o as fetchPaged, p as platformBaseUrl, q as TenantProviderConfig_TenantProviderType, tt as PageDirection, v as WorkflowExecution_Status, w as TailorDBType_Permission_Permit, x as TailorDBGQLPermission_Operator, y as WorkflowJobExecution_Status, z as AuthInvokerSchema } from "./client-62B-r3MN.mjs";
|
|
4
4
|
import { a as parseBoolean, i as symbols, n as logger, r as styles, t as CIPromptError } from "./logger-DpJyJvNz.mjs";
|
|
5
|
-
import { D as
|
|
5
|
+
import { C as loadConfig, D as loadConfigPath, E as loadAccessToken, M as writePlatformConfig, O as loadWorkspaceId, S as hashFile, b as getDistDir, c as createExecutorService, d as buildExecutorArgsExpr, f as buildResolverOperationHookExpr, h as loadFilesWithIgnores, k as readPlatformConfig, m as stringifyFunction, n as generatePluginFilesIfNeeded, p as TailorDBTypeSchema, r as loadApplication, s as HTTP_METHODS, t as defineApplication, y as createBundleCache } from "./application-B59TaTk_.mjs";
|
|
6
6
|
import { t as multiline } from "./multiline-Cf9ODpr1.mjs";
|
|
7
7
|
import { t as readPackageJson } from "./package-json-DcQApfPQ.mjs";
|
|
8
8
|
import { n as isCLIError, t as createCLIError } from "./errors-EsY4XO6O.mjs";
|
|
@@ -636,7 +636,7 @@ const inspectCommand = defineAppCommand({
|
|
|
636
636
|
const listCommand$10 = defineAppCommand({
|
|
637
637
|
name: "list",
|
|
638
638
|
description: "List all invocable OperatorService methods.",
|
|
639
|
-
notes: "Only
|
|
639
|
+
notes: "Only single-request (non-streaming) methods are listed, because the CLI issues a single JSON request and reads one JSON response.",
|
|
640
640
|
args: z.object({}).strict(),
|
|
641
641
|
run: () => {
|
|
642
642
|
const names = listMethodNames();
|
|
@@ -793,7 +793,7 @@ const apiCommand = defineAppCommand({
|
|
|
793
793
|
description: "Call Tailor Platform API endpoints directly.",
|
|
794
794
|
notes: `Use \`tailor-sdk api list\` to enumerate invocable methods and \`tailor-sdk api inspect <endpoint>\` to print an endpoint's input message tree (combine with \`--json\` for machine-readable output).
|
|
795
795
|
|
|
796
|
-
The request body is inferred from the
|
|
796
|
+
The request body is inferred from the target endpoint's request schema, and commonly required fields are auto-injected so they can be omitted from \`--body\`:
|
|
797
797
|
|
|
798
798
|
- \`workspaceId\` — resolved from \`-w\` / \`TAILOR_PLATFORM_WORKSPACE_ID\` / the selected profile.
|
|
799
799
|
- \`namespaceName\` — resolved from \`tailor.config.ts\` based on the endpoint's service:
|
|
@@ -802,7 +802,7 @@ The request body is inferred from the proto definition of the target endpoint, a
|
|
|
802
802
|
|
|
803
803
|
Values already present in \`--body\` are never overridden. If a value cannot be resolved (e.g. no config found), injection is silently skipped and the server-side validation error takes precedence.
|
|
804
804
|
|
|
805
|
-
Use \`--field key=value\` (repeatable) to set request body fields without writing JSON. Dotted keys (e.g. \`application.name=foo\`) build nested objects. \`--field\` overrides matching fields in \`--body\` and tab-completes from the endpoint's
|
|
805
|
+
Use \`--field key=value\` (repeatable) to set request body fields without writing JSON. Dotted keys (e.g. \`application.name=foo\`) build nested objects. \`--field\` overrides matching fields in \`--body\` and tab-completes from the endpoint's request schema.`,
|
|
806
806
|
examples: [
|
|
807
807
|
{
|
|
808
808
|
cmd: "GetApplication -b '{\"applicationName\":\"app-1\"}'",
|
|
@@ -1735,6 +1735,16 @@ function areNormalizedEqual(left, right) {
|
|
|
1735
1735
|
function trnPrefix(workspaceId) {
|
|
1736
1736
|
return `trn:v1:workspace:${workspaceId}`;
|
|
1737
1737
|
}
|
|
1738
|
+
/**
|
|
1739
|
+
* Build the TRN for a workspace resource.
|
|
1740
|
+
* @param workspaceId - Workspace ID
|
|
1741
|
+
* @param kind - Resource kind segment
|
|
1742
|
+
* @param name - Resource name
|
|
1743
|
+
* @returns Fully-qualified TRN string
|
|
1744
|
+
*/
|
|
1745
|
+
function resourceTrn(workspaceId, kind, name) {
|
|
1746
|
+
return `${trnPrefix(workspaceId)}:${kind}:${name}`;
|
|
1747
|
+
}
|
|
1738
1748
|
const sdkNameLabelKey = "sdk-name";
|
|
1739
1749
|
const sdkVersionLabelKey = "sdk-version";
|
|
1740
1750
|
const sdkAppIdLabelKey = "sdk-app-id";
|
|
@@ -1817,9 +1827,6 @@ async function applyApplication(client, changeSet, phase = "create-update") {
|
|
|
1817
1827
|
await client.deleteApplication(del.request);
|
|
1818
1828
|
}));
|
|
1819
1829
|
}
|
|
1820
|
-
function trn$6(workspaceId, name) {
|
|
1821
|
-
return `trn:v1:workspace:${workspaceId}:application:${name}`;
|
|
1822
|
-
}
|
|
1823
1830
|
function sortStrings(values) {
|
|
1824
1831
|
return [...values ?? []].sort();
|
|
1825
1832
|
}
|
|
@@ -1944,7 +1951,7 @@ async function planApplication(context, httpAdapterBuildResult) {
|
|
|
1944
1951
|
if (idpConfigs.length > 0) authIdpConfigName = idpConfigs[0].name;
|
|
1945
1952
|
}
|
|
1946
1953
|
const metaRequest = await buildMetaRequest({
|
|
1947
|
-
trn:
|
|
1954
|
+
trn: resourceTrn(workspaceId, "application", application.name),
|
|
1948
1955
|
appName: application.name,
|
|
1949
1956
|
appId: application.id
|
|
1950
1957
|
});
|
|
@@ -2003,7 +2010,7 @@ async function planApplication(context, httpAdapterBuildResult) {
|
|
|
2003
2010
|
}
|
|
2004
2011
|
async function fetchAppLabels(client, workspaceId, appName) {
|
|
2005
2012
|
try {
|
|
2006
|
-
const { metadata } = await client.getMetadata({ trn:
|
|
2013
|
+
const { metadata } = await client.getMetadata({ trn: resourceTrn(workspaceId, "application", appName) });
|
|
2007
2014
|
return metadata?.labels;
|
|
2008
2015
|
} catch (error) {
|
|
2009
2016
|
if (error instanceof ConnectError && error.code === Code.NotFound) return;
|
|
@@ -2133,9 +2140,6 @@ function hashValue(value) {
|
|
|
2133
2140
|
|
|
2134
2141
|
//#endregion
|
|
2135
2142
|
//#region src/cli/commands/deploy/auth-connection.ts
|
|
2136
|
-
function connectionTrn(workspaceId, name) {
|
|
2137
|
-
return `${trnPrefix(workspaceId)}:auth-connection:${name}`;
|
|
2138
|
-
}
|
|
2139
2143
|
function buildConnectionRequest(workspaceId, name, config) {
|
|
2140
2144
|
return {
|
|
2141
2145
|
workspaceId,
|
|
@@ -2156,11 +2160,6 @@ function buildConnectionRequest(workspaceId, name, config) {
|
|
|
2156
2160
|
}
|
|
2157
2161
|
};
|
|
2158
2162
|
}
|
|
2159
|
-
/**
|
|
2160
|
-
* Compute a hash of the full connection config for change detection.
|
|
2161
|
-
* @param config - Auth connection config
|
|
2162
|
-
* @returns SHA-256 hex digest
|
|
2163
|
-
*/
|
|
2164
2163
|
function hashConnectionConfig(config) {
|
|
2165
2164
|
return hashValue(JSON.stringify({
|
|
2166
2165
|
type: config.type,
|
|
@@ -2172,12 +2171,6 @@ function hashConnectionConfig(config) {
|
|
|
2172
2171
|
tokenUrl: config.tokenUrl ?? ""
|
|
2173
2172
|
}));
|
|
2174
2173
|
}
|
|
2175
|
-
/**
|
|
2176
|
-
* Check whether the non-secret fields of an existing connection differ from the desired config.
|
|
2177
|
-
* @param existing - Existing connection from the server
|
|
2178
|
-
* @param desired - Desired connection config
|
|
2179
|
-
* @returns true if any non-secret field has changed
|
|
2180
|
-
*/
|
|
2181
2174
|
function hasNonSecretFieldChanged(existing, desired) {
|
|
2182
2175
|
if (existing.config.case !== "oauth2") return true;
|
|
2183
2176
|
const oauth2 = existing.config.value;
|
|
@@ -2213,56 +2206,47 @@ async function planAuthConnections(client, workspaceId, appName, appId, auths) {
|
|
|
2213
2206
|
}
|
|
2214
2207
|
});
|
|
2215
2208
|
const existingConnections = {};
|
|
2216
|
-
let metadataSupported = true;
|
|
2217
2209
|
await Promise.all(existingList.map(async (resource) => {
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
};
|
|
2225
|
-
} catch (error) {
|
|
2226
|
-
if (error instanceof ConnectError && error.code === Code.InvalidArgument) {
|
|
2227
|
-
metadataSupported = false;
|
|
2228
|
-
existingConnections[resource.name] = {
|
|
2229
|
-
resource,
|
|
2230
|
-
label: void 0
|
|
2231
|
-
};
|
|
2232
|
-
} else throw error;
|
|
2233
|
-
}
|
|
2210
|
+
const { metadata } = await client.getMetadata({ trn: resourceTrn(workspaceId, "auth_connection", resource.name) });
|
|
2211
|
+
existingConnections[resource.name] = {
|
|
2212
|
+
resource,
|
|
2213
|
+
label: metadata?.labels[sdkNameLabelKey],
|
|
2214
|
+
allLabels: metadata?.labels
|
|
2215
|
+
};
|
|
2234
2216
|
}));
|
|
2235
2217
|
const state = loadSecretsState();
|
|
2236
2218
|
for (const [name, config] of Object.entries(desiredConnections)) {
|
|
2237
2219
|
const existing = existingConnections[name];
|
|
2238
|
-
const metaRequest =
|
|
2239
|
-
trn:
|
|
2220
|
+
const metaRequest = await buildMetaRequest({
|
|
2221
|
+
trn: resourceTrn(workspaceId, "auth_connection", name),
|
|
2240
2222
|
appName,
|
|
2241
2223
|
appId
|
|
2242
|
-
})
|
|
2224
|
+
});
|
|
2243
2225
|
if (existing) {
|
|
2244
|
-
if (!isOwnedByApp(existing.allLabels, appName, appId)) {
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
});
|
|
2254
|
-
}
|
|
2226
|
+
if (!isOwnedByApp(existing.allLabels, appName, appId)) if (existing.label) conflicts.push({
|
|
2227
|
+
resourceType: "Auth connection",
|
|
2228
|
+
resourceName: name,
|
|
2229
|
+
currentOwner: existing.label
|
|
2230
|
+
});
|
|
2231
|
+
else unmanaged.push({
|
|
2232
|
+
resourceType: "Auth connection",
|
|
2233
|
+
resourceName: name
|
|
2234
|
+
});
|
|
2255
2235
|
const currentHash = hashConnectionConfig(config);
|
|
2256
2236
|
const storedHash = state.connections?.[name];
|
|
2257
2237
|
if (hasNonSecretFieldChanged(existing.resource, config) || currentHash !== storedHash) changeSet.replaces.push({
|
|
2258
2238
|
name,
|
|
2259
|
-
|
|
2239
|
+
deleteRequest: {
|
|
2260
2240
|
workspaceId,
|
|
2261
2241
|
connectionName: name
|
|
2262
2242
|
},
|
|
2263
2243
|
createRequest: buildConnectionRequest(workspaceId, name, config),
|
|
2264
2244
|
metaRequest
|
|
2265
2245
|
});
|
|
2246
|
+
else if (!existing.label) changeSet.updates.push({
|
|
2247
|
+
name,
|
|
2248
|
+
metaRequest
|
|
2249
|
+
});
|
|
2266
2250
|
else changeSet.unchanged.push({ name });
|
|
2267
2251
|
delete existingConnections[name];
|
|
2268
2252
|
} else changeSet.creates.push({
|
|
@@ -2278,7 +2262,7 @@ async function planAuthConnections(client, workspaceId, appName, appId, auths) {
|
|
|
2278
2262
|
resourceOwners.add(entry.label);
|
|
2279
2263
|
continue;
|
|
2280
2264
|
}
|
|
2281
|
-
if (owned
|
|
2265
|
+
if (owned) changeSet.deletes.push({
|
|
2282
2266
|
name,
|
|
2283
2267
|
request: {
|
|
2284
2268
|
workspaceId,
|
|
@@ -2293,20 +2277,6 @@ async function planAuthConnections(client, workspaceId, appName, appId, auths) {
|
|
|
2293
2277
|
resourceOwners
|
|
2294
2278
|
};
|
|
2295
2279
|
}
|
|
2296
|
-
/**
|
|
2297
|
-
* Attempt to set metadata, silently ignoring InvalidArgument errors
|
|
2298
|
-
* when the platform does not yet support auth-connection TRNs.
|
|
2299
|
-
* @param client - Operator client instance
|
|
2300
|
-
* @param metaRequest - Metadata request to send
|
|
2301
|
-
*/
|
|
2302
|
-
async function trySetMetadata(client, metaRequest) {
|
|
2303
|
-
try {
|
|
2304
|
-
await client.setMetadata(metaRequest);
|
|
2305
|
-
} catch (error) {
|
|
2306
|
-
if (error instanceof ConnectError && error.code === Code.InvalidArgument) return;
|
|
2307
|
-
throw error;
|
|
2308
|
-
}
|
|
2309
|
-
}
|
|
2310
2280
|
function extractOAuth2Config(connection) {
|
|
2311
2281
|
if (!connection) return void 0;
|
|
2312
2282
|
const config = connection.config;
|
|
@@ -2333,13 +2303,16 @@ async function applyAuthConnections(client, result, phase) {
|
|
|
2333
2303
|
if (phase === "create-update") {
|
|
2334
2304
|
await Promise.all(changeSet.creates.map(async (create) => {
|
|
2335
2305
|
await client.createAuthConnection(create.request);
|
|
2336
|
-
|
|
2306
|
+
await client.setMetadata(create.metaRequest);
|
|
2337
2307
|
}));
|
|
2338
2308
|
for (const replace of changeSet.replaces) {
|
|
2339
|
-
await client.
|
|
2309
|
+
await client.deleteAuthConnection(replace.deleteRequest);
|
|
2340
2310
|
await client.createAuthConnection(replace.createRequest);
|
|
2341
|
-
|
|
2311
|
+
await client.setMetadata(replace.metaRequest);
|
|
2342
2312
|
}
|
|
2313
|
+
await Promise.all(changeSet.updates.map(async (update) => {
|
|
2314
|
+
await client.setMetadata(update.metaRequest);
|
|
2315
|
+
}));
|
|
2343
2316
|
const state = loadSecretsState();
|
|
2344
2317
|
if (!state.connections) state.connections = {};
|
|
2345
2318
|
for (const create of changeSet.creates) {
|
|
@@ -2353,7 +2326,7 @@ async function applyAuthConnections(client, result, phase) {
|
|
|
2353
2326
|
saveSecretsState(state);
|
|
2354
2327
|
} else if (phase === "delete-resources" || phase === "delete") {
|
|
2355
2328
|
await Promise.all(changeSet.deletes.map(async (del) => {
|
|
2356
|
-
await client.
|
|
2329
|
+
await client.deleteAuthConnection(del.request);
|
|
2357
2330
|
}));
|
|
2358
2331
|
if (changeSet.deletes.length > 0) {
|
|
2359
2332
|
const state = loadSecretsState();
|
|
@@ -2376,9 +2349,6 @@ const CHUNK_SIZE = 64 * 1024;
|
|
|
2376
2349
|
function computeContentHash(content) {
|
|
2377
2350
|
return crypto$1.createHash("sha256").update(content, "utf-8").digest("hex");
|
|
2378
2351
|
}
|
|
2379
|
-
function functionRegistryTrn$1(workspaceId, name) {
|
|
2380
|
-
return `trn:v1:workspace:${workspaceId}:function_registry:${name}`;
|
|
2381
|
-
}
|
|
2382
2352
|
const RESOLVER_PREFIX = "resolver--";
|
|
2383
2353
|
const EXECUTOR_PREFIX = "executor--";
|
|
2384
2354
|
const WORKFLOW_PREFIX = "workflow--";
|
|
@@ -2570,7 +2540,7 @@ async function planFunctionRegistry(client, workspaceId, appName, appId, entries
|
|
|
2570
2540
|
});
|
|
2571
2541
|
const existingMap = {};
|
|
2572
2542
|
await Promise.all(existingFunctions.map(async (func) => {
|
|
2573
|
-
const { metadata } = await client.getMetadata({ trn:
|
|
2543
|
+
const { metadata } = await client.getMetadata({ trn: resourceTrn(workspaceId, "function_registry", func.name) });
|
|
2574
2544
|
existingMap[func.name] = {
|
|
2575
2545
|
resource: func,
|
|
2576
2546
|
label: metadata?.labels[sdkNameLabelKey],
|
|
@@ -2580,7 +2550,7 @@ async function planFunctionRegistry(client, workspaceId, appName, appId, entries
|
|
|
2580
2550
|
for (const entry of entries) {
|
|
2581
2551
|
const existing = existingMap[entry.name];
|
|
2582
2552
|
const metaRequest = await buildMetaRequest({
|
|
2583
|
-
trn:
|
|
2553
|
+
trn: resourceTrn(workspaceId, "function_registry", entry.name),
|
|
2584
2554
|
appName,
|
|
2585
2555
|
appId
|
|
2586
2556
|
});
|
|
@@ -3135,9 +3105,6 @@ async function planIdP(context) {
|
|
|
3135
3105
|
resourceOwners
|
|
3136
3106
|
};
|
|
3137
3107
|
}
|
|
3138
|
-
function trn$5(workspaceId, name) {
|
|
3139
|
-
return `trn:v1:workspace:${workspaceId}:idp:${name}`;
|
|
3140
|
-
}
|
|
3141
3108
|
function normalizeComparableUserAuthPolicy(policy) {
|
|
3142
3109
|
return {
|
|
3143
3110
|
useNonEmailIdentifier: policy?.useNonEmailIdentifier ?? false,
|
|
@@ -3232,7 +3199,7 @@ async function planServices$3(client, workspaceId, appName, appId, idps, idpUser
|
|
|
3232
3199
|
const existingServices = {};
|
|
3233
3200
|
await Promise.all(withoutLabel.map(async (resource) => {
|
|
3234
3201
|
if (!resource.namespace?.name) return;
|
|
3235
|
-
const { metadata } = await client.getMetadata({ trn:
|
|
3202
|
+
const { metadata } = await client.getMetadata({ trn: resourceTrn(workspaceId, "idp", resource.namespace.name) });
|
|
3236
3203
|
existingServices[resource.namespace.name] = {
|
|
3237
3204
|
resource,
|
|
3238
3205
|
label: metadata?.labels[sdkNameLabelKey],
|
|
@@ -3243,7 +3210,7 @@ async function planServices$3(client, workspaceId, appName, appId, idps, idpUser
|
|
|
3243
3210
|
const namespaceName = idp.name;
|
|
3244
3211
|
const existing = existingServices[namespaceName];
|
|
3245
3212
|
const metaRequest = await buildMetaRequest({
|
|
3246
|
-
trn:
|
|
3213
|
+
trn: resourceTrn(workspaceId, "idp", namespaceName),
|
|
3247
3214
|
appName,
|
|
3248
3215
|
appId
|
|
3249
3216
|
});
|
|
@@ -3602,9 +3569,6 @@ async function planAuth(context) {
|
|
|
3602
3569
|
resourceOwners: new Set([...resourceOwners, ...connectionResult.resourceOwners])
|
|
3603
3570
|
};
|
|
3604
3571
|
}
|
|
3605
|
-
function trn$4(workspaceId, name) {
|
|
3606
|
-
return `trn:v1:workspace:${workspaceId}:auth:${name}`;
|
|
3607
|
-
}
|
|
3608
3572
|
async function planServices$2(client, workspaceId, appName, appId, auths, forceApplyAll = false) {
|
|
3609
3573
|
const changeSet = createChangeSet("Auth services");
|
|
3610
3574
|
const conflicts = [];
|
|
@@ -3626,7 +3590,7 @@ async function planServices$2(client, workspaceId, appName, appId, auths, forceA
|
|
|
3626
3590
|
const existingServices = {};
|
|
3627
3591
|
await Promise.all(withoutLabel.map(async (resource) => {
|
|
3628
3592
|
if (!resource.namespace?.name) return;
|
|
3629
|
-
const { metadata } = await client.getMetadata({ trn:
|
|
3593
|
+
const { metadata } = await client.getMetadata({ trn: resourceTrn(workspaceId, "auth", resource.namespace.name) });
|
|
3630
3594
|
existingServices[resource.namespace.name] = {
|
|
3631
3595
|
resource,
|
|
3632
3596
|
label: metadata?.labels[sdkNameLabelKey],
|
|
@@ -3637,7 +3601,7 @@ async function planServices$2(client, workspaceId, appName, appId, auths, forceA
|
|
|
3637
3601
|
const { config } = auth;
|
|
3638
3602
|
const existing = existingServices[config.name];
|
|
3639
3603
|
const metaRequest = await buildMetaRequest({
|
|
3640
|
-
trn:
|
|
3604
|
+
trn: resourceTrn(workspaceId, "auth", config.name),
|
|
3641
3605
|
appName,
|
|
3642
3606
|
appId
|
|
3643
3607
|
});
|
|
@@ -4965,9 +4929,6 @@ async function applyExecutor(client, result, phase = "create-update") {
|
|
|
4965
4929
|
})]);
|
|
4966
4930
|
else if (phase === "delete") await Promise.all(changeSet.deletes.map((del) => client.deleteExecutorExecutor(del.request)));
|
|
4967
4931
|
}
|
|
4968
|
-
function trn$3(workspaceId, name) {
|
|
4969
|
-
return `trn:v1:workspace:${workspaceId}:executor:${name}`;
|
|
4970
|
-
}
|
|
4971
4932
|
/**
|
|
4972
4933
|
* Plan executor-related changes based on current and desired state.
|
|
4973
4934
|
* @param context - Planning context
|
|
@@ -4991,13 +4952,13 @@ async function planExecutor(context) {
|
|
|
4991
4952
|
return [executors, nextPageToken];
|
|
4992
4953
|
},
|
|
4993
4954
|
getName: (resource) => resource.name,
|
|
4994
|
-
getTrn:
|
|
4955
|
+
getTrn: (workspaceId, name) => resourceTrn(workspaceId, "executor", name)
|
|
4995
4956
|
});
|
|
4996
4957
|
const executors = forRemoval ? {} : await application.executorService?.loadExecutors() ?? {};
|
|
4997
4958
|
for (const executor of Object.values(executors)) {
|
|
4998
4959
|
const existing = existingExecutors[executor.name];
|
|
4999
4960
|
const metaRequest = await buildMetaRequest({
|
|
5000
|
-
trn:
|
|
4961
|
+
trn: resourceTrn(workspaceId, "executor", executor.name),
|
|
5001
4962
|
appName: application.name,
|
|
5002
4963
|
appId: application.id
|
|
5003
4964
|
});
|
|
@@ -5411,9 +5372,6 @@ async function planPipeline(context) {
|
|
|
5411
5372
|
resourceOwners
|
|
5412
5373
|
};
|
|
5413
5374
|
}
|
|
5414
|
-
function trn$2(workspaceId, name) {
|
|
5415
|
-
return `trn:v1:workspace:${workspaceId}:pipeline:${name}`;
|
|
5416
|
-
}
|
|
5417
5375
|
async function planServices$1(client, workspaceId, appName, appId, pipelines) {
|
|
5418
5376
|
const changeSet = createChangeSet("Pipeline services");
|
|
5419
5377
|
const conflicts = [];
|
|
@@ -5435,7 +5393,7 @@ async function planServices$1(client, workspaceId, appName, appId, pipelines) {
|
|
|
5435
5393
|
const existingServices = {};
|
|
5436
5394
|
await Promise.all(withoutLabel.map(async (resource) => {
|
|
5437
5395
|
if (!resource.namespace?.name) return;
|
|
5438
|
-
const { metadata } = await client.getMetadata({ trn:
|
|
5396
|
+
const { metadata } = await client.getMetadata({ trn: resourceTrn(workspaceId, "pipeline", resource.namespace.name) });
|
|
5439
5397
|
existingServices[resource.namespace.name] = {
|
|
5440
5398
|
resource,
|
|
5441
5399
|
label: metadata?.labels[sdkNameLabelKey],
|
|
@@ -5445,7 +5403,7 @@ async function planServices$1(client, workspaceId, appName, appId, pipelines) {
|
|
|
5445
5403
|
for (const pipeline of pipelines) {
|
|
5446
5404
|
const existing = existingServices[pipeline.namespace];
|
|
5447
5405
|
const metaRequest = await buildMetaRequest({
|
|
5448
|
-
trn:
|
|
5406
|
+
trn: resourceTrn(workspaceId, "pipeline", pipeline.namespace),
|
|
5449
5407
|
appName,
|
|
5450
5408
|
appId
|
|
5451
5409
|
});
|
|
@@ -5733,7 +5691,7 @@ async function planSecretManager(context) {
|
|
|
5733
5691
|
});
|
|
5734
5692
|
const existingVaults = {};
|
|
5735
5693
|
await Promise.all(existingVaultList.map(async (resource) => {
|
|
5736
|
-
const { metadata } = await client.getMetadata({ trn:
|
|
5694
|
+
const { metadata } = await client.getMetadata({ trn: resourceTrn(workspaceId, "vault", resource.name) });
|
|
5737
5695
|
existingVaults[resource.name] = {
|
|
5738
5696
|
resource,
|
|
5739
5697
|
label: metadata?.labels[sdkNameLabelKey],
|
|
@@ -5747,7 +5705,7 @@ async function planSecretManager(context) {
|
|
|
5747
5705
|
const existing = existingVaults[vaultName];
|
|
5748
5706
|
if (existing) {
|
|
5749
5707
|
const metaRequest = await buildMetaRequest({
|
|
5750
|
-
trn:
|
|
5708
|
+
trn: resourceTrn(workspaceId, "vault", vaultName),
|
|
5751
5709
|
appName: application.name,
|
|
5752
5710
|
appId: application.id
|
|
5753
5711
|
});
|
|
@@ -5860,9 +5818,6 @@ async function planSecretManager(context) {
|
|
|
5860
5818
|
resourceOwners
|
|
5861
5819
|
};
|
|
5862
5820
|
}
|
|
5863
|
-
function vaultTrn$1(workspaceId, name) {
|
|
5864
|
-
return `trn:v1:workspace:${workspaceId}:vault:${name}`;
|
|
5865
|
-
}
|
|
5866
5821
|
/**
|
|
5867
5822
|
* Apply secret manager changes for the given phase.
|
|
5868
5823
|
* @param client - Operator client instance
|
|
@@ -5881,7 +5836,7 @@ async function applySecretManager(client, result, phase = "create-update", appli
|
|
|
5881
5836
|
});
|
|
5882
5837
|
if (application) {
|
|
5883
5838
|
const metaRequest = await buildMetaRequest({
|
|
5884
|
-
trn:
|
|
5839
|
+
trn: resourceTrn(create.workspaceId, "vault", create.name),
|
|
5885
5840
|
appName: application.name,
|
|
5886
5841
|
appId: application.id
|
|
5887
5842
|
});
|
|
@@ -5890,7 +5845,7 @@ async function applySecretManager(client, result, phase = "create-update", appli
|
|
|
5890
5845
|
}));
|
|
5891
5846
|
if (application) await Promise.all(vaultChangeSet.updates.map(async (update) => {
|
|
5892
5847
|
const metaRequest = await buildMetaRequest({
|
|
5893
|
-
trn:
|
|
5848
|
+
trn: resourceTrn(update.workspaceId, "vault", update.name),
|
|
5894
5849
|
appName: application.name,
|
|
5895
5850
|
appId: application.id
|
|
5896
5851
|
});
|
|
@@ -5948,18 +5903,23 @@ async function applySecretManager(client, result, phase = "create-update", appli
|
|
|
5948
5903
|
* @returns Promise that resolves when static websites are applied
|
|
5949
5904
|
*/
|
|
5950
5905
|
async function applyStaticWebsite(client, result, phase = "create-update") {
|
|
5951
|
-
const { changeSet } = result;
|
|
5952
|
-
if (phase === "create-update")
|
|
5953
|
-
await
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
|
|
5906
|
+
const { changeSet, customDomainChangeSet } = result;
|
|
5907
|
+
if (phase === "create-update") {
|
|
5908
|
+
await Promise.all([...changeSet.creates.map(async (create) => {
|
|
5909
|
+
await client.createStaticWebsite(create.request);
|
|
5910
|
+
await client.setMetadata(create.metaRequest);
|
|
5911
|
+
}), ...changeSet.updates.map(async (update) => {
|
|
5912
|
+
await client.updateStaticWebsite(update.request);
|
|
5913
|
+
await client.setMetadata(update.metaRequest);
|
|
5914
|
+
})]);
|
|
5915
|
+
await Promise.all([...customDomainChangeSet.creates.map(async (add) => {
|
|
5916
|
+
await client.addCustomDomain(add.request);
|
|
5917
|
+
await client.setMetadata(add.metaRequest);
|
|
5918
|
+
}), ...customDomainChangeSet.deletes.map((del) => client.removeCustomDomain(del.request))]);
|
|
5919
|
+
} else if (phase === "delete") await Promise.all(changeSet.deletes.map((del) => client.deleteStaticWebsite(del.request)));
|
|
5960
5920
|
}
|
|
5961
|
-
function
|
|
5962
|
-
return `trn:v1:workspace:${workspaceId}:staticwebsite:${
|
|
5921
|
+
function customDomainTrn(workspaceId, websiteName, domain) {
|
|
5922
|
+
return `trn:v1:workspace:${workspaceId}:staticwebsite:${websiteName}:custom_domain:${domain}`;
|
|
5963
5923
|
}
|
|
5964
5924
|
function normalizeComparableStaticWebsiteShape(input) {
|
|
5965
5925
|
return {
|
|
@@ -5984,6 +5944,7 @@ function areStaticWebsitesEqual(existing, desired) {
|
|
|
5984
5944
|
async function planStaticWebsite(context) {
|
|
5985
5945
|
const { client, workspaceId, application, forRemoval } = context;
|
|
5986
5946
|
const changeSet = createChangeSet("StaticWebsites");
|
|
5947
|
+
const customDomainChangeSet = createChangeSet("CustomDomains");
|
|
5987
5948
|
const conflicts = [];
|
|
5988
5949
|
const unmanaged = [];
|
|
5989
5950
|
const resourceOwners = /* @__PURE__ */ new Set();
|
|
@@ -5999,15 +5960,16 @@ async function planStaticWebsite(context) {
|
|
|
5999
5960
|
return [staticwebsites, nextPageToken];
|
|
6000
5961
|
},
|
|
6001
5962
|
getName: (resource) => resource.name,
|
|
6002
|
-
getTrn:
|
|
5963
|
+
getTrn: (workspaceId, name) => resourceTrn(workspaceId, "staticwebsite", name)
|
|
6003
5964
|
});
|
|
5965
|
+
const ownedWebsiteNames = /* @__PURE__ */ new Set();
|
|
6004
5966
|
const staticWebsiteServices = forRemoval ? [] : application.staticWebsiteServices;
|
|
6005
5967
|
for (const websiteService of staticWebsiteServices) {
|
|
6006
5968
|
const config = websiteService;
|
|
6007
5969
|
const name = websiteService.name;
|
|
6008
5970
|
const existing = existingWebsites[name];
|
|
6009
5971
|
const metaRequest = await buildMetaRequest({
|
|
6010
|
-
trn:
|
|
5972
|
+
trn: resourceTrn(workspaceId, "staticwebsite", name),
|
|
6011
5973
|
appName: application.name,
|
|
6012
5974
|
appId: application.id
|
|
6013
5975
|
});
|
|
@@ -6021,7 +5983,7 @@ async function planStaticWebsite(context) {
|
|
|
6021
5983
|
}
|
|
6022
5984
|
};
|
|
6023
5985
|
if (existing) {
|
|
6024
|
-
|
|
5986
|
+
const owned = trackDesiredResourceOwnership({
|
|
6025
5987
|
labels: existing.allLabels,
|
|
6026
5988
|
ownerLabel: existing.label,
|
|
6027
5989
|
appName: application.name,
|
|
@@ -6030,18 +5992,23 @@ async function planStaticWebsite(context) {
|
|
|
6030
5992
|
resourceName: name,
|
|
6031
5993
|
conflicts,
|
|
6032
5994
|
unmanaged
|
|
6033
|
-
})
|
|
5995
|
+
});
|
|
5996
|
+
if (owned && hasMatchingSdkVersion(existing.allLabels, metaRequest.labels) && areStaticWebsitesEqual(existing.resource, desired)) changeSet.unchanged.push({ name });
|
|
6034
5997
|
else changeSet.updates.push({
|
|
6035
5998
|
name,
|
|
6036
5999
|
request,
|
|
6037
6000
|
metaRequest
|
|
6038
6001
|
});
|
|
6002
|
+
if (owned) ownedWebsiteNames.add(name);
|
|
6039
6003
|
delete existingWebsites[name];
|
|
6040
|
-
} else
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6004
|
+
} else {
|
|
6005
|
+
changeSet.creates.push({
|
|
6006
|
+
name,
|
|
6007
|
+
request,
|
|
6008
|
+
metaRequest
|
|
6009
|
+
});
|
|
6010
|
+
ownedWebsiteNames.add(name);
|
|
6011
|
+
}
|
|
6045
6012
|
}
|
|
6046
6013
|
Object.entries(existingWebsites).forEach(([name]) => {
|
|
6047
6014
|
const entry = existingWebsites[name];
|
|
@@ -6060,8 +6027,63 @@ async function planStaticWebsite(context) {
|
|
|
6060
6027
|
}
|
|
6061
6028
|
});
|
|
6062
6029
|
});
|
|
6030
|
+
const desiredDomainsByWebsite = /* @__PURE__ */ new Map();
|
|
6031
|
+
for (const service of staticWebsiteServices) if (service.customDomains !== void 0 && ownedWebsiteNames.has(service.name)) desiredDomainsByWebsite.set(service.name, service.customDomains);
|
|
6032
|
+
const existingDomainsByWebsite = /* @__PURE__ */ new Map();
|
|
6033
|
+
const websitesToFetchDomains = [...ownedWebsiteNames].filter((name) => !changeSet.creates.some((c) => c.name === name));
|
|
6034
|
+
await Promise.all(websitesToFetchDomains.map(async (name) => {
|
|
6035
|
+
try {
|
|
6036
|
+
const { customDomains } = await client.listCustomDomains({
|
|
6037
|
+
workspaceId,
|
|
6038
|
+
staticWebsiteName: name
|
|
6039
|
+
});
|
|
6040
|
+
const domainsWithLabels = await Promise.all(customDomains.map(async (d) => {
|
|
6041
|
+
const { metadata } = await client.getMetadata({ trn: customDomainTrn(workspaceId, name, d.domain) });
|
|
6042
|
+
return {
|
|
6043
|
+
domain: d.domain,
|
|
6044
|
+
allLabels: metadata?.labels
|
|
6045
|
+
};
|
|
6046
|
+
}));
|
|
6047
|
+
existingDomainsByWebsite.set(name, domainsWithLabels);
|
|
6048
|
+
} catch (error) {
|
|
6049
|
+
if (error instanceof ConnectError && error.code === Code.NotFound) return;
|
|
6050
|
+
throw error;
|
|
6051
|
+
}
|
|
6052
|
+
}));
|
|
6053
|
+
for (const name of ownedWebsiteNames) {
|
|
6054
|
+
const desired = new Set(desiredDomainsByWebsite.get(name) ?? []);
|
|
6055
|
+
const existingDomains = existingDomainsByWebsite.get(name) ?? [];
|
|
6056
|
+
const existingSet = new Set(existingDomains.map((d) => d.domain));
|
|
6057
|
+
const sdkOwnedDomains = new Set(existingDomains.filter((d) => isOwnedByApp(d.allLabels, application.name, application.id)).map((d) => d.domain));
|
|
6058
|
+
for (const domain of desired) if (!existingSet.has(domain)) {
|
|
6059
|
+
const metaRequest = await buildMetaRequest({
|
|
6060
|
+
trn: customDomainTrn(workspaceId, name, domain),
|
|
6061
|
+
appName: application.name,
|
|
6062
|
+
appId: application.id
|
|
6063
|
+
});
|
|
6064
|
+
customDomainChangeSet.creates.push({
|
|
6065
|
+
name: domain,
|
|
6066
|
+
request: {
|
|
6067
|
+
workspaceId,
|
|
6068
|
+
staticWebsiteName: name,
|
|
6069
|
+
domain
|
|
6070
|
+
},
|
|
6071
|
+
metaRequest
|
|
6072
|
+
});
|
|
6073
|
+
} else customDomainChangeSet.unchanged.push({ name: domain });
|
|
6074
|
+
if (desiredDomainsByWebsite.has(name)) {
|
|
6075
|
+
for (const domain of sdkOwnedDomains) if (!desired.has(domain)) customDomainChangeSet.deletes.push({
|
|
6076
|
+
name: domain,
|
|
6077
|
+
request: {
|
|
6078
|
+
workspaceId,
|
|
6079
|
+
domain
|
|
6080
|
+
}
|
|
6081
|
+
});
|
|
6082
|
+
}
|
|
6083
|
+
}
|
|
6063
6084
|
return {
|
|
6064
6085
|
changeSet,
|
|
6086
|
+
customDomainChangeSet,
|
|
6065
6087
|
conflicts,
|
|
6066
6088
|
unmanaged,
|
|
6067
6089
|
resourceOwners
|
|
@@ -7983,7 +8005,7 @@ function spinner(options) {
|
|
|
7983
8005
|
*/
|
|
7984
8006
|
async function getCurrentMigrationNumber(client, workspaceId, namespace) {
|
|
7985
8007
|
try {
|
|
7986
|
-
const trn =
|
|
8008
|
+
const trn = resourceTrn(workspaceId, "tailordb", namespace);
|
|
7987
8009
|
const { metadata } = await client.getMetadata({ trn });
|
|
7988
8010
|
const label = metadata?.labels[MIGRATION_LABEL_KEY];
|
|
7989
8011
|
if (!label) return 0;
|
|
@@ -8064,7 +8086,7 @@ async function executeSingleMigration(options, migration) {
|
|
|
8064
8086
|
* @returns {Promise<void>}
|
|
8065
8087
|
*/
|
|
8066
8088
|
async function updateMigrationLabel(client, workspaceId, namespace, migrationNumber) {
|
|
8067
|
-
const trn =
|
|
8089
|
+
const trn = resourceTrn(workspaceId, "tailordb", namespace);
|
|
8068
8090
|
const { metadata } = await client.getMetadata({ trn });
|
|
8069
8091
|
const existingLabels = metadata?.labels ?? {};
|
|
8070
8092
|
const newLabel = `m${formatMigrationNumber(migrationNumber)}`;
|
|
@@ -8179,7 +8201,7 @@ async function fetchRemoteTypes(client, workspaceId, namespace) {
|
|
|
8179
8201
|
*/
|
|
8180
8202
|
async function getRemoteMigrationNumber(client, workspaceId, namespace) {
|
|
8181
8203
|
try {
|
|
8182
|
-
const trn =
|
|
8204
|
+
const trn = resourceTrn(workspaceId, "tailordb", namespace);
|
|
8183
8205
|
const { metadata } = await client.getMetadata({ trn });
|
|
8184
8206
|
const label = metadata?.labels?.["sdk-migration"];
|
|
8185
8207
|
if (!label) return null;
|
|
@@ -8733,9 +8755,6 @@ function formatTailorDBResourceChangeEntries(typeChangeSet, gqlPermissionChangeS
|
|
|
8733
8755
|
...collectTailorDBDisplayEntries("replace", typeChangeSet.replaces, gqlPermissionChangeSet.replaces)
|
|
8734
8756
|
];
|
|
8735
8757
|
}
|
|
8736
|
-
function trn(workspaceId, name) {
|
|
8737
|
-
return `${trnPrefix(workspaceId)}:tailordb:${name}`;
|
|
8738
|
-
}
|
|
8739
8758
|
function normalizeComparableTailorDBService(service) {
|
|
8740
8759
|
return normalizeProtoConfig({
|
|
8741
8760
|
namespace: service.namespace,
|
|
@@ -8772,7 +8791,7 @@ async function planServices(client, workspaceId, appName, appId, tailordbs) {
|
|
|
8772
8791
|
const existingServices = {};
|
|
8773
8792
|
await Promise.all(withoutLabel.map(async (resource) => {
|
|
8774
8793
|
if (!resource.namespace?.name) return;
|
|
8775
|
-
const { metadata } = await client.getMetadata({ trn:
|
|
8794
|
+
const { metadata } = await client.getMetadata({ trn: resourceTrn(workspaceId, "tailordb", resource.namespace.name) });
|
|
8776
8795
|
existingServices[resource.namespace.name] = {
|
|
8777
8796
|
resource,
|
|
8778
8797
|
label: metadata?.labels[sdkNameLabelKey],
|
|
@@ -8782,7 +8801,7 @@ async function planServices(client, workspaceId, appName, appId, tailordbs) {
|
|
|
8782
8801
|
for (const tailordb of tailordbs) {
|
|
8783
8802
|
const existing = existingServices[tailordb.namespace];
|
|
8784
8803
|
const metaRequest = await buildMetaRequest({
|
|
8785
|
-
trn:
|
|
8804
|
+
trn: resourceTrn(workspaceId, "tailordb", tailordb.namespace),
|
|
8786
8805
|
appName,
|
|
8787
8806
|
appId,
|
|
8788
8807
|
existingLabels: existing?.allLabels
|
|
@@ -9549,7 +9568,7 @@ async function registerJobFunctions(client, changeSet, appName, appId, unchanged
|
|
|
9549
9568
|
scriptRef: workflowJobFunctionName(jobName)
|
|
9550
9569
|
});
|
|
9551
9570
|
await client.setMetadata(await buildMetaRequest({
|
|
9552
|
-
trn:
|
|
9571
|
+
trn: resourceTrn(workspaceId, "workflow_job_function", jobName),
|
|
9553
9572
|
appName,
|
|
9554
9573
|
appId
|
|
9555
9574
|
}));
|
|
@@ -9562,9 +9581,9 @@ async function registerJobFunctions(client, changeSet, appName, appId, unchanged
|
|
|
9562
9581
|
}
|
|
9563
9582
|
const unusedJobFunctions = existingJobFunctions.filter((jobName) => !allUsedJobNames.has(jobName));
|
|
9564
9583
|
await Promise.all(unusedJobFunctions.map(async (jobName) => {
|
|
9565
|
-
const { metadata } = await client.getMetadata({ trn:
|
|
9584
|
+
const { metadata } = await client.getMetadata({ trn: resourceTrn(workspaceId, "workflow_job_function", jobName) });
|
|
9566
9585
|
if (isOwnedByApp(metadata?.labels, appName, appId)) await client.setMetadata({
|
|
9567
|
-
trn:
|
|
9586
|
+
trn: resourceTrn(workspaceId, "workflow_job_function", jobName),
|
|
9568
9587
|
labels: { [sdkNameLabelKey]: "" }
|
|
9569
9588
|
});
|
|
9570
9589
|
}));
|
|
@@ -9590,12 +9609,6 @@ function toRetryPolicy(policy) {
|
|
|
9590
9609
|
function toConcurrencyPolicy(policy) {
|
|
9591
9610
|
return { maxConcurrentExecutions: policy.maxConcurrentExecutions };
|
|
9592
9611
|
}
|
|
9593
|
-
function workflowTrn$1(workspaceId, name) {
|
|
9594
|
-
return `trn:v1:workspace:${workspaceId}:workflow:${name}`;
|
|
9595
|
-
}
|
|
9596
|
-
function jobFunctionTrn(workspaceId, name) {
|
|
9597
|
-
return `trn:v1:workspace:${workspaceId}:workflow_job_function:${name}`;
|
|
9598
|
-
}
|
|
9599
9612
|
/**
|
|
9600
9613
|
* Plan workflow changes and job functions based on current and desired state.
|
|
9601
9614
|
* @param client - Operator client instance
|
|
@@ -9625,12 +9638,12 @@ async function planWorkflow(client, workspaceId, appName, appId, workflows, main
|
|
|
9625
9638
|
return [response.workflows, response.nextPageToken];
|
|
9626
9639
|
},
|
|
9627
9640
|
getName: (resource) => resource.name,
|
|
9628
|
-
getTrn:
|
|
9641
|
+
getTrn: (workspaceId, name) => resourceTrn(workspaceId, "workflow", name)
|
|
9629
9642
|
});
|
|
9630
9643
|
for (const workflow of Object.values(workflows)) {
|
|
9631
9644
|
const existing = existingWorkflows[workflow.name];
|
|
9632
9645
|
const metaRequest = await buildMetaRequest({
|
|
9633
|
-
trn:
|
|
9646
|
+
trn: resourceTrn(workspaceId, "workflow", workflow.name),
|
|
9634
9647
|
appName,
|
|
9635
9648
|
appId
|
|
9636
9649
|
});
|
|
@@ -9759,36 +9772,6 @@ function normalizeRetryPolicyForCompare(policy) {
|
|
|
9759
9772
|
|
|
9760
9773
|
//#endregion
|
|
9761
9774
|
//#region src/cli/commands/deploy/deploy.ts
|
|
9762
|
-
function applicationTrn(workspaceId, name) {
|
|
9763
|
-
return `trn:v1:workspace:${workspaceId}:application:${name}`;
|
|
9764
|
-
}
|
|
9765
|
-
function functionRegistryTrn(workspaceId, name) {
|
|
9766
|
-
return `trn:v1:workspace:${workspaceId}:function_registry:${name}`;
|
|
9767
|
-
}
|
|
9768
|
-
function pipelineTrn(workspaceId, name) {
|
|
9769
|
-
return `trn:v1:workspace:${workspaceId}:pipeline:${name}`;
|
|
9770
|
-
}
|
|
9771
|
-
function idpTrn(workspaceId, name) {
|
|
9772
|
-
return `trn:v1:workspace:${workspaceId}:idp:${name}`;
|
|
9773
|
-
}
|
|
9774
|
-
function authTrn(workspaceId, name) {
|
|
9775
|
-
return `trn:v1:workspace:${workspaceId}:auth:${name}`;
|
|
9776
|
-
}
|
|
9777
|
-
function executorTrn(workspaceId, name) {
|
|
9778
|
-
return `trn:v1:workspace:${workspaceId}:executor:${name}`;
|
|
9779
|
-
}
|
|
9780
|
-
function workflowTrn(workspaceId, name) {
|
|
9781
|
-
return `trn:v1:workspace:${workspaceId}:workflow:${name}`;
|
|
9782
|
-
}
|
|
9783
|
-
function staticWebsiteTrn(workspaceId, name) {
|
|
9784
|
-
return `trn:v1:workspace:${workspaceId}:staticwebsite:${name}`;
|
|
9785
|
-
}
|
|
9786
|
-
function tailorDBTrn(workspaceId, name) {
|
|
9787
|
-
return `trn:v1:workspace:${workspaceId}:tailordb:${name}`;
|
|
9788
|
-
}
|
|
9789
|
-
function vaultTrn(workspaceId, name) {
|
|
9790
|
-
return `trn:v1:workspace:${workspaceId}:vault:${name}`;
|
|
9791
|
-
}
|
|
9792
9775
|
/**
|
|
9793
9776
|
* Resolve the set of IdP names that have at least one executor subscribed to
|
|
9794
9777
|
* their user events. When an executor's idpUser trigger omits the `idp` option
|
|
@@ -9810,36 +9793,36 @@ function collectIdpUserTriggerTargets(application) {
|
|
|
9810
9793
|
}
|
|
9811
9794
|
async function shouldForceApplyAll(client, workspaceId, application, functionEntries) {
|
|
9812
9795
|
const desiredLabels = (await buildMetaRequest({
|
|
9813
|
-
trn:
|
|
9796
|
+
trn: resourceTrn(workspaceId, "application", application.name),
|
|
9814
9797
|
appName: application.name,
|
|
9815
9798
|
appId: application.id
|
|
9816
9799
|
})).labels;
|
|
9817
9800
|
const candidateTrns = /* @__PURE__ */ new Set();
|
|
9818
|
-
if (application.subgraphs.length > 0) candidateTrns.add(
|
|
9801
|
+
if (application.subgraphs.length > 0) candidateTrns.add(resourceTrn(workspaceId, "application", application.name));
|
|
9819
9802
|
application.staticWebsiteServices.forEach((website) => {
|
|
9820
|
-
candidateTrns.add(
|
|
9803
|
+
candidateTrns.add(resourceTrn(workspaceId, "staticwebsite", website.name));
|
|
9821
9804
|
});
|
|
9822
9805
|
application.resolverServices.forEach((pipeline) => {
|
|
9823
|
-
candidateTrns.add(
|
|
9806
|
+
candidateTrns.add(resourceTrn(workspaceId, "pipeline", pipeline.namespace));
|
|
9824
9807
|
});
|
|
9825
9808
|
application.idpServices.forEach((idp) => {
|
|
9826
|
-
candidateTrns.add(
|
|
9809
|
+
candidateTrns.add(resourceTrn(workspaceId, "idp", idp.name));
|
|
9827
9810
|
});
|
|
9828
|
-
if (application.authService) candidateTrns.add(
|
|
9811
|
+
if (application.authService) candidateTrns.add(resourceTrn(workspaceId, "auth", application.authService.config.name));
|
|
9829
9812
|
Object.values(application.executorService?.executors ?? {}).forEach((executor) => {
|
|
9830
|
-
candidateTrns.add(
|
|
9813
|
+
candidateTrns.add(resourceTrn(workspaceId, "executor", executor.name));
|
|
9831
9814
|
});
|
|
9832
9815
|
Object.values(application.workflowService?.workflows ?? {}).forEach((workflow) => {
|
|
9833
|
-
candidateTrns.add(
|
|
9816
|
+
candidateTrns.add(resourceTrn(workspaceId, "workflow", workflow.name));
|
|
9834
9817
|
});
|
|
9835
9818
|
application.tailorDBServices.forEach((service) => {
|
|
9836
|
-
candidateTrns.add(
|
|
9819
|
+
candidateTrns.add(resourceTrn(workspaceId, "tailordb", service.namespace));
|
|
9837
9820
|
});
|
|
9838
9821
|
application.secrets.forEach((vault) => {
|
|
9839
|
-
candidateTrns.add(
|
|
9822
|
+
candidateTrns.add(resourceTrn(workspaceId, "vault", vault.vaultName));
|
|
9840
9823
|
});
|
|
9841
9824
|
functionEntries.forEach((entry) => {
|
|
9842
|
-
candidateTrns.add(
|
|
9825
|
+
candidateTrns.add(resourceTrn(workspaceId, "function_registry", entry.name));
|
|
9843
9826
|
});
|
|
9844
9827
|
for (const trn of candidateTrns) try {
|
|
9845
9828
|
const { metadata } = await client.getMetadata({ trn });
|
|
@@ -9896,6 +9879,7 @@ function printPlanResults(results) {
|
|
|
9896
9879
|
const idpServiceActions = extractServiceActions(results.idp.changeSet.service);
|
|
9897
9880
|
const authServiceActions = extractServiceActions(results.auth.changeSet.service);
|
|
9898
9881
|
results.staticWebsite.changeSet.print();
|
|
9882
|
+
results.staticWebsite.customDomainChangeSet.print();
|
|
9899
9883
|
results.app.print();
|
|
9900
9884
|
printGroupedDisplaySection("TailorDB", tailorDBEntries, tailorDBServiceActions);
|
|
9901
9885
|
printGroupedDisplaySection("Resolver", pipelineEntries, pipelineServiceActions);
|
|
@@ -9945,6 +9929,7 @@ function summarizePlanResults(results, displayEntries, serviceActions) {
|
|
|
9945
9929
|
const nonGrouped = summarizeChangeSets([
|
|
9946
9930
|
otherChanges,
|
|
9947
9931
|
results.staticWebsite.changeSet,
|
|
9932
|
+
results.staticWebsite.customDomainChangeSet,
|
|
9948
9933
|
results.app,
|
|
9949
9934
|
results.secretManager.vaultChangeSet,
|
|
9950
9935
|
results.secretManager.secretChangeSet
|
|
@@ -10121,6 +10106,10 @@ async function deploy(options) {
|
|
|
10121
10106
|
resourceType: "OAuth2 client (client type change)",
|
|
10122
10107
|
resourceName: replace.name
|
|
10123
10108
|
});
|
|
10109
|
+
for (const del of auth.changeSet.connection.deletes) importantDeletions.push({
|
|
10110
|
+
resourceType: "Auth connection",
|
|
10111
|
+
resourceName: del.name
|
|
10112
|
+
});
|
|
10124
10113
|
for (const del of secretManager.vaultChangeSet.deletes) importantDeletions.push({
|
|
10125
10114
|
resourceType: "Secret Manager vault",
|
|
10126
10115
|
resourceName: del.name
|
|
@@ -14515,7 +14504,7 @@ async function generate(options) {
|
|
|
14515
14504
|
if (options.init) await handleInitOption(namespacesWithMigrations, options.yes);
|
|
14516
14505
|
let pluginManager;
|
|
14517
14506
|
if (plugins.length > 0) pluginManager = new PluginManager(plugins);
|
|
14518
|
-
const { defineApplication } = await import("./application-
|
|
14507
|
+
const { defineApplication } = await import("./application-gO_pa5BO.mjs");
|
|
14519
14508
|
const application = defineApplication({
|
|
14520
14509
|
config,
|
|
14521
14510
|
pluginManager
|
|
@@ -16707,5 +16696,5 @@ function isDeno() {
|
|
|
16707
16696
|
}
|
|
16708
16697
|
|
|
16709
16698
|
//#endregion
|
|
16710
|
-
export { listCommand$5 as $, compareSnapshots as $t, truncate as A,
|
|
16711
|
-
//# sourceMappingURL=runtime-
|
|
16699
|
+
export { listCommand$5 as $, compareSnapshots as $t, truncate as A, toPageDirection as An, startCommand as At, logBetaWarning as B, getExecutor as Bt, listCommand$2 as C, commonArgs as Cn, triggerExecutor as Ct, resumeWorkflow as D, isVerbose as Dn, jobsCommand as Dt, resumeCommand as E, deploymentArgs as En, getExecutorJob as Et, writeDbTypesFile as F, getWorkflowExecution as Ft, organizationTree as G, parseMigrationLabelNumber as Gt, removeCommand$1 as H, executeScript as Ht, getConfiguredEditorCommand as I, listWorkflowExecutions as It, listOrganizations as J, DIFF_FILE_NAME as Jt, treeCommand as K, bundleMigrationScript as Kt, openInConfiguredEditor as L, functionExecutionStatusToString as Lt, generate as M, getCommand$5 as Mt, generateCommand as N, getWorkflow as Nt, listCommand$3 as O, pagedLogArgs as On, listExecutorJobs as Ot, generateMigrationScript as P, executionsCommand as Pt, updateFolder as Q, compareLocalTypesWithSnapshot as Qt, show as R, formatKeyValueTable as Rt, listApps as S, defineAppCommand as Sn, triggerCommand as St, healthCommand as T, confirmationArgs as Tn, listExecutors as Tt, updateCommand$1 as U, waitForExecution$1 as Ut, remove as V, deploy as Vt, updateOrganization as W, MIGRATION_LABEL_KEY as Wt, getOrganization as X, MIGRATE_FILE_NAME as Xt, getCommand$1 as Y, INITIAL_SCHEMA_NUMBER as Yt, updateCommand$2 as Z, SCHEMA_FILE_NAME as Zt, getWorkspace as _, generateUserTypes as _n, listFunctionRegistries as _t, updateUser as a, getNextMigrationNumber as an, createCommand$1 as at, createCommand as b, apiCall as bn, listWebhookExecutors as bt, listCommand as c, reconstructSnapshotFromMigrations as cn, listOAuth2Clients as ct, inviteUser as d, formatMigrationDiff as dn, getMachineUserToken as dt, createSnapshotFromLocalTypes as en, listFolders as et, restoreCommand as f, hasChanges as fn, tokenCommand as ft, getCommand as g, PluginManager as gn, listCommand$8 as gt, listWorkspaces as h, sdkNameLabelKey as hn, generate$1 as ht, updateCommand as i, getMigrationFiles as in, deleteFolder as it, truncateCommand as j, workspaceArgs as jn, startWorkflow as jt, listWorkflows as k, paginationArgs as kn, watchExecutorJob as kt, listUsers as l, formatMigrationNumber as ln, getCommand$3 as lt, listCommand$1 as m, resourceTrn as mn, listMachineUsers as mt, query as n, getMigrationDirPath as nn, getFolder as nt, removeCommand as o, isValidMigrationNumber as on, createFolder as ot, restoreWorkspace as p, getNamespacesWithMigrations as pn, listCommand$7 as pt, listCommand$4 as q, DB_TYPES_FILE_NAME as qt, queryCommand as r, getMigrationFilePath as rn, deleteCommand$1 as rt, removeUser as s, loadDiff as sn, listCommand$6 as st, isNativeTypeScriptRuntime as t, getLatestMigrationNumber as tn, getCommand$2 as tt, inviteCommand as u, formatDiffSummary as un, getOAuth2Client as ut, deleteCommand as v, prompt as vn, getCommand$4 as vt, getAppHealth as w, configArg as wn, listCommand$9 as wt, createWorkspace as x, assertWritable as xn, webhookCommand as xt, deleteWorkspace as y, apiCommand as yn, getFunctionRegistry as yt, showCommand as z, getCommand$6 as zt };
|
|
16700
|
+
//# sourceMappingURL=runtime-BC-FbQkg.mjs.map
|