@antelopejs/dms-antelope-cloud 0.0.0-stage → 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.
Files changed (224) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +447 -2
  3. package/dist/cloud-status.d.ts +13 -0
  4. package/dist/cloud-status.js +77 -0
  5. package/dist/config.d.ts +84 -0
  6. package/dist/config.js +104 -0
  7. package/dist/configured.d.ts +16 -0
  8. package/dist/configured.js +26 -0
  9. package/dist/connection/actions.d.ts +40 -0
  10. package/dist/connection/actions.js +120 -0
  11. package/dist/connection/announce.d.ts +8 -0
  12. package/dist/connection/announce.js +20 -0
  13. package/dist/connection/cloud.d.ts +60 -0
  14. package/dist/connection/cloud.js +87 -0
  15. package/dist/connection/content.d.ts +70 -0
  16. package/dist/connection/content.js +462 -0
  17. package/dist/connection/current.d.ts +26 -0
  18. package/dist/connection/current.js +28 -0
  19. package/dist/connection/device-flow.d.ts +16 -0
  20. package/dist/connection/device-flow.js +146 -0
  21. package/dist/connection/refusals.d.ts +51 -0
  22. package/dist/connection/refusals.js +85 -0
  23. package/dist/connection/repository.d.ts +28 -0
  24. package/dist/connection/repository.js +69 -0
  25. package/dist/connection/seal.d.ts +22 -0
  26. package/dist/connection/seal.js +47 -0
  27. package/dist/connection/store.d.ts +294 -0
  28. package/dist/connection/store.js +165 -0
  29. package/dist/connection/view.d.ts +39 -0
  30. package/dist/connection/view.js +39 -0
  31. package/dist/dashboard/actions.d.ts +40 -0
  32. package/dist/dashboard/actions.js +115 -0
  33. package/dist/dashboard/dockerfile.d.ts +34 -0
  34. package/dist/dashboard/dockerfile.js +71 -0
  35. package/dist/dashboard/service.d.ts +61 -0
  36. package/dist/dashboard/service.js +137 -0
  37. package/dist/dashboard/variables.d.ts +30 -0
  38. package/dist/dashboard/variables.js +34 -0
  39. package/dist/deployments/build-log.d.ts +39 -0
  40. package/dist/deployments/build-log.js +57 -0
  41. package/dist/deployments/cloud-steps.d.ts +77 -0
  42. package/dist/deployments/cloud-steps.js +132 -0
  43. package/dist/deployments/content.d.ts +61 -0
  44. package/dist/deployments/content.js +268 -0
  45. package/dist/deployments/deployment.d.ts +96 -0
  46. package/dist/deployments/deployment.js +3 -0
  47. package/dist/deployments/follow.d.ts +18 -0
  48. package/dist/deployments/follow.js +112 -0
  49. package/dist/deployments/ledger.d.ts +23 -0
  50. package/dist/deployments/ledger.js +359 -0
  51. package/dist/deployments/lifecycle.d.ts +123 -0
  52. package/dist/deployments/lifecycle.js +146 -0
  53. package/dist/deployments/live.d.ts +28 -0
  54. package/dist/deployments/live.js +54 -0
  55. package/dist/deployments/publish-read.d.ts +20 -0
  56. package/dist/deployments/publish-read.js +24 -0
  57. package/dist/deployments/refusals.d.ts +13 -0
  58. package/dist/deployments/refusals.js +35 -0
  59. package/dist/environments/actions.d.ts +86 -0
  60. package/dist/environments/actions.js +210 -0
  61. package/dist/environments/address.d.ts +60 -0
  62. package/dist/environments/address.js +149 -0
  63. package/dist/environments/content.d.ts +97 -0
  64. package/dist/environments/content.js +275 -0
  65. package/dist/environments/follower.d.ts +32 -0
  66. package/dist/environments/follower.js +114 -0
  67. package/dist/environments/pipeline.d.ts +58 -0
  68. package/dist/environments/pipeline.js +76 -0
  69. package/dist/environments/publish-targets.d.ts +18 -0
  70. package/dist/environments/publish-targets.js +55 -0
  71. package/dist/environments/roles.d.ts +73 -0
  72. package/dist/environments/roles.js +97 -0
  73. package/dist/frontend-module.d.ts +12 -0
  74. package/dist/frontend-module.js +25 -0
  75. package/dist/git/changed-files.d.ts +30 -0
  76. package/dist/git/changed-files.js +107 -0
  77. package/dist/git/changes.d.ts +89 -0
  78. package/dist/git/changes.js +162 -0
  79. package/dist/git/command.d.ts +51 -0
  80. package/dist/git/command.js +231 -0
  81. package/dist/git/promotion.d.ts +23 -0
  82. package/dist/git/promotion.js +46 -0
  83. package/dist/git/publish-input.d.ts +42 -0
  84. package/dist/git/publish-input.js +62 -0
  85. package/dist/git/publish-job.d.ts +82 -0
  86. package/dist/git/publish-job.js +99 -0
  87. package/dist/git/publish-steps.d.ts +90 -0
  88. package/dist/git/publish-steps.js +205 -0
  89. package/dist/git/publisher.d.ts +23 -0
  90. package/dist/git/publisher.js +206 -0
  91. package/dist/git/refs.d.ts +99 -0
  92. package/dist/git/refs.js +178 -0
  93. package/dist/git/refusal.d.ts +49 -0
  94. package/dist/git/refusal.js +70 -0
  95. package/dist/git/repository.d.ts +101 -0
  96. package/dist/git/repository.js +273 -0
  97. package/dist/git/versions.d.ts +99 -0
  98. package/dist/git/versions.js +174 -0
  99. package/dist/git/write-lock.d.ts +19 -0
  100. package/dist/git/write-lock.js +49 -0
  101. package/dist/index.d.ts +5 -0
  102. package/dist/index.js +59 -0
  103. package/dist/lifecycle.d.ts +8 -0
  104. package/dist/lifecycle.js +78 -0
  105. package/dist/logs/relay.d.ts +25 -0
  106. package/dist/logs/relay.js +138 -0
  107. package/dist/null-prototype.d.ts +7 -0
  108. package/dist/null-prototype.js +3 -0
  109. package/dist/overview/content.d.ts +40 -0
  110. package/dist/overview/content.js +172 -0
  111. package/dist/pages/changes.d.ts +32 -0
  112. package/dist/pages/changes.js +141 -0
  113. package/dist/pages/connection.d.ts +43 -0
  114. package/dist/pages/connection.js +295 -0
  115. package/dist/pages/deployment.d.ts +67 -0
  116. package/dist/pages/deployment.js +261 -0
  117. package/dist/pages/deployments.d.ts +46 -0
  118. package/dist/pages/deployments.js +266 -0
  119. package/dist/pages/environments.d.ts +34 -0
  120. package/dist/pages/environments.js +368 -0
  121. package/dist/pages/logs.d.ts +46 -0
  122. package/dist/pages/logs.js +140 -0
  123. package/dist/pages/navigation.d.ts +61 -0
  124. package/dist/pages/navigation.js +107 -0
  125. package/dist/pages/overview.d.ts +35 -0
  126. package/dist/pages/overview.js +201 -0
  127. package/dist/pages/project-guard.d.ts +32 -0
  128. package/dist/pages/project-guard.js +99 -0
  129. package/dist/pages/query.d.ts +6 -0
  130. package/dist/pages/query.js +14 -0
  131. package/dist/pages/resources.d.ts +37 -0
  132. package/dist/pages/resources.js +211 -0
  133. package/dist/pages/setup.d.ts +40 -0
  134. package/dist/pages/setup.js +271 -0
  135. package/dist/pages/slugs.d.ts +15 -0
  136. package/dist/pages/slugs.js +28 -0
  137. package/dist/pages/variables.d.ts +43 -0
  138. package/dist/pages/variables.js +327 -0
  139. package/dist/pages/version.d.ts +26 -0
  140. package/dist/pages/version.js +214 -0
  141. package/dist/pages/versions.d.ts +20 -0
  142. package/dist/pages/versions.js +115 -0
  143. package/dist/resources/apply.d.ts +15 -0
  144. package/dist/resources/apply.js +127 -0
  145. package/dist/resources/cards.d.ts +41 -0
  146. package/dist/resources/cards.js +211 -0
  147. package/dist/resources/connect.d.ts +66 -0
  148. package/dist/resources/connect.js +78 -0
  149. package/dist/resources/content.d.ts +26 -0
  150. package/dist/resources/content.js +158 -0
  151. package/dist/resources/format.d.ts +10 -0
  152. package/dist/resources/format.js +30 -0
  153. package/dist/resources/guard.d.ts +23 -0
  154. package/dist/resources/guard.js +60 -0
  155. package/dist/resources/modules.d.ts +23 -0
  156. package/dist/resources/modules.js +39 -0
  157. package/dist/resources/plan.d.ts +8 -0
  158. package/dist/resources/plan.js +93 -0
  159. package/dist/resources/read.d.ts +54 -0
  160. package/dist/resources/read.js +69 -0
  161. package/dist/resources/refusals.d.ts +15 -0
  162. package/dist/resources/refusals.js +33 -0
  163. package/dist/resources/routes.d.ts +32 -0
  164. package/dist/resources/routes.js +53 -0
  165. package/dist/setup/actions.d.ts +79 -0
  166. package/dist/setup/actions.js +188 -0
  167. package/dist/setup/apply.d.ts +37 -0
  168. package/dist/setup/apply.js +172 -0
  169. package/dist/setup/content.d.ts +50 -0
  170. package/dist/setup/content.js +440 -0
  171. package/dist/setup/rollout.d.ts +119 -0
  172. package/dist/setup/rollout.js +227 -0
  173. package/dist/setup/steps.d.ts +93 -0
  174. package/dist/setup/steps.js +95 -0
  175. package/dist/setup/storage.d.ts +29 -0
  176. package/dist/setup/storage.js +78 -0
  177. package/dist/setup/store.d.ts +214 -0
  178. package/dist/setup/store.js +174 -0
  179. package/dist/setup/volume.d.ts +31 -0
  180. package/dist/setup/volume.js +52 -0
  181. package/dist/slug.d.ts +7 -0
  182. package/dist/slug.js +26 -0
  183. package/dist/variables/actions.d.ts +76 -0
  184. package/dist/variables/actions.js +185 -0
  185. package/dist/variables/content.d.ts +69 -0
  186. package/dist/variables/content.js +310 -0
  187. package/dist/variables/decide.d.ts +27 -0
  188. package/dist/variables/decide.js +155 -0
  189. package/dist/variables/decided-dialog.d.ts +11 -0
  190. package/dist/variables/decided-dialog.js +129 -0
  191. package/dist/variables/decided.d.ts +80 -0
  192. package/dist/variables/decided.js +240 -0
  193. package/dist/variables/dialogs.d.ts +8 -0
  194. package/dist/variables/dialogs.js +219 -0
  195. package/dist/variables/model.d.ts +106 -0
  196. package/dist/variables/model.js +156 -0
  197. package/dist/variables/project-config.d.ts +117 -0
  198. package/dist/variables/project-config.js +248 -0
  199. package/dist/variables/read.d.ts +33 -0
  200. package/dist/variables/read.js +118 -0
  201. package/dist/web-url.d.ts +9 -0
  202. package/dist/web-url.js +19 -0
  203. package/frontend-vue/app/components/BuildLog.vue +99 -0
  204. package/frontend-vue/app/components/ChangedFiles.vue +165 -0
  205. package/frontend-vue/app/components/DashboardEnvironments.vue +102 -0
  206. package/frontend-vue/app/components/LogLine.vue +33 -0
  207. package/frontend-vue/app/components/LogViewer.vue +314 -0
  208. package/frontend-vue/app/components/PublishChipIcon.vue +39 -0
  209. package/frontend-vue/app/components/PublishForm.vue +505 -0
  210. package/frontend-vue/app/components/PublishPopover.vue +90 -0
  211. package/frontend-vue/app/components/PublishRoute.vue +222 -0
  212. package/frontend-vue/app/composables/usePublishSummary.ts +80 -0
  213. package/frontend-vue/app/plugins/publish-chip.client.ts +44 -0
  214. package/frontend-vue/app/types/publishing.ts +154 -0
  215. package/frontend-vue/app/utils/build-log.ts +96 -0
  216. package/frontend-vue/app/utils/changed-files.ts +142 -0
  217. package/frontend-vue/app/utils/log-line.ts +15 -0
  218. package/frontend-vue/app/utils/log-stream.ts +361 -0
  219. package/frontend-vue/app/utils/publish-state.ts +299 -0
  220. package/frontend-vue/dms.frontend.ts +27 -0
  221. package/frontend-vue/i18n/locales/antelope-cloud-en-GB.json +110 -0
  222. package/frontend-vue/package.json +38 -0
  223. package/frontend-vue/pnpm-lock.yaml +2697 -0
  224. package/package.json +115 -3
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.refuse = refuse;
4
+ exports.refuseRead = refuseRead;
5
+ exports.projectAccess = projectAccess;
6
+ exports.requireProject = requireProject;
7
+ exports.readProjectGate = readProjectGate;
8
+ exports.projectGuard = projectGuard;
9
+ const interface_api_1 = require("@antelopejs/interface-api");
10
+ const guard_1 = require("@antelopejs/interface-dms/base/guard");
11
+ const announce_1 = require("../connection/announce");
12
+ const current_1 = require("../connection/current");
13
+ const slugs_1 = require("./slugs");
14
+ const HTTP_BAD_REQUEST = 400;
15
+ const HTTP_CONFLICT = 409;
16
+ const HTTP_UNPROCESSABLE = 422;
17
+ const HTTP_BAD_GATEWAY = 502;
18
+ const MESSAGE_KEY_PREFIX = "$dms_antelope_cloud.errors.";
19
+ const OPEN_CONNECTION = [
20
+ { label: "Open Connection", to: (0, slugs_1.modulePageSlug)("connection") },
21
+ ];
22
+ const NOT_CONNECTED = {
23
+ ready: false,
24
+ emptyState: {
25
+ title: "Not connected to AntelopeJS Cloud",
26
+ description: "Sign this DMS in to an AntelopeJS Cloud workspace on the Connection page.",
27
+ icon: "i-ph-plugs-connected",
28
+ actions: OPEN_CONNECTION,
29
+ },
30
+ };
31
+ const NO_PROJECT = {
32
+ ready: false,
33
+ emptyState: {
34
+ title: "No project chosen",
35
+ description: "Choose the AntelopeJS Cloud project this DMS publishes on the Connection page.",
36
+ icon: "i-ph-folder-simple",
37
+ actions: OPEN_CONNECTION,
38
+ },
39
+ };
40
+ const READ_REFUSALS = {
41
+ __proto__: null,
42
+ revoked: "sign_in_revoked",
43
+ missing: "unknown_project",
44
+ forbidden: "cloud_forbidden",
45
+ unreachable: "cloud_unreachable",
46
+ };
47
+ const REFUSAL_STATUS = new Map([
48
+ ["project_required", HTTP_BAD_REQUEST],
49
+ ["unknown_project", HTTP_UNPROCESSABLE],
50
+ ["cloud_unreachable", HTTP_BAD_GATEWAY],
51
+ ]);
52
+ /** The refusal the dashboard shows for `key`, 409 unless the key says otherwise. */
53
+ function refuse(key) {
54
+ return new interface_api_1.HTTPResult(REFUSAL_STATUS.get(key) ?? HTTP_CONFLICT, {
55
+ error: key,
56
+ message: `${MESSAGE_KEY_PREFIX}${key}`,
57
+ });
58
+ }
59
+ /** The refusal for a Cloud read that gave no value. */
60
+ function refuseRead(kind) {
61
+ return refuse(READ_REFUSALS[kind]);
62
+ }
63
+ /** The stored sign-in and its project, or null when either is missing. */
64
+ async function projectAccess(tenantId) {
65
+ const stored = await (0, current_1.readConnection)(tenantId);
66
+ if (stored?.state !== "connected" || stored.projectId === null)
67
+ return null;
68
+ return { connection: stored, projectId: stored.projectId };
69
+ }
70
+ /**
71
+ * The stored sign-in and its project, for a route that changes something.
72
+ *
73
+ * @throws The `not_connected` or `project_required` refusal.
74
+ */
75
+ async function requireProject(tenantId) {
76
+ const stored = await (0, current_1.readConnection)(tenantId);
77
+ if (stored?.state !== "connected")
78
+ throw refuse("not_connected");
79
+ if (stored.projectId === null)
80
+ throw refuse("project_required");
81
+ return { connection: stored, projectId: stored.projectId };
82
+ }
83
+ /** Open once the workspace is signed in with a project chosen, else why not. */
84
+ async function readProjectGate(tenantId) {
85
+ const stored = await (0, current_1.readConnection)(tenantId);
86
+ if (stored?.state !== "connected")
87
+ return NOT_CONNECTED;
88
+ return stored.projectId === null ? NO_PROJECT : { ready: true };
89
+ }
90
+ /** The `Guard` a project page puts first, reading its gate route at `fetchUrl`. */
91
+ function projectGuard(fetchUrl) {
92
+ return (0, guard_1.Guard)({
93
+ fetchUrl,
94
+ field: "ready",
95
+ realtimeTopic: announce_1.CONNECTION_TOPIC,
96
+ fallback: NOT_CONNECTED.emptyState,
97
+ });
98
+ }
99
+ //# sourceMappingURL=project-guard.js.map
@@ -0,0 +1,6 @@
1
+ import type { QueryValue } from "@antelopejs/interface-api";
2
+ /**
3
+ * The text of a query parameter: nothing when the request did not carry it,
4
+ * or carried it without a value (`?name` and `?name=` arrive as `true`).
5
+ */
6
+ export declare function queryText(value: QueryValue): string | undefined;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.queryText = queryText;
4
+ const zod_1 = require("zod");
5
+ const textSchema = zod_1.z.string();
6
+ /**
7
+ * The text of a query parameter: nothing when the request did not carry it,
8
+ * or carried it without a value (`?name` and `?name=` arrive as `true`).
9
+ */
10
+ function queryText(value) {
11
+ const parsed = textSchema.safeParse(value);
12
+ return parsed.success ? parsed.data : undefined;
13
+ }
14
+ //# sourceMappingURL=query.js.map
@@ -0,0 +1,37 @@
1
+ import { type QueryValue } from "@antelopejs/interface-api";
2
+ import { type BannerContent } from "@antelopejs/interface-dms/base/banner";
3
+ import { type KeyValueListItem } from "@antelopejs/interface-dms/base/key-value-list";
4
+ import { type NavCardItem } from "@antelopejs/interface-dms/base/nav-card-grid";
5
+ import type { ConfirmDialogSerialized } from "@antelopejs/interface-dms/base/types/confirm-dialog";
6
+ import { type ResourcesGuardAnswer } from "../resources/guard";
7
+ interface Items<T> {
8
+ items: T[];
9
+ }
10
+ declare const ResourcesPage_base: {
11
+ new (...args: any[]): {};
12
+ extend: <T extends import("@antelopejs/interface-api").ControllerClass>(this: T, location: string) => T;
13
+ location: string;
14
+ };
15
+ /**
16
+ * What AntelopeJS Cloud runs for each environment of the connected project,
17
+ * derived from the modules in the running project's `antelope.config.ts`, and
18
+ * the plan to review before a version adds a resource.
19
+ */
20
+ export declare class ResourcesPage extends ResourcesPage_base {
21
+ static banner: import("@antelopejs/interface-dms").ComponentBuilder<import("@antelopejs/interface-dms/base").BannerProps>;
22
+ static connection: import("@antelopejs/interface-dms").ComponentBuilder<import("@antelopejs/interface-dms/base").GuardOptions>;
23
+ /** The DMS workspace of the request, bound by the page's registration. */
24
+ tenantId: string;
25
+ private stored;
26
+ private read;
27
+ readState(environment?: QueryValue): Promise<ResourcesGuardAnswer>;
28
+ readBanner(environment?: QueryValue): Promise<BannerContent | null>;
29
+ readEnvironments(environment?: QueryValue): Promise<Items<NavCardItem>>;
30
+ readCards(environment?: QueryValue): Promise<Items<NavCardItem>>;
31
+ readDerived(environment?: QueryValue): Promise<Items<KeyValueListItem>>;
32
+ readLimits(environment?: QueryValue): Promise<Items<KeyValueListItem>>;
33
+ readPlanDialog(environment?: QueryValue): Promise<ConfirmDialogSerialized>;
34
+ readPublishNote(environment?: QueryValue): Promise<BannerContent | null>;
35
+ apply(environment?: QueryValue): Promise<object>;
36
+ }
37
+ export {};
@@ -0,0 +1,211 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.ResourcesPage = void 0;
16
+ const interface_api_1 = require("@antelopejs/interface-api");
17
+ const banner_1 = require("@antelopejs/interface-dms/base/banner");
18
+ const guard_1 = require("@antelopejs/interface-dms/base/guard");
19
+ const key_value_list_1 = require("@antelopejs/interface-dms/base/key-value-list");
20
+ const nav_card_grid_1 = require("@antelopejs/interface-dms/base/nav-card-grid");
21
+ const section_1 = require("@antelopejs/interface-dms/base/section");
22
+ const page_1 = require("@antelopejs/interface-dms/page");
23
+ const announce_1 = require("../connection/announce");
24
+ const current_1 = require("../connection/current");
25
+ const apply_1 = require("../resources/apply");
26
+ const cards_1 = require("../resources/cards");
27
+ const content_1 = require("../resources/content");
28
+ const guard_2 = require("../resources/guard");
29
+ const plan_1 = require("../resources/plan");
30
+ const read_1 = require("../resources/read");
31
+ const routes_1 = require("../resources/routes");
32
+ const navigation_1 = require("./navigation");
33
+ const query_1 = require("./query");
34
+ const EnvironmentQuery = () => (0, interface_api_1.Parameter)(routes_1.ENVIRONMENT_PARAMETER, "query");
35
+ const TOPICS = [routes_1.RESOURCES_TOPIC, announce_1.CONNECTION_TOPIC];
36
+ const CARD_COLUMNS = 3;
37
+ function environmentList() {
38
+ return (0, nav_card_grid_1.NavCardGrid)({
39
+ title: "Environments",
40
+ description: "Choose the environment whose resources you want to see. AntelopeJS Cloud runs a set of databases for each one.",
41
+ fetchUrl: (0, routes_1.resourcesRoute)(routes_1.RESOURCES_ROUTES.environments),
42
+ realtimeTopic: TOPICS,
43
+ columns: CARD_COLUMNS,
44
+ });
45
+ }
46
+ function resourceGrid() {
47
+ return (0, nav_card_grid_1.NavCardGrid)({
48
+ fetchUrl: (0, routes_1.pageEnvironmentRoute)(routes_1.RESOURCES_ROUTES.cards),
49
+ realtimeTopic: TOPICS,
50
+ columns: CARD_COLUMNS,
51
+ empty: {
52
+ title: "No database to show",
53
+ description: "Choose an environment above. An environment whose modules need no database lists none.",
54
+ },
55
+ });
56
+ }
57
+ function keyValues(route, title) {
58
+ return (0, key_value_list_1.KeyValueList)({
59
+ title,
60
+ fetchUrl: (0, routes_1.pageEnvironmentRoute)(route),
61
+ realtimeTopic: TOPICS,
62
+ });
63
+ }
64
+ /**
65
+ * What AntelopeJS Cloud runs for each environment of the connected project,
66
+ * derived from the modules in the running project's `antelope.config.ts`, and
67
+ * the plan to review before a version adds a resource.
68
+ */
69
+ let ResourcesPage = class ResourcesPage extends (0, page_1.PageController)("resources", (0, navigation_1.navigationEntry)("resources")) {
70
+ static banner = (0, banner_1.Banner)({
71
+ fetchUrl: (0, routes_1.pageEnvironmentRoute)(routes_1.RESOURCES_ROUTES.banner),
72
+ realtimeTopic: TOPICS,
73
+ });
74
+ static connection = (0, guard_1.Guard)({
75
+ fetchUrl: (0, routes_1.resourcesRoute)(routes_1.RESOURCES_ROUTES.state),
76
+ realtimeTopic: TOPICS,
77
+ field: "ready",
78
+ fallback: {
79
+ title: "Nothing to show",
80
+ description: "AntelopeJS Cloud has nothing to show for this project yet.",
81
+ icon: "i-ph-cube",
82
+ },
83
+ })
84
+ .child("environments", environmentList())
85
+ .child("resources", (0, section_1.Section)({
86
+ title: "Resources",
87
+ card: false,
88
+ description: "The databases the environment runs, the ones its next version creates, and the needs AntelopeJS Cloud cannot provide.",
89
+ }).child("cards", resourceGrid()))
90
+ .child("derived", (0, section_1.Section)({
91
+ title: "How this is derived",
92
+ card: false,
93
+ description: "Each module of antelope.config.ts and what it becomes on AntelopeJS Cloud: you do not declare infrastructure twice.",
94
+ }).child("modules", keyValues(routes_1.RESOURCES_ROUTES.derived, "Modules")))
95
+ .child("limits", (0, section_1.Section)({
96
+ title: "Limits",
97
+ card: false,
98
+ description: "What the plan of the workspace allows this environment.",
99
+ }).child("ceilings", keyValues(routes_1.RESOURCES_ROUTES.limits, "Plan")));
100
+ stored() {
101
+ return (0, current_1.readConnection)(this.tenantId);
102
+ }
103
+ async read(environment) {
104
+ return (0, read_1.readResources)(await this.stored(), (0, query_1.queryText)(environment) || undefined);
105
+ }
106
+ async readState(environment) {
107
+ return (0, guard_2.guardAnswer)(await this.read(environment));
108
+ }
109
+ async readBanner(environment) {
110
+ return (0, content_1.resourcesBanner)(await this.read(environment));
111
+ }
112
+ async readEnvironments(environment) {
113
+ return { items: (0, content_1.environmentItems)(await this.read(environment)) };
114
+ }
115
+ async readCards(environment) {
116
+ const read = await this.read(environment);
117
+ if (read.kind !== "ok")
118
+ return { items: [] };
119
+ return {
120
+ items: (0, cards_1.resourceCards)(read.resources, read.plan).map(cards_1.cardItem),
121
+ };
122
+ }
123
+ async readDerived(environment) {
124
+ const read = await this.read(environment);
125
+ return {
126
+ items: read.kind === "ok" ? (0, cards_1.derivedItems)(read.modules, read) : [],
127
+ };
128
+ }
129
+ async readLimits(environment) {
130
+ const read = await this.read(environment);
131
+ return { items: read.kind === "ok" ? (0, cards_1.limitItems)(read) : [] };
132
+ }
133
+ async readPlanDialog(environment) {
134
+ return (0, plan_1.planDialog)(await this.read(environment));
135
+ }
136
+ async readPublishNote(environment) {
137
+ return (0, content_1.publishNote)(await this.read(environment));
138
+ }
139
+ async apply(environment) {
140
+ await (0, apply_1.applyResources)(this.tenantId, await this.stored(), (0, query_1.queryText)(environment) || undefined);
141
+ return {};
142
+ }
143
+ };
144
+ exports.ResourcesPage = ResourcesPage;
145
+ __decorate([
146
+ (0, interface_api_1.Get)(routes_1.RESOURCES_ROUTES.state),
147
+ __param(0, EnvironmentQuery()),
148
+ __metadata("design:type", Function),
149
+ __metadata("design:paramtypes", [Object]),
150
+ __metadata("design:returntype", Promise)
151
+ ], ResourcesPage.prototype, "readState", null);
152
+ __decorate([
153
+ (0, interface_api_1.Get)(routes_1.RESOURCES_ROUTES.banner),
154
+ __param(0, EnvironmentQuery()),
155
+ __metadata("design:type", Function),
156
+ __metadata("design:paramtypes", [Object]),
157
+ __metadata("design:returntype", Promise)
158
+ ], ResourcesPage.prototype, "readBanner", null);
159
+ __decorate([
160
+ (0, interface_api_1.Get)(routes_1.RESOURCES_ROUTES.environments),
161
+ __param(0, EnvironmentQuery()),
162
+ __metadata("design:type", Function),
163
+ __metadata("design:paramtypes", [Object]),
164
+ __metadata("design:returntype", Promise)
165
+ ], ResourcesPage.prototype, "readEnvironments", null);
166
+ __decorate([
167
+ (0, interface_api_1.Get)(routes_1.RESOURCES_ROUTES.cards),
168
+ __param(0, EnvironmentQuery()),
169
+ __metadata("design:type", Function),
170
+ __metadata("design:paramtypes", [Object]),
171
+ __metadata("design:returntype", Promise)
172
+ ], ResourcesPage.prototype, "readCards", null);
173
+ __decorate([
174
+ (0, interface_api_1.Get)(routes_1.RESOURCES_ROUTES.derived),
175
+ __param(0, EnvironmentQuery()),
176
+ __metadata("design:type", Function),
177
+ __metadata("design:paramtypes", [Object]),
178
+ __metadata("design:returntype", Promise)
179
+ ], ResourcesPage.prototype, "readDerived", null);
180
+ __decorate([
181
+ (0, interface_api_1.Get)(routes_1.RESOURCES_ROUTES.limits),
182
+ __param(0, EnvironmentQuery()),
183
+ __metadata("design:type", Function),
184
+ __metadata("design:paramtypes", [Object]),
185
+ __metadata("design:returntype", Promise)
186
+ ], ResourcesPage.prototype, "readLimits", null);
187
+ __decorate([
188
+ (0, interface_api_1.Get)(routes_1.RESOURCES_ROUTES.planDialog),
189
+ __param(0, EnvironmentQuery()),
190
+ __metadata("design:type", Function),
191
+ __metadata("design:paramtypes", [Object]),
192
+ __metadata("design:returntype", Promise)
193
+ ], ResourcesPage.prototype, "readPlanDialog", null);
194
+ __decorate([
195
+ (0, interface_api_1.Get)(routes_1.RESOURCES_ROUTES.publishNote),
196
+ __param(0, EnvironmentQuery()),
197
+ __metadata("design:type", Function),
198
+ __metadata("design:paramtypes", [Object]),
199
+ __metadata("design:returntype", Promise)
200
+ ], ResourcesPage.prototype, "readPublishNote", null);
201
+ __decorate([
202
+ (0, interface_api_1.Post)(routes_1.RESOURCES_ROUTES.apply),
203
+ __param(0, EnvironmentQuery()),
204
+ __metadata("design:type", Function),
205
+ __metadata("design:paramtypes", [Object]),
206
+ __metadata("design:returntype", Promise)
207
+ ], ResourcesPage.prototype, "apply", null);
208
+ exports.ResourcesPage = ResourcesPage = __decorate([
209
+ (0, page_1.RegisterPage)()
210
+ ], ResourcesPage);
211
+ //# sourceMappingURL=resources.js.map
@@ -0,0 +1,40 @@
1
+ import { type BannerContent } from "@antelopejs/interface-dms/base/banner";
2
+ import { type KeyValueListItem } from "@antelopejs/interface-dms/base/key-value-list";
3
+ import type { ConfirmDialogSerialized } from "@antelopejs/interface-dms/base/types/confirm-dialog";
4
+ import { type GuardAnswer, type RemoteAnswer } from "../connection/content";
5
+ import { type ApplyAnswer } from "../setup/content";
6
+ interface Items {
7
+ items: KeyValueListItem[];
8
+ }
9
+ declare const SetupPage_base: {
10
+ new (...args: any[]): {};
11
+ extend: <T extends import("@antelopejs/interface-api").ControllerClass>(this: T, location: string) => T;
12
+ location: string;
13
+ };
14
+ /**
15
+ * The steps that put this project online on AntelopeJS Cloud: connect, choose
16
+ * or plan the project, check the repository, review the plan, apply it.
17
+ * Nothing is created on AntelopeJS Cloud before the plan is applied.
18
+ */
19
+ export declare class SetupPage extends SetupPage_base {
20
+ static steps: import("@antelopejs/interface-dms").ComponentBuilder<import("@antelopejs/interface-dms/base").KeyValueListProps>;
21
+ static step: import("@antelopejs/interface-dms").ComponentBuilder<import("@antelopejs/interface-dms/base").BannerProps>;
22
+ static connection: import("@antelopejs/interface-dms").ComponentBuilder<import("@antelopejs/interface-dms/base").GuardOptions>;
23
+ /** The DMS workspace of the request, bound by the page's registration. */
24
+ tenantId: string;
25
+ private stored;
26
+ readSteps(): Promise<Items>;
27
+ readStep(): Promise<BannerContent | null>;
28
+ readState(): Promise<GuardAnswer>;
29
+ readPlan(): Promise<Items>;
30
+ readRemote(): Promise<RemoteAnswer>;
31
+ readRepository(): Promise<Items>;
32
+ readNewProjectDialog(): Promise<ConfirmDialogSerialized>;
33
+ readExistingProjectDialog(): Promise<ConfirmDialogSerialized>;
34
+ readStagesDialog(): Promise<ConfirmDialogSerialized>;
35
+ planNewProject(body: unknown): Promise<object>;
36
+ planExistingProject(body: unknown): Promise<object>;
37
+ planStages(body: unknown): Promise<object>;
38
+ apply(): Promise<ApplyAnswer>;
39
+ }
40
+ export {};