@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.
- package/LICENSE +201 -0
- package/README.md +447 -2
- 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 -3
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
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;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
42
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
43
|
+
};
|
|
44
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
45
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.ConnectionPage = void 0;
|
|
49
|
+
const interface_api_1 = require("@antelopejs/interface-api");
|
|
50
|
+
const banner_1 = require("@antelopejs/interface-dms/base/banner");
|
|
51
|
+
const guard_1 = require("@antelopejs/interface-dms/base/guard");
|
|
52
|
+
const key_value_list_1 = require("@antelopejs/interface-dms/base/key-value-list");
|
|
53
|
+
const section_1 = require("@antelopejs/interface-dms/base/section");
|
|
54
|
+
const page_1 = require("@antelopejs/interface-dms/page");
|
|
55
|
+
const cloud_status_1 = require("../cloud-status");
|
|
56
|
+
const config_1 = require("../config");
|
|
57
|
+
const actions = __importStar(require("../connection/actions"));
|
|
58
|
+
const announce_1 = require("../connection/announce");
|
|
59
|
+
const cloud_1 = require("../connection/cloud");
|
|
60
|
+
const content = __importStar(require("../connection/content"));
|
|
61
|
+
const content_1 = require("../connection/content");
|
|
62
|
+
const current_1 = require("../connection/current");
|
|
63
|
+
const repository_1 = require("../connection/repository");
|
|
64
|
+
const view_1 = require("../connection/view");
|
|
65
|
+
const navigation_1 = require("./navigation");
|
|
66
|
+
const slugs_1 = require("./slugs");
|
|
67
|
+
const STATUS_ROWS = 3;
|
|
68
|
+
function details(route) {
|
|
69
|
+
return (0, key_value_list_1.KeyValueList)({
|
|
70
|
+
fetchUrl: (0, content_1.connectionRoute)(route),
|
|
71
|
+
realtimeTopic: announce_1.CONNECTION_TOPIC,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function fetchedBanner(route) {
|
|
75
|
+
return (0, banner_1.Banner)({
|
|
76
|
+
fetchUrl: (0, content_1.connectionRoute)(route),
|
|
77
|
+
realtimeTopic: announce_1.CONNECTION_TOPIC,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Asks the cloud what the connection's token reaches: the workspace's
|
|
82
|
+
* projects, or only the project of a connection the cloud manages, whose
|
|
83
|
+
* token the workspace endpoints refuse.
|
|
84
|
+
*/
|
|
85
|
+
function probeAccess(api, stored) {
|
|
86
|
+
return (0, current_1.isManaged)(stored)
|
|
87
|
+
? api.readProject(stored.projectId)
|
|
88
|
+
: api.listProjects();
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* How this project reaches AntelopeJS Cloud: the device sign-in, the workspace
|
|
92
|
+
* and project it publishes to, the repository it builds from, and the API it
|
|
93
|
+
* talks to. The workspace's token stays on the server.
|
|
94
|
+
*/
|
|
95
|
+
let ConnectionPage = class ConnectionPage extends (0, page_1.PageController)("connection", (0, navigation_1.navigationEntry)("connection")) {
|
|
96
|
+
static banner = fetchedBanner(content_1.CONNECTION_ROUTES.banner);
|
|
97
|
+
static connection = (0, guard_1.Guard)({
|
|
98
|
+
fetchUrl: (0, content_1.connectionRoute)(content_1.CONNECTION_ROUTES.state),
|
|
99
|
+
realtimeTopic: announce_1.CONNECTION_TOPIC,
|
|
100
|
+
field: "connected",
|
|
101
|
+
fallback: {
|
|
102
|
+
title: "Not connected",
|
|
103
|
+
description: "Connect this DMS to an AntelopeJS Cloud workspace to choose the project it publishes. The workspace token stays encrypted on this server.",
|
|
104
|
+
icon: "i-ph-plugs-connected",
|
|
105
|
+
actions: [{ label: "Start the first-run setup", to: slugs_1.SETUP_PAGE_SLUG }],
|
|
106
|
+
},
|
|
107
|
+
})
|
|
108
|
+
.child("account", (0, section_1.Section)({
|
|
109
|
+
title: "Account",
|
|
110
|
+
card: false,
|
|
111
|
+
description: "Who signed this DMS in, and how the sign-in is kept.",
|
|
112
|
+
}).child("details", details(content_1.CONNECTION_ROUTES.account)))
|
|
113
|
+
.child("workspace", (0, section_1.Section)({
|
|
114
|
+
title: "Workspace and project",
|
|
115
|
+
card: false,
|
|
116
|
+
description: "Where this project's environments run.",
|
|
117
|
+
}).child("details", details(content_1.CONNECTION_ROUTES.workspace)))
|
|
118
|
+
.child("repository", (0, section_1.Section)({
|
|
119
|
+
title: "Repository",
|
|
120
|
+
card: false,
|
|
121
|
+
description: "AntelopeJS Cloud builds each environment from its branch on GitHub.",
|
|
122
|
+
}).child("details", details(content_1.CONNECTION_ROUTES.repository)))
|
|
123
|
+
.child("danger", (0, section_1.Section)({ title: "Danger zone", danger: true })
|
|
124
|
+
.child("disconnect", fetchedBanner(content_1.CONNECTION_ROUTES.disconnectBanner))
|
|
125
|
+
.child("signOut", fetchedBanner(content_1.CONNECTION_ROUTES.signOutBanner)));
|
|
126
|
+
static status = (0, key_value_list_1.KeyValueList)({
|
|
127
|
+
title: "AntelopeJS Cloud API",
|
|
128
|
+
fetchUrl: (0, content_1.connectionRoute)(content_1.CONNECTION_ROUTES.apiStatus),
|
|
129
|
+
skeletonCount: STATUS_ROWS,
|
|
130
|
+
});
|
|
131
|
+
stored() {
|
|
132
|
+
return (0, current_1.readConnection)(this.tenantId);
|
|
133
|
+
}
|
|
134
|
+
async view() {
|
|
135
|
+
return (0, view_1.toView)(await this.stored(), new Date());
|
|
136
|
+
}
|
|
137
|
+
async readBanner() {
|
|
138
|
+
const stored = await this.stored();
|
|
139
|
+
const view = (0, view_1.toView)(stored, new Date());
|
|
140
|
+
const access = stored?.state === "connected"
|
|
141
|
+
? await (0, cloud_1.readCloud)(stored, (api) => probeAccess(api, stored))
|
|
142
|
+
: undefined;
|
|
143
|
+
return content.connectionBanner(view, access?.kind);
|
|
144
|
+
}
|
|
145
|
+
async readState() {
|
|
146
|
+
return content.guardAnswer(await this.view());
|
|
147
|
+
}
|
|
148
|
+
async readAccount() {
|
|
149
|
+
return { items: content.accountItems(await this.view()) };
|
|
150
|
+
}
|
|
151
|
+
async readWorkspace() {
|
|
152
|
+
const stored = await this.stored();
|
|
153
|
+
const view = (0, view_1.toView)(stored, new Date());
|
|
154
|
+
if (stored?.state !== "connected" || stored.projectId === null) {
|
|
155
|
+
return { items: content.workspaceItems(view, undefined) };
|
|
156
|
+
}
|
|
157
|
+
const { projectId } = stored;
|
|
158
|
+
const project = await (0, cloud_1.readCloud)(stored, (api) => api.readProject(projectId));
|
|
159
|
+
return { items: content.workspaceItems(view, project) };
|
|
160
|
+
}
|
|
161
|
+
async readRepository() {
|
|
162
|
+
return {
|
|
163
|
+
items: content.repositoryItems(await (0, repository_1.readPublishedRepository)()),
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
async readDisconnectBanner() {
|
|
167
|
+
return content.disconnectBanner(await this.view());
|
|
168
|
+
}
|
|
169
|
+
async readSignOutBanner() {
|
|
170
|
+
return content.signOutBanner(await this.view());
|
|
171
|
+
}
|
|
172
|
+
async readProjectDialog() {
|
|
173
|
+
const stored = await this.stored();
|
|
174
|
+
if (stored?.state === "connected" && (0, current_1.isManaged)(stored)) {
|
|
175
|
+
return content.managedProjectDialog();
|
|
176
|
+
}
|
|
177
|
+
return content.projectDialog(stored?.state === "connected"
|
|
178
|
+
? await (0, cloud_1.readCloud)(stored, (api) => api.listProjects())
|
|
179
|
+
: undefined);
|
|
180
|
+
}
|
|
181
|
+
async connect() {
|
|
182
|
+
await actions.connect(this.tenantId, this.user.name);
|
|
183
|
+
return {};
|
|
184
|
+
}
|
|
185
|
+
async cancel() {
|
|
186
|
+
await actions.cancel(this.tenantId);
|
|
187
|
+
return {};
|
|
188
|
+
}
|
|
189
|
+
async chooseProject(body) {
|
|
190
|
+
await actions.chooseProject(this.tenantId, actions.parseProjectChoice(body));
|
|
191
|
+
return {};
|
|
192
|
+
}
|
|
193
|
+
async disconnect() {
|
|
194
|
+
await actions.disconnect(this.tenantId);
|
|
195
|
+
return {};
|
|
196
|
+
}
|
|
197
|
+
async signOut() {
|
|
198
|
+
await actions.signOut(this.tenantId);
|
|
199
|
+
return {};
|
|
200
|
+
}
|
|
201
|
+
async readApiStatus() {
|
|
202
|
+
const { apiUrl } = (0, config_1.cloudSettings)();
|
|
203
|
+
return { items: (0, cloud_status_1.connectionItems)(apiUrl, await (0, cloud_status_1.probeCloud)(apiUrl)) };
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
exports.ConnectionPage = ConnectionPage;
|
|
207
|
+
__decorate([
|
|
208
|
+
(0, interface_api_1.Get)(content_1.CONNECTION_ROUTES.banner),
|
|
209
|
+
__metadata("design:type", Function),
|
|
210
|
+
__metadata("design:paramtypes", []),
|
|
211
|
+
__metadata("design:returntype", Promise)
|
|
212
|
+
], ConnectionPage.prototype, "readBanner", null);
|
|
213
|
+
__decorate([
|
|
214
|
+
(0, interface_api_1.Get)(content_1.CONNECTION_ROUTES.state),
|
|
215
|
+
__metadata("design:type", Function),
|
|
216
|
+
__metadata("design:paramtypes", []),
|
|
217
|
+
__metadata("design:returntype", Promise)
|
|
218
|
+
], ConnectionPage.prototype, "readState", null);
|
|
219
|
+
__decorate([
|
|
220
|
+
(0, interface_api_1.Get)(content_1.CONNECTION_ROUTES.account),
|
|
221
|
+
__metadata("design:type", Function),
|
|
222
|
+
__metadata("design:paramtypes", []),
|
|
223
|
+
__metadata("design:returntype", Promise)
|
|
224
|
+
], ConnectionPage.prototype, "readAccount", null);
|
|
225
|
+
__decorate([
|
|
226
|
+
(0, interface_api_1.Get)(content_1.CONNECTION_ROUTES.workspace),
|
|
227
|
+
__metadata("design:type", Function),
|
|
228
|
+
__metadata("design:paramtypes", []),
|
|
229
|
+
__metadata("design:returntype", Promise)
|
|
230
|
+
], ConnectionPage.prototype, "readWorkspace", null);
|
|
231
|
+
__decorate([
|
|
232
|
+
(0, interface_api_1.Get)(content_1.CONNECTION_ROUTES.repository),
|
|
233
|
+
__metadata("design:type", Function),
|
|
234
|
+
__metadata("design:paramtypes", []),
|
|
235
|
+
__metadata("design:returntype", Promise)
|
|
236
|
+
], ConnectionPage.prototype, "readRepository", null);
|
|
237
|
+
__decorate([
|
|
238
|
+
(0, interface_api_1.Get)(content_1.CONNECTION_ROUTES.disconnectBanner),
|
|
239
|
+
__metadata("design:type", Function),
|
|
240
|
+
__metadata("design:paramtypes", []),
|
|
241
|
+
__metadata("design:returntype", Promise)
|
|
242
|
+
], ConnectionPage.prototype, "readDisconnectBanner", null);
|
|
243
|
+
__decorate([
|
|
244
|
+
(0, interface_api_1.Get)(content_1.CONNECTION_ROUTES.signOutBanner),
|
|
245
|
+
__metadata("design:type", Function),
|
|
246
|
+
__metadata("design:paramtypes", []),
|
|
247
|
+
__metadata("design:returntype", Promise)
|
|
248
|
+
], ConnectionPage.prototype, "readSignOutBanner", null);
|
|
249
|
+
__decorate([
|
|
250
|
+
(0, interface_api_1.Get)(content_1.CONNECTION_ROUTES.projectDialog),
|
|
251
|
+
__metadata("design:type", Function),
|
|
252
|
+
__metadata("design:paramtypes", []),
|
|
253
|
+
__metadata("design:returntype", Promise)
|
|
254
|
+
], ConnectionPage.prototype, "readProjectDialog", null);
|
|
255
|
+
__decorate([
|
|
256
|
+
(0, interface_api_1.Post)(content_1.CONNECTION_ROUTES.connect),
|
|
257
|
+
__metadata("design:type", Function),
|
|
258
|
+
__metadata("design:paramtypes", []),
|
|
259
|
+
__metadata("design:returntype", Promise)
|
|
260
|
+
], ConnectionPage.prototype, "connect", null);
|
|
261
|
+
__decorate([
|
|
262
|
+
(0, interface_api_1.Post)(content_1.CONNECTION_ROUTES.cancel),
|
|
263
|
+
__metadata("design:type", Function),
|
|
264
|
+
__metadata("design:paramtypes", []),
|
|
265
|
+
__metadata("design:returntype", Promise)
|
|
266
|
+
], ConnectionPage.prototype, "cancel", null);
|
|
267
|
+
__decorate([
|
|
268
|
+
(0, interface_api_1.Post)(content_1.CONNECTION_ROUTES.project),
|
|
269
|
+
__param(0, (0, interface_api_1.JSONBody)()),
|
|
270
|
+
__metadata("design:type", Function),
|
|
271
|
+
__metadata("design:paramtypes", [Object]),
|
|
272
|
+
__metadata("design:returntype", Promise)
|
|
273
|
+
], ConnectionPage.prototype, "chooseProject", null);
|
|
274
|
+
__decorate([
|
|
275
|
+
(0, interface_api_1.Post)(content_1.CONNECTION_ROUTES.disconnect),
|
|
276
|
+
__metadata("design:type", Function),
|
|
277
|
+
__metadata("design:paramtypes", []),
|
|
278
|
+
__metadata("design:returntype", Promise)
|
|
279
|
+
], ConnectionPage.prototype, "disconnect", null);
|
|
280
|
+
__decorate([
|
|
281
|
+
(0, interface_api_1.Post)(content_1.CONNECTION_ROUTES.signOut),
|
|
282
|
+
__metadata("design:type", Function),
|
|
283
|
+
__metadata("design:paramtypes", []),
|
|
284
|
+
__metadata("design:returntype", Promise)
|
|
285
|
+
], ConnectionPage.prototype, "signOut", null);
|
|
286
|
+
__decorate([
|
|
287
|
+
(0, interface_api_1.Get)(content_1.CONNECTION_ROUTES.apiStatus),
|
|
288
|
+
__metadata("design:type", Function),
|
|
289
|
+
__metadata("design:paramtypes", []),
|
|
290
|
+
__metadata("design:returntype", Promise)
|
|
291
|
+
], ConnectionPage.prototype, "readApiStatus", null);
|
|
292
|
+
exports.ConnectionPage = ConnectionPage = __decorate([
|
|
293
|
+
(0, page_1.RegisterPage)()
|
|
294
|
+
], ConnectionPage);
|
|
295
|
+
//# sourceMappingURL=connection.js.map
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { HTTPResult } 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 BuildLogLine } from "../deployments/build-log";
|
|
5
|
+
import { type ProjectGate } from "./project-guard";
|
|
6
|
+
/** The routes of the Deployment page, relative to it. */
|
|
7
|
+
export declare const DEPLOYMENT_ROUTES: {
|
|
8
|
+
readonly gate: "/gate";
|
|
9
|
+
readonly facts: "/facts";
|
|
10
|
+
readonly steps: "/steps";
|
|
11
|
+
readonly failure: "/failure";
|
|
12
|
+
readonly rollbackBanner: "/rollback-banner";
|
|
13
|
+
readonly rollback: "/rollback";
|
|
14
|
+
readonly buildLog: "/build-log";
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* What the build log viewer reads: the end of the failed build's log, or why
|
|
18
|
+
* there is none to show. `none`: no build of the deployment failed. `gone`:
|
|
19
|
+
* AntelopeJS Cloud no longer serves that build's log. `unreachable`: it gave
|
|
20
|
+
* no usable answer.
|
|
21
|
+
*/
|
|
22
|
+
export type BuildLogAnswer = {
|
|
23
|
+
readonly state: "lines";
|
|
24
|
+
readonly lines: readonly BuildLogLine[];
|
|
25
|
+
readonly truncated: boolean;
|
|
26
|
+
} | {
|
|
27
|
+
readonly state: "none" | "gone" | "unreachable";
|
|
28
|
+
};
|
|
29
|
+
declare const DeploymentPage_base: {
|
|
30
|
+
new (...args: any[]): {};
|
|
31
|
+
extend: <T extends import("@antelopejs/interface-api").ControllerClass>(this: T, location: string) => T;
|
|
32
|
+
location: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* One deployment, live while it runs: its route from Queued to Live, why it
|
|
36
|
+
* failed and what the environment still serves, its facts, and a rollback
|
|
37
|
+
* of its environment to it.
|
|
38
|
+
*/
|
|
39
|
+
export declare class DeploymentPage extends DeploymentPage_base {
|
|
40
|
+
static toolbar: import("@antelopejs/interface-dms").ComponentBuilder<import("@antelopejs/interface-dms/base").PageToolbarProps>;
|
|
41
|
+
static deployment: import("@antelopejs/interface-dms").ComponentBuilder<import("@antelopejs/interface-dms/base").GuardOptions>;
|
|
42
|
+
/** The DMS workspace of the request, bound by the page's registration. */
|
|
43
|
+
tenantId: string;
|
|
44
|
+
gate(): Promise<ProjectGate>;
|
|
45
|
+
facts(id: string): Promise<{
|
|
46
|
+
items: KeyValueListItem[];
|
|
47
|
+
} | HTTPResult>;
|
|
48
|
+
steps(id: string): Promise<{
|
|
49
|
+
items: KeyValueListItem[];
|
|
50
|
+
} | HTTPResult>;
|
|
51
|
+
failure(id: string): Promise<BannerContent | null | HTTPResult>;
|
|
52
|
+
/**
|
|
53
|
+
* The end of the log of the deployment's failed build, read from
|
|
54
|
+
* AntelopeJS Cloud each time the viewer asks. Nothing is read from the
|
|
55
|
+
* Cloud's logs for a deployment whose builds did not fail.
|
|
56
|
+
*/
|
|
57
|
+
buildLog(id: string): Promise<BuildLogAnswer | HTTPResult>;
|
|
58
|
+
readRollbackBanner(id: string): Promise<BannerContent | null | HTTPResult>;
|
|
59
|
+
/**
|
|
60
|
+
* Rolls the deployment's environment back to it. Answers `{}` once every
|
|
61
|
+
* service moved. A refused plan, and a rollback that moved some services
|
|
62
|
+
* only (`rollback_partial`: pressing it again finishes it), answer 409
|
|
63
|
+
* with the refusal's key.
|
|
64
|
+
*/
|
|
65
|
+
rollback(id: string): Promise<object>;
|
|
66
|
+
}
|
|
67
|
+
export {};
|
|
@@ -0,0 +1,261 @@
|
|
|
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.DeploymentPage = exports.DEPLOYMENT_ROUTES = void 0;
|
|
16
|
+
const interface_api_1 = require("@antelopejs/interface-api");
|
|
17
|
+
const banner_1 = require("@antelopejs/interface-dms/base/banner");
|
|
18
|
+
const custom_1 = require("@antelopejs/interface-dms/base/custom");
|
|
19
|
+
const grid_1 = require("@antelopejs/interface-dms/base/grid");
|
|
20
|
+
const guard_1 = require("@antelopejs/interface-dms/base/guard");
|
|
21
|
+
const key_value_list_1 = require("@antelopejs/interface-dms/base/key-value-list");
|
|
22
|
+
const page_toolbar_1 = require("@antelopejs/interface-dms/base/page-toolbar");
|
|
23
|
+
const page_1 = require("@antelopejs/interface-dms/page");
|
|
24
|
+
const cloud_1 = require("../connection/cloud");
|
|
25
|
+
const build_log_1 = require("../deployments/build-log");
|
|
26
|
+
const content_1 = require("../deployments/content");
|
|
27
|
+
const follow_1 = require("../deployments/follow");
|
|
28
|
+
const ledger_1 = require("../deployments/ledger");
|
|
29
|
+
const lifecycle_1 = require("../deployments/lifecycle");
|
|
30
|
+
const deployments_1 = require("./deployments");
|
|
31
|
+
const navigation_1 = require("./navigation");
|
|
32
|
+
const slugs_1 = require("./slugs");
|
|
33
|
+
const project_guard_1 = require("./project-guard");
|
|
34
|
+
/** The routes of the Deployment page, relative to it. */
|
|
35
|
+
exports.DEPLOYMENT_ROUTES = {
|
|
36
|
+
gate: "/gate",
|
|
37
|
+
facts: "/facts",
|
|
38
|
+
steps: "/steps",
|
|
39
|
+
failure: "/failure",
|
|
40
|
+
rollbackBanner: "/rollback-banner",
|
|
41
|
+
rollback: "/rollback",
|
|
42
|
+
buildLog: "/build-log",
|
|
43
|
+
};
|
|
44
|
+
const ID_PARAMETER = "id";
|
|
45
|
+
const PAGE_PATTERN = (0, slugs_1.detailPageSlug)(`deployment/:${ID_PARAMETER}`);
|
|
46
|
+
const LIVE_MAX_RATE_S = 2;
|
|
47
|
+
const FACT_ROWS = 8;
|
|
48
|
+
const HTTP_NOT_FOUND = 404;
|
|
49
|
+
function routeUrl(path) {
|
|
50
|
+
return (0, page_1.pageRoutePath)((0, slugs_1.detailPageSlug)(`deployment/{{params.${ID_PARAMETER}}}`), path);
|
|
51
|
+
}
|
|
52
|
+
function deploymentRoute(id, path) {
|
|
53
|
+
return (0, page_1.pageRoutePath)((0, slugs_1.deploymentPageSlug)(id), path);
|
|
54
|
+
}
|
|
55
|
+
function notFound() {
|
|
56
|
+
return new interface_api_1.HTTPResult(HTTP_NOT_FOUND, {
|
|
57
|
+
message: "$dms_antelope_cloud.errors.deployment_not_found",
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
const READS_IN_FLIGHT = new Map();
|
|
61
|
+
async function readDetail(tenantId, id) {
|
|
62
|
+
const access = await (0, project_guard_1.projectAccess)(tenantId);
|
|
63
|
+
if (!access)
|
|
64
|
+
return null;
|
|
65
|
+
const read = await (0, cloud_1.readCloud)(access.connection, (api) => (0, ledger_1.readDeployment)(api, access.projectId, id));
|
|
66
|
+
if (read.kind === "ok" &&
|
|
67
|
+
read.value &&
|
|
68
|
+
!lifecycle_1.LIFECYCLE[read.value.phase].terminal) {
|
|
69
|
+
(0, follow_1.follow)(tenantId, access.connection, [id]);
|
|
70
|
+
}
|
|
71
|
+
return read;
|
|
72
|
+
}
|
|
73
|
+
function sharedDetail(tenantId, id) {
|
|
74
|
+
const key = JSON.stringify([tenantId, id]);
|
|
75
|
+
const pending = READS_IN_FLIGHT.get(key);
|
|
76
|
+
if (pending)
|
|
77
|
+
return pending;
|
|
78
|
+
const read = readDetail(tenantId, id).finally(() => READS_IN_FLIGHT.delete(key));
|
|
79
|
+
READS_IN_FLIGHT.set(key, read);
|
|
80
|
+
return read;
|
|
81
|
+
}
|
|
82
|
+
async function answerFor(tenantId, id, answer, empty) {
|
|
83
|
+
const read = await sharedDetail(tenantId, id);
|
|
84
|
+
if (read?.kind !== "ok")
|
|
85
|
+
return empty;
|
|
86
|
+
return read.value ? answer(read.value) : notFound();
|
|
87
|
+
}
|
|
88
|
+
function liveList(title, path, skeletonCount) {
|
|
89
|
+
return (0, key_value_list_1.KeyValueList)({
|
|
90
|
+
title,
|
|
91
|
+
fetchUrl: routeUrl(path),
|
|
92
|
+
realtimeTopic: follow_1.DEPLOYMENTS_TOPIC,
|
|
93
|
+
skeletonCount,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function liveBanner(path) {
|
|
97
|
+
return (0, banner_1.Banner)({ fetchUrl: routeUrl(path), realtimeTopic: follow_1.DEPLOYMENTS_TOPIC });
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* One deployment, live while it runs: its route from Queued to Live, why it
|
|
101
|
+
* failed and what the environment still serves, its facts, and a rollback
|
|
102
|
+
* of its environment to it.
|
|
103
|
+
*/
|
|
104
|
+
let DeploymentPage = class DeploymentPage extends (0, page_1.PageController)("deployment", {
|
|
105
|
+
...(0, navigation_1.navigationEntry)("deployments"),
|
|
106
|
+
displayName: "Deployment",
|
|
107
|
+
urlSlug: `deployment/:${ID_PARAMETER}`,
|
|
108
|
+
hidden: true,
|
|
109
|
+
parent: deployments_1.DeploymentsPage,
|
|
110
|
+
live: { maxRate: LIVE_MAX_RATE_S },
|
|
111
|
+
}) {
|
|
112
|
+
static toolbar = (0, page_toolbar_1.pageToolbar)({ period: false });
|
|
113
|
+
static deployment = (0, project_guard_1.projectGuard)(routeUrl(exports.DEPLOYMENT_ROUTES.gate)).child("found", (0, guard_1.Guard)({
|
|
114
|
+
fetchUrl: routeUrl(exports.DEPLOYMENT_ROUTES.facts),
|
|
115
|
+
when: "notFound",
|
|
116
|
+
fallback: {
|
|
117
|
+
title: "No such deployment",
|
|
118
|
+
description: "This project ran no deployment with this id.",
|
|
119
|
+
icon: "i-ph-cloud-slash",
|
|
120
|
+
actions: [
|
|
121
|
+
{ label: "All deployments", to: (0, slugs_1.modulePageSlug)("deployments") },
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
})
|
|
125
|
+
.child("failure", liveBanner(exports.DEPLOYMENT_ROUTES.failure))
|
|
126
|
+
.child("build-log", (0, custom_1.CustomComponent)("AntelopeCloudBuildLog")
|
|
127
|
+
.options({
|
|
128
|
+
fetchUrl: routeUrl(exports.DEPLOYMENT_ROUTES.buildLog),
|
|
129
|
+
routePattern: PAGE_PATTERN,
|
|
130
|
+
openQuery: content_1.BUILD_LOG_QUERY,
|
|
131
|
+
})
|
|
132
|
+
.meta({
|
|
133
|
+
name: "$dms_antelope_cloud.build_log.name",
|
|
134
|
+
description: "$dms_antelope_cloud.build_log.description",
|
|
135
|
+
icon: "i-ph-terminal-window",
|
|
136
|
+
}))
|
|
137
|
+
.child("rollback", liveBanner(exports.DEPLOYMENT_ROUTES.rollbackBanner))
|
|
138
|
+
.child("content", (0, grid_1.Grid)().child("row", (0, grid_1.GridRow)()
|
|
139
|
+
.child("steps", liveList("Route", exports.DEPLOYMENT_ROUTES.steps, lifecycle_1.STEPS.length))
|
|
140
|
+
.child("facts", liveList("Details", exports.DEPLOYMENT_ROUTES.facts, FACT_ROWS)))));
|
|
141
|
+
async gate() {
|
|
142
|
+
return (0, project_guard_1.readProjectGate)(this.tenantId);
|
|
143
|
+
}
|
|
144
|
+
async facts(id) {
|
|
145
|
+
return answerFor(this.tenantId, id, (detail) => ({
|
|
146
|
+
items: [
|
|
147
|
+
...(0, content_1.factItems)(detail),
|
|
148
|
+
{
|
|
149
|
+
id: "logs",
|
|
150
|
+
label: "Logs",
|
|
151
|
+
value: `View ${detail.environment.name} logs`,
|
|
152
|
+
type: "link",
|
|
153
|
+
to: `${(0, slugs_1.modulePageSlug)("logs")}?environment=${encodeURIComponent(detail.environment.id)}`,
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
}), { items: [] });
|
|
157
|
+
}
|
|
158
|
+
async steps(id) {
|
|
159
|
+
return answerFor(this.tenantId, id, (detail) => ({ items: (0, content_1.stepItems)(detail) }), { items: [] });
|
|
160
|
+
}
|
|
161
|
+
async failure(id) {
|
|
162
|
+
return answerFor(this.tenantId, id, (detail) => (0, content_1.failureBanner)(detail, (0, slugs_1.deploymentPageSlug)(detail.id)), null);
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* The end of the log of the deployment's failed build, read from
|
|
166
|
+
* AntelopeJS Cloud each time the viewer asks. Nothing is read from the
|
|
167
|
+
* Cloud's logs for a deployment whose builds did not fail.
|
|
168
|
+
*/
|
|
169
|
+
async buildLog(id) {
|
|
170
|
+
const access = await (0, project_guard_1.projectAccess)(this.tenantId);
|
|
171
|
+
const detail = await sharedDetail(this.tenantId, id);
|
|
172
|
+
if (!access || detail?.kind !== "ok")
|
|
173
|
+
return { state: "unreachable" };
|
|
174
|
+
if (!detail.value)
|
|
175
|
+
return notFound();
|
|
176
|
+
const buildId = detail.value.failure?.buildId ?? null;
|
|
177
|
+
if (buildId === null)
|
|
178
|
+
return { state: "none" };
|
|
179
|
+
const log = await (0, cloud_1.readCloud)(access.connection, (api) => (0, build_log_1.readBuildLog)(api, buildId));
|
|
180
|
+
if (log.kind === "ok")
|
|
181
|
+
return { state: "lines", ...log.value };
|
|
182
|
+
if (log.kind === "revoked" || log.kind === "forbidden") {
|
|
183
|
+
throw (0, project_guard_1.refuseRead)(log.kind);
|
|
184
|
+
}
|
|
185
|
+
return { state: log.kind === "missing" ? "gone" : "unreachable" };
|
|
186
|
+
}
|
|
187
|
+
async readRollbackBanner(id) {
|
|
188
|
+
return answerFor(this.tenantId, id, (detail) => (0, content_1.rollbackBanner)(detail, deploymentRoute(detail.id, exports.DEPLOYMENT_ROUTES.rollback)), null);
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Rolls the deployment's environment back to it. Answers `{}` once every
|
|
192
|
+
* service moved. A refused plan, and a rollback that moved some services
|
|
193
|
+
* only (`rollback_partial`: pressing it again finishes it), answer 409
|
|
194
|
+
* with the refusal's key.
|
|
195
|
+
*/
|
|
196
|
+
async rollback(id) {
|
|
197
|
+
const access = await (0, project_guard_1.requireProject)(this.tenantId);
|
|
198
|
+
const read = await (0, cloud_1.readCloud)(access.connection, (api) => (0, ledger_1.rollBack)(api, access.projectId, id));
|
|
199
|
+
await (0, follow_1.announceDeployments)(this.tenantId);
|
|
200
|
+
if (read.kind !== "ok")
|
|
201
|
+
throw (0, project_guard_1.refuseRead)(read.kind);
|
|
202
|
+
if (read.value.kind === "refused")
|
|
203
|
+
throw (0, project_guard_1.refuse)(read.value.reason);
|
|
204
|
+
if (read.value.kind === "partial")
|
|
205
|
+
throw (0, project_guard_1.refuse)("rollback_partial");
|
|
206
|
+
return {};
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
exports.DeploymentPage = DeploymentPage;
|
|
210
|
+
__decorate([
|
|
211
|
+
(0, interface_api_1.Get)(exports.DEPLOYMENT_ROUTES.gate),
|
|
212
|
+
__metadata("design:type", Function),
|
|
213
|
+
__metadata("design:paramtypes", []),
|
|
214
|
+
__metadata("design:returntype", Promise)
|
|
215
|
+
], DeploymentPage.prototype, "gate", null);
|
|
216
|
+
__decorate([
|
|
217
|
+
(0, interface_api_1.Get)(exports.DEPLOYMENT_ROUTES.facts),
|
|
218
|
+
__param(0, (0, interface_api_1.Parameter)(ID_PARAMETER, "param")),
|
|
219
|
+
__metadata("design:type", Function),
|
|
220
|
+
__metadata("design:paramtypes", [String]),
|
|
221
|
+
__metadata("design:returntype", Promise)
|
|
222
|
+
], DeploymentPage.prototype, "facts", null);
|
|
223
|
+
__decorate([
|
|
224
|
+
(0, interface_api_1.Get)(exports.DEPLOYMENT_ROUTES.steps),
|
|
225
|
+
__param(0, (0, interface_api_1.Parameter)(ID_PARAMETER, "param")),
|
|
226
|
+
__metadata("design:type", Function),
|
|
227
|
+
__metadata("design:paramtypes", [String]),
|
|
228
|
+
__metadata("design:returntype", Promise)
|
|
229
|
+
], DeploymentPage.prototype, "steps", null);
|
|
230
|
+
__decorate([
|
|
231
|
+
(0, interface_api_1.Get)(exports.DEPLOYMENT_ROUTES.failure),
|
|
232
|
+
__param(0, (0, interface_api_1.Parameter)(ID_PARAMETER, "param")),
|
|
233
|
+
__metadata("design:type", Function),
|
|
234
|
+
__metadata("design:paramtypes", [String]),
|
|
235
|
+
__metadata("design:returntype", Promise)
|
|
236
|
+
], DeploymentPage.prototype, "failure", null);
|
|
237
|
+
__decorate([
|
|
238
|
+
(0, interface_api_1.Get)(exports.DEPLOYMENT_ROUTES.buildLog),
|
|
239
|
+
__param(0, (0, interface_api_1.Parameter)(ID_PARAMETER, "param")),
|
|
240
|
+
__metadata("design:type", Function),
|
|
241
|
+
__metadata("design:paramtypes", [String]),
|
|
242
|
+
__metadata("design:returntype", Promise)
|
|
243
|
+
], DeploymentPage.prototype, "buildLog", null);
|
|
244
|
+
__decorate([
|
|
245
|
+
(0, interface_api_1.Get)(exports.DEPLOYMENT_ROUTES.rollbackBanner),
|
|
246
|
+
__param(0, (0, interface_api_1.Parameter)(ID_PARAMETER, "param")),
|
|
247
|
+
__metadata("design:type", Function),
|
|
248
|
+
__metadata("design:paramtypes", [String]),
|
|
249
|
+
__metadata("design:returntype", Promise)
|
|
250
|
+
], DeploymentPage.prototype, "readRollbackBanner", null);
|
|
251
|
+
__decorate([
|
|
252
|
+
(0, interface_api_1.Post)(exports.DEPLOYMENT_ROUTES.rollback),
|
|
253
|
+
__param(0, (0, interface_api_1.Parameter)(ID_PARAMETER, "param")),
|
|
254
|
+
__metadata("design:type", Function),
|
|
255
|
+
__metadata("design:paramtypes", [String]),
|
|
256
|
+
__metadata("design:returntype", Promise)
|
|
257
|
+
], DeploymentPage.prototype, "rollback", null);
|
|
258
|
+
exports.DeploymentPage = DeploymentPage = __decorate([
|
|
259
|
+
(0, page_1.RegisterPage)()
|
|
260
|
+
], DeploymentPage);
|
|
261
|
+
//# sourceMappingURL=deployment.js.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type QueryValue } from "@antelopejs/interface-api";
|
|
2
|
+
import { type PublishSteps } from "../deployments/cloud-steps";
|
|
3
|
+
import { type DeploymentRows } from "../deployments/content";
|
|
4
|
+
import { type EnvironmentsLive } from "../deployments/live";
|
|
5
|
+
import { type ProjectGate } from "./project-guard";
|
|
6
|
+
/** The routes of the Deployments page, relative to it. */
|
|
7
|
+
export declare const DEPLOYMENTS_ROUTES: {
|
|
8
|
+
readonly gate: "/gate";
|
|
9
|
+
readonly list: "/list";
|
|
10
|
+
readonly publishSteps: "/publish-steps";
|
|
11
|
+
readonly environments: "/environments";
|
|
12
|
+
};
|
|
13
|
+
declare const DeploymentsPage_base: {
|
|
14
|
+
new (...args: any[]): {};
|
|
15
|
+
extend: <T extends import("@antelopejs/interface-api").ControllerClass>(this: T, location: string) => T;
|
|
16
|
+
location: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Every deployment AntelopeJS Cloud ran for the connected project, newest
|
|
20
|
+
* first, live while one runs: In progress, Failed and Rollbacks tabs, an
|
|
21
|
+
* environment filter from `?environment=`, and a search.
|
|
22
|
+
*/
|
|
23
|
+
export declare class DeploymentsPage extends DeploymentsPage_base {
|
|
24
|
+
static toolbar: import("@antelopejs/interface-dms").ComponentBuilder<import("@antelopejs/interface-dms/base").PageToolbarProps>;
|
|
25
|
+
static live: import("@antelopejs/interface-dms").ComponentBuilder<unknown>;
|
|
26
|
+
static deployments: import("@antelopejs/interface-dms").ComponentBuilder<import("@antelopejs/interface-dms/base").GuardOptions>;
|
|
27
|
+
/** The DMS workspace of the request, bound by the page's registration. */
|
|
28
|
+
tenantId: string;
|
|
29
|
+
gate(): Promise<ProjectGate>;
|
|
30
|
+
/**
|
|
31
|
+
* The rows the table's filters let through. Following the deployments
|
|
32
|
+
* still running keeps the page live; a failed read answers no row, and
|
|
33
|
+
* the Connection page says why.
|
|
34
|
+
*/
|
|
35
|
+
list(stage: QueryValue, environmentId: QueryValue, triggerKind: QueryValue): Promise<DeploymentRows>;
|
|
36
|
+
/**
|
|
37
|
+
* The four Cloud steps of a publish that pushed `commit` to the branch of
|
|
38
|
+
* the environment named `environment`: why they cannot be followed,
|
|
39
|
+
* `waiting` until the Cloud runs a deployment of the commit, then that
|
|
40
|
+
* deployment's steps, and what visitors see once it failed.
|
|
41
|
+
*/
|
|
42
|
+
readPublishSteps(environment: QueryValue, commit: QueryValue): Promise<PublishSteps>;
|
|
43
|
+
/** Each environment of the project with the version it serves, for the "What's live" widget. */
|
|
44
|
+
readEnvironments(): Promise<EnvironmentsLive>;
|
|
45
|
+
}
|
|
46
|
+
export {};
|