@antelopejs/dms-antelope-cloud 0.0.0 → 0.1.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/LICENSE +201 -0
- package/README.md +448 -0
- package/dist/cloud-status.d.ts +13 -0
- package/dist/cloud-status.js +77 -0
- package/dist/config.d.ts +84 -0
- package/dist/config.js +104 -0
- package/dist/configured.d.ts +16 -0
- package/dist/configured.js +26 -0
- package/dist/connection/actions.d.ts +40 -0
- package/dist/connection/actions.js +120 -0
- package/dist/connection/announce.d.ts +8 -0
- package/dist/connection/announce.js +20 -0
- package/dist/connection/cloud.d.ts +60 -0
- package/dist/connection/cloud.js +87 -0
- package/dist/connection/content.d.ts +70 -0
- package/dist/connection/content.js +462 -0
- package/dist/connection/current.d.ts +26 -0
- package/dist/connection/current.js +28 -0
- package/dist/connection/device-flow.d.ts +16 -0
- package/dist/connection/device-flow.js +146 -0
- package/dist/connection/refusals.d.ts +51 -0
- package/dist/connection/refusals.js +85 -0
- package/dist/connection/repository.d.ts +28 -0
- package/dist/connection/repository.js +69 -0
- package/dist/connection/seal.d.ts +22 -0
- package/dist/connection/seal.js +47 -0
- package/dist/connection/store.d.ts +294 -0
- package/dist/connection/store.js +165 -0
- package/dist/connection/view.d.ts +39 -0
- package/dist/connection/view.js +39 -0
- package/dist/dashboard/actions.d.ts +40 -0
- package/dist/dashboard/actions.js +115 -0
- package/dist/dashboard/dockerfile.d.ts +34 -0
- package/dist/dashboard/dockerfile.js +71 -0
- package/dist/dashboard/service.d.ts +61 -0
- package/dist/dashboard/service.js +137 -0
- package/dist/dashboard/variables.d.ts +30 -0
- package/dist/dashboard/variables.js +34 -0
- package/dist/deployments/build-log.d.ts +39 -0
- package/dist/deployments/build-log.js +57 -0
- package/dist/deployments/cloud-steps.d.ts +77 -0
- package/dist/deployments/cloud-steps.js +132 -0
- package/dist/deployments/content.d.ts +61 -0
- package/dist/deployments/content.js +268 -0
- package/dist/deployments/deployment.d.ts +96 -0
- package/dist/deployments/deployment.js +3 -0
- package/dist/deployments/follow.d.ts +18 -0
- package/dist/deployments/follow.js +112 -0
- package/dist/deployments/ledger.d.ts +23 -0
- package/dist/deployments/ledger.js +359 -0
- package/dist/deployments/lifecycle.d.ts +123 -0
- package/dist/deployments/lifecycle.js +146 -0
- package/dist/deployments/live.d.ts +28 -0
- package/dist/deployments/live.js +54 -0
- package/dist/deployments/publish-read.d.ts +20 -0
- package/dist/deployments/publish-read.js +24 -0
- package/dist/deployments/refusals.d.ts +13 -0
- package/dist/deployments/refusals.js +35 -0
- package/dist/environments/actions.d.ts +86 -0
- package/dist/environments/actions.js +210 -0
- package/dist/environments/address.d.ts +60 -0
- package/dist/environments/address.js +149 -0
- package/dist/environments/content.d.ts +97 -0
- package/dist/environments/content.js +275 -0
- package/dist/environments/follower.d.ts +32 -0
- package/dist/environments/follower.js +114 -0
- package/dist/environments/pipeline.d.ts +58 -0
- package/dist/environments/pipeline.js +76 -0
- package/dist/environments/publish-targets.d.ts +18 -0
- package/dist/environments/publish-targets.js +55 -0
- package/dist/environments/roles.d.ts +73 -0
- package/dist/environments/roles.js +97 -0
- package/dist/frontend-module.d.ts +12 -0
- package/dist/frontend-module.js +25 -0
- package/dist/git/changed-files.d.ts +30 -0
- package/dist/git/changed-files.js +107 -0
- package/dist/git/changes.d.ts +89 -0
- package/dist/git/changes.js +162 -0
- package/dist/git/command.d.ts +51 -0
- package/dist/git/command.js +231 -0
- package/dist/git/promotion.d.ts +23 -0
- package/dist/git/promotion.js +46 -0
- package/dist/git/publish-input.d.ts +42 -0
- package/dist/git/publish-input.js +62 -0
- package/dist/git/publish-job.d.ts +82 -0
- package/dist/git/publish-job.js +99 -0
- package/dist/git/publish-steps.d.ts +90 -0
- package/dist/git/publish-steps.js +205 -0
- package/dist/git/publisher.d.ts +23 -0
- package/dist/git/publisher.js +206 -0
- package/dist/git/refs.d.ts +99 -0
- package/dist/git/refs.js +178 -0
- package/dist/git/refusal.d.ts +49 -0
- package/dist/git/refusal.js +70 -0
- package/dist/git/repository.d.ts +101 -0
- package/dist/git/repository.js +273 -0
- package/dist/git/versions.d.ts +99 -0
- package/dist/git/versions.js +174 -0
- package/dist/git/write-lock.d.ts +19 -0
- package/dist/git/write-lock.js +49 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +59 -0
- package/dist/lifecycle.d.ts +8 -0
- package/dist/lifecycle.js +78 -0
- package/dist/logs/relay.d.ts +25 -0
- package/dist/logs/relay.js +138 -0
- package/dist/null-prototype.d.ts +7 -0
- package/dist/null-prototype.js +3 -0
- package/dist/overview/content.d.ts +40 -0
- package/dist/overview/content.js +172 -0
- package/dist/pages/changes.d.ts +32 -0
- package/dist/pages/changes.js +141 -0
- package/dist/pages/connection.d.ts +43 -0
- package/dist/pages/connection.js +295 -0
- package/dist/pages/deployment.d.ts +67 -0
- package/dist/pages/deployment.js +261 -0
- package/dist/pages/deployments.d.ts +46 -0
- package/dist/pages/deployments.js +266 -0
- package/dist/pages/environments.d.ts +34 -0
- package/dist/pages/environments.js +368 -0
- package/dist/pages/logs.d.ts +46 -0
- package/dist/pages/logs.js +140 -0
- package/dist/pages/navigation.d.ts +61 -0
- package/dist/pages/navigation.js +107 -0
- package/dist/pages/overview.d.ts +35 -0
- package/dist/pages/overview.js +201 -0
- package/dist/pages/project-guard.d.ts +32 -0
- package/dist/pages/project-guard.js +99 -0
- package/dist/pages/query.d.ts +6 -0
- package/dist/pages/query.js +14 -0
- package/dist/pages/resources.d.ts +37 -0
- package/dist/pages/resources.js +211 -0
- package/dist/pages/setup.d.ts +40 -0
- package/dist/pages/setup.js +271 -0
- package/dist/pages/slugs.d.ts +15 -0
- package/dist/pages/slugs.js +28 -0
- package/dist/pages/variables.d.ts +43 -0
- package/dist/pages/variables.js +327 -0
- package/dist/pages/version.d.ts +26 -0
- package/dist/pages/version.js +214 -0
- package/dist/pages/versions.d.ts +20 -0
- package/dist/pages/versions.js +115 -0
- package/dist/resources/apply.d.ts +15 -0
- package/dist/resources/apply.js +127 -0
- package/dist/resources/cards.d.ts +41 -0
- package/dist/resources/cards.js +211 -0
- package/dist/resources/connect.d.ts +66 -0
- package/dist/resources/connect.js +78 -0
- package/dist/resources/content.d.ts +26 -0
- package/dist/resources/content.js +158 -0
- package/dist/resources/format.d.ts +10 -0
- package/dist/resources/format.js +30 -0
- package/dist/resources/guard.d.ts +23 -0
- package/dist/resources/guard.js +60 -0
- package/dist/resources/modules.d.ts +23 -0
- package/dist/resources/modules.js +39 -0
- package/dist/resources/plan.d.ts +8 -0
- package/dist/resources/plan.js +93 -0
- package/dist/resources/read.d.ts +54 -0
- package/dist/resources/read.js +69 -0
- package/dist/resources/refusals.d.ts +15 -0
- package/dist/resources/refusals.js +33 -0
- package/dist/resources/routes.d.ts +32 -0
- package/dist/resources/routes.js +53 -0
- package/dist/setup/actions.d.ts +79 -0
- package/dist/setup/actions.js +188 -0
- package/dist/setup/apply.d.ts +37 -0
- package/dist/setup/apply.js +172 -0
- package/dist/setup/content.d.ts +50 -0
- package/dist/setup/content.js +440 -0
- package/dist/setup/rollout.d.ts +119 -0
- package/dist/setup/rollout.js +227 -0
- package/dist/setup/steps.d.ts +93 -0
- package/dist/setup/steps.js +95 -0
- package/dist/setup/storage.d.ts +29 -0
- package/dist/setup/storage.js +78 -0
- package/dist/setup/store.d.ts +214 -0
- package/dist/setup/store.js +174 -0
- package/dist/setup/volume.d.ts +31 -0
- package/dist/setup/volume.js +52 -0
- package/dist/slug.d.ts +7 -0
- package/dist/slug.js +26 -0
- package/dist/variables/actions.d.ts +76 -0
- package/dist/variables/actions.js +185 -0
- package/dist/variables/content.d.ts +69 -0
- package/dist/variables/content.js +310 -0
- package/dist/variables/decide.d.ts +27 -0
- package/dist/variables/decide.js +155 -0
- package/dist/variables/decided-dialog.d.ts +11 -0
- package/dist/variables/decided-dialog.js +129 -0
- package/dist/variables/decided.d.ts +80 -0
- package/dist/variables/decided.js +240 -0
- package/dist/variables/dialogs.d.ts +8 -0
- package/dist/variables/dialogs.js +219 -0
- package/dist/variables/model.d.ts +106 -0
- package/dist/variables/model.js +156 -0
- package/dist/variables/project-config.d.ts +117 -0
- package/dist/variables/project-config.js +248 -0
- package/dist/variables/read.d.ts +33 -0
- package/dist/variables/read.js +118 -0
- package/dist/web-url.d.ts +9 -0
- package/dist/web-url.js +19 -0
- package/frontend-vue/app/components/BuildLog.vue +99 -0
- package/frontend-vue/app/components/ChangedFiles.vue +165 -0
- package/frontend-vue/app/components/DashboardEnvironments.vue +102 -0
- package/frontend-vue/app/components/LogLine.vue +33 -0
- package/frontend-vue/app/components/LogViewer.vue +314 -0
- package/frontend-vue/app/components/PublishChipIcon.vue +39 -0
- package/frontend-vue/app/components/PublishForm.vue +505 -0
- package/frontend-vue/app/components/PublishPopover.vue +90 -0
- package/frontend-vue/app/components/PublishRoute.vue +222 -0
- package/frontend-vue/app/composables/usePublishSummary.ts +80 -0
- package/frontend-vue/app/plugins/publish-chip.client.ts +44 -0
- package/frontend-vue/app/types/publishing.ts +154 -0
- package/frontend-vue/app/utils/build-log.ts +96 -0
- package/frontend-vue/app/utils/changed-files.ts +142 -0
- package/frontend-vue/app/utils/log-line.ts +15 -0
- package/frontend-vue/app/utils/log-stream.ts +361 -0
- package/frontend-vue/app/utils/publish-state.ts +299 -0
- package/frontend-vue/dms.frontend.ts +27 -0
- package/frontend-vue/i18n/locales/antelope-cloud-en-GB.json +110 -0
- package/frontend-vue/package.json +38 -0
- package/frontend-vue/pnpm-lock.yaml +2697 -0
- package/package.json +115 -4
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.unknownEnvironmentTexts = unknownEnvironmentTexts;
|
|
4
|
+
exports.resourcesBanner = resourcesBanner;
|
|
5
|
+
exports.publishNote = publishNote;
|
|
6
|
+
exports.environmentItems = environmentItems;
|
|
7
|
+
const format_1 = require("./format");
|
|
8
|
+
const routes_1 = require("./routes");
|
|
9
|
+
function reviewPlan(environment) {
|
|
10
|
+
return {
|
|
11
|
+
label: "Review plan",
|
|
12
|
+
icon: "i-ph-cube",
|
|
13
|
+
target: {
|
|
14
|
+
type: "api",
|
|
15
|
+
url: (0, routes_1.environmentRoute)(routes_1.RESOURCES_ROUTES.apply, environment),
|
|
16
|
+
method: "POST",
|
|
17
|
+
successMessage: "Resources created",
|
|
18
|
+
},
|
|
19
|
+
confirm: {
|
|
20
|
+
from: (0, routes_1.environmentRoute)(routes_1.RESOURCES_ROUTES.planDialog, environment),
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/** What the page says of an environment the project does not list. */
|
|
25
|
+
function unknownEnvironmentTexts(requested) {
|
|
26
|
+
return {
|
|
27
|
+
title: `No environment named ${requested}`,
|
|
28
|
+
description: "The project lists no such environment. Choose one of its environments below.",
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function unique(values) {
|
|
32
|
+
return [...new Set(values)];
|
|
33
|
+
}
|
|
34
|
+
function connectBanner(environment, missing) {
|
|
35
|
+
const databases = unique(missing.map(({ database }) => database.label));
|
|
36
|
+
const variables = unique(missing.map(({ variable }) => variable));
|
|
37
|
+
const one = variables.length === 1;
|
|
38
|
+
return {
|
|
39
|
+
tone: "info",
|
|
40
|
+
icon: "i-ph-plugs",
|
|
41
|
+
title: `${databases.join(", ")} on ${environment} ${databases.length === 1 ? "isn't" : "aren't"} connected to the app`,
|
|
42
|
+
description: `The app does not receive ${variables.join(", ")} yet. Connect, and AntelopeJS Cloud sets ${one ? "it" : "them"} from what the database publishes and keeps ${one ? "it" : "them"} current; the next deployment reads ${one ? "it" : "them"}.`,
|
|
43
|
+
actions: [
|
|
44
|
+
{
|
|
45
|
+
label: "Connect",
|
|
46
|
+
icon: "i-ph-plugs-connected",
|
|
47
|
+
target: {
|
|
48
|
+
type: "api",
|
|
49
|
+
url: (0, routes_1.environmentRoute)(routes_1.RESOURCES_ROUTES.apply, environment),
|
|
50
|
+
method: "POST",
|
|
51
|
+
successMessage: "Database connected",
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function unfedBanner([first]) {
|
|
58
|
+
return {
|
|
59
|
+
tone: "warning",
|
|
60
|
+
icon: "i-ph-plugs",
|
|
61
|
+
title: `Nothing carries the address of ${first.database.label} into the app`,
|
|
62
|
+
description: `antelope.config.ts has no envOverrides entry that feeds ${first.path}. Add one, such as ${first.suggestion}: "${first.path}", and AntelopeJS Cloud sets it from the database.`,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The call to action at the top of the page: how many dependencies of the
|
|
67
|
+
* environment are not running yet, and the plan to review. On a plan Cloud
|
|
68
|
+
* refuses, it warns that they cannot be created. Once they all run, it says
|
|
69
|
+
* which database the app is not connected to, with the action that connects
|
|
70
|
+
* it, or the `envOverrides` line whose absence leaves a database unreachable.
|
|
71
|
+
* `null` when the plan creates nothing and every database is connected.
|
|
72
|
+
*/
|
|
73
|
+
function resourcesBanner(read) {
|
|
74
|
+
if (read.kind === "unknown_environment") {
|
|
75
|
+
return {
|
|
76
|
+
tone: "warning",
|
|
77
|
+
icon: "i-ph-magnifying-glass",
|
|
78
|
+
...unknownEnvironmentTexts(read.requested),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
if (read.kind !== "ok")
|
|
82
|
+
return null;
|
|
83
|
+
const { name } = read.environment;
|
|
84
|
+
const { length } = read.plan.create;
|
|
85
|
+
if (length === 0) {
|
|
86
|
+
const { missing, unfed } = read.connections;
|
|
87
|
+
if (missing.length > 0)
|
|
88
|
+
return connectBanner(name, missing);
|
|
89
|
+
const [first, ...others] = unfed;
|
|
90
|
+
return first ? unfedBanner([first, ...others]) : null;
|
|
91
|
+
}
|
|
92
|
+
const count = (0, format_1.dependencies)(length);
|
|
93
|
+
if (!read.plan.canApply) {
|
|
94
|
+
return {
|
|
95
|
+
tone: "warning",
|
|
96
|
+
icon: "i-ph-cube",
|
|
97
|
+
title: `${count} on ${name} can't be created on your plan`,
|
|
98
|
+
description: "AntelopeJS Cloud refuses this plan, so publishing does not create them. Review the plan to see why.",
|
|
99
|
+
actions: [reviewPlan(name)],
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
tone: "info",
|
|
104
|
+
icon: "i-ph-cube",
|
|
105
|
+
title: `${count} on ${name} ${length === 1 ? "isn't" : "aren't"} running yet`,
|
|
106
|
+
description: "AntelopeJS Cloud creates them when the next version reaches this environment. Review the plan to have them ready before you publish.",
|
|
107
|
+
actions: [reviewPlan(name)],
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* What the next version adds to an environment, for the publish form: the
|
|
112
|
+
* databases the plan creates, named after the modules that need them, with a
|
|
113
|
+
* link to review the plan. On a plan Cloud refuses, it says the version needs
|
|
114
|
+
* them and publishing does not create them. `null` when it adds nothing.
|
|
115
|
+
*/
|
|
116
|
+
function publishNote(read) {
|
|
117
|
+
if (read.kind !== "ok" || read.plan.create.length === 0)
|
|
118
|
+
return null;
|
|
119
|
+
const { create, canApply } = read.plan;
|
|
120
|
+
const { name } = read.environment;
|
|
121
|
+
const labels = create.map(({ label }) => label).join(", ");
|
|
122
|
+
const modules = create.map(({ module }) => module).join(", ");
|
|
123
|
+
const detected = `Detected from ${modules} in antelope.config.ts.`;
|
|
124
|
+
const what = create.length === 1
|
|
125
|
+
? `a dependency${canApply ? "" : " your plan refuses"}: ${labels}`
|
|
126
|
+
: `${create.length} dependencies${canApply ? "" : " your plan refuses"}: ${labels}`;
|
|
127
|
+
return {
|
|
128
|
+
tone: canApply ? "info" : "warning",
|
|
129
|
+
size: "sm",
|
|
130
|
+
icon: "i-ph-cube",
|
|
131
|
+
title: canApply
|
|
132
|
+
? `This version adds ${what}`
|
|
133
|
+
: `This version needs ${what}`,
|
|
134
|
+
description: canApply
|
|
135
|
+
? `${detected} Created on ${name} before the build.`
|
|
136
|
+
: `${detected} The plan of ${name} refuses ${create.length === 1 ? "it" : "them"}, so publishing does not create ${create.length === 1 ? "it" : "them"}.`,
|
|
137
|
+
actions: [
|
|
138
|
+
{
|
|
139
|
+
label: "Review plan",
|
|
140
|
+
icon: "i-ph-arrow-right",
|
|
141
|
+
to: (0, routes_1.resourcesPageUrl)(name),
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
/** The environments of the project, each a link to the page for it. */
|
|
147
|
+
function environmentItems(read) {
|
|
148
|
+
if (read.kind !== "ok" && read.kind !== "unknown_environment")
|
|
149
|
+
return [];
|
|
150
|
+
return read.environments.map(({ id, name }) => ({
|
|
151
|
+
id,
|
|
152
|
+
title: name,
|
|
153
|
+
icon: "i-ph-stack",
|
|
154
|
+
to: (0, routes_1.resourcesPageUrl)(name),
|
|
155
|
+
description: `See what AntelopeJS Cloud runs on ${name}.`,
|
|
156
|
+
}));
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=content.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MonthlyCost } from "@antelopejs/cloud-sdk";
|
|
2
|
+
/** `1 instance`, `2 instances`. */
|
|
3
|
+
export declare function plural(count: number, noun: string): string;
|
|
4
|
+
/** `1 dependency`, `2 dependencies`. */
|
|
5
|
+
export declare function dependencies(count: number): string;
|
|
6
|
+
/**
|
|
7
|
+
* A monthly cost as the plan states it: its range, or that the plan
|
|
8
|
+
* includes it.
|
|
9
|
+
*/
|
|
10
|
+
export declare function monthlyCostText(cost: MonthlyCost): string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.plural = plural;
|
|
4
|
+
exports.dependencies = dependencies;
|
|
5
|
+
exports.monthlyCostText = monthlyCostText;
|
|
6
|
+
const LOCALE = "en-GB";
|
|
7
|
+
/** `1 instance`, `2 instances`. */
|
|
8
|
+
function plural(count, noun) {
|
|
9
|
+
return `${count} ${noun}${count === 1 ? "" : "s"}`;
|
|
10
|
+
}
|
|
11
|
+
/** `1 dependency`, `2 dependencies`. */
|
|
12
|
+
function dependencies(count) {
|
|
13
|
+
return count === 1 ? "1 dependency" : `${count} dependencies`;
|
|
14
|
+
}
|
|
15
|
+
function money(amount, currency) {
|
|
16
|
+
return new Intl.NumberFormat(LOCALE, { style: "currency", currency }).format(amount);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A monthly cost as the plan states it: its range, or that the plan
|
|
20
|
+
* includes it.
|
|
21
|
+
*/
|
|
22
|
+
function monthlyCostText(cost) {
|
|
23
|
+
if (cost.included)
|
|
24
|
+
return "Included in your plan";
|
|
25
|
+
const { floor, ceiling, currency } = cost;
|
|
26
|
+
if (floor === ceiling)
|
|
27
|
+
return `${money(floor, currency)} / month`;
|
|
28
|
+
return `${money(floor, currency)} – ${money(ceiling, currency)} / month`;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { GuardFallback } from "@antelopejs/interface-dms/base/guard";
|
|
2
|
+
import type { ResourcesRead } from "./read";
|
|
3
|
+
/** What the Resources page's `Guard` reads: whether there is anything to show, and why not. */
|
|
4
|
+
export interface ResourcesGuardAnswer {
|
|
5
|
+
ready: boolean;
|
|
6
|
+
/** Laid over the Guard's fallback: why the page has nothing to show. */
|
|
7
|
+
emptyState?: GuardFallback;
|
|
8
|
+
}
|
|
9
|
+
type Unavailable = Exclude<ResourcesRead["kind"], "ok" | "unknown_environment">;
|
|
10
|
+
interface GuardText {
|
|
11
|
+
readonly title: string;
|
|
12
|
+
readonly description: string;
|
|
13
|
+
readonly icon: string;
|
|
14
|
+
}
|
|
15
|
+
/** The title and the description of why a read has nothing to show. */
|
|
16
|
+
export declare function guardTexts(kind: Unavailable): GuardText;
|
|
17
|
+
/**
|
|
18
|
+
* The answer of the Guard route: ready, or the reason there is nothing to
|
|
19
|
+
* show with a link to the Connection page. An environment the project does
|
|
20
|
+
* not list keeps the page, so the owner can choose another.
|
|
21
|
+
*/
|
|
22
|
+
export declare function guardAnswer(read: ResourcesRead): ResourcesGuardAnswer;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.guardTexts = guardTexts;
|
|
4
|
+
exports.guardAnswer = guardAnswer;
|
|
5
|
+
const slugs_1 = require("../pages/slugs");
|
|
6
|
+
const GUARD_TEXTS = {
|
|
7
|
+
__proto__: null,
|
|
8
|
+
not_connected: {
|
|
9
|
+
title: "Not connected to AntelopeJS Cloud",
|
|
10
|
+
description: "Connect this DMS to an AntelopeJS Cloud workspace to see what runs for each environment.",
|
|
11
|
+
icon: "i-ph-plugs-connected",
|
|
12
|
+
},
|
|
13
|
+
no_project: {
|
|
14
|
+
title: "No project chosen",
|
|
15
|
+
description: "Choose the project this DMS publishes to see what runs for each of its environments.",
|
|
16
|
+
icon: "i-ph-folder-simple",
|
|
17
|
+
},
|
|
18
|
+
revoked: {
|
|
19
|
+
title: "Your AntelopeJS Cloud sign-in was revoked",
|
|
20
|
+
description: "Sign in again to read what runs for each environment.",
|
|
21
|
+
icon: "i-ph-key",
|
|
22
|
+
},
|
|
23
|
+
forbidden: {
|
|
24
|
+
title: "AntelopeJS Cloud does not allow this token here",
|
|
25
|
+
description: "Its access does not cover what runs for this project's environments.",
|
|
26
|
+
icon: "i-ph-lock-key",
|
|
27
|
+
},
|
|
28
|
+
unreachable: {
|
|
29
|
+
title: "AntelopeJS Cloud did not answer",
|
|
30
|
+
description: "Try again in a moment.",
|
|
31
|
+
icon: "i-ph-cloud-slash",
|
|
32
|
+
},
|
|
33
|
+
missing: {
|
|
34
|
+
title: "This project has no environment",
|
|
35
|
+
description: "AntelopeJS Cloud lists no environment for the chosen project, or the project is gone. Choose a project again.",
|
|
36
|
+
icon: "i-ph-magnifying-glass",
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
/** The title and the description of why a read has nothing to show. */
|
|
40
|
+
function guardTexts(kind) {
|
|
41
|
+
return GUARD_TEXTS[kind];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The answer of the Guard route: ready, or the reason there is nothing to
|
|
45
|
+
* show with a link to the Connection page. An environment the project does
|
|
46
|
+
* not list keeps the page, so the owner can choose another.
|
|
47
|
+
*/
|
|
48
|
+
function guardAnswer(read) {
|
|
49
|
+
if (read.kind === "ok" || read.kind === "unknown_environment") {
|
|
50
|
+
return { ready: true };
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
ready: false,
|
|
54
|
+
emptyState: {
|
|
55
|
+
...guardTexts(read.kind),
|
|
56
|
+
actions: [{ label: "Open Connection", to: (0, slugs_1.modulePageSlug)("connection") }],
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=guard.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ModuleDeclaration } from "@antelopejs/interface-core/modules";
|
|
2
|
+
/**
|
|
3
|
+
* What the running project's `antelope.config.ts` runs: the npm packages that
|
|
4
|
+
* decide the plan, and the modules that run inside the app service only.
|
|
5
|
+
*/
|
|
6
|
+
export interface ProjectModules {
|
|
7
|
+
/** The npm package of each enabled module with a `package` source: sorted, once each. */
|
|
8
|
+
readonly packages: readonly string[];
|
|
9
|
+
/** The key of each enabled module with a local or git source: sorted. */
|
|
10
|
+
readonly inApp: readonly string[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Sorts a project's module declarations into the packages AntelopeJS Cloud
|
|
14
|
+
* plans for and the modules that run inside the app. A disabled module runs
|
|
15
|
+
* nothing, so it is in neither.
|
|
16
|
+
*/
|
|
17
|
+
export declare function projectModulesOf(declarations: Readonly<Record<string, ModuleDeclaration>>): ProjectModules;
|
|
18
|
+
/**
|
|
19
|
+
* Reads the top-level `modules` of the running project's `antelope.config.ts`.
|
|
20
|
+
*
|
|
21
|
+
* @throws When the running project has no configuration file to read.
|
|
22
|
+
*/
|
|
23
|
+
export declare function readProjectModules(): Promise<ProjectModules>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.projectModulesOf = projectModulesOf;
|
|
4
|
+
exports.readProjectModules = readProjectModules;
|
|
5
|
+
const modules_1 = require("@antelopejs/interface-core/modules");
|
|
6
|
+
function byName(left, right) {
|
|
7
|
+
return left.localeCompare(right);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Sorts a project's module declarations into the packages AntelopeJS Cloud
|
|
11
|
+
* plans for and the modules that run inside the app. A disabled module runs
|
|
12
|
+
* nothing, so it is in neither.
|
|
13
|
+
*/
|
|
14
|
+
function projectModulesOf(declarations) {
|
|
15
|
+
const packages = new Set();
|
|
16
|
+
const inApp = new Set();
|
|
17
|
+
for (const [key, declaration] of Object.entries(declarations)) {
|
|
18
|
+
if (declaration.disabled === true)
|
|
19
|
+
continue;
|
|
20
|
+
const { source } = declaration;
|
|
21
|
+
if (source?.type === "package")
|
|
22
|
+
packages.add(source.package);
|
|
23
|
+
else
|
|
24
|
+
inApp.add(key);
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
packages: [...packages].sort(byName),
|
|
28
|
+
inApp: [...inApp].sort(byName),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Reads the top-level `modules` of the running project's `antelope.config.ts`.
|
|
33
|
+
*
|
|
34
|
+
* @throws When the running project has no configuration file to read.
|
|
35
|
+
*/
|
|
36
|
+
async function readProjectModules() {
|
|
37
|
+
return projectModulesOf(await (0, modules_1.ListModuleDeclarations)());
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=modules.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ConfirmDialogSerialized } from "@antelopejs/interface-dms/base/types/confirm-dialog";
|
|
2
|
+
import type { ResourcesRead } from "./read";
|
|
3
|
+
/**
|
|
4
|
+
* The dialog "Review plan" opens: the plan as Cloud computes it, and the
|
|
5
|
+
* button that applies it only when Cloud can. A plan it refuses, as on the
|
|
6
|
+
* Free plan, shows its refusals and nothing to confirm.
|
|
7
|
+
*/
|
|
8
|
+
export declare function planDialog(read: ResourcesRead): ConfirmDialogSerialized;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.planDialog = planDialog;
|
|
4
|
+
const confirm_dialog_1 = require("@antelopejs/interface-dms/base/confirm-dialog");
|
|
5
|
+
const format_1 = require("./format");
|
|
6
|
+
const content_1 = require("./content");
|
|
7
|
+
const refusals_1 = require("./refusals");
|
|
8
|
+
const guard_1 = require("./guard");
|
|
9
|
+
const PLAN_ICONS = {
|
|
10
|
+
create: "i-ph-plus",
|
|
11
|
+
existing: "i-ph-equals",
|
|
12
|
+
unprovided: "i-ph-prohibit",
|
|
13
|
+
refusal: "i-ph-warning",
|
|
14
|
+
};
|
|
15
|
+
function impactRows(plan) {
|
|
16
|
+
return [
|
|
17
|
+
...plan.create.map(({ label, version, module, monthlyCost }) => ({
|
|
18
|
+
icon: PLAN_ICONS.create,
|
|
19
|
+
label: `${label} ${version} for ${module}`,
|
|
20
|
+
count: monthlyCost ? (0, format_1.monthlyCostText)(monthlyCost) : undefined,
|
|
21
|
+
})),
|
|
22
|
+
...plan.existing.map(({ name, module }) => ({
|
|
23
|
+
icon: PLAN_ICONS.existing,
|
|
24
|
+
label: `${name} already runs for ${module}`,
|
|
25
|
+
})),
|
|
26
|
+
...plan.unprovided.map((need) => ({
|
|
27
|
+
icon: PLAN_ICONS.unprovided,
|
|
28
|
+
label: `${need.resource} for ${need.module}: AntelopeJS Cloud cannot provide it`,
|
|
29
|
+
})),
|
|
30
|
+
...plan.refusals.map((refusal) => ({
|
|
31
|
+
icon: PLAN_ICONS.refusal,
|
|
32
|
+
label: (0, refusals_1.refusalMessageKey)(refusal),
|
|
33
|
+
})),
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
function summaryOf(plan) {
|
|
37
|
+
const sentences = [];
|
|
38
|
+
if (plan.cost)
|
|
39
|
+
sentences.push(`Monthly cost: ${(0, format_1.monthlyCostText)(plan.cost)}.`);
|
|
40
|
+
const unbacked = plan.create.filter(({ backups }) => !backups);
|
|
41
|
+
if (unbacked.length > 0) {
|
|
42
|
+
sentences.push(`${unbacked.map(({ label }) => label).join(", ")} ${unbacked.length === 1 ? "runs" : "run"} without backups: keep nothing in ${unbacked.length === 1 ? "it" : "them"} that you cannot rebuild.`);
|
|
43
|
+
}
|
|
44
|
+
const { servicesPerEnvironment, databasesPerEnvironment } = plan.limits;
|
|
45
|
+
const ceilings = [
|
|
46
|
+
["Services", servicesPerEnvironment],
|
|
47
|
+
["Databases", databasesPerEnvironment],
|
|
48
|
+
];
|
|
49
|
+
for (const [name, use] of ceilings) {
|
|
50
|
+
if (use) {
|
|
51
|
+
sentences.push(`${name}: ${use.used} / ${use.ceiling} now, ${use.afterApply} after.`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return sentences.join(" ");
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The dialog "Review plan" opens: the plan as Cloud computes it, and the
|
|
58
|
+
* button that applies it only when Cloud can. A plan it refuses, as on the
|
|
59
|
+
* Free plan, shows its refusals and nothing to confirm.
|
|
60
|
+
*/
|
|
61
|
+
function planDialog(read) {
|
|
62
|
+
if (read.kind === "unknown_environment") {
|
|
63
|
+
const { title, description } = (0, content_1.unknownEnvironmentTexts)(read.requested);
|
|
64
|
+
return (0, confirm_dialog_1.serializeConfirmDialog)({ title, description, blocked: true });
|
|
65
|
+
}
|
|
66
|
+
if (read.kind !== "ok") {
|
|
67
|
+
const { title, description } = (0, guard_1.guardTexts)(read.kind);
|
|
68
|
+
return (0, confirm_dialog_1.serializeConfirmDialog)({ title, description, blocked: true });
|
|
69
|
+
}
|
|
70
|
+
const { plan, environment } = read;
|
|
71
|
+
if (plan.create.length === 0) {
|
|
72
|
+
return (0, confirm_dialog_1.serializeConfirmDialog)({
|
|
73
|
+
title: `Nothing to create on ${environment.name}`,
|
|
74
|
+
description: "Every database the modules need already runs, or AntelopeJS Cloud cannot provide it.",
|
|
75
|
+
icon: "i-ph-cube",
|
|
76
|
+
impact: impactRows(plan),
|
|
77
|
+
blocked: true,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
const count = (0, format_1.dependencies)(plan.create.length);
|
|
81
|
+
return (0, confirm_dialog_1.serializeConfirmDialog)({
|
|
82
|
+
title: plan.canApply
|
|
83
|
+
? `Create ${count} on ${environment.name}?`
|
|
84
|
+
: `${environment.name} cannot create ${count} yet`,
|
|
85
|
+
description: summaryOf(plan),
|
|
86
|
+
icon: "i-ph-cube",
|
|
87
|
+
color: plan.canApply ? "primary" : "warning",
|
|
88
|
+
confirmLabel: `Create on ${environment.name}`,
|
|
89
|
+
impact: impactRows(plan),
|
|
90
|
+
blocked: !plan.canApply,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=plan.js.map
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { EnvironmentResource, ResourcePlan } from "@antelopejs/cloud-sdk";
|
|
2
|
+
import type { CurrentConnection } from "../connection/current";
|
|
3
|
+
import { type Connections } from "./connect";
|
|
4
|
+
import { type ProjectModules } from "./modules";
|
|
5
|
+
/** An environment of the project, as the resource routes name it. */
|
|
6
|
+
export interface EnvironmentRef {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* What one environment's Resources view reads, in one pass: why there is
|
|
12
|
+
* nothing to show, or the project's environments, the one chosen, what it
|
|
13
|
+
* runs and the plan Cloud computes for the project's modules.
|
|
14
|
+
*/
|
|
15
|
+
export type ResourcesRead = {
|
|
16
|
+
kind: "not_connected";
|
|
17
|
+
} | {
|
|
18
|
+
kind: "no_project";
|
|
19
|
+
} | {
|
|
20
|
+
kind: "revoked";
|
|
21
|
+
} | {
|
|
22
|
+
kind: "forbidden";
|
|
23
|
+
} | {
|
|
24
|
+
kind: "unreachable";
|
|
25
|
+
} | {
|
|
26
|
+
kind: "missing";
|
|
27
|
+
} | {
|
|
28
|
+
kind: "unknown_environment";
|
|
29
|
+
requested: string;
|
|
30
|
+
environments: EnvironmentRef[];
|
|
31
|
+
} | {
|
|
32
|
+
kind: "ok";
|
|
33
|
+
environments: EnvironmentRef[];
|
|
34
|
+
environment: EnvironmentRef;
|
|
35
|
+
modules: ProjectModules;
|
|
36
|
+
resources: EnvironmentResource[];
|
|
37
|
+
plan: ResourcePlan;
|
|
38
|
+
/** What stands between the environment's databases and its apps. */
|
|
39
|
+
connections: Connections;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* The environment a request names by name or id, the first of the project's
|
|
43
|
+
* when it names none, `undefined` when the project has no such environment.
|
|
44
|
+
*/
|
|
45
|
+
export declare function pickEnvironment<Environment extends EnvironmentRef>(environments: readonly Environment[], requested: string | undefined): Environment | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Reads what AntelopeJS Cloud runs for an environment of the tenant's project,
|
|
48
|
+
* and its plan for the modules of the running project. `requested` is an
|
|
49
|
+
* environment's name or id, the first one the project lists when it is
|
|
50
|
+
* `undefined`.
|
|
51
|
+
*
|
|
52
|
+
* @throws When the running project has no configuration file to read.
|
|
53
|
+
*/
|
|
54
|
+
export declare function readResources(stored: CurrentConnection | undefined, requested: string | undefined): Promise<ResourcesRead>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pickEnvironment = pickEnvironment;
|
|
4
|
+
exports.readResources = readResources;
|
|
5
|
+
const cloud_1 = require("../connection/cloud");
|
|
6
|
+
const roles_1 = require("../environments/roles");
|
|
7
|
+
const project_config_1 = require("../variables/project-config");
|
|
8
|
+
const connect_1 = require("./connect");
|
|
9
|
+
const modules_1 = require("./modules");
|
|
10
|
+
/**
|
|
11
|
+
* The environment a request names by name or id, the first of the project's
|
|
12
|
+
* when it names none, `undefined` when the project has no such environment.
|
|
13
|
+
*/
|
|
14
|
+
function pickEnvironment(environments, requested) {
|
|
15
|
+
if (requested === undefined)
|
|
16
|
+
return environments[0];
|
|
17
|
+
return environments.find(({ id, name }) => id === requested || name === requested);
|
|
18
|
+
}
|
|
19
|
+
async function readEnvironment(api, projectId, requested, packages) {
|
|
20
|
+
const project = await api.readProject(projectId);
|
|
21
|
+
const environments = project.environments.map(({ id, name }) => ({
|
|
22
|
+
id,
|
|
23
|
+
name,
|
|
24
|
+
}));
|
|
25
|
+
const environment = pickEnvironment(environments, requested);
|
|
26
|
+
if (!environment) {
|
|
27
|
+
return requested === undefined || environments.length === 0
|
|
28
|
+
? { kind: "missing" }
|
|
29
|
+
: { kind: "unknown_environment", requested, environments };
|
|
30
|
+
}
|
|
31
|
+
const [{ resources }, plan, { variables }] = await Promise.all([
|
|
32
|
+
api.environmentResources(projectId, environment.id),
|
|
33
|
+
api.planResources(projectId, environment.id, packages),
|
|
34
|
+
api.listVariables(projectId, environment.id),
|
|
35
|
+
]);
|
|
36
|
+
const services = project.environments.find(({ id }) => id === environment.id)?.services ??
|
|
37
|
+
[];
|
|
38
|
+
const { apps } = await (0, roles_1.rolesAmong)(api, services, new Set(resources.map(({ serviceId }) => serviceId)));
|
|
39
|
+
const facts = { resources, serviceIds: apps, variables };
|
|
40
|
+
return { kind: "ok", environments, environment, resources, plan, facts };
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Reads what AntelopeJS Cloud runs for an environment of the tenant's project,
|
|
44
|
+
* and its plan for the modules of the running project. `requested` is an
|
|
45
|
+
* environment's name or id, the first one the project lists when it is
|
|
46
|
+
* `undefined`.
|
|
47
|
+
*
|
|
48
|
+
* @throws When the running project has no configuration file to read.
|
|
49
|
+
*/
|
|
50
|
+
async function readResources(stored, requested) {
|
|
51
|
+
if (stored?.state !== "connected")
|
|
52
|
+
return { kind: "not_connected" };
|
|
53
|
+
const { projectId } = stored;
|
|
54
|
+
if (projectId === null)
|
|
55
|
+
return { kind: "no_project" };
|
|
56
|
+
const modules = await (0, modules_1.readProjectModules)();
|
|
57
|
+
const view = await (0, cloud_1.readCloud)(stored, (api) => readEnvironment(api, projectId, requested, modules.packages));
|
|
58
|
+
if (view.kind !== "ok")
|
|
59
|
+
return { kind: view.kind };
|
|
60
|
+
if (view.value.kind !== "ok")
|
|
61
|
+
return view.value;
|
|
62
|
+
const { facts, ...environment } = view.value;
|
|
63
|
+
return {
|
|
64
|
+
...environment,
|
|
65
|
+
modules,
|
|
66
|
+
connections: (0, connect_1.plannedConnections)(facts, await (0, project_config_1.readProjectConfig)()),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=read.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { NullPrototype } from "../null-prototype";
|
|
2
|
+
import type { ResourcePlanRefusal } from "@antelopejs/cloud-sdk";
|
|
3
|
+
/**
|
|
4
|
+
* How each reason AntelopeJS Cloud refuses a plan reads here: `key` is the end
|
|
5
|
+
* of both the key of its text in the module's catalog,
|
|
6
|
+
* `dms_antelope_cloud.errors.resources.<key>`, and of the error key the
|
|
7
|
+
* Cloud apply answers it with, `cloud.errors.resources.<key>`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const PLAN_REFUSALS: NullPrototype<Record<ResourcePlanRefusal, {
|
|
10
|
+
readonly key: string;
|
|
11
|
+
}>>;
|
|
12
|
+
/** The i18n key, with its `$`, of the text that explains a refused plan. */
|
|
13
|
+
export declare function refusalMessageKey(refusal: ResourcePlanRefusal): string;
|
|
14
|
+
/** The refusal a Cloud apply answered 409 with, `undefined` for another error key. */
|
|
15
|
+
export declare function refusalOfCloudKey(cloudKey: string): ResourcePlanRefusal | undefined;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PLAN_REFUSALS = void 0;
|
|
4
|
+
exports.refusalMessageKey = refusalMessageKey;
|
|
5
|
+
exports.refusalOfCloudKey = refusalOfCloudKey;
|
|
6
|
+
/**
|
|
7
|
+
* How each reason AntelopeJS Cloud refuses a plan reads here: `key` is the end
|
|
8
|
+
* of both the key of its text in the module's catalog,
|
|
9
|
+
* `dms_antelope_cloud.errors.resources.<key>`, and of the error key the
|
|
10
|
+
* Cloud apply answers it with, `cloud.errors.resources.<key>`.
|
|
11
|
+
*/
|
|
12
|
+
exports.PLAN_REFUSALS = {
|
|
13
|
+
__proto__: null,
|
|
14
|
+
preview_environment: { key: "preview_environment" },
|
|
15
|
+
services_per_environment: { key: "over_service_limit" },
|
|
16
|
+
databases_per_environment: { key: "over_database_limit" },
|
|
17
|
+
};
|
|
18
|
+
const REFUSALS = [
|
|
19
|
+
"preview_environment",
|
|
20
|
+
"services_per_environment",
|
|
21
|
+
"databases_per_environment",
|
|
22
|
+
];
|
|
23
|
+
const MODULE_KEY_PREFIX = "dms_antelope_cloud.errors.resources.";
|
|
24
|
+
const CLOUD_KEY_PREFIX = "cloud.errors.resources.";
|
|
25
|
+
/** The i18n key, with its `$`, of the text that explains a refused plan. */
|
|
26
|
+
function refusalMessageKey(refusal) {
|
|
27
|
+
return `$${MODULE_KEY_PREFIX}${exports.PLAN_REFUSALS[refusal].key}`;
|
|
28
|
+
}
|
|
29
|
+
/** The refusal a Cloud apply answered 409 with, `undefined` for another error key. */
|
|
30
|
+
function refusalOfCloudKey(cloudKey) {
|
|
31
|
+
return REFUSALS.find((refusal) => `${CLOUD_KEY_PREFIX}${exports.PLAN_REFUSALS[refusal].key}` === cloudKey);
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=refusals.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** The routes of the Resources page, relative to it. */
|
|
2
|
+
export declare const RESOURCES_ROUTES: {
|
|
3
|
+
readonly state: "/state";
|
|
4
|
+
readonly banner: "/banner";
|
|
5
|
+
readonly environments: "/environments";
|
|
6
|
+
readonly cards: "/cards";
|
|
7
|
+
readonly derived: "/derived";
|
|
8
|
+
readonly limits: "/limits";
|
|
9
|
+
readonly planDialog: "/plan-dialog";
|
|
10
|
+
readonly apply: "/apply";
|
|
11
|
+
readonly publishNote: "/publish-note";
|
|
12
|
+
};
|
|
13
|
+
/** A route of the Resources page. */
|
|
14
|
+
export type ResourcesRoute = (typeof RESOURCES_ROUTES)[keyof typeof RESOURCES_ROUTES];
|
|
15
|
+
/** The query parameter that names the environment a route answers for. */
|
|
16
|
+
export declare const ENVIRONMENT_PARAMETER = "environment";
|
|
17
|
+
/** The realtime topic the Resources page's blocks read their routes again on. */
|
|
18
|
+
export declare const RESOURCES_TOPIC = "antelope-cloud.resources";
|
|
19
|
+
/** The URL of the Resources page itself, showing the environment of the name given. */
|
|
20
|
+
export declare function resourcesPageUrl(environment: string): string;
|
|
21
|
+
/** The URL of a Resources page route that answers for the project's first environment. */
|
|
22
|
+
export declare function resourcesRoute(route: ResourcesRoute): string;
|
|
23
|
+
/** The URL of a Resources page route, for the environment of the name given. */
|
|
24
|
+
export declare function environmentRoute(route: ResourcesRoute, environment: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* The URL of a Resources page route, for the environment the page URL names.
|
|
27
|
+
* The dashboard fills the token in from the page's own query and does not
|
|
28
|
+
* read the route while the page names none.
|
|
29
|
+
*/
|
|
30
|
+
export declare function pageEnvironmentRoute(route: ResourcesRoute): string;
|
|
31
|
+
/** Tells the tenant's open Resources pages that what Cloud runs changed. */
|
|
32
|
+
export declare function announceResources(tenantId: string): Promise<void>;
|