@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.
Files changed (224) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +448 -0
  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 -4
@@ -0,0 +1,327 @@
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.VariablesPage = void 0;
49
+ const interface_api_1 = require("@antelopejs/interface-api");
50
+ const banner_1 = require("@antelopejs/interface-dms/base/banner");
51
+ const default_types_1 = require("@antelopejs/interface-dms/base/data-types/default-types");
52
+ const layouts_1 = require("@antelopejs/interface-dms/base/layouts");
53
+ const table_view_1 = require("@antelopejs/interface-dms/base/table-view");
54
+ const page_1 = require("@antelopejs/interface-dms/page");
55
+ const announce_1 = require("../connection/announce");
56
+ const current_1 = require("../connection/current");
57
+ const actions = __importStar(require("../variables/actions"));
58
+ const content = __importStar(require("../variables/content"));
59
+ const decide_1 = require("../variables/decide");
60
+ const decided_dialog_1 = require("../variables/decided-dialog");
61
+ const content_1 = require("../variables/content");
62
+ const dialogs = __importStar(require("../variables/dialogs"));
63
+ const model_1 = require("../variables/model");
64
+ const project_config_1 = require("../variables/project-config");
65
+ const read_1 = require("../variables/read");
66
+ const navigation_1 = require("./navigation");
67
+ const query_1 = require("./query");
68
+ function fetchedBanner(route) {
69
+ return (0, banner_1.Banner)({
70
+ fetchUrl: (0, content_1.variablesRoute)(route),
71
+ realtimeTopic: announce_1.CONNECTION_TOPIC,
72
+ });
73
+ }
74
+ const SET_VALUE = {
75
+ id: "set-value",
76
+ label: "Set value",
77
+ icon: "i-ph-pencil-simple",
78
+ isVisible: true,
79
+ showLabel: true,
80
+ isDefault: true,
81
+ target: {
82
+ type: "api",
83
+ url: (0, content_1.rowRoute)(content_1.VARIABLES_ROUTES.value),
84
+ method: "POST",
85
+ successMessage: "Value saved",
86
+ },
87
+ confirm: { from: (0, content_1.rowRoute)(content_1.VARIABLES_ROUTES.valueDialog) },
88
+ rule: {
89
+ field: "state",
90
+ notEquals: "wired",
91
+ },
92
+ };
93
+ const REMOVE = {
94
+ id: "remove",
95
+ label: "Remove",
96
+ icon: "i-ph-trash",
97
+ color: "error",
98
+ target: {
99
+ type: "api",
100
+ url: (0, content_1.rowRoute)(content_1.VARIABLES_ROUTES.remove),
101
+ method: "POST",
102
+ successMessage: "Variable removed",
103
+ },
104
+ confirm: { from: (0, content_1.rowRoute)(content_1.VARIABLES_ROUTES.removeDialog) },
105
+ rule: {
106
+ field: "state",
107
+ notEquals: "missing",
108
+ },
109
+ };
110
+ const text = () => new default_types_1.DefaultDataTypes.StringType();
111
+ /**
112
+ * The variables and secrets of each environment of the connected project:
113
+ * those AntelopeJS Cloud wires from a resource, those the owner set, and
114
+ * those a service lacks: the `envOverrides` keys of the app, and the
115
+ * variables a dashboard reads. Secret values are write-only: no answer of
116
+ * the page carries one, but the setup token, in the answer of the action
117
+ * that generates it.
118
+ */
119
+ let VariablesPage = class VariablesPage extends (0, page_1.PageController)("variables", (0, navigation_1.navigationEntry)("variables"), (0, layouts_1.DefaultLayout)({
120
+ headerActions: [
121
+ {
122
+ id: "add-variable",
123
+ label: "Add variable",
124
+ icon: "i-ph-plus",
125
+ color: "primary",
126
+ target: {
127
+ type: "api",
128
+ url: (0, content_1.variablesRoute)(content_1.VARIABLES_ROUTES.add),
129
+ method: "POST",
130
+ successMessage: "Variable added",
131
+ },
132
+ confirm: { from: (0, content_1.variablesRoute)(content_1.VARIABLES_ROUTES.addDialog) },
133
+ },
134
+ ],
135
+ })) {
136
+ static status = fetchedBanner(content_1.VARIABLES_ROUTES.status);
137
+ static hardcoded = fetchedBanner(content_1.VARIABLES_ROUTES.hardcoded);
138
+ static environments = fetchedBanner(content_1.VARIABLES_ROUTES.environments);
139
+ static variables = table_view_1.TableView.fromSource({
140
+ fetchUrl: (0, content_1.variablesRoute)(content_1.VARIABLES_ROUTES.list),
141
+ rowIdKey: "ref",
142
+ realtimeTopic: announce_1.CONNECTION_TOPIC,
143
+ capabilities: { search: true, filter: true },
144
+ queryParamFilters: {
145
+ environment: {
146
+ field: "environmentName",
147
+ visible: true,
148
+ label: "Environment",
149
+ },
150
+ },
151
+ searchPlaceholder: "Search variables",
152
+ columns: {
153
+ key: {
154
+ name: "Variable",
155
+ type: text(),
156
+ order: 0,
157
+ display: new table_view_1.DefaultDisplays.TwoLineDisplay({ subField: "location" }),
158
+ },
159
+ value: {
160
+ name: "Value",
161
+ type: text(),
162
+ order: 1,
163
+ display: new table_view_1.DefaultDisplays.TextDisplay({ toneField: "valueTone" }),
164
+ },
165
+ source: {
166
+ name: "Source",
167
+ type: text(),
168
+ order: 2,
169
+ display: new table_view_1.DefaultDisplays.StatusPillDisplay({
170
+ toneField: "sourceTone",
171
+ subField: "sourceDetail",
172
+ }),
173
+ },
174
+ feeds: {
175
+ name: "Feeds",
176
+ type: text(),
177
+ order: 3,
178
+ display: new table_view_1.DefaultDisplays.TwoLineDisplay({
179
+ emptyLabel: "Not in envOverrides",
180
+ }),
181
+ },
182
+ },
183
+ emptyStates: {
184
+ firstRun: {
185
+ title: "No variable yet",
186
+ description: "This project's environments hold no variable, and envOverrides names none.",
187
+ },
188
+ },
189
+ rowActions: { custom: [SET_VALUE, REMOVE] },
190
+ });
191
+ async read() {
192
+ return (0, read_1.readVariables)(await (0, current_1.readConnection)(this.tenantId));
193
+ }
194
+ async readStatus() {
195
+ return content.statusBanner(await this.read());
196
+ }
197
+ async readHardcoded() {
198
+ return content.hardcodedBanner((0, project_config_1.hardcodedSecrets)(await (0, project_config_1.readProjectConfig)()));
199
+ }
200
+ async readEnvironments() {
201
+ return content.environmentsBanner(await this.read());
202
+ }
203
+ async list(search, environment) {
204
+ return content.tableAnswer(await this.read(), {
205
+ search: (0, query_1.queryText)(search),
206
+ environment: (0, query_1.queryText)(environment),
207
+ });
208
+ }
209
+ async readAddDialog() {
210
+ return dialogs.addDialog(await this.read());
211
+ }
212
+ async add(body) {
213
+ await actions.addVariable(this.tenantId, actions.parseNewVariable(body));
214
+ return {};
215
+ }
216
+ async readValueDialog(ref) {
217
+ return dialogs.valueDialog(await this.read(), (0, model_1.parseRef)(ref));
218
+ }
219
+ async setValue(ref, body) {
220
+ await actions.setValue(this.tenantId, ref, actions.parseValueBody(body));
221
+ return {};
222
+ }
223
+ async readRemoveDialog(ref) {
224
+ return dialogs.removeDialog(await this.read(), (0, model_1.parseRef)(ref));
225
+ }
226
+ async remove(ref) {
227
+ await actions.removeVariable(this.tenantId, ref);
228
+ return {};
229
+ }
230
+ async readDecidedDialog(environment) {
231
+ return (0, decided_dialog_1.decidedDialog)(await this.read(), (0, query_1.queryText)(environment) ?? "");
232
+ }
233
+ /**
234
+ * Sets what AntelopeJS Cloud can decide on an environment. The answer
235
+ * carries the setup token when this run generated it, and no other value.
236
+ */
237
+ async decide(environment) {
238
+ return (0, decide_1.setDecided)(this.tenantId, (0, query_1.queryText)(environment) ?? "");
239
+ }
240
+ };
241
+ exports.VariablesPage = VariablesPage;
242
+ __decorate([
243
+ (0, interface_api_1.Get)(content_1.VARIABLES_ROUTES.status),
244
+ __metadata("design:type", Function),
245
+ __metadata("design:paramtypes", []),
246
+ __metadata("design:returntype", Promise)
247
+ ], VariablesPage.prototype, "readStatus", null);
248
+ __decorate([
249
+ (0, interface_api_1.Get)(content_1.VARIABLES_ROUTES.hardcoded),
250
+ __metadata("design:type", Function),
251
+ __metadata("design:paramtypes", []),
252
+ __metadata("design:returntype", Promise)
253
+ ], VariablesPage.prototype, "readHardcoded", null);
254
+ __decorate([
255
+ (0, interface_api_1.Get)(content_1.VARIABLES_ROUTES.environments),
256
+ __metadata("design:type", Function),
257
+ __metadata("design:paramtypes", []),
258
+ __metadata("design:returntype", Promise)
259
+ ], VariablesPage.prototype, "readEnvironments", null);
260
+ __decorate([
261
+ (0, interface_api_1.Get)(content_1.VARIABLES_ROUTES.list),
262
+ __param(0, (0, interface_api_1.Parameter)("search", "query")),
263
+ __param(1, (0, interface_api_1.Parameter)("filter_environmentName", "query")),
264
+ __metadata("design:type", Function),
265
+ __metadata("design:paramtypes", [Object, Object]),
266
+ __metadata("design:returntype", Promise)
267
+ ], VariablesPage.prototype, "list", null);
268
+ __decorate([
269
+ (0, interface_api_1.Get)(content_1.VARIABLES_ROUTES.addDialog),
270
+ __metadata("design:type", Function),
271
+ __metadata("design:paramtypes", []),
272
+ __metadata("design:returntype", Promise)
273
+ ], VariablesPage.prototype, "readAddDialog", null);
274
+ __decorate([
275
+ (0, interface_api_1.Post)(content_1.VARIABLES_ROUTES.add),
276
+ __param(0, (0, interface_api_1.JSONBody)()),
277
+ __metadata("design:type", Function),
278
+ __metadata("design:paramtypes", [Object]),
279
+ __metadata("design:returntype", Promise)
280
+ ], VariablesPage.prototype, "add", null);
281
+ __decorate([
282
+ (0, interface_api_1.Get)(content_1.VARIABLES_ROUTES.valueDialog),
283
+ __param(0, (0, interface_api_1.Parameter)("ref")),
284
+ __metadata("design:type", Function),
285
+ __metadata("design:paramtypes", [String]),
286
+ __metadata("design:returntype", Promise)
287
+ ], VariablesPage.prototype, "readValueDialog", null);
288
+ __decorate([
289
+ (0, interface_api_1.Post)(content_1.VARIABLES_ROUTES.value),
290
+ __param(0, (0, interface_api_1.Parameter)("ref")),
291
+ __param(1, (0, interface_api_1.JSONBody)()),
292
+ __metadata("design:type", Function),
293
+ __metadata("design:paramtypes", [String, Object]),
294
+ __metadata("design:returntype", Promise)
295
+ ], VariablesPage.prototype, "setValue", null);
296
+ __decorate([
297
+ (0, interface_api_1.Get)(content_1.VARIABLES_ROUTES.removeDialog),
298
+ __param(0, (0, interface_api_1.Parameter)("ref")),
299
+ __metadata("design:type", Function),
300
+ __metadata("design:paramtypes", [String]),
301
+ __metadata("design:returntype", Promise)
302
+ ], VariablesPage.prototype, "readRemoveDialog", null);
303
+ __decorate([
304
+ (0, interface_api_1.Post)(content_1.VARIABLES_ROUTES.remove),
305
+ __param(0, (0, interface_api_1.Parameter)("ref")),
306
+ __metadata("design:type", Function),
307
+ __metadata("design:paramtypes", [String]),
308
+ __metadata("design:returntype", Promise)
309
+ ], VariablesPage.prototype, "remove", null);
310
+ __decorate([
311
+ (0, interface_api_1.Get)(content_1.VARIABLES_ROUTES.decidedDialog),
312
+ __param(0, (0, interface_api_1.Parameter)("environment", "query")),
313
+ __metadata("design:type", Function),
314
+ __metadata("design:paramtypes", [Object]),
315
+ __metadata("design:returntype", Promise)
316
+ ], VariablesPage.prototype, "readDecidedDialog", null);
317
+ __decorate([
318
+ (0, interface_api_1.Post)(content_1.VARIABLES_ROUTES.decided),
319
+ __param(0, (0, interface_api_1.Parameter)("environment", "query")),
320
+ __metadata("design:type", Function),
321
+ __metadata("design:paramtypes", [Object]),
322
+ __metadata("design:returntype", Promise)
323
+ ], VariablesPage.prototype, "decide", null);
324
+ exports.VariablesPage = VariablesPage = __decorate([
325
+ (0, page_1.RegisterPage)()
326
+ ], VariablesPage);
327
+ //# sourceMappingURL=variables.js.map
@@ -0,0 +1,26 @@
1
+ import { HTTPResult } from "@antelopejs/interface-api";
2
+ import type { CodeBlockResponse } from "@antelopejs/interface-dms/base/code-block";
3
+ import { type KeyValueListItem } from "@antelopejs/interface-dms/base/key-value-list";
4
+ import { type VersionDetail } from "../git/versions";
5
+ declare const VersionPage_base: {
6
+ new (...args: any[]): {};
7
+ extend: <T extends import("@antelopejs/interface-api").ControllerClass>(this: T, location: string) => T;
8
+ location: string;
9
+ };
10
+ /**
11
+ * One published version: its tag, its release notes, the files and commits
12
+ * since the published version before it, and the environments it is on. A
13
+ * version whose tag origin lacks answers 404, as one that does not exist.
14
+ */
15
+ export declare class VersionPage extends VersionPage_base {
16
+ static version: import("@antelopejs/interface-dms").ComponentBuilder<import("@antelopejs/interface-dms/base").GuardOptions>;
17
+ details(raw: string): Promise<VersionDetail | HTTPResult>;
18
+ facts(raw: string): Promise<{
19
+ items: KeyValueListItem[];
20
+ } | HTTPResult>;
21
+ releaseNotes(raw: string): Promise<CodeBlockResponse | HTTPResult>;
22
+ environments(raw: string): Promise<{
23
+ items: KeyValueListItem[];
24
+ } | HTTPResult>;
25
+ }
26
+ export {};
@@ -0,0 +1,214 @@
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.VersionPage = void 0;
16
+ const interface_api_1 = require("@antelopejs/interface-api");
17
+ const code_block_1 = require("@antelopejs/interface-dms/base/code-block");
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_1 = require("@antelopejs/interface-dms/page");
23
+ const config_1 = require("../config");
24
+ const refs_1 = require("../git/refs");
25
+ const repository_1 = require("../git/repository");
26
+ const versions_1 = require("../git/versions");
27
+ const navigation_1 = require("./navigation");
28
+ const slugs_1 = require("./slugs");
29
+ const versions_2 = require("./versions");
30
+ const DETAILS_ROUTE = "/details";
31
+ const FACTS_ROUTE = "/facts";
32
+ const NOTES_ROUTE = "/release-notes";
33
+ const ENVIRONMENTS_ROUTE = "/environments";
34
+ const VERSION_NUMBER = /^[1-9]\d{0,8}$/u;
35
+ const NUMBER_PARAMETER = "number";
36
+ const FILES_SPAN = 2;
37
+ const FACT_ROWS = 6;
38
+ /** The page's routes as a block reads them, the version number taken from the page URL. */
39
+ function routeUrl(route) {
40
+ return (0, page_1.pageRoutePath)((0, slugs_1.detailPageSlug)("version/{{params.number}}"), route);
41
+ }
42
+ function versionPage(number) {
43
+ return `${(0, slugs_1.detailPageSlug)("version")}/${number}`;
44
+ }
45
+ function notFound() {
46
+ return new interface_api_1.HTTPResult(404, {
47
+ message: "$dms_antelope_cloud.errors.version_not_found",
48
+ });
49
+ }
50
+ /** The published version a page URL names, or `null` when there is none. */
51
+ async function readVersionAt(raw) {
52
+ if (!VERSION_NUMBER.test(raw))
53
+ return null;
54
+ const read = await (0, repository_1.readRepository)((0, config_1.cloudSettings)().repositoryPath, "recent");
55
+ return read.kind === "read" ? (0, versions_1.versionAt)(read.snapshot, Number(raw)) : null;
56
+ }
57
+ function factItems({ summary, previous }) {
58
+ return [
59
+ { id: "tag", label: "Tag", value: summary.tag, type: "mono", copy: true },
60
+ {
61
+ id: "commit",
62
+ label: "Commit",
63
+ value: (0, refs_1.shortSha)(summary.commit),
64
+ type: "mono",
65
+ copyValue: summary.commit,
66
+ },
67
+ { id: "message", label: "Message", value: summary.message },
68
+ {
69
+ id: "author",
70
+ label: "Author",
71
+ value: summary.author.name,
72
+ detail: summary.author.email,
73
+ },
74
+ {
75
+ id: "published",
76
+ label: "Published",
77
+ value: summary.publishedAt,
78
+ type: "date",
79
+ },
80
+ previous
81
+ ? {
82
+ id: "previous",
83
+ label: "Previous",
84
+ value: `${previous.name} · ${previous.tag}`,
85
+ type: "link",
86
+ to: versionPage(previous.number),
87
+ }
88
+ : { id: "previous", label: "Previous", value: "None, the first version" },
89
+ ];
90
+ }
91
+ function environmentItems({ summary }) {
92
+ return summary.environments.map((name) => ({
93
+ id: name,
94
+ label: name,
95
+ value: (0, refs_1.environmentBranch)(name),
96
+ type: "mono",
97
+ }));
98
+ }
99
+ /**
100
+ * One published version: its tag, its release notes, the files and commits
101
+ * since the published version before it, and the environments it is on. A
102
+ * version whose tag origin lacks answers 404, as one that does not exist.
103
+ */
104
+ let VersionPage = class VersionPage extends (0, page_1.PageController)("version", {
105
+ ...(0, navigation_1.navigationEntry)("versions"),
106
+ displayName: "Version",
107
+ urlSlug: `version/:${NUMBER_PARAMETER}`,
108
+ hidden: true,
109
+ parent: versions_2.VersionsPage,
110
+ }) {
111
+ static version = (0, guard_1.Guard)({
112
+ fetchUrl: routeUrl(FACTS_ROUTE),
113
+ when: "notFound",
114
+ fallback: {
115
+ title: "No such version",
116
+ description: "This repository has published no version with this number.",
117
+ icon: "i-ph-tag",
118
+ },
119
+ }).child("content", (0, grid_1.Grid)()
120
+ .child("summary", (0, grid_1.GridRow)()
121
+ .child("files", (0, custom_1.CustomComponent)("AntelopeCloudChangedFiles")
122
+ .options({
123
+ fetchUrl: routeUrl(DETAILS_ROUTE),
124
+ field: "files",
125
+ routePattern: (0, slugs_1.detailPageSlug)(`version/:${NUMBER_PARAMETER}`),
126
+ })
127
+ .meta({
128
+ name: "$dms_antelope_cloud.changed_files.name",
129
+ description: "$dms_antelope_cloud.changed_files.description",
130
+ icon: "i-ph-file-code",
131
+ }), { colSpan: FILES_SPAN })
132
+ .child("details", (0, key_value_list_1.KeyValueList)({
133
+ title: "Details",
134
+ fetchUrl: routeUrl(FACTS_ROUTE),
135
+ skeletonCount: FACT_ROWS,
136
+ })))
137
+ .child("notes", (0, grid_1.GridRow)()
138
+ .child("releaseNotes", (0, guard_1.Guard)({
139
+ fetchUrl: routeUrl(NOTES_ROUTE),
140
+ field: "code",
141
+ fallback: {
142
+ title: "No release notes",
143
+ description: "This version was published without release notes.",
144
+ icon: "i-ph-note-blank",
145
+ },
146
+ }).child("text", (0, code_block_1.CodeBlock)({
147
+ title: "Release notes",
148
+ fetchUrl: routeUrl(NOTES_ROUTE),
149
+ language: "text",
150
+ wrap: true,
151
+ })), { colSpan: FILES_SPAN })
152
+ .child("environments", (0, key_value_list_1.KeyValueList)({
153
+ title: "Environments",
154
+ fetchUrl: routeUrl(ENVIRONMENTS_ROUTE),
155
+ empty: {
156
+ title: "On no environment",
157
+ description: "No env/* branch points to this version's commit.",
158
+ },
159
+ }))));
160
+ async details(raw) {
161
+ if (!VERSION_NUMBER.test(raw))
162
+ return notFound();
163
+ const read = await (0, repository_1.readRepository)((0, config_1.cloudSettings)().repositoryPath, "recent");
164
+ const detail = read.kind === "read"
165
+ ? await (0, versions_1.readVersion)(read.snapshot, Number(raw))
166
+ : null;
167
+ return detail ?? notFound();
168
+ }
169
+ async facts(raw) {
170
+ const found = await readVersionAt(raw);
171
+ return found ? { items: factItems(found) } : notFound();
172
+ }
173
+ async releaseNotes(raw) {
174
+ const found = await readVersionAt(raw);
175
+ return found ? { code: found.release.notes, language: "text" } : notFound();
176
+ }
177
+ async environments(raw) {
178
+ const found = await readVersionAt(raw);
179
+ return found ? { items: environmentItems(found) } : notFound();
180
+ }
181
+ };
182
+ exports.VersionPage = VersionPage;
183
+ __decorate([
184
+ (0, interface_api_1.Get)(DETAILS_ROUTE),
185
+ __param(0, (0, interface_api_1.Parameter)(NUMBER_PARAMETER)),
186
+ __metadata("design:type", Function),
187
+ __metadata("design:paramtypes", [String]),
188
+ __metadata("design:returntype", Promise)
189
+ ], VersionPage.prototype, "details", null);
190
+ __decorate([
191
+ (0, interface_api_1.Get)(FACTS_ROUTE),
192
+ __param(0, (0, interface_api_1.Parameter)(NUMBER_PARAMETER)),
193
+ __metadata("design:type", Function),
194
+ __metadata("design:paramtypes", [String]),
195
+ __metadata("design:returntype", Promise)
196
+ ], VersionPage.prototype, "facts", null);
197
+ __decorate([
198
+ (0, interface_api_1.Get)(NOTES_ROUTE),
199
+ __param(0, (0, interface_api_1.Parameter)(NUMBER_PARAMETER)),
200
+ __metadata("design:type", Function),
201
+ __metadata("design:paramtypes", [String]),
202
+ __metadata("design:returntype", Promise)
203
+ ], VersionPage.prototype, "releaseNotes", null);
204
+ __decorate([
205
+ (0, interface_api_1.Get)(ENVIRONMENTS_ROUTE),
206
+ __param(0, (0, interface_api_1.Parameter)(NUMBER_PARAMETER)),
207
+ __metadata("design:type", Function),
208
+ __metadata("design:paramtypes", [String]),
209
+ __metadata("design:returntype", Promise)
210
+ ], VersionPage.prototype, "environments", null);
211
+ exports.VersionPage = VersionPage = __decorate([
212
+ (0, page_1.RegisterPage)()
213
+ ], VersionPage);
214
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1,20 @@
1
+ import { type VersionSummary } from "../git/versions";
2
+ /** A version as a row of the Versions table, with the cells it draws as such. */
3
+ export type VersionRow = VersionSummary & {
4
+ readonly shortCommit: string;
5
+ readonly authorName: string;
6
+ };
7
+ declare const VersionsPage_base: {
8
+ new (...args: any[]): {};
9
+ extend: <T extends import("@antelopejs/interface-api").ControllerClass>(this: T, location: string) => T;
10
+ location: string;
11
+ };
12
+ /** Every published version of the project and the environments on each. */
13
+ export declare class VersionsPage extends VersionsPage_base {
14
+ static versions: import("@antelopejs/interface-dms").ComponentBuilder<import("@antelopejs/interface-dms/base").TableViewOptionsSerialized>;
15
+ list(): Promise<{
16
+ results: VersionRow[];
17
+ total: number;
18
+ }>;
19
+ }
20
+ export {};