@tailor-platform/sdk 1.19.0 → 1.21.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 +44 -0
- package/dist/{application-A6PZjujv.mjs → application-CEv5c7TU.mjs} +97929 -97634
- package/dist/application-CEv5c7TU.mjs.map +1 -0
- package/dist/{application-nPS5veK6.mjs → application-DiCzM9b0.mjs} +3 -3
- package/dist/cli/index.mjs +118 -63
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +117 -58
- package/dist/cli/lib.mjs +7 -7
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/skills.mjs +1 -1
- package/dist/cli/skills.mjs.map +1 -1
- package/dist/configure/index.d.mts +4 -4
- package/dist/configure/index.mjs +5 -0
- package/dist/configure/index.mjs.map +1 -1
- package/dist/{index-B91ZpOcd.d.mts → index-BWVAwea4.d.mts} +2 -2
- package/dist/{index-ClLZCbcm.d.mts → index-CnHd6BNg.d.mts} +9 -43
- package/dist/{index-DDqKNFh4.d.mts → index-Dn61THJK.d.mts} +2 -2
- package/dist/{index-B6pvy1MK.d.mts → index-DxlmLUag.d.mts} +2 -2
- package/dist/{index-CPzbMghQ.d.mts → index-oZXVKyfX.d.mts} +2 -2
- package/dist/{package-json-DUY2kB6z.mjs → package-json-3H5gfhA4.mjs} +2 -2
- package/dist/package-json-3H5gfhA4.mjs.map +1 -0
- package/dist/package-json-DTDAqRRJ.mjs +3 -0
- package/dist/plugin/builtin/enum-constants/index.d.mts +2 -2
- package/dist/plugin/builtin/file-utils/index.d.mts +2 -2
- package/dist/plugin/builtin/kysely-type/index.d.mts +2 -2
- package/dist/plugin/builtin/seed/index.d.mts +2 -2
- package/dist/plugin/builtin/seed/index.mjs +1 -1
- package/dist/plugin/index.d.mts +1 -1
- package/dist/{seed-CeUEANfQ.mjs → seed-D-rYCN5F.mjs} +2 -2
- package/dist/{seed-CeUEANfQ.mjs.map → seed-D-rYCN5F.mjs.map} +1 -1
- package/dist/telemetry-Dhzj9Ncm.mjs +3 -0
- package/dist/{telemetry-rFq0QdvJ.mjs → telemetry-DuBhnd0X.mjs} +2 -2
- package/dist/telemetry-DuBhnd0X.mjs.map +1 -0
- package/dist/{types-CJF3Y1x8.d.mts → types-C0o90Cmb.d.mts} +87 -3
- package/dist/types-ClK_HJ0G.mjs.map +1 -1
- package/dist/{types-CblXasFV.d.mts → types-QKq1usl7.d.mts} +20 -9
- package/dist/{update-Cr5c7h1r.mjs → update-9MTRN1UA.mjs} +456 -244
- package/dist/update-9MTRN1UA.mjs.map +1 -0
- package/dist/utils/test/index.d.mts +3 -3
- package/docs/cli/application.md +2 -0
- package/docs/services/resolver.md +61 -0
- package/docs/services/tailordb.md +55 -0
- package/package.json +1 -1
- package/dist/application-A6PZjujv.mjs.map +0 -1
- package/dist/package-json-DUY2kB6z.mjs.map +0 -1
- package/dist/package-json-Dd1AnA5F.mjs +0 -3
- package/dist/telemetry-9A1BZqbl.mjs +0 -3
- package/dist/telemetry-rFq0QdvJ.mjs.map +0 -1
- package/dist/update-Cr5c7h1r.mjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as db } from "./schema-D5Cpd8fQ.mjs";
|
|
2
|
-
import { $ as
|
|
3
|
-
import { t as readPackageJson } from "./package-json-
|
|
4
|
-
import { r as withSpan } from "./telemetry-
|
|
2
|
+
import { $ as TenantProviderConfig_TenantProviderType, A as WorkflowJobExecution_Status, D as userAgent, E as resolveStaticWebsiteUrls, F as TailorDBType_Permission_Permit, G as AuthInvokerSchema, H as ExecutorTargetType, I as TailorDBType_PermitAction, J as AuthSCIMAttribute_Mutability, K as AuthOAuth2Client_ClientType, L as PipelineResolver_OperationType, M as TailorDBGQLPermission_Operator, N as TailorDBGQLPermission_Permit, O as WorkspacePlatformUserRole, P as TailorDBType_Permission_Operator, R as IdPLang, T as platformBaseUrl, U as ExecutorTriggerType, V as ExecutorJobStatus, W as AuthIDPConfig_AuthType, X as AuthSCIMAttribute_Uniqueness, Y as AuthSCIMAttribute_Type, Z as AuthSCIMConfig_AuthorizationType, _ as loadWorkspaceId, a as buildExecutorArgsExpr, at as PageDirection, b as fetchAll, c as OAuth2ClientSchema, ct as logger, d as getDistDir, et as UserProfileProviderConfig_UserProfileProviderType, f as hashFile, g as loadOrganizationId, h as loadFolderId, i as loadConfig, it as FilterSchema, j as TailorDBGQLPermission_Action, k as WorkflowExecution_Status, l as stringifyFunction, lt as styles, m as loadAccessToken, n as generatePluginFilesIfNeeded, nt as ConditionSchema, o as buildResolverOperationHookExpr, ot as ApplicationSchemaUpdateAttemptStatus, q as AuthOAuth2Client_GrantType, r as loadApplication, rt as Condition_Operator, s as createExecutorService, st as Subgraph_ServiceType, t as defineApplication, tt as GetApplicationSchemaHealthResponse_ApplicationSchemaHealthStatus, u as createBundleCache, ut as symbols, v as readPlatformConfig, w as initOperatorClient, x as fetchMachineUserToken, y as writePlatformConfig, z as FunctionExecution_Status } from "./application-CEv5c7TU.mjs";
|
|
3
|
+
import { t as readPackageJson } from "./package-json-3H5gfhA4.mjs";
|
|
4
|
+
import { r as withSpan } from "./telemetry-DuBhnd0X.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import { arg, defineCommand, runCommand } from "politty";
|
|
7
7
|
import { z } from "zod";
|
|
@@ -14,20 +14,21 @@ import { getBorderCharacters, table } from "table";
|
|
|
14
14
|
import { ValueSchema, timestampDate } from "@bufbuild/protobuf/wkt";
|
|
15
15
|
import { Code, ConnectError } from "@connectrpc/connect";
|
|
16
16
|
import { resolveTSConfig } from "pkg-types";
|
|
17
|
+
import { findUpSync } from "find-up-simple";
|
|
17
18
|
import ml from "multiline-ts";
|
|
19
|
+
import * as crypto from "node:crypto";
|
|
18
20
|
import * as inflection from "inflection";
|
|
19
21
|
import * as fs$1 from "node:fs/promises";
|
|
20
22
|
import { glob } from "node:fs/promises";
|
|
21
23
|
import * as rolldown from "rolldown";
|
|
22
24
|
import { create, fromJson, toJson } from "@bufbuild/protobuf";
|
|
23
|
-
import * as crypto from "node:crypto";
|
|
24
25
|
import ora from "ora";
|
|
25
26
|
import { setTimeout as setTimeout$1 } from "timers/promises";
|
|
26
27
|
import { spawn } from "node:child_process";
|
|
27
28
|
import { watch } from "chokidar";
|
|
28
29
|
import * as madgeModule from "madge";
|
|
29
30
|
|
|
30
|
-
//#region src/cli/
|
|
31
|
+
//#region src/cli/shared/errors.ts
|
|
31
32
|
/**
|
|
32
33
|
* Type guard to check if an error is a CLIError
|
|
33
34
|
* @param error - Error to check
|
|
@@ -38,7 +39,7 @@ function isCLIError(error) {
|
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
//#endregion
|
|
41
|
-
//#region src/cli/args.ts
|
|
42
|
+
//#region src/cli/shared/args.ts
|
|
42
43
|
const unitToMs = {
|
|
43
44
|
ms: 1,
|
|
44
45
|
s: 1e3,
|
|
@@ -161,7 +162,7 @@ const withCommonArgs = (handler) => async (args) => {
|
|
|
161
162
|
try {
|
|
162
163
|
if ("json" in args && typeof args.json === "boolean") logger.jsonMode = args.json;
|
|
163
164
|
loadEnvFiles(args["env-file"], args["env-file-if-exists"]);
|
|
164
|
-
const { initTelemetry } = await import("./telemetry-
|
|
165
|
+
const { initTelemetry } = await import("./telemetry-Dhzj9Ncm.mjs");
|
|
165
166
|
await initTelemetry();
|
|
166
167
|
await handler(args);
|
|
167
168
|
} catch (error) {
|
|
@@ -174,14 +175,14 @@ const withCommonArgs = (handler) => async (args) => {
|
|
|
174
175
|
} else logger.error(`Unknown error: ${error}`);
|
|
175
176
|
process.exit(1);
|
|
176
177
|
} finally {
|
|
177
|
-
const { shutdownTelemetry } = await import("./telemetry-
|
|
178
|
+
const { shutdownTelemetry } = await import("./telemetry-Dhzj9Ncm.mjs");
|
|
178
179
|
await shutdownTelemetry();
|
|
179
180
|
}
|
|
180
181
|
process.exit(0);
|
|
181
182
|
};
|
|
182
183
|
|
|
183
184
|
//#endregion
|
|
184
|
-
//#region src/cli/api.ts
|
|
185
|
+
//#region src/cli/commands/api.ts
|
|
185
186
|
/**
|
|
186
187
|
* Call Tailor Platform API endpoints directly.
|
|
187
188
|
* If the endpoint doesn't contain "/", it defaults to `tailor.v1.OperatorService/{endpoint}`.
|
|
@@ -241,7 +242,190 @@ const apiCommand = defineCommand({
|
|
|
241
242
|
});
|
|
242
243
|
|
|
243
244
|
//#endregion
|
|
244
|
-
//#region src/cli/
|
|
245
|
+
//#region src/cli/cache/types.ts
|
|
246
|
+
const cacheOutputFileSchema = z.object({
|
|
247
|
+
outputPath: z.string(),
|
|
248
|
+
contentHash: z.string()
|
|
249
|
+
});
|
|
250
|
+
const cacheEntrySchema = z.object({
|
|
251
|
+
kind: z.literal("bundle"),
|
|
252
|
+
inputHash: z.string(),
|
|
253
|
+
dependencyPaths: z.array(z.string()),
|
|
254
|
+
outputFiles: z.array(cacheOutputFileSchema),
|
|
255
|
+
createdAt: z.string()
|
|
256
|
+
});
|
|
257
|
+
const cacheManifestSchema = z.object({
|
|
258
|
+
version: z.literal(1),
|
|
259
|
+
sdkVersion: z.string(),
|
|
260
|
+
lockfileHash: z.string().optional(),
|
|
261
|
+
entries: z.record(z.string(), cacheEntrySchema)
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
//#endregion
|
|
265
|
+
//#region src/cli/cache/store.ts
|
|
266
|
+
const MANIFEST_FILENAME = "manifest.json";
|
|
267
|
+
const BUNDLES_DIR = "bundles";
|
|
268
|
+
/**
|
|
269
|
+
* Create a cache store for manifest persistence and bundle output storage.
|
|
270
|
+
* @param config - Cache configuration specifying the cache directory
|
|
271
|
+
* @returns A CacheStore instance
|
|
272
|
+
*/
|
|
273
|
+
function createCacheStore(config) {
|
|
274
|
+
let cachedManifest = null;
|
|
275
|
+
function manifestPath() {
|
|
276
|
+
return path.join(config.cacheDir, MANIFEST_FILENAME);
|
|
277
|
+
}
|
|
278
|
+
function bundlesDir() {
|
|
279
|
+
return path.join(config.cacheDir, BUNDLES_DIR);
|
|
280
|
+
}
|
|
281
|
+
function bundlePath(cacheKey) {
|
|
282
|
+
return path.join(bundlesDir(), `${cacheKey.replaceAll(":", "_")}.js`);
|
|
283
|
+
}
|
|
284
|
+
function loadManifest() {
|
|
285
|
+
try {
|
|
286
|
+
const raw = fs$2.readFileSync(manifestPath(), "utf-8");
|
|
287
|
+
const result = cacheManifestSchema.safeParse(JSON.parse(raw));
|
|
288
|
+
if (!result.success) {
|
|
289
|
+
cachedManifest = void 0;
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
cachedManifest = result.data;
|
|
293
|
+
return cachedManifest;
|
|
294
|
+
} catch {
|
|
295
|
+
cachedManifest = void 0;
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
function getCurrentManifest() {
|
|
300
|
+
if (cachedManifest === null) loadManifest();
|
|
301
|
+
return cachedManifest ?? void 0;
|
|
302
|
+
}
|
|
303
|
+
function ensureManifestLoaded() {
|
|
304
|
+
if (cachedManifest === null) loadManifest();
|
|
305
|
+
if (cachedManifest == null) cachedManifest = {
|
|
306
|
+
version: 1,
|
|
307
|
+
sdkVersion: "",
|
|
308
|
+
entries: {}
|
|
309
|
+
};
|
|
310
|
+
return cachedManifest;
|
|
311
|
+
}
|
|
312
|
+
function saveManifest(manifest) {
|
|
313
|
+
fs$2.mkdirSync(config.cacheDir, { recursive: true });
|
|
314
|
+
const target = manifestPath();
|
|
315
|
+
const tmpFile = path.join(config.cacheDir, `.manifest.${process.pid}.tmp`);
|
|
316
|
+
try {
|
|
317
|
+
fs$2.writeFileSync(tmpFile, JSON.stringify(manifest, null, 2), "utf-8");
|
|
318
|
+
fs$2.renameSync(tmpFile, target);
|
|
319
|
+
} catch (e) {
|
|
320
|
+
try {
|
|
321
|
+
fs$2.rmSync(tmpFile, { force: true });
|
|
322
|
+
} catch {}
|
|
323
|
+
throw e;
|
|
324
|
+
}
|
|
325
|
+
cachedManifest = manifest;
|
|
326
|
+
}
|
|
327
|
+
function getEntry(key) {
|
|
328
|
+
return ensureManifestLoaded().entries[key];
|
|
329
|
+
}
|
|
330
|
+
function setEntry(key, entry) {
|
|
331
|
+
const manifest = ensureManifestLoaded();
|
|
332
|
+
manifest.entries[key] = entry;
|
|
333
|
+
}
|
|
334
|
+
function deleteEntry(key) {
|
|
335
|
+
const manifest = ensureManifestLoaded();
|
|
336
|
+
delete manifest.entries[key];
|
|
337
|
+
}
|
|
338
|
+
function storeBundleOutput(cacheKey, sourcePath) {
|
|
339
|
+
const dir = bundlesDir();
|
|
340
|
+
fs$2.mkdirSync(dir, { recursive: true });
|
|
341
|
+
fs$2.copyFileSync(sourcePath, bundlePath(cacheKey));
|
|
342
|
+
const mapSource = `${sourcePath}.map`;
|
|
343
|
+
const cachedMapPath = `${bundlePath(cacheKey)}.map`;
|
|
344
|
+
if (fs$2.existsSync(mapSource)) fs$2.copyFileSync(mapSource, cachedMapPath);
|
|
345
|
+
else fs$2.rmSync(cachedMapPath, { force: true });
|
|
346
|
+
}
|
|
347
|
+
function restoreBundleOutput(cacheKey, targetPath) {
|
|
348
|
+
const cached = bundlePath(cacheKey);
|
|
349
|
+
const targetDir = path.dirname(targetPath);
|
|
350
|
+
fs$2.mkdirSync(targetDir, { recursive: true });
|
|
351
|
+
try {
|
|
352
|
+
fs$2.copyFileSync(cached, targetPath);
|
|
353
|
+
} catch (e) {
|
|
354
|
+
if (e.code === "ENOENT") return false;
|
|
355
|
+
throw e;
|
|
356
|
+
}
|
|
357
|
+
const cachedMap = `${cached}.map`;
|
|
358
|
+
if (fs$2.existsSync(cachedMap)) fs$2.copyFileSync(cachedMap, `${targetPath}.map`);
|
|
359
|
+
return true;
|
|
360
|
+
}
|
|
361
|
+
function clean() {
|
|
362
|
+
fs$2.rmSync(config.cacheDir, {
|
|
363
|
+
recursive: true,
|
|
364
|
+
force: true
|
|
365
|
+
});
|
|
366
|
+
cachedManifest = null;
|
|
367
|
+
}
|
|
368
|
+
return {
|
|
369
|
+
loadManifest,
|
|
370
|
+
getCurrentManifest,
|
|
371
|
+
saveManifest,
|
|
372
|
+
getEntry,
|
|
373
|
+
setEntry,
|
|
374
|
+
deleteEntry,
|
|
375
|
+
storeBundleOutput,
|
|
376
|
+
restoreBundleOutput,
|
|
377
|
+
clean
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
//#endregion
|
|
382
|
+
//#region src/cli/cache/manager.ts
|
|
383
|
+
/**
|
|
384
|
+
* Create a CacheManager that orchestrates cache operations.
|
|
385
|
+
* @param options - Configuration for the cache manager
|
|
386
|
+
* @returns A CacheManager instance
|
|
387
|
+
*/
|
|
388
|
+
function createCacheManager(options) {
|
|
389
|
+
if (!(options.enabled ?? true)) return {
|
|
390
|
+
enabled: false,
|
|
391
|
+
bundleCache: {
|
|
392
|
+
tryRestore() {
|
|
393
|
+
return false;
|
|
394
|
+
},
|
|
395
|
+
save() {}
|
|
396
|
+
},
|
|
397
|
+
finalize() {}
|
|
398
|
+
};
|
|
399
|
+
const store = createCacheStore({ cacheDir: options.cacheDir ?? path.resolve(getDistDir(), "cache") });
|
|
400
|
+
const existingManifest = store.loadManifest();
|
|
401
|
+
if (existingManifest) {
|
|
402
|
+
if (existingManifest.sdkVersion !== options.sdkVersion) {
|
|
403
|
+
logger.debug(`Cache invalidated: SDK version changed from ${existingManifest.sdkVersion} to ${options.sdkVersion}`);
|
|
404
|
+
store.clean();
|
|
405
|
+
} else if (existingManifest.lockfileHash !== options.lockfileHash) {
|
|
406
|
+
logger.debug("Cache invalidated: lockfile changed");
|
|
407
|
+
store.clean();
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
return {
|
|
411
|
+
enabled: true,
|
|
412
|
+
bundleCache: createBundleCache(store),
|
|
413
|
+
finalize() {
|
|
414
|
+
const manifest = store.getCurrentManifest() ?? {
|
|
415
|
+
version: 1,
|
|
416
|
+
sdkVersion: options.sdkVersion,
|
|
417
|
+
lockfileHash: options.lockfileHash,
|
|
418
|
+
entries: {}
|
|
419
|
+
};
|
|
420
|
+
manifest.sdkVersion = options.sdkVersion;
|
|
421
|
+
manifest.lockfileHash = options.lockfileHash;
|
|
422
|
+
store.saveManifest(manifest);
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
//#endregion
|
|
428
|
+
//#region src/cli/shared/type-generator.ts
|
|
245
429
|
/**
|
|
246
430
|
* Extract attribute definitions from the app config for user-defined typing.
|
|
247
431
|
* @param config - Application config to inspect
|
|
@@ -696,38 +880,7 @@ function copyMetadataToExtendedType(original, extended) {
|
|
|
696
880
|
}
|
|
697
881
|
|
|
698
882
|
//#endregion
|
|
699
|
-
//#region src/cli/apply/
|
|
700
|
-
/**
|
|
701
|
-
* Build TRN prefix for a workspace.
|
|
702
|
-
* @param workspaceId - Workspace ID
|
|
703
|
-
* @returns TRN prefix string
|
|
704
|
-
*/
|
|
705
|
-
function trnPrefix(workspaceId) {
|
|
706
|
-
return `trn:v1:workspace:${workspaceId}`;
|
|
707
|
-
}
|
|
708
|
-
const sdkNameLabelKey = "sdk-name";
|
|
709
|
-
/**
|
|
710
|
-
* Build metadata request with SDK labels.
|
|
711
|
-
* @param trn - Target TRN
|
|
712
|
-
* @param appName - Application name label
|
|
713
|
-
* @param existingLabels - Existing labels to preserve (optional)
|
|
714
|
-
* @returns Metadata request
|
|
715
|
-
*/
|
|
716
|
-
async function buildMetaRequest(trn$7, appName, existingLabels) {
|
|
717
|
-
const packageJson = await readPackageJson();
|
|
718
|
-
const sdkVersion = packageJson.version ? `v${packageJson.version.replace(/\./g, "-")}` : "unknown";
|
|
719
|
-
return {
|
|
720
|
-
trn: trn$7,
|
|
721
|
-
labels: {
|
|
722
|
-
...existingLabels ?? {},
|
|
723
|
-
[sdkNameLabelKey]: appName,
|
|
724
|
-
"sdk-version": sdkVersion
|
|
725
|
-
}
|
|
726
|
-
};
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
//#endregion
|
|
730
|
-
//#region src/cli/apply/services/index.ts
|
|
883
|
+
//#region src/cli/commands/apply/change-set.ts
|
|
731
884
|
/**
|
|
732
885
|
* Create a new ChangeSet for tracking resource changes.
|
|
733
886
|
* @param title - Title for the change set
|
|
@@ -758,7 +911,38 @@ function createChangeSet(title) {
|
|
|
758
911
|
}
|
|
759
912
|
|
|
760
913
|
//#endregion
|
|
761
|
-
//#region src/cli/apply/
|
|
914
|
+
//#region src/cli/commands/apply/label.ts
|
|
915
|
+
/**
|
|
916
|
+
* Build TRN prefix for a workspace.
|
|
917
|
+
* @param workspaceId - Workspace ID
|
|
918
|
+
* @returns TRN prefix string
|
|
919
|
+
*/
|
|
920
|
+
function trnPrefix(workspaceId) {
|
|
921
|
+
return `trn:v1:workspace:${workspaceId}`;
|
|
922
|
+
}
|
|
923
|
+
const sdkNameLabelKey = "sdk-name";
|
|
924
|
+
/**
|
|
925
|
+
* Build metadata request with SDK labels.
|
|
926
|
+
* @param trn - Target TRN
|
|
927
|
+
* @param appName - Application name label
|
|
928
|
+
* @param existingLabels - Existing labels to preserve (optional)
|
|
929
|
+
* @returns Metadata request
|
|
930
|
+
*/
|
|
931
|
+
async function buildMetaRequest(trn$7, appName, existingLabels) {
|
|
932
|
+
const packageJson = await readPackageJson();
|
|
933
|
+
const sdkVersion = packageJson.version ? `v${packageJson.version.replace(/\./g, "-")}` : "unknown";
|
|
934
|
+
return {
|
|
935
|
+
trn: trn$7,
|
|
936
|
+
labels: {
|
|
937
|
+
...existingLabels ?? {},
|
|
938
|
+
[sdkNameLabelKey]: appName,
|
|
939
|
+
"sdk-version": sdkVersion
|
|
940
|
+
}
|
|
941
|
+
};
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
//#endregion
|
|
945
|
+
//#region src/cli/commands/apply/application.ts
|
|
762
946
|
/**
|
|
763
947
|
* Apply application changes for the given phase.
|
|
764
948
|
* @param client - Operator client instance
|
|
@@ -895,7 +1079,7 @@ function protoSubgraph(subgraph) {
|
|
|
895
1079
|
}
|
|
896
1080
|
|
|
897
1081
|
//#endregion
|
|
898
|
-
//#region src/cli/apply/
|
|
1082
|
+
//#region src/cli/commands/apply/idp.ts
|
|
899
1083
|
/**
|
|
900
1084
|
* Build the vault name for an IdP client.
|
|
901
1085
|
* @param namespaceName - IdP namespace name
|
|
@@ -1066,7 +1250,8 @@ async function planServices$3(client, workspaceId, appName, idps) {
|
|
|
1066
1250
|
authorization,
|
|
1067
1251
|
lang,
|
|
1068
1252
|
userAuthPolicy,
|
|
1069
|
-
publishUserEvents: idp.publishUserEvents
|
|
1253
|
+
publishUserEvents: idp.publishUserEvents,
|
|
1254
|
+
disableGqlOperations: convertGqlOperationsToDisable(idp.gqlOperations)
|
|
1070
1255
|
},
|
|
1071
1256
|
metaRequest
|
|
1072
1257
|
});
|
|
@@ -1079,7 +1264,8 @@ async function planServices$3(client, workspaceId, appName, idps) {
|
|
|
1079
1264
|
authorization,
|
|
1080
1265
|
lang,
|
|
1081
1266
|
userAuthPolicy,
|
|
1082
|
-
publishUserEvents: idp.publishUserEvents
|
|
1267
|
+
publishUserEvents: idp.publishUserEvents,
|
|
1268
|
+
disableGqlOperations: convertGqlOperationsToDisable(idp.gqlOperations)
|
|
1083
1269
|
},
|
|
1084
1270
|
metaRequest
|
|
1085
1271
|
});
|
|
@@ -1179,9 +1365,19 @@ function convertLang(lang) {
|
|
|
1179
1365
|
default: return IdPLang.UNSPECIFIED;
|
|
1180
1366
|
}
|
|
1181
1367
|
}
|
|
1368
|
+
function convertGqlOperationsToDisable(gqlOperations) {
|
|
1369
|
+
if (!gqlOperations) return;
|
|
1370
|
+
return {
|
|
1371
|
+
create: gqlOperations.create === false,
|
|
1372
|
+
update: gqlOperations.update === false,
|
|
1373
|
+
delete: gqlOperations.delete === false,
|
|
1374
|
+
read: gqlOperations.read === false,
|
|
1375
|
+
sendPasswordResetEmail: gqlOperations.sendPasswordResetEmail === false
|
|
1376
|
+
};
|
|
1377
|
+
}
|
|
1182
1378
|
|
|
1183
1379
|
//#endregion
|
|
1184
|
-
//#region src/cli/apply/
|
|
1380
|
+
//#region src/cli/commands/apply/auth.ts
|
|
1185
1381
|
/**
|
|
1186
1382
|
* Apply auth-related changes for the given phase.
|
|
1187
1383
|
* @param client - Operator client instance
|
|
@@ -2072,7 +2268,7 @@ function protoSCIMAttribute(attr) {
|
|
|
2072
2268
|
}
|
|
2073
2269
|
|
|
2074
2270
|
//#endregion
|
|
2075
|
-
//#region src/cli/apply/
|
|
2271
|
+
//#region src/cli/commands/apply/confirm.ts
|
|
2076
2272
|
/**
|
|
2077
2273
|
* Confirm reassignment of resources when owner conflicts are detected.
|
|
2078
2274
|
* @param conflicts - Detected owner conflicts
|
|
@@ -2157,7 +2353,7 @@ async function confirmImportantResourceDeletion(resources, yes) {
|
|
|
2157
2353
|
}
|
|
2158
2354
|
|
|
2159
2355
|
//#endregion
|
|
2160
|
-
//#region src/cli/apply/
|
|
2356
|
+
//#region src/cli/commands/apply/function-registry.ts
|
|
2161
2357
|
const CHUNK_SIZE = 64 * 1024;
|
|
2162
2358
|
/**
|
|
2163
2359
|
* Compute SHA-256 content hash for a script string.
|
|
@@ -2399,7 +2595,7 @@ async function applyFunctionRegistry(client, workspaceId, result, phase = "creat
|
|
|
2399
2595
|
}
|
|
2400
2596
|
|
|
2401
2597
|
//#endregion
|
|
2402
|
-
//#region src/cli/apply/
|
|
2598
|
+
//#region src/cli/commands/apply/executor.ts
|
|
2403
2599
|
/**
|
|
2404
2600
|
* Apply executor-related changes for the given phase.
|
|
2405
2601
|
* @param client - Operator client instance
|
|
@@ -2658,7 +2854,7 @@ function protoExecutor(appName, executor, env) {
|
|
|
2658
2854
|
}
|
|
2659
2855
|
|
|
2660
2856
|
//#endregion
|
|
2661
|
-
//#region src/cli/apply/
|
|
2857
|
+
//#region src/cli/commands/apply/resolver.ts
|
|
2662
2858
|
const SCALAR_TYPE_MAP = {
|
|
2663
2859
|
uuid: {
|
|
2664
2860
|
kind: "ScalarType",
|
|
@@ -2844,6 +3040,7 @@ async function planResolvers(client, workspaceId, pipelines, executors, deletedS
|
|
|
2844
3040
|
};
|
|
2845
3041
|
const executorUsedResolvers = /* @__PURE__ */ new Set();
|
|
2846
3042
|
for (const executor of executors) if (executor.trigger.kind === "resolverExecuted") executorUsedResolvers.add(executor.trigger.resolverName);
|
|
3043
|
+
for (const pipeline of pipelines) for (const resolver of Object.values(pipeline.resolvers)) if (executorUsedResolvers.has(resolver.name) && resolver.publishEvents === false) throw new Error(`Resolver "${resolver.name}" has publishEvents set to false, but it is used by an executor with a resolverExecuted trigger. Either remove the publishEvents: false setting or remove the executor trigger for this resolver.`);
|
|
2847
3044
|
for (const pipeline of pipelines) {
|
|
2848
3045
|
const existingResolvers = await fetchResolvers(pipeline.namespace);
|
|
2849
3046
|
const existingNameSet = /* @__PURE__ */ new Set();
|
|
@@ -2906,15 +3103,19 @@ function processResolver(namespace, resolver, executorUsedResolvers, env) {
|
|
|
2906
3103
|
const response = protoFields({ "": resolver.output }, `${typeBaseName}Output`, false)[0];
|
|
2907
3104
|
const resolverDescription = resolver.description || `${resolver.name} resolver`;
|
|
2908
3105
|
const outputDescription = resolver.output.metadata.description;
|
|
3106
|
+
const combinedDescription = outputDescription ? `${resolverDescription}\n\nReturns:\n${outputDescription}` : resolverDescription;
|
|
3107
|
+
let publishExecutionEvents = false;
|
|
3108
|
+
if (resolver.publishEvents !== void 0) publishExecutionEvents = resolver.publishEvents;
|
|
3109
|
+
else if (executorUsedResolvers.has(resolver.name)) publishExecutionEvents = true;
|
|
2909
3110
|
return {
|
|
2910
3111
|
authorization: "true==true",
|
|
2911
|
-
description:
|
|
3112
|
+
description: combinedDescription,
|
|
2912
3113
|
inputs,
|
|
2913
3114
|
name: resolver.name,
|
|
2914
3115
|
operationType: resolver.operation,
|
|
2915
3116
|
response,
|
|
2916
3117
|
pipelines,
|
|
2917
|
-
publishExecutionEvents
|
|
3118
|
+
publishExecutionEvents
|
|
2918
3119
|
};
|
|
2919
3120
|
}
|
|
2920
3121
|
function protoFields(fields, baseName, isInput) {
|
|
@@ -2952,7 +3153,7 @@ function protoFields(fields, baseName, isInput) {
|
|
|
2952
3153
|
}
|
|
2953
3154
|
|
|
2954
3155
|
//#endregion
|
|
2955
|
-
//#region src/cli/apply/
|
|
3156
|
+
//#region src/cli/commands/apply/staticwebsite.ts
|
|
2956
3157
|
/**
|
|
2957
3158
|
* Apply static website changes for the given phase.
|
|
2958
3159
|
* @param client - Operator client instance
|
|
@@ -3069,7 +3270,7 @@ async function planStaticWebsite(context) {
|
|
|
3069
3270
|
}
|
|
3070
3271
|
|
|
3071
3272
|
//#endregion
|
|
3072
|
-
//#region src/cli/tailordb/migrate/config.ts
|
|
3273
|
+
//#region src/cli/commands/tailordb/migrate/config.ts
|
|
3073
3274
|
/**
|
|
3074
3275
|
* Migration configuration utilities
|
|
3075
3276
|
*/
|
|
@@ -3102,7 +3303,7 @@ function getNamespacesWithMigrations(config, configDir) {
|
|
|
3102
3303
|
}
|
|
3103
3304
|
|
|
3104
3305
|
//#endregion
|
|
3105
|
-
//#region src/cli/tailordb/migrate/diff-calculator.ts
|
|
3306
|
+
//#region src/cli/commands/tailordb/migrate/diff-calculator.ts
|
|
3106
3307
|
/**
|
|
3107
3308
|
* Current schema snapshot format version
|
|
3108
3309
|
*/
|
|
@@ -3260,7 +3461,7 @@ function formatDiffSummary(diff) {
|
|
|
3260
3461
|
}
|
|
3261
3462
|
|
|
3262
3463
|
//#endregion
|
|
3263
|
-
//#region src/cli/tailordb/migrate/snapshot.ts
|
|
3464
|
+
//#region src/cli/commands/tailordb/migrate/snapshot.ts
|
|
3264
3465
|
/**
|
|
3265
3466
|
* Schema snapshot management for TailorDB migrations
|
|
3266
3467
|
*/
|
|
@@ -3443,6 +3644,7 @@ function createSnapshotType(type) {
|
|
|
3443
3644
|
...ops.read !== void 0 && { read: ops.read }
|
|
3444
3645
|
};
|
|
3445
3646
|
}
|
|
3647
|
+
if (type.settings.publishEvents !== void 0) snapshotType.settings.publishEvents = type.settings.publishEvents;
|
|
3446
3648
|
}
|
|
3447
3649
|
if (type.indexes && Object.keys(type.indexes).length > 0) {
|
|
3448
3650
|
snapshotType.indexes = {};
|
|
@@ -4350,7 +4552,7 @@ function formatSchemaDrifts(drifts) {
|
|
|
4350
4552
|
}
|
|
4351
4553
|
|
|
4352
4554
|
//#endregion
|
|
4353
|
-
//#region src/cli/
|
|
4555
|
+
//#region src/cli/commands/tailordb/migrate/bundler.ts
|
|
4354
4556
|
/**
|
|
4355
4557
|
* Migration script bundler for TailorDB migrations
|
|
4356
4558
|
*
|
|
@@ -4428,7 +4630,7 @@ async function bundleMigrationScript(sourceFile, namespace, migrationNumber) {
|
|
|
4428
4630
|
}
|
|
4429
4631
|
|
|
4430
4632
|
//#endregion
|
|
4431
|
-
//#region src/cli/tailordb/migrate/types.ts
|
|
4633
|
+
//#region src/cli/commands/tailordb/migrate/types.ts
|
|
4432
4634
|
/**
|
|
4433
4635
|
* Prefix added to migration numbers in labels (required because migration names start with numbers)
|
|
4434
4636
|
*/
|
|
@@ -4450,7 +4652,7 @@ function parseMigrationLabelNumber(label) {
|
|
|
4450
4652
|
}
|
|
4451
4653
|
|
|
4452
4654
|
//#endregion
|
|
4453
|
-
//#region src/cli/
|
|
4655
|
+
//#region src/cli/shared/script-executor.ts
|
|
4454
4656
|
/**
|
|
4455
4657
|
* Script execution service for TestExecScript API
|
|
4456
4658
|
*
|
|
@@ -4525,7 +4727,7 @@ async function executeScript(options) {
|
|
|
4525
4727
|
}
|
|
4526
4728
|
|
|
4527
4729
|
//#endregion
|
|
4528
|
-
//#region src/cli/apply/
|
|
4730
|
+
//#region src/cli/commands/apply/tailordb/migration.ts
|
|
4529
4731
|
/**
|
|
4530
4732
|
* Migration execution service for TailorDB migrations
|
|
4531
4733
|
*
|
|
@@ -4703,7 +4905,7 @@ function groupMigrationsByNamespace(migrations) {
|
|
|
4703
4905
|
}
|
|
4704
4906
|
|
|
4705
4907
|
//#endregion
|
|
4706
|
-
//#region src/cli/apply/
|
|
4908
|
+
//#region src/cli/commands/apply/tailordb/index.ts
|
|
4707
4909
|
/**
|
|
4708
4910
|
* Fetch all TailorDB types from remote for a namespace
|
|
4709
4911
|
* @param {OperatorClient} client - Operator client instance
|
|
@@ -5302,6 +5504,13 @@ async function planTypes(client, workspaceId, tailordbs, executors, deletedServi
|
|
|
5302
5504
|
};
|
|
5303
5505
|
const executorUsedTypes = /* @__PURE__ */ new Set();
|
|
5304
5506
|
for (const executor of executors) if (executor.trigger.kind === "recordCreated" || executor.trigger.kind === "recordUpdated" || executor.trigger.kind === "recordDeleted") executorUsedTypes.add(executor.trigger.typeName);
|
|
5507
|
+
for (const tailordb of tailordbs) {
|
|
5508
|
+
const types = filteredTypesByNamespace?.get(tailordb.namespace) ?? tailordb.types;
|
|
5509
|
+
for (const typeName of Object.keys(types)) {
|
|
5510
|
+
const type = types[typeName];
|
|
5511
|
+
if (executorUsedTypes.has(typeName) && type.settings?.publishEvents === false) throw new Error(`Type "${typeName}" has publishEvents set to false, but it is used by an executor with a record trigger. Either remove the publishEvents: false setting or remove the executor trigger for this type.`);
|
|
5512
|
+
}
|
|
5513
|
+
}
|
|
5305
5514
|
for (const tailordb of tailordbs) {
|
|
5306
5515
|
const existingTypes = await fetchTypes(tailordb.namespace);
|
|
5307
5516
|
const existingNameSet = /* @__PURE__ */ new Set();
|
|
@@ -5369,7 +5578,8 @@ function generateTailorDBTypeManifest(type, executorUsedTypes, namespaceGqlOpera
|
|
|
5369
5578
|
pluralForm,
|
|
5370
5579
|
publishRecordEvents: false
|
|
5371
5580
|
};
|
|
5372
|
-
if (
|
|
5581
|
+
if (type.settings?.publishEvents !== void 0) defaultSettings.publishRecordEvents = type.settings.publishEvents;
|
|
5582
|
+
else if (executorUsedTypes.has(type.name)) defaultSettings.publishRecordEvents = true;
|
|
5373
5583
|
const ops = type.settings?.gqlOperations ?? namespaceGqlOperations;
|
|
5374
5584
|
if (ops) defaultSettings.disableGqlOperations = {
|
|
5375
5585
|
create: ops.create === false,
|
|
@@ -5811,7 +6021,7 @@ function formatMigrationCheckResults(results) {
|
|
|
5811
6021
|
}
|
|
5812
6022
|
|
|
5813
6023
|
//#endregion
|
|
5814
|
-
//#region src/cli/apply/
|
|
6024
|
+
//#region src/cli/commands/apply/workflow.ts
|
|
5815
6025
|
/**
|
|
5816
6026
|
* Apply workflow changes for the given phase.
|
|
5817
6027
|
* @param client - Operator client instance
|
|
@@ -6001,7 +6211,7 @@ async function planWorkflow(client, workspaceId, appName, workflows, mainJobDeps
|
|
|
6001
6211
|
}
|
|
6002
6212
|
|
|
6003
6213
|
//#endregion
|
|
6004
|
-
//#region src/cli/apply/
|
|
6214
|
+
//#region src/cli/commands/apply/apply.ts
|
|
6005
6215
|
/**
|
|
6006
6216
|
* Apply the configured application to the Tailor platform.
|
|
6007
6217
|
* @param options - Options for apply execution
|
|
@@ -6014,16 +6224,43 @@ async function apply(options) {
|
|
|
6014
6224
|
const { config: config$1, plugins } = await withSpan("build.loadConfig", () => loadConfig(options?.configPath));
|
|
6015
6225
|
const dryRun$1 = options?.dryRun ?? false;
|
|
6016
6226
|
const buildOnly$1 = options?.buildOnly ?? process.env.TAILOR_PLATFORM_SDK_BUILD_ONLY === "true";
|
|
6227
|
+
const noCache = options?.noCache ?? false;
|
|
6228
|
+
const packageJson = await readPackageJson();
|
|
6229
|
+
const cacheDir = path.resolve(getDistDir(), "cache");
|
|
6230
|
+
if (options?.cleanCache) {
|
|
6231
|
+
fs$2.rmSync(cacheDir, {
|
|
6232
|
+
recursive: true,
|
|
6233
|
+
force: true
|
|
6234
|
+
});
|
|
6235
|
+
logger.info("Bundle cache cleaned");
|
|
6236
|
+
}
|
|
6237
|
+
const configDir = path.dirname(config$1.path);
|
|
6238
|
+
const lockfilePath = findUpSync("pnpm-lock.yaml", { cwd: configDir }) ?? findUpSync("package-lock.json", { cwd: configDir }) ?? findUpSync("yarn.lock", { cwd: configDir }) ?? findUpSync("bun.lock", { cwd: configDir });
|
|
6239
|
+
const cacheManager = createCacheManager({
|
|
6240
|
+
enabled: !noCache,
|
|
6241
|
+
cacheDir,
|
|
6242
|
+
sdkVersion: packageJson.version ?? "unknown",
|
|
6243
|
+
lockfileHash: lockfilePath ? hashFile(lockfilePath) : void 0
|
|
6244
|
+
});
|
|
6017
6245
|
let pluginManager;
|
|
6018
6246
|
if (plugins.length > 0) pluginManager = new PluginManager(plugins);
|
|
6019
6247
|
await withSpan("build.generateUserTypes", () => generateUserTypes({
|
|
6020
6248
|
config: config$1,
|
|
6021
6249
|
configPath: config$1.path
|
|
6022
6250
|
}));
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6251
|
+
let application$1;
|
|
6252
|
+
let workflowBuildResult$1;
|
|
6253
|
+
try {
|
|
6254
|
+
const result = await withSpan("build.loadApplication", () => loadApplication({
|
|
6255
|
+
config: config$1,
|
|
6256
|
+
pluginManager,
|
|
6257
|
+
bundleCache: cacheManager.bundleCache
|
|
6258
|
+
}));
|
|
6259
|
+
application$1 = result.application;
|
|
6260
|
+
workflowBuildResult$1 = result.workflowBuildResult;
|
|
6261
|
+
} finally {
|
|
6262
|
+
cacheManager.finalize();
|
|
6263
|
+
}
|
|
6027
6264
|
return {
|
|
6028
6265
|
config: config$1,
|
|
6029
6266
|
plugins,
|
|
@@ -6177,33 +6414,9 @@ async function apply(options) {
|
|
|
6177
6414
|
logger.success("Successfully applied changes.");
|
|
6178
6415
|
});
|
|
6179
6416
|
}
|
|
6180
|
-
const applyCommand = defineCommand({
|
|
6181
|
-
name: "apply",
|
|
6182
|
-
description: "Apply Tailor configuration to deploy your application.",
|
|
6183
|
-
args: z.object({
|
|
6184
|
-
...commonArgs,
|
|
6185
|
-
...deploymentArgs,
|
|
6186
|
-
...confirmationArgs,
|
|
6187
|
-
"dry-run": arg(z.boolean().optional(), {
|
|
6188
|
-
alias: "d",
|
|
6189
|
-
description: "Run the command without making any changes"
|
|
6190
|
-
}),
|
|
6191
|
-
"no-schema-check": arg(z.boolean().optional(), { description: "Skip schema diff check against migration snapshots" })
|
|
6192
|
-
}),
|
|
6193
|
-
run: withCommonArgs(async (args) => {
|
|
6194
|
-
await apply({
|
|
6195
|
-
workspaceId: args["workspace-id"],
|
|
6196
|
-
profile: args.profile,
|
|
6197
|
-
configPath: args.config,
|
|
6198
|
-
dryRun: args["dry-run"],
|
|
6199
|
-
yes: args.yes,
|
|
6200
|
-
noSchemaCheck: args["no-schema-check"]
|
|
6201
|
-
});
|
|
6202
|
-
})
|
|
6203
|
-
});
|
|
6204
6417
|
|
|
6205
6418
|
//#endregion
|
|
6206
|
-
//#region src/cli/executor/status.ts
|
|
6419
|
+
//#region src/cli/commands/executor/status.ts
|
|
6207
6420
|
/**
|
|
6208
6421
|
* Colorize executor job status string.
|
|
6209
6422
|
* @param status - Executor job status string
|
|
@@ -6293,7 +6506,7 @@ function executorTriggerTypeToString(triggerType) {
|
|
|
6293
6506
|
}
|
|
6294
6507
|
|
|
6295
6508
|
//#endregion
|
|
6296
|
-
//#region src/cli/executor/transform.ts
|
|
6509
|
+
//#region src/cli/commands/executor/transform.ts
|
|
6297
6510
|
function executorJobStatusToString(status) {
|
|
6298
6511
|
switch (status) {
|
|
6299
6512
|
case ExecutorJobStatus.PENDING: return "PENDING";
|
|
@@ -6460,7 +6673,7 @@ function toExecutorInfo(executor) {
|
|
|
6460
6673
|
}
|
|
6461
6674
|
|
|
6462
6675
|
//#endregion
|
|
6463
|
-
//#region src/cli/executor/get.ts
|
|
6676
|
+
//#region src/cli/commands/executor/get.ts
|
|
6464
6677
|
const nameArgs$1 = { name: arg(z.string(), {
|
|
6465
6678
|
positional: true,
|
|
6466
6679
|
description: "Executor name"
|
|
@@ -6520,7 +6733,7 @@ const getCommand$3 = defineCommand({
|
|
|
6520
6733
|
});
|
|
6521
6734
|
|
|
6522
6735
|
//#endregion
|
|
6523
|
-
//#region src/cli/
|
|
6736
|
+
//#region src/cli/shared/format.ts
|
|
6524
6737
|
/**
|
|
6525
6738
|
* Format a protobuf Timestamp to ISO string.
|
|
6526
6739
|
* @param timestamp - Protobuf timestamp
|
|
@@ -6566,7 +6779,7 @@ function humanizeRelativeTime(value) {
|
|
|
6566
6779
|
}
|
|
6567
6780
|
|
|
6568
6781
|
//#endregion
|
|
6569
|
-
//#region src/cli/
|
|
6782
|
+
//#region src/cli/shared/function-execution.ts
|
|
6570
6783
|
/**
|
|
6571
6784
|
* Convert function execution status enum to string.
|
|
6572
6785
|
* @param status - Function execution status enum value
|
|
@@ -6582,7 +6795,7 @@ function functionExecutionStatusToString(status) {
|
|
|
6582
6795
|
}
|
|
6583
6796
|
|
|
6584
6797
|
//#endregion
|
|
6585
|
-
//#region src/cli/workflow/args.ts
|
|
6798
|
+
//#region src/cli/commands/workflow/args.ts
|
|
6586
6799
|
const nameArgs = { name: arg(z.string(), {
|
|
6587
6800
|
positional: true,
|
|
6588
6801
|
description: "Workflow name"
|
|
@@ -6603,7 +6816,7 @@ const waitArgs = {
|
|
|
6603
6816
|
};
|
|
6604
6817
|
|
|
6605
6818
|
//#endregion
|
|
6606
|
-
//#region src/cli/workflow/status.ts
|
|
6819
|
+
//#region src/cli/commands/workflow/status.ts
|
|
6607
6820
|
/**
|
|
6608
6821
|
* Check if workflow execution status is terminal.
|
|
6609
6822
|
* @param status - Workflow execution status enum value
|
|
@@ -6614,7 +6827,7 @@ function isWorkflowExecutionTerminalStatus(status) {
|
|
|
6614
6827
|
}
|
|
6615
6828
|
|
|
6616
6829
|
//#endregion
|
|
6617
|
-
//#region src/cli/workflow/transform.ts
|
|
6830
|
+
//#region src/cli/commands/workflow/transform.ts
|
|
6618
6831
|
/**
|
|
6619
6832
|
* Convert a workflow execution status enum to a string.
|
|
6620
6833
|
* @param status - Workflow execution status
|
|
@@ -6706,7 +6919,7 @@ function toWorkflowExecutionInfo(execution) {
|
|
|
6706
6919
|
}
|
|
6707
6920
|
|
|
6708
6921
|
//#endregion
|
|
6709
|
-
//#region src/cli/workflow/executions.ts
|
|
6922
|
+
//#region src/cli/commands/workflow/executions.ts
|
|
6710
6923
|
function sleep$1(ms) {
|
|
6711
6924
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
6712
6925
|
}
|
|
@@ -6951,7 +7164,7 @@ const executionsCommand = defineCommand({
|
|
|
6951
7164
|
});
|
|
6952
7165
|
|
|
6953
7166
|
//#endregion
|
|
6954
|
-
//#region src/cli/workflow/get.ts
|
|
7167
|
+
//#region src/cli/commands/workflow/get.ts
|
|
6955
7168
|
/**
|
|
6956
7169
|
* Resolve a workflow definition by name.
|
|
6957
7170
|
* @param client - Operator client
|
|
@@ -7004,7 +7217,7 @@ const getCommand$2 = defineCommand({
|
|
|
7004
7217
|
});
|
|
7005
7218
|
|
|
7006
7219
|
//#endregion
|
|
7007
|
-
//#region src/cli/workflow/start.ts
|
|
7220
|
+
//#region src/cli/commands/workflow/start.ts
|
|
7008
7221
|
function sleep(ms) {
|
|
7009
7222
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
7010
7223
|
}
|
|
@@ -7206,7 +7419,7 @@ const startCommand = defineCommand({
|
|
|
7206
7419
|
});
|
|
7207
7420
|
|
|
7208
7421
|
//#endregion
|
|
7209
|
-
//#region src/cli/executor/jobs.ts
|
|
7422
|
+
//#region src/cli/commands/executor/jobs.ts
|
|
7210
7423
|
function formatTime(date) {
|
|
7211
7424
|
return date.toLocaleTimeString("en-US", { hour12: false });
|
|
7212
7425
|
}
|
|
@@ -7585,7 +7798,7 @@ const jobsCommand = defineCommand({
|
|
|
7585
7798
|
});
|
|
7586
7799
|
|
|
7587
7800
|
//#endregion
|
|
7588
|
-
//#region src/cli/executor/list.ts
|
|
7801
|
+
//#region src/cli/commands/executor/list.ts
|
|
7589
7802
|
/**
|
|
7590
7803
|
* List executors in the workspace and return CLI-friendly info.
|
|
7591
7804
|
* @param options - Executor listing options
|
|
@@ -7634,7 +7847,7 @@ const listCommand$6 = defineCommand({
|
|
|
7634
7847
|
});
|
|
7635
7848
|
|
|
7636
7849
|
//#endregion
|
|
7637
|
-
//#region src/cli/executor/trigger.ts
|
|
7850
|
+
//#region src/cli/commands/executor/trigger.ts
|
|
7638
7851
|
/**
|
|
7639
7852
|
* Schema for JSON string validation (object only)
|
|
7640
7853
|
* Transforms the string to a parsed object
|
|
@@ -7847,7 +8060,7 @@ The \`--logs\` option displays logs from the downstream execution when available
|
|
|
7847
8060
|
});
|
|
7848
8061
|
|
|
7849
8062
|
//#endregion
|
|
7850
|
-
//#region src/cli/executor/webhook.ts
|
|
8063
|
+
//#region src/cli/commands/executor/webhook.ts
|
|
7851
8064
|
/**
|
|
7852
8065
|
* Build the webhook URL for an executor.
|
|
7853
8066
|
* @param workspaceId - Workspace ID
|
|
@@ -7915,7 +8128,7 @@ const webhookCommand = defineCommand({
|
|
|
7915
8128
|
});
|
|
7916
8129
|
|
|
7917
8130
|
//#endregion
|
|
7918
|
-
//#region src/cli/
|
|
8131
|
+
//#region src/cli/commands/generate/types.ts
|
|
7919
8132
|
/**
|
|
7920
8133
|
* Type guard to check if a generator has a specific dependency.
|
|
7921
8134
|
* @template D
|
|
@@ -7928,7 +8141,7 @@ function hasDependency(generator, dependency) {
|
|
|
7928
8141
|
}
|
|
7929
8142
|
|
|
7930
8143
|
//#endregion
|
|
7931
|
-
//#region src/cli/
|
|
8144
|
+
//#region src/cli/commands/generate/watch/index.ts
|
|
7932
8145
|
/**
|
|
7933
8146
|
* Error codes.
|
|
7934
8147
|
*/
|
|
@@ -8306,7 +8519,7 @@ function createDependencyWatcher(options = {}) {
|
|
|
8306
8519
|
}
|
|
8307
8520
|
|
|
8308
8521
|
//#endregion
|
|
8309
|
-
//#region src/cli/
|
|
8522
|
+
//#region src/cli/commands/generate/service.ts
|
|
8310
8523
|
/**
|
|
8311
8524
|
* Creates a generation manager.
|
|
8312
8525
|
* @param params - Parameters for creating the generation manager
|
|
@@ -8328,18 +8541,8 @@ function createGenerationManager(params) {
|
|
|
8328
8541
|
let watcher = null;
|
|
8329
8542
|
const generatorResults = {};
|
|
8330
8543
|
const generationPlugins = pluginManager?.getPluginsWithGenerationHooks() ?? [];
|
|
8331
|
-
function
|
|
8332
|
-
return
|
|
8333
|
-
}
|
|
8334
|
-
function onlyHas(gen, ...required) {
|
|
8335
|
-
const deps = getDeps(gen);
|
|
8336
|
-
return required.every((r) => deps.has(r)) && deps.size === required.length;
|
|
8337
|
-
}
|
|
8338
|
-
function hasAll(gen, ...required) {
|
|
8339
|
-
return required.every((r) => getDeps(gen).has(r));
|
|
8340
|
-
}
|
|
8341
|
-
function hasNone(gen, ...excluded) {
|
|
8342
|
-
return excluded.every((e) => !getDeps(gen).has(e));
|
|
8544
|
+
function getReadyGenerators(dep) {
|
|
8545
|
+
return generators.filter((g) => g.dependencies.includes(dep));
|
|
8343
8546
|
}
|
|
8344
8547
|
function getAuthInput() {
|
|
8345
8548
|
const authService = application.authService;
|
|
@@ -8594,13 +8797,15 @@ function createGenerationManager(params) {
|
|
|
8594
8797
|
}
|
|
8595
8798
|
async function runGenerators(gens, watch$1) {
|
|
8596
8799
|
const results = await Promise.allSettled(gens.map(async (gen) => {
|
|
8597
|
-
|
|
8598
|
-
|
|
8599
|
-
|
|
8600
|
-
|
|
8601
|
-
|
|
8602
|
-
|
|
8603
|
-
|
|
8800
|
+
await withSpan(`generate.generator.${gen.id}`, async () => {
|
|
8801
|
+
try {
|
|
8802
|
+
await processGenerator(gen);
|
|
8803
|
+
} catch (error) {
|
|
8804
|
+
logger.error(`Error processing generator ${styles.bold(gen.id)}`);
|
|
8805
|
+
logger.error(String(error));
|
|
8806
|
+
if (!watch$1) throw error;
|
|
8807
|
+
}
|
|
8808
|
+
});
|
|
8604
8809
|
}));
|
|
8605
8810
|
if (!watch$1) {
|
|
8606
8811
|
const failures = results.filter((r) => r.status === "rejected");
|
|
@@ -8646,64 +8851,86 @@ function createGenerationManager(params) {
|
|
|
8646
8851
|
logger.newline();
|
|
8647
8852
|
logger.log(`Generation for application: ${styles.highlight(application.config.name)}`);
|
|
8648
8853
|
const app = application;
|
|
8649
|
-
|
|
8650
|
-
|
|
8651
|
-
|
|
8652
|
-
|
|
8653
|
-
await
|
|
8654
|
-
|
|
8655
|
-
|
|
8656
|
-
|
|
8657
|
-
|
|
8658
|
-
|
|
8659
|
-
|
|
8660
|
-
|
|
8661
|
-
|
|
8662
|
-
|
|
8854
|
+
await withSpan("generate.loadTailorDBTypes", async (span) => {
|
|
8855
|
+
span.setAttribute("generate.namespace_count", app.tailorDBServices.length);
|
|
8856
|
+
for (const db$1 of app.tailorDBServices) {
|
|
8857
|
+
const namespace = db$1.namespace;
|
|
8858
|
+
await withSpan(`generate.loadTypes.${namespace}`, async () => {
|
|
8859
|
+
try {
|
|
8860
|
+
await db$1.loadTypes();
|
|
8861
|
+
await db$1.processNamespacePlugins();
|
|
8862
|
+
services.tailordb[namespace] = {
|
|
8863
|
+
types: db$1.types,
|
|
8864
|
+
sourceInfo: db$1.typeSourceInfo,
|
|
8865
|
+
pluginAttachments: db$1.pluginAttachments
|
|
8866
|
+
};
|
|
8867
|
+
} catch (error) {
|
|
8868
|
+
logger.error(`Error loading types for TailorDB service ${styles.bold(namespace)}`);
|
|
8869
|
+
logger.error(String(error));
|
|
8870
|
+
if (!watch$1) throw error;
|
|
8871
|
+
}
|
|
8872
|
+
});
|
|
8663
8873
|
}
|
|
8664
|
-
}
|
|
8665
|
-
const pluginExecutorFiles =
|
|
8666
|
-
|
|
8667
|
-
|
|
8874
|
+
});
|
|
8875
|
+
const { pluginExecutorFiles, executorService } = await withSpan("generate.pluginFiles", async () => {
|
|
8876
|
+
const pluginExecutorFiles$1 = generatePluginFilesIfNeeded(pluginManager, app.tailorDBServices, config.path);
|
|
8877
|
+
return {
|
|
8878
|
+
pluginExecutorFiles: pluginExecutorFiles$1,
|
|
8879
|
+
executorService: app.executorService ?? (pluginExecutorFiles$1.length > 0 ? createExecutorService({ config: { files: [] } }) : void 0)
|
|
8880
|
+
};
|
|
8881
|
+
});
|
|
8882
|
+
if (app.authService) await withSpan("generate.resolveAuthNamespaces", async () => app.authService.resolveNamespaces());
|
|
8668
8883
|
if (app.tailorDBServices.length > 0 || pluginExecutorFiles.length > 0) logger.newline();
|
|
8669
|
-
const
|
|
8884
|
+
const readyAfterTailorDB = getReadyGenerators("tailordb");
|
|
8670
8885
|
const hasOnTailorDBReady = generationPlugins.some((p) => p.onTailorDBReady != null);
|
|
8671
|
-
if (
|
|
8672
|
-
await
|
|
8886
|
+
if (readyAfterTailorDB.length > 0 || hasOnTailorDBReady) {
|
|
8887
|
+
await withSpan("generate.onTailorDBReady", async () => {
|
|
8888
|
+
await Promise.all([runGenerators(readyAfterTailorDB, watch$1), runPluginHook("onTailorDBReady", watch$1)]);
|
|
8889
|
+
});
|
|
8673
8890
|
logger.newline();
|
|
8674
8891
|
}
|
|
8675
|
-
|
|
8676
|
-
const
|
|
8677
|
-
|
|
8678
|
-
await
|
|
8679
|
-
|
|
8680
|
-
|
|
8681
|
-
|
|
8892
|
+
await withSpan("generate.loadResolvers", async () => {
|
|
8893
|
+
for (const resolverService of app.resolverServices) {
|
|
8894
|
+
const namespace = resolverService.namespace;
|
|
8895
|
+
await withSpan(`generate.loadResolvers.${namespace}`, async () => {
|
|
8896
|
+
try {
|
|
8897
|
+
await resolverService.loadResolvers();
|
|
8898
|
+
services.resolver[namespace] = {};
|
|
8899
|
+
Object.entries(resolverService.resolvers).forEach(([_, resolver]) => {
|
|
8900
|
+
services.resolver[namespace][resolver.name] = resolver;
|
|
8901
|
+
});
|
|
8902
|
+
} catch (error) {
|
|
8903
|
+
logger.error(`Error loading resolvers for Resolver service ${styles.bold(namespace)}`);
|
|
8904
|
+
logger.error(String(error));
|
|
8905
|
+
if (!watch$1) throw error;
|
|
8906
|
+
}
|
|
8682
8907
|
});
|
|
8683
|
-
} catch (error) {
|
|
8684
|
-
logger.error(`Error loading resolvers for Resolver service ${styles.bold(namespace)}`);
|
|
8685
|
-
logger.error(String(error));
|
|
8686
|
-
if (!watch$1) throw error;
|
|
8687
8908
|
}
|
|
8688
|
-
}
|
|
8689
|
-
const
|
|
8909
|
+
});
|
|
8910
|
+
const readyAfterResolvers = getReadyGenerators("resolver");
|
|
8690
8911
|
const hasOnResolverReady = generationPlugins.some((p) => p.onResolverReady != null);
|
|
8691
|
-
if (
|
|
8692
|
-
await
|
|
8912
|
+
if (readyAfterResolvers.length > 0 || hasOnResolverReady) {
|
|
8913
|
+
await withSpan("generate.onResolversReady", async () => {
|
|
8914
|
+
await Promise.all([runGenerators(readyAfterResolvers, watch$1), runPluginHook("onResolverReady", watch$1)]);
|
|
8915
|
+
});
|
|
8693
8916
|
logger.newline();
|
|
8694
8917
|
}
|
|
8695
|
-
|
|
8696
|
-
|
|
8697
|
-
|
|
8698
|
-
|
|
8699
|
-
|
|
8700
|
-
|
|
8701
|
-
|
|
8918
|
+
await withSpan("generate.loadExecutors", async () => {
|
|
8919
|
+
if (executorService) {
|
|
8920
|
+
await executorService.loadExecutors();
|
|
8921
|
+
if (pluginExecutorFiles.length > 0) await executorService.loadPluginExecutorFiles([...pluginExecutorFiles]);
|
|
8922
|
+
}
|
|
8923
|
+
const allExecutors = executorService?.executors ?? {};
|
|
8924
|
+
Object.entries(allExecutors).forEach(([key, executor]) => {
|
|
8925
|
+
services.executor[key] = executor;
|
|
8926
|
+
});
|
|
8702
8927
|
});
|
|
8703
|
-
const
|
|
8928
|
+
const readyAfterExecutors = getReadyGenerators("executor");
|
|
8704
8929
|
const hasOnExecutorReady = generationPlugins.some((p) => p.onExecutorReady != null);
|
|
8705
|
-
if (
|
|
8706
|
-
await
|
|
8930
|
+
if (readyAfterExecutors.length > 0 || hasOnExecutorReady) {
|
|
8931
|
+
await withSpan("generate.onExecutorsReady", async () => {
|
|
8932
|
+
await Promise.all([runGenerators(readyAfterExecutors, watch$1), runPluginHook("onExecutorReady", watch$1)]);
|
|
8933
|
+
});
|
|
8707
8934
|
logger.newline();
|
|
8708
8935
|
}
|
|
8709
8936
|
},
|
|
@@ -8732,50 +8959,35 @@ function createGenerationManager(params) {
|
|
|
8732
8959
|
* @returns Promise that resolves when generation (and watch, if enabled) completes
|
|
8733
8960
|
*/
|
|
8734
8961
|
async function generate$1(options) {
|
|
8735
|
-
|
|
8736
|
-
|
|
8737
|
-
|
|
8738
|
-
|
|
8739
|
-
|
|
8740
|
-
|
|
8741
|
-
|
|
8742
|
-
|
|
8743
|
-
|
|
8744
|
-
|
|
8962
|
+
return withSpan("generate", async (rootSpan) => {
|
|
8963
|
+
const { config, generators, plugins } = await withSpan("generate.loadConfig", async () => loadConfig(options?.configPath));
|
|
8964
|
+
const watch$1 = options?.watch ?? false;
|
|
8965
|
+
rootSpan.setAttribute("generate.watch", watch$1);
|
|
8966
|
+
rootSpan.setAttribute("generate.generators.count", generators.length);
|
|
8967
|
+
await withSpan("generate.generateUserTypes", async () => generateUserTypes({
|
|
8968
|
+
config,
|
|
8969
|
+
configPath: config.path
|
|
8970
|
+
}));
|
|
8971
|
+
let pluginManager;
|
|
8972
|
+
if (plugins.length > 0) pluginManager = new PluginManager(plugins);
|
|
8973
|
+
const application = defineApplication({
|
|
8745
8974
|
config,
|
|
8746
8975
|
pluginManager
|
|
8747
|
-
})
|
|
8748
|
-
config
|
|
8749
|
-
|
|
8750
|
-
|
|
8976
|
+
});
|
|
8977
|
+
rootSpan.setAttribute("app.name", application.config.name);
|
|
8978
|
+
const manager = createGenerationManager({
|
|
8979
|
+
application,
|
|
8980
|
+
config,
|
|
8981
|
+
generators,
|
|
8982
|
+
pluginManager
|
|
8983
|
+
});
|
|
8984
|
+
await manager.generate(watch$1);
|
|
8985
|
+
if (watch$1) await manager.watch();
|
|
8751
8986
|
});
|
|
8752
|
-
await manager.generate(watch$1);
|
|
8753
|
-
if (watch$1) await manager.watch();
|
|
8754
8987
|
}
|
|
8755
|
-
const generateCommand$1 = defineCommand({
|
|
8756
|
-
name: "generate",
|
|
8757
|
-
description: "Generate files using Tailor configuration.",
|
|
8758
|
-
args: z.object({
|
|
8759
|
-
...commonArgs,
|
|
8760
|
-
config: arg(z.string().default("tailor.config.ts"), {
|
|
8761
|
-
alias: "c",
|
|
8762
|
-
description: "Path to SDK config file"
|
|
8763
|
-
}),
|
|
8764
|
-
watch: arg(z.boolean().default(false), {
|
|
8765
|
-
alias: "W",
|
|
8766
|
-
description: "Watch for type/resolver changes and regenerate"
|
|
8767
|
-
})
|
|
8768
|
-
}),
|
|
8769
|
-
run: withCommonArgs(async (args) => {
|
|
8770
|
-
await generate$1({
|
|
8771
|
-
configPath: args.config,
|
|
8772
|
-
watch: args.watch
|
|
8773
|
-
});
|
|
8774
|
-
})
|
|
8775
|
-
});
|
|
8776
8988
|
|
|
8777
8989
|
//#endregion
|
|
8778
|
-
//#region src/cli/machineuser/list.ts
|
|
8990
|
+
//#region src/cli/commands/machineuser/list.ts
|
|
8779
8991
|
/**
|
|
8780
8992
|
* Map a MachineUser protobuf message to CLI-friendly info.
|
|
8781
8993
|
* @param user - Machine user resource
|
|
@@ -8843,7 +9055,7 @@ const listCommand$5 = defineCommand({
|
|
|
8843
9055
|
});
|
|
8844
9056
|
|
|
8845
9057
|
//#endregion
|
|
8846
|
-
//#region src/cli/machineuser/token.ts
|
|
9058
|
+
//#region src/cli/commands/machineuser/token.ts
|
|
8847
9059
|
/**
|
|
8848
9060
|
* Get a machine user access token for the current application.
|
|
8849
9061
|
* @param options - Token retrieval options
|
|
@@ -8908,7 +9120,7 @@ const tokenCommand = defineCommand({
|
|
|
8908
9120
|
});
|
|
8909
9121
|
|
|
8910
9122
|
//#endregion
|
|
8911
|
-
//#region src/cli/oauth2client/transform.ts
|
|
9123
|
+
//#region src/cli/commands/oauth2client/transform.ts
|
|
8912
9124
|
const grantTypeToString = (grantType) => {
|
|
8913
9125
|
switch (grantType) {
|
|
8914
9126
|
case AuthOAuth2Client_GrantType.AUTHORIZATION_CODE: return "authorization_code";
|
|
@@ -8949,7 +9161,7 @@ function toOAuth2ClientCredentials(client) {
|
|
|
8949
9161
|
}
|
|
8950
9162
|
|
|
8951
9163
|
//#endregion
|
|
8952
|
-
//#region src/cli/oauth2client/get.ts
|
|
9164
|
+
//#region src/cli/commands/oauth2client/get.ts
|
|
8953
9165
|
/**
|
|
8954
9166
|
* Get OAuth2 client credentials for the current application.
|
|
8955
9167
|
* @param options - OAuth2 client lookup options
|
|
@@ -9006,7 +9218,7 @@ const getCommand$1 = defineCommand({
|
|
|
9006
9218
|
});
|
|
9007
9219
|
|
|
9008
9220
|
//#endregion
|
|
9009
|
-
//#region src/cli/oauth2client/list.ts
|
|
9221
|
+
//#region src/cli/commands/oauth2client/list.ts
|
|
9010
9222
|
/**
|
|
9011
9223
|
* List OAuth2 clients for the current application.
|
|
9012
9224
|
* @param options - OAuth2 client listing options
|
|
@@ -9056,7 +9268,7 @@ const listCommand$4 = defineCommand({
|
|
|
9056
9268
|
});
|
|
9057
9269
|
|
|
9058
9270
|
//#endregion
|
|
9059
|
-
//#region src/cli/remove.ts
|
|
9271
|
+
//#region src/cli/commands/remove.ts
|
|
9060
9272
|
async function loadOptions$9(options) {
|
|
9061
9273
|
const client = await initOperatorClient(await loadAccessToken({
|
|
9062
9274
|
useProfile: true,
|
|
@@ -9148,7 +9360,7 @@ const removeCommand$1 = defineCommand({
|
|
|
9148
9360
|
});
|
|
9149
9361
|
|
|
9150
9362
|
//#endregion
|
|
9151
|
-
//#region src/cli/show.ts
|
|
9363
|
+
//#region src/cli/commands/show.ts
|
|
9152
9364
|
function applicationInfo(app) {
|
|
9153
9365
|
return {
|
|
9154
9366
|
name: app.name,
|
|
@@ -9209,7 +9421,7 @@ const showCommand = defineCommand({
|
|
|
9209
9421
|
});
|
|
9210
9422
|
|
|
9211
9423
|
//#endregion
|
|
9212
|
-
//#region src/cli/
|
|
9424
|
+
//#region src/cli/shared/beta.ts
|
|
9213
9425
|
/**
|
|
9214
9426
|
* Warn that a feature is in beta.
|
|
9215
9427
|
* @param {string} featureName - Name of the beta feature (e.g., "tailordb erd", "tailordb migration")
|
|
@@ -9220,7 +9432,7 @@ function logBetaWarning(featureName) {
|
|
|
9220
9432
|
}
|
|
9221
9433
|
|
|
9222
9434
|
//#endregion
|
|
9223
|
-
//#region src/cli/tailordb/migrate/db-types-generator.ts
|
|
9435
|
+
//#region src/cli/commands/tailordb/migrate/db-types-generator.ts
|
|
9224
9436
|
/**
|
|
9225
9437
|
* DB types generator for TailorDB migrations
|
|
9226
9438
|
*
|
|
@@ -9463,7 +9675,7 @@ async function writeDbTypesFile(snapshot, migrationsDir, migrationNumber, diff)
|
|
|
9463
9675
|
}
|
|
9464
9676
|
|
|
9465
9677
|
//#endregion
|
|
9466
|
-
//#region src/cli/tailordb/migrate/template-generator.ts
|
|
9678
|
+
//#region src/cli/commands/tailordb/migrate/template-generator.ts
|
|
9467
9679
|
/**
|
|
9468
9680
|
* Template generator for TailorDB migrations
|
|
9469
9681
|
*
|
|
@@ -9663,7 +9875,7 @@ function generateChangeScript(change) {
|
|
|
9663
9875
|
}
|
|
9664
9876
|
|
|
9665
9877
|
//#endregion
|
|
9666
|
-
//#region src/cli/tailordb/migrate/generate.ts
|
|
9878
|
+
//#region src/cli/commands/tailordb/migrate/generate.ts
|
|
9667
9879
|
/**
|
|
9668
9880
|
* Generate command for TailorDB migrations
|
|
9669
9881
|
*
|
|
@@ -9728,7 +9940,7 @@ async function generate(options) {
|
|
|
9728
9940
|
if (options.init) await handleInitOption(namespacesWithMigrations, options.yes);
|
|
9729
9941
|
let pluginManager;
|
|
9730
9942
|
if (plugins.length > 0) pluginManager = new PluginManager(plugins);
|
|
9731
|
-
const { defineApplication: defineApplication$1 } = await import("./application-
|
|
9943
|
+
const { defineApplication: defineApplication$1 } = await import("./application-DiCzM9b0.mjs");
|
|
9732
9944
|
const application = defineApplication$1({
|
|
9733
9945
|
config,
|
|
9734
9946
|
pluginManager
|
|
@@ -9885,7 +10097,7 @@ const generateCommand = defineCommand({
|
|
|
9885
10097
|
});
|
|
9886
10098
|
|
|
9887
10099
|
//#endregion
|
|
9888
|
-
//#region src/cli/tailordb/truncate.ts
|
|
10100
|
+
//#region src/cli/commands/tailordb/truncate.ts
|
|
9889
10101
|
async function truncateSingleType(options, client) {
|
|
9890
10102
|
await client.truncateTailorDBType({
|
|
9891
10103
|
workspaceId: options.workspaceId,
|
|
@@ -10051,7 +10263,7 @@ const truncateCommand = defineCommand({
|
|
|
10051
10263
|
});
|
|
10052
10264
|
|
|
10053
10265
|
//#endregion
|
|
10054
|
-
//#region src/cli/workflow/list.ts
|
|
10266
|
+
//#region src/cli/commands/workflow/list.ts
|
|
10055
10267
|
/**
|
|
10056
10268
|
* List workflows in the workspace and return CLI-friendly info.
|
|
10057
10269
|
* @param options - Workflow listing options
|
|
@@ -10097,7 +10309,7 @@ const listCommand$3 = defineCommand({
|
|
|
10097
10309
|
});
|
|
10098
10310
|
|
|
10099
10311
|
//#endregion
|
|
10100
|
-
//#region src/cli/workflow/resume.ts
|
|
10312
|
+
//#region src/cli/commands/workflow/resume.ts
|
|
10101
10313
|
/**
|
|
10102
10314
|
* Resume a suspended workflow execution and return a handle to wait for completion.
|
|
10103
10315
|
* @param options - Resume options
|
|
@@ -10172,7 +10384,7 @@ const resumeCommand = defineCommand({
|
|
|
10172
10384
|
});
|
|
10173
10385
|
|
|
10174
10386
|
//#endregion
|
|
10175
|
-
//#region src/cli/workspace/app/transform.ts
|
|
10387
|
+
//#region src/cli/commands/workspace/app/transform.ts
|
|
10176
10388
|
const statusToString = (status) => {
|
|
10177
10389
|
switch (status) {
|
|
10178
10390
|
case GetApplicationSchemaHealthResponse_ApplicationSchemaHealthStatus.OK: return "ok";
|
|
@@ -10209,7 +10421,7 @@ const appHealthInfo = (name, health) => {
|
|
|
10209
10421
|
};
|
|
10210
10422
|
|
|
10211
10423
|
//#endregion
|
|
10212
|
-
//#region src/cli/workspace/app/health.ts
|
|
10424
|
+
//#region src/cli/commands/workspace/app/health.ts
|
|
10213
10425
|
const healthOptionsSchema = z.object({
|
|
10214
10426
|
workspaceId: z.uuid({ message: "workspace-id must be a valid UUID" }).optional(),
|
|
10215
10427
|
profile: z.string().optional(),
|
|
@@ -10267,7 +10479,7 @@ const healthCommand = defineCommand({
|
|
|
10267
10479
|
});
|
|
10268
10480
|
|
|
10269
10481
|
//#endregion
|
|
10270
|
-
//#region src/cli/workspace/app/list.ts
|
|
10482
|
+
//#region src/cli/commands/workspace/app/list.ts
|
|
10271
10483
|
const listAppsOptionsSchema = z.object({
|
|
10272
10484
|
workspaceId: z.uuid({ message: "workspace-id must be a valid UUID" }).optional(),
|
|
10273
10485
|
profile: z.string().optional(),
|
|
@@ -10339,7 +10551,7 @@ const listCommand$2 = defineCommand({
|
|
|
10339
10551
|
});
|
|
10340
10552
|
|
|
10341
10553
|
//#endregion
|
|
10342
|
-
//#region src/cli/workspace/transform.ts
|
|
10554
|
+
//#region src/cli/commands/workspace/transform.ts
|
|
10343
10555
|
const workspaceInfo = (workspace) => {
|
|
10344
10556
|
return {
|
|
10345
10557
|
id: workspace.id,
|
|
@@ -10359,7 +10571,7 @@ const workspaceDetails = (workspace) => {
|
|
|
10359
10571
|
};
|
|
10360
10572
|
|
|
10361
10573
|
//#endregion
|
|
10362
|
-
//#region src/cli/workspace/create.ts
|
|
10574
|
+
//#region src/cli/commands/workspace/create.ts
|
|
10363
10575
|
/**
|
|
10364
10576
|
* Schema for workspace creation options
|
|
10365
10577
|
* - name: 3-63 chars, lowercase alphanumeric and hyphens, cannot start/end with hyphen
|
|
@@ -10474,7 +10686,7 @@ const createCommand = defineCommand({
|
|
|
10474
10686
|
});
|
|
10475
10687
|
|
|
10476
10688
|
//#endregion
|
|
10477
|
-
//#region src/cli/workspace/delete.ts
|
|
10689
|
+
//#region src/cli/commands/workspace/delete.ts
|
|
10478
10690
|
const deleteWorkspaceOptionsSchema = z.object({ workspaceId: z.uuid({ message: "workspace-id must be a valid UUID" }) });
|
|
10479
10691
|
async function loadOptions$6(options) {
|
|
10480
10692
|
const result = deleteWorkspaceOptionsSchema.safeParse(options);
|
|
@@ -10531,7 +10743,7 @@ const deleteCommand = defineCommand({
|
|
|
10531
10743
|
});
|
|
10532
10744
|
|
|
10533
10745
|
//#endregion
|
|
10534
|
-
//#region src/cli/workspace/get.ts
|
|
10746
|
+
//#region src/cli/commands/workspace/get.ts
|
|
10535
10747
|
const getWorkspaceOptionsSchema = z.object({
|
|
10536
10748
|
workspaceId: z.uuid({ message: "workspace-id must be a valid UUID" }).optional(),
|
|
10537
10749
|
profile: z.string().optional()
|
|
@@ -10581,7 +10793,7 @@ const getCommand = defineCommand({
|
|
|
10581
10793
|
});
|
|
10582
10794
|
|
|
10583
10795
|
//#endregion
|
|
10584
|
-
//#region src/cli/workspace/list.ts
|
|
10796
|
+
//#region src/cli/commands/workspace/list.ts
|
|
10585
10797
|
/**
|
|
10586
10798
|
* List workspaces with an optional limit.
|
|
10587
10799
|
* @param options - Workspace listing options
|
|
@@ -10627,7 +10839,7 @@ const listCommand$1 = defineCommand({
|
|
|
10627
10839
|
});
|
|
10628
10840
|
|
|
10629
10841
|
//#endregion
|
|
10630
|
-
//#region src/cli/workspace/restore.ts
|
|
10842
|
+
//#region src/cli/commands/workspace/restore.ts
|
|
10631
10843
|
const restoreWorkspaceOptionsSchema = z.object({ workspaceId: z.uuid({ message: "workspace-id must be a valid UUID" }) });
|
|
10632
10844
|
async function loadOptions$4(options) {
|
|
10633
10845
|
const result = restoreWorkspaceOptionsSchema.safeParse(options);
|
|
@@ -10671,7 +10883,7 @@ const restoreCommand = defineCommand({
|
|
|
10671
10883
|
});
|
|
10672
10884
|
|
|
10673
10885
|
//#endregion
|
|
10674
|
-
//#region src/cli/workspace/user/transform.ts
|
|
10886
|
+
//#region src/cli/commands/workspace/user/transform.ts
|
|
10675
10887
|
const roleToString = (role) => {
|
|
10676
10888
|
switch (role) {
|
|
10677
10889
|
case WorkspacePlatformUserRole.ADMIN: return "admin";
|
|
@@ -10702,7 +10914,7 @@ const validRoles = [
|
|
|
10702
10914
|
];
|
|
10703
10915
|
|
|
10704
10916
|
//#endregion
|
|
10705
|
-
//#region src/cli/workspace/user/invite.ts
|
|
10917
|
+
//#region src/cli/commands/workspace/user/invite.ts
|
|
10706
10918
|
const inviteUserOptionsSchema = z.object({
|
|
10707
10919
|
workspaceId: z.uuid({ message: "workspace-id must be a valid UUID" }).optional(),
|
|
10708
10920
|
profile: z.string().optional(),
|
|
@@ -10759,7 +10971,7 @@ const inviteCommand = defineCommand({
|
|
|
10759
10971
|
});
|
|
10760
10972
|
|
|
10761
10973
|
//#endregion
|
|
10762
|
-
//#region src/cli/workspace/user/list.ts
|
|
10974
|
+
//#region src/cli/commands/workspace/user/list.ts
|
|
10763
10975
|
const listUsersOptionsSchema = z.object({
|
|
10764
10976
|
workspaceId: z.uuid({ message: "workspace-id must be a valid UUID" }).optional(),
|
|
10765
10977
|
profile: z.string().optional(),
|
|
@@ -10827,7 +11039,7 @@ const listCommand = defineCommand({
|
|
|
10827
11039
|
});
|
|
10828
11040
|
|
|
10829
11041
|
//#endregion
|
|
10830
|
-
//#region src/cli/workspace/user/remove.ts
|
|
11042
|
+
//#region src/cli/commands/workspace/user/remove.ts
|
|
10831
11043
|
const removeUserOptionsSchema = z.object({
|
|
10832
11044
|
workspaceId: z.uuid({ message: "workspace-id must be a valid UUID" }).optional(),
|
|
10833
11045
|
profile: z.string().optional(),
|
|
@@ -10883,7 +11095,7 @@ const removeCommand = defineCommand({
|
|
|
10883
11095
|
});
|
|
10884
11096
|
|
|
10885
11097
|
//#endregion
|
|
10886
|
-
//#region src/cli/workspace/user/update.ts
|
|
11098
|
+
//#region src/cli/commands/workspace/user/update.ts
|
|
10887
11099
|
const updateUserOptionsSchema = z.object({
|
|
10888
11100
|
workspaceId: z.uuid({ message: "workspace-id must be a valid UUID" }).optional(),
|
|
10889
11101
|
profile: z.string().optional(),
|
|
@@ -10940,5 +11152,5 @@ const updateCommand = defineCommand({
|
|
|
10940
11152
|
});
|
|
10941
11153
|
|
|
10942
11154
|
//#endregion
|
|
10943
|
-
export {
|
|
10944
|
-
//# sourceMappingURL=update-
|
|
11155
|
+
export { listExecutorJobs as $, generateCommand as A, getMigrationFiles as At, getMachineUserToken as B, generateUserTypes as Bt, resumeCommand as C, compareLocalTypesWithSnapshot as Ct, truncate as D, getLatestMigrationNumber as Dt, listWorkflows as E, formatMigrationNumber as Et, removeCommand$1 as F, formatDiffSummary as Ft, listWebhookExecutors as G, deploymentArgs as Gt, listCommand$5 as H, apiCommand as Ht, listCommand$4 as I, formatMigrationDiff as It, triggerExecutor as J, workspaceArgs as Jt, webhookCommand as K, jsonArgs as Kt, listOAuth2Clients as L, hasChanges as Lt, show as M, isValidMigrationNumber as Mt, showCommand as N, loadDiff as Nt, truncateCommand as O, getMigrationDirPath as Ot, remove as P, reconstructSnapshotFromMigrations as Pt, jobsCommand as Q, getCommand$1 as R, getNamespacesWithMigrations as Rt, healthCommand as S, SCHEMA_FILE_NAME as St, listCommand$3 as T, createSnapshotFromLocalTypes as Tt, listMachineUsers as U, commonArgs as Ut, tokenCommand as V, apiCall as Vt, generate$1 as W, confirmationArgs as Wt, listExecutors as X, listCommand$6 as Y, getExecutorJob as Z, createCommand as _, bundleMigrationScript as _t, listCommand as a, executionsCommand as at, listCommand$2 as b, INITIAL_SCHEMA_NUMBER as bt, inviteUser as c, functionExecutionStatusToString as ct, listCommand$1 as d, getExecutor as dt, watchExecutorJob as et, listWorkspaces as f, apply as ft, deleteWorkspace as g, parseMigrationLabelNumber as gt, deleteCommand as h, MIGRATION_LABEL_KEY as ht, removeUser as i, getWorkflow as it, logBetaWarning as j, getNextMigrationNumber as jt, generate as k, getMigrationFilePath as kt, restoreCommand as l, formatKeyValueTable as lt, getWorkspace as m, waitForExecution$1 as mt, updateUser as n, startWorkflow as nt, listUsers as o, getWorkflowExecution as ot, getCommand as p, executeScript as pt, triggerCommand as q, withCommonArgs as qt, removeCommand as r, getCommand$2 as rt, inviteCommand as s, listWorkflowExecutions as st, updateCommand as t, startCommand as tt, restoreWorkspace as u, getCommand$3 as ut, createWorkspace as v, DB_TYPES_FILE_NAME as vt, resumeWorkflow as w, compareSnapshots as wt, getAppHealth as x, MIGRATE_FILE_NAME as xt, listApps as y, DIFF_FILE_NAME as yt, getOAuth2Client as z, trnPrefix as zt };
|
|
11156
|
+
//# sourceMappingURL=update-9MTRN1UA.mjs.map
|