@ikas/component-cli 1.4.0-beta.40 → 1.4.0-beta.43
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/commands/add-sections-to-page.d.ts +3 -0
- package/dist/commands/add-sections-to-page.d.ts.map +1 -0
- package/dist/commands/add-sections-to-page.js +39 -0
- package/dist/commands/add-sections-to-page.js.map +1 -0
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +168 -5
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/create-page.d.ts +3 -0
- package/dist/commands/create-page.d.ts.map +1 -0
- package/dist/commands/create-page.js +31 -0
- package/dist/commands/create-page.js.map +1 -0
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +118 -66
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/get-available-values.d.ts +3 -0
- package/dist/commands/get-available-values.d.ts.map +1 -0
- package/dist/commands/get-available-values.js +49 -0
- package/dist/commands/get-available-values.js.map +1 -0
- package/dist/commands/get-component-props.d.ts +3 -0
- package/dist/commands/get-component-props.d.ts.map +1 -0
- package/dist/commands/get-component-props.js +32 -0
- package/dist/commands/get-component-props.js.map +1 -0
- package/dist/commands/get-page-by-type.d.ts +3 -0
- package/dist/commands/get-page-by-type.d.ts.map +1 -0
- package/dist/commands/get-page-by-type.js +25 -0
- package/dist/commands/get-page-by-type.js.map +1 -0
- package/dist/commands/get-section-values.d.ts +3 -0
- package/dist/commands/get-section-values.d.ts.map +1 -0
- package/dist/commands/get-section-values.js +39 -0
- package/dist/commands/get-section-values.js.map +1 -0
- package/dist/commands/list-entities.d.ts +3 -0
- package/dist/commands/list-entities.d.ts.map +1 -0
- package/dist/commands/list-entities.js +32 -0
- package/dist/commands/list-entities.js.map +1 -0
- package/dist/commands/list-page-sections.d.ts +3 -0
- package/dist/commands/list-page-sections.d.ts.map +1 -0
- package/dist/commands/list-page-sections.js +25 -0
- package/dist/commands/list-page-sections.js.map +1 -0
- package/dist/commands/proxy.d.ts +39 -0
- package/dist/commands/proxy.d.ts.map +1 -0
- package/dist/commands/proxy.js +210 -0
- package/dist/commands/proxy.js.map +1 -0
- package/dist/commands/publish-theme.d.ts +3 -0
- package/dist/commands/publish-theme.d.ts.map +1 -0
- package/dist/commands/publish-theme.js +29 -0
- package/dist/commands/publish-theme.js.map +1 -0
- package/dist/commands/search-products.d.ts +3 -0
- package/dist/commands/search-products.d.ts.map +1 -0
- package/dist/commands/search-products.js +40 -0
- package/dist/commands/search-products.js.map +1 -0
- package/dist/commands/set-dynamic-value.d.ts +3 -0
- package/dist/commands/set-dynamic-value.d.ts.map +1 -0
- package/dist/commands/set-dynamic-value.js +54 -0
- package/dist/commands/set-dynamic-value.js.map +1 -0
- package/dist/commands/update-page-sections.d.ts +3 -0
- package/dist/commands/update-page-sections.d.ts.map +1 -0
- package/dist/commands/update-page-sections.js +39 -0
- package/dist/commands/update-page-sections.js.map +1 -0
- package/dist/commands/update-section-prop.d.ts +3 -0
- package/dist/commands/update-section-prop.d.ts.map +1 -0
- package/dist/commands/update-section-prop.js +59 -0
- package/dist/commands/update-section-prop.js.map +1 -0
- package/dist/commands/update-section-props.d.ts +3 -0
- package/dist/commands/update-section-props.d.ts.map +1 -0
- package/dist/commands/update-section-props.js +43 -0
- package/dist/commands/update-section-props.js.map +1 -0
- package/dist/commands/upload-image.d.ts +3 -0
- package/dist/commands/upload-image.d.ts.map +1 -0
- package/dist/commands/upload-image.js +38 -0
- package/dist/commands/upload-image.js.map +1 -0
- package/dist/commands/upload-images.d.ts +3 -0
- package/dist/commands/upload-images.d.ts.map +1 -0
- package/dist/commands/upload-images.js +48 -0
- package/dist/commands/upload-images.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/compile.d.ts +1 -4
- package/dist/utils/compile.d.ts.map +1 -1
- package/dist/utils/compile.js +40 -500
- package/dist/utils/compile.js.map +1 -1
- package/dist/utils/editor-action-client.d.ts +1 -1
- package/dist/utils/editor-action-client.d.ts.map +1 -1
- package/dist/utils/editor-action-client.js +23 -8
- package/dist/utils/editor-action-client.js.map +1 -1
- package/dist/utils/load-image.d.ts +16 -0
- package/dist/utils/load-image.d.ts.map +1 -0
- package/dist/utils/load-image.js +50 -0
- package/dist/utils/load-image.js.map +1 -0
- package/dist/utils/websocket-server.d.ts +2 -2
- package/dist/utils/websocket-server.d.ts.map +1 -1
- package/dist/utils/websocket-server.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish-theme.d.ts","sourceRoot":"","sources":["../../src/commands/publish-theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgCpC,wBAAgB,yBAAyB,IAAI,OAAO,CAWnD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { printErrorAndExit, printResultAndExit, runEditorAction, } from "../utils/editor-action-client.js";
|
|
3
|
+
async function runPublishTheme(options) {
|
|
4
|
+
const port = options.port ? parseInt(options.port, 10) : undefined;
|
|
5
|
+
try {
|
|
6
|
+
const result = await runEditorAction("publish-theme", {
|
|
7
|
+
confirm: !!options.confirm,
|
|
8
|
+
confirmProduction: !!options.confirmProduction,
|
|
9
|
+
},
|
|
10
|
+
// Publishing optimizes images + uploads the whole project to the host, so
|
|
11
|
+
// give it more headroom than the default action timeout.
|
|
12
|
+
{ ...(port ? { port } : {}), timeoutMs: 120_000 });
|
|
13
|
+
printResultAndExit(result);
|
|
14
|
+
}
|
|
15
|
+
catch (e) {
|
|
16
|
+
printErrorAndExit(e);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export function createPublishThemeCommand() {
|
|
20
|
+
const cmd = new Command("publish-theme");
|
|
21
|
+
cmd
|
|
22
|
+
.description("Publish the current theme LIVE (same as the editor's Publish button — saves the whole project to the storefront). This is a real, customer-facing publish: it does nothing unless you pass --confirm, and the MAIN/production theme additionally requires --confirm-production. Without the flags it returns a dry-run describing what would happen and the previewUrl. On success returns { published: true, previewUrl, isMainTheme }.")
|
|
23
|
+
.option("--confirm", "Actually publish (required). Without it, returns a dry-run.")
|
|
24
|
+
.option("--confirm-production", "Required IN ADDITION to --confirm when publishing the MAIN/production theme (live customer-facing site).")
|
|
25
|
+
.option("--port <port>", "Dev server WebSocket port", "5201")
|
|
26
|
+
.action(runPublishTheme);
|
|
27
|
+
return cmd;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=publish-theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish-theme.js","sourceRoot":"","sources":["../../src/commands/publish-theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,GAChB,MAAM,kCAAkC,CAAC;AAQ1C,KAAK,UAAU,eAAe,CAAC,OAA4B;IACzD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACnE,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,eAAe,CAClC,eAAe,EACf;YACE,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO;YAC1B,iBAAiB,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB;SAC/C;QACD,0EAA0E;QAC1E,yDAAyD;QACzD,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,CAClD,CAAC;QACF,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,iBAAiB,CAAC,CAAC,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,yBAAyB;IACvC,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;IACzC,GAAG;SACA,WAAW,CACV,0aAA0a,CAC3a;SACA,MAAM,CAAC,WAAW,EAAE,6DAA6D,CAAC;SAClF,MAAM,CAAC,sBAAsB,EAAE,0GAA0G,CAAC;SAC1I,MAAM,CAAC,eAAe,EAAE,2BAA2B,EAAE,MAAM,CAAC;SAC5D,MAAM,CAAC,eAAe,CAAC,CAAC;IAC3B,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-products.d.ts","sourceRoot":"","sources":["../../src/commands/search-products.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2CpC,wBAAgB,2BAA2B,IAAI,OAAO,CAarD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { printErrorAndExit, printResultAndExit, runEditorAction, } from "../utils/editor-action-client.js";
|
|
3
|
+
async function runSearchProducts(options) {
|
|
4
|
+
const port = options.port ? parseInt(options.port, 10) : undefined;
|
|
5
|
+
const productIds = options.ids
|
|
6
|
+
? options.ids
|
|
7
|
+
.split(",")
|
|
8
|
+
.map(s => s.trim())
|
|
9
|
+
.filter(Boolean)
|
|
10
|
+
: undefined;
|
|
11
|
+
const perPage = options.perPage ? parseInt(options.perPage, 10) : undefined;
|
|
12
|
+
const page = options.page ? parseInt(options.page, 10) : undefined;
|
|
13
|
+
try {
|
|
14
|
+
const result = await runEditorAction("search-products", {
|
|
15
|
+
...(options.query ? { query: options.query } : {}),
|
|
16
|
+
...(productIds && productIds.length ? { productIds } : {}),
|
|
17
|
+
...(typeof perPage === "number" && !Number.isNaN(perPage) ? { perPage } : {}),
|
|
18
|
+
...(typeof page === "number" && !Number.isNaN(page) ? { page } : {}),
|
|
19
|
+
},
|
|
20
|
+
// The host fetches from the store API, so allow more than the default 10s.
|
|
21
|
+
{ ...(port ? { port } : {}), timeoutMs: 20_000 });
|
|
22
|
+
printResultAndExit(result);
|
|
23
|
+
}
|
|
24
|
+
catch (e) {
|
|
25
|
+
printErrorAndExit(e);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export function createSearchProductsCommand() {
|
|
29
|
+
const cmd = new Command("search-products");
|
|
30
|
+
cmd
|
|
31
|
+
.description("Search the connected store's products and return each product's id (productId) + first variantId, name, slug, and variant count. Use the productId/variantId to fill a PRODUCT prop value via `ikas-component update-section-prop`. Requires the editor embedded in the ikas admin panel (the host runs the search).")
|
|
32
|
+
.option("--query <text>", "Free-text search query (name, sku, barcode)")
|
|
33
|
+
.option("--ids <ids>", "Comma-separated product ids to look up directly")
|
|
34
|
+
.option("--per-page <n>", "Results per page")
|
|
35
|
+
.option("--page <n>", "Page number")
|
|
36
|
+
.option("--port <port>", "Dev server WebSocket port", "5201")
|
|
37
|
+
.action(runSearchProducts);
|
|
38
|
+
return cmd;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=search-products.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-products.js","sourceRoot":"","sources":["../../src/commands/search-products.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,GAChB,MAAM,kCAAkC,CAAC;AAU1C,KAAK,UAAU,iBAAiB,CAAC,OAA8B;IAC7D,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACnE,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG;QAC5B,CAAC,CAAC,OAAO,CAAC,GAAG;aACR,KAAK,CAAC,GAAG,CAA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,CAAC;IAC7B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,iBAAiB,CAAC,CAAC,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,2BAA2B;IACzC,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC3C,GAAG;SACA,WAAW,CACV,sTAAsT,CACvT;SACA,MAAM,CAAC,gBAAgB,EAAE,6CAA6C,CAAC;SACvE,MAAM,CAAC,aAAa,EAAE,iDAAiD,CAAC;SACxE,MAAM,CAAC,gBAAgB,EAAE,kBAAkB,CAAC;SAC5C,MAAM,CAAC,YAAY,EAAE,aAAa,CAAC;SACnC,MAAM,CAAC,eAAe,EAAE,2BAA2B,EAAE,MAAM,CAAC;SAC5D,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAC7B,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-dynamic-value.d.ts","sourceRoot":"","sources":["../../src/commands/set-dynamic-value.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsDpC,wBAAgB,4BAA4B,IAAI,OAAO,CActD"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { printErrorAndExit, printResultAndExit, runEditorAction, } from "../utils/editor-action-client.js";
|
|
3
|
+
function parseListPath(raw) {
|
|
4
|
+
if (!raw)
|
|
5
|
+
return undefined;
|
|
6
|
+
let parsed;
|
|
7
|
+
try {
|
|
8
|
+
parsed = JSON.parse(raw);
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
printErrorAndExit(new Error('--list-path must be JSON, e.g. \'[{"propId":"<listPropId>","index":0}]\''));
|
|
12
|
+
}
|
|
13
|
+
if (!Array.isArray(parsed)) {
|
|
14
|
+
printErrorAndExit(new Error("--list-path must be a JSON array of { propId, index }."));
|
|
15
|
+
}
|
|
16
|
+
return parsed;
|
|
17
|
+
}
|
|
18
|
+
async function runSetDynamicValue(options) {
|
|
19
|
+
if (!options.elementId)
|
|
20
|
+
printErrorAndExit(new Error("--element-id is required"));
|
|
21
|
+
if (!options.propId)
|
|
22
|
+
printErrorAndExit(new Error("--prop-id is required (the prop to bind)"));
|
|
23
|
+
if (!options.ref)
|
|
24
|
+
printErrorAndExit(new Error("--ref is required (a value's `ref` from get-available-values)"));
|
|
25
|
+
const listPath = parseListPath(options.listPath);
|
|
26
|
+
const port = options.port ? parseInt(options.port, 10) : undefined;
|
|
27
|
+
try {
|
|
28
|
+
const result = await runEditorAction("set-dynamic-value", {
|
|
29
|
+
...(options.pageId ? { pageId: options.pageId } : {}),
|
|
30
|
+
elementId: options.elementId,
|
|
31
|
+
propId: options.propId,
|
|
32
|
+
ref: options.ref,
|
|
33
|
+
...(listPath ? { listPath } : {}),
|
|
34
|
+
}, port ? { port } : {});
|
|
35
|
+
printResultAndExit(result);
|
|
36
|
+
}
|
|
37
|
+
catch (e) {
|
|
38
|
+
printErrorAndExit(e);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
export function createSetDynamicValueCommand() {
|
|
42
|
+
const cmd = new Command("set-dynamic-value");
|
|
43
|
+
cmd
|
|
44
|
+
.description("Bind a prop to a DYNAMIC value (a variable / loop item field) instead of a static value. --ref is a value's `ref` from `get-available-values`. For a prop of a component inside a COMPONENT_LIST, pass the same --list-path you used for get-available-values. Replaces any static value on that prop.")
|
|
45
|
+
.requiredOption("--element-id <id>", "Placed section elementId (from `list-page-sections`)")
|
|
46
|
+
.requiredOption("--prop-id <id>", "Prop id to bind")
|
|
47
|
+
.requiredOption("--ref <ref>", "A value `ref` from `get-available-values`")
|
|
48
|
+
.option("--page-id <id>", "Page id (from `list-pages`)")
|
|
49
|
+
.option("--list-path <json>", 'JSON path into a COMPONENT_LIST, e.g. \'[{"propId":"<listPropId>","index":0}]\'')
|
|
50
|
+
.option("--port <port>", "Dev server WebSocket port", "5201")
|
|
51
|
+
.action(runSetDynamicValue);
|
|
52
|
+
return cmd;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=set-dynamic-value.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-dynamic-value.js","sourceRoot":"","sources":["../../src/commands/set-dynamic-value.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,GAChB,MAAM,kCAAkC,CAAC;AAW1C,SAAS,aAAa,CAAC,GAAY;IACjC,IAAI,CAAC,GAAG;QAAE,OAAO,SAAS,CAAC;IAC3B,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,iBAAiB,CAAC,IAAI,KAAK,CAAC,0EAA0E,CAAC,CAAC,CAAC;IAC3G,CAAC;IACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3B,iBAAiB,CAAC,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC,CAAC;IACzF,CAAC;IACD,OAAO,MAAkD,CAAC;AAC5D,CAAC;AAED,KAAK,UAAU,kBAAkB,CAAC,OAA+B;IAC/D,IAAI,CAAC,OAAO,CAAC,SAAS;QAAE,iBAAiB,CAAC,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC,CAAC;IACjF,IAAI,CAAC,OAAO,CAAC,MAAM;QAAE,iBAAiB,CAAC,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC,CAAC;IAC9F,IAAI,CAAC,OAAO,CAAC,GAAG;QAAE,iBAAiB,CAAC,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC,CAAC;IAChH,MAAM,QAAQ,GAAG,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC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C,CAAC;IAC9B,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-page-sections.d.ts","sourceRoot":"","sources":["../../src/commands/update-page-sections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiDpC,wBAAgB,+BAA+B,IAAI,OAAO,CAczD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { printErrorAndExit, printResultAndExit, runEditorAction, } from "../utils/editor-action-client.js";
|
|
3
|
+
async function runUpdatePageSections(options) {
|
|
4
|
+
if (!options.pageId || typeof options.pageId !== "string") {
|
|
5
|
+
printErrorAndExit(new Error("--page-id is required (use `ikas-component list-pages`)"));
|
|
6
|
+
}
|
|
7
|
+
if (options.sections === undefined) {
|
|
8
|
+
printErrorAndExit(new Error('--sections is required: a JSON array, e.g. \'[{"elementId":"<id>","updates":[{"propName":"heading","value":{"value":"Hi"}}]}]\''));
|
|
9
|
+
}
|
|
10
|
+
let sections;
|
|
11
|
+
try {
|
|
12
|
+
sections = JSON.parse(options.sections);
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
printErrorAndExit(new Error(`--sections must be valid JSON. Received: ${options.sections}`));
|
|
16
|
+
}
|
|
17
|
+
if (!Array.isArray(sections) || sections.length === 0) {
|
|
18
|
+
printErrorAndExit(new Error('--sections must be a non-empty JSON array of { elementId, updates: [...] } objects.'));
|
|
19
|
+
}
|
|
20
|
+
const port = options.port ? parseInt(options.port, 10) : undefined;
|
|
21
|
+
try {
|
|
22
|
+
const result = await runEditorAction("update-page-sections", { pageId: options.pageId, sections }, { ...(port ? { port } : {}), timeoutMs: 30_000 });
|
|
23
|
+
printResultAndExit(result);
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
printErrorAndExit(e);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export function createUpdatePageSectionsCommand() {
|
|
30
|
+
const cmd = new Command("update-page-sections");
|
|
31
|
+
cmd
|
|
32
|
+
.description("Fill MANY placed sections of a page in one call. --sections is a JSON array of { elementId, updates: [{ propId|propName, value }] }, each value using the same per-type shape as update-section-prop. All-or-nothing across the whole page: every value is resolved and validated before any is written.")
|
|
33
|
+
.requiredOption("--page-id <id>", "Page id (from `ikas-component list-pages`)")
|
|
34
|
+
.requiredOption("--sections <json>", 'JSON array, e.g. \'[{"elementId":"<id>","updates":[{"propName":"heading","value":{"value":"Hi"}}]}]\'')
|
|
35
|
+
.option("--port <port>", "Dev server WebSocket port", "5201")
|
|
36
|
+
.action(runUpdatePageSections);
|
|
37
|
+
return cmd;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=update-page-sections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-page-sections.js","sourceRoot":"","sources":["../../src/commands/update-page-sections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,GAChB,MAAM,kCAAkC,CAAC;AAQ1C,KAAK,UAAU,qBAAqB,CAAC,OAAkC;IACrE,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,OAAO,OAAO,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC1D,iBAAiB,CAAC,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC,CAAC;IAC1F,CAAC;IACD,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;QACnC,iBAAiB,CACf,IAAI,KAAK,CACP,iIAAiI,CAClI,CACF,CAAC;IACJ,CAAC;IACD,IAAI,QAAiB,CAAC;IACtB,IAAI,CAAC;QACH,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAAC,MAAM,CAAC;QACP,iBAAiB,CAAC,I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oot":"","sources":["../../src/commands/update-section-prop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA4DpC,wBAAgB,8BAA8B,IAAI,OAAO,CAsBxD"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { printErrorAndExit, printResultAndExit, runEditorAction, } from "../utils/editor-action-client.js";
|
|
3
|
+
async function runUpdateSectionProp(options) {
|
|
4
|
+
if (!options.pageId || typeof options.pageId !== "string") {
|
|
5
|
+
printErrorAndExit(new Error("--page-id is required (use `ikas-component list-pages` to discover ids)"));
|
|
6
|
+
}
|
|
7
|
+
if (!options.elementId || typeof options.elementId !== "string") {
|
|
8
|
+
printErrorAndExit(new Error("--element-id is required (use `ikas-component list-page-sections` to discover ids)"));
|
|
9
|
+
}
|
|
10
|
+
if (!options.propId && !options.propName) {
|
|
11
|
+
printErrorAndExit(new Error("Provide --prop-id or --prop-name (see `ikas-component list-page-sections`)"));
|
|
12
|
+
}
|
|
13
|
+
if (options.value === undefined) {
|
|
14
|
+
printErrorAndExit(new Error("--value is required (JSON, e.g. '{\"value\":\"Hello\"}')"));
|
|
15
|
+
}
|
|
16
|
+
let value;
|
|
17
|
+
try {
|
|
18
|
+
value = JSON.parse(options.value);
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
printErrorAndExit(new Error(`--value must be valid JSON (e.g. '{"value":"Hello"}'). Received: ${options.value}`));
|
|
22
|
+
}
|
|
23
|
+
const port = options.port ? parseInt(options.port, 10) : undefined;
|
|
24
|
+
try {
|
|
25
|
+
const result = await runEditorAction("update-section-prop", {
|
|
26
|
+
pageId: options.pageId,
|
|
27
|
+
elementId: options.elementId,
|
|
28
|
+
...(options.propId ? { propId: options.propId } : {}),
|
|
29
|
+
...(options.propName ? { propName: options.propName } : {}),
|
|
30
|
+
value,
|
|
31
|
+
}, port ? { port } : {});
|
|
32
|
+
printResultAndExit(result);
|
|
33
|
+
}
|
|
34
|
+
catch (e) {
|
|
35
|
+
printErrorAndExit(e);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export function createUpdateSectionPropCommand() {
|
|
39
|
+
const cmd = new Command("update-section-prop");
|
|
40
|
+
cmd
|
|
41
|
+
.description([
|
|
42
|
+
"Change a single prop value of a section placed on a page. Target the placement by its elementId (from `ikas-component list-page-sections`) and the prop by --prop-id or --prop-name.",
|
|
43
|
+
"--value is the JSON-encoded prop value. Shape depends on the prop type:",
|
|
44
|
+
" Scalars (TEXT/RICH_TEXT/BOOLEAN/NUMBER/COLOR/ENUM/DATE) are { \"value\": <scalar> } — e.g. '{\"value\":\"Hello\"}', '{\"value\":true}', '{\"value\":\"#FF0000\"}'.",
|
|
45
|
+
" Object props are NOT wrapped: IMAGE/VIDEO/SVG = '{\"id\":\"<asset-id>\",\"altText\":\"...\"}' (get id via `ikas-component upload-image`); PRODUCT = '{\"productId\":\"...\"}'.",
|
|
46
|
+
" LINK = a single link object needing id + linkType + label + subLinks: PAGE = '{\"id\":\"<unique>\",\"linkType\":\"PAGE\",\"label\":\"Home\",\"pageId\":\"<id>\",\"pageType\":\"INDEX\",\"subLinks\":[]}'; EXTERNAL = '{\"id\":\"<unique>\",\"linkType\":\"EXTERNAL\",\"label\":\"Docs\",\"externalLink\":\"https://...\",\"subLinks\":[]}'. (pageId/pageType from `list-pages`.) LIST_OF_LINK = '{\"links\":[<link>,...]}'.",
|
|
47
|
+
" COMPONENT_LIST = '{\"components\":[{\"id\":\"<unique>\",\"codeComponentId\":\"<child-id>\",\"propValues\":{\"<childProp>\":<value>}}]}' (single COMPONENT = one such entry). Each entry needs a unique id and codeComponentId (or componentId); child propValues use the same per-type shapes recursively.",
|
|
48
|
+
" The value REPLACES the whole prop — to edit a COMPONENT_LIST, read the current value from `list-page-sections` and resend the entire array. Wrong shapes are rejected with an error, not stored silently.",
|
|
49
|
+
].join("\n"))
|
|
50
|
+
.requiredOption("--page-id <id>", "Page id (from `ikas-component list-pages`)")
|
|
51
|
+
.requiredOption("--element-id <id>", "Placed section elementId (from `ikas-component list-page-sections`)")
|
|
52
|
+
.option("--prop-id <id>", "Blueprint prop id to update")
|
|
53
|
+
.option("--prop-name <name>", "Blueprint prop name to update (alternative to --prop-id)")
|
|
54
|
+
.requiredOption("--value <json>", 'JSON-encoded prop value, e.g. \'{"value":"Hello"}\'')
|
|
55
|
+
.option("--port <port>", "Dev server WebSocket port", "5201")
|
|
56
|
+
.action(runUpdateSectionProp);
|
|
57
|
+
return cmd;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=update-section-prop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-section-prop.js","sourceRoot":"","sources":["../../src/commands/update-section-prop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,GAChB,MAAM,kCAAkC,CAAC;AAW1C,KAAK,UAAU,oBAAoB,CAAC,OAAiC;IACnE,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,OAAO,OAAO,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC1D,iBAAiB,CAAC,IAAI,KAAK,CAAC,yEAAyE,CAAC,CAAC,CAAC;IAC1G,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,OAAO,CAAC,SAAS,KAAK,QAAQ,EAAE,CAAC;QAChE,iBAAiB,CACf,IAAI,KAAK,CAAC,oFAAoF,CAAC,CAChG,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QACzC,iBAAiB,CAAC,IAAI,KAAK,CAAC,4EAA4E,CAAC,CAAC,CAAC;IAC7G,CAAC;IACD,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAChC,iBAAiB,CAAC,IAAI,KA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;QACtK,kLAAkL;QAClL,+ZAA+Z;QAC/Z,8SAA8S;QAC9S,6MAA6M;KAC9M,CAAC,IAAI,CAAC,IAAI,CAAC,CACb;SACA,cAAc,CAAC,gBAAgB,EAAE,4CAA4C,CAAC;SAC9E,cAAc,CAAC,mBAAmB,EAAE,qEAAqE,CAAC;SAC1G,MAAM,CAAC,gBAAgB,EAAE,6BAA6B,CAAC;SACvD,MAAM,CAAC,oBAAoB,EAAE,0DAA0D,CAAC;SACxF,cAAc,CAAC,gBAAgB,EAAE,qDAAqD,CAAC;SACvF,MAAM,CAAC,eAAe,EAAE,2BAA2B,EAAE,MAAM,CAAC;SAC5D,MAAM,CAAC,oBAAoB,CAAC,CAAC;IAChC,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-section-props.d.ts","sourceRoot":"","sources":["../../src/commands/update-section-props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoDpC,wBAAgB,+BAA+B,IAAI,OAAO,CAezD"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { printErrorAndExit, printResultAndExit, runEditorAction, } from "../utils/editor-action-client.js";
|
|
3
|
+
async function runUpdateSectionProps(options) {
|
|
4
|
+
if (!options.pageId || typeof options.pageId !== "string") {
|
|
5
|
+
printErrorAndExit(new Error("--page-id is required (use `ikas-component list-pages`)"));
|
|
6
|
+
}
|
|
7
|
+
if (!options.elementId || typeof options.elementId !== "string") {
|
|
8
|
+
printErrorAndExit(new Error("--element-id is required (use `ikas-component list-page-sections`)"));
|
|
9
|
+
}
|
|
10
|
+
if (options.updates === undefined) {
|
|
11
|
+
printErrorAndExit(new Error('--updates is required: a JSON array, e.g. \'[{"propName":"heading","value":{"value":"Hi"}}]\''));
|
|
12
|
+
}
|
|
13
|
+
let updates;
|
|
14
|
+
try {
|
|
15
|
+
updates = JSON.parse(options.updates);
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
printErrorAndExit(new Error(`--updates must be valid JSON. Received: ${options.updates}`));
|
|
19
|
+
}
|
|
20
|
+
if (!Array.isArray(updates) || updates.length === 0) {
|
|
21
|
+
printErrorAndExit(new Error('--updates must be a non-empty JSON array of { propId|propName, value } objects.'));
|
|
22
|
+
}
|
|
23
|
+
const port = options.port ? parseInt(options.port, 10) : undefined;
|
|
24
|
+
try {
|
|
25
|
+
const result = await runEditorAction("update-section-props", { pageId: options.pageId, elementId: options.elementId, updates }, { ...(port ? { port } : {}), timeoutMs: 30_000 });
|
|
26
|
+
printResultAndExit(result);
|
|
27
|
+
}
|
|
28
|
+
catch (e) {
|
|
29
|
+
printErrorAndExit(e);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export function createUpdateSectionPropsCommand() {
|
|
33
|
+
const cmd = new Command("update-section-props");
|
|
34
|
+
cmd
|
|
35
|
+
.description("Set MANY prop values on one placed section in a single call (batch update-section-prop). --updates is a JSON array of { propId|propName, value }, each value using the same per-type shape as update-section-prop. All-or-nothing: every entry is resolved and validated before any is written.")
|
|
36
|
+
.requiredOption("--page-id <id>", "Page id (from `ikas-component list-pages`)")
|
|
37
|
+
.requiredOption("--element-id <id>", "Placed section elementId (from `ikas-component list-page-sections`)")
|
|
38
|
+
.requiredOption("--updates <json>", 'JSON array, e.g. \'[{"propName":"heading","value":{"value":"Hi"}},{"propName":"image","value":{"id":"<asset-id>"}}]\'')
|
|
39
|
+
.option("--port <port>", "Dev server WebSocket port", "5201")
|
|
40
|
+
.action(runUpdateSectionProps);
|
|
41
|
+
return cmd;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=update-section-props.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-section-props.js","sourceRoot":"","sources":["../../src/commands/update-section-props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC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M,EAAE,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,EAAE,EACjE,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,CACjD,CAAC;QACF,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,iBAAiB,CAAC,CAAC,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,+BAA+B;IAC7C,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAChD,GAAG;SACA,WAAW,CACV,iSAAiS,CAClS;SACA,cAAc,CAAC,gBAAgB,EAAE,4CAA4C,CAAC;SAC9E,cAAc,CAAC,mBAAmB,EAAE,qEAAqE,CAAC;SAC1G,cAAc,CACb,kBAAkB,EAClB,uHAAuH,CACxH;SACA,MAAM,CAAC,eAAe,EAAE,2BAA2B,EAAE,MAAM,CAAC;SAC5D,MAAM,CAAC,qBAAqB,CAAC,CAAC;IACjC,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-image.d.ts","sourceRoot":"","sources":["../../src/commands/upload-image.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyCpC,wBAAgB,wBAAwB,IAAI,OAAO,CAYlD"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { printErrorAndExit, printResultAndExit, runEditorAction, } from "../utils/editor-action-client.js";
|
|
3
|
+
import { loadImageSource } from "../utils/load-image.js";
|
|
4
|
+
async function runUploadImage(options) {
|
|
5
|
+
const port = options.port ? parseInt(options.port, 10) : undefined;
|
|
6
|
+
if (!options.file && !options.url) {
|
|
7
|
+
printErrorAndExit(new Error("Provide --file <path> or --url <url>"));
|
|
8
|
+
}
|
|
9
|
+
try {
|
|
10
|
+
const { base64, mimeType, fileName } = await loadImageSource({ file: options.file, url: options.url });
|
|
11
|
+
const result = await runEditorAction("upload-image", {
|
|
12
|
+
base64,
|
|
13
|
+
mimeType,
|
|
14
|
+
fileName,
|
|
15
|
+
...(options.alt ? { altText: options.alt } : {}),
|
|
16
|
+
isVideo: false,
|
|
17
|
+
},
|
|
18
|
+
// Uploads carry the full image payload and round-trip to the host, so give
|
|
19
|
+
// them a far more generous timeout than the default 10s.
|
|
20
|
+
{ ...(port ? { port } : {}), timeoutMs: 60_000 });
|
|
21
|
+
printResultAndExit(result);
|
|
22
|
+
}
|
|
23
|
+
catch (e) {
|
|
24
|
+
printErrorAndExit(e);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export function createUploadImageCommand() {
|
|
28
|
+
const cmd = new Command("upload-image");
|
|
29
|
+
cmd
|
|
30
|
+
.description("Upload an image to the connected editor's project and return its image id. Supply the image with --file (local path) or --url. The returned id can be used as the `id` of an IMAGE prop value via `ikas-component update-section-prop`. Requires the editor to be embedded in the ikas admin panel (the host performs the actual upload).")
|
|
31
|
+
.option("--file <path>", "Local image file path (.png, .jpg, .jpeg, .webp, .gif)")
|
|
32
|
+
.option("--url <url>", "Image URL to fetch and upload")
|
|
33
|
+
.option("--alt <text>", "Alt text for the image")
|
|
34
|
+
.option("--port <port>", "Dev server WebSocket port", "5201")
|
|
35
|
+
.action(runUploadImage);
|
|
36
|
+
return cmd;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=upload-image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-image.js","sourceRoot":"","sources":["../../src/commands/upload-image.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,GAChB,MAAM,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SACA,WAAW,CACV,2UAA2U,CAC5U;SACA,MAAM,CAAC,eAAe,EAAE,wDAAwD,CAAC;SACjF,MAAM,CAAC,aAAa,EAAE,+BAA+B,CAAC;SACtD,MAAM,CAAC,cAAc,EAAE,wBAAwB,CAAC;SAChD,MAAM,CAAC,eAAe,EAAE,2BAA2B,EAAE,MAAM,CAAC;SAC5D,MAAM,CAAC,cAAc,CAAC,CAAC;IAC1B,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-images.d.ts","sourceRoot":"","sources":["../../src/commands/upload-images.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA8DpC,wBAAgB,yBAAyB,IAAI,OAAO,CAanD"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { printErrorAndExit, printResultAndExit, runEditorAction, } from "../utils/editor-action-client.js";
|
|
3
|
+
import { loadImageSource } from "../utils/load-image.js";
|
|
4
|
+
async function runUploadImages(options) {
|
|
5
|
+
if (options.manifest === undefined) {
|
|
6
|
+
printErrorAndExit(new Error('--manifest is required: a JSON array, e.g. \'[{"file":"/a.png","alt":"A"},{"url":"https://...","alt":"B"}]\''));
|
|
7
|
+
}
|
|
8
|
+
let manifest;
|
|
9
|
+
try {
|
|
10
|
+
manifest = JSON.parse(options.manifest);
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
printErrorAndExit(new Error(`--manifest must be valid JSON. Received: ${options.manifest}`));
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (!Array.isArray(manifest) || manifest.length === 0) {
|
|
17
|
+
printErrorAndExit(new Error("--manifest must be a non-empty JSON array of { file|url, alt? } objects."));
|
|
18
|
+
}
|
|
19
|
+
const port = options.port ? parseInt(options.port, 10) : undefined;
|
|
20
|
+
try {
|
|
21
|
+
// Read/encode all sources in parallel, then send one batch editor-action.
|
|
22
|
+
const images = await Promise.all(manifest.map(async (entry) => {
|
|
23
|
+
const { base64, mimeType, fileName } = await loadImageSource({ file: entry.file, url: entry.url });
|
|
24
|
+
return {
|
|
25
|
+
base64,
|
|
26
|
+
mimeType,
|
|
27
|
+
fileName,
|
|
28
|
+
...(entry.alt ? { altText: entry.alt } : {}),
|
|
29
|
+
isVideo: false,
|
|
30
|
+
};
|
|
31
|
+
}));
|
|
32
|
+
const result = await runEditorAction("upload-images", { images }, { ...(port ? { port } : {}), timeoutMs: 60_000 });
|
|
33
|
+
printResultAndExit(result);
|
|
34
|
+
}
|
|
35
|
+
catch (e) {
|
|
36
|
+
printErrorAndExit(e);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export function createUploadImagesCommand() {
|
|
40
|
+
const cmd = new Command("upload-images");
|
|
41
|
+
cmd
|
|
42
|
+
.description("Upload MANY images in one call (batch upload-image) and return their ids in order. --manifest is a JSON array of { file|url, alt? }. The host uploads them all in a single round-trip. Requires the editor embedded in the ikas admin panel.")
|
|
43
|
+
.requiredOption("--manifest <json>", 'JSON array, e.g. \'[{"file":"/a.png","alt":"A"},{"url":"https://x/b.jpg"}]\'')
|
|
44
|
+
.option("--port <port>", "Dev server WebSocket port", "5201")
|
|
45
|
+
.action(runUploadImages);
|
|
46
|
+
return cmd;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=upload-images.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-images.js","sourceRoot":"","sources":["../../src/commands/upload-images.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,GAChB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAazD,KAAK,UAAU,eAAe,CAAC,OAA4B;IACzD,IAAI,OAAO,CAAC,QAAQ,KAAK,SA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ACF,MAAM,MAAM,GAAG,MAAM,eAAe,CAClC,eAAe,EACf,EAAE,MAAM,EAAE,EACV,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,CACjD,CAAC;QACF,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,iBAAiB,CAAC,CAAC,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,yBAAyB;IACvC,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;IACzC,GAAG;SACA,WAAW,CACV,8OAA8O,CAC/O;SACA,cAAc,CACb,mBAAmB,EACnB,8EAA8E,CAC/E;SACA,MAAM,CAAC,eAAe,EAAE,2BAA2B,EAAE,MAAM,CAAC;SAC5D,MAAM,CAAC,eAAe,CAAC,CAAC;IAC3B,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2DpC,wBAAgB,GAAG,qBAElB;AAED,cAAc,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import { createAddCommand } from "./commands/add.js";
|
|
3
|
+
import { createAddSectionsToPageCommand } from "./commands/add-sections-to-page.js";
|
|
3
4
|
import { createAddToPageCommand } from "./commands/add-to-page.js";
|
|
5
|
+
import { createCreatePageCommand } from "./commands/create-page.js";
|
|
6
|
+
import { createGetAvailableValuesCommand } from "./commands/get-available-values.js";
|
|
7
|
+
import { createGetComponentPropsCommand } from "./commands/get-component-props.js";
|
|
8
|
+
import { createGetPageByTypeCommand } from "./commands/get-page-by-type.js";
|
|
9
|
+
import { createGetSectionValuesCommand } from "./commands/get-section-values.js";
|
|
4
10
|
import { createBuildCommand } from "./commands/build.js";
|
|
5
11
|
import { createCheckCommand } from "./commands/check.js";
|
|
6
12
|
import { createConfigCommand } from "./commands/config.js";
|
|
7
13
|
import { createDevCommand } from "./commands/dev.js";
|
|
8
14
|
import { createImportCommand } from "./commands/import.js";
|
|
15
|
+
import { createListEntitiesCommand } from "./commands/list-entities.js";
|
|
9
16
|
import { createListImportedCommand } from "./commands/list-imported.js";
|
|
17
|
+
import { createListPageSectionsCommand } from "./commands/list-page-sections.js";
|
|
10
18
|
import { createListPagesCommand } from "./commands/list-pages.js";
|
|
11
19
|
import { createPublishCommand } from "./commands/publish.js";
|
|
20
|
+
import { createPublishThemeCommand } from "./commands/publish-theme.js";
|
|
21
|
+
import { createSearchProductsCommand } from "./commands/search-products.js";
|
|
22
|
+
import { createUpdatePageSectionsCommand } from "./commands/update-page-sections.js";
|
|
23
|
+
import { createUpdateSectionPropCommand } from "./commands/update-section-prop.js";
|
|
24
|
+
import { createUploadImageCommand } from "./commands/upload-image.js";
|
|
25
|
+
import { createUploadImagesCommand } from "./commands/upload-images.js";
|
|
12
26
|
const program = new Command();
|
|
13
27
|
program
|
|
14
28
|
.name("ikas-component")
|
|
@@ -25,6 +39,20 @@ program.addCommand(createListPagesCommand());
|
|
|
25
39
|
program.addCommand(createListImportedCommand());
|
|
26
40
|
program.addCommand(createImportCommand());
|
|
27
41
|
program.addCommand(createAddToPageCommand());
|
|
42
|
+
program.addCommand(createAddSectionsToPageCommand());
|
|
43
|
+
program.addCommand(createListPageSectionsCommand());
|
|
44
|
+
program.addCommand(createGetSectionValuesCommand());
|
|
45
|
+
program.addCommand(createGetComponentPropsCommand());
|
|
46
|
+
program.addCommand(createGetPageByTypeCommand());
|
|
47
|
+
program.addCommand(createCreatePageCommand());
|
|
48
|
+
program.addCommand(createPublishThemeCommand());
|
|
49
|
+
program.addCommand(createGetAvailableValuesCommand());
|
|
50
|
+
program.addCommand(createUpdateSectionPropCommand());
|
|
51
|
+
program.addCommand(createUpdatePageSectionsCommand());
|
|
52
|
+
program.addCommand(createUploadImageCommand());
|
|
53
|
+
program.addCommand(createUploadImagesCommand());
|
|
54
|
+
program.addCommand(createSearchProductsCommand());
|
|
55
|
+
program.addCommand(createListEntitiesCommand());
|
|
28
56
|
export function run() {
|
|
29
57
|
return program.parseAsync(process.argv);
|
|
30
58
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,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+B,EAAE,CAAC,CAAC;AACtD,OAAO,CAAC,UAAU,CAAC,8BAA8B,EAAE,CAAC,CAAC;AACrD,OAAO,CAAC,UAAU,CAAC,+BAA+B,EAAE,CAAC,CAAC;AACtD,OAAO,CAAC,UAAU,CAAC,wBAAwB,EAAE,CAAC,CAAC;AAC/C,OAAO,CAAC,UAAU,CAAC,yBAAyB,EAAE,CAAC,CAAC;AAChD,OAAO,CAAC,UAAU,CAAC,2BAA2B,EAAE,CAAC,CAAC;AAClD,OAAO,CAAC,UAAU,CAAC,yBAAyB,EAAE,CAAC,CAAC;AAEhD,MAAM,UAAU,GAAG;IACjB,OAAO,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC1C,CAAC;AAED,cAAc,YAAY,CAAC"}
|
package/dist/utils/compile.d.ts
CHANGED
|
@@ -4,10 +4,7 @@ import type { CompilationResult, MultiCompilationResult } from "../types.js";
|
|
|
4
4
|
*/
|
|
5
5
|
export declare function compileComponent(entryPath: string, stylesPath: string, componentId: string): Promise<CompilationResult>;
|
|
6
6
|
/**
|
|
7
|
-
* Scope CSS selectors with a component-specific class prefix
|
|
8
|
-
* document-global CSS identifiers (`@keyframes`, `@font-face` font-family,
|
|
9
|
-
* `@counter-style`) DEFINED in this component so two components — or the host theme —
|
|
10
|
-
* declaring the same name can't collide in the page's global namespace.
|
|
7
|
+
* Scope CSS selectors with a component-specific class prefix
|
|
11
8
|
*/
|
|
12
9
|
export declare function scopeCSS(css: string, componentId: string): string;
|
|
13
10
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/utils/compile.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAuB,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AA4ClG;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,iBAAiB,CAAC,CAoD5B;AAED
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/utils/compile.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAuB,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AA4ClG;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,iBAAiB,CAAC,CAoD5B;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAGjE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,MAAM,CAGzE;AAyFD;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,UAAU,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,EAAE,EACnE,gBAAgB,CAAC,EAAE,MAAM,GACxB,OAAO,CAAC,sBAAsB,CAAC,CAwTjC"}
|