@commercetools/cli-topic-integration-layer 0.4.0 → 0.5.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 +53 -35
- package/dist/commands/integration-layer/allowlist/add.d.ts +10 -0
- package/dist/commands/integration-layer/allowlist/add.js +41 -0
- package/dist/commands/integration-layer/allowlist/add.js.map +1 -0
- package/dist/commands/integration-layer/allowlist/list.d.ts +6 -0
- package/dist/commands/integration-layer/allowlist/list.js +28 -0
- package/dist/commands/integration-layer/allowlist/list.js.map +1 -0
- package/dist/commands/integration-layer/allowlist/remove.d.ts +13 -0
- package/dist/commands/integration-layer/allowlist/remove.js +56 -0
- package/dist/commands/integration-layer/allowlist/remove.js.map +1 -0
- package/dist/commands/integration-layer/allowlist/set.d.ts +13 -0
- package/dist/commands/integration-layer/allowlist/set.js +52 -0
- package/dist/commands/integration-layer/allowlist/set.js.map +1 -0
- package/dist/commands/integration-layer/config/unset.js +1 -1
- package/dist/commands/integration-layer/config/unset.js.map +1 -1
- package/dist/commands/integration-layer/explore.js +5 -4
- package/dist/commands/integration-layer/explore.js.map +1 -1
- package/dist/commands/integration-layer/extension/push.d.ts +1 -1
- package/dist/commands/integration-layer/extension/push.js +7 -7
- package/dist/commands/integration-layer/extension/push.js.map +1 -1
- package/dist/commands/integration-layer/extension/serve.d.ts +4 -4
- package/dist/commands/integration-layer/extension/serve.js +31 -31
- package/dist/commands/integration-layer/extension/serve.js.map +1 -1
- package/dist/commands/integration-layer/extension/validate.js +3 -3
- package/dist/commands/integration-layer/extension/validate.js.map +1 -1
- package/dist/commands/integration-layer/init.js +32 -41
- package/dist/commands/integration-layer/init.js.map +1 -1
- package/dist/lib/allowlistPrompt.d.ts +16 -0
- package/dist/lib/allowlistPrompt.js +31 -0
- package/dist/lib/allowlistPrompt.js.map +1 -0
- package/dist/lib/awaitBundleState.js +3 -3
- package/dist/lib/awaitBundleState.js.map +1 -1
- package/dist/lib/base.d.ts +13 -13
- package/dist/lib/base.js +17 -17
- package/dist/lib/base.js.map +1 -1
- package/dist/lib/ilClient.d.ts +35 -8
- package/dist/lib/ilClient.js +35 -4
- package/dist/lib/ilClient.js.map +1 -1
- package/dist/lib/sourceRevision.d.ts +1 -1
- package/dist/lib/sourceRevision.js +3 -3
- package/dist/lib/sourceRevision.js.map +1 -1
- package/dist/lib/tooling/apiExtension.js +1 -2
- package/dist/lib/tooling/apiExtension.js.map +1 -1
- package/dist/lib/tooling/build.js +3 -6
- package/dist/lib/tooling/build.js.map +1 -1
- package/dist/lib/tooling/compose.d.ts +2 -2
- package/dist/lib/tooling/compose.js +7 -9
- package/dist/lib/tooling/compose.js.map +1 -1
- package/dist/lib/tooling/exploreSchema.js +1 -1
- package/dist/lib/tooling/exploreSchema.js.map +1 -1
- package/dist/lib/tooling/explorerPage.js +2 -2
- package/dist/lib/tooling/explorerServer.d.ts +6 -0
- package/dist/lib/tooling/explorerServer.js +4 -0
- package/dist/lib/tooling/explorerServer.js.map +1 -1
- package/dist/lib/tooling/gateway.d.ts +1 -1
- package/dist/lib/tooling/gateway.js +5 -6
- package/dist/lib/tooling/gateway.js.map +1 -1
- package/dist/lib/tooling/loadBundle.js +1 -2
- package/dist/lib/tooling/loadBundle.js.map +1 -1
- package/dist/lib/tooling/session.d.ts +2 -2
- package/dist/lib/tooling/session.js +3 -3
- package/dist/lib/tooling/session.js.map +1 -1
- package/dist/lib/tooling/staticAnalysis.js +5 -8
- package/dist/lib/tooling/staticAnalysis.js.map +1 -1
- package/dist/lib/tooling/validateBundle.js +17 -5
- package/dist/lib/tooling/validateBundle.js.map +1 -1
- package/package.json +1 -1
- package/dist/commands/integration-layer/hello.d.ts +0 -6
- package/dist/commands/integration-layer/hello.js +0 -10
- package/dist/commands/integration-layer/hello.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,66 +1,84 @@
|
|
|
1
1
|
# @commercetools/cli-topic-integration-layer
|
|
2
2
|
|
|
3
3
|
A [commercetools CLI](https://github.com/commercetools/cli) plugin that adds the
|
|
4
|
-
`integration-layer` topic
|
|
5
|
-
|
|
4
|
+
`integration-layer` topic — the tooling for authoring, running, validating, publishing,
|
|
5
|
+
and inspecting [Commerce Integration Layer][docs] extensions.
|
|
6
|
+
|
|
7
|
+
It is published to the public npm registry and installed on demand as a runtime oclif
|
|
8
|
+
plugin; it is never bundled into the base `@commercetools/cli`.
|
|
9
|
+
|
|
10
|
+
[docs]: https://docs.commercetools.com/integration-layer
|
|
6
11
|
|
|
7
12
|
## Install
|
|
8
13
|
|
|
9
14
|
```bash
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
# @latest once plugin-plugins is promoted to the latest release.
|
|
15
|
+
# NB: use @dev for now — the `plugins` command (@oclif/plugin-plugins) ships only in
|
|
16
|
+
# the CLI's dev prerelease. Drop @dev once it is promoted to the latest release.
|
|
13
17
|
npm install -g @commercetools/cli@dev
|
|
14
18
|
|
|
15
19
|
# Opt in to the integration-layer topic (public npm — no auth needed)
|
|
16
20
|
commercetools plugins install @commercetools/cli-topic-integration-layer
|
|
21
|
+
|
|
22
|
+
# Log in once — mints the manage_project token the authenticated commands reuse
|
|
23
|
+
commercetools auth login --project-key <your-project-key>
|
|
17
24
|
```
|
|
18
25
|
|
|
19
26
|
## Commands
|
|
20
27
|
|
|
21
28
|
```bash
|
|
22
|
-
commercetools integration-layer init
|
|
29
|
+
commercetools integration-layer init [DIR] # scaffold an extensions monorepo [offline]
|
|
30
|
+
|
|
31
|
+
commercetools integration-layer extension build # bundle src/extension.ts → dist [offline]
|
|
32
|
+
commercetools integration-layer extension serve # local dev server, GraphiQL + hot reload
|
|
33
|
+
commercetools integration-layer extension invoke # fire a sample API-Extension callback [offline]
|
|
34
|
+
commercetools integration-layer extension validate # local checks + remote compose/breaking gate
|
|
35
|
+
commercetools integration-layer extension push # build + validate + upload, then await the load verdict
|
|
36
|
+
commercetools integration-layer extension status # the Project's stored bundle
|
|
37
|
+
commercetools integration-layer extension delete # remove the extension subgraph
|
|
23
38
|
|
|
24
|
-
commercetools integration-layer
|
|
25
|
-
commercetools integration-layer
|
|
26
|
-
commercetools integration-layer extension push [--force] # build + validate + upload the bundle
|
|
27
|
-
[--source-revision <rev> | --no-source-revision] # provenance; default: detected from git
|
|
28
|
-
commercetools integration-layer extension status # show the project's stored bundle
|
|
29
|
-
commercetools integration-layer extension delete [--yes] # remove the extension subgraph
|
|
39
|
+
commercetools integration-layer explore # local GraphQL explorer over your deployed edge
|
|
40
|
+
commercetools integration-layer schema fetch # the Project's core-subgraph SDL
|
|
30
41
|
|
|
31
|
-
commercetools integration-layer
|
|
42
|
+
commercetools integration-layer config list|get|set|unset # per-project extension configuration
|
|
32
43
|
|
|
33
|
-
commercetools integration-layer
|
|
34
|
-
commercetools integration-layer config get <KEY>
|
|
35
|
-
commercetools integration-layer config set <KEY> <VALUE> [--secret]
|
|
36
|
-
commercetools integration-layer config unset <KEY>
|
|
44
|
+
commercetools integration-layer allowlist list|add|remove|set # hosts the extension's fetch may reach
|
|
37
45
|
|
|
38
|
-
commercetools integration-layer --version
|
|
46
|
+
commercetools integration-layer --version # the installed plugin version [offline]
|
|
39
47
|
```
|
|
40
48
|
|
|
49
|
+
Add `--all` to `build` / `serve` / `validate` / `push` to merge every extension under
|
|
50
|
+
`./extensions/*` into the single bundle a Project deploys.
|
|
51
|
+
|
|
41
52
|
Authenticated commands present the token from `commercetools auth login` (a
|
|
42
|
-
`manage_project` bearer) and
|
|
43
|
-
`--integration-layer-url` / `INTEGRATION_LAYER_URL`
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
53
|
+
`manage_project` bearer) and derive the Commerce Integration Layer's hosts from your login
|
|
54
|
+
Region; `--integration-layer-url` / `INTEGRATION_LAYER_URL` overrides the extensions
|
|
55
|
+
edge.
|
|
56
|
+
|
|
57
|
+
**[Full reference — every command, flag, host, and CI usage][ref]** and
|
|
58
|
+
[extension-authoring detail][authoring] live in the
|
|
59
|
+
[commerce-integration-layer-extensions][repo] repository, which also holds ready-to-edit
|
|
60
|
+
templates for each pattern.
|
|
61
|
+
|
|
62
|
+
[repo]: https://github.com/commercetools/commerce-integration-layer-extensions
|
|
63
|
+
[ref]: https://github.com/commercetools/commerce-integration-layer-extensions/blob/main/docs/cli.md
|
|
64
|
+
[authoring]: https://github.com/commercetools/commerce-integration-layer-extensions/blob/main/docs/authoring.md
|
|
47
65
|
|
|
48
66
|
## Develop
|
|
49
67
|
|
|
50
|
-
This package lives in the
|
|
51
|
-
|
|
68
|
+
This package lives in the [commerce-integration-layer-extensions][repo] repo. From the repo
|
|
69
|
+
root:
|
|
52
70
|
|
|
53
71
|
```bash
|
|
54
|
-
pnpm
|
|
55
|
-
pnpm
|
|
56
|
-
pnpm
|
|
57
|
-
pnpm
|
|
58
|
-
pnpm
|
|
59
|
-
|
|
60
|
-
#
|
|
61
|
-
# commercetools plugins link . (from app/, after build)
|
|
72
|
+
pnpm install
|
|
73
|
+
pnpm --filter @commercetools/cli-topic-integration-layer build # tsc → dist/
|
|
74
|
+
pnpm --filter @commercetools/cli-topic-integration-layer test # vitest
|
|
75
|
+
pnpm typecheck
|
|
76
|
+
pnpm lint
|
|
77
|
+
|
|
78
|
+
pnpm setup:cli # build + `commercetools plugins link` this checkout
|
|
62
79
|
```
|
|
63
80
|
|
|
64
|
-
|
|
81
|
+
Changing the plugin? Add a changeset (`pnpm changeset`) in your PR — see
|
|
82
|
+
[Developing the plugin][dev] for the release flow.
|
|
65
83
|
|
|
66
|
-
|
|
84
|
+
[dev]: https://github.com/commercetools/commerce-integration-layer-extensions/blob/main/docs/cli.md#developing-the-plugin
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IntegrationLayerCommand } from "../../../lib/base.js";
|
|
2
|
+
export default class AllowlistAdd extends IntegrationLayerCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static strict: boolean;
|
|
6
|
+
static args: {
|
|
7
|
+
host: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
run(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Args } from "@oclif/core";
|
|
2
|
+
import { getAllowlist, putAllowlist } from "../../../lib/ilClient.js";
|
|
3
|
+
import { IntegrationLayerCommand } from "../../../lib/base.js";
|
|
4
|
+
export default class AllowlistAdd extends IntegrationLayerCommand {
|
|
5
|
+
static description = "Add one or more host patterns to the extension HTTP allowlist (exact host or *.suffix)";
|
|
6
|
+
static examples = [
|
|
7
|
+
"<%= config.bin %> integration-layer allowlist add api.vendor.com",
|
|
8
|
+
"<%= config.bin %> integration-layer allowlist add api.vendor.com '*.algolia.net'",
|
|
9
|
+
];
|
|
10
|
+
// Variadic: the write route replaces the whole allow list, so we read it, merge in
|
|
11
|
+
// the new hosts, and PUT the union. Any number of hosts in one call.
|
|
12
|
+
static strict = false;
|
|
13
|
+
static args = {
|
|
14
|
+
host: Args.string({
|
|
15
|
+
description: "host pattern to allow (bare host, e.g. api.example.com or *.example.com)",
|
|
16
|
+
required: true,
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
19
|
+
async run() {
|
|
20
|
+
const { argv, flags } = await this.parse(AllowlistAdd);
|
|
21
|
+
const hosts = argv.map((h) => h.trim()).filter((h) => h !== "");
|
|
22
|
+
const { baseUrl, projectKey, token } = await this.resolveIlContext(flags);
|
|
23
|
+
const { allow } = await getAllowlist(baseUrl, projectKey, token);
|
|
24
|
+
// Existing entries are stored lowercased; compare case-insensitively so we don't
|
|
25
|
+
// re-send a host that's already there (the Commerce Integration Layer would de-dupe anyway).
|
|
26
|
+
const existing = new Set(allow.map((h) => h.toLowerCase()));
|
|
27
|
+
const added = hosts.filter((h) => !existing.has(h.toLowerCase()));
|
|
28
|
+
if (added.length === 0) {
|
|
29
|
+
this.log(`Nothing to add — every host is already allowed for '${projectKey}'.`);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
// The Commerce Integration Layer validates + normalizes (lowercase, de-dupe) on write.
|
|
33
|
+
const { allow: result, version } = await putAllowlist(baseUrl, projectKey, token, [
|
|
34
|
+
...allow,
|
|
35
|
+
...added,
|
|
36
|
+
]);
|
|
37
|
+
this.log(`✓ added ${added.map((h) => `'${h}'`).join(", ")} for '${projectKey}' (version ${version}).`);
|
|
38
|
+
this.log(`Allowed hosts: ${result.join(", ")}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=add.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../../../src/commands/integration-layer/allowlist/add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,uBAAuB;IAC/D,MAAM,CAAU,WAAW,GACzB,wFAAwF,CAAC;IAE3F,MAAM,CAAU,QAAQ,GAAG;QACzB,kEAAkE;QAClE,kFAAkF;KACnF,CAAC;IAEF,mFAAmF;IACnF,qEAAqE;IACrE,MAAM,CAAU,MAAM,GAAG,KAAK,CAAC;IAE/B,MAAM,CAAU,IAAI,GAAG;QACrB,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC;YAChB,WAAW,EAAE,0EAA0E;YACvF,QAAQ,EAAE,IAAI;SACf,CAAC;KACH,CAAC;IAEF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QACvD,MAAM,KAAK,GAAI,IAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EA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llowlist } from "../../../lib/ilClient.js";
|
|
2
|
+
import { IntegrationLayerCommand } from "../../../lib/base.js";
|
|
3
|
+
export default class AllowlistList extends IntegrationLayerCommand {
|
|
4
|
+
static description = "List the project's extension HTTP allowlist — the hosts the extension sandbox's fetch may reach";
|
|
5
|
+
static examples = ["<%= config.bin %> integration-layer allowlist list"];
|
|
6
|
+
async run() {
|
|
7
|
+
const { flags } = await this.parse(AllowlistList);
|
|
8
|
+
const { baseUrl, projectKey, token } = await this.resolveIlContext(flags);
|
|
9
|
+
const { allow, deny } = await getAllowlist(baseUrl, projectKey, token);
|
|
10
|
+
if (allow.length === 0) {
|
|
11
|
+
this.log(`No allowlisted hosts for '${projectKey}' — the extension's fetch can reach nothing.`);
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
this.log(`Allowed hosts for '${projectKey}':`);
|
|
15
|
+
for (const host of allow)
|
|
16
|
+
this.log(` ${host}`);
|
|
17
|
+
}
|
|
18
|
+
// The operator deny ceiling is informational: a host is reachable only if it
|
|
19
|
+
// matches `allow` AND not `deny`. It is not editable from here.
|
|
20
|
+
if (deny.length > 0) {
|
|
21
|
+
this.log("");
|
|
22
|
+
this.log("Denied by the operator (takes precedence, read-only):");
|
|
23
|
+
for (const host of deny)
|
|
24
|
+
this.log(` ${host}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/commands/integration-layer/allowlist/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,uBAAuB;IAChE,MAAM,CAAU,WAAW,GACzB,iGAAiG,CAAC;IAEpG,MAAM,CAAU,QAAQ,GAAG,CAAC,oDAAoD,CAAC,CAAC;IAElF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QAClD,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAC1E,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QAEvE,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,IAAI,CAAC,GAAG,CAAC,6BAA6B,UAAU,8CAA8C,CAAC,CAAC;QAClG,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,GAAG,CAAC,sBAAsB,UAAU,IAAI,CAAC,CAAC;YAC/C,KAAK,MAAM,IAAI,IAAI,KAAK;gBAAE,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;QAClD,CAAC;QAED,6EAA6E;QAC7E,gEAAgE;QAChE,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpB,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACb,IAAI,CAAC,GAAG,CAAC,uDAAuD,CAAC,CAAC;YAClE,KAAK,MAAM,IAAI,IAAI,IAAI;gBAAE,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;QACjD,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IntegrationLayerCommand } from "../../../lib/base.js";
|
|
2
|
+
export default class AllowlistRemove extends IntegrationLayerCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static strict: boolean;
|
|
6
|
+
static flags: {
|
|
7
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
};
|
|
9
|
+
static args: {
|
|
10
|
+
host: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Args, Flags } from "@oclif/core";
|
|
2
|
+
import { confirmAllowlistChange } from "../../../lib/allowlistPrompt.js";
|
|
3
|
+
import { getAllowlist, putAllowlist } from "../../../lib/ilClient.js";
|
|
4
|
+
import { IntegrationLayerCommand } from "../../../lib/base.js";
|
|
5
|
+
export default class AllowlistRemove extends IntegrationLayerCommand {
|
|
6
|
+
static description = "Remove one or more host patterns from the extension HTTP allowlist";
|
|
7
|
+
static examples = [
|
|
8
|
+
"<%= config.bin %> integration-layer allowlist remove api.vendor.com",
|
|
9
|
+
"<%= config.bin %> integration-layer allowlist remove api.vendor.com '*.algolia.net'",
|
|
10
|
+
"<%= config.bin %> integration-layer allowlist remove api.vendor.com --force",
|
|
11
|
+
];
|
|
12
|
+
// Variadic: read-modify-write, same as `add` — the write route replaces the whole
|
|
13
|
+
// allow list, so we PUT the remaining hosts.
|
|
14
|
+
static strict = false;
|
|
15
|
+
static flags = {
|
|
16
|
+
force: Flags.boolean({
|
|
17
|
+
description: "apply the change without confirmation",
|
|
18
|
+
default: false,
|
|
19
|
+
}),
|
|
20
|
+
};
|
|
21
|
+
static args = {
|
|
22
|
+
host: Args.string({
|
|
23
|
+
description: "host pattern to remove (as stored, e.g. api.example.com or *.example.com)",
|
|
24
|
+
required: true,
|
|
25
|
+
}),
|
|
26
|
+
};
|
|
27
|
+
async run() {
|
|
28
|
+
const { argv, flags } = await this.parse(AllowlistRemove);
|
|
29
|
+
// Stored entries are lowercased, so match case-insensitively.
|
|
30
|
+
const targets = new Set(argv.map((h) => h.trim().toLowerCase()).filter((h) => h !== ""));
|
|
31
|
+
const { baseUrl, projectKey, token } = await this.resolveIlContext(flags);
|
|
32
|
+
const { allow } = await getAllowlist(baseUrl, projectKey, token);
|
|
33
|
+
const remaining = allow.filter((h) => !targets.has(h.toLowerCase()));
|
|
34
|
+
if (remaining.length === allow.length) {
|
|
35
|
+
this.log(`Nothing to remove — no matching host in the allowlist for '${projectKey}'.`);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const confirmed = await confirmAllowlistChange({
|
|
39
|
+
projectKey,
|
|
40
|
+
action: "remove",
|
|
41
|
+
current: allow,
|
|
42
|
+
next: remaining,
|
|
43
|
+
force: flags.force,
|
|
44
|
+
log: (line) => this.log(line),
|
|
45
|
+
abort: (message) => this.error(message),
|
|
46
|
+
});
|
|
47
|
+
if (!confirmed) {
|
|
48
|
+
this.log("Aborted.");
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const { allow: result, version } = await putAllowlist(baseUrl, projectKey, token, remaining);
|
|
52
|
+
this.log(`✓ removed ${[...targets].map((h) => `'${h}'`).join(", ")} from '${projectKey}' (version ${version}).`);
|
|
53
|
+
this.log(result.length > 0 ? `Allowed hosts: ${result.join(", ")}` : "Allowed hosts: (none)");
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=remove.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove.js","sourceRoot":"","sources":["../../../../src/commands/integration-layer/allowlist/remove.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,uBAAuB;IAClE,MAAM,CAAU,WAAW,GACzB,oEAAoE,CAAC;IAEvE,MAAM,CAAU,QAAQ,GAAG;QACzB,qEAAqE;QACrE,qFAAqF;QACrF,6E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AC;YACvF,OAAO;QACT,CAAC;QAED,MAAM,SAAS,GAAG,MAAM,sBAAsB,CAAC;YAC7C,UAAU;YACV,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;YAC7B,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;SACxC,CAAC,CAAC;QACH,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACrB,OAAO;QACT,CAAC;QAED,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QAC7F,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,UAAU,cAAc,OAAO,IAAI,CAAC,CAAC;QACjH,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,kBAAkB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC;IAChG,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IntegrationLayerCommand } from "../../../lib/base.js";
|
|
2
|
+
export default class AllowlistSet extends IntegrationLayerCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static strict: boolean;
|
|
6
|
+
static flags: {
|
|
7
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
};
|
|
9
|
+
static args: {
|
|
10
|
+
host: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Args, Flags } from "@oclif/core";
|
|
2
|
+
import { confirmAllowlistChange } from "../../../lib/allowlistPrompt.js";
|
|
3
|
+
import { getAllowlist, putAllowlist } from "../../../lib/ilClient.js";
|
|
4
|
+
import { IntegrationLayerCommand } from "../../../lib/base.js";
|
|
5
|
+
export default class AllowlistSet extends IntegrationLayerCommand {
|
|
6
|
+
static description = "Replace the ENTIRE extension HTTP allowlist with the given host patterns";
|
|
7
|
+
static examples = [
|
|
8
|
+
"<%= config.bin %> integration-layer allowlist set api.vendor.com '*.algolia.net'",
|
|
9
|
+
"<%= config.bin %> integration-layer allowlist set api.vendor.com --force",
|
|
10
|
+
];
|
|
11
|
+
// Variadic: full replace, but at least one host is required — clearing the whole
|
|
12
|
+
// list in one shot is too easy to do by mistake.
|
|
13
|
+
static strict = false;
|
|
14
|
+
static flags = {
|
|
15
|
+
force: Flags.boolean({
|
|
16
|
+
description: "apply the change without confirmation",
|
|
17
|
+
default: false,
|
|
18
|
+
}),
|
|
19
|
+
};
|
|
20
|
+
static args = {
|
|
21
|
+
host: Args.string({
|
|
22
|
+
description: "host pattern to allow (bare host, e.g. api.example.com or *.example.com)",
|
|
23
|
+
required: true,
|
|
24
|
+
}),
|
|
25
|
+
};
|
|
26
|
+
async run() {
|
|
27
|
+
const { argv, flags } = await this.parse(AllowlistSet);
|
|
28
|
+
const hosts = argv.map((h) => h.trim()).filter((h) => h !== "");
|
|
29
|
+
if (hosts.length === 0) {
|
|
30
|
+
this.error("At least one host pattern is required. Use 'allowlist remove' to drop individual hosts.");
|
|
31
|
+
}
|
|
32
|
+
const { baseUrl, projectKey, token } = await this.resolveIlContext(flags);
|
|
33
|
+
const { allow: current } = await getAllowlist(baseUrl, projectKey, token);
|
|
34
|
+
const confirmed = await confirmAllowlistChange({
|
|
35
|
+
projectKey,
|
|
36
|
+
action: "set",
|
|
37
|
+
current,
|
|
38
|
+
next: hosts,
|
|
39
|
+
force: flags.force,
|
|
40
|
+
log: (line) => this.log(line),
|
|
41
|
+
abort: (message) => this.error(message),
|
|
42
|
+
});
|
|
43
|
+
if (!confirmed) {
|
|
44
|
+
this.log("Aborted.");
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const { allow, version } = await putAllowlist(baseUrl, projectKey, token, hosts);
|
|
48
|
+
this.log(`✓ set the allowlist for '${projectKey}' (version ${version}).`);
|
|
49
|
+
this.log(`Allowed hosts: ${allow.join(", ")}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set.js","sourceRoot":"","sources":["../../../../src/commands/integration-layer/allowlist/set.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,uBAAuB;IAC/D,MAAM,CAAU,WAAW,GACzB,0EAA0E,CAAC;IAE7E,MAAM,CAAU,QAAQ,GAAG;QACzB,kFAAkF;QAClF,0EAA0E;KAC3E,CAAC;IAEF,iFAAiF;IACjF,iDAAiD;IACjD,MAAM,CAAU,MAAM,GAAG,KAAK,CAAC;IAE/B,MAAM,CAAU,KAAK,GAAG;QACtB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC;YACnB,WAAW,EAAE,uCAAuC;YACpD,OAAO,EAAE,KAAK;SACf,C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AAO;QACT,CAAC;QAED,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QACjF,IAAI,CAAC,GAAG,CAAC,4BAA4B,UAAU,cAAc,OAAO,IAAI,CAAC,CAAC;QAC1E,IAAI,CAAC,GAAG,CAAC,kBAAkB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjD,CAAC"}
|
|
@@ -10,7 +10,7 @@ export default class ConfigUnset extends IntegrationLayerCommand {
|
|
|
10
10
|
async run() {
|
|
11
11
|
const { args, flags } = await this.parse(ConfigUnset);
|
|
12
12
|
const { baseUrl, projectKey, token } = await this.resolveIlContext(flags);
|
|
13
|
-
// A PATCH entry with `value: null` deletes that key (
|
|
13
|
+
// A PATCH entry with `value: null` deletes that key (Commerce Integration Layer contract).
|
|
14
14
|
await patchConfig(baseUrl, projectKey, token, [{ key: args.key, value: null }]);
|
|
15
15
|
this.log(`✓ removed '${args.key}' from '${projectKey}'.`);
|
|
16
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unset.js","sourceRoot":"","sources":["../../../../src/commands/integration-layer/config/unset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,uBAAuB;IAC9D,MAAM,CAAU,WAAW,GAAG,kCAAkC,CAAC;IAEjE,MAAM,CAAU,QAAQ,GAAG,CAAC,iEAAiE,CAAC,CAAC;IAE/F,MAAM,CAAU,IAAI,GAAG;QACrB,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,sBAAsB,EAAE,QAAQ,EAAE,IAAI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,CAAC,cAAc,IAAI,CAAC,GAAG,WAAW,UAAU,IAAI,CAAC,CAAC;IAC5D,CAAC"}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
// is not reimplemented here. To see what a customer sees, log in as them.
|
|
21
21
|
//
|
|
22
22
|
// PRESENTMENT — prices are selected from the session's locale/currency/country, which
|
|
23
|
-
// the
|
|
23
|
+
// the Commerce Integration Layer resolves ONCE at mint (it has no per-request override, by
|
|
24
24
|
// design). So `--locale/--currency/--country` are mint-time flags: to explore a
|
|
25
25
|
// different market, restart the explorer. Send none and you get the project's
|
|
26
26
|
// configured defaults, like a storefront with no locale switcher.
|
|
@@ -74,12 +74,12 @@ export default class Explore extends IntegrationLayerCommand {
|
|
|
74
74
|
"graphql-url": Flags.string({
|
|
75
75
|
description: "GraphQL edge base URL — the router (also settable via IL_GRAPHQL_URL); overrides the URL derived from your login region",
|
|
76
76
|
env: "IL_GRAPHQL_URL",
|
|
77
|
-
helpGroup: "INTEGRATION LAYER",
|
|
77
|
+
helpGroup: "COMMERCE INTEGRATION LAYER",
|
|
78
78
|
}),
|
|
79
79
|
"auth-url": Flags.string({
|
|
80
80
|
description: "identity edge base URL, where sessions are minted (also settable via IL_AUTH_URL); overrides the URL derived from your login region",
|
|
81
81
|
env: "IL_AUTH_URL",
|
|
82
|
-
helpGroup: "INTEGRATION LAYER",
|
|
82
|
+
helpGroup: "COMMERCE INTEGRATION LAYER",
|
|
83
83
|
}),
|
|
84
84
|
};
|
|
85
85
|
async run() {
|
|
@@ -111,6 +111,7 @@ export default class Explore extends IntegrationLayerCommand {
|
|
|
111
111
|
schema: resolved.schema,
|
|
112
112
|
endpoint,
|
|
113
113
|
bearer: session.token,
|
|
114
|
+
clientVersion: this.config.version,
|
|
114
115
|
});
|
|
115
116
|
await new Promise((resolve, reject) => {
|
|
116
117
|
server.once("error", reject);
|
|
@@ -144,7 +145,7 @@ export default class Explore extends IntegrationLayerCommand {
|
|
|
144
145
|
async resolveSchema(deployed, baseUrl, projectKey, token) {
|
|
145
146
|
if (deployed) {
|
|
146
147
|
this.log(`Fetching the deployed composed schema for '${projectKey}' …`);
|
|
147
|
-
// Already a public API schema — the
|
|
148
|
+
// Already a public API schema — the Commerce Integration Layer reduces it before
|
|
148
149
|
// sending, so there is no supergraph to unpick here. (The LOCAL path below
|
|
149
150
|
// still composes, which is why this command keeps a composition dependency.)
|
|
150
151
|
const apiSdl = await fetchDeployedApiSchemaSdl(baseUrl, projectKey, token);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explore.js","sourceRoot":"","sources":["../../../src/commands/integration-layer/explore.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,EAAE;AACF,oFAAoF;AACpF,mFAAmF;AACnF,qDAAqD;AACrD,EAAE;AACF,mFAAmF;AACnF,gFAAgF;AAChF,iFAAiF;AACjF,6EAA6E;AAC7E,EAAE;AACF,kFAAkF;AAClF,kFAAkF;AAClF,mFAAmF;AACnF,EAAE;AACF,qFAAqF;AACrF,+EAA+E;AAC/E,uFAAuF;AACvF,sFAAsF;AACtF,0EAA0E;AAC1E,EAAE;AACF,sFAAsF;AACtF,
|
|
1
|
+
{"version":3,"file":"explore.js","sourceRoot":"","sources":["../../../src/commands/integration-layer/explore.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,EAAE;AACF,oFAAoF;AACpF,mFAAmF;AACnF,qDAAqD;AACrD,EAAE;AACF,mFAAmF;AACnF,gFAAgF;AAChF,iFAAiF;AACjF,6EAA6E;AAC7E,EAAE;AACF,kFAAkF;AAClF,kFAAkF;AAClF,mFAAmF;AACnF,EAAE;AACF,qFAAqF;AACrF,+EAA+E;AAC/E,uFAAuF;AACvF,sFAAsF;AACtF,0EAA0E;AAC1E,EAAE;AACF,sFAAsF;AACtF,2FAA2F;AAC3F,gFAAgF;AAChF,8EAA8E;AAC9E,kEAAkE;AAElE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACpD,OA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CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,KAAK,IAAI,CAAC,CAAC;YAC9D,IAAI,CAAC,QAAQ;gBAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;YACtD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;QAC/C,CAAC;gBAAS,CAAC;YACT,EAAE,CAAC,KAAK,EAAE,CAAC;QACb,CAAC;IACH,CAAC;;AAIH,+DAA+D;AAC/D,KAAK,UAAU,MAAM,CAAC,IAAY;IAChC,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -17,7 +17,7 @@ export default class ExtensionPush extends IntegrationLayerCommand {
|
|
|
17
17
|
* Report how the pushed version fared and say whether the command should fail.
|
|
18
18
|
*
|
|
19
19
|
* Only a genuine `failed` verdict is an error. Not being ABLE to find out — an
|
|
20
|
-
* older
|
|
20
|
+
* older Commerce Integration Layer, an extension that isn't deployed, a metadata read that
|
|
21
21
|
* errored — is reported honestly and left as a success, because the push itself
|
|
22
22
|
* did land and failing it would break workflows that never had this signal.
|
|
23
23
|
*/
|
|
@@ -14,7 +14,7 @@ import { IntegrationLayerCommand } from "../../../lib/base.js";
|
|
|
14
14
|
// extension happens to be mid-poll already.
|
|
15
15
|
const POLL_INTERVAL_MS = 5000;
|
|
16
16
|
/**
|
|
17
|
-
* Name a build the way its author recognises it: the
|
|
17
|
+
* Name a build the way its author recognises it: the Commerce Integration Layer's version
|
|
18
18
|
* number AND the source revision it was built from. The number is an internal
|
|
19
19
|
* counter — the commit is the identity. Falls back to the bare version when the
|
|
20
20
|
* push recorded no revision.
|
|
@@ -52,7 +52,7 @@ export default class ExtensionPush extends IntegrationLayerCommand {
|
|
|
52
52
|
// Provenance. The default is auto-detection from the working copy, so a plain
|
|
53
53
|
// `push` records where the build came from with no ceremony; the flag is for a
|
|
54
54
|
// non-git VCS, a CI build id, or anything else the integrator identifies revisions
|
|
55
|
-
// by (the
|
|
55
|
+
// by (the Commerce Integration Layer stores an opaque string).
|
|
56
56
|
"source-revision": Flags.string({
|
|
57
57
|
description: "version-control revision this build came from (default: detected from the git working copy; also settable via EXTENSION_SOURCE_REVISION)",
|
|
58
58
|
env: "EXTENSION_SOURCE_REVISION",
|
|
@@ -81,7 +81,7 @@ export default class ExtensionPush extends IntegrationLayerCommand {
|
|
|
81
81
|
* Report how the pushed version fared and say whether the command should fail.
|
|
82
82
|
*
|
|
83
83
|
* Only a genuine `failed` verdict is an error. Not being ABLE to find out — an
|
|
84
|
-
* older
|
|
84
|
+
* older Commerce Integration Layer, an extension that isn't deployed, a metadata read that
|
|
85
85
|
* errored — is reported honestly and left as a success, because the push itself
|
|
86
86
|
* did land and failing it would break workflows that never had this signal.
|
|
87
87
|
*/
|
|
@@ -112,7 +112,7 @@ export default class ExtensionPush extends IntegrationLayerCommand {
|
|
|
112
112
|
/** True when the remote result should abort the push. */
|
|
113
113
|
reportRemote(result) {
|
|
114
114
|
if (!result.composes) {
|
|
115
|
-
this.logToStderr("✗ extension does not compose with the
|
|
115
|
+
this.logToStderr("✗ extension does not compose with the Commerce Integration Layer supergraph:");
|
|
116
116
|
for (const err of result.compositionErrors)
|
|
117
117
|
this.logToStderr(` - ${err}`);
|
|
118
118
|
}
|
|
@@ -123,10 +123,10 @@ export default class ExtensionPush extends IntegrationLayerCommand {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
else if (!result.comparedToPublished) {
|
|
126
|
-
this.log("✓ composes with the
|
|
126
|
+
this.log("✓ composes with the Commerce Integration Layer supergraph (breaking-change check skipped: no published baseline)");
|
|
127
127
|
}
|
|
128
128
|
else {
|
|
129
|
-
this.log("✓ composes with the
|
|
129
|
+
this.log("✓ composes with the Commerce Integration Layer supergraph and introduces no breaking changes");
|
|
130
130
|
}
|
|
131
131
|
return result.valid;
|
|
132
132
|
}
|
|
@@ -160,7 +160,7 @@ export default class ExtensionPush extends IntegrationLayerCommand {
|
|
|
160
160
|
throw err;
|
|
161
161
|
}
|
|
162
162
|
const { baseUrl, projectKey, token } = await this.resolveIlContext(flags);
|
|
163
|
-
// Remote check composes the GraphQL subgraph WITH the
|
|
163
|
+
// Remote check composes the GraphQL subgraph WITH the Commerce Integration Layer + checks
|
|
164
164
|
// for breaking changes. Only applies when the bundle has a subgraph — an
|
|
165
165
|
// API-extensions-only bundle has no SDL, so skip straight to the upload.
|
|
166
166
|
if (typeDefs !== null) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push.js","sourceRoot":"","sources":["../../../../src/commands/integration-layer/extension/push.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/F,OAAO,EAAE,UAAU,EAAE,cAAc,EAA+B,MAAM,0BAA0B,CAAC;AACnG,OAAO,EAAE,gBAAgB,EAAsB,MAAM,kCAAkC,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,qFAAqF;AACrF,gFAAgF;AAChF,6EAA6E;AAC7E,4CAA4C;AAC5C,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAE9B;;;;;GAKG;AACH,SAAS,aAAa,CAAC,OA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AE,KAAK,CAAC,cAAc,CAAC,GAAG,IAAI;YACvC,UAAU,EAAE,gBAAgB;SAC7B,CAAC,CAAC;QACH,IAAI,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9C,IAAI,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAC;QACvD,CAAC;IACH,CAAC"}
|
|
@@ -13,8 +13,8 @@ export default class ExtensionServe extends IntegrationLayerCommand {
|
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
15
|
* The identity/storefront edge (the `auth.` host) — where `--gateway`/`--all` mint the
|
|
16
|
-
* anonymous session AND reach the
|
|
17
|
-
* served by the
|
|
16
|
+
* anonymous session AND reach the Commerce Integration Layer's CORE subgraph `/graphql`. Both are
|
|
17
|
+
* served by the identity edge, a DIFFERENT host from the extensions edge
|
|
18
18
|
* ({@link IlContext.baseUrl}, `extensions.`, which serves `/subgraph`). The gateway must
|
|
19
19
|
* route to the core subgraph here, NOT the `graphql.` router edge, whose COMPOSED graph
|
|
20
20
|
* would double-count the local extension. Overridable via --auth-url / IL_AUTH_URL for
|
|
@@ -25,9 +25,9 @@ export default class ExtensionServe extends IntegrationLayerCommand {
|
|
|
25
25
|
/**
|
|
26
26
|
* `--all`: merge every extension under `./extensions/*` into ONE federation subgraph —
|
|
27
27
|
* the single bundle a project deploys — and serve it behind a local federated gateway
|
|
28
|
-
* with the deployed
|
|
28
|
+
* with the deployed Commerce Integration Layer, exactly the two-subgraph shape the router plans
|
|
29
29
|
* over (core + the combined `extensions` subgraph). Like `--gateway` it reaches the
|
|
30
|
-
*
|
|
30
|
+
* Commerce Integration Layer (fetches its SDL, mints an anonymous session), so it needs a
|
|
31
31
|
* `commercetools auth login`. Watches every extension and hot-reloads: any edit
|
|
32
32
|
* re-merges the combined subgraph, and a schema change recomposes + rebuilds the gateway.
|
|
33
33
|
*/
|