@antlur/backstage 1.7.0 → 1.7.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/dist/cli/actions/sync-blocks.d.ts +3 -0
- package/dist/cli/actions/sync-blocks.d.ts.map +1 -0
- package/dist/cli/actions/sync-blocks.js +28 -0
- package/dist/cli/actions/sync-layouts.d.ts +3 -0
- package/dist/cli/actions/sync-layouts.d.ts.map +1 -0
- package/dist/cli/actions/sync-layouts.js +33 -0
- package/dist/cli/cli.d.ts +3 -0
- package/dist/cli/cli.d.ts.map +1 -0
- package/dist/cli/cli.js +35 -0
- package/dist/cli/load-config.d.ts +3 -0
- package/dist/cli/load-config.d.ts.map +1 -0
- package/dist/cli/load-config.js +42 -0
- package/dist/client.d.ts +13 -13
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +27 -13
- package/dist/endpoints/alerts.d.ts +1 -1
- package/dist/endpoints/alerts.d.ts.map +1 -1
- package/dist/endpoints/alerts.js +1 -1
- package/dist/endpoints/base.js +1 -0
- package/dist/endpoints/blocks.d.ts +1 -1
- package/dist/endpoints/blocks.d.ts.map +1 -1
- package/dist/endpoints/blocks.js +1 -1
- package/dist/endpoints/events.d.ts +1 -1
- package/dist/endpoints/events.d.ts.map +1 -1
- package/dist/endpoints/events.js +1 -1
- package/dist/endpoints/instagram.d.ts +1 -1
- package/dist/endpoints/instagram.d.ts.map +1 -1
- package/dist/endpoints/instagram.js +1 -1
- package/dist/endpoints/layouts.d.ts +1 -1
- package/dist/endpoints/layouts.d.ts.map +1 -1
- package/dist/endpoints/layouts.js +1 -1
- package/dist/endpoints/locations.d.ts +1 -1
- package/dist/endpoints/locations.d.ts.map +1 -1
- package/dist/endpoints/locations.js +1 -1
- package/dist/endpoints/media.d.ts +1 -1
- package/dist/endpoints/media.d.ts.map +1 -1
- package/dist/endpoints/media.js +1 -1
- package/dist/endpoints/menus.d.ts +1 -1
- package/dist/endpoints/menus.d.ts.map +1 -1
- package/dist/endpoints/menus.js +1 -1
- package/dist/endpoints/navigation.d.ts +1 -1
- package/dist/endpoints/navigation.d.ts.map +1 -1
- package/dist/endpoints/navigation.js +1 -1
- package/dist/endpoints/pages.d.ts +1 -1
- package/dist/endpoints/pages.d.ts.map +1 -1
- package/dist/endpoints/pages.js +1 -1
- package/dist/endpoints/press.d.ts +1 -1
- package/dist/endpoints/press.d.ts.map +1 -1
- package/dist/endpoints/press.js +1 -1
- package/dist/endpoints/website.d.ts +1 -1
- package/dist/endpoints/website.d.ts.map +1 -1
- package/dist/endpoints/website.js +1 -1
- package/package.json +12 -3
- package/src/cli/actions/sync-blocks.ts +32 -0
- package/src/cli/actions/sync-layouts.ts +36 -0
- package/src/cli/cli.ts +45 -0
- package/src/cli/load-config.ts +48 -0
- package/src/client.ts +13 -13
- package/src/endpoints/alerts.ts +1 -1
- package/src/endpoints/blocks.ts +1 -1
- package/src/endpoints/events.ts +1 -1
- package/src/endpoints/instagram.ts +1 -1
- package/src/endpoints/layouts.ts +1 -1
- package/src/endpoints/locations.ts +1 -1
- package/src/endpoints/media.ts +1 -1
- package/src/endpoints/menus.ts +1 -1
- package/src/endpoints/navigation.ts +1 -1
- package/src/endpoints/pages.ts +1 -1
- package/src/endpoints/press.ts +1 -1
- package/src/endpoints/website.ts +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-blocks.d.ts","sourceRoot":"","sources":["../../../src/cli/actions/sync-blocks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAG3D,wBAAsB,UAAU,CAAC,MAAM,EAAE,mBAAmB,iBA4B3D"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BackstageClient } from "../../client.js";
|
|
2
|
+
export async function syncBlocks(config) {
|
|
3
|
+
const client = new BackstageClient(config);
|
|
4
|
+
if (!config.blocks || !config.blocks.length) {
|
|
5
|
+
console.log("No blocks found in config");
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
config.blocks.forEach(async (block) => {
|
|
9
|
+
const blockData = {
|
|
10
|
+
name: block.name,
|
|
11
|
+
slug: block.slug,
|
|
12
|
+
schema: block.schema,
|
|
13
|
+
};
|
|
14
|
+
try {
|
|
15
|
+
await client.blocks.create(blockData);
|
|
16
|
+
console.log(`Block ${block.slug} created`);
|
|
17
|
+
}
|
|
18
|
+
catch (err) {
|
|
19
|
+
if (err.response.status === 409) {
|
|
20
|
+
const id = err.response.data;
|
|
21
|
+
console.log(`Block ${block.slug} already exists with id ${id}. Updating...`);
|
|
22
|
+
await client.blocks.update(id, blockData);
|
|
23
|
+
console.log(`Block ${block.slug} updated`);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-layouts.d.ts","sourceRoot":"","sources":["../../../src/cli/actions/sync-layouts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAG3D,wBAAsB,WAAW,CAAC,MAAM,EAAE,mBAAmB,iBAgC5D"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { BackstageClient } from "../../client.js";
|
|
2
|
+
export async function syncLayouts(config) {
|
|
3
|
+
const client = new BackstageClient(config);
|
|
4
|
+
if (!config.layouts || !config.layouts.length) {
|
|
5
|
+
console.log("No layouts found in config");
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
config.layouts.forEach(async (layout) => {
|
|
9
|
+
const layoutData = {
|
|
10
|
+
name: layout.name,
|
|
11
|
+
slug: layout.slug,
|
|
12
|
+
schema: layout.schema,
|
|
13
|
+
};
|
|
14
|
+
try {
|
|
15
|
+
await client.layouts.create(layoutData);
|
|
16
|
+
console.log(`Layout ${layout.slug} created`);
|
|
17
|
+
}
|
|
18
|
+
catch (err) {
|
|
19
|
+
if (err.response.status === 409) {
|
|
20
|
+
const id = err.response.data;
|
|
21
|
+
console.log(`Layout ${layout.slug} already exists with id ${id}. Updating...`);
|
|
22
|
+
try {
|
|
23
|
+
const res = await client.layouts.update(id, layoutData);
|
|
24
|
+
console.log(`Layout ${layout.slug} updated`, res);
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
console.error(`Error updating layout ${layout.slug}:`, err);
|
|
28
|
+
}
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli/cli.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { config } from "dotenv";
|
|
3
|
+
import { resolve } from "path";
|
|
4
|
+
import { program } from "commander";
|
|
5
|
+
import { loadBackstageConfig } from "./load-config.js";
|
|
6
|
+
import { syncBlocks } from "./actions/sync-blocks.js";
|
|
7
|
+
import { syncLayouts } from "./actions/sync-layouts.js";
|
|
8
|
+
config({ path: resolve(process.cwd(), ".env") });
|
|
9
|
+
program
|
|
10
|
+
.name("backstage")
|
|
11
|
+
.description("CLI tool for Backstage CMS")
|
|
12
|
+
.version(process.env.npm_package_version || "1.0.0");
|
|
13
|
+
program
|
|
14
|
+
.command("sync <type>")
|
|
15
|
+
.description("Sync blocks and layouts with the Backstage CMS")
|
|
16
|
+
.action(async (type) => {
|
|
17
|
+
const backstageConfig = await loadBackstageConfig();
|
|
18
|
+
if (!backstageConfig) {
|
|
19
|
+
console.error("Failed to load backstage.config.ts");
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (type === "blocks") {
|
|
23
|
+
syncBlocks(backstageConfig);
|
|
24
|
+
}
|
|
25
|
+
if (type === "layouts") {
|
|
26
|
+
syncLayouts(backstageConfig);
|
|
27
|
+
}
|
|
28
|
+
if (type === "all") {
|
|
29
|
+
syncBlocks(backstageConfig);
|
|
30
|
+
syncLayouts(backstageConfig);
|
|
31
|
+
}
|
|
32
|
+
console.error(`Unknown type: ${type}`);
|
|
33
|
+
return;
|
|
34
|
+
});
|
|
35
|
+
program.parse();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-config.d.ts","sourceRoot":"","sources":["../../src/cli/load-config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAErD,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CA2C/E"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import { createServer, mergeConfig, loadConfigFromFile } from "vite";
|
|
3
|
+
export async function loadBackstageConfig() {
|
|
4
|
+
try {
|
|
5
|
+
const configPath = path.resolve(process.cwd(), "backstage/config.ts");
|
|
6
|
+
// Load user's Vite configuration
|
|
7
|
+
const userViteConfig = await loadConfigFromFile({
|
|
8
|
+
command: "serve",
|
|
9
|
+
mode: "development",
|
|
10
|
+
});
|
|
11
|
+
// This is a hack because the react-router plugin was throwing errors
|
|
12
|
+
const userPlugins = userViteConfig?.config?.plugins?.filter((plugin) => {
|
|
13
|
+
return plugin.name === "vite-tsconfig-paths";
|
|
14
|
+
});
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
userViteConfig.config.plugins = userPlugins;
|
|
17
|
+
// Merge with defaults
|
|
18
|
+
const viteConfig = mergeConfig(userViteConfig?.config ?? {}, {
|
|
19
|
+
configFile: false, // Disable auto config loading
|
|
20
|
+
resolve: {
|
|
21
|
+
alias: userViteConfig?.config?.resolve?.alias ?? {},
|
|
22
|
+
},
|
|
23
|
+
server: { middlewareMode: true },
|
|
24
|
+
});
|
|
25
|
+
// Create Vite server with user's aliases
|
|
26
|
+
const server = await createServer(viteConfig);
|
|
27
|
+
// Dynamically import the config
|
|
28
|
+
const module = await server.ssrLoadModule(configPath);
|
|
29
|
+
await server.close();
|
|
30
|
+
if (module && typeof module.default === "object") {
|
|
31
|
+
return module.default;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
console.warn("backstage/config.ts does not export a default object");
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
console.error("Failed to load backstage/config.ts:", error);
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
}
|
package/dist/client.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { AxiosInstance, AxiosRequestConfig } from "axios";
|
|
2
|
-
import { BackstageUserConfig } from "./config";
|
|
3
|
-
import { AlertService } from "./endpoints/alerts";
|
|
4
|
-
import { BlocksService } from "./endpoints/blocks";
|
|
5
|
-
import { EventService } from "./endpoints/events";
|
|
6
|
-
import { InstagramService } from "./endpoints/instagram";
|
|
7
|
-
import { LayoutService } from "./endpoints/layouts";
|
|
8
|
-
import { LocationService } from "./endpoints/locations";
|
|
9
|
-
import { MenuService } from "./endpoints/menus";
|
|
10
|
-
import { NavigationService } from "./endpoints/navigation";
|
|
11
|
-
import { PageService } from "./endpoints/pages";
|
|
12
|
-
import { PressService } from "./endpoints/press";
|
|
13
|
-
import { WebsiteService } from "./endpoints/website";
|
|
14
|
-
import { MediaService } from "./endpoints/media";
|
|
2
|
+
import { BackstageUserConfig } from "./config.js";
|
|
3
|
+
import { AlertService } from "./endpoints/alerts.js";
|
|
4
|
+
import { BlocksService } from "./endpoints/blocks.js";
|
|
5
|
+
import { EventService } from "./endpoints/events.js";
|
|
6
|
+
import { InstagramService } from "./endpoints/instagram.js";
|
|
7
|
+
import { LayoutService } from "./endpoints/layouts.js";
|
|
8
|
+
import { LocationService } from "./endpoints/locations.js";
|
|
9
|
+
import { MenuService } from "./endpoints/menus.js";
|
|
10
|
+
import { NavigationService } from "./endpoints/navigation.js";
|
|
11
|
+
import { PageService } from "./endpoints/pages.js";
|
|
12
|
+
import { PressService } from "./endpoints/press.js";
|
|
13
|
+
import { WebsiteService } from "./endpoints/website.js";
|
|
14
|
+
import { MediaService } from "./endpoints/media.js";
|
|
15
15
|
export declare class BackstageClient {
|
|
16
16
|
private instance;
|
|
17
17
|
readonly alerts: AlertService;
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAAE,kBAAkB,EAA6B,MAAM,OAAO,CAAC;AAC5F,OAAO,EAAmB,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAAE,kBAAkB,EAA6B,MAAM,OAAO,CAAC;AAC5F,OAAO,EAAmB,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAgB;IAGhC,SAAgB,MAAM,EAAE,YAAY,CAAC;IACrC,SAAgB,MAAM,EAAE,aAAa,CAAC;IACtC,SAAgB,MAAM,EAAE,YAAY,CAAC;IACrC,SAAgB,SAAS,EAAE,gBAAgB,CAAC;IAC5C,SAAgB,OAAO,EAAE,aAAa,CAAC;IACvC,SAAgB,SAAS,EAAE,eAAe,CAAC;IAC3C,SAAgB,KAAK,EAAE,YAAY,CAAC;IACpC,SAAgB,KAAK,EAAE,WAAW,CAAC;IACnC,SAAgB,UAAU,EAAE,iBAAiB,CAAC;IAC9C,SAAgB,KAAK,EAAE,WAAW,CAAC;IACnC,SAAgB,KAAK,EAAE,YAAY,CAAC;IACpC,SAAgB,OAAO,EAAE,cAAc,CAAC;gBAE5B,MAAM,CAAC,EAAE,mBAAmB;IAwE3B,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,CAAC,CAAC;IAKtE,IAAI,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,CAAC,CAAC;IAKvF,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,CAAC,CAAC;IAKtF,KAAK,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,CAAC,CAAC;IAKxF,MAAM,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,CAAC,CAAC;IAK/E,gBAAgB,IAAI,aAAa;CAGzC"}
|
package/dist/client.js
CHANGED
|
@@ -1,18 +1,32 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
|
-
import { getGlobalConfig } from "./config";
|
|
3
|
-
import { AlertService } from "./endpoints/alerts";
|
|
4
|
-
import { BlocksService } from "./endpoints/blocks";
|
|
5
|
-
import { EventService } from "./endpoints/events";
|
|
6
|
-
import { InstagramService } from "./endpoints/instagram";
|
|
7
|
-
import { LayoutService } from "./endpoints/layouts";
|
|
8
|
-
import { LocationService } from "./endpoints/locations";
|
|
9
|
-
import { MenuService } from "./endpoints/menus";
|
|
10
|
-
import { NavigationService } from "./endpoints/navigation";
|
|
11
|
-
import { PageService } from "./endpoints/pages";
|
|
12
|
-
import { PressService } from "./endpoints/press";
|
|
13
|
-
import { WebsiteService } from "./endpoints/website";
|
|
14
|
-
import { MediaService } from "./endpoints/media";
|
|
2
|
+
import { getGlobalConfig } from "./config.js";
|
|
3
|
+
import { AlertService } from "./endpoints/alerts.js";
|
|
4
|
+
import { BlocksService } from "./endpoints/blocks.js";
|
|
5
|
+
import { EventService } from "./endpoints/events.js";
|
|
6
|
+
import { InstagramService } from "./endpoints/instagram.js";
|
|
7
|
+
import { LayoutService } from "./endpoints/layouts.js";
|
|
8
|
+
import { LocationService } from "./endpoints/locations.js";
|
|
9
|
+
import { MenuService } from "./endpoints/menus.js";
|
|
10
|
+
import { NavigationService } from "./endpoints/navigation.js";
|
|
11
|
+
import { PageService } from "./endpoints/pages.js";
|
|
12
|
+
import { PressService } from "./endpoints/press.js";
|
|
13
|
+
import { WebsiteService } from "./endpoints/website.js";
|
|
14
|
+
import { MediaService } from "./endpoints/media.js";
|
|
15
15
|
export class BackstageClient {
|
|
16
|
+
instance;
|
|
17
|
+
// Service Instances
|
|
18
|
+
alerts;
|
|
19
|
+
blocks;
|
|
20
|
+
events;
|
|
21
|
+
instagram;
|
|
22
|
+
layouts;
|
|
23
|
+
locations;
|
|
24
|
+
media;
|
|
25
|
+
menus;
|
|
26
|
+
navigation;
|
|
27
|
+
pages;
|
|
28
|
+
press;
|
|
29
|
+
website;
|
|
16
30
|
constructor(config) {
|
|
17
31
|
// If no config is passed, try to get from the global config
|
|
18
32
|
const globalConfig = getGlobalConfig();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alerts.d.ts","sourceRoot":"","sources":["../../src/endpoints/alerts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"alerts.d.ts","sourceRoot":"","sources":["../../src/endpoints/alerts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,qBAAa,YAAa,SAAQ,WAAW;IACrC,SAAS,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;CAIpC"}
|
package/dist/endpoints/alerts.js
CHANGED
package/dist/endpoints/base.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../src/endpoints/blocks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../src/endpoints/blocks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,GAAG,CAAC;CACb;AAED,qBAAa,aAAc,SAAQ,WAAW;IACtC,GAAG;IAEH,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,WAAW;IAK1C,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,WAAW;CAI7D"}
|
package/dist/endpoints/blocks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/endpoints/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/endpoints/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,qBAAa,YAAa,SAAQ,WAAW;IACrC,SAAS,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;IAK7B,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;IAKpC,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;CAInD"}
|
package/dist/endpoints/events.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instagram.d.ts","sourceRoot":"","sources":["../../src/endpoints/instagram.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,aAAa,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"instagram.d.ts","sourceRoot":"","sources":["../../src/endpoints/instagram.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,aAAa,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,qBAAa,gBAAiB,SAAQ,WAAW;IACzC,MAAM,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;CAIzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layouts.d.ts","sourceRoot":"","sources":["../../src/endpoints/layouts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"layouts.d.ts","sourceRoot":"","sources":["../../src/endpoints/layouts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,GAAG,CAAC;CACb;AAED,qBAAa,aAAc,SAAQ,WAAW;IACtC,GAAG;IAEH,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,YAAY;IAK3C,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,YAAY;CAI9D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Location } from "../types";
|
|
2
|
-
import { BaseService } from "./base";
|
|
2
|
+
import { BaseService } from "./base.js";
|
|
3
3
|
export declare class LocationService extends BaseService {
|
|
4
4
|
getLocations(): Promise<Location[]>;
|
|
5
5
|
getLocationBySlug(slug: string): Promise<Location | Location[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locations.d.ts","sourceRoot":"","sources":["../../src/endpoints/locations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"locations.d.ts","sourceRoot":"","sources":["../../src/endpoints/locations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,qBAAa,eAAgB,SAAQ,WAAW;IACxC,YAAY,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAYnC,iBAAiB,CAAC,IAAI,EAAE,MAAM;CAUrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../src/endpoints/media.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../src/endpoints/media.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,qBAAa,YAAa,SAAQ,WAAW;IACrC,GAAG;CAIV"}
|
package/dist/endpoints/media.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menus.d.ts","sourceRoot":"","sources":["../../src/endpoints/menus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,IAAI,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"menus.d.ts","sourceRoot":"","sources":["../../src/endpoints/menus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,IAAI,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,qBAAa,WAAY,SAAQ,WAAW;IACpC,QAAQ,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;IAM3B,OAAO,CAAC,EAAE,EAAE,MAAM;IAWlB,aAAa,CAAC,IAAI,EAAE,MAAM;CAYjC"}
|
package/dist/endpoints/menus.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Navigation } from "../types";
|
|
2
|
-
import { BaseService } from "./base";
|
|
2
|
+
import { BaseService } from "./base.js";
|
|
3
3
|
export declare class NavigationService extends BaseService {
|
|
4
4
|
getNavigations(): Promise<Navigation[]>;
|
|
5
5
|
getDefaultNavigation(): Promise<Navigation>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/endpoints/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4C,UAAU,EAAE,MAAM,UAAU,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/endpoints/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4C,UAAU,EAAE,MAAM,UAAU,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,qBAAa,iBAAkB,SAAQ,WAAW;IAC1C,cAAc,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;IAYvC,oBAAoB,IAAI,OAAO,CAAC,UAAU,CAAC;IAK3C,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;CAcrD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pages.d.ts","sourceRoot":"","sources":["../../src/endpoints/pages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,IAAI,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"pages.d.ts","sourceRoot":"","sources":["../../src/endpoints/pages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,IAAI,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,qBAAa,WAAY,SAAQ,WAAW;IACpC,QAAQ,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;IAK3B,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKlC,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK1C,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAK5B,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAIzD"}
|
package/dist/endpoints/pages.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"press.d.ts","sourceRoot":"","sources":["../../src/endpoints/press.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"press.d.ts","sourceRoot":"","sources":["../../src/endpoints/press.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,qBAAa,YAAa,SAAQ,WAAW;IACrC,QAAQ,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;CAInC"}
|
package/dist/endpoints/press.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"website.d.ts","sourceRoot":"","sources":["../../src/endpoints/website.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"website.d.ts","sourceRoot":"","sources":["../../src/endpoints/website.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,qBAAa,cAAe,SAAQ,WAAW;IACvC,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAK9B,MAAM,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAKlC"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antlur/backstage",
|
|
3
3
|
"author": "Anthony Holmes",
|
|
4
|
-
"version": "1.7.
|
|
4
|
+
"version": "1.7.1",
|
|
5
5
|
"description": "A simple client for Backstage CMS",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|
|
8
|
+
"module": "./dist/index.js",
|
|
8
9
|
"types": "./dist/types/index.d.ts",
|
|
9
10
|
"exports": {
|
|
10
11
|
".": {
|
|
@@ -28,9 +29,14 @@
|
|
|
28
29
|
"clean": "rm -rf dist",
|
|
29
30
|
"build": "npm run clean && tsc",
|
|
30
31
|
"prepublishOnly": "npm run build && npm test",
|
|
31
|
-
"
|
|
32
|
+
"dev": "tsc --watch",
|
|
33
|
+
"cli": "vite-node src/cli/cli.ts",
|
|
34
|
+
"postbuild": "chmod +x ./dist/cli/cli.js",
|
|
32
35
|
"test": "echo \"No tests yet\" && exit 0"
|
|
33
36
|
},
|
|
37
|
+
"bin": {
|
|
38
|
+
"backstage": "./dist/cli/cli.js"
|
|
39
|
+
},
|
|
34
40
|
"peerDependencies": {
|
|
35
41
|
"luxon": "^3.5.0",
|
|
36
42
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -38,7 +44,10 @@
|
|
|
38
44
|
},
|
|
39
45
|
"dependencies": {
|
|
40
46
|
"axios": "^1.7.9",
|
|
41
|
-
"
|
|
47
|
+
"commander": "^13.1.0",
|
|
48
|
+
"dotenv": "^16.4.7",
|
|
49
|
+
"schema-dts": "^1.1.2",
|
|
50
|
+
"vite-node": "^3.0.5"
|
|
42
51
|
},
|
|
43
52
|
"devDependencies": {
|
|
44
53
|
"@types/luxon": "^3.4.2",
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { BackstageUserConfig } from "../../config.js";
|
|
2
|
+
import { BackstageClient } from "../../client.js";
|
|
3
|
+
|
|
4
|
+
export async function syncBlocks(config: BackstageUserConfig) {
|
|
5
|
+
const client = new BackstageClient(config);
|
|
6
|
+
|
|
7
|
+
if (!config.blocks || !config.blocks.length) {
|
|
8
|
+
console.log("No blocks found in config");
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
config.blocks.forEach(async (block) => {
|
|
13
|
+
const blockData = {
|
|
14
|
+
name: block.name,
|
|
15
|
+
slug: block.slug,
|
|
16
|
+
schema: block.schema,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
await client.blocks.create(blockData);
|
|
21
|
+
console.log(`Block ${block.slug} created`);
|
|
22
|
+
} catch (err: any) {
|
|
23
|
+
if (err.response.status === 409) {
|
|
24
|
+
const id = err.response.data;
|
|
25
|
+
console.log(`Block ${block.slug} already exists with id ${id}. Updating...`);
|
|
26
|
+
await client.blocks.update(id, blockData);
|
|
27
|
+
console.log(`Block ${block.slug} updated`);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { BackstageUserConfig } from "../../config.js";
|
|
2
|
+
import { BackstageClient } from "../../client.js";
|
|
3
|
+
|
|
4
|
+
export async function syncLayouts(config: BackstageUserConfig) {
|
|
5
|
+
const client = new BackstageClient(config);
|
|
6
|
+
|
|
7
|
+
if (!config.layouts || !config.layouts.length) {
|
|
8
|
+
console.log("No layouts found in config");
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
config.layouts.forEach(async (layout) => {
|
|
13
|
+
const layoutData = {
|
|
14
|
+
name: layout.name,
|
|
15
|
+
slug: layout.slug,
|
|
16
|
+
schema: layout.schema,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
await client.layouts.create(layoutData);
|
|
21
|
+
console.log(`Layout ${layout.slug} created`);
|
|
22
|
+
} catch (err: any) {
|
|
23
|
+
if (err.response.status === 409) {
|
|
24
|
+
const id = err.response.data;
|
|
25
|
+
console.log(`Layout ${layout.slug} already exists with id ${id}. Updating...`);
|
|
26
|
+
try {
|
|
27
|
+
const res = await client.layouts.update(id, layoutData);
|
|
28
|
+
console.log(`Layout ${layout.slug} updated`, res);
|
|
29
|
+
} catch (err) {
|
|
30
|
+
console.error(`Error updating layout ${layout.slug}:`, err);
|
|
31
|
+
}
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
package/src/cli/cli.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { config } from "dotenv";
|
|
4
|
+
import { resolve } from "path";
|
|
5
|
+
import { program } from "commander";
|
|
6
|
+
import { loadBackstageConfig } from "./load-config.js";
|
|
7
|
+
import { syncBlocks } from "./actions/sync-blocks.js";
|
|
8
|
+
import { syncLayouts } from "./actions/sync-layouts.js";
|
|
9
|
+
|
|
10
|
+
config({ path: resolve(process.cwd(), ".env") });
|
|
11
|
+
|
|
12
|
+
program
|
|
13
|
+
.name("backstage")
|
|
14
|
+
.description("CLI tool for Backstage CMS")
|
|
15
|
+
.version(process.env.npm_package_version || "1.0.0");
|
|
16
|
+
|
|
17
|
+
program
|
|
18
|
+
.command("sync <type>")
|
|
19
|
+
.description("Sync blocks and layouts with the Backstage CMS")
|
|
20
|
+
.action(async (type) => {
|
|
21
|
+
const backstageConfig = await loadBackstageConfig();
|
|
22
|
+
|
|
23
|
+
if (!backstageConfig) {
|
|
24
|
+
console.error("Failed to load backstage.config.ts");
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (type === "blocks") {
|
|
29
|
+
syncBlocks(backstageConfig);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (type === "layouts") {
|
|
33
|
+
syncLayouts(backstageConfig);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (type === "all") {
|
|
37
|
+
syncBlocks(backstageConfig);
|
|
38
|
+
syncLayouts(backstageConfig);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
console.error(`Unknown type: ${type}`);
|
|
42
|
+
return;
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
program.parse();
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import { createServer, mergeConfig, loadConfigFromFile } from "vite";
|
|
3
|
+
import type { BackstageUserConfig } from "../config";
|
|
4
|
+
|
|
5
|
+
export async function loadBackstageConfig(): Promise<BackstageUserConfig | null> {
|
|
6
|
+
try {
|
|
7
|
+
const configPath = path.resolve(process.cwd(), "backstage/config.ts");
|
|
8
|
+
|
|
9
|
+
// Load user's Vite configuration
|
|
10
|
+
const userViteConfig = await loadConfigFromFile({
|
|
11
|
+
command: "serve",
|
|
12
|
+
mode: "development",
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
// This is a hack because the react-router plugin was throwing errors
|
|
16
|
+
const userPlugins = userViteConfig?.config?.plugins?.filter((plugin: any) => {
|
|
17
|
+
return plugin.name === "vite-tsconfig-paths";
|
|
18
|
+
});
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
userViteConfig.config.plugins = userPlugins;
|
|
21
|
+
|
|
22
|
+
// Merge with defaults
|
|
23
|
+
const viteConfig = mergeConfig(userViteConfig?.config ?? {}, {
|
|
24
|
+
configFile: false, // Disable auto config loading
|
|
25
|
+
resolve: {
|
|
26
|
+
alias: userViteConfig?.config?.resolve?.alias ?? {},
|
|
27
|
+
},
|
|
28
|
+
server: { middlewareMode: true },
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// Create Vite server with user's aliases
|
|
32
|
+
const server = await createServer(viteConfig);
|
|
33
|
+
|
|
34
|
+
// Dynamically import the config
|
|
35
|
+
const module = await server.ssrLoadModule(configPath);
|
|
36
|
+
await server.close();
|
|
37
|
+
|
|
38
|
+
if (module && typeof module.default === "object") {
|
|
39
|
+
return module.default;
|
|
40
|
+
} else {
|
|
41
|
+
console.warn("backstage/config.ts does not export a default object");
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
} catch (error) {
|
|
45
|
+
console.error("Failed to load backstage/config.ts:", error);
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
}
|
package/src/client.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, AxiosError } from "axios";
|
|
2
|
-
import { getGlobalConfig, BackstageUserConfig } from "./config";
|
|
3
|
-
import { AlertService } from "./endpoints/alerts";
|
|
4
|
-
import { BlocksService } from "./endpoints/blocks";
|
|
5
|
-
import { EventService } from "./endpoints/events";
|
|
6
|
-
import { InstagramService } from "./endpoints/instagram";
|
|
7
|
-
import { LayoutService } from "./endpoints/layouts";
|
|
8
|
-
import { LocationService } from "./endpoints/locations";
|
|
9
|
-
import { MenuService } from "./endpoints/menus";
|
|
10
|
-
import { NavigationService } from "./endpoints/navigation";
|
|
11
|
-
import { PageService } from "./endpoints/pages";
|
|
12
|
-
import { PressService } from "./endpoints/press";
|
|
13
|
-
import { WebsiteService } from "./endpoints/website";
|
|
14
|
-
import { MediaService } from "./endpoints/media";
|
|
2
|
+
import { getGlobalConfig, BackstageUserConfig } from "./config.js";
|
|
3
|
+
import { AlertService } from "./endpoints/alerts.js";
|
|
4
|
+
import { BlocksService } from "./endpoints/blocks.js";
|
|
5
|
+
import { EventService } from "./endpoints/events.js";
|
|
6
|
+
import { InstagramService } from "./endpoints/instagram.js";
|
|
7
|
+
import { LayoutService } from "./endpoints/layouts.js";
|
|
8
|
+
import { LocationService } from "./endpoints/locations.js";
|
|
9
|
+
import { MenuService } from "./endpoints/menus.js";
|
|
10
|
+
import { NavigationService } from "./endpoints/navigation.js";
|
|
11
|
+
import { PageService } from "./endpoints/pages.js";
|
|
12
|
+
import { PressService } from "./endpoints/press.js";
|
|
13
|
+
import { WebsiteService } from "./endpoints/website.js";
|
|
14
|
+
import { MediaService } from "./endpoints/media.js";
|
|
15
15
|
|
|
16
16
|
export class BackstageClient {
|
|
17
17
|
private instance: AxiosInstance;
|
package/src/endpoints/alerts.ts
CHANGED
package/src/endpoints/blocks.ts
CHANGED
package/src/endpoints/events.ts
CHANGED
package/src/endpoints/layouts.ts
CHANGED
package/src/endpoints/media.ts
CHANGED
package/src/endpoints/menus.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiSingleResponse, ApiCollectionResponse, Navigation } from "../types";
|
|
2
|
-
import { BaseService } from "./base";
|
|
2
|
+
import { BaseService } from "./base.js";
|
|
3
3
|
|
|
4
4
|
export class NavigationService extends BaseService {
|
|
5
5
|
async getNavigations(): Promise<Navigation[]> {
|
package/src/endpoints/pages.ts
CHANGED
package/src/endpoints/press.ts
CHANGED
package/src/endpoints/website.ts
CHANGED