@vendure/cloud 0.3.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/dist/cli/commands/deployment/build-logs.js +2 -9
- package/dist/cli/commands/deployment/build-logs.js.map +1 -1
- package/dist/cli/commands/deployment/deploy.d.ts.map +1 -1
- package/dist/cli/commands/deployment/deploy.js +34 -64
- package/dist/cli/commands/deployment/deploy.js.map +1 -1
- package/dist/cli/commands/deployment/index.d.ts.map +1 -1
- package/dist/cli/commands/deployment/index.js +52 -27
- package/dist/cli/commands/deployment/index.js.map +1 -1
- package/dist/cli/commands/deployment/log-export.d.ts +13 -0
- package/dist/cli/commands/deployment/log-export.d.ts.map +1 -0
- package/dist/cli/commands/deployment/log-export.js +133 -0
- package/dist/cli/commands/deployment/log-export.js.map +1 -0
- package/dist/cli/commands/deployment/log-query-output.d.ts +13 -0
- package/dist/cli/commands/deployment/log-query-output.d.ts.map +1 -0
- package/dist/cli/commands/deployment/log-query-output.js +106 -0
- package/dist/cli/commands/deployment/log-query-output.js.map +1 -0
- package/dist/cli/commands/deployment/logs.d.ts +1 -0
- package/dist/cli/commands/deployment/logs.d.ts.map +1 -1
- package/dist/cli/commands/deployment/logs.js +347 -69
- package/dist/cli/commands/deployment/logs.js.map +1 -1
- package/dist/cli/commands/deployment/options.d.ts +2 -6
- package/dist/cli/commands/deployment/options.d.ts.map +1 -1
- package/dist/cli/commands/deployment/options.js +21 -9
- package/dist/cli/commands/deployment/options.js.map +1 -1
- package/dist/cli/commands/deployment/plan.d.ts +1 -1
- package/dist/cli/commands/deployment/plan.d.ts.map +1 -1
- package/dist/cli/commands/deployment/plan.js +4 -6
- package/dist/cli/commands/deployment/plan.js.map +1 -1
- package/dist/cli/commands/deployment/recovery.d.ts +9 -0
- package/dist/cli/commands/deployment/recovery.d.ts.map +1 -0
- package/dist/cli/commands/deployment/recovery.js +86 -0
- package/dist/cli/commands/deployment/recovery.js.map +1 -0
- package/dist/cli/commands/deployment/rollback.d.ts.map +1 -1
- package/dist/cli/commands/deployment/rollback.js +8 -3
- package/dist/cli/commands/deployment/rollback.js.map +1 -1
- package/dist/cli/commands/deployment/show.d.ts.map +1 -1
- package/dist/cli/commands/deployment/show.js +16 -5
- package/dist/cli/commands/deployment/show.js.map +1 -1
- package/dist/cli/commands/deployment/source.d.ts +1 -12
- package/dist/cli/commands/deployment/source.d.ts.map +1 -1
- package/dist/cli/commands/deployment/source.js +5 -13
- package/dist/cli/commands/deployment/source.js.map +1 -1
- package/dist/cli/commands/deployment/status.d.ts.map +1 -1
- package/dist/cli/commands/deployment/status.js +22 -20
- package/dist/cli/commands/deployment/status.js.map +1 -1
- package/dist/cli/commands/deployment/teardown.d.ts.map +1 -1
- package/dist/cli/commands/deployment/teardown.js +12 -1
- package/dist/cli/commands/deployment/teardown.js.map +1 -1
- package/dist/cli/commands/identity-context/keys.d.ts.map +1 -1
- package/dist/cli/commands/identity-context/keys.js +6 -5
- package/dist/cli/commands/identity-context/keys.js.map +1 -1
- package/dist/cli/commands/identity-context/login.d.ts.map +1 -1
- package/dist/cli/commands/identity-context/login.js +2 -2
- package/dist/cli/commands/identity-context/login.js.map +1 -1
- package/dist/cli/commands/identity-context/logout.d.ts.map +1 -1
- package/dist/cli/commands/identity-context/logout.js +3 -4
- package/dist/cli/commands/identity-context/logout.js.map +1 -1
- package/dist/cli/commands/identity-context/org-switch.d.ts.map +1 -1
- package/dist/cli/commands/identity-context/org-switch.js +19 -7
- package/dist/cli/commands/identity-context/org-switch.js.map +1 -1
- package/dist/cli/commands/identity-context/use.d.ts.map +1 -1
- package/dist/cli/commands/identity-context/use.js +2 -3
- package/dist/cli/commands/identity-context/use.js.map +1 -1
- package/dist/cli/commands/identity-context/whoami.d.ts.map +1 -1
- package/dist/cli/commands/identity-context/whoami.js +33 -12
- package/dist/cli/commands/identity-context/whoami.js.map +1 -1
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +0 -1
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/project-config/config/desired-state.d.ts +1 -1
- package/dist/cli/commands/project-config/config/desired-state.d.ts.map +1 -1
- package/dist/cli/commands/project-config/config/desired-state.js +4 -3
- package/dist/cli/commands/project-config/config/desired-state.js.map +1 -1
- package/dist/cli/commands/project-config/config/email/domain.d.ts +5 -0
- package/dist/cli/commands/project-config/config/email/domain.d.ts.map +1 -0
- package/dist/cli/commands/project-config/config/email/domain.js +80 -0
- package/dist/cli/commands/project-config/config/email/domain.js.map +1 -0
- package/dist/cli/commands/project-config/config/email/events.d.ts +4 -0
- package/dist/cli/commands/project-config/config/email/events.d.ts.map +1 -0
- package/dist/cli/commands/project-config/config/email/events.js +55 -0
- package/dist/cli/commands/project-config/config/email/events.js.map +1 -0
- package/dist/cli/commands/project-config/config/email/index.d.ts +2 -0
- package/dist/cli/commands/project-config/config/email/index.d.ts.map +1 -0
- package/dist/cli/commands/project-config/config/email/index.js +108 -0
- package/dist/cli/commands/project-config/config/email/index.js.map +1 -0
- package/dist/cli/commands/project-config/config/email/test-sending.d.ts +4 -0
- package/dist/cli/commands/project-config/config/email/test-sending.d.ts.map +1 -0
- package/dist/cli/commands/project-config/config/email/test-sending.js +68 -0
- package/dist/cli/commands/project-config/config/email/test-sending.js.map +1 -0
- package/dist/cli/commands/project-config/config/index.d.ts.map +1 -1
- package/dist/cli/commands/project-config/config/index.js +12 -7
- package/dist/cli/commands/project-config/config/index.js.map +1 -1
- package/dist/cli/commands/project-config/config/runtime.d.ts +2 -1
- package/dist/cli/commands/project-config/config/runtime.d.ts.map +1 -1
- package/dist/cli/commands/project-config/config/runtime.js +43 -29
- package/dist/cli/commands/project-config/config/runtime.js.map +1 -1
- package/dist/cli/commands/project-config/env/index.d.ts.map +1 -1
- package/dist/cli/commands/project-config/env/index.js +8 -2
- package/dist/cli/commands/project-config/env/index.js.map +1 -1
- package/dist/cli/commands/project-config/environment/index.d.ts.map +1 -1
- package/dist/cli/commands/project-config/environment/index.js +15 -1
- package/dist/cli/commands/project-config/environment/index.js.map +1 -1
- package/dist/cli/commands/project-config/environment/regions.d.ts +6 -0
- package/dist/cli/commands/project-config/environment/regions.d.ts.map +1 -0
- package/dist/cli/commands/project-config/environment/regions.js +22 -0
- package/dist/cli/commands/project-config/environment/regions.js.map +1 -0
- package/dist/cli/commands/project-config/init/init.d.ts.map +1 -1
- package/dist/cli/commands/project-config/init/init.js +28 -5
- package/dist/cli/commands/project-config/init/init.js.map +1 -1
- package/dist/cli/commands/project-config/project/list.d.ts.map +1 -1
- package/dist/cli/commands/project-config/project/list.js +8 -1
- package/dist/cli/commands/project-config/project/list.js.map +1 -1
- package/dist/cli/commands/project-config/project/show.d.ts.map +1 -1
- package/dist/cli/commands/project-config/project/show.js +12 -0
- package/dist/cli/commands/project-config/project/show.js.map +1 -1
- package/dist/cli/commands/project-config/project/subscription-state.d.ts +5 -0
- package/dist/cli/commands/project-config/project/subscription-state.d.ts.map +1 -0
- package/dist/cli/commands/project-config/project/subscription-state.js +57 -0
- package/dist/cli/commands/project-config/project/subscription-state.js.map +1 -0
- package/dist/cli/commands/project-config/source/connect.d.ts.map +1 -1
- package/dist/cli/commands/project-config/source/connect.js +5 -5
- package/dist/cli/commands/project-config/source/connect.js.map +1 -1
- package/dist/cli/commands/project-config/source/map.d.ts.map +1 -1
- package/dist/cli/commands/project-config/source/map.js +4 -4
- package/dist/cli/commands/project-config/source/map.js.map +1 -1
- package/dist/cli/commands/project-config/source/status.d.ts.map +1 -1
- package/dist/cli/commands/project-config/source/status.js +71 -17
- package/dist/cli/commands/project-config/source/status.js.map +1 -1
- package/dist/cli/commands/runtime-data/backup.d.ts +1 -0
- package/dist/cli/commands/runtime-data/backup.d.ts.map +1 -1
- package/dist/cli/commands/runtime-data/backup.js +36 -0
- package/dist/cli/commands/runtime-data/backup.js.map +1 -1
- package/dist/cli/commands/runtime-data/index.d.ts +1 -0
- package/dist/cli/commands/runtime-data/index.d.ts.map +1 -1
- package/dist/cli/commands/runtime-data/index.js +26 -4
- package/dist/cli/commands/runtime-data/index.js.map +1 -1
- package/dist/cli/commands/runtime-data/restore.d.ts.map +1 -1
- package/dist/cli/commands/runtime-data/restore.js +33 -5
- package/dist/cli/commands/runtime-data/restore.js.map +1 -1
- package/dist/cli/index.d.ts +13 -3
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +12 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/lib/auth.d.ts +21 -2
- package/dist/cli/lib/auth.d.ts.map +1 -1
- package/dist/cli/lib/auth.js +22 -2
- package/dist/cli/lib/auth.js.map +1 -1
- package/dist/cli/lib/commit.d.ts +4 -0
- package/dist/cli/lib/commit.d.ts.map +1 -0
- package/dist/cli/lib/commit.js +22 -0
- package/dist/cli/lib/commit.js.map +1 -0
- package/dist/cli/lib/console-credential.d.ts +55 -0
- package/dist/cli/lib/console-credential.d.ts.map +1 -0
- package/dist/cli/lib/console-credential.js +164 -0
- package/dist/cli/lib/console-credential.js.map +1 -0
- package/dist/cli/lib/console-origins.d.ts +30 -0
- package/dist/cli/lib/console-origins.d.ts.map +1 -0
- package/dist/cli/lib/console-origins.js +87 -0
- package/dist/cli/lib/console-origins.js.map +1 -0
- package/dist/cli/lib/console-pairing.d.ts +15 -0
- package/dist/cli/lib/console-pairing.d.ts.map +1 -0
- package/dist/cli/lib/console-pairing.js +70 -0
- package/dist/cli/lib/console-pairing.js.map +1 -0
- package/dist/cli/lib/console-session-lock.d.ts +39 -0
- package/dist/cli/lib/console-session-lock.d.ts.map +1 -0
- package/dist/cli/lib/console-session-lock.js +235 -0
- package/dist/cli/lib/console-session-lock.js.map +1 -0
- package/dist/cli/lib/console-session.d.ts +47 -0
- package/dist/cli/lib/console-session.d.ts.map +1 -0
- package/dist/cli/lib/console-session.js +235 -0
- package/dist/cli/lib/console-session.js.map +1 -0
- package/dist/cli/lib/contract/backup-schedule-reasons.d.ts +4 -0
- package/dist/cli/lib/contract/backup-schedule-reasons.d.ts.map +1 -0
- package/dist/cli/lib/contract/backup-schedule-reasons.js +17 -0
- package/dist/cli/lib/contract/backup-schedule-reasons.js.map +1 -0
- package/dist/cli/lib/contract/build-settings.d.ts +1 -1
- package/dist/cli/lib/contract/database.d.ts +19 -0
- package/dist/cli/lib/contract/database.d.ts.map +1 -1
- package/dist/cli/lib/contract/database.js.map +1 -1
- package/dist/cli/lib/contract/deployments.d.ts +13 -0
- package/dist/cli/lib/contract/deployments.d.ts.map +1 -1
- package/dist/cli/lib/contract/deployments.js +38 -0
- package/dist/cli/lib/contract/deployments.js.map +1 -1
- package/dist/cli/lib/contract/desired-state.d.ts +3 -5
- package/dist/cli/lib/contract/desired-state.d.ts.map +1 -1
- package/dist/cli/lib/contract/desired-state.js +42 -28
- package/dist/cli/lib/contract/desired-state.js.map +1 -1
- package/dist/cli/lib/contract/foreign-credentials.d.ts +6 -4
- package/dist/cli/lib/contract/foreign-credentials.d.ts.map +1 -1
- package/dist/cli/lib/contract/foreign-credentials.js +7 -5
- package/dist/cli/lib/contract/foreign-credentials.js.map +1 -1
- package/dist/cli/lib/contract/logs.d.ts +120 -0
- package/dist/cli/lib/contract/logs.d.ts.map +1 -1
- package/dist/cli/lib/contract/logs.js +106 -1
- package/dist/cli/lib/contract/logs.js.map +1 -1
- package/dist/cli/lib/contract/managed-email.d.ts +57 -0
- package/dist/cli/lib/contract/managed-email.d.ts.map +1 -0
- package/dist/cli/lib/contract/managed-email.js +21 -0
- package/dist/cli/lib/contract/managed-email.js.map +1 -0
- package/dist/cli/lib/contract/projects.d.ts +6 -0
- package/dist/cli/lib/contract/projects.d.ts.map +1 -1
- package/dist/cli/lib/contract/regions.d.ts +11 -0
- package/dist/cli/lib/contract/regions.d.ts.map +1 -0
- package/dist/cli/lib/contract/regions.js +7 -0
- package/dist/cli/lib/contract/regions.js.map +1 -0
- package/dist/cli/lib/contract/runtime-operations.d.ts +0 -1
- package/dist/cli/lib/contract/runtime-operations.d.ts.map +1 -1
- package/dist/cli/lib/contract/source-disconnect-reasons.d.ts +4 -0
- package/dist/cli/lib/contract/source-disconnect-reasons.d.ts.map +1 -0
- package/dist/cli/lib/contract/source-disconnect-reasons.js +31 -0
- package/dist/cli/lib/contract/source-disconnect-reasons.js.map +1 -0
- package/dist/cli/lib/contract/source-repository.d.ts +1 -1
- package/dist/cli/lib/contract/source-repository.d.ts.map +1 -1
- package/dist/cli/lib/contract/source-repository.js +1 -0
- package/dist/cli/lib/contract/source-repository.js.map +1 -1
- package/dist/cli/lib/errors.d.ts +30 -0
- package/dist/cli/lib/errors.d.ts.map +1 -1
- package/dist/cli/lib/errors.js +46 -0
- package/dist/cli/lib/errors.js.map +1 -1
- package/dist/cli/lib/platform-address.d.ts +3 -0
- package/dist/cli/lib/platform-address.d.ts.map +1 -0
- package/dist/cli/lib/platform-address.js +7 -0
- package/dist/cli/lib/platform-address.js.map +1 -0
- package/dist/cli/lib/resolve.d.ts +1 -0
- package/dist/cli/lib/resolve.d.ts.map +1 -1
- package/dist/cli/lib/resolve.js +26 -3
- package/dist/cli/lib/resolve.js.map +1 -1
- package/dist/cli/lib/terminal-output.d.ts +8 -0
- package/dist/cli/lib/terminal-output.d.ts.map +1 -0
- package/dist/cli/lib/terminal-output.js +52 -0
- package/dist/cli/lib/terminal-output.js.map +1 -0
- package/dist/dev/dashboard-vite-config.d.ts +1 -0
- package/dist/dev/dashboard-vite-config.d.ts.map +1 -1
- package/dist/dev/dashboard-vite-config.js +26 -3
- package/dist/dev/dashboard-vite-config.js.map +1 -1
- package/dist/dev/dev-command.d.ts.map +1 -1
- package/dist/dev/dev-command.js +21 -1
- package/dist/dev/dev-command.js.map +1 -1
- package/dist/dev/dev-migrate.js +2 -0
- package/dist/dev/dev-migrate.js.map +1 -1
- package/dist/dev/dev-server.js +3 -0
- package/dist/dev/dev-server.js.map +1 -1
- package/dist/dev/dev-worker.js +2 -1
- package/dist/dev/dev-worker.js.map +1 -1
- package/dist/local-core.d.ts +2 -0
- package/dist/local-core.d.ts.map +1 -0
- package/dist/local-core.js +15 -0
- package/dist/local-core.js.map +1 -0
- package/dist/local-durable-execution-plugin.d.ts +3 -0
- package/dist/local-durable-execution-plugin.d.ts.map +1 -0
- package/dist/local-durable-execution-plugin.js +33 -0
- package/dist/local-durable-execution-plugin.js.map +1 -0
- package/dist/local-runtime.d.ts.map +1 -1
- package/dist/local-runtime.js +7 -0
- package/dist/local-runtime.js.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../../../src/cli/commands/project-config/config/email/events.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EASnB,MAAM,sBAAsB,CAAC;AAgB9B,wBAAsB,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBxE;AAED,wBAAsB,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CA4BvE"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as prompts from "@clack/prompts";
|
|
2
|
+
import { createAuthenticatedClient, formatTable, output, resolveEnvironment, writeJson, } from "../../../../index.js";
|
|
3
|
+
// One phrase per normalized event type. The wire vocabulary is a machine's, and reading
|
|
4
|
+
// "soft_bounce" in a table is reading a field name rather than what happened.
|
|
5
|
+
const EVENT_DESCRIPTIONS = {
|
|
6
|
+
accepted: "Accepted for delivery",
|
|
7
|
+
delivered: "Delivered",
|
|
8
|
+
soft_bounce: "Temporary delivery failure",
|
|
9
|
+
hard_bounce: "Permanent delivery failure",
|
|
10
|
+
complaint: "Reported as spam",
|
|
11
|
+
suppressed: "Recipient suppressed",
|
|
12
|
+
rejected: "Rejected before sending",
|
|
13
|
+
paused: "Sending paused",
|
|
14
|
+
resumed: "Sending resumed",
|
|
15
|
+
};
|
|
16
|
+
export async function eventsAction(options) {
|
|
17
|
+
const { environment } = await resolveEnvironment(options);
|
|
18
|
+
const response = await createAuthenticatedClient(options).get(`/environments/${environment.id}/managed-email/events`);
|
|
19
|
+
if (options.json === true) {
|
|
20
|
+
writeJson(response);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (response.events.length === 0) {
|
|
24
|
+
output.info(`No managed email events recorded for ${environment.slug}.`);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
prompts.note(formatTable(["When", "What happened", "Recipient", "Detail"], response.events.map((event) => [
|
|
28
|
+
event.occurredAt,
|
|
29
|
+
EVENT_DESCRIPTIONS[event.type],
|
|
30
|
+
event.recipient ?? "—",
|
|
31
|
+
event.reason ?? "—",
|
|
32
|
+
])), `Managed email events · ${environment.slug}`);
|
|
33
|
+
}
|
|
34
|
+
export async function usageAction(options) {
|
|
35
|
+
const { environment } = await resolveEnvironment(options);
|
|
36
|
+
const response = await createAuthenticatedClient(options).get(`/environments/${environment.id}/managed-email/usage`);
|
|
37
|
+
if (options.json === true) {
|
|
38
|
+
writeJson(response);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
prompts.note(formatTable(["Measure", "Value"], [
|
|
42
|
+
["Period start", response.periodStart],
|
|
43
|
+
["Period end", response.periodEnd],
|
|
44
|
+
[`Accepted · ${environment.slug}`, String(response.environmentAccepted)],
|
|
45
|
+
["Accepted · organization", String(response.organizationAccepted)],
|
|
46
|
+
[
|
|
47
|
+
"Platform safety ceiling",
|
|
48
|
+
response.safetyCeiling === null ? "not published yet" : String(response.safetyCeiling),
|
|
49
|
+
],
|
|
50
|
+
]), "Managed email usage");
|
|
51
|
+
// Usage counts submissions the platform accepted. Saying so here stops a zero being read as a
|
|
52
|
+
// delivery problem while the managed transport is still to arrive.
|
|
53
|
+
output.info("Usage counts accepted submissions, including ones that later bounce.");
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../../../../src/cli/commands/project-config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-config/config/email/index.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,iBAAiB,2DA6F5B,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { defineCloudCommand, defineCloudCommandGroup } from "../../../../command.js";
|
|
2
|
+
// `vcloud config email …` — managed transactional email, as far as it goes today.
|
|
3
|
+
//
|
|
4
|
+
// A customer can prepare a sending domain and confirm they control it, configure and read a
|
|
5
|
+
// non-production environment's containment, and read the normalized events and the usage those
|
|
6
|
+
// events measure. They cannot send: that needs the managed transport (CLO-401), so every domain
|
|
7
|
+
// reports itself unable to send and says which half is missing.
|
|
8
|
+
//
|
|
9
|
+
// Sending domains belong to the organization, so those three commands take no `--environment`. They
|
|
10
|
+
// sit under `config` because that is where the configuration families live.
|
|
11
|
+
//
|
|
12
|
+
// Declaration only: every `run` loads its implementation through `await import(...)`, for the reason
|
|
13
|
+
// stated in the parent family's own `index.ts`.
|
|
14
|
+
export const emailCommandGroup = defineCloudCommandGroup({
|
|
15
|
+
name: "email",
|
|
16
|
+
description: "Manage managed email",
|
|
17
|
+
subcommands: [
|
|
18
|
+
defineCloudCommandGroup({
|
|
19
|
+
name: "domain",
|
|
20
|
+
description: "Manage sending domains",
|
|
21
|
+
subcommands: [
|
|
22
|
+
defineCloudCommand({
|
|
23
|
+
name: "list",
|
|
24
|
+
description: "List sending domains and the record each one needs",
|
|
25
|
+
run: async ({ globals }) => {
|
|
26
|
+
const { domainListAction } = await import("./domain.js");
|
|
27
|
+
await domainListAction(globals);
|
|
28
|
+
},
|
|
29
|
+
}),
|
|
30
|
+
defineCloudCommand({
|
|
31
|
+
name: "prepare",
|
|
32
|
+
description: "Prepare a sending domain and issue its ownership record",
|
|
33
|
+
arguments: [{ name: "domain", description: "Sending domain to prepare", required: true }],
|
|
34
|
+
run: async ({ args, globals }) => {
|
|
35
|
+
const [{ domainPrepareAction }, { requiredArgument }] = await Promise.all([
|
|
36
|
+
import("./domain.js"),
|
|
37
|
+
import("../../../../arguments.js"),
|
|
38
|
+
]);
|
|
39
|
+
await domainPrepareAction(requiredArgument(args, 0, "domain"), globals);
|
|
40
|
+
},
|
|
41
|
+
}),
|
|
42
|
+
defineCloudCommand({
|
|
43
|
+
name: "verify",
|
|
44
|
+
description: "Check the published ownership record for a sending domain",
|
|
45
|
+
arguments: [{ name: "domain", description: "Prepared domain", required: true }],
|
|
46
|
+
run: async ({ args, globals }) => {
|
|
47
|
+
const [{ domainVerifyAction }, { requiredArgument }] = await Promise.all([
|
|
48
|
+
import("./domain.js"),
|
|
49
|
+
import("../../../../arguments.js"),
|
|
50
|
+
]);
|
|
51
|
+
await domainVerifyAction(requiredArgument(args, 0, "domain"), globals);
|
|
52
|
+
},
|
|
53
|
+
}),
|
|
54
|
+
],
|
|
55
|
+
}),
|
|
56
|
+
defineCloudCommandGroup({
|
|
57
|
+
name: "test",
|
|
58
|
+
description: "Manage non-production test sending",
|
|
59
|
+
subcommands: [
|
|
60
|
+
defineCloudCommand({
|
|
61
|
+
name: "show",
|
|
62
|
+
description: "Show the recipient allowlist and daily send cap",
|
|
63
|
+
run: async ({ globals }) => {
|
|
64
|
+
const { testSendingShowAction } = await import("./test-sending.js");
|
|
65
|
+
await testSendingShowAction(globals);
|
|
66
|
+
},
|
|
67
|
+
}),
|
|
68
|
+
defineCloudCommand({
|
|
69
|
+
name: "set",
|
|
70
|
+
description: "Set the recipient allowlist, the daily send cap, or both",
|
|
71
|
+
options: [
|
|
72
|
+
{
|
|
73
|
+
long: "--allow <addresses>",
|
|
74
|
+
description: "Comma-separated recipient addresses, or none to allow nobody",
|
|
75
|
+
required: true,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
long: "--cap <count>",
|
|
79
|
+
description: "Messages this environment may send in a day",
|
|
80
|
+
required: true,
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
run: async ({ options, globals }) => {
|
|
84
|
+
const { testSendingSetAction } = await import("./test-sending.js");
|
|
85
|
+
await testSendingSetAction(globals, options);
|
|
86
|
+
},
|
|
87
|
+
}),
|
|
88
|
+
],
|
|
89
|
+
}),
|
|
90
|
+
defineCloudCommand({
|
|
91
|
+
name: "events",
|
|
92
|
+
description: "Show recent delivery, bounce, complaint, suppression and pause events",
|
|
93
|
+
run: async ({ globals }) => {
|
|
94
|
+
const { eventsAction } = await import("./events.js");
|
|
95
|
+
await eventsAction(globals);
|
|
96
|
+
},
|
|
97
|
+
}),
|
|
98
|
+
defineCloudCommand({
|
|
99
|
+
name: "usage",
|
|
100
|
+
description: "Show accepted email submissions for this month",
|
|
101
|
+
run: async ({ globals }) => {
|
|
102
|
+
const { usageAction } = await import("./events.js");
|
|
103
|
+
await usageAction(globals);
|
|
104
|
+
},
|
|
105
|
+
}),
|
|
106
|
+
],
|
|
107
|
+
});
|
|
108
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/cli/commands/project-config/config/email/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAErF,kFAAkF;AAClF,EAAE;AACF,4FAA4F;AAC5F,+FAA+F;AAC/F,gGAAgG;AAChG,gEAAgE;AAChE,EAAE;AACF,oGAAoG;AACpG,4EAA4E;AAC5E,EAAE;AACF,qGAAqG;AACrG,gDAAgD;AAChD,MAAM,CAAC,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;IACvD,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE;QACX,uBAAuB,CAAC;YACtB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,wBAAwB;YACrC,WAAW,EAAE;gBACX,kBAAkB,CAAC;oBACjB,IAAI,EAAE,MAAM;oBACZ,WAAW,EAAE,oDAAoD;oBACjE,GAAG,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;wBACzB,MAAM,EAAE,gBAAgB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AAC;SACF,CAAC;QACF,kBAAkB,CAAC;YACjB,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,gDAAgD;YAC7D,GAAG,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;gBACzB,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC;gBACpD,MAAM,WAAW,CAAC,OAAO,CAAC,CAAC;YAC7B,CAAC;SACF,CAAC;KACH;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type GlobalOptions } from "../../../../index.js";
|
|
2
|
+
export declare function testSendingShowAction(options: GlobalOptions): Promise<void>;
|
|
3
|
+
export declare function testSendingSetAction(options: GlobalOptions, commandOptions: Record<string, unknown>): Promise<void>;
|
|
4
|
+
//# sourceMappingURL=test-sending.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-sending.d.ts","sourceRoot":"","sources":["../../../../../../src/cli/commands/project-config/config/email/test-sending.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EASnB,MAAM,sBAAsB,CAAC;AAM9B,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAUjF;AAED,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,aAAa,EACtB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACtC,OAAO,CAAC,IAAI,CAAC,CAaf"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as prompts from "@clack/prompts";
|
|
2
|
+
import { createAuthenticatedClient, formatTable, output, readSingleValue, resolveEnvironment, writeJson, } from "../../../../index.js";
|
|
3
|
+
// The word a customer types to allow nobody. An empty `--allow ""` is indistinguishable from a flag
|
|
4
|
+
// whose value a shell ate, so clearing the allowlist is spelled rather than left to an empty string.
|
|
5
|
+
const ALLOW_NONE = "none";
|
|
6
|
+
export async function testSendingShowAction(options) {
|
|
7
|
+
const { environment } = await resolveEnvironment(options);
|
|
8
|
+
const response = await createAuthenticatedClient(options).get(`/environments/${environment.id}/managed-email/test-sending`);
|
|
9
|
+
if (options.json === true) {
|
|
10
|
+
writeJson(response);
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
render(response);
|
|
14
|
+
}
|
|
15
|
+
export async function testSendingSetAction(options, commandOptions) {
|
|
16
|
+
const request = readRequest(commandOptions);
|
|
17
|
+
const { environment } = await resolveEnvironment(options);
|
|
18
|
+
const response = await createAuthenticatedClient(options).put(`/environments/${environment.id}/managed-email/test-sending`, request);
|
|
19
|
+
if (options.json === true) {
|
|
20
|
+
writeJson(response);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
output.success("Test sending updated.");
|
|
24
|
+
render(response);
|
|
25
|
+
}
|
|
26
|
+
function readRequest(commandOptions) {
|
|
27
|
+
const allow = readSingleValue(commandOptions.allow, "--allow");
|
|
28
|
+
const cap = readSingleValue(commandOptions.cap, "--cap");
|
|
29
|
+
if (allow === undefined && cap === undefined) {
|
|
30
|
+
throw new Error("Give --allow, --cap, or both.");
|
|
31
|
+
}
|
|
32
|
+
const request = {};
|
|
33
|
+
if (allow !== undefined)
|
|
34
|
+
request.recipientAllowlist = readAllowlist(allow);
|
|
35
|
+
if (cap !== undefined)
|
|
36
|
+
request.dailySendCap = readCap(cap);
|
|
37
|
+
return request;
|
|
38
|
+
}
|
|
39
|
+
function readAllowlist(value) {
|
|
40
|
+
if (value.trim().toLowerCase() === ALLOW_NONE)
|
|
41
|
+
return [];
|
|
42
|
+
return value
|
|
43
|
+
.split(",")
|
|
44
|
+
.map((entry) => entry.trim())
|
|
45
|
+
.filter((entry) => entry !== "");
|
|
46
|
+
}
|
|
47
|
+
function readCap(value) {
|
|
48
|
+
const cap = Number(value);
|
|
49
|
+
if (!Number.isInteger(cap) || cap < 0) {
|
|
50
|
+
throw new Error(`--cap must be a whole number of messages, not "${value}".`);
|
|
51
|
+
}
|
|
52
|
+
return cap;
|
|
53
|
+
}
|
|
54
|
+
function render(response) {
|
|
55
|
+
if (!response.configurable) {
|
|
56
|
+
output.info("This is a production environment. It sends from a verified sending domain, so it has no test recipient allowlist or send cap.");
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
prompts.note(formatTable(["Setting", "Value"], [
|
|
60
|
+
["Recipient allowlist", response.recipientAllowlist.join(", ") || "nobody"],
|
|
61
|
+
["Daily send cap", String(response.dailySendCap)],
|
|
62
|
+
["Accepted today", String(response.acceptedToday)],
|
|
63
|
+
]), "Test sending");
|
|
64
|
+
if (response.recipientAllowlist.length === 0) {
|
|
65
|
+
output.info("Nothing is delivered while the allowlist is empty. Add addresses with `config email test set --allow`.");
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=test-sending.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-sending.js","sourceRoot":"","sources":["../../../../../../src/cli/commands/project-config/config/email/test-sending.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAIL,yBAAyB,EACzB,WAAW,EACX,MAAM,EACN,eAAe,EACf,kBAAkB,EAClB,SAAS,GACV,MAAM,sBAAsB,CAAC;AAE9B,oGAAoG;AACpG,qGAAqG;AACrG,MAAM,UAAU,GAAG,MAAM,CAAC;AAE1B,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,OAAsB;IAChE,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAG,MAAM,yBAAyB,CAAC,OAAO,CAAC,CAAC,GAAG,CAC3D,iBAAiB,WAAW,CAAC,EAAE,6BAA6B,CAC7D,CAAC;IACF,IAAI,OAAO,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;QAC1B,SAAS,CAAC,QAAQ,CAAC,CAAC;QACpB,OAAO;IAC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1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/project-config/config/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/project-config/config/index.ts"],"names":[],"mappings":"AAwBA,eAAO,MAAM,kBAAkB,wDA+J7B,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineCloudCommand, defineCloudCommandGroup } from "../../../command.js";
|
|
2
2
|
import { formatAlternatives } from "../options.js";
|
|
3
3
|
import { BUILD_FIELDS } from "./build-fields.js";
|
|
4
|
+
import { emailCommandGroup } from "./email/index.js";
|
|
4
5
|
// `vcloud config …` — a VC Environment's Desired State and its Source Build Settings overrides.
|
|
5
6
|
//
|
|
6
7
|
// Declaration only: every `run` loads its implementation through `await import(...)`, so the
|
|
@@ -9,10 +10,13 @@ import { BUILD_FIELDS } from "./build-fields.js";
|
|
|
9
10
|
//
|
|
10
11
|
// `config set` explains rather than does: VC Environment type and region are fixed at creation. Its
|
|
11
12
|
// two options stay declared so the explanation comes from the command rather than from the host
|
|
12
|
-
// refusing an option it does not recognise.
|
|
13
|
+
// refusing an option it does not recognise. `config worker set` and `--replicas` on the server
|
|
14
|
+
// follow the same shape since CLO-572 took replica counts over.
|
|
15
|
+
// Declared so the removal is answered by a sentence rather than by the host refusing an unknown
|
|
16
|
+
// option. `runtime.ts` says why that difference is worth a declaration (CLO-572).
|
|
13
17
|
const REPLICAS_OPTION = {
|
|
14
18
|
long: "--replicas <count>",
|
|
15
|
-
description: "
|
|
19
|
+
description: "Removed: Vendure Cloud scales the server and the worker automatically",
|
|
16
20
|
required: true,
|
|
17
21
|
};
|
|
18
22
|
export const configCommandGroup = defineCloudCommandGroup({
|
|
@@ -61,7 +65,7 @@ export const configCommandGroup = defineCloudCommandGroup({
|
|
|
61
65
|
],
|
|
62
66
|
run: async ({ options, globals }) => {
|
|
63
67
|
const { runtimeSetAction } = await import("./runtime.js");
|
|
64
|
-
await runtimeSetAction(
|
|
68
|
+
await runtimeSetAction(globals, options);
|
|
65
69
|
},
|
|
66
70
|
}),
|
|
67
71
|
],
|
|
@@ -72,11 +76,11 @@ export const configCommandGroup = defineCloudCommandGroup({
|
|
|
72
76
|
subcommands: [
|
|
73
77
|
defineCloudCommand({
|
|
74
78
|
name: "set",
|
|
75
|
-
description: "
|
|
79
|
+
description: "Explain that the worker scales automatically",
|
|
76
80
|
options: [REPLICAS_OPTION],
|
|
77
|
-
run: async ({ options
|
|
78
|
-
const {
|
|
79
|
-
|
|
81
|
+
run: async ({ options }) => {
|
|
82
|
+
const { workerSetAction } = await import("./runtime.js");
|
|
83
|
+
workerSetAction(options);
|
|
80
84
|
},
|
|
81
85
|
}),
|
|
82
86
|
],
|
|
@@ -113,6 +117,7 @@ export const configCommandGroup = defineCloudCommandGroup({
|
|
|
113
117
|
}),
|
|
114
118
|
],
|
|
115
119
|
}),
|
|
120
|
+
emailCommandGroup,
|
|
116
121
|
defineCloudCommandGroup({
|
|
117
122
|
name: "build",
|
|
118
123
|
description: "Manage Source Build Settings overrides",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/cli/commands/project-config/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/cli/commands/project-config/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAA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etAction(
|
|
2
|
+
export declare function runtimeSetAction(options: GlobalOptions, commandOptions: Record<string, unknown>): Promise<void>;
|
|
3
|
+
export declare function workerSetAction(commandOptions: Record<string, unknown>): void;
|
|
3
4
|
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/project-config/config/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/project-config/config/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AA8BvD,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,aAAa,EACtB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACtC,OAAO,CAAC,IAAI,CAAC,CAoBf;AAID,wBAAgB,eAAe,CAAC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAK7E"}
|
|
@@ -1,38 +1,52 @@
|
|
|
1
1
|
import { assertNotEmpty, definedEntries, readInteger, readString } from "../options.js";
|
|
2
2
|
import { updateDesiredState } from "./desired-state.js";
|
|
3
|
-
//
|
|
3
|
+
// What a customer may still say about a runtime service. `--replicas` is not it, and neither is
|
|
4
|
+
// anything on the worker at all.
|
|
4
5
|
//
|
|
5
|
-
//
|
|
6
|
-
// the
|
|
7
|
-
//
|
|
6
|
+
// **The count went to platform-owned autoscaling (CLO-572).** Vendure Cloud scales the server on
|
|
7
|
+
// its CPU and the worker on its queue backlog, between bounds the platform sets from the VC
|
|
8
|
+
// Environment's capacity class. A fixed count is no longer read anywhere, so accepting one and
|
|
9
|
+
// applying nothing would be the worst of the three options.
|
|
8
10
|
//
|
|
9
|
-
// The
|
|
10
|
-
//
|
|
11
|
-
|
|
11
|
+
// The option therefore stays declared and is refused with a sentence, which is the shape
|
|
12
|
+
// `config set` already uses for type and region. Removing the flag instead would leave the host to
|
|
13
|
+
// answer "unknown option --replicas", which tells a customer their CLI is wrong rather than that
|
|
14
|
+
// the platform now does this for them — and a script that has been setting replicas for months
|
|
15
|
+
// deserves the second answer.
|
|
16
|
+
const REPLICAS_REMOVED_MESSAGE = "Replica counts are not configurable. Vendure Cloud scales the server and the worker automatically within platform limits. Contact support if you need a higher limit.";
|
|
17
|
+
// The worker had no other option, so the whole command is an explanation now.
|
|
18
|
+
const WORKER_REMOVED_MESSAGE = "The worker has nothing to configure. Vendure Cloud sizes and scales it automatically, and the port and health check path belong to the server alone.";
|
|
19
|
+
// `config server set`.
|
|
20
|
+
//
|
|
21
|
+
// `--plan` went with the VC Plan catalog (ADR-0036) and is not declared, so the host refuses it as
|
|
22
|
+
// an unknown option. `--replicas` is declared and refused here, because the two removals are not
|
|
23
|
+
// alike: nobody scripts a compute plan they picked once, and plenty of pipelines scale replicas
|
|
24
|
+
// before a sale.
|
|
25
|
+
export async function runtimeSetAction(options, commandOptions) {
|
|
26
|
+
// Ahead of the empty check below, so `--replicas 3` on its own is answered with the explanation
|
|
27
|
+
// rather than with "specify at least one option" — it did specify one.
|
|
28
|
+
if (readInteger(commandOptions.replicas, "--replicas") !== undefined) {
|
|
29
|
+
throw new Error(REPLICAS_REMOVED_MESSAGE);
|
|
30
|
+
}
|
|
12
31
|
const values = definedEntries({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
? {
|
|
16
|
-
port: readInteger(commandOptions.port, "--port"),
|
|
17
|
-
healthCheckPath: readString(commandOptions.healthCheckPath),
|
|
18
|
-
}
|
|
19
|
-
: {}),
|
|
32
|
+
port: readInteger(commandOptions.port, "--port"),
|
|
33
|
+
healthCheckPath: readString(commandOptions.healthCheckPath),
|
|
20
34
|
});
|
|
21
35
|
assertNotEmpty(values, "Specify at least one configuration option.");
|
|
22
|
-
await updateDesiredState(options,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
runtime
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
await updateDesiredState(options, "server", (current) => ({
|
|
37
|
+
...current,
|
|
38
|
+
runtime: {
|
|
39
|
+
...current.runtime,
|
|
40
|
+
server: { ...current.runtime.server, ...values },
|
|
41
|
+
},
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
// `config worker set`. Declared so that a script still calling it is told what happened, rather
|
|
45
|
+
// than being told the command does not exist.
|
|
46
|
+
export function workerSetAction(commandOptions) {
|
|
47
|
+
if (readInteger(commandOptions.replicas, "--replicas") !== undefined) {
|
|
48
|
+
throw new Error(REPLICAS_REMOVED_MESSAGE);
|
|
49
|
+
}
|
|
50
|
+
throw new Error(WORKER_REMOVED_MESSAGE);
|
|
37
51
|
}
|
|
38
52
|
//# sourceMappingURL=runtime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../../../../src/cli/commands/project-config/config/runtime.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,+
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../../../../src/cli/commands/project-config/config/runtime.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,gGAAgG;AAChG,iCAAiC;AACjC,EAAE;AACF,iGAAiG;AACjG,4FAA4F;AAC5F,+FAA+F;AAC/F,4D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5C,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/project-config/env/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/project-config/env/index.ts"],"names":[],"mappings":"AA6BA,eAAO,MAAM,eAAe,wDAiF1B,CAAC"}
|
|
@@ -15,8 +15,14 @@ const METADATA_OPTIONS = [
|
|
|
15
15
|
description: `Delivery scope: ${formatAlternatives(SCOPES, false)}`,
|
|
16
16
|
required: true,
|
|
17
17
|
},
|
|
18
|
-
{
|
|
19
|
-
|
|
18
|
+
{
|
|
19
|
+
long: "--sensitive",
|
|
20
|
+
description: "Treat as a credential: secret build delivery, and masked in runtime logs",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
long: "--non-sensitive",
|
|
24
|
+
description: "Clear the credential marking (the default for a new variable)",
|
|
25
|
+
},
|
|
20
26
|
];
|
|
21
27
|
export const envCommandGroup = defineCloudCommandGroup({
|
|
22
28
|
name: "env",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/cli/commands/project-config/env/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAClF,kFAAkF;AAClF,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,+DAA+D;AAC/D,EAAE;AACF,6FAA6F;AAC7F,mHAAmH;AACnH,sCAAsC;AACtC,EAAE;AACF,oGAAoG;AAEpG,MAAM,gBAAgB,GAAG;IACvB;QACE,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,mBAAmB,kBAAkB,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;QACnE,QAAQ,EAAE,IAAI;KACf;IACD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/cli/commands/project-config/env/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAClF,kFAAkF;AAClF,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,+DAA+D;AAC/D,EAAE;AACF,6FAA6F;AAC7F,mHAAmH;AACnH,sCAAsC;AACtC,EAAE;AACF,oGAAoG;AAEpG,MAAM,gBAAgB,GAAG;IACvB;QACE,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,mBAAmB,kBAAkB,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;QACnE,QAAQ,EAAE,IAAI;KACf;IACD;QACE,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,0EAA0E;KACxF;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,+DAA+D;KAC7E;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,uBAAuB,CAAC;IACrD,IAAI,EAAE,KAAK;IACX,WAAW,EAAE,iCAAiC;IAC9C,WAAW,EAAE;QACX,kBAAkB,CAAC;YACjB,IAAI,EAAE,KAAK;YACX,WAAW,EAAE,gCAAgC;YAC7C,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YAC1E,OAAO,EAAE,gBAAgB;YACzB,GAAG,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE;gBACxC,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,MAAM,CAAC,UAAU,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YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC3C,CAAC;SACF,CAAC;QACF,kBAAkB,CAAC;YACjB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,yCAAyC;YACtD,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YAC1E,OAAO,EAAE,gBAAgB;YACzB,GAAG,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE;gBACxC,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC;gBACxD,MAAM,eAAe,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAChD,CAAC;SACF,CAAC;KACH;CACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/project-config/environment/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/project-config/environment/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,uBAAuB,wDAwElC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineCloudCommand, defineCloudCommandGroup } from "../../../command.js";
|
|
2
2
|
import { readFlag } from "../options.js";
|
|
3
|
-
// `vcloud environment …` — the VC Environments of the selected VC Project
|
|
3
|
+
// `vcloud environment …` — the VC Environments of the selected VC Project, and the regions one can
|
|
4
|
+
// be created in.
|
|
4
5
|
//
|
|
5
6
|
// Declaration only: every `run` loads its implementation through `await import(...)`, so the
|
|
6
7
|
// host's `require` of this plugin on each `vendure` invocation costs nothing.
|
|
@@ -8,6 +9,11 @@ import { readFlag } from "../options.js";
|
|
|
8
9
|
// `--type` and `--region` on `create` are mandatory and
|
|
9
10
|
// validated against the Desired State schemas, both of which `create` enforces itself: the host has
|
|
10
11
|
// no equivalent of commander's `.requiredOption()` and no coercion hook.
|
|
12
|
+
//
|
|
13
|
+
// `regions` is where the value for `--region` comes from. It is neither project- nor
|
|
14
|
+
// environment-scoped, and sits here because it is what `create` sends. The schema refuses a region
|
|
15
|
+
// Vendure Cloud does not support; where each one runs and whether it is taking new VC Environments
|
|
16
|
+
// are the control plane's to answer.
|
|
11
17
|
export const environmentCommandGroup = defineCloudCommandGroup({
|
|
12
18
|
name: "environment",
|
|
13
19
|
description: "Manage VC Environments",
|
|
@@ -61,6 +67,14 @@ export const environmentCommandGroup = defineCloudCommandGroup({
|
|
|
61
67
|
await environmentUpdateAction(args, globals, options);
|
|
62
68
|
},
|
|
63
69
|
}),
|
|
70
|
+
defineCloudCommand({
|
|
71
|
+
name: "regions",
|
|
72
|
+
description: "List the regions a VC Environment can be created in",
|
|
73
|
+
run: async ({ globals }) => {
|
|
74
|
+
const { environmentRegionsAction } = await import("./regions.js");
|
|
75
|
+
await environmentRegionsAction(globals);
|
|
76
|
+
},
|
|
77
|
+
}),
|
|
64
78
|
defineCloudCommand({
|
|
65
79
|
name: "delete",
|
|
66
80
|
description: "Delete a safely torn-down VC Environment",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/cli/commands/project-config/environment/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/cli/commands/project-config/environment/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,mGAAmG;AACnG,iBAAiB;AACjB,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,CAAC;YAC1C,CAAC;SACF,CAAC;QACF,kBAAkB,CAAC;YACjB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,0CAA0C;YACvD,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,2BAA2B,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YAC7F,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;YAC9D,GAAG,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE;gBACxC,MAAM,EAAE,uBAAuB,EAAE,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC;gBAChE,MAAM,uBAAuB,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;YACtE,CAAC;SACF,CAAC;KACH;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type CredentialOptions, type GlobalOptions, type SupportedRegionResponse } from "../../../index.js";
|
|
2
|
+
export declare function environmentRegionsAction(options: GlobalOptions): Promise<void>;
|
|
3
|
+
export declare function fetchSupportedRegions(options: CredentialOptions): Promise<SupportedRegionResponse[]>;
|
|
4
|
+
export declare function regionRow(region: SupportedRegionResponse): string[];
|
|
5
|
+
export declare function regionLocationLabel(region: SupportedRegionResponse): string;
|
|
6
|
+
//# sourceMappingURL=regions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regions.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/project-config/environment/regions.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAK7B,MAAM,mBAAmB,CAAC;AAE3B,wBAAsB,wBAAwB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAapF;AAGD,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,uBAAuB,EAAE,CAAC,CAEpC;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,uBAAuB,GAAG,MAAM,EAAE,CAEnE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,uBAAuB,GAAG,MAAM,CAE3E"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as prompts from "@clack/prompts";
|
|
2
|
+
import { createAuthenticatedClient, formatTable, output, writeJson, } from "../../../index.js";
|
|
3
|
+
export async function environmentRegionsAction(options) {
|
|
4
|
+
const regions = await fetchSupportedRegions(options);
|
|
5
|
+
if (options.json === true) {
|
|
6
|
+
writeJson(regions);
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
prompts.note(formatTable(["REGION", "LOCATION", "AVAILABLE"], regions.map(regionRow)), "Vendure Cloud regions");
|
|
10
|
+
output.info("Create a VC Environment in one of them with `environment create --region <region>`. A region shown as unavailable is one Vendure Cloud supports and is not placing new VC Environments in. The region is fixed once the VC Environment exists.");
|
|
11
|
+
}
|
|
12
|
+
// Shared with `init`, which offers the same catalog as a prompt.
|
|
13
|
+
export async function fetchSupportedRegions(options) {
|
|
14
|
+
return createAuthenticatedClient(options).get("/regions");
|
|
15
|
+
}
|
|
16
|
+
export function regionRow(region) {
|
|
17
|
+
return [region.region, regionLocationLabel(region), region.available ? "yes" : "no"];
|
|
18
|
+
}
|
|
19
|
+
export function regionLocationLabel(region) {
|
|
20
|
+
return `${region.location.country}, ${region.location.continent}`;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=regions.js.map
|