@superblocksteam/cli 2.0.1-next.0 → 2.0.1-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{generated-OEJDZY6Q.js → generated-B26UL5I4.js} +2 -2
- package/dist/index.js +280 -315
- package/oclif.manifest.json +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -293035,7 +293035,7 @@ init_cjs_shims();
|
|
|
293035
293035
|
init_cjs_shims();
|
|
293036
293036
|
var generated = {};
|
|
293037
293037
|
try {
|
|
293038
|
-
generated = await import("./generated-
|
|
293038
|
+
generated = await import("./generated-B26UL5I4.js");
|
|
293039
293039
|
} catch (_error) {
|
|
293040
293040
|
getLogger().warn("[ai-service] Generated markdown modules not found. Run `pnpm generate:markdown` first.");
|
|
293041
293041
|
}
|
|
@@ -308083,13 +308083,13 @@ var ComponentsManager = class _ComponentsManager extends EventEmitter6 {
|
|
|
308083
308083
|
init_cjs_shims();
|
|
308084
308084
|
var import_core3 = __toESM(require_lib33(), 1);
|
|
308085
308085
|
var import_types25 = __toESM(require_lib7(), 1);
|
|
308086
|
-
import
|
|
308086
|
+
import fs12 from "fs/promises";
|
|
308087
308087
|
import EventEmitter8 from "node:events";
|
|
308088
|
-
import
|
|
308088
|
+
import path26 from "node:path";
|
|
308089
308089
|
var import_shared29 = __toESM(require_dist2(), 1);
|
|
308090
308090
|
var import_util23 = __toESM(require_dist3(), 1);
|
|
308091
308091
|
init_lodash();
|
|
308092
|
-
var
|
|
308092
|
+
var import_yaml2 = __toESM(require_dist(), 1);
|
|
308093
308093
|
|
|
308094
308094
|
// ../../../vite-plugin-file-sync/dist/codegen.js
|
|
308095
308095
|
init_cjs_shims();
|
|
@@ -312537,112 +312537,6 @@ var SourceTracker = class {
|
|
|
312537
312537
|
};
|
|
312538
312538
|
};
|
|
312539
312539
|
|
|
312540
|
-
// ../../../vite-plugin-file-sync/dist/util.js
|
|
312541
|
-
init_cjs_shims();
|
|
312542
|
-
var import_yaml2 = __toESM(require_dist(), 1);
|
|
312543
|
-
import fs12 from "node:fs/promises";
|
|
312544
|
-
import path26 from "node:path";
|
|
312545
|
-
async function getAllPages({ rootDir }) {
|
|
312546
|
-
try {
|
|
312547
|
-
const routesJson = await fs12.readFile(path26.join(rootDir, "routes.json"), "utf8");
|
|
312548
|
-
const routes = JSON.parse(routesJson);
|
|
312549
|
-
const pages = await Promise.all(Object.entries(routes).map(async ([routePath, { file: pagePath }]) => {
|
|
312550
|
-
const contents = await fs12.readFile(path26.join(rootDir, "pages", pagePath), "utf8");
|
|
312551
|
-
return {
|
|
312552
|
-
name: pagePath.split("/")[0] ?? "page name not found",
|
|
312553
|
-
contents,
|
|
312554
|
-
route: routePath,
|
|
312555
|
-
fileName: path26.join(rootDir, "pages", pagePath)
|
|
312556
|
-
};
|
|
312557
|
-
}));
|
|
312558
|
-
return pages;
|
|
312559
|
-
} catch (e) {
|
|
312560
|
-
getLogger().error("Error getting pages path for route", getErrorMeta(e));
|
|
312561
|
-
return [];
|
|
312562
|
-
}
|
|
312563
|
-
}
|
|
312564
|
-
async function getAllApiDefinitions({ rootDir, currentUrl }) {
|
|
312565
|
-
const logger3 = getLogger();
|
|
312566
|
-
try {
|
|
312567
|
-
const routesJson = await fs12.readFile(path26.join(rootDir, "routes.json"), "utf8");
|
|
312568
|
-
const routes = JSON.parse(routesJson);
|
|
312569
|
-
const pathname = new URL(currentUrl).pathname;
|
|
312570
|
-
const fileName = Object.entries(routes).find(([path53]) => {
|
|
312571
|
-
const routeRegex = new RegExp("^" + path53.replaceAll(/:[^/]+/g, "([^/]+)") + "$");
|
|
312572
|
-
return routeRegex.test(pathname);
|
|
312573
|
-
})?.[1];
|
|
312574
|
-
if (!fileName) {
|
|
312575
|
-
throw new Error(`Route match not found for ${currentUrl}`);
|
|
312576
|
-
}
|
|
312577
|
-
const apisDir = path26.join(rootDir, "pages", path26.dirname(fileName), "apis");
|
|
312578
|
-
const objs = await fs12.readdir(apisDir);
|
|
312579
|
-
logger3.info(`objs ${JSON.stringify(objs)}`);
|
|
312580
|
-
const apiDefinitions = [];
|
|
312581
|
-
for (const obj of objs) {
|
|
312582
|
-
const stat4 = await fs12.stat(path26.join(apisDir, obj));
|
|
312583
|
-
if (stat4.isFile() && obj.endsWith(".yaml")) {
|
|
312584
|
-
const contents = await fs12.readFile(path26.join(apisDir, obj), "utf8");
|
|
312585
|
-
const yamlContents = await import_yaml2.default.parse(contents);
|
|
312586
|
-
const apiName = yamlContents.metadata.name;
|
|
312587
|
-
apiDefinitions.push({
|
|
312588
|
-
name: apiName,
|
|
312589
|
-
fileName: obj,
|
|
312590
|
-
contents: yamlContents
|
|
312591
|
-
});
|
|
312592
|
-
} else if (stat4.isDirectory()) {
|
|
312593
|
-
const apiYamlPath = path26.join(apisDir, obj, "api.yaml");
|
|
312594
|
-
const apiYamlStat = await fs12.stat(apiYamlPath);
|
|
312595
|
-
if (apiYamlStat.isFile()) {
|
|
312596
|
-
const contents = await fs12.readFile(apiYamlPath, "utf8");
|
|
312597
|
-
const yamlContents = await import_yaml2.default.parse(contents);
|
|
312598
|
-
const apiName = yamlContents.metadata.name;
|
|
312599
|
-
apiDefinitions.push({
|
|
312600
|
-
name: apiName,
|
|
312601
|
-
fileName: path26.join(apisDir, obj, "api.yaml"),
|
|
312602
|
-
contents: yamlContents
|
|
312603
|
-
});
|
|
312604
|
-
}
|
|
312605
|
-
}
|
|
312606
|
-
}
|
|
312607
|
-
return apiDefinitions;
|
|
312608
|
-
} catch (e) {
|
|
312609
|
-
logger3.error("Error getting api definitions", getErrorMeta(e));
|
|
312610
|
-
return [];
|
|
312611
|
-
}
|
|
312612
|
-
}
|
|
312613
|
-
var isValidApi = (api) => {
|
|
312614
|
-
const logger3 = getLogger();
|
|
312615
|
-
const isValidStep = (step) => {
|
|
312616
|
-
const isValidStep2 = !!step && step.integration && (step.integration !== "javascript" && step.integration !== "python" || step.integration === "javascript" && typeof step.javascript?.body === "string" || step.integration === "python" && typeof step.python?.body === "string");
|
|
312617
|
-
if (!isValidStep2) {
|
|
312618
|
-
logger3.warn(`API ${api.metadata.name} file incomplete: invalid step`);
|
|
312619
|
-
}
|
|
312620
|
-
return isValidStep2;
|
|
312621
|
-
};
|
|
312622
|
-
const isValidBlock = (block) => {
|
|
312623
|
-
const isValidBlock2 = !!block && block.name && isValidStep(block.step);
|
|
312624
|
-
if (!isValidBlock2) {
|
|
312625
|
-
logger3.warn(`API ${api.metadata.name} file incomplete: invalid block`);
|
|
312626
|
-
}
|
|
312627
|
-
return isValidBlock2;
|
|
312628
|
-
};
|
|
312629
|
-
const isValidMetadata = (metadata) => {
|
|
312630
|
-
const isValidMetadata2 = metadata.name && metadata.organization;
|
|
312631
|
-
if (!isValidMetadata2) {
|
|
312632
|
-
logger3.warn(`API ${api.metadata.name} file incomplete: invalid metadata`);
|
|
312633
|
-
}
|
|
312634
|
-
return isValidMetadata2;
|
|
312635
|
-
};
|
|
312636
|
-
const isValidTrigger = (trigger) => {
|
|
312637
|
-
const isValidTrigger2 = trigger && trigger.application && trigger.application.id;
|
|
312638
|
-
if (!isValidTrigger2) {
|
|
312639
|
-
logger3.warn(`API ${api.metadata.name} file incomplete: invalid trigger`);
|
|
312640
|
-
}
|
|
312641
|
-
return isValidTrigger2;
|
|
312642
|
-
};
|
|
312643
|
-
return api && isValidMetadata(api.metadata) && isValidTrigger(api.trigger) && (api.blocks?.length === 0 || api.blocks?.every(isValidBlock));
|
|
312644
|
-
};
|
|
312645
|
-
|
|
312646
312540
|
// ../../../vite-plugin-file-sync/dist/file-system-manager.js
|
|
312647
312541
|
var SUPPORTED_FILETYPES = [
|
|
312648
312542
|
{
|
|
@@ -312726,7 +312620,7 @@ var FileSyncManager = class extends EventEmitter8 {
|
|
|
312726
312620
|
if (!this.rootDir) {
|
|
312727
312621
|
throw new Error("Root directory not set");
|
|
312728
312622
|
}
|
|
312729
|
-
return
|
|
312623
|
+
return path26.join(this.rootDir, "App.tsx");
|
|
312730
312624
|
}
|
|
312731
312625
|
updateApi = (content2, path53) => {
|
|
312732
312626
|
if (!this.rootDir) {
|
|
@@ -312740,7 +312634,7 @@ var FileSyncManager = class extends EventEmitter8 {
|
|
|
312740
312634
|
scopeId = "";
|
|
312741
312635
|
}
|
|
312742
312636
|
const updatedApi = {
|
|
312743
|
-
apiPb:
|
|
312637
|
+
apiPb: import_yaml2.default.parse(JSON.stringify(apiContents)),
|
|
312744
312638
|
pageName,
|
|
312745
312639
|
stepPathMap,
|
|
312746
312640
|
scopeId
|
|
@@ -312753,11 +312647,11 @@ var FileSyncManager = class extends EventEmitter8 {
|
|
|
312753
312647
|
const logger3 = getLogger();
|
|
312754
312648
|
this.rootDir = rootPath;
|
|
312755
312649
|
this.watcher = watcher;
|
|
312756
|
-
const fileNames = await readFiles(
|
|
312650
|
+
const fileNames = await readFiles(path26.join(rootPath));
|
|
312757
312651
|
const tsxFiles = fileNames.filter((f) => f.endsWith(".tsx") && !f.includes(`${getLegacyComponentsFolder()}/`));
|
|
312758
312652
|
const yamlFiles = fileNames.filter((f) => f.endsWith(".yaml"));
|
|
312759
312653
|
const scopeFiles = fileNames.filter((f) => f.endsWith(SCOPE_FILE));
|
|
312760
|
-
const appThemeFile =
|
|
312654
|
+
const appThemeFile = path26.join(rootPath, APP_THEME_FILE_NAME);
|
|
312761
312655
|
logger3.info(`files to be scanned ${JSON.stringify(tsxFiles)}`);
|
|
312762
312656
|
logger3.info(`api files to be scanned ${JSON.stringify(yamlFiles)}`);
|
|
312763
312657
|
logger3.info(`app theme file to be scanned ${JSON.stringify(appThemeFile)}`);
|
|
@@ -312804,7 +312698,7 @@ var FileSyncManager = class extends EventEmitter8 {
|
|
|
312804
312698
|
this.tsFiles[path53] = content2;
|
|
312805
312699
|
}
|
|
312806
312700
|
});
|
|
312807
|
-
const routePath =
|
|
312701
|
+
const routePath = path26.join(rootPath, ROUTES_FILE);
|
|
312808
312702
|
const routeFile = await readFile6(routePath);
|
|
312809
312703
|
if (routeFile) {
|
|
312810
312704
|
try {
|
|
@@ -312965,11 +312859,11 @@ var FileSyncManager = class extends EventEmitter8 {
|
|
|
312965
312859
|
if (kind === "ts") {
|
|
312966
312860
|
this.tsFiles[path53] = content2;
|
|
312967
312861
|
await this.fsOperationQueue.enqueue(async () => {
|
|
312968
|
-
await
|
|
312862
|
+
await fs12.writeFile(path53, content2);
|
|
312969
312863
|
});
|
|
312970
312864
|
} else if (kind === "api") {
|
|
312971
312865
|
const currentApiFile = this.apiFiles[path53];
|
|
312972
|
-
const apiPb =
|
|
312866
|
+
const apiPb = import_yaml2.default.parse(content2);
|
|
312973
312867
|
if (apiPb.metadata.id) {
|
|
312974
312868
|
delete apiPb.metadata.id;
|
|
312975
312869
|
}
|
|
@@ -313135,7 +313029,7 @@ var FileSyncManager = class extends EventEmitter8 {
|
|
|
313135
313029
|
throw new Error("Root directory not set");
|
|
313136
313030
|
}
|
|
313137
313031
|
const pagePath = getPageFolder(this.rootDir, name18);
|
|
313138
|
-
const pageIndexPath =
|
|
313032
|
+
const pageIndexPath = path26.join(pagePath, "index.tsx");
|
|
313139
313033
|
const pageContent = (
|
|
313140
313034
|
/*js*/
|
|
313141
313035
|
`import { SbPage, SbContainer, registerPage } from "@superblocksteam/library";
|
|
@@ -313148,7 +313042,7 @@ function Page() {
|
|
|
313148
313042
|
export default registerPage(Page, { name: "${name18}" });
|
|
313149
313043
|
`
|
|
313150
313044
|
);
|
|
313151
|
-
await
|
|
313045
|
+
await fs12.mkdir(pagePath, { recursive: true });
|
|
313152
313046
|
await this.writeFile(pageIndexPath, pageContent, "ts");
|
|
313153
313047
|
await this.handleNonVisualChangeByDeletingIds(pageIndexPath, pageContent);
|
|
313154
313048
|
this.emit("addPage", pageIndexPath);
|
|
@@ -313290,18 +313184,18 @@ export default registerPage(Page, { name: "${name18}" });
|
|
|
313290
313184
|
if (!apiName) {
|
|
313291
313185
|
throw new Error("API name is not set");
|
|
313292
313186
|
}
|
|
313293
|
-
const apiDir =
|
|
313294
|
-
const apiPath =
|
|
313187
|
+
const apiDir = path26.join(this.rootDir, "pages", api.pageName, "apis", apiName);
|
|
313188
|
+
const apiPath = path26.join(apiDir, "api.yaml");
|
|
313295
313189
|
const isNewApi = !this.getApiFiles()[apiPath];
|
|
313296
313190
|
try {
|
|
313297
|
-
const stats = await
|
|
313191
|
+
const stats = await fs12.stat(apiDir);
|
|
313298
313192
|
if (!stats.isDirectory()) {
|
|
313299
|
-
await
|
|
313193
|
+
await fs12.mkdir(apiDir, { recursive: true });
|
|
313300
313194
|
}
|
|
313301
313195
|
} catch {
|
|
313302
|
-
await
|
|
313196
|
+
await fs12.mkdir(apiDir, { recursive: true });
|
|
313303
313197
|
}
|
|
313304
|
-
await this.writeFile(apiPath,
|
|
313198
|
+
await this.writeFile(apiPath, import_yaml2.default.stringify(api.apiPb), "api");
|
|
313305
313199
|
const generationNumber = this.generationNumberSequence.next();
|
|
313306
313200
|
const apiDef = this.createClientApi(api);
|
|
313307
313201
|
let scopeId = "";
|
|
@@ -313337,16 +313231,16 @@ export default registerPage(Page, { name: "${name18}" });
|
|
|
313337
313231
|
return new Promise(
|
|
313338
313232
|
// eslint-disable-next-line no-async-promise-executor
|
|
313339
313233
|
async (resolve8) => {
|
|
313340
|
-
const apiFilePath =
|
|
313234
|
+
const apiFilePath = path26.join(rootDir, "pages", pageName, "apis", apiName, "api.yaml");
|
|
313341
313235
|
const api = this.apiFiles[apiFilePath];
|
|
313342
313236
|
if (!api || !this.sourceTracker) {
|
|
313343
313237
|
return resolve8(void 0);
|
|
313344
313238
|
}
|
|
313345
|
-
const apiDir =
|
|
313239
|
+
const apiDir = path26.join(rootDir, "pages", pageName, "apis", apiName);
|
|
313346
313240
|
try {
|
|
313347
|
-
const stats = await
|
|
313241
|
+
const stats = await fs12.stat(apiDir);
|
|
313348
313242
|
if (stats.isDirectory()) {
|
|
313349
|
-
await
|
|
313243
|
+
await fs12.rmdir(apiDir, { recursive: true });
|
|
313350
313244
|
}
|
|
313351
313245
|
delete this.apiFiles[apiFilePath];
|
|
313352
313246
|
const scopeId = await this.sourceTracker.deleteApi({
|
|
@@ -313380,14 +313274,14 @@ export default registerPage(Page, { name: "${name18}" });
|
|
|
313380
313274
|
throw new Error("Root directory not set");
|
|
313381
313275
|
}
|
|
313382
313276
|
const pagePath = getPageFolder(this.rootDir, pageName);
|
|
313383
|
-
const existingApiFolder =
|
|
313384
|
-
const newApiFolder =
|
|
313277
|
+
const existingApiFolder = path26.join(this.rootDir, "pages", pageName, "apis", oldName);
|
|
313278
|
+
const newApiFolder = path26.join(this.rootDir, "pages", pageName, "apis", newName);
|
|
313385
313279
|
const files = this.sourceTracker?.getCurrentFiles();
|
|
313386
|
-
const file = files?.[
|
|
313280
|
+
const file = files?.[path26.join(pagePath, "index.tsx")];
|
|
313387
313281
|
if (!file || !file.ast) {
|
|
313388
313282
|
throw new Error(`Page ${pageName} not found`);
|
|
313389
313283
|
}
|
|
313390
|
-
const apiFilePath =
|
|
313284
|
+
const apiFilePath = path26.join(existingApiFolder, "api.yaml");
|
|
313391
313285
|
const apiDef = this.apiFiles[apiFilePath];
|
|
313392
313286
|
if (!apiDef) {
|
|
313393
313287
|
throw new Error(`API ${oldName} not found`);
|
|
@@ -313396,14 +313290,14 @@ export default registerPage(Page, { name: "${name18}" });
|
|
|
313396
313290
|
api: { apiPb: this.apiFiles[path53]?.apiPb },
|
|
313397
313291
|
filePath: path53
|
|
313398
313292
|
})).filter((api) => !!api.api));
|
|
313399
|
-
const newApiFolderExists = await
|
|
313293
|
+
const newApiFolderExists = await fs12.stat(newApiFolder).catch(() => false);
|
|
313400
313294
|
if (newApiFolderExists) {
|
|
313401
313295
|
throw new Error(`API ${newName} already exists`);
|
|
313402
313296
|
}
|
|
313403
313297
|
this.watcher?.unwatch(existingApiFolder);
|
|
313404
313298
|
this.watcher?.unwatch(newApiFolder);
|
|
313405
313299
|
apiDef.apiPb.metadata.name = newName;
|
|
313406
|
-
await
|
|
313300
|
+
await fs12.rename(existingApiFolder, newApiFolder);
|
|
313407
313301
|
const scopeDef = this.sourceTracker?.getScopeDefinitionForPage(pageName);
|
|
313408
313302
|
if (!scopeDef) {
|
|
313409
313303
|
throw new Error(`Scope definition not found for API`);
|
|
@@ -313414,7 +313308,7 @@ export default registerPage(Page, { name: "${name18}" });
|
|
|
313414
313308
|
entityId: scopeDef.scopeNameToEntityId[oldName]
|
|
313415
313309
|
});
|
|
313416
313310
|
delete this.apiFiles[apiFilePath];
|
|
313417
|
-
this.writeFile(
|
|
313311
|
+
this.writeFile(path26.join(newApiFolder, "api.yaml"), import_yaml2.default.stringify(apiDef.apiPb), "api");
|
|
313418
313312
|
this.watcher?.add(existingApiFolder);
|
|
313419
313313
|
this.watcher?.add(newApiFolder);
|
|
313420
313314
|
const changes = await this.sourceTracker?.getAndFlushChanges() ?? [];
|
|
@@ -313434,7 +313328,7 @@ export default registerPage(Page, { name: "${name18}" });
|
|
|
313434
313328
|
if (isEqual_default(api?.apiPb, this.apiFiles[filePath]?.apiPb)) {
|
|
313435
313329
|
return Promise.resolve();
|
|
313436
313330
|
}
|
|
313437
|
-
await this.writeFile(filePath,
|
|
313331
|
+
await this.writeFile(filePath, import_yaml2.default.stringify(api?.apiPb), "api");
|
|
313438
313332
|
this.emit("apiManualUpdate", {
|
|
313439
313333
|
api: this.createClientApi(api),
|
|
313440
313334
|
pageName,
|
|
@@ -313482,7 +313376,7 @@ export default registerPage(Page, { name: "${name18}" });
|
|
|
313482
313376
|
if (!this.rootDir) {
|
|
313483
313377
|
throw new Error("Root directory not set");
|
|
313484
313378
|
}
|
|
313485
|
-
const filePath =
|
|
313379
|
+
const filePath = path26.join(this.rootDir, APP_THEME_FILE_NAME);
|
|
313486
313380
|
await this.sourceTracker?.updateTheme({
|
|
313487
313381
|
themeFilePath: filePath,
|
|
313488
313382
|
theme
|
|
@@ -313537,8 +313431,8 @@ export default registerPage(Page, { name: "${name18}" });
|
|
|
313537
313431
|
throw new Error("Root directory not set");
|
|
313538
313432
|
}
|
|
313539
313433
|
const newPageFolder = getPageFolder(this.rootDir, newName);
|
|
313540
|
-
const newIndexFilePath =
|
|
313541
|
-
const oldIndexFilePath =
|
|
313434
|
+
const newIndexFilePath = path26.join(newPageFolder, "index.tsx");
|
|
313435
|
+
const oldIndexFilePath = path26.join(this.rootDir, "pages", oldName, "index.tsx");
|
|
313542
313436
|
const oldPageFolder = getPageFolder(this.rootDir, oldName);
|
|
313543
313437
|
this.watcher?.unwatch(newPageFolder);
|
|
313544
313438
|
this.watcher?.unwatch(oldPageFolder);
|
|
@@ -313552,7 +313446,7 @@ export default registerPage(Page, { name: "${name18}" });
|
|
|
313552
313446
|
});
|
|
313553
313447
|
const changes = await this.sourceTracker?.getAndFlushChanges() ?? [];
|
|
313554
313448
|
await this.writeChanges(changes);
|
|
313555
|
-
await
|
|
313449
|
+
await fs12.rename(oldPageFolder, newPageFolder);
|
|
313556
313450
|
await this.removeRoute(oldIndexFilePath);
|
|
313557
313451
|
await this.addRoute(existingRoute, newIndexFilePath);
|
|
313558
313452
|
const newIndexFile = await readFile6(newIndexFilePath);
|
|
@@ -313566,7 +313460,7 @@ export default registerPage(Page, { name: "${name18}" });
|
|
|
313566
313460
|
this.watcher?.add(oldPageFolder);
|
|
313567
313461
|
};
|
|
313568
313462
|
getPageRoots(filePath) {
|
|
313569
|
-
const scopeFilePath =
|
|
313463
|
+
const scopeFilePath = path26.join(path26.dirname(filePath), "index.tsx");
|
|
313570
313464
|
const currentFile = this.sourceTracker?.getCurrentFiles()[scopeFilePath];
|
|
313571
313465
|
if (!currentFile) {
|
|
313572
313466
|
return null;
|
|
@@ -313574,7 +313468,7 @@ export default registerPage(Page, { name: "${name18}" });
|
|
|
313574
313468
|
return getPageRoots(filePath, currentFile);
|
|
313575
313469
|
}
|
|
313576
313470
|
getScope(filePath) {
|
|
313577
|
-
const scopeFilePath =
|
|
313471
|
+
const scopeFilePath = path26.join(path26.dirname(filePath), SCOPE_FILE);
|
|
313578
313472
|
const currentFile = this.sourceTracker?.getCurrentFiles()[scopeFilePath];
|
|
313579
313473
|
if (!currentFile) {
|
|
313580
313474
|
console.log("File not found", scopeFilePath);
|
|
@@ -313598,7 +313492,7 @@ export default registerPage(Page, { name: "${name18}" });
|
|
|
313598
313492
|
throw new Error("Root directory not set");
|
|
313599
313493
|
}
|
|
313600
313494
|
this.routes[route] = { file: this.getRelativeRoutePath(filePath) };
|
|
313601
|
-
await this.writeFile(
|
|
313495
|
+
await this.writeFile(path26.join(this.rootDir, ROUTES_FILE), JSON.stringify(this.routes, null, 2));
|
|
313602
313496
|
}
|
|
313603
313497
|
async removeRoute(filePath) {
|
|
313604
313498
|
if (!this.rootDir) {
|
|
@@ -313606,7 +313500,7 @@ export default registerPage(Page, { name: "${name18}" });
|
|
|
313606
313500
|
}
|
|
313607
313501
|
const relativeFilePath = this.getRelativeRoutePath(filePath);
|
|
313608
313502
|
this.routes = Object.fromEntries(Object.entries(this.routes).filter(([_, value2]) => value2.file !== relativeFilePath));
|
|
313609
|
-
await this.writeFile(
|
|
313503
|
+
await this.writeFile(path26.join(this.rootDir, ROUTES_FILE), JSON.stringify(this.routes, null, 2));
|
|
313610
313504
|
}
|
|
313611
313505
|
async writeChanges(changes, callback) {
|
|
313612
313506
|
return Promise.all(changes.map(async ({ fileName, source: source2, kind }) => {
|
|
@@ -313636,7 +313530,7 @@ export default registerPage(Page, { name: "${name18}" });
|
|
|
313636
313530
|
if (isEqual_default(api?.apiPb, this.apiFiles[filePath]?.apiPb)) {
|
|
313637
313531
|
return Promise.resolve();
|
|
313638
313532
|
}
|
|
313639
|
-
return this.writeFile(filePath,
|
|
313533
|
+
return this.writeFile(filePath, import_yaml2.default.stringify(api?.apiPb), "api");
|
|
313640
313534
|
}));
|
|
313641
313535
|
};
|
|
313642
313536
|
getApisInScope = (elementId) => {
|
|
@@ -313644,14 +313538,14 @@ export default registerPage(Page, { name: "${name18}" });
|
|
|
313644
313538
|
if (!filePath) {
|
|
313645
313539
|
return [];
|
|
313646
313540
|
}
|
|
313647
|
-
const pagePath =
|
|
313541
|
+
const pagePath = path26.dirname(filePath);
|
|
313648
313542
|
return Object.entries(this.apiFiles).filter(([filePath2]) => filePath2.includes(pagePath)).map(([filePath2, api]) => ({ api, filePath: filePath2 }));
|
|
313649
313543
|
};
|
|
313650
313544
|
getRelativeRoutePath(filePath) {
|
|
313651
313545
|
if (!this.rootDir) {
|
|
313652
313546
|
throw new Error("Root directory not set");
|
|
313653
313547
|
}
|
|
313654
|
-
return
|
|
313548
|
+
return path26.relative(path26.join(this.rootDir, PAGES_DIRECTORY), filePath);
|
|
313655
313549
|
}
|
|
313656
313550
|
// Utilities for converting server API format to Client API format
|
|
313657
313551
|
// We internally save the API as the server does, but we return should always return it
|
|
@@ -313684,15 +313578,12 @@ export default registerPage(Page, { name: "${name18}" });
|
|
|
313684
313578
|
let yamlPath = filePath;
|
|
313685
313579
|
if (fileType.type === "python-api-step" || fileType.type === "js-api-step") {
|
|
313686
313580
|
const apiFolderPath = filePath.split("/").slice(0, -1).join("/");
|
|
313687
|
-
yamlPath =
|
|
313581
|
+
yamlPath = path26.join(apiFolderPath, "api.yaml");
|
|
313688
313582
|
}
|
|
313689
313583
|
const logger3 = getLogger();
|
|
313690
313584
|
try {
|
|
313691
313585
|
const apiContent = await getMergedApiContent(yamlPath);
|
|
313692
313586
|
logger3.info(`API content read successfully: ${yamlPath}`);
|
|
313693
|
-
if (!isValidApi(apiContent.api)) {
|
|
313694
|
-
return;
|
|
313695
|
-
}
|
|
313696
313587
|
if (!apiContent) {
|
|
313697
313588
|
return;
|
|
313698
313589
|
}
|
|
@@ -313727,7 +313618,7 @@ export default registerPage(Page, { name: "${name18}" });
|
|
|
313727
313618
|
};
|
|
313728
313619
|
async function readFile6(path53) {
|
|
313729
313620
|
try {
|
|
313730
|
-
const content2 = await
|
|
313621
|
+
const content2 = await fs12.readFile(path53, "utf-8");
|
|
313731
313622
|
return content2;
|
|
313732
313623
|
} catch (e) {
|
|
313733
313624
|
getLogger().error(`error reading file: ${path53}`, getErrorMeta(e));
|
|
@@ -313735,7 +313626,7 @@ async function readFile6(path53) {
|
|
|
313735
313626
|
}
|
|
313736
313627
|
}
|
|
313737
313628
|
async function readFiles(dir) {
|
|
313738
|
-
return await glob2(
|
|
313629
|
+
return await glob2(path26.join(dir, "**/*.{tsx,yaml,ts}"), {
|
|
313739
313630
|
ignore: [
|
|
313740
313631
|
"node_modules/**",
|
|
313741
313632
|
"dist/**",
|
|
@@ -314124,6 +314015,80 @@ var GenerationNumberSequence = class {
|
|
|
314124
314015
|
}
|
|
314125
314016
|
};
|
|
314126
314017
|
|
|
314018
|
+
// ../../../vite-plugin-file-sync/dist/util.js
|
|
314019
|
+
init_cjs_shims();
|
|
314020
|
+
var import_yaml3 = __toESM(require_dist(), 1);
|
|
314021
|
+
import fs13 from "node:fs/promises";
|
|
314022
|
+
import path27 from "node:path";
|
|
314023
|
+
async function getAllPages({ rootDir }) {
|
|
314024
|
+
try {
|
|
314025
|
+
const routesJson = await fs13.readFile(path27.join(rootDir, "routes.json"), "utf8");
|
|
314026
|
+
const routes = JSON.parse(routesJson);
|
|
314027
|
+
const pages = await Promise.all(Object.entries(routes).map(async ([routePath, { file: pagePath }]) => {
|
|
314028
|
+
const contents = await fs13.readFile(path27.join(rootDir, "pages", pagePath), "utf8");
|
|
314029
|
+
return {
|
|
314030
|
+
name: pagePath.split("/")[0] ?? "page name not found",
|
|
314031
|
+
contents,
|
|
314032
|
+
route: routePath,
|
|
314033
|
+
fileName: path27.join(rootDir, "pages", pagePath)
|
|
314034
|
+
};
|
|
314035
|
+
}));
|
|
314036
|
+
return pages;
|
|
314037
|
+
} catch (e) {
|
|
314038
|
+
getLogger().error("Error getting pages path for route", getErrorMeta(e));
|
|
314039
|
+
return [];
|
|
314040
|
+
}
|
|
314041
|
+
}
|
|
314042
|
+
async function getAllApiDefinitions({ rootDir, currentUrl }) {
|
|
314043
|
+
const logger3 = getLogger();
|
|
314044
|
+
try {
|
|
314045
|
+
const routesJson = await fs13.readFile(path27.join(rootDir, "routes.json"), "utf8");
|
|
314046
|
+
const routes = JSON.parse(routesJson);
|
|
314047
|
+
const pathname = new URL(currentUrl).pathname;
|
|
314048
|
+
const fileName = Object.entries(routes).find(([path53]) => {
|
|
314049
|
+
const routeRegex = new RegExp("^" + path53.replaceAll(/:[^/]+/g, "([^/]+)") + "$");
|
|
314050
|
+
return routeRegex.test(pathname);
|
|
314051
|
+
})?.[1];
|
|
314052
|
+
if (!fileName) {
|
|
314053
|
+
throw new Error(`Route match not found for ${currentUrl}`);
|
|
314054
|
+
}
|
|
314055
|
+
const apisDir = path27.join(rootDir, "pages", path27.dirname(fileName), "apis");
|
|
314056
|
+
const objs = await fs13.readdir(apisDir);
|
|
314057
|
+
logger3.info(`objs ${JSON.stringify(objs)}`);
|
|
314058
|
+
const apiDefinitions = [];
|
|
314059
|
+
for (const obj of objs) {
|
|
314060
|
+
const stat4 = await fs13.stat(path27.join(apisDir, obj));
|
|
314061
|
+
if (stat4.isFile() && obj.endsWith(".yaml")) {
|
|
314062
|
+
const contents = await fs13.readFile(path27.join(apisDir, obj), "utf8");
|
|
314063
|
+
const yamlContents = await import_yaml3.default.parse(contents);
|
|
314064
|
+
const apiName = yamlContents.metadata.name;
|
|
314065
|
+
apiDefinitions.push({
|
|
314066
|
+
name: apiName,
|
|
314067
|
+
fileName: obj,
|
|
314068
|
+
contents: yamlContents
|
|
314069
|
+
});
|
|
314070
|
+
} else if (stat4.isDirectory()) {
|
|
314071
|
+
const apiYamlPath = path27.join(apisDir, obj, "api.yaml");
|
|
314072
|
+
const apiYamlStat = await fs13.stat(apiYamlPath);
|
|
314073
|
+
if (apiYamlStat.isFile()) {
|
|
314074
|
+
const contents = await fs13.readFile(apiYamlPath, "utf8");
|
|
314075
|
+
const yamlContents = await import_yaml3.default.parse(contents);
|
|
314076
|
+
const apiName = yamlContents.metadata.name;
|
|
314077
|
+
apiDefinitions.push({
|
|
314078
|
+
name: apiName,
|
|
314079
|
+
fileName: path27.join(apisDir, obj, "api.yaml"),
|
|
314080
|
+
contents: yamlContents
|
|
314081
|
+
});
|
|
314082
|
+
}
|
|
314083
|
+
}
|
|
314084
|
+
}
|
|
314085
|
+
return apiDefinitions;
|
|
314086
|
+
} catch (e) {
|
|
314087
|
+
logger3.error("Error getting api definitions", getErrorMeta(e));
|
|
314088
|
+
return [];
|
|
314089
|
+
}
|
|
314090
|
+
}
|
|
314091
|
+
|
|
314127
314092
|
// ../../../vite-plugin-file-sync/dist/file-sync-vite-plugin.js
|
|
314128
314093
|
var hasStarted = false;
|
|
314129
314094
|
var isInitialized = false;
|
|
@@ -314943,7 +314908,7 @@ async function buildWithVite({ root: root2, dest: dest4, mode, libraryUrl, asset
|
|
|
314943
314908
|
init_cjs_shims();
|
|
314944
314909
|
var import_bucketeer_sdk = __toESM(require_dist5(), 1);
|
|
314945
314910
|
var import_shared33 = __toESM(require_dist2(), 1);
|
|
314946
|
-
var
|
|
314911
|
+
var import_util29 = __toESM(require_dist3(), 1);
|
|
314947
314912
|
import * as fs16 from "node:fs";
|
|
314948
314913
|
import path31 from "node:path";
|
|
314949
314914
|
|
|
@@ -318369,7 +318334,7 @@ var ValidateGitSetupError = class extends Error {
|
|
|
318369
318334
|
|
|
318370
318335
|
// ../sdk/dist/flag.js
|
|
318371
318336
|
init_cjs_shims();
|
|
318372
|
-
var
|
|
318337
|
+
var import_util27 = __toESM(require_dist3(), 1);
|
|
318373
318338
|
var signingEnabled = (flags) => {
|
|
318374
318339
|
return flags["ui.enable-resource-signing"] ?? false;
|
|
318375
318340
|
};
|
|
@@ -318388,7 +318353,7 @@ var FeatureFlags = class {
|
|
|
318388
318353
|
return this.flags["superblocks.git.split.large.steps.new.enabled"] ?? false;
|
|
318389
318354
|
}
|
|
318390
318355
|
linesForLargeSteps() {
|
|
318391
|
-
return this.flags["superblocks.git.split.large.step.lines"] ??
|
|
318356
|
+
return this.flags["superblocks.git.split.large.step.lines"] ?? import_util27.DEFAULT_LINES_FOR_LARGE_STEPS;
|
|
318392
318357
|
}
|
|
318393
318358
|
};
|
|
318394
318359
|
|
|
@@ -318406,12 +318371,12 @@ var import_instrumentation_http = __toESM(require_src16(), 1);
|
|
|
318406
318371
|
var import_resources = __toESM(require_src17(), 1);
|
|
318407
318372
|
var import_sdk_node = __toESM(require_src34(), 1);
|
|
318408
318373
|
init_esm();
|
|
318409
|
-
var
|
|
318374
|
+
var import_util28 = __toESM(require_dist3(), 1);
|
|
318410
318375
|
|
|
318411
318376
|
// ../sdk/package.json
|
|
318412
318377
|
var package_default = {
|
|
318413
318378
|
name: "@superblocksteam/sdk",
|
|
318414
|
-
version: "2.0.1-next.
|
|
318379
|
+
version: "2.0.1-next.1",
|
|
318415
318380
|
type: "module",
|
|
318416
318381
|
description: "Superblocks JS SDK",
|
|
318417
318382
|
homepage: "https://www.superblocks.com",
|
|
@@ -318453,8 +318418,8 @@ var package_default = {
|
|
|
318453
318418
|
"@rollup/wasm-node": "^4.35.0",
|
|
318454
318419
|
"@superblocksteam/bucketeer-sdk": "0.5.0",
|
|
318455
318420
|
"@superblocksteam/shared": "0.9160.0",
|
|
318456
|
-
"@superblocksteam/util": "2.0.1-next.
|
|
318457
|
-
"@superblocksteam/vite-plugin-file-sync": "2.0.1-next.
|
|
318421
|
+
"@superblocksteam/util": "2.0.1-next.1",
|
|
318422
|
+
"@superblocksteam/vite-plugin-file-sync": "2.0.1-next.1",
|
|
318458
318423
|
"@vitejs/plugin-react": "^4.3.4",
|
|
318459
318424
|
axios: "^1.4.0",
|
|
318460
318425
|
chokidar: "^4.0.3",
|
|
@@ -318531,7 +318496,7 @@ var ATTR_SUPERBLOCKS_BASE_URL = "superblocks.base_url";
|
|
|
318531
318496
|
var superblocksTracesUrl = void 0;
|
|
318532
318497
|
var superblocksHostname = "unknown";
|
|
318533
318498
|
try {
|
|
318534
|
-
const tokenWithUrl = await (0,
|
|
318499
|
+
const tokenWithUrl = await (0, import_util28.getLocalTokenWithUrl)();
|
|
318535
318500
|
const superblocksBaseUrl = new URL(tokenWithUrl.superblocksBaseUrl);
|
|
318536
318501
|
superblocksTracesUrl = superblocksBaseUrl.origin + "/api/v1/traces";
|
|
318537
318502
|
superblocksHostname = superblocksBaseUrl.hostname;
|
|
@@ -318913,7 +318878,7 @@ async function fetchApplication({ cliVersion, applicationId, branch, token: toke
|
|
|
318913
318878
|
return data;
|
|
318914
318879
|
} catch (e) {
|
|
318915
318880
|
if (axios_default.isAxiosError(e) && e.response?.status === 404) {
|
|
318916
|
-
throw new
|
|
318881
|
+
throw new import_util29.NotFoundError(`Application ${applicationId} was not found`);
|
|
318917
318882
|
}
|
|
318918
318883
|
throw new Error(`Could not fetch application: ${typeof e === "object" && e && "message" in e ? e.message : e}`);
|
|
318919
318884
|
}
|
|
@@ -318934,7 +318899,7 @@ async function fetchApplicationBranches({ cliVersion, applicationId, token: toke
|
|
|
318934
318899
|
serverResponse = await axios_default(config2);
|
|
318935
318900
|
} catch (e) {
|
|
318936
318901
|
if (axios_default.isAxiosError(e) && e.response?.status === 404) {
|
|
318937
|
-
throw new
|
|
318902
|
+
throw new import_util29.NotFoundError(`Application ${applicationId} was not found`);
|
|
318938
318903
|
}
|
|
318939
318904
|
throw new Error(`Could not fetch application branches: ${e.message}`);
|
|
318940
318905
|
}
|
|
@@ -318981,7 +318946,7 @@ async function fetchApplicationWithComponentsFromBucketeer({ applicationWrapper,
|
|
|
318981
318946
|
};
|
|
318982
318947
|
}
|
|
318983
318948
|
superblocksBaseUrl = superblocksBaseUrl.replace(/\/$/, "");
|
|
318984
|
-
const bucketeerBaseUrl = (0,
|
|
318949
|
+
const bucketeerBaseUrl = (0, import_util29.getBucketeerUrlFromSuperblocksUrl)(superblocksBaseUrl);
|
|
318985
318950
|
const branchPath = branch ? `/branches/${encodeURIComponent(branch)}` : "";
|
|
318986
318951
|
const componentFileURL = new URL(`${BASE_BUCKETEER_URL}/v1/components/${applicationId}${branchPath}?commit=${commitId}&viewMode=${viewMode}&multiPage=true`, bucketeerBaseUrl).toString();
|
|
318987
318952
|
try {
|
|
@@ -319001,7 +318966,7 @@ async function fetchApplicationWithComponentsFromBucketeer({ applicationWrapper,
|
|
|
319001
318966
|
return bucketeerApp;
|
|
319002
318967
|
} catch (e) {
|
|
319003
318968
|
if (axios_default.isAxiosError(e) && e.response?.status === 404) {
|
|
319004
|
-
throw new
|
|
318969
|
+
throw new import_util29.NotFoundError(`Application ${applicationId} was not found`);
|
|
319005
318970
|
}
|
|
319006
318971
|
throw new Error("Could not fetch application");
|
|
319007
318972
|
}
|
|
@@ -319062,7 +319027,7 @@ async function fetchApi(cliVersion, apiId, token2, superblocksBaseUrl, viewMode,
|
|
|
319062
319027
|
}
|
|
319063
319028
|
} catch (e) {
|
|
319064
319029
|
if (axios_default.isAxiosError(e) && e.response?.status === 404) {
|
|
319065
|
-
throw new
|
|
319030
|
+
throw new import_util29.NotFoundError(`Api ${apiId} was not found`);
|
|
319066
319031
|
}
|
|
319067
319032
|
throw new Error(`Could not fetch api: ${typeof e === "object" && e && "message" in e ? e.message : e}`);
|
|
319068
319033
|
}
|
|
@@ -319101,7 +319066,7 @@ async function validateGitSetup(cliVersion, resourceId, resourceType, event, loc
|
|
|
319101
319066
|
break;
|
|
319102
319067
|
}
|
|
319103
319068
|
default:
|
|
319104
|
-
(0,
|
|
319069
|
+
(0, import_util29.unreachable)(resourceType);
|
|
319105
319070
|
}
|
|
319106
319071
|
const config2 = {
|
|
319107
319072
|
method: "post",
|
|
@@ -319148,7 +319113,7 @@ async function registerComponents(cliVersion, applicationId, componentConfigs, t
|
|
|
319148
319113
|
applicationId,
|
|
319149
319114
|
branchName: branch || "",
|
|
319150
319115
|
cliVersion,
|
|
319151
|
-
componentEvent: injectedHeaders[
|
|
319116
|
+
componentEvent: injectedHeaders[import_util29.COMPONENT_EVENT_HEADER],
|
|
319152
319117
|
components: componentConfigs
|
|
319153
319118
|
});
|
|
319154
319119
|
socket.close();
|
|
@@ -319177,9 +319142,9 @@ async function registerComponents(cliVersion, applicationId, componentConfigs, t
|
|
|
319177
319142
|
}
|
|
319178
319143
|
async function uploadComponents({ cliVersion, applicationId, componentConfigs, files, token: token2, superblocksBaseUrl, branch }) {
|
|
319179
319144
|
superblocksBaseUrl = superblocksBaseUrl.replace(/\/$/, "");
|
|
319180
|
-
const bucketeerBaseUrl = (0,
|
|
319145
|
+
const bucketeerBaseUrl = (0, import_util29.getBucketeerUrlFromSuperblocksUrl)(superblocksBaseUrl);
|
|
319181
319146
|
const uploadFiles = files.map((file, ind) => {
|
|
319182
|
-
let contentType = (0,
|
|
319147
|
+
let contentType = (0, import_util29.getContentType)(file);
|
|
319183
319148
|
if (contentType.length === 0) {
|
|
319184
319149
|
contentType = "application/octet-stream";
|
|
319185
319150
|
}
|
|
@@ -319222,7 +319187,7 @@ You can reduce your component bundle size by uploading static assets to a separa
|
|
|
319222
319187
|
headers: {
|
|
319223
319188
|
Authorization: "Bearer " + token2,
|
|
319224
319189
|
[CLI_VERSION_HEADER]: cliVersion,
|
|
319225
|
-
[
|
|
319190
|
+
[import_util29.COMPONENT_EVENT_HEADER]: import_util29.ComponentEvent.UPLOAD,
|
|
319226
319191
|
[SUPERBLOCKS_URL_HEADER]: superblocksBaseUrl,
|
|
319227
319192
|
...formHeaders
|
|
319228
319193
|
}
|
|
@@ -319274,7 +319239,7 @@ async function fetchCurrentUser(cliVersion, token2, superblocksBaseUrl) {
|
|
|
319274
319239
|
headers: {
|
|
319275
319240
|
Authorization: "Bearer " + token2,
|
|
319276
319241
|
[CLI_VERSION_HEADER]: cliVersion,
|
|
319277
|
-
[
|
|
319242
|
+
[import_util29.COMPONENT_EVENT_HEADER]: import_util29.ComponentEvent.LOGIN
|
|
319278
319243
|
}
|
|
319279
319244
|
};
|
|
319280
319245
|
const response = await axios_default(config2);
|
|
@@ -319441,7 +319406,7 @@ async function fetchApplicationCommits({ cliVersion, applicationId, branch, toke
|
|
|
319441
319406
|
return serverResponse?.data?.data;
|
|
319442
319407
|
} catch (e) {
|
|
319443
319408
|
if (axios_default.isAxiosError(e) && e.response?.status === 404) {
|
|
319444
|
-
throw new
|
|
319409
|
+
throw new import_util29.NotFoundError(`Application ${applicationId} was not found`);
|
|
319445
319410
|
}
|
|
319446
319411
|
throw new Error("Could not fetch application");
|
|
319447
319412
|
}
|
|
@@ -319467,7 +319432,7 @@ async function fetchApiCommits({ cliVersion, applicationId, branch, token: token
|
|
|
319467
319432
|
return serverResponse?.data?.data;
|
|
319468
319433
|
} catch (e) {
|
|
319469
319434
|
if (axios_default.isAxiosError(e) && e.response?.status === 404) {
|
|
319470
|
-
throw new
|
|
319435
|
+
throw new import_util29.NotFoundError(`Application ${applicationId} was not found`);
|
|
319471
319436
|
}
|
|
319472
319437
|
throw new Error("Could not fetch application");
|
|
319473
319438
|
}
|
|
@@ -319505,11 +319470,11 @@ async function deployResource(cliVersion, resourceType, resourceId, token2, supe
|
|
|
319505
319470
|
let message;
|
|
319506
319471
|
if (axios_default.isAxiosError(e)) {
|
|
319507
319472
|
if (e.response?.status === 404) {
|
|
319508
|
-
throw new
|
|
319473
|
+
throw new import_util29.NotFoundError(`${e.response?.data?.responseMeta?.message}`);
|
|
319509
319474
|
} else if (e.response?.status === 403) {
|
|
319510
|
-
throw new
|
|
319475
|
+
throw new import_util29.ForbiddenError(`${e.response?.data?.responseMeta?.message}`);
|
|
319511
319476
|
} else if (e.response?.status === 400) {
|
|
319512
|
-
throw new
|
|
319477
|
+
throw new import_util29.BadRequestError(`${e.response?.data?.responseMeta?.message}`);
|
|
319513
319478
|
} else {
|
|
319514
319479
|
message = e.response?.data?.responseMeta?.message ?? JSON.stringify(e.response?.data) ?? e.response?.statusText;
|
|
319515
319480
|
throw new Error(`${message}`);
|
|
@@ -319542,12 +319507,12 @@ var import_shared35 = __toESM(require_dist2(), 1);
|
|
|
319542
319507
|
|
|
319543
319508
|
// ../sdk/dist/dbfs/client.js
|
|
319544
319509
|
init_cjs_shims();
|
|
319545
|
-
var
|
|
319510
|
+
var import_util31 = __toESM(require_dist3(), 1);
|
|
319546
319511
|
|
|
319547
319512
|
// ../sdk/dist/dbfs/local.js
|
|
319548
319513
|
init_cjs_shims();
|
|
319549
319514
|
var import_shared34 = __toESM(require_dist2(), 1);
|
|
319550
|
-
var
|
|
319515
|
+
var import_util30 = __toESM(require_dist3(), 1);
|
|
319551
319516
|
import * as fsp4 from "node:fs/promises";
|
|
319552
319517
|
async function doDownloadDirectoryToLocal(rpcClient, directoryHash, localDirectoryPath) {
|
|
319553
319518
|
await fsp4.mkdir(localDirectoryPath, { recursive: true });
|
|
@@ -319579,7 +319544,7 @@ async function doDownloadDirectoryToLocalRec(rpcClient, directoryHash, localDire
|
|
|
319579
319544
|
break;
|
|
319580
319545
|
}
|
|
319581
319546
|
default: {
|
|
319582
|
-
(0,
|
|
319547
|
+
(0, import_util30.unreachable)(entry);
|
|
319583
319548
|
}
|
|
319584
319549
|
}
|
|
319585
319550
|
}
|
|
@@ -319619,7 +319584,7 @@ async function hashLocalDirectory2(localDirectoryPath) {
|
|
|
319619
319584
|
break;
|
|
319620
319585
|
}
|
|
319621
319586
|
default:
|
|
319622
|
-
(0,
|
|
319587
|
+
(0, import_util30.unreachable)(localDirEntry);
|
|
319623
319588
|
}
|
|
319624
319589
|
directoryContents.push(entry);
|
|
319625
319590
|
}
|
|
@@ -319651,7 +319616,7 @@ async function doUploadLocalDirectory(rpcClient, localDirectoryPath) {
|
|
|
319651
319616
|
name: localDirEntry.name
|
|
319652
319617
|
};
|
|
319653
319618
|
} else {
|
|
319654
|
-
(0,
|
|
319619
|
+
(0, import_util30.unreachable)(localDirEntry);
|
|
319655
319620
|
}
|
|
319656
319621
|
directoryContents.push(entry);
|
|
319657
319622
|
}
|
|
@@ -319741,7 +319706,7 @@ async function printDirectoryEntries(token2, superblocksBaseUrl, directoryHash)
|
|
|
319741
319706
|
break;
|
|
319742
319707
|
}
|
|
319743
319708
|
default: {
|
|
319744
|
-
(0,
|
|
319709
|
+
(0, import_util31.unreachable)(entry);
|
|
319745
319710
|
}
|
|
319746
319711
|
}
|
|
319747
319712
|
console.log(`${entry.type}${executable ? "x" : " "} ${hash2} ${entry.name}${target ? ` -> ${target}` : ""}`);
|
|
@@ -319921,7 +319886,7 @@ var SuperblocksSdk = class {
|
|
|
319921
319886
|
// ../sdk/dist/version-control.mjs
|
|
319922
319887
|
init_cjs_shims();
|
|
319923
319888
|
var import_shared36 = __toESM(require_dist2(), 1);
|
|
319924
|
-
var
|
|
319889
|
+
var import_util32 = __toESM(require_dist3(), 1);
|
|
319925
319890
|
import * as https2 from "https";
|
|
319926
319891
|
import path33 from "node:path";
|
|
319927
319892
|
import { dirname as dirname8 } from "path";
|
|
@@ -324522,7 +324487,7 @@ var DEFAULT_FILE_VERSION = "0.1.0";
|
|
|
324522
324487
|
var SPLIT_LARGE_API_STEPS_VERSION = "0.2.0";
|
|
324523
324488
|
var LATEST_FILE_VERSION = SPLIT_LARGE_API_STEPS_VERSION;
|
|
324524
324489
|
function getApiRepresentation(featureFlags, resourceConfig) {
|
|
324525
|
-
const linesForLargeSteps = featureFlags.linesForLargeSteps() ??
|
|
324490
|
+
const linesForLargeSteps = featureFlags.linesForLargeSteps() ?? import_util32.DEFAULT_LINES_FOR_LARGE_STEPS;
|
|
324526
324491
|
if (featureFlags.splitLargeApiStepsEnabled() && isPostSplitLargeApiSteps(resourceConfig)) {
|
|
324527
324492
|
return {
|
|
324528
324493
|
extractLargeSourceFiles: true,
|
|
@@ -324589,10 +324554,10 @@ function getFileStructureTypeFromResourceConfig(superblocksConfig) {
|
|
|
324589
324554
|
}
|
|
324590
324555
|
async function getFileStructureType(rootPath, existingRelativeLocation) {
|
|
324591
324556
|
try {
|
|
324592
|
-
const superblocksConfig = await (0,
|
|
324557
|
+
const superblocksConfig = await (0, import_util32.getSuperblocksApplicationConfigJson)(`${rootPath}/${existingRelativeLocation}`);
|
|
324593
324558
|
return getFileStructureTypeFromResourceConfig(superblocksConfig);
|
|
324594
324559
|
} catch {
|
|
324595
|
-
await (0,
|
|
324560
|
+
await (0, import_util32.getSuperblocksApplicationV2ConfigJson)(`${rootPath}/${existingRelativeLocation}`);
|
|
324596
324561
|
return FileStructureType.MULTI_PAGE;
|
|
324597
324562
|
}
|
|
324598
324563
|
}
|
|
@@ -324604,7 +324569,7 @@ async function readApplicationFromDisk(rootPath, existingRelativeLocation) {
|
|
|
324604
324569
|
if (await import_fs_extra4.default.pathExists(apisDirName)) {
|
|
324605
324570
|
const apiFiles = await import_fs_extra4.default.readdir(apisDirName);
|
|
324606
324571
|
for (const apiFile of apiFiles) {
|
|
324607
|
-
const { api: apiContent } = await (0,
|
|
324572
|
+
const { api: apiContent } = await (0, import_util32.readAppApiYamlFile)(apisDirName, apiFile);
|
|
324608
324573
|
apis.push({
|
|
324609
324574
|
id: apiContent.metadata.id,
|
|
324610
324575
|
apiPb: apiContent
|
|
@@ -324618,7 +324583,7 @@ async function readApplicationFromDisk(rootPath, existingRelativeLocation) {
|
|
|
324618
324583
|
};
|
|
324619
324584
|
}
|
|
324620
324585
|
async function readMultiPageApplicationFromDisk(rootPath, existingRelativeLocation) {
|
|
324621
|
-
const superblocksApplicationConfig = await (0,
|
|
324586
|
+
const superblocksApplicationConfig = await (0, import_util32.getSuperblocksApplicationConfigJson)(`${rootPath}/${existingRelativeLocation}`);
|
|
324622
324587
|
const application = await readYamlFile(`${rootPath}/${existingRelativeLocation}/application.yaml`);
|
|
324623
324588
|
const pagesDirName = `${rootPath}/${existingRelativeLocation}/pages`;
|
|
324624
324589
|
const pages = [];
|
|
@@ -324630,7 +324595,7 @@ async function readMultiPageApplicationFromDisk(rootPath, existingRelativeLocati
|
|
|
324630
324595
|
if (await import_fs_extra4.default.pathExists(pageApisDirName)) {
|
|
324631
324596
|
const pageApiNames = getApiNamesFromPageConfig(page);
|
|
324632
324597
|
for (const apiName of pageApiNames) {
|
|
324633
|
-
const { api: apiContent } = await (0,
|
|
324598
|
+
const { api: apiContent } = await (0, import_util32.readAppApiYamlFile)(pageApisDirName, apiName);
|
|
324634
324599
|
apis2.push({
|
|
324635
324600
|
id: apiContent.metadata.id,
|
|
324636
324601
|
pageId: page.id,
|
|
@@ -324655,7 +324620,7 @@ async function readMultiPageApplicationFromDisk(rootPath, existingRelativeLocati
|
|
|
324655
324620
|
const appConfig = superblocksApplicationConfig;
|
|
324656
324621
|
const apiNames = getApiNamesFromApplicationConfig(appConfig);
|
|
324657
324622
|
for (const apiName of apiNames) {
|
|
324658
|
-
const { api: apiContent } = await (0,
|
|
324623
|
+
const { api: apiContent } = await (0, import_util32.readAppApiYamlFile)(appApisDirName, apiName);
|
|
324659
324624
|
apis.push({
|
|
324660
324625
|
id: apiContent.metadata.id,
|
|
324661
324626
|
apiPb: apiContent
|
|
@@ -324676,7 +324641,7 @@ function getApiNamesFromPageConfig(pageConfig) {
|
|
|
324676
324641
|
}
|
|
324677
324642
|
async function readApiFromDisk(rootPath, existingRelativeLocation) {
|
|
324678
324643
|
const path53 = `${rootPath}/${existingRelativeLocation}`;
|
|
324679
|
-
const { api: apiContent } = await (0,
|
|
324644
|
+
const { api: apiContent } = await (0, import_util32.readAppApiYamlFile)(path53);
|
|
324680
324645
|
return {
|
|
324681
324646
|
apiPb: apiContent
|
|
324682
324647
|
};
|
|
@@ -324705,7 +324670,7 @@ async function writeResourceToDisk(resourceType, resourceId, resource, rootPath,
|
|
|
324705
324670
|
const apiPromises = [];
|
|
324706
324671
|
const apisDirName = `${appDirName}/apis`;
|
|
324707
324672
|
await import_fs_extra4.default.ensureDir(apisDirName);
|
|
324708
|
-
const existingApplicationConfig = await (0,
|
|
324673
|
+
const existingApplicationConfig = await (0, import_util32.getSuperblocksApplicationConfigIfExists)(appDirName);
|
|
324709
324674
|
const existingFilePaths = getExistingFilePathsForApplicationApi(existingApplicationConfig, appDirName);
|
|
324710
324675
|
const newApplicationConfig = {
|
|
324711
324676
|
configType: "APPLICATION",
|
|
@@ -324734,8 +324699,8 @@ async function writeResourceToDisk(resourceType, resourceId, resource, rootPath,
|
|
|
324734
324699
|
for (const filePath of existingFilePaths) {
|
|
324735
324700
|
await import_fs_extra4.default.remove(filePath);
|
|
324736
324701
|
}
|
|
324737
|
-
await import_fs_extra4.default.ensureDir(`${appDirName}/${
|
|
324738
|
-
await import_fs_extra4.default.writeFile(`${appDirName}/${
|
|
324702
|
+
await import_fs_extra4.default.ensureDir(`${appDirName}/${import_util32.SUPERBLOCKS_HOME_FOLDER_NAME}`);
|
|
324703
|
+
await import_fs_extra4.default.writeFile(`${appDirName}/${import_util32.RESOURCE_CONFIG_PATH}`, JSON.stringify(sortByKey(newApplicationConfig), null, 2));
|
|
324739
324704
|
const createdFiles = await Promise.resolve(
|
|
324740
324705
|
// Defensive check for when application settings are missing componentFiles
|
|
324741
324706
|
resource.componentFiles?.map((file) => downloadFile(appDirName, file.filename, file.url)) ?? []
|
|
@@ -324757,7 +324722,7 @@ async function writeResourceToDisk(resourceType, resourceId, resource, rootPath,
|
|
|
324757
324722
|
if (!await import_fs_extra4.default.pathExists(backendDirName)) {
|
|
324758
324723
|
await import_fs_extra4.default.mkdir(backendDirName, { recursive: true });
|
|
324759
324724
|
}
|
|
324760
|
-
const existingBackendConfig = await (0,
|
|
324725
|
+
const existingBackendConfig = await (0, import_util32.getSuperblocksBackendConfigIfExists)(backendDirName);
|
|
324761
324726
|
const existingFilePaths = getExistingFilePathsForBackendApi(existingBackendConfig, backendDirName);
|
|
324762
324727
|
const backendConfig = {
|
|
324763
324728
|
id: resourceId,
|
|
@@ -324769,8 +324734,8 @@ async function writeResourceToDisk(resourceType, resourceId, resource, rootPath,
|
|
|
324769
324734
|
if (apiRepresentation.extractLargeSourceFiles) {
|
|
324770
324735
|
backendConfig.sourceFiles = apiInfo.sourceFiles;
|
|
324771
324736
|
}
|
|
324772
|
-
await import_fs_extra4.default.ensureDir(`${backendDirName}/${
|
|
324773
|
-
await import_fs_extra4.default.writeFile(`${backendDirName}/${
|
|
324737
|
+
await import_fs_extra4.default.ensureDir(`${backendDirName}/${import_util32.SUPERBLOCKS_HOME_FOLDER_NAME}`);
|
|
324738
|
+
await import_fs_extra4.default.writeFile(`${backendDirName}/${import_util32.RESOURCE_CONFIG_PATH}`, JSON.stringify(sortByKey(backendConfig), null, 2));
|
|
324774
324739
|
for (const filePath of existingFilePaths) {
|
|
324775
324740
|
await import_fs_extra4.default.remove(filePath);
|
|
324776
324741
|
}
|
|
@@ -324807,7 +324772,7 @@ async function writeV1ApplicationToDisk(resource, appDirName, featureFlags, rela
|
|
|
324807
324772
|
sortMapEntries: true
|
|
324808
324773
|
});
|
|
324809
324774
|
await import_fs_extra4.default.outputFile(`${appDirName}/application.yaml`, applicationContent);
|
|
324810
|
-
const existingApplicationConfig = await (0,
|
|
324775
|
+
const existingApplicationConfig = await (0, import_util32.getSuperblocksApplicationConfigIfExists)(appDirName);
|
|
324811
324776
|
const existingFilePaths = getExistingFilePathsForApplicationApi(existingApplicationConfig, appDirName);
|
|
324812
324777
|
const newApplicationConfig = {
|
|
324813
324778
|
configType: "APPLICATION",
|
|
@@ -324887,8 +324852,8 @@ async function writeV1ApplicationToDisk(resource, appDirName, featureFlags, rela
|
|
|
324887
324852
|
for (const filePath of existingFilePaths) {
|
|
324888
324853
|
await import_fs_extra4.default.remove(filePath);
|
|
324889
324854
|
}
|
|
324890
|
-
await import_fs_extra4.default.ensureDir(`${appDirName}/${
|
|
324891
|
-
await import_fs_extra4.default.writeFile(`${appDirName}/${
|
|
324855
|
+
await import_fs_extra4.default.ensureDir(`${appDirName}/${import_util32.SUPERBLOCKS_HOME_FOLDER_NAME}`);
|
|
324856
|
+
await import_fs_extra4.default.writeFile(`${appDirName}/${import_util32.RESOURCE_CONFIG_PATH}`, JSON.stringify(sortByKey(newApplicationConfig), null, 2));
|
|
324892
324857
|
const createdFiles = await Promise.resolve(
|
|
324893
324858
|
// Defensive check for when application settings are missing componentFiles
|
|
324894
324859
|
resource.componentFiles?.map((file) => downloadFile(appDirName, file.filename, file.url)) ?? []
|
|
@@ -324908,14 +324873,14 @@ async function writeV1ApplicationToDisk(resource, appDirName, featureFlags, rela
|
|
|
324908
324873
|
};
|
|
324909
324874
|
}
|
|
324910
324875
|
async function writeCodeModeApplicationToDisk(sdk2, resource, appDirName, featureFlags) {
|
|
324911
|
-
const existingApplicationConfig = await (0,
|
|
324876
|
+
const existingApplicationConfig = await (0, import_util32.getSuperblocksApplicationConfigIfExists)(appDirName);
|
|
324912
324877
|
const newApplicationConfig = {
|
|
324913
324878
|
configType: "APPLICATION_V2",
|
|
324914
324879
|
id: resource.application.id,
|
|
324915
324880
|
metadata: getResourceConfigMetadata(featureFlags, existingApplicationConfig)
|
|
324916
324881
|
};
|
|
324917
|
-
await import_fs_extra4.default.ensureDir(`${appDirName}/${
|
|
324918
|
-
await import_fs_extra4.default.writeFile(`${appDirName}/${
|
|
324882
|
+
await import_fs_extra4.default.ensureDir(`${appDirName}/${import_util32.SUPERBLOCKS_HOME_FOLDER_NAME}`);
|
|
324883
|
+
await import_fs_extra4.default.writeFile(`${appDirName}/${import_util32.RESOURCE_CONFIG_PATH}`, JSON.stringify(sortByKey(newApplicationConfig), null, 2));
|
|
324919
324884
|
try {
|
|
324920
324885
|
await sdk2.dbfsGetApplication({
|
|
324921
324886
|
applicationId: resource.application.id,
|
|
@@ -325120,7 +325085,7 @@ function extractApiName(api) {
|
|
|
325120
325085
|
async function writeAppApi(api, directoryPath, existingFilePaths, apiPromises, apiRepresentation) {
|
|
325121
325086
|
const originalApiName = extractApiName(api);
|
|
325122
325087
|
const additionalStepFiles = [];
|
|
325123
|
-
await (0,
|
|
325088
|
+
await (0, import_util32.writeApiFiles)(api, slugifyName(originalApiName), `${directoryPath}/apis`, true, apiPromises, additionalStepFiles, apiRepresentation, existingFilePaths);
|
|
325124
325089
|
return {
|
|
325125
325090
|
name: originalApiName,
|
|
325126
325091
|
sourceFiles: additionalStepFiles.map((file) => file.relativePath).sort()
|
|
@@ -325129,7 +325094,7 @@ async function writeAppApi(api, directoryPath, existingFilePaths, apiPromises, a
|
|
|
325129
325094
|
async function writeBackendApi(api, directoryPath, apiPromises, apiRepresentation, existingFilePaths) {
|
|
325130
325095
|
const originalApiName = extractApiName(api);
|
|
325131
325096
|
const additionalStepFiles = [];
|
|
325132
|
-
await (0,
|
|
325097
|
+
await (0, import_util32.writeApiFiles)(api, "api", directoryPath, false, apiPromises, additionalStepFiles, apiRepresentation, existingFilePaths);
|
|
325133
325098
|
return {
|
|
325134
325099
|
name: originalApiName,
|
|
325135
325100
|
sourceFiles: additionalStepFiles.map((file) => file.relativePath).sort()
|
|
@@ -325175,18 +325140,18 @@ async function validateMultiPageApplication(applicationConfig, superblocksRootPa
|
|
|
325175
325140
|
async function validateLocalResource(superblocksRootPath, resource) {
|
|
325176
325141
|
switch (resource.resourceType) {
|
|
325177
325142
|
case "APPLICATION": {
|
|
325178
|
-
const applicationConfigPath = path33.resolve(superblocksRootPath, resource.location,
|
|
325143
|
+
const applicationConfigPath = path33.resolve(superblocksRootPath, resource.location, import_util32.RESOURCE_CONFIG_PATH);
|
|
325179
325144
|
if (!await import_fs_extra4.default.pathExists(applicationConfigPath)) {
|
|
325180
325145
|
return `File ${relativeToCurrentDir(applicationConfigPath)} not found. Superblocks CLI commands cannot function without it.`;
|
|
325181
325146
|
}
|
|
325182
325147
|
let applicationConfig = void 0;
|
|
325183
325148
|
try {
|
|
325184
|
-
applicationConfig = await (0,
|
|
325149
|
+
applicationConfig = await (0, import_util32.getSuperblocksApplicationConfigJson)(path33.join(superblocksRootPath, resource.location));
|
|
325185
325150
|
} catch {
|
|
325186
325151
|
}
|
|
325187
325152
|
if (!applicationConfig) {
|
|
325188
325153
|
try {
|
|
325189
|
-
applicationConfig = await (0,
|
|
325154
|
+
applicationConfig = await (0, import_util32.getSuperblocksApplicationV2ConfigJson)(path33.join(superblocksRootPath, resource.location));
|
|
325190
325155
|
if (!applicationConfig) {
|
|
325191
325156
|
throw new Error();
|
|
325192
325157
|
}
|
|
@@ -325210,7 +325175,7 @@ async function validateLocalResource(superblocksRootPath, resource) {
|
|
|
325210
325175
|
break;
|
|
325211
325176
|
}
|
|
325212
325177
|
case "BACKEND": {
|
|
325213
|
-
const backendConfigPath = path33.resolve(superblocksRootPath, resource.location,
|
|
325178
|
+
const backendConfigPath = path33.resolve(superblocksRootPath, resource.location, import_util32.RESOURCE_CONFIG_PATH);
|
|
325214
325179
|
if (!await import_fs_extra4.default.pathExists(backendConfigPath)) {
|
|
325215
325180
|
return `File ${relativeToCurrentDir(backendConfigPath)} not found. Superblocks CLI commands cannot function without it.`;
|
|
325216
325181
|
}
|
|
@@ -325252,7 +325217,7 @@ function relativeToCurrentDir(applicationConfigPath) {
|
|
|
325252
325217
|
|
|
325253
325218
|
// ../sdk/dist/dev-utils/dev-server.mjs
|
|
325254
325219
|
init_cjs_shims();
|
|
325255
|
-
var
|
|
325220
|
+
var import_util33 = __toESM(require_dist3(), 1);
|
|
325256
325221
|
import net from "node:net";
|
|
325257
325222
|
import os4 from "node:os";
|
|
325258
325223
|
import path34 from "node:path";
|
|
@@ -325267,7 +325232,7 @@ async function createDevServer({ root: root2, mode, fsOperationQueue, syncServic
|
|
|
325267
325232
|
logger3.debug("Dev server already running");
|
|
325268
325233
|
return httpServer;
|
|
325269
325234
|
}
|
|
325270
|
-
const resourceConfig = await (0,
|
|
325235
|
+
const resourceConfig = await (0, import_util33.getSuperblocksResourceConfigIfExists)();
|
|
325271
325236
|
if (resourceConfig?.configType !== "APPLICATION_V2") {
|
|
325272
325237
|
throw new Error("Invalid resource configuration type");
|
|
325273
325238
|
}
|
|
@@ -325422,7 +325387,7 @@ async function startVite({ app, httpServer: httpServer2, root: root2, mode, port
|
|
|
325422
325387
|
};
|
|
325423
325388
|
const isCustomBuildEnabled2 = await isCustomComponentsEnabled();
|
|
325424
325389
|
const customFolder = path34.join(root2, "custom");
|
|
325425
|
-
const cdnUrl = "https://assets-cdn.superblocks.com/library/2.0.1-next.
|
|
325390
|
+
const cdnUrl = "https://assets-cdn.superblocks.com/library/2.0.1-next.1";
|
|
325426
325391
|
const env3 = loadEnv(mode, root2, "");
|
|
325427
325392
|
const hmrPort = await getFreePort();
|
|
325428
325393
|
const hmrOptions = {
|
|
@@ -325529,7 +325494,7 @@ function getValidFileUrl(url3, file) {
|
|
|
325529
325494
|
|
|
325530
325495
|
// ../sdk/dist/cli-replacement/dev.mjs
|
|
325531
325496
|
init_cjs_shims();
|
|
325532
|
-
var
|
|
325497
|
+
var import_util34 = __toESM(require_dist3(), 1);
|
|
325533
325498
|
import * as child_process2 from "node:child_process";
|
|
325534
325499
|
import * as fsp5 from "node:fs/promises";
|
|
325535
325500
|
import path36 from "node:path";
|
|
@@ -326120,7 +326085,7 @@ async function dev(options8) {
|
|
|
326120
326085
|
});
|
|
326121
326086
|
logger3.info("Checking if local files are synced with the server");
|
|
326122
326087
|
try {
|
|
326123
|
-
await (0,
|
|
326088
|
+
await (0, import_util34.maskUnixSignals)(async () => {
|
|
326124
326089
|
const sdk2 = new SuperblocksSdk(applicationConfig.token, applicationConfig.superblocksBaseUrl, "");
|
|
326125
326090
|
if (lockService) {
|
|
326126
326091
|
try {
|
|
@@ -326212,10 +326177,10 @@ async function dev(options8) {
|
|
|
326212
326177
|
// ../sdk/dist/cli-replacement/init.js
|
|
326213
326178
|
init_cjs_shims();
|
|
326214
326179
|
var import_shared37 = __toESM(require_dist2(), 1);
|
|
326215
|
-
var
|
|
326180
|
+
var import_util35 = __toESM(require_dist3(), 1);
|
|
326216
326181
|
async function fetchAndWriteApplication({ resourceId, viewMode, featureFlags, projectRootFolder, appRelativePath, sdk: sdk2, skipSigningVerification }) {
|
|
326217
326182
|
const headers = {
|
|
326218
|
-
[
|
|
326183
|
+
[import_util35.COMPONENT_EVENT_HEADER]: import_shared37.ComponentEvent.INIT
|
|
326219
326184
|
};
|
|
326220
326185
|
const application = await sdk2.fetchApplicationWithComponents({
|
|
326221
326186
|
applicationId: resourceId,
|
|
@@ -326239,7 +326204,7 @@ async function fetchAndWriteApplication({ resourceId, viewMode, featureFlags, pr
|
|
|
326239
326204
|
var import_shared38 = __toESM(require_dist2(), 1);
|
|
326240
326205
|
|
|
326241
326206
|
// src/commands/commits.mts
|
|
326242
|
-
var
|
|
326207
|
+
var import_util38 = __toESM(require_dist3(), 1);
|
|
326243
326208
|
|
|
326244
326209
|
// ../../../../node_modules/.pnpm/listr2@6.6.0_enquirer@2.4.1/node_modules/listr2/dist/index.js
|
|
326245
326210
|
init_cjs_shims();
|
|
@@ -328511,7 +328476,7 @@ __name(Manager, "Manager");
|
|
|
328511
328476
|
init_cjs_shims();
|
|
328512
328477
|
import path37 from "node:path";
|
|
328513
328478
|
import { Command, ux } from "@oclif/core";
|
|
328514
|
-
var
|
|
328479
|
+
var import_util37 = __toESM(require_dist3(), 1);
|
|
328515
328480
|
var import_fs_extra6 = __toESM(require_lib(), 1);
|
|
328516
328481
|
var import_semver5 = __toESM(require_semver2(), 1);
|
|
328517
328482
|
|
|
@@ -328629,7 +328594,7 @@ var AuthenticatedCommand = class extends Command {
|
|
|
328629
328594
|
async init() {
|
|
328630
328595
|
await super.init();
|
|
328631
328596
|
try {
|
|
328632
|
-
const result = await (0,
|
|
328597
|
+
const result = await (0, import_util37.getLocalTokenWithUrl)();
|
|
328633
328598
|
if (!("token" in result)) {
|
|
328634
328599
|
throw new Error();
|
|
328635
328600
|
}
|
|
@@ -328660,7 +328625,7 @@ var AuthenticatedCommand = class extends Command {
|
|
|
328660
328625
|
};
|
|
328661
328626
|
}
|
|
328662
328627
|
async getBaseUrl() {
|
|
328663
|
-
const result = await (0,
|
|
328628
|
+
const result = await (0, import_util37.getLocalTokenWithUrlIfExists)();
|
|
328664
328629
|
return result?.superblocksBaseUrl ?? "";
|
|
328665
328630
|
}
|
|
328666
328631
|
getSdk() {
|
|
@@ -328673,7 +328638,7 @@ var AuthenticatedCommand = class extends Command {
|
|
|
328673
328638
|
let previousConfig;
|
|
328674
328639
|
let rootConfigPath;
|
|
328675
328640
|
try {
|
|
328676
|
-
[previousConfig, rootConfigPath] = await (0,
|
|
328641
|
+
[previousConfig, rootConfigPath] = await (0, import_util37.getSuperblocksMonorepoConfigJson)(true);
|
|
328677
328642
|
} catch {
|
|
328678
328643
|
return;
|
|
328679
328644
|
}
|
|
@@ -328758,7 +328723,7 @@ var AuthenticatedApplicationCommand = class extends AuthenticatedCommand {
|
|
|
328758
328723
|
apis: {}
|
|
328759
328724
|
};
|
|
328760
328725
|
async getEditModeUrl() {
|
|
328761
|
-
const result = await (0,
|
|
328726
|
+
const result = await (0, import_util37.getLocalTokenWithUrlIfExists)();
|
|
328762
328727
|
const baseUrl = typeof result === "string" ? result : result?.superblocksBaseUrl;
|
|
328763
328728
|
return new URL(
|
|
328764
328729
|
`/applications/edit/${this.applicationConfig.id}`,
|
|
@@ -328768,14 +328733,14 @@ var AuthenticatedApplicationCommand = class extends AuthenticatedCommand {
|
|
|
328768
328733
|
async init() {
|
|
328769
328734
|
await super.init();
|
|
328770
328735
|
try {
|
|
328771
|
-
this.applicationConfig = await (0,
|
|
328736
|
+
this.applicationConfig = await (0, import_util37.getSuperblocksApplicationConfigJson)();
|
|
328772
328737
|
} catch (error) {
|
|
328773
328738
|
this.error(error.message, {
|
|
328774
328739
|
exit: 1
|
|
328775
328740
|
});
|
|
328776
328741
|
}
|
|
328777
328742
|
const { branchName } = await this.validateApplicationGitSetup(
|
|
328778
|
-
|
|
328743
|
+
import_util37.ComponentEvent.INIT
|
|
328779
328744
|
);
|
|
328780
328745
|
ux.action.start("Checking application...");
|
|
328781
328746
|
try {
|
|
@@ -328840,7 +328805,7 @@ ${cyan("superblocks migrate")}`
|
|
|
328840
328805
|
}
|
|
328841
328806
|
ux.action.stop();
|
|
328842
328807
|
ux.action.start("Scanning for Superblocks components...");
|
|
328843
|
-
const exists2 = await import_fs_extra6.default.pathExists(
|
|
328808
|
+
const exists2 = await import_fs_extra6.default.pathExists(import_util37.CUSTOM_COMPONENTS_PATH);
|
|
328844
328809
|
if (!exists2) {
|
|
328845
328810
|
ux.action.stop();
|
|
328846
328811
|
this.error(
|
|
@@ -328850,7 +328815,7 @@ ${cyan("superblocks migrate")}`
|
|
|
328850
328815
|
}
|
|
328851
328816
|
);
|
|
328852
328817
|
}
|
|
328853
|
-
const { configs, hasError } = await (0,
|
|
328818
|
+
const { configs, hasError } = await (0, import_util37.getComponentConfigs)(true);
|
|
328854
328819
|
if (hasError) {
|
|
328855
328820
|
ux.action.stop();
|
|
328856
328821
|
this.error("Failed to register components", { exit: 1 });
|
|
@@ -328866,7 +328831,7 @@ ${cyan("superblocks migrate")}`
|
|
|
328866
328831
|
try {
|
|
328867
328832
|
ux.action.start("Registering components...");
|
|
328868
328833
|
const { branchName } = await this.validateApplicationGitSetup(
|
|
328869
|
-
|
|
328834
|
+
import_util37.ComponentEvent.REGISTER
|
|
328870
328835
|
);
|
|
328871
328836
|
await this.getSdk().registerComponents(
|
|
328872
328837
|
this.applicationConfig.id,
|
|
@@ -328889,7 +328854,7 @@ var AuthenticatedApplicationV2Command = class extends AuthenticatedCommand {
|
|
|
328889
328854
|
id: ""
|
|
328890
328855
|
};
|
|
328891
328856
|
async getEditModeUrl() {
|
|
328892
|
-
const result = await (0,
|
|
328857
|
+
const result = await (0, import_util37.getLocalTokenWithUrlIfExists)();
|
|
328893
328858
|
const baseUrl = typeof result === "string" ? result : result?.superblocksBaseUrl;
|
|
328894
328859
|
return new URL(
|
|
328895
328860
|
`/code-mode/applications/edit/${this.applicationConfig.id}`,
|
|
@@ -328899,14 +328864,14 @@ var AuthenticatedApplicationV2Command = class extends AuthenticatedCommand {
|
|
|
328899
328864
|
async init() {
|
|
328900
328865
|
await super.init();
|
|
328901
328866
|
try {
|
|
328902
|
-
this.applicationConfig = await (0,
|
|
328867
|
+
this.applicationConfig = await (0, import_util37.getSuperblocksApplicationV2ConfigJson)();
|
|
328903
328868
|
} catch (error) {
|
|
328904
328869
|
this.error(error.message, {
|
|
328905
328870
|
exit: 1
|
|
328906
328871
|
});
|
|
328907
328872
|
}
|
|
328908
328873
|
const { branchName } = await this.validateApplicationGitSetup(
|
|
328909
|
-
|
|
328874
|
+
import_util37.ComponentEvent.INIT
|
|
328910
328875
|
);
|
|
328911
328876
|
ux.action.start("Checking application...");
|
|
328912
328877
|
try {
|
|
@@ -328996,8 +328961,8 @@ var Commits = class _Commits extends AuthenticatedCommand {
|
|
|
328996
328961
|
[
|
|
328997
328962
|
ctx.existingSuperblocksRootConfig,
|
|
328998
328963
|
ctx.superblocksRootConfigPath
|
|
328999
|
-
] = await (0,
|
|
329000
|
-
ctx.existingSuperblocksResourceConfig = await (0,
|
|
328964
|
+
] = await (0, import_util38.getSuperblocksMonorepoConfigJson)(true);
|
|
328965
|
+
ctx.existingSuperblocksResourceConfig = await (0, import_util38.getSuperblocksResourceConfigIfExists)();
|
|
329001
328966
|
ctx.superblocksRootPath = path38.resolve(
|
|
329002
328967
|
path38.dirname(ctx.superblocksRootConfigPath),
|
|
329003
328968
|
".."
|
|
@@ -329038,7 +329003,7 @@ var Commits = class _Commits extends AuthenticatedCommand {
|
|
|
329038
329003
|
skipSigningVerification: true
|
|
329039
329004
|
});
|
|
329040
329005
|
} catch (error) {
|
|
329041
|
-
if (error instanceof
|
|
329006
|
+
if (error instanceof import_util38.NotFoundError) {
|
|
329042
329007
|
ctx.removedResourceIds.push(resourceId);
|
|
329043
329008
|
} else {
|
|
329044
329009
|
throw error;
|
|
@@ -329054,7 +329019,7 @@ var Commits = class _Commits extends AuthenticatedCommand {
|
|
|
329054
329019
|
skipSigningVerification: true
|
|
329055
329020
|
});
|
|
329056
329021
|
} catch (error) {
|
|
329057
|
-
if (error instanceof
|
|
329022
|
+
if (error instanceof import_util38.NotFoundError) {
|
|
329058
329023
|
ctx.removedResourceIds.push(resourceId);
|
|
329059
329024
|
} else {
|
|
329060
329025
|
throw error;
|
|
@@ -329127,7 +329092,7 @@ Would you like to also delete these resources from your filesystem?`
|
|
|
329127
329092
|
title: `Fetching commits for application ${resource.location} from branch ${branchName}...`,
|
|
329128
329093
|
task: async (_ctx, task2) => {
|
|
329129
329094
|
const headers = {
|
|
329130
|
-
[
|
|
329095
|
+
[import_util38.COMPONENT_EVENT_HEADER]: import_util38.ComponentEvent.COMMITS
|
|
329131
329096
|
};
|
|
329132
329097
|
try {
|
|
329133
329098
|
task2.title += `: fetched`;
|
|
@@ -329141,7 +329106,7 @@ Would you like to also delete these resources from your filesystem?`
|
|
|
329141
329106
|
this.printCommits(applicationCommits, branchName);
|
|
329142
329107
|
task2.title += `: done`;
|
|
329143
329108
|
} catch (e) {
|
|
329144
|
-
if (e instanceof
|
|
329109
|
+
if (e instanceof import_util38.NotFoundError) {
|
|
329145
329110
|
task2.title += `: not found in this branch. skipped`;
|
|
329146
329111
|
} else {
|
|
329147
329112
|
throw e;
|
|
@@ -329202,7 +329167,7 @@ Would you like to also delete these resources from your filesystem?`
|
|
|
329202
329167
|
`No resource found with the given location: ${resourcePath}`
|
|
329203
329168
|
);
|
|
329204
329169
|
}
|
|
329205
|
-
const resourceConfig = await (0,
|
|
329170
|
+
const resourceConfig = await (0, import_util38.getSuperblocksResourceConfigIfExists)();
|
|
329206
329171
|
if (resourceConfig) {
|
|
329207
329172
|
return resourceConfig.id;
|
|
329208
329173
|
}
|
|
@@ -329260,7 +329225,7 @@ Would you like to also delete these resources from your filesystem?`
|
|
|
329260
329225
|
|
|
329261
329226
|
// src/commands/components/create.mts
|
|
329262
329227
|
init_cjs_shims();
|
|
329263
|
-
var
|
|
329228
|
+
var import_util39 = __toESM(require_dist3(), 1);
|
|
329264
329229
|
import { exec as exec6 } from "node:child_process";
|
|
329265
329230
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
329266
329231
|
import path39 from "node:path";
|
|
@@ -329385,8 +329350,8 @@ var CreateComponent = class _CreateComponent extends AuthenticatedApplicationCom
|
|
|
329385
329350
|
type: "input",
|
|
329386
329351
|
name: "name",
|
|
329387
329352
|
message: "What is the machine readable name of the component you want to create?",
|
|
329388
|
-
validate: (response) => (0,
|
|
329389
|
-
initial: (0,
|
|
329353
|
+
validate: (response) => (0, import_util39.isValidIdentifier)(response) || "Invalid identifier",
|
|
329354
|
+
initial: (0, import_util39.suggestIdentifier)(displayName, true) || "ToDoList"
|
|
329390
329355
|
})).name;
|
|
329391
329356
|
this.log();
|
|
329392
329357
|
this.log(
|
|
@@ -329411,8 +329376,8 @@ var CreateComponent = class _CreateComponent extends AuthenticatedApplicationCom
|
|
|
329411
329376
|
name: "path",
|
|
329412
329377
|
message: "What is the path of the property? This will be used to access the property in your code (e.g. currentTasks)",
|
|
329413
329378
|
validate: (response) => {
|
|
329414
|
-
if (!(0,
|
|
329415
|
-
if ((0,
|
|
329379
|
+
if (!(0, import_util39.isValidIdentifier)(response)) return "Invalid identifier";
|
|
329380
|
+
if ((0, import_util39.isReservedPropertyName)(response))
|
|
329416
329381
|
return "Reserved property path (see https://docs.superblocks.com/applications/custom-components/faq#what-is-a-reserved-property)";
|
|
329417
329382
|
if (properties.some((v) => v.path === response))
|
|
329418
329383
|
return "Duplicate property path";
|
|
@@ -329423,7 +329388,7 @@ var CreateComponent = class _CreateComponent extends AuthenticatedApplicationCom
|
|
|
329423
329388
|
type: "select",
|
|
329424
329389
|
name: "type",
|
|
329425
329390
|
message: `What is the type of ${propertyPath}?`,
|
|
329426
|
-
choices: Object.entries(
|
|
329391
|
+
choices: Object.entries(import_util39.dataTypeDefinions).map(
|
|
329427
329392
|
([k, v]) => ({
|
|
329428
329393
|
name: k,
|
|
329429
329394
|
message: v.prompt,
|
|
@@ -329506,10 +329471,10 @@ var CreateComponent = class _CreateComponent extends AuthenticatedApplicationCom
|
|
|
329506
329471
|
name: "value",
|
|
329507
329472
|
message: "What is the path of the event? This will be used to trigger the event in your code (e.g. onChange)",
|
|
329508
329473
|
type: "input",
|
|
329509
|
-
initial: (0,
|
|
329474
|
+
initial: (0, import_util39.suggestIdentifier)(eventHandlerName) || "onChange",
|
|
329510
329475
|
validate: (response) => {
|
|
329511
|
-
if (!(0,
|
|
329512
|
-
if ((0,
|
|
329476
|
+
if (!(0, import_util39.isValidIdentifier)(response)) return "Invalid identifier";
|
|
329477
|
+
if ((0, import_util39.isReservedPropertyName)(response))
|
|
329513
329478
|
return "Reserved property path (see https://docs.superblocks.com/applications/custom-components/faq#what-is-a-reserved-property)";
|
|
329514
329479
|
if (events.some((v) => v.path === response))
|
|
329515
329480
|
return "Duplicate property path";
|
|
@@ -329671,7 +329636,7 @@ var CreateComponent = class _CreateComponent extends AuthenticatedApplicationCom
|
|
|
329671
329636
|
ux2.action.stop();
|
|
329672
329637
|
}
|
|
329673
329638
|
const headers = {
|
|
329674
|
-
[
|
|
329639
|
+
[import_util39.COMPONENT_EVENT_HEADER]: import_util39.ComponentEvent.CREATE
|
|
329675
329640
|
};
|
|
329676
329641
|
await this.registerComponents(headers);
|
|
329677
329642
|
}
|
|
@@ -329679,13 +329644,13 @@ var CreateComponent = class _CreateComponent extends AuthenticatedApplicationCom
|
|
|
329679
329644
|
|
|
329680
329645
|
// src/commands/components/register.mts
|
|
329681
329646
|
init_cjs_shims();
|
|
329682
|
-
var
|
|
329647
|
+
var import_util40 = __toESM(require_dist3(), 1);
|
|
329683
329648
|
var Register = class extends AuthenticatedApplicationCommand {
|
|
329684
329649
|
static description = "Registers all local component config files";
|
|
329685
329650
|
static examples = ["superblocks components register"];
|
|
329686
329651
|
async run() {
|
|
329687
329652
|
const headers = {
|
|
329688
|
-
[
|
|
329653
|
+
[import_util40.COMPONENT_EVENT_HEADER]: import_util40.ComponentEvent.REGISTER
|
|
329689
329654
|
};
|
|
329690
329655
|
await this.registerComponents(headers);
|
|
329691
329656
|
}
|
|
@@ -329693,7 +329658,7 @@ var Register = class extends AuthenticatedApplicationCommand {
|
|
|
329693
329658
|
|
|
329694
329659
|
// src/commands/components/upload.mts
|
|
329695
329660
|
init_cjs_shims();
|
|
329696
|
-
var
|
|
329661
|
+
var import_util41 = __toESM(require_dist3(), 1);
|
|
329697
329662
|
import { Flags as Flags3, ux as ux3 } from "@oclif/core";
|
|
329698
329663
|
import react4 from "@vitejs/plugin-react";
|
|
329699
329664
|
var import_fs_extra9 = __toESM(require_lib(), 1);
|
|
@@ -329913,7 +329878,7 @@ var Upload = class _Upload extends AuthenticatedApplicationCommand {
|
|
|
329913
329878
|
async run() {
|
|
329914
329879
|
const { flags } = await this.parse(_Upload);
|
|
329915
329880
|
ux3.action.start("Scanning for Superblocks components...");
|
|
329916
|
-
const exists2 = await import_fs_extra9.default.pathExists(
|
|
329881
|
+
const exists2 = await import_fs_extra9.default.pathExists(import_util41.CUSTOM_COMPONENTS_PATH);
|
|
329917
329882
|
if (!exists2) {
|
|
329918
329883
|
ux3.action.stop();
|
|
329919
329884
|
this.error(
|
|
@@ -329924,11 +329889,11 @@ var Upload = class _Upload extends AuthenticatedApplicationCommand {
|
|
|
329924
329889
|
);
|
|
329925
329890
|
}
|
|
329926
329891
|
const { branchName } = await this.validateApplicationGitSetup(
|
|
329927
|
-
|
|
329892
|
+
import_util41.ComponentEvent.UPLOAD,
|
|
329928
329893
|
flags.branch
|
|
329929
329894
|
);
|
|
329930
329895
|
const headers = {
|
|
329931
|
-
[
|
|
329896
|
+
[import_util41.COMPONENT_EVENT_HEADER]: import_util41.ComponentEvent.REGISTER
|
|
329932
329897
|
};
|
|
329933
329898
|
const configs = await this.registerComponents(headers);
|
|
329934
329899
|
if (!configs) return;
|
|
@@ -330011,14 +329976,14 @@ var Upload = class _Upload extends AuthenticatedApplicationCommand {
|
|
|
330011
329976
|
|
|
330012
329977
|
// src/commands/components/watch.mts
|
|
330013
329978
|
init_cjs_shims();
|
|
330014
|
-
var
|
|
329979
|
+
var import_util43 = __toESM(require_dist3(), 1);
|
|
330015
329980
|
import react5 from "@vitejs/plugin-react";
|
|
330016
329981
|
import { createLogger as createLogger7, createServer as createServer2 } from "vite";
|
|
330017
329982
|
|
|
330018
329983
|
// src/appendHotReloadEventPlugin.mts
|
|
330019
329984
|
init_cjs_shims();
|
|
330020
329985
|
import path44 from "path";
|
|
330021
|
-
var
|
|
329986
|
+
var import_util42 = __toESM(require_dist3(), 1);
|
|
330022
329987
|
var appendHotReloadEventPlugin = (getBranch) => {
|
|
330023
329988
|
return {
|
|
330024
329989
|
name: "append-code-plugin",
|
|
@@ -330029,15 +329994,15 @@ var appendHotReloadEventPlugin = (getBranch) => {
|
|
|
330029
329994
|
const isConfigFile = path44.basename(ctx.file) === "config.ts";
|
|
330030
329995
|
if (!isConfigFile) return;
|
|
330031
329996
|
try {
|
|
330032
|
-
const result = await (0,
|
|
329997
|
+
const result = await (0, import_util42.getLocalTokenWithUrl)();
|
|
330033
329998
|
if (!result || !("token" in result)) {
|
|
330034
329999
|
throw new Error("Please run `superblocks login` to login.");
|
|
330035
330000
|
}
|
|
330036
330001
|
const { token: token2, superblocksBaseUrl } = result;
|
|
330037
|
-
const resourceConfig = await (0,
|
|
330038
|
-
const { configs, hasError } = await (0,
|
|
330002
|
+
const resourceConfig = await (0, import_util42.getSuperblocksApplicationConfigJson)();
|
|
330003
|
+
const { configs, hasError } = await (0, import_util42.getComponentConfigs)(true);
|
|
330039
330004
|
if (hasError) return;
|
|
330040
|
-
const [rootSettings] = await (0,
|
|
330005
|
+
const [rootSettings] = await (0, import_util42.getSuperblocksMonorepoConfigJson)(true);
|
|
330041
330006
|
const sdk2 = new SuperblocksSdk(
|
|
330042
330007
|
token2,
|
|
330043
330008
|
superblocksBaseUrl,
|
|
@@ -330046,7 +330011,7 @@ var appendHotReloadEventPlugin = (getBranch) => {
|
|
|
330046
330011
|
console.log("Registering components...");
|
|
330047
330012
|
const branch = await getBranch();
|
|
330048
330013
|
const headers = {
|
|
330049
|
-
[
|
|
330014
|
+
[import_util42.COMPONENT_EVENT_HEADER]: import_util42.ComponentEvent.REGISTER
|
|
330050
330015
|
};
|
|
330051
330016
|
await sdk2.registerComponents(
|
|
330052
330017
|
resourceConfig.id,
|
|
@@ -330093,7 +330058,7 @@ var Watch = class extends AuthenticatedApplicationCommand {
|
|
|
330093
330058
|
static description = "watch for changes to your custom components";
|
|
330094
330059
|
async run() {
|
|
330095
330060
|
const headers = {
|
|
330096
|
-
[
|
|
330061
|
+
[import_util43.COMPONENT_EVENT_HEADER]: import_util43.ComponentEvent.REGISTER
|
|
330097
330062
|
};
|
|
330098
330063
|
await this.registerComponents(headers);
|
|
330099
330064
|
this.log(
|
|
@@ -330104,7 +330069,7 @@ var Watch = class extends AuthenticatedApplicationCommand {
|
|
|
330104
330069
|
this.log();
|
|
330105
330070
|
const editModeUrl = new URL(await this.getEditModeUrl());
|
|
330106
330071
|
editModeUrl.searchParams.set("devMode", "true");
|
|
330107
|
-
const { branchName, localBranchName } = await this.validateApplicationGitSetup(
|
|
330072
|
+
const { branchName, localBranchName } = await this.validateApplicationGitSetup(import_util43.ComponentEvent.REGISTER);
|
|
330108
330073
|
if (branchName) {
|
|
330109
330074
|
editModeUrl.searchParams.set("branch", branchName);
|
|
330110
330075
|
}
|
|
@@ -330120,7 +330085,7 @@ var Watch = class extends AuthenticatedApplicationCommand {
|
|
|
330120
330085
|
if (curLocalBranchName === lastLocalBranchName) {
|
|
330121
330086
|
return lastBranchName;
|
|
330122
330087
|
} else {
|
|
330123
|
-
const { branchName: branchName2, localBranchName: localBranchName2 } = await this.validateApplicationGitSetup(
|
|
330088
|
+
const { branchName: branchName2, localBranchName: localBranchName2 } = await this.validateApplicationGitSetup(import_util43.ComponentEvent.REGISTER);
|
|
330124
330089
|
lastBranchName = branchName2;
|
|
330125
330090
|
lastLocalBranchName = localBranchName2;
|
|
330126
330091
|
return branchName2;
|
|
@@ -330180,7 +330145,7 @@ var Watch = class extends AuthenticatedApplicationCommand {
|
|
|
330180
330145
|
|
|
330181
330146
|
// src/commands/config/set.mts
|
|
330182
330147
|
init_cjs_shims();
|
|
330183
|
-
var
|
|
330148
|
+
var import_util45 = __toESM(require_dist3(), 1);
|
|
330184
330149
|
import dns from "dns";
|
|
330185
330150
|
import { promisify as promisify3 } from "util";
|
|
330186
330151
|
import { Args as Args2, Command as Command2 } from "@oclif/core";
|
|
@@ -330209,21 +330174,21 @@ var SetSuperblocksConfig = class _SetSuperblocksConfig extends Command2 {
|
|
|
330209
330174
|
const newDomain = args.value;
|
|
330210
330175
|
const newSuperblocksBaseUrl = `https://${newDomain}/`;
|
|
330211
330176
|
await this.validateDomain(newDomain);
|
|
330212
|
-
const result = await (0,
|
|
330177
|
+
const result = await (0, import_util45.getLocalTokenWithUrlIfExists)();
|
|
330213
330178
|
if (result) {
|
|
330214
330179
|
if (!("token" in result)) {
|
|
330215
|
-
await (0,
|
|
330180
|
+
await (0, import_util45.saveApiToken)(newSuperblocksBaseUrl);
|
|
330216
330181
|
break;
|
|
330217
330182
|
}
|
|
330218
330183
|
const { token: token2, superblocksBaseUrl } = result;
|
|
330219
330184
|
const tokenToSave = newSuperblocksBaseUrl === superblocksBaseUrl ? token2 : void 0;
|
|
330220
330185
|
if (tokenToSave) {
|
|
330221
|
-
await (0,
|
|
330186
|
+
await (0, import_util45.saveApiToken)(newSuperblocksBaseUrl, tokenToSave);
|
|
330222
330187
|
} else {
|
|
330223
|
-
await (0,
|
|
330188
|
+
await (0, import_util45.saveApiToken)(newSuperblocksBaseUrl);
|
|
330224
330189
|
}
|
|
330225
330190
|
} else {
|
|
330226
|
-
await (0,
|
|
330191
|
+
await (0, import_util45.saveApiToken)(newSuperblocksBaseUrl);
|
|
330227
330192
|
}
|
|
330228
330193
|
break;
|
|
330229
330194
|
}
|
|
@@ -330532,7 +330497,7 @@ var Dev2 = class extends Command5 {
|
|
|
330532
330497
|
init_cjs_shims();
|
|
330533
330498
|
import path46 from "path";
|
|
330534
330499
|
import { Args as Args3, Flags as Flags7 } from "@oclif/core";
|
|
330535
|
-
var
|
|
330500
|
+
var import_util46 = __toESM(require_dist3(), 1);
|
|
330536
330501
|
var import_fs_extra12 = __toESM(require_lib(), 1);
|
|
330537
330502
|
init_lodash();
|
|
330538
330503
|
var Initialize = class _Initialize extends AuthenticatedCommand {
|
|
@@ -330582,7 +330547,7 @@ var Initialize = class _Initialize extends AuthenticatedCommand {
|
|
|
330582
330547
|
[
|
|
330583
330548
|
ctx.existingSuperblocksRootConfig,
|
|
330584
330549
|
ctx.superblocksRootConfigPath
|
|
330585
|
-
] = await (0,
|
|
330550
|
+
] = await (0, import_util46.getSuperblocksMonorepoConfigJson)(true);
|
|
330586
330551
|
} catch {
|
|
330587
330552
|
}
|
|
330588
330553
|
}
|
|
@@ -330624,12 +330589,12 @@ var Initialize = class _Initialize extends AuthenticatedCommand {
|
|
|
330624
330589
|
title: "Fetching resource by resourceUrl...",
|
|
330625
330590
|
enabled: () => !isEmpty_default(args.resource_url),
|
|
330626
330591
|
task: async (ctx2, task2) => {
|
|
330627
|
-
const [resourceId, resourceType] = (0,
|
|
330592
|
+
const [resourceId, resourceType] = (0, import_util46.getResourceIdFromUrl)(
|
|
330628
330593
|
args.resource_url
|
|
330629
330594
|
);
|
|
330630
330595
|
if (resourceType === "APPLICATION") {
|
|
330631
330596
|
const headers = {
|
|
330632
|
-
[
|
|
330597
|
+
[import_util46.COMPONENT_EVENT_HEADER]: import_util46.ComponentEvent.INIT
|
|
330633
330598
|
};
|
|
330634
330599
|
const application = await this.getSdk().fetchApplicationWithComponents({
|
|
330635
330600
|
applicationId: resourceId,
|
|
@@ -330638,7 +330603,7 @@ var Initialize = class _Initialize extends AuthenticatedCommand {
|
|
|
330638
330603
|
skipSigningVerification
|
|
330639
330604
|
});
|
|
330640
330605
|
if (!application) {
|
|
330641
|
-
throw new
|
|
330606
|
+
throw new import_util46.NotFoundError(
|
|
330642
330607
|
`Application ${resourceId} was not found`
|
|
330643
330608
|
);
|
|
330644
330609
|
}
|
|
@@ -330767,16 +330732,16 @@ var Initialize = class _Initialize extends AuthenticatedCommand {
|
|
|
330767
330732
|
)) {
|
|
330768
330733
|
superblocksConfig.resources[resourceId] = resource;
|
|
330769
330734
|
}
|
|
330770
|
-
if (!await import_fs_extra12.default.exists(
|
|
330771
|
-
await import_fs_extra12.default.mkdir(
|
|
330735
|
+
if (!await import_fs_extra12.default.exists(import_util46.SUPERBLOCKS_HOME_FOLDER_NAME)) {
|
|
330736
|
+
await import_fs_extra12.default.mkdir(import_util46.SUPERBLOCKS_HOME_FOLDER_NAME);
|
|
330772
330737
|
}
|
|
330773
330738
|
await import_fs_extra12.default.writeFile(
|
|
330774
|
-
ctx.superblocksRootConfigPath ??
|
|
330739
|
+
ctx.superblocksRootConfigPath ?? import_util46.RESOURCE_CONFIG_PATH,
|
|
330775
330740
|
JSON.stringify(sortByKey(superblocksConfig), null, 2)
|
|
330776
330741
|
);
|
|
330777
330742
|
if (ctx.existingSuperblocksRootConfig) {
|
|
330778
330743
|
this.log(
|
|
330779
|
-
`Superblocks resources added at ${ctx.superblocksRootConfigPath?.replace(
|
|
330744
|
+
`Superblocks resources added at ${ctx.superblocksRootConfigPath?.replace(import_util46.RESOURCE_CONFIG_PATH, "")}`
|
|
330780
330745
|
);
|
|
330781
330746
|
}
|
|
330782
330747
|
}
|
|
@@ -330791,7 +330756,7 @@ var Initialize = class _Initialize extends AuthenticatedCommand {
|
|
|
330791
330756
|
async getResourcesToInitialize(ctx, task, args) {
|
|
330792
330757
|
if (args.resource_url) {
|
|
330793
330758
|
try {
|
|
330794
|
-
const [resourceId] = (0,
|
|
330759
|
+
const [resourceId] = (0, import_util46.getResourceIdFromUrl)(args.resource_url);
|
|
330795
330760
|
return [resourceId];
|
|
330796
330761
|
} catch {
|
|
330797
330762
|
throw new Error(`Invalid resource URL: ${args.resource_url}`);
|
|
@@ -330873,7 +330838,7 @@ var Initialize = class _Initialize extends AuthenticatedCommand {
|
|
|
330873
330838
|
// src/commands/login.mts
|
|
330874
330839
|
init_cjs_shims();
|
|
330875
330840
|
import { Command as Command6, Flags as Flags8 } from "@oclif/core";
|
|
330876
|
-
var
|
|
330841
|
+
var import_util47 = __toESM(require_dist3(), 1);
|
|
330877
330842
|
var import_enquirer2 = __toESM(require_enquirer(), 1);
|
|
330878
330843
|
init_lodash();
|
|
330879
330844
|
var { prompt: prompt2 } = import_enquirer2.default;
|
|
@@ -330890,7 +330855,7 @@ var Login = class _Login extends Command6 {
|
|
|
330890
330855
|
async run() {
|
|
330891
330856
|
const { flags } = await this.parse(_Login);
|
|
330892
330857
|
let token2 = flags.token;
|
|
330893
|
-
const result = await (0,
|
|
330858
|
+
const result = await (0, import_util47.getLocalTokenWithUrlIfExists)();
|
|
330894
330859
|
const superblocksBaseUrl = result?.superblocksBaseUrl ?? this.DEFAULT_BASE_URL;
|
|
330895
330860
|
if (!token2) {
|
|
330896
330861
|
if (result && "token" in result) {
|
|
@@ -330916,10 +330881,10 @@ var Login = class _Login extends Command6 {
|
|
|
330916
330881
|
this.config.version
|
|
330917
330882
|
);
|
|
330918
330883
|
const user = await sdk2.fetchCurrentUser();
|
|
330919
|
-
await (0,
|
|
330884
|
+
await (0, import_util47.saveApiToken)(superblocksBaseUrl, token2);
|
|
330920
330885
|
this.log(green(`Welcome to the Superblocks \u{1F428} CLI ${user.user.name}!`));
|
|
330921
330886
|
} catch (error) {
|
|
330922
|
-
if (error instanceof
|
|
330887
|
+
if (error instanceof import_util47.FileAccessError) {
|
|
330923
330888
|
this.log(
|
|
330924
330889
|
red(
|
|
330925
330890
|
"Could not save token, ensure the Superblocks CLI has access to create folders in your home directory."
|
|
@@ -330944,7 +330909,7 @@ init_cjs_shims();
|
|
|
330944
330909
|
import { exec as exec7 } from "node:child_process";
|
|
330945
330910
|
import path47 from "node:path";
|
|
330946
330911
|
import util6 from "node:util";
|
|
330947
|
-
var
|
|
330912
|
+
var import_util48 = __toESM(require_dist3(), 1);
|
|
330948
330913
|
var import_fs_extra13 = __toESM(require_lib(), 1);
|
|
330949
330914
|
var import_semver7 = __toESM(require_semver2(), 1);
|
|
330950
330915
|
var Migrate = class extends AuthenticatedCommand {
|
|
@@ -330964,8 +330929,8 @@ var Migrate = class extends AuthenticatedCommand {
|
|
|
330964
330929
|
[
|
|
330965
330930
|
ctx.existingSuperblocksRootConfig,
|
|
330966
330931
|
ctx.superblocksRootConfigPath
|
|
330967
|
-
] = await (0,
|
|
330968
|
-
ctx.existingSuperblocksResourceConfig = await (0,
|
|
330932
|
+
] = await (0, import_util48.getSuperblocksMonorepoConfigJson)(true);
|
|
330933
|
+
ctx.existingSuperblocksResourceConfig = await (0, import_util48.getSuperblocksResourceConfigIfExists)();
|
|
330969
330934
|
} catch {
|
|
330970
330935
|
this.error(
|
|
330971
330936
|
`No Superblocks project found in the current folder hierarchy. Run ${cyan(
|
|
@@ -331168,7 +331133,7 @@ var Migrate = class extends AuthenticatedCommand {
|
|
|
331168
331133
|
init_cjs_shims();
|
|
331169
331134
|
import path48 from "node:path";
|
|
331170
331135
|
import { Args as Args4, Flags as Flags9 } from "@oclif/core";
|
|
331171
|
-
var
|
|
331136
|
+
var import_util49 = __toESM(require_dist3(), 1);
|
|
331172
331137
|
var Pull = class _Pull extends AuthenticatedCommand {
|
|
331173
331138
|
static description = "Download objects from Superblocks and save them locally";
|
|
331174
331139
|
static examples = [
|
|
@@ -331228,8 +331193,8 @@ var Pull = class _Pull extends AuthenticatedCommand {
|
|
|
331228
331193
|
[
|
|
331229
331194
|
ctx.existingSuperblocksRootConfig,
|
|
331230
331195
|
ctx.superblocksRootConfigPath
|
|
331231
|
-
] = await (0,
|
|
331232
|
-
ctx.existingSuperblocksResourceConfig = await (0,
|
|
331196
|
+
] = await (0, import_util49.getSuperblocksMonorepoConfigJson)(true);
|
|
331197
|
+
ctx.existingSuperblocksResourceConfig = await (0, import_util49.getSuperblocksResourceConfigIfExists)();
|
|
331233
331198
|
ctx.superblocksRootPath = path48.resolve(
|
|
331234
331199
|
path48.dirname(ctx.superblocksRootConfigPath),
|
|
331235
331200
|
".."
|
|
@@ -331270,7 +331235,7 @@ var Pull = class _Pull extends AuthenticatedCommand {
|
|
|
331270
331235
|
skipSigningVerification: true
|
|
331271
331236
|
});
|
|
331272
331237
|
} catch (error) {
|
|
331273
|
-
if (error instanceof
|
|
331238
|
+
if (error instanceof import_util49.NotFoundError) {
|
|
331274
331239
|
ctx.removedResourceIds.push(resourceId);
|
|
331275
331240
|
} else {
|
|
331276
331241
|
throw error;
|
|
@@ -331286,7 +331251,7 @@ var Pull = class _Pull extends AuthenticatedCommand {
|
|
|
331286
331251
|
skipSigningVerification: true
|
|
331287
331252
|
});
|
|
331288
331253
|
} catch (error) {
|
|
331289
|
-
if (error instanceof
|
|
331254
|
+
if (error instanceof import_util49.NotFoundError) {
|
|
331290
331255
|
ctx.removedResourceIds.push(resourceId);
|
|
331291
331256
|
} else {
|
|
331292
331257
|
throw error;
|
|
@@ -331361,7 +331326,7 @@ Would you like to also delete these resources from your filesystem?`
|
|
|
331361
331326
|
const { branchName } = await this.validateGitSetup(
|
|
331362
331327
|
resource?.resourceType,
|
|
331363
331328
|
resourceId,
|
|
331364
|
-
|
|
331329
|
+
import_util49.ComponentEvent.PULL,
|
|
331365
331330
|
ctx.localBranchName
|
|
331366
331331
|
);
|
|
331367
331332
|
ctx.branchToPullFrom.set(resourceId, branchName);
|
|
@@ -331419,7 +331384,7 @@ ${error.message}.`
|
|
|
331419
331384
|
title: `Pulling application ${resource.location} from branch ${branchName}...`,
|
|
331420
331385
|
task: async (_ctx, task2) => {
|
|
331421
331386
|
const headers = {
|
|
331422
|
-
[
|
|
331387
|
+
[import_util49.COMPONENT_EVENT_HEADER]: import_util49.ComponentEvent.PULL
|
|
331423
331388
|
};
|
|
331424
331389
|
try {
|
|
331425
331390
|
task2.title += `: fetched`;
|
|
@@ -331454,7 +331419,7 @@ ${error.message}.`
|
|
|
331454
331419
|
}
|
|
331455
331420
|
task2.title += `: done`;
|
|
331456
331421
|
} catch (e) {
|
|
331457
|
-
if (e instanceof
|
|
331422
|
+
if (e instanceof import_util49.NotFoundError) {
|
|
331458
331423
|
task2.title += `: not found in this branch. skipped`;
|
|
331459
331424
|
} else {
|
|
331460
331425
|
throw e;
|
|
@@ -331524,7 +331489,7 @@ ${error.message}.`
|
|
|
331524
331489
|
`No resource found with the given location: ${resourcePath}`
|
|
331525
331490
|
);
|
|
331526
331491
|
}
|
|
331527
|
-
const resourceConfig = await (0,
|
|
331492
|
+
const resourceConfig = await (0, import_util49.getSuperblocksResourceConfigIfExists)();
|
|
331528
331493
|
if (resourceConfig) {
|
|
331529
331494
|
return [resourceConfig.id];
|
|
331530
331495
|
}
|
|
@@ -331566,7 +331531,7 @@ ${error.message}.`
|
|
|
331566
331531
|
init_cjs_shims();
|
|
331567
331532
|
import path49 from "node:path";
|
|
331568
331533
|
import { Args as Args5, Flags as Flags10 } from "@oclif/core";
|
|
331569
|
-
var
|
|
331534
|
+
var import_util50 = __toESM(require_dist3(), 1);
|
|
331570
331535
|
init_lodash();
|
|
331571
331536
|
var Push = class _Push extends AuthenticatedCommand {
|
|
331572
331537
|
static description = "Import objects from local filesystem to Superblocks";
|
|
@@ -331613,8 +331578,8 @@ var Push = class _Push extends AuthenticatedCommand {
|
|
|
331613
331578
|
[
|
|
331614
331579
|
ctx.existingSuperblocksRootConfig,
|
|
331615
331580
|
ctx.superblocksRootConfigPath
|
|
331616
|
-
] = await (0,
|
|
331617
|
-
ctx.existingSuperblocksResourceConfig = await (0,
|
|
331581
|
+
] = await (0, import_util50.getSuperblocksMonorepoConfigJson)(true);
|
|
331582
|
+
ctx.existingSuperblocksResourceConfig = await (0, import_util50.getSuperblocksResourceConfigIfExists)();
|
|
331618
331583
|
ctx.superblocksRootPath = path49.resolve(
|
|
331619
331584
|
path49.dirname(ctx.superblocksRootConfigPath),
|
|
331620
331585
|
".."
|
|
@@ -331685,7 +331650,7 @@ If resource is not connected to git repository, pass "main" as branch name.`
|
|
|
331685
331650
|
skipSigningVerification: true
|
|
331686
331651
|
});
|
|
331687
331652
|
} catch (error) {
|
|
331688
|
-
if (error instanceof
|
|
331653
|
+
if (error instanceof import_util50.NotFoundError) {
|
|
331689
331654
|
ctx.removedResourceIds.push(resourceId);
|
|
331690
331655
|
} else {
|
|
331691
331656
|
throw error;
|
|
@@ -331701,7 +331666,7 @@ If resource is not connected to git repository, pass "main" as branch name.`
|
|
|
331701
331666
|
skipSigningVerification: true
|
|
331702
331667
|
});
|
|
331703
331668
|
} catch (error) {
|
|
331704
|
-
if (error instanceof
|
|
331669
|
+
if (error instanceof import_util50.NotFoundError) {
|
|
331705
331670
|
ctx.removedResourceIds.push(resourceId);
|
|
331706
331671
|
} else {
|
|
331707
331672
|
throw error;
|
|
@@ -331780,7 +331745,7 @@ Would you like to also delete these resources from your filesystem?`
|
|
|
331780
331745
|
const { branchName } = await this.validateGitSetup(
|
|
331781
331746
|
resource?.resourceType,
|
|
331782
331747
|
resourceId,
|
|
331783
|
-
|
|
331748
|
+
import_util50.ComponentEvent.PUSH,
|
|
331784
331749
|
ctx.localBranchName
|
|
331785
331750
|
);
|
|
331786
331751
|
ctx.branchToPushTo.set(resourceId, branchName);
|
|
@@ -331870,7 +331835,7 @@ ${error.message}.`
|
|
|
331870
331835
|
task: async (_ctx, task2) => {
|
|
331871
331836
|
let configType;
|
|
331872
331837
|
try {
|
|
331873
|
-
const applicationConfig2 = await (0,
|
|
331838
|
+
const applicationConfig2 = await (0, import_util50.getSuperblocksApplicationV2ConfigJson)(
|
|
331874
331839
|
path49.join(superblocksRootPath, resource.location)
|
|
331875
331840
|
);
|
|
331876
331841
|
configType = applicationConfig2.configType;
|
|
@@ -332039,7 +332004,7 @@ ${error.message}.`
|
|
|
332039
332004
|
`No resource found with the given location: ${resourcePath}`
|
|
332040
332005
|
);
|
|
332041
332006
|
}
|
|
332042
|
-
const resourceConfig = await (0,
|
|
332007
|
+
const resourceConfig = await (0, import_util50.getSuperblocksResourceConfigIfExists)();
|
|
332043
332008
|
if (resourceConfig) {
|
|
332044
332009
|
return [resourceConfig.id];
|
|
332045
332010
|
}
|
|
@@ -332077,7 +332042,7 @@ ${error.message}.`
|
|
|
332077
332042
|
init_cjs_shims();
|
|
332078
332043
|
import path50 from "path";
|
|
332079
332044
|
import { Args as Args6 } from "@oclif/core";
|
|
332080
|
-
var
|
|
332045
|
+
var import_util51 = __toESM(require_dist3(), 1);
|
|
332081
332046
|
var import_fs_extra14 = __toESM(require_lib(), 1);
|
|
332082
332047
|
init_lodash();
|
|
332083
332048
|
var Remove = class _Remove extends AuthenticatedCommand {
|
|
@@ -332112,7 +332077,7 @@ var Remove = class _Remove extends AuthenticatedCommand {
|
|
|
332112
332077
|
[
|
|
332113
332078
|
ctx.existingSuperblocksRootConfig,
|
|
332114
332079
|
ctx.superblocksRootConfigPath
|
|
332115
|
-
] = await (0,
|
|
332080
|
+
] = await (0, import_util51.getSuperblocksMonorepoConfigJson)(true);
|
|
332116
332081
|
ctx.superblocksRootPath = path50.resolve(
|
|
332117
332082
|
path50.dirname(ctx.superblocksRootConfigPath),
|
|
332118
332083
|
".."
|
|
@@ -332199,7 +332164,7 @@ var Remove = class _Remove extends AuthenticatedCommand {
|
|
|
332199
332164
|
{
|
|
332200
332165
|
title: "Updating Superblocks project file...",
|
|
332201
332166
|
task: async (ctx) => {
|
|
332202
|
-
const [superblocksRootConfig, rootConfigPath] = await (0,
|
|
332167
|
+
const [superblocksRootConfig, rootConfigPath] = await (0, import_util51.getSuperblocksMonorepoConfigJson)(true);
|
|
332203
332168
|
for (const removedResourceId of ctx.removedResourceIds) {
|
|
332204
332169
|
delete superblocksRootConfig.resources[removedResourceId];
|
|
332205
332170
|
}
|
|
@@ -332302,7 +332267,7 @@ function getResourceIdFromLocation(ctx, resourceLocation) {
|
|
|
332302
332267
|
init_cjs_shims();
|
|
332303
332268
|
import path51 from "node:path";
|
|
332304
332269
|
import { Args as Args7, Flags as Flags11 } from "@oclif/core";
|
|
332305
|
-
var
|
|
332270
|
+
var import_util52 = __toESM(require_dist3(), 1);
|
|
332306
332271
|
init_lodash();
|
|
332307
332272
|
var Upload3 = class _Upload extends AuthenticatedCommand {
|
|
332308
332273
|
static description = "Upload your local files to Superblocks live edit";
|
|
@@ -332339,8 +332304,8 @@ var Upload3 = class _Upload extends AuthenticatedCommand {
|
|
|
332339
332304
|
[
|
|
332340
332305
|
ctx.existingSuperblocksRootConfig,
|
|
332341
332306
|
ctx.superblocksRootConfigPath
|
|
332342
|
-
] = await (0,
|
|
332343
|
-
ctx.existingSuperblocksResourceConfig = await (0,
|
|
332307
|
+
] = await (0, import_util52.getSuperblocksMonorepoConfigJson)(true);
|
|
332308
|
+
ctx.existingSuperblocksResourceConfig = await (0, import_util52.getSuperblocksResourceConfigIfExists)();
|
|
332344
332309
|
ctx.superblocksRootPath = path51.resolve(
|
|
332345
332310
|
path51.dirname(ctx.superblocksRootConfigPath),
|
|
332346
332311
|
".."
|
|
@@ -332375,7 +332340,7 @@ var Upload3 = class _Upload extends AuthenticatedCommand {
|
|
|
332375
332340
|
skipSigningVerification: true
|
|
332376
332341
|
});
|
|
332377
332342
|
} catch (error) {
|
|
332378
|
-
if (error instanceof
|
|
332343
|
+
if (error instanceof import_util52.NotFoundError) {
|
|
332379
332344
|
ctx.removedResourceIds.push(resourceId);
|
|
332380
332345
|
} else {
|
|
332381
332346
|
throw error;
|
|
@@ -332391,7 +332356,7 @@ var Upload3 = class _Upload extends AuthenticatedCommand {
|
|
|
332391
332356
|
skipSigningVerification: true
|
|
332392
332357
|
});
|
|
332393
332358
|
} catch (error) {
|
|
332394
|
-
if (error instanceof
|
|
332359
|
+
if (error instanceof import_util52.NotFoundError) {
|
|
332395
332360
|
ctx.removedResourceIds.push(resourceId);
|
|
332396
332361
|
} else {
|
|
332397
332362
|
throw error;
|
|
@@ -332498,7 +332463,7 @@ Would you like to also delete these resources from your filesystem?`
|
|
|
332498
332463
|
title: `Uploading application ${resource.location}...`,
|
|
332499
332464
|
task: async (_ctx, task2) => {
|
|
332500
332465
|
try {
|
|
332501
|
-
await (0,
|
|
332466
|
+
await (0, import_util52.getSuperblocksApplicationV2ConfigJson)(
|
|
332502
332467
|
path51.join(superblocksRootPath, resource.location)
|
|
332503
332468
|
);
|
|
332504
332469
|
} catch {
|
|
@@ -332561,7 +332526,7 @@ Would you like to also delete these resources from your filesystem?`
|
|
|
332561
332526
|
`No resource found with the given location: ${resourcePath}`
|
|
332562
332527
|
);
|
|
332563
332528
|
}
|
|
332564
|
-
const resourceConfig = await (0,
|
|
332529
|
+
const resourceConfig = await (0, import_util52.getSuperblocksResourceConfigIfExists)();
|
|
332565
332530
|
if (resourceConfig) {
|
|
332566
332531
|
return [resourceConfig.id];
|
|
332567
332532
|
}
|