@plexus-ms/lib 0.122.1 → 0.123.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/dist/bookkeeping.d.ts +0 -8
- package/dist/bookkeeping.d.ts.map +1 -1
- package/dist/bookkeeping.js +2 -15
- package/dist/bookkeeping.js.map +1 -1
- package/dist/compose.d.ts +41 -0
- package/dist/compose.d.ts.map +1 -0
- package/dist/compose.js +169 -0
- package/dist/compose.js.map +1 -0
- package/dist/consumers.d.ts +3 -18
- package/dist/consumers.d.ts.map +1 -1
- package/dist/consumers.js +13 -42
- package/dist/consumers.js.map +1 -1
- package/dist/context.d.ts +6 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +14 -5
- package/dist/context.js.map +1 -1
- package/dist/deploy.d.ts +11 -3
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +181 -117
- package/dist/deploy.js.map +1 -1
- package/dist/doctor.d.ts +121 -15
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +512 -71
- package/dist/doctor.js.map +1 -1
- package/dist/effects.d.ts +3 -0
- package/dist/effects.d.ts.map +1 -1
- package/dist/effects.js.map +1 -1
- package/dist/frontmatter.js +1 -1
- package/dist/frontmatter.js.map +1 -1
- package/dist/index.d.ts +10 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -10
- package/dist/index.js.map +1 -1
- package/dist/io.d.ts +28 -0
- package/dist/io.d.ts.map +1 -1
- package/dist/io.js +86 -4
- package/dist/io.js.map +1 -1
- package/dist/marker.d.ts +22 -5
- package/dist/marker.d.ts.map +1 -1
- package/dist/marker.js +100 -13
- package/dist/marker.js.map +1 -1
- package/dist/model.d.ts +48 -4
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +59 -11
- package/dist/model.js.map +1 -1
- package/dist/need.d.ts +11 -34
- package/dist/need.d.ts.map +1 -1
- package/dist/need.js +92 -54
- package/dist/need.js.map +1 -1
- package/dist/overview.d.ts +25 -0
- package/dist/overview.d.ts.map +1 -1
- package/dist/overview.js +106 -14
- package/dist/overview.js.map +1 -1
- package/dist/propagate.d.ts +3 -3
- package/dist/propagate.d.ts.map +1 -1
- package/dist/propagate.js +8 -6
- package/dist/propagate.js.map +1 -1
- package/dist/requirements.d.ts +1 -1
- package/dist/requirements.d.ts.map +1 -1
- package/dist/requirements.js +6 -5
- package/dist/requirements.js.map +1 -1
- package/dist/standard-index.json +90 -6
- package/dist/take.d.ts +1 -1
- package/dist/take.d.ts.map +1 -1
- package/dist/take.js +6 -25
- package/dist/take.js.map +1 -1
- package/dist/templates.d.ts +21 -0
- package/dist/templates.d.ts.map +1 -0
- package/dist/templates.js +55 -0
- package/dist/templates.js.map +1 -0
- package/dist/update.d.ts +3 -3
- package/dist/update.d.ts.map +1 -1
- package/dist/update.js +58 -71
- package/dist/update.js.map +1 -1
- package/dist/version.d.ts +7 -2
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +17 -2
- package/dist/version.js.map +1 -1
- package/package.json +1 -1
- package/dist/catalog.d.ts +0 -23
- package/dist/catalog.d.ts.map +0 -1
- package/dist/catalog.js +0 -38
- package/dist/catalog.js.map +0 -1
- package/dist/manifest.d.ts +0 -20
- package/dist/manifest.d.ts.map +0 -1
- package/dist/manifest.js +0 -59
- package/dist/manifest.js.map +0 -1
package/dist/bookkeeping.d.ts
CHANGED
|
@@ -5,12 +5,4 @@ export declare const bumpWorkflowRefs: (text: string, version: string) => string
|
|
|
5
5
|
export declare const hasConflictMarkers: (text: string) => boolean;
|
|
6
6
|
/** Whether `git status --porcelain` output shows unmerged entries. */
|
|
7
7
|
export declare const hasUnmergedEntries: (porcelain: string) => boolean;
|
|
8
|
-
/**
|
|
9
|
-
* The marker says which version a unit was brought up to (§ 1.4 PLX). copier
|
|
10
|
-
* re-renders it only when the template's content changed, so a version that
|
|
11
|
-
* touched nothing in a template would leave `plexus:` behind while bumping the
|
|
12
|
-
* answers file; this syncs it to the answers file's `_commit`, which copier
|
|
13
|
-
* always writes. A marker with conflict markers is left to the human.
|
|
14
|
-
*/
|
|
15
|
-
export declare function syncMarker(marker: string, commit: string): string;
|
|
16
8
|
//# sourceMappingURL=bookkeeping.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bookkeeping.d.ts","sourceRoot":"","sources":["../src/bookkeeping.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bookkeeping.d.ts","sourceRoot":"","sources":["../src/bookkeeping.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,yCAAyC,CAAC;AAEnE,4FAA4F;AAC5F,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,EAAE,SAAS,MAAM,KAAG,MACuC,CAAC;AAEzG,8DAA8D;AAC9D,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,KAAG,OAAkC,CAAC;AAErF,sEAAsE;AACtE,eAAO,MAAM,kBAAkB,GAAI,WAAW,MAAM,KAAG,OAA4C,CAAC"}
|
package/dist/bookkeeping.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
// What a repo taking a version writes besides copier's update: the workflow
|
|
2
|
-
// refs moved to the version
|
|
3
|
-
//
|
|
2
|
+
// refs moved to the version. Pure functions from a file's text to its new
|
|
3
|
+
// text; the marker carries no version (§ 1.4 PLX) and is left to copier. The bookkeeping of cutting a
|
|
4
4
|
// version, every other pin the version owns, lives in `@plexus-ms/dev`.
|
|
5
|
-
import { setFrontmatterField } from "./frontmatter.js";
|
|
6
5
|
export const WORKFLOW_REF = 'plexus-ms/tooling/.github/workflows/';
|
|
7
6
|
/** Every `uses: plexus-ms/tooling/.github/workflows/<file>@<ref>` pinned to the version. */
|
|
8
7
|
export const bumpWorkflowRefs = (text, version) => text.replace(/(plexus-ms\/tooling\/\.github\/workflows\/[A-Za-z0-9._-]+)@v?[0-9.]+/g, `$1@${version}`);
|
|
@@ -10,16 +9,4 @@ export const bumpWorkflowRefs = (text, version) => text.replace(/(plexus-ms\/too
|
|
|
10
9
|
export const hasConflictMarkers = (text) => /^<<<<<<< /m.test(text);
|
|
11
10
|
/** Whether `git status --porcelain` output shows unmerged entries. */
|
|
12
11
|
export const hasUnmergedEntries = (porcelain) => /^(UU|AA|DU|UD)/m.test(porcelain);
|
|
13
|
-
/**
|
|
14
|
-
* The marker says which version a unit was brought up to (§ 1.4 PLX). copier
|
|
15
|
-
* re-renders it only when the template's content changed, so a version that
|
|
16
|
-
* touched nothing in a template would leave `plexus:` behind while bumping the
|
|
17
|
-
* answers file; this syncs it to the answers file's `_commit`, which copier
|
|
18
|
-
* always writes. A marker with conflict markers is left to the human.
|
|
19
|
-
*/
|
|
20
|
-
export function syncMarker(marker, commit) {
|
|
21
|
-
if (hasConflictMarkers(marker))
|
|
22
|
-
return marker;
|
|
23
|
-
return setFrontmatterField(marker, 'plexus', commit);
|
|
24
|
-
}
|
|
25
12
|
//# sourceMappingURL=bookkeeping.js.map
|
package/dist/bookkeeping.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bookkeeping.js","sourceRoot":"","sources":["../src/bookkeeping.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,
|
|
1
|
+
{"version":3,"file":"bookkeeping.js","sourceRoot":"","sources":["../src/bookkeeping.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,0EAA0E;AAC1E,sGAAsG;AACtG,wEAAwE;AACxE,MAAM,CAAC,MAAM,YAAY,GAAG,sCAAsC,CAAC;AAEnE,4FAA4F;AAC5F,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAAE,OAAe,EAAU,EAAE,CACxE,IAAI,CAAC,OAAO,CAAC,uEAAuE,EAAE,MAAM,OAAO,EAAE,CAAC,CAAC;AAEzG,8DAA8D;AAC9D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAErF,sEAAsE;AACtE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,SAAiB,EAAW,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** A YAML mapping, every key of which may be absent or of any type. */
|
|
2
|
+
export type Mapping = Record<string, unknown>;
|
|
3
|
+
export interface Compose {
|
|
4
|
+
/** The services by name, same-file `extends` merged in; an entry that is not a mapping is left out. */
|
|
5
|
+
services: Record<string, Mapping>;
|
|
6
|
+
/** The file has a top-level `include`, whose files are not read. */
|
|
7
|
+
includes?: true;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The app service: the one the deploy verb reads the live image and the
|
|
11
|
+
* health status from (§ 6 PLX-Delivery), named `web` by convention.
|
|
12
|
+
*/
|
|
13
|
+
export declare const APP_SERVICE = "web";
|
|
14
|
+
export declare const isMapping: (value: unknown) => value is Mapping;
|
|
15
|
+
/**
|
|
16
|
+
* A compose file from its text. A file that is not YAML compose could read
|
|
17
|
+
* (duplicate keys among them) is a usage error naming the file.
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseCompose(text: string, path: string): Compose;
|
|
20
|
+
/**
|
|
21
|
+
* The deploy verb's placeholder for the image ref (§ 3 PLX-App), in any
|
|
22
|
+
* spelling `${PLEXUS_DEPLOYMENT_IMAGE…}`: the verb pins every one of them to
|
|
23
|
+
* the same ref, so two spellings name the same image.
|
|
24
|
+
*/
|
|
25
|
+
export declare const IMAGE_PLACEHOLDER: RegExp;
|
|
26
|
+
/** An image as the deploy verb will run it: every spelling of the placeholder as one. */
|
|
27
|
+
export declare const normalImage: (image: string) => string;
|
|
28
|
+
/** The app service's healthcheck as the file spells it, if it declares one that is a mapping. */
|
|
29
|
+
export declare function healthcheckOf(compose: Compose): Mapping | undefined;
|
|
30
|
+
/** Compose's truthy spellings of a boolean, any case, quoted or not: `true`, `yes`, `y`, `on`. */
|
|
31
|
+
export declare const truthy: (value: unknown) => boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the healthcheck can ever report healthy (`PLX-App/Healthcheck`):
|
|
34
|
+
* a `test` of its own, a non-empty string or a non-empty list whose first
|
|
35
|
+
* word is not NONE, and not disabled. The deploy waits on it, so anything
|
|
36
|
+
* else cannot be deployed; one that inherits the image's test does not count.
|
|
37
|
+
*/
|
|
38
|
+
export declare function declaresHealthcheck(check: Mapping | undefined): check is Mapping;
|
|
39
|
+
/** A service's labels, from either spelling compose accepts: a mapping, or a list of `key=value`. */
|
|
40
|
+
export declare function labelsOf(service: Mapping): Record<string, string>;
|
|
41
|
+
//# sourceMappingURL=compose.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../src/compose.ts"],"names":[],"mappings":"AAmBA,uEAAuE;AACvE,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE9C,MAAM,WAAW,OAAO;IACtB,uGAAuG;IACvG,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,oEAAoE;IACpE,QAAQ,CAAC,EAAE,IAAI,CAAC;CACjB;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,QAAQ,CAAC;AAEjC,eAAO,MAAM,SAAS,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,OACkB,CAAC;AAEvE;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAYhE;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,QAA4C,CAAC;AAE3E,yFAAyF;AACzF,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,KAAG,MAAwE,CAAC;AAqFrH,iGAAiG;AACjG,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAGnE;AAED,kGAAkG;AAClG,eAAO,MAAM,MAAM,GAAI,OAAO,OAAO,KAAG,OACmE,CAAC;AAE5G;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,GAAG,KAAK,IAAI,OAAO,CAKhF;AAED,qGAAqG;AACrG,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAWjE"}
|
package/dist/compose.js
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
// The one reader of an app's compose file (§ 2 PLX-App), for every verb that
|
|
2
|
+
// looks into one: the deploy verb reads the app service's healthcheck from it
|
|
3
|
+
// before it reaches a host, and doctor runs the compose checks of PLX-App
|
|
4
|
+
// over it. It reads what compose would read as far as plain YAML goes, with
|
|
5
|
+
// anchors and merge keys resolved, and `${…}` interpolation left as written.
|
|
6
|
+
// A service that `extends` another service of the same file is read merged
|
|
7
|
+
// with it, through a chain of such services (`resolveExtends`); services that
|
|
8
|
+
// extend each other in a cycle are an error naming them, as compose refuses
|
|
9
|
+
// them. Not read: the files an `include` names, whose presence is recorded so
|
|
10
|
+
// that a reader can say what it did not read, and a service an `extends`
|
|
11
|
+
// takes from another file (`file:`), where the chain stops and the service is
|
|
12
|
+
// read as written. Where the merge differs from compose's: a list both sides
|
|
13
|
+
// give is de-duplicated by value as written, where compose first normalizes
|
|
14
|
+
// it (so `.env` and `./.env` are two entries to both, while `"3000"` and
|
|
15
|
+
// `3000` are one port to both), and volumes and devices are not merged by
|
|
16
|
+
// their target in the container, as compose merges them.
|
|
17
|
+
import { parse } from 'yaml';
|
|
18
|
+
import { UsageError } from "./version.js";
|
|
19
|
+
/**
|
|
20
|
+
* The app service: the one the deploy verb reads the live image and the
|
|
21
|
+
* health status from (§ 6 PLX-Delivery), named `web` by convention.
|
|
22
|
+
*/
|
|
23
|
+
export const APP_SERVICE = 'web';
|
|
24
|
+
export const isMapping = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
25
|
+
/**
|
|
26
|
+
* A compose file from its text. A file that is not YAML compose could read
|
|
27
|
+
* (duplicate keys among them) is a usage error naming the file.
|
|
28
|
+
*/
|
|
29
|
+
export function parseCompose(text, path) {
|
|
30
|
+
let doc;
|
|
31
|
+
try {
|
|
32
|
+
doc = parse(text, { merge: true });
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
throw new UsageError(`${path}: not valid YAML: ${error.message.split('\n')[0]?.replace(/:$/, '')}`);
|
|
36
|
+
}
|
|
37
|
+
const declared = isMapping(doc) && isMapping(doc.services) ? doc.services : {};
|
|
38
|
+
const written = {};
|
|
39
|
+
for (const [name, service] of Object.entries(declared))
|
|
40
|
+
if (isMapping(service))
|
|
41
|
+
written[name] = service;
|
|
42
|
+
const services = resolveExtends(written, path);
|
|
43
|
+
return { services, ...(isMapping(doc) && doc.include != null ? { includes: true } : {}) };
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The deploy verb's placeholder for the image ref (§ 3 PLX-App), in any
|
|
47
|
+
* spelling `${PLEXUS_DEPLOYMENT_IMAGE…}`: the verb pins every one of them to
|
|
48
|
+
* the same ref, so two spellings name the same image.
|
|
49
|
+
*/
|
|
50
|
+
export const IMAGE_PLACEHOLDER = /\$\{PLEXUS_DEPLOYMENT_IMAGE(:[^}]*)?\}/g;
|
|
51
|
+
/** An image as the deploy verb will run it: every spelling of the placeholder as one. */
|
|
52
|
+
export const normalImage = (image) => image.replace(IMAGE_PLACEHOLDER, '${PLEXUS_DEPLOYMENT_IMAGE}');
|
|
53
|
+
/** Lists compose concatenates when a service extends another, dropping duplicates; any other list of the service replaces the base's. */
|
|
54
|
+
const CONCATENATED = new Set([
|
|
55
|
+
'ports',
|
|
56
|
+
'expose',
|
|
57
|
+
'env_file',
|
|
58
|
+
'volumes',
|
|
59
|
+
'devices',
|
|
60
|
+
'dns',
|
|
61
|
+
'secrets',
|
|
62
|
+
'configs',
|
|
63
|
+
'tmpfs',
|
|
64
|
+
]);
|
|
65
|
+
/** The service of this file a service extends, if it names one: `extends: <name>` or `{ service: <name> }` without `file:`. */
|
|
66
|
+
function baseOf(service) {
|
|
67
|
+
const ext = service.extends;
|
|
68
|
+
const ref = isMapping(ext) ? (ext.file == null ? ext.service : undefined) : ext;
|
|
69
|
+
return typeof ref === 'string' ? ref : undefined;
|
|
70
|
+
}
|
|
71
|
+
/** A list entry's identity for de-duplication: a scalar by its text, a mapping or list by its whole value. */
|
|
72
|
+
const identity = (value) => value !== null && typeof value === 'object' ? JSON.stringify(value) : String(value);
|
|
73
|
+
/** Two lists concatenated, an entry equal to an earlier one dropped. */
|
|
74
|
+
function union(base, own) {
|
|
75
|
+
const seen = new Set();
|
|
76
|
+
return [...base, ...own].filter((entry) => {
|
|
77
|
+
const id = identity(entry);
|
|
78
|
+
if (seen.has(id))
|
|
79
|
+
return false;
|
|
80
|
+
seen.add(id);
|
|
81
|
+
return true;
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Every service merged with the services of the same file it `extends`,
|
|
86
|
+
* through the whole chain, as compose merges them: the service's own keys
|
|
87
|
+
* over its base's (itself merged first); a mapping on both sides (labels in
|
|
88
|
+
* either spelling, healthcheck, environment) merged key by key; ports, env
|
|
89
|
+
* files and the like concatenated without duplicates. An `extends` naming
|
|
90
|
+
* another file, or no service of this file, ends the chain: that service is
|
|
91
|
+
* read as written. A cycle is a usage error naming the services in it.
|
|
92
|
+
*/
|
|
93
|
+
function resolveExtends(written, path) {
|
|
94
|
+
const resolved = {};
|
|
95
|
+
const chain = [];
|
|
96
|
+
const resolve = (name) => {
|
|
97
|
+
const done = resolved[name];
|
|
98
|
+
if (done)
|
|
99
|
+
return done;
|
|
100
|
+
const service = written[name] ?? {};
|
|
101
|
+
const at = chain.indexOf(name);
|
|
102
|
+
if (at >= 0)
|
|
103
|
+
throw new UsageError(`${path}: services extend each other in a cycle: ${[...chain.slice(at), name].join(' → ')}`);
|
|
104
|
+
const ref = baseOf(service);
|
|
105
|
+
let merged = service;
|
|
106
|
+
if (ref !== undefined && written[ref]) {
|
|
107
|
+
chain.push(name);
|
|
108
|
+
merged = merge(resolve(ref), service);
|
|
109
|
+
chain.pop();
|
|
110
|
+
}
|
|
111
|
+
resolved[name] = merged;
|
|
112
|
+
return merged;
|
|
113
|
+
};
|
|
114
|
+
for (const name of Object.keys(written))
|
|
115
|
+
resolve(name);
|
|
116
|
+
return resolved;
|
|
117
|
+
}
|
|
118
|
+
/** A service over its (resolved) base, as compose merges one level. */
|
|
119
|
+
function merge(base, service) {
|
|
120
|
+
const { extends: _own, ...own } = service;
|
|
121
|
+
const { extends: _inherited, ...inherited } = base;
|
|
122
|
+
const merged = { ...inherited };
|
|
123
|
+
for (const [key, value] of Object.entries(own)) {
|
|
124
|
+
const from = merged[key];
|
|
125
|
+
if (key === 'labels' && from !== undefined)
|
|
126
|
+
merged[key] = { ...labelsOf(base), ...labelsOf(service) };
|
|
127
|
+
else if (isMapping(from) && isMapping(value))
|
|
128
|
+
merged[key] = { ...from, ...value };
|
|
129
|
+
else if (CONCATENATED.has(key) && Array.isArray(from) && Array.isArray(value))
|
|
130
|
+
merged[key] = union(from, value);
|
|
131
|
+
else
|
|
132
|
+
merged[key] = value;
|
|
133
|
+
}
|
|
134
|
+
return merged;
|
|
135
|
+
}
|
|
136
|
+
/** The app service's healthcheck as the file spells it, if it declares one that is a mapping. */
|
|
137
|
+
export function healthcheckOf(compose) {
|
|
138
|
+
const check = compose.services[APP_SERVICE]?.healthcheck;
|
|
139
|
+
return isMapping(check) ? check : undefined;
|
|
140
|
+
}
|
|
141
|
+
/** Compose's truthy spellings of a boolean, any case, quoted or not: `true`, `yes`, `y`, `on`. */
|
|
142
|
+
export const truthy = (value) => value === true || (typeof value === 'string' && ['true', 'yes', 'y', 'on'].includes(value.toLowerCase()));
|
|
143
|
+
/**
|
|
144
|
+
* Whether the healthcheck can ever report healthy (`PLX-App/Healthcheck`):
|
|
145
|
+
* a `test` of its own, a non-empty string or a non-empty list whose first
|
|
146
|
+
* word is not NONE, and not disabled. The deploy waits on it, so anything
|
|
147
|
+
* else cannot be deployed; one that inherits the image's test does not count.
|
|
148
|
+
*/
|
|
149
|
+
export function declaresHealthcheck(check) {
|
|
150
|
+
if (check === undefined || truthy(check.disable))
|
|
151
|
+
return false;
|
|
152
|
+
const { test } = check;
|
|
153
|
+
if (typeof test === 'string')
|
|
154
|
+
return test.trim() !== '';
|
|
155
|
+
return Array.isArray(test) && test.length > 0 && test[0] !== 'NONE';
|
|
156
|
+
}
|
|
157
|
+
/** A service's labels, from either spelling compose accepts: a mapping, or a list of `key=value`. */
|
|
158
|
+
export function labelsOf(service) {
|
|
159
|
+
const { labels } = service;
|
|
160
|
+
if (isMapping(labels))
|
|
161
|
+
return Object.fromEntries(Object.entries(labels).map(([k, v]) => [k, v == null ? '' : String(v)]));
|
|
162
|
+
if (!Array.isArray(labels))
|
|
163
|
+
return {};
|
|
164
|
+
return Object.fromEntries(labels.map(String).map((l) => {
|
|
165
|
+
const at = l.indexOf('=');
|
|
166
|
+
return at < 0 ? [l, ''] : [l.slice(0, at), l.slice(at + 1)];
|
|
167
|
+
}));
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=compose.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose.js","sourceRoot":"","sources":["../src/compose.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,8EAA8E;AAC9E,0EAA0E;AAC1E,4EAA4E;AAC5E,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,4EAA4E;AAC5E,8EAA8E;AAC9E,yEAAyE;AACzE,8EAA8E;AAC9E,6EAA6E;AAC7E,4EAA4E;AAC5E,yEAAyE;AACzE,0EAA0E;AAC1E,yDAAyD;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAY1C;;;GA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AAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACrG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QAAE,OAAO,EAAE,CAAC;IACtC,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QAC3B,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC1B,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IAC9D,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
package/dist/consumers.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { Context } from './context.ts';
|
|
2
|
-
import type
|
|
3
|
-
import type { Directory } from './model.ts';
|
|
4
|
-
/** The versioned repos that are templates: what a repo can be generated from. */
|
|
5
|
-
export declare const TEMPLATES: readonly string[];
|
|
2
|
+
import { type Directory } from './model.ts';
|
|
6
3
|
export interface Site {
|
|
7
4
|
path: string;
|
|
8
5
|
/** Relative to the workspace. */
|
|
@@ -23,20 +20,8 @@ export interface Consumer {
|
|
|
23
20
|
/** Its sites in tree order: the repo root before its apps. */
|
|
24
21
|
sites: Site[];
|
|
25
22
|
}
|
|
26
|
-
/** The branch a consumer is updated on; undefined
|
|
27
|
-
export declare function expectedBranch(
|
|
28
|
-
/** The template source copier records for a template of the upstream organisation. */
|
|
29
|
-
export declare const templateSource: (template: string) => string;
|
|
30
|
-
/**
|
|
31
|
-
* Templates renamed on a version, old name → current (0.114.0: the web template
|
|
32
|
-
* became the Turborepo template, the platform repo the operations repo; 0.120.0:
|
|
33
|
-
* the repos' `preset-` prefix became `template-`, copier's own word). A
|
|
34
|
-
* consumer whose answers still name the old one is a consumer of the current
|
|
35
|
-
* one, and its next update points the answers at the new name.
|
|
36
|
-
*/
|
|
37
|
-
export declare const RENAMED_TEMPLATES: Readonly<Record<string, string>>;
|
|
38
|
-
/** The current template a recorded template source stands for, or undefined when it is none of the given templates. */
|
|
39
|
-
export declare function templateOf(src: string, templates: readonly string[]): string | undefined;
|
|
23
|
+
/** The branch a consumer is updated on; undefined for a repo without a marker. */
|
|
24
|
+
export declare function expectedBranch(repo: Directory): Consumer['expected'];
|
|
40
25
|
/**
|
|
41
26
|
* The consumers under a scanned workspace (`overview` with git facets), for
|
|
42
27
|
* the given templates. A site inside a template directory is the template's own
|
package/dist/consumers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consumers.d.ts","sourceRoot":"","sources":["../src/consumers.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,
|
|
1
|
+
{"version":3,"file":"consumers.d.ts","sourceRoot":"","sources":["../src/consumers.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,KAAK,SAAS,EAAgB,MAAM,YAAY,CAAC;AAG1D,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,2GAA2G;IAC3G,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8DAA8D;IAC9D,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AAED,kFAAkF;AAClF,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC,UAAU,CAAC,CAIpE;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAsCpH"}
|
package/dist/consumers.js
CHANGED
|
@@ -1,50 +1,21 @@
|
|
|
1
1
|
// The consumers of the templates: every copier-managed site under a directory
|
|
2
2
|
// (tenant repo roots and their apps/*) and the repo each belongs to. A
|
|
3
3
|
// consumer is updated in a scratch checkout of its origin's branch, never in
|
|
4
|
-
// its own checkout, on the branch the version lands on:
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
4
|
+
// its own checkout, on the branch the version lands on: the operations repo
|
|
5
|
+
// rides main, an app repo rides develop (§ 3 PLX-Delivery), and a package
|
|
6
|
+
// repo (its root answers say `publishes_packages`) is trunk-based on main
|
|
7
|
+
// (§ 5 PLX-Delivery). A repo without a marker is taken on the branch its
|
|
8
|
+
// checkout is on.
|
|
9
9
|
import { relative } from 'node:path';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
if (!declaration)
|
|
10
|
+
import { isOperations } from "./model.js";
|
|
11
|
+
import { templateOf } from "./templates.js";
|
|
12
|
+
/** The branch a consumer is updated on; undefined for a repo without a marker. */
|
|
13
|
+
export function expectedBranch(repo) {
|
|
14
|
+
if (!repo.declaration)
|
|
16
15
|
return undefined;
|
|
17
|
-
if (
|
|
16
|
+
if (isOperations(repo))
|
|
18
17
|
return 'main';
|
|
19
|
-
|
|
20
|
-
return answers.publishes_packages === true ? 'main' : 'develop';
|
|
21
|
-
return undefined;
|
|
22
|
-
}
|
|
23
|
-
/** The template source copier records for a template of the upstream organisation. */
|
|
24
|
-
export const templateSource = (template) => `gh:plexus-ms/${template}`;
|
|
25
|
-
/**
|
|
26
|
-
* Templates renamed on a version, old name → current (0.114.0: the web template
|
|
27
|
-
* became the Turborepo template, the platform repo the operations repo; 0.120.0:
|
|
28
|
-
* the repos' `preset-` prefix became `template-`, copier's own word). A
|
|
29
|
-
* consumer whose answers still name the old one is a consumer of the current
|
|
30
|
-
* one, and its next update points the answers at the new name.
|
|
31
|
-
*/
|
|
32
|
-
export const RENAMED_TEMPLATES = {
|
|
33
|
-
'preset-repo-web': 'template-repo-turbo',
|
|
34
|
-
'preset-repo-platform': 'template-repo-operations',
|
|
35
|
-
'preset-repo-turbo': 'template-repo-turbo',
|
|
36
|
-
'preset-app-nextjs': 'template-app-nextjs',
|
|
37
|
-
'preset-repo-operations': 'template-repo-operations',
|
|
38
|
-
};
|
|
39
|
-
/** The current template a recorded template source stands for, or undefined when it is none of the given templates. */
|
|
40
|
-
export function templateOf(src, templates) {
|
|
41
|
-
for (const p of templates)
|
|
42
|
-
if (templateSource(p) === src)
|
|
43
|
-
return p;
|
|
44
|
-
for (const [old, current] of Object.entries(RENAMED_TEMPLATES))
|
|
45
|
-
if (templateSource(old) === src && templates.includes(current))
|
|
46
|
-
return current;
|
|
47
|
-
return undefined;
|
|
18
|
+
return repo.copier?.answers.publishes_packages === true ? 'main' : 'develop';
|
|
48
19
|
}
|
|
49
20
|
/**
|
|
50
21
|
* The consumers under a scanned workspace (`overview` with git facets), for
|
|
@@ -66,7 +37,7 @@ export async function findConsumers(ctx, root, templates) {
|
|
|
66
37
|
else {
|
|
67
38
|
let consumer = consumers.get(here.path);
|
|
68
39
|
if (!consumer) {
|
|
69
|
-
const expected = expectedBranch(here
|
|
40
|
+
const expected = expectedBranch(here);
|
|
70
41
|
consumer = {
|
|
71
42
|
path: here.path,
|
|
72
43
|
rel: relative(root.path, here.path) || '.',
|
package/dist/consumers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consumers.js","sourceRoot":"","sources":["../src/consumers.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,uEAAuE;AACvE,6EAA6E;AAC7E,
|
|
1
|
+
{"version":3,"file":"consumers.js","sourceRoot":"","sources":["../src/consumers.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,uEAAuE;AACvE,6EAA6E;AAC7E,4EAA4E;AAC5E,0EAA0E;AAC1E,0EAA0E;AAC1E,yEAAyE;AACzE,kBAAkB;AAClB,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,OAAO,EAAkB,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAwB5C,kFAAkF;AAClF,MAAM,UAAU,cAAc,CAAC,IAAe;IAC5C,IAAI,CAAC,IAAI,CAAC,WAAW;QAAE,OAAO,SAAS,CAAC;IACxC,IAAI,YAAY,CAAC,IAAI,CAAC;QAAE,OAAO,MAAM,CAAC;IACtC,OAAO,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,kBAAkB,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/E,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,GAAY,EAAE,IAAe,EAAE,SAA4B;IAC7F,MAAM,SAAS,GAAG,IAAI,GAAG,EAAoB,CAAC;IAC9C,MAAM,OAAO,GAAW,EAAE,CAAC;IAE3B,MAAM,KAAK,GAAG,CAAC,GAAc,EAAE,IAA2B,EAAE,UAAmB,EAAE,EAAE;QACjF,MAAM,IAAI,GAAG,GAAG,CAAC,GAAG,C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QACD,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,QAAQ;YAAE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAC/D,CAAC,CAAC;IACF,KAAK,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IAE9B,KAAK,MAAM,IAAI,IAAI,OAAO;QAAE,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,GAAG,mCAAmC,CAAC,CAAC;IACtF,KAAK,MAAM,CAAC,IAAI,SAAS,CAAC,MAAM,EAAE,EAAE,CAAC;QACnC,MAAM,MAAM,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAChH,IAAI,MAAM,KAAK,EAAE;YAAE,CAAC,CAAC,OAAO,GAAG,kBAAkB,CAAC;;YAC7C,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IACD,OAAO,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC;AACjC,CAAC"}
|
package/dist/context.d.ts
CHANGED
|
@@ -48,6 +48,12 @@ export declare class Context {
|
|
|
48
48
|
* against a throwaway copy to be honest. Resolves with the output of a run.
|
|
49
49
|
*/
|
|
50
50
|
stage(step: Step): Promise<string | undefined>;
|
|
51
|
+
/**
|
|
52
|
+
* A step's output goes to the terminal under -vv. When the caller goes on
|
|
53
|
+
* with it (`used`: a staged `mktemp -d`, a create call's answer), it is
|
|
54
|
+
* captured at every verbosity and only echoed, never passed through
|
|
55
|
+
* uncaptured: an empty answer would send the caller on with ''.
|
|
56
|
+
*/
|
|
51
57
|
private perform;
|
|
52
58
|
}
|
|
53
59
|
//# sourceMappingURL=context.d.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2 : 1);
|
|
90
90
|
if (!this.dryRun)
|
|
91
|
-
await this.perform(step);
|
|
91
|
+
await this.perform(step, false);
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
@@ -103,7 +103,7 @@ export class Context {
|
|
|
103
103
|
this.say(indent(input), step.kind === 'write' ? 2 : 1);
|
|
104
104
|
if (this.dryRun)
|
|
105
105
|
return undefined;
|
|
106
|
-
return this.perform(step);
|
|
106
|
+
return this.perform(step, true);
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
109
|
* Perform a step on scratch state, whatever the mode: the one exception to
|
|
@@ -115,16 +115,25 @@ export class Context {
|
|
|
115
115
|
const input = body(step);
|
|
116
116
|
if (input !== undefined)
|
|
117
117
|
this.say(indent(input), 2);
|
|
118
|
-
return this.perform(step);
|
|
118
|
+
return this.perform(step, true);
|
|
119
119
|
}
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
/**
|
|
121
|
+
* A step's output goes to the terminal under -vv. When the caller goes on
|
|
122
|
+
* with it (`used`: a staged `mktemp -d`, a create call's answer), it is
|
|
123
|
+
* captured at every verbosity and only echoed, never passed through
|
|
124
|
+
* uncaptured: an empty answer would send the caller on with ''.
|
|
125
|
+
*/
|
|
126
|
+
async perform(step, used) {
|
|
127
|
+
const shown = this.verbose >= 2;
|
|
128
|
+
const inherit = (shown && !used) || (step.kind === 'run' && step.interactive === true);
|
|
122
129
|
switch (step.kind) {
|
|
123
130
|
case 'run':
|
|
124
131
|
return this.io.exec(step.command, step.args, {
|
|
125
132
|
cwd: step.cwd,
|
|
126
133
|
input: step.input,
|
|
127
134
|
inherit,
|
|
135
|
+
echo: shown && !inherit,
|
|
136
|
+
timeout: step.timeout,
|
|
128
137
|
env: step.env === undefined ? undefined : { ...process.env, ...step.env },
|
|
129
138
|
});
|
|
130
139
|
case 'write':
|
package/dist/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.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CAAC,IAAI,CAAC,CAAC;AAChB,CAAC"}
|
package/dist/deploy.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Mapping } from './compose.ts';
|
|
1
2
|
import type { Context } from './context.ts';
|
|
2
3
|
export interface DeployOptions {
|
|
3
4
|
/** ssh target, `deploy@host`. */
|
|
@@ -5,9 +6,7 @@ export interface DeployOptions {
|
|
|
5
6
|
app: string;
|
|
6
7
|
/** The image ref to pin; empty or absent for a third-party app whose file pins its own. */
|
|
7
8
|
image?: string;
|
|
8
|
-
/**
|
|
9
|
-
healthUrl?: string;
|
|
10
|
-
/** Poll attempts, two seconds apart. */
|
|
9
|
+
/** Looks at the app container's health status, two seconds apart. */
|
|
11
10
|
retries?: number;
|
|
12
11
|
/** The environment deployed into; default production. Decides the app dir's slug (§ 3 PLX-Platform). */
|
|
13
12
|
environment?: string;
|
|
@@ -45,6 +44,15 @@ export declare function renderCompose(text: string, image: string | undefined, p
|
|
|
45
44
|
export declare function defaultAppDir(app: string, environment?: string): string;
|
|
46
45
|
/** Single-quote a word for a remote shell. */
|
|
47
46
|
export declare const q: (word: string) => string;
|
|
47
|
+
/** A compose duration (Go's syntax: `1m30s`, `500ms`) in seconds, or undefined when it is not one. */
|
|
48
|
+
export declare function seconds(duration: unknown): number | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Why the healthcheck would be seen healthy late, or not at all within a
|
|
51
|
+
* wait of `budget` seconds: without `start_interval`, or once a short
|
|
52
|
+
* `start_period` is over, Docker probes only every `interval`. Undefined when
|
|
53
|
+
* the timing keys cover the wait; a value the verb cannot read is left to compose.
|
|
54
|
+
*/
|
|
55
|
+
export declare function slowStart(check: Mapping, budget: number): string | undefined;
|
|
48
56
|
/** Deploy from the checkout at `dir`: read, render, then the host-side steps in order. */
|
|
49
57
|
export declare function deploy(ctx: Context, options: DeployOptions): Promise<Deploy>;
|
|
50
58
|
//# sourceMappingURL=deploy.d.ts.map
|
package/dist/deploy.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../src/deploy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../src/deploy.ts"],"names":[],"mappings":"AA4CA,OAAO,EAAyD,KAAK,OAAO,EAAgB,MAAM,cAAc,CAAC;AACjH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAM5C,MAAM,WAAW,aAAa;IAC5B,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,2FAA2F;IAC3F,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wGAAwG;IACxG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2FAA2F;IAC3F,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,uIAAuI;IACvI,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAID;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAY3F;AAED,gHAAgH;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