@intentius/chant-lexicon-gcp 0.124.35 → 0.124.37
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/api/read-client.d.ts +2 -1
- package/dist/api/read-client.d.ts.map +1 -1
- package/dist/api/read-client.js +2 -1
- package/dist/deep-observe.d.ts.map +1 -1
- package/dist/deep-observe.js +56 -11
- package/dist/describe-resources.d.ts +20 -6
- package/dist/describe-resources.d.ts.map +1 -1
- package/dist/describe-resources.js +40 -26
- package/dist/health.d.ts.map +1 -1
- package/dist/health.js +6 -9
- package/dist/integrity.json +2 -2
- package/dist/manifest.json +1 -1
- package/dist/op/activities/gcp-apply.d.ts +14 -1
- package/dist/op/activities/gcp-apply.d.ts.map +1 -1
- package/dist/op/activities/gcp-apply.js +49 -8
- package/dist/op/activities/gcp-compute.d.ts +10 -0
- package/dist/op/activities/gcp-compute.d.ts.map +1 -1
- package/dist/op/activities/gcp-compute.js +39 -3
- package/dist/op/activities/gcp-iam.d.ts.map +1 -1
- package/dist/op/activities/gcp-iam.js +2 -0
- package/dist/serializer.d.ts +18 -0
- package/dist/serializer.d.ts.map +1 -1
- package/dist/serializer.js +72 -16
- package/package.json +2 -2
- package/src/api/read-client.ts +2 -1
- package/src/deep-observe.test.ts +27 -1
- package/src/deep-observe.ts +52 -12
- package/src/describe-resources.test.ts +6 -5
- package/src/describe-resources.ts +43 -24
- package/src/health.ts +7 -10
- package/src/op/activities/gcp-apply.test.ts +48 -3
- package/src/op/activities/gcp-apply.ts +49 -9
- package/src/op/activities/gcp-compute.test.ts +94 -0
- package/src/op/activities/gcp-compute.ts +37 -2
- package/src/op/activities/gcp-iam.ts +2 -0
- package/src/project-config.test.ts +119 -0
- package/src/read-refs.test.ts +135 -0
- package/src/serializer.test.ts +26 -0
- package/src/serializer.ts +73 -15
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
* PubSubTopic, PubSubSubscription, SecretManagerSecret, IAMServiceAccount,
|
|
25
25
|
* RunService, IAMPolicyMember and the Cloud Run load balancer kinds
|
|
26
26
|
* (ComputeAddress, ComputeRegionNetworkEndpointGroup, ComputeBackendService,
|
|
27
|
-
* ComputeURLMap, ComputeTargetHTTPProxy, ComputeForwardingRule; #4233)
|
|
27
|
+
* ComputeURLMap, ComputeTargetHTTPProxy, ComputeForwardingRule; #4233), and
|
|
28
|
+
* ComputeNetwork and ComputeSubnetwork (#4248). An
|
|
28
29
|
* IAMPolicyMember is read through its target's policy and is present when the
|
|
29
30
|
* policy grants its member the role. The kubectl path could fetch any CNRM kind the cluster knew
|
|
30
31
|
* about, so this is narrower on paper. It is not narrower in practice for
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-client.d.ts","sourceRoot":"","sources":["../../src/api/read-client.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"read-client.d.ts","sourceRoot":"","sources":["../../src/api/read-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,EAA6B,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5F,kCAAkC;AAClC,MAAM,WAAW,oBAAoB;IACnC,+FAA+F;IAC/F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,yDAAyD;IACzD,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAED,uHAAuH;AACvH,MAAM,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAUrH;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,KAAK;IAGnC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM;IAF1B,YACE,OAAO,EAAE,MAAM,EACN,MAAM,CAAC,EAAE,MAAM,YAAA,EAIzB;CACF;AAED,mFAAmF;AACnF,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAEhD;AAED,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAEtE;AAED;;;;;;GAMG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,oBAAoB,EAC5B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACjC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAiDlC"}
|
package/dist/api/read-client.js
CHANGED
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
* PubSubTopic, PubSubSubscription, SecretManagerSecret, IAMServiceAccount,
|
|
25
25
|
* RunService, IAMPolicyMember and the Cloud Run load balancer kinds
|
|
26
26
|
* (ComputeAddress, ComputeRegionNetworkEndpointGroup, ComputeBackendService,
|
|
27
|
-
* ComputeURLMap, ComputeTargetHTTPProxy, ComputeForwardingRule; #4233)
|
|
27
|
+
* ComputeURLMap, ComputeTargetHTTPProxy, ComputeForwardingRule; #4233), and
|
|
28
|
+
* ComputeNetwork and ComputeSubnetwork (#4248). An
|
|
28
29
|
* IAMPolicyMember is read through its target's policy and is present when the
|
|
29
30
|
* policy grants its member the role. The kubectl path could fetch any CNRM kind the cluster knew
|
|
30
31
|
* about, so this is narrower on paper. It is not narrower in practice for
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deep-observe.d.ts","sourceRoot":"","sources":["../src/deep-observe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAEH,OAAO,KAAK,EACV,qBAAqB,EAGtB,MAAM,0BAA0B,CAAC;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MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAWtF;AAUD;6EAC6E;AAC7E,UAAU,aAAa;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AA0OD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CASnH;AAED;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAuF5G"}
|
package/dist/deep-observe.js
CHANGED
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
*/
|
|
56
56
|
import { deepObservation, normalizeDeepProperties } from "@intentius/chant/deep-observation";
|
|
57
57
|
import { hasOwnershipMarker } from "@intentius/chant/ownership";
|
|
58
|
-
import { deriveGVK, manifestProjectAnnotations, resolveReadProject } from "./describe-resources.js";
|
|
58
|
+
import { deriveGVK, manifestProjectAnnotations, readTargets, resolveReadProject } from "./describe-resources.js";
|
|
59
59
|
import { getResource, mapperForKind, GcpReadError, isNotFound } from "./api/read-client.js";
|
|
60
60
|
import { gcpDeepNormalizationHooks } from "./deep-observe-hooks.js";
|
|
61
61
|
/** The labels the applier stamps — see describe-resources.ts. */
|
|
@@ -166,6 +166,25 @@ const CNRM_REFINERS = {
|
|
|
166
166
|
template.serviceAccountRef = email.endsWith(suffix) ? { name: email.slice(0, -suffix.length) } : { external: email };
|
|
167
167
|
delete template.serviceAccount;
|
|
168
168
|
}
|
|
169
|
+
// #4249: Direct VPC egress paths back to CNRM's refs, `name` for the
|
|
170
|
+
// project's own network and subnetwork, `external` otherwise.
|
|
171
|
+
const vpcAccess = template?.vpcAccess;
|
|
172
|
+
if (vpcAccess && Array.isArray(vpcAccess.networkInterfaces)) {
|
|
173
|
+
const own = (value, pattern) => {
|
|
174
|
+
if (!value.includes("/"))
|
|
175
|
+
return { name: value };
|
|
176
|
+
const hit = pattern.exec(value);
|
|
177
|
+
return hit && hit[1] === ctx.project ? { name: hit[2] } : { external: value };
|
|
178
|
+
};
|
|
179
|
+
vpcAccess.networkInterfaces = vpcAccess.networkInterfaces.map((i) => {
|
|
180
|
+
const { network, subnetwork, ...rest } = i;
|
|
181
|
+
return {
|
|
182
|
+
...rest,
|
|
183
|
+
...(typeof network === "string" ? { networkRef: own(network, /^projects\/([^/]+)\/global\/networks\/([^/]+)$/) } : {}),
|
|
184
|
+
...(typeof subnetwork === "string" ? { subnetworkRef: own(subnetwork, /^projects\/([^/]+)\/regions\/[^/]+\/subnetworks\/([^/]+)$/) } : {}),
|
|
185
|
+
};
|
|
186
|
+
});
|
|
187
|
+
}
|
|
169
188
|
},
|
|
170
189
|
// #4233: the inverse of gcp-compute.ts's body builders. Compute returns refs
|
|
171
190
|
// as full URLs and a region as a URL; CNRM writes `*Ref: { name }` and a
|
|
@@ -247,6 +266,39 @@ const CNRM_REFINERS = {
|
|
|
247
266
|
delete tree.urlMap;
|
|
248
267
|
}
|
|
249
268
|
},
|
|
269
|
+
// #4248: a network is global and has no location; compute nests the routing
|
|
270
|
+
// mode and lists the subnetworks it holds, which CNRM declares separately.
|
|
271
|
+
ComputeNetwork(tree) {
|
|
272
|
+
const routing = tree.routingConfig;
|
|
273
|
+
if (routing) {
|
|
274
|
+
if (routing.routingMode !== undefined)
|
|
275
|
+
tree.routingMode = routing.routingMode;
|
|
276
|
+
delete tree.routingConfig;
|
|
277
|
+
}
|
|
278
|
+
delete tree.subnetworks;
|
|
279
|
+
delete tree.gatewayIPv4;
|
|
280
|
+
},
|
|
281
|
+
ComputeSubnetwork(tree) {
|
|
282
|
+
if (typeof tree.region === "string")
|
|
283
|
+
tree.region = lastSegment(tree.region);
|
|
284
|
+
if (typeof tree.network === "string") {
|
|
285
|
+
tree.networkRef = { name: lastSegment(tree.network) };
|
|
286
|
+
delete tree.network;
|
|
287
|
+
}
|
|
288
|
+
if (Array.isArray(tree.secondaryIpRanges)) {
|
|
289
|
+
tree.secondaryIpRange = tree.secondaryIpRanges;
|
|
290
|
+
delete tree.secondaryIpRanges;
|
|
291
|
+
}
|
|
292
|
+
const log = tree.logConfig;
|
|
293
|
+
if (log) {
|
|
294
|
+
if (log.enable === false)
|
|
295
|
+
delete tree.logConfig;
|
|
296
|
+
else
|
|
297
|
+
delete log.enable;
|
|
298
|
+
}
|
|
299
|
+
delete tree.gatewayAddress;
|
|
300
|
+
delete tree.fingerprint;
|
|
301
|
+
},
|
|
250
302
|
ComputeForwardingRule(tree) {
|
|
251
303
|
computeLocation(tree);
|
|
252
304
|
if (tree.IPProtocol !== undefined) {
|
|
@@ -312,7 +364,8 @@ export async function observeResourcesDeepGcp(options) {
|
|
|
312
364
|
const unobserved = {};
|
|
313
365
|
const endpoint = process.env.GCP_ENDPOINT_URL;
|
|
314
366
|
const manifestProjects = manifestProjectAnnotations(options.buildOutput);
|
|
315
|
-
const
|
|
367
|
+
const targets = readTargets(options.entities);
|
|
368
|
+
const reads = [...options.entities].map(async ([entityName, { entityType }]) => {
|
|
316
369
|
const gvk = deriveGVK(entityType);
|
|
317
370
|
if (!gvk || !mapperForKind(gvk.kind)) {
|
|
318
371
|
unobserved[entityName] = {
|
|
@@ -324,16 +377,8 @@ export async function observeResourcesDeepGcp(options) {
|
|
|
324
377
|
};
|
|
325
378
|
return;
|
|
326
379
|
}
|
|
380
|
+
const { name, props } = targets.get(entityName);
|
|
327
381
|
const metadata = props.metadata;
|
|
328
|
-
const name = metadata?.name;
|
|
329
|
-
if (!name) {
|
|
330
|
-
unobserved[entityName] = {
|
|
331
|
-
type: entityType,
|
|
332
|
-
reason: "read-failed",
|
|
333
|
-
detail: "declared entity has no metadata.name to query by",
|
|
334
|
-
};
|
|
335
|
-
return;
|
|
336
|
-
}
|
|
337
382
|
let client;
|
|
338
383
|
try {
|
|
339
384
|
client = {
|
|
@@ -82,15 +82,29 @@ export declare function deriveGVK(entityType: string): {
|
|
|
82
82
|
*/
|
|
83
83
|
export declare function manifestProjectAnnotations(buildOutput: string | undefined): Map<string, string>;
|
|
84
84
|
/**
|
|
85
|
-
* The project a read should target: the entity's
|
|
86
|
-
* `
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
85
|
+
* The project a read should target, in apply's order (#4252): the entity's
|
|
86
|
+
* own literal `projectRef.external`, then the built manifest's project for it
|
|
87
|
+
* (its resolved projectRef, or the project-id annotation chant.config's
|
|
88
|
+
* `gcp.project` writes), then the entity's own annotation, then
|
|
89
|
+
* `GCP_PROJECT_ID`, then `GOOGLE_CLOUD_PROJECT`. Throws apply's own error when
|
|
90
|
+
* nothing resolves, so the `no-binding` detail names every knob.
|
|
90
91
|
*/
|
|
91
92
|
export declare function resolveReadProject(kind: string, name: string, metadata: {
|
|
92
93
|
annotations?: Record<string, string>;
|
|
93
|
-
} | undefined, manifestProjects: Map<string, string>, props?: Record<string, unknown
|
|
94
|
+
} | undefined, manifestProjects: Map<string, string>, props?: Record<string, unknown>, env?: NodeJS.ProcessEnv): string;
|
|
95
|
+
/**
|
|
96
|
+
* Each declared entity as a read sees it (#4251): the name the build writes
|
|
97
|
+
* (`metadata.name`, else the kebab-cased logical id) and its props with every
|
|
98
|
+
* reference to another resource resolved as the serializer resolves it, so a
|
|
99
|
+
* mapper building a read URL never meets an attribute reference.
|
|
100
|
+
*/
|
|
101
|
+
export declare function readTargets(entities: Map<string, {
|
|
102
|
+
entityType: string;
|
|
103
|
+
props: Record<string, unknown>;
|
|
104
|
+
}>): Map<string, {
|
|
105
|
+
name: string;
|
|
106
|
+
props: Record<string, unknown>;
|
|
107
|
+
}>;
|
|
94
108
|
/**
|
|
95
109
|
* Status from a REST payload.
|
|
96
110
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe-resources.d.ts","sourceRoot":"","sources":["../src/describe-resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAsC,MAAM,0BAA0B,CAAC;AAsBtG;;gCAEgC;AAChC,UAAU,eAAe;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IACvC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE;QACP,UAAU,CAAC,EAAE,KAAK,CAAC;YAAE,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QACxF,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;KACtB,CAAC;CACH;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAIpF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,GAAG,CAAC,MAAM,E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;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,SAAS,EAC9D,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACrC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,CAUR;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAAC,GAC5E,GAAG,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAAC,CAY/D;AAUD;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,CAY3D;AAED,wBAAsB,iBAAiB,CAAC,OAAO,EAAE;IAC/C,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;IAC9E,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAiH7B"}
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
import { observation } from "@intentius/chant/observation";
|
|
39
39
|
import { hasOwnershipMarker, classifyOwnership, readOwnership } from "@intentius/chant/ownership";
|
|
40
40
|
import { getResource, mapperForKind, GcpReadError, isNotFound } from "./api/read-client.js";
|
|
41
|
-
import {
|
|
42
|
-
import { resolveGVK } from "./serializer.js";
|
|
41
|
+
import { NO_PROJECT, parseManifest, projectRefProject } from "./op/activities/gcp-apply.js";
|
|
42
|
+
import { cnrmNameOf, resolveCnrmRefs, resolveGVK } from "./serializer.js";
|
|
43
43
|
/**
|
|
44
44
|
* chant's ownership marker as GCP labels.
|
|
45
45
|
*
|
|
@@ -99,22 +99,43 @@ export function manifestProjectAnnotations(buildOutput) {
|
|
|
99
99
|
return out;
|
|
100
100
|
}
|
|
101
101
|
/**
|
|
102
|
-
* The project a read should target: the entity's
|
|
103
|
-
* `
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
102
|
+
* The project a read should target, in apply's order (#4252): the entity's
|
|
103
|
+
* own literal `projectRef.external`, then the built manifest's project for it
|
|
104
|
+
* (its resolved projectRef, or the project-id annotation chant.config's
|
|
105
|
+
* `gcp.project` writes), then the entity's own annotation, then
|
|
106
|
+
* `GCP_PROJECT_ID`, then `GOOGLE_CLOUD_PROJECT`. Throws apply's own error when
|
|
107
|
+
* nothing resolves, so the `no-binding` detail names every knob.
|
|
107
108
|
*/
|
|
108
|
-
export function resolveReadProject(kind, name, metadata, manifestProjects, props) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
throw
|
|
109
|
+
export function resolveReadProject(kind, name, metadata, manifestProjects, props, env = process.env) {
|
|
110
|
+
const project = projectRefProject(props, {}) ||
|
|
111
|
+
manifestProjects.get(`${kind}/${name}`) ||
|
|
112
|
+
metadata?.annotations?.["cnrm.cloud.google.com/project-id"] ||
|
|
113
|
+
projectRefProject(props, env) ||
|
|
114
|
+
env.GCP_PROJECT_ID ||
|
|
115
|
+
env.GOOGLE_CLOUD_PROJECT;
|
|
116
|
+
if (!project)
|
|
117
|
+
throw new Error(NO_PROJECT);
|
|
118
|
+
return project;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Each declared entity as a read sees it (#4251): the name the build writes
|
|
122
|
+
* (`metadata.name`, else the kebab-cased logical id) and its props with every
|
|
123
|
+
* reference to another resource resolved as the serializer resolves it, so a
|
|
124
|
+
* mapper building a read URL never meets an attribute reference.
|
|
125
|
+
*/
|
|
126
|
+
export function readTargets(entities) {
|
|
127
|
+
const logicalByProps = new Map();
|
|
128
|
+
for (const [logical, { props }] of entities)
|
|
129
|
+
logicalByProps.set(props, logical);
|
|
130
|
+
const logicalOf = (props) => logicalByProps.get(props);
|
|
131
|
+
const out = new Map();
|
|
132
|
+
for (const [logical, { props }] of entities) {
|
|
133
|
+
out.set(logical, {
|
|
134
|
+
name: cnrmNameOf(logical, props),
|
|
135
|
+
props: resolveCnrmRefs(props, logicalOf),
|
|
136
|
+
});
|
|
117
137
|
}
|
|
138
|
+
return out;
|
|
118
139
|
}
|
|
119
140
|
function pruneUndefined(obj) {
|
|
120
141
|
const out = {};
|
|
@@ -163,7 +184,8 @@ export async function describeResources(options) {
|
|
|
163
184
|
// `describe-stack-resources` returns no tags.
|
|
164
185
|
let warnedOwnership = false;
|
|
165
186
|
const manifestProjects = manifestProjectAnnotations(options.buildOutput);
|
|
166
|
-
const
|
|
187
|
+
const targets = readTargets(options.entities);
|
|
188
|
+
const reads = [...options.entities].map(async ([entityName, { entityType }]) => {
|
|
167
189
|
const gvk = deriveGVK(entityType);
|
|
168
190
|
if (!gvk) {
|
|
169
191
|
unobserved[entityName] = {
|
|
@@ -183,16 +205,8 @@ export async function describeResources(options) {
|
|
|
183
205
|
};
|
|
184
206
|
return;
|
|
185
207
|
}
|
|
208
|
+
const { name, props } = targets.get(entityName);
|
|
186
209
|
const metadata = props.metadata;
|
|
187
|
-
const name = metadata?.name;
|
|
188
|
-
if (!name) {
|
|
189
|
-
unobserved[entityName] = {
|
|
190
|
-
type: entityType,
|
|
191
|
-
reason: "read-failed",
|
|
192
|
-
detail: "declared entity has no metadata.name to query by",
|
|
193
|
-
};
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
210
|
let client;
|
|
197
211
|
try {
|
|
198
212
|
client = {
|
package/dist/health.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../src/health.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,gBAAgB,EAAoB,MAAM,0BAA0B,CAAC;AACnH,OAAO,EAAyC,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAG5F,eAAO,MAAM,gBAAgB,YAAI,mBAAmB,CAAU,CAAC;AAE/D,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAClB;AAED,UAAU,SAAS;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,gEAAgE;AAChE,MAAM,WAAW,oBAAoB;IACnC,iBAAiB,CAAC,EAAE,SAAS,CAAC;IAC9B,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACrD;AAOD,yEAAyE;AACzE,wBAAgB,aAAa,CAAC,IAAI,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,GAAG,WAAW,CAqBzF;A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EAAE,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAiD3F"}
|
package/dist/health.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* `GCP_ENDPOINT_URL` (floci-gcp) answers.
|
|
10
10
|
*/
|
|
11
11
|
import { getResource, GcpReadError, isNotFound } from "./api/read-client.js";
|
|
12
|
-
import { deriveGVK, manifestProjectAnnotations, resolveReadProject } from "./describe-resources.js";
|
|
12
|
+
import { deriveGVK, manifestProjectAnnotations, readTargets, resolveReadProject } from "./describe-resources.js";
|
|
13
13
|
export const GCP_HEALTH_TYPES = ["GCP::Run::Service"];
|
|
14
14
|
function readyCondition(body) {
|
|
15
15
|
if (body.terminalCondition && (body.terminalCondition.type ?? "Ready") === "Ready")
|
|
@@ -46,16 +46,13 @@ export async function observeHealthGcp(options) {
|
|
|
46
46
|
const entities = {};
|
|
47
47
|
const unobserved = {};
|
|
48
48
|
const absent = [];
|
|
49
|
-
|
|
49
|
+
const targets = readTargets(options.entities);
|
|
50
|
+
await Promise.all([...options.entities].map(async ([entityName, { entityType }]) => {
|
|
50
51
|
const gvk = deriveGVK(entityType);
|
|
52
|
+
const { name, props } = targets.get(entityName);
|
|
51
53
|
const metadata = props.metadata;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
unobserved[entityName] = {
|
|
55
|
-
type: entityType,
|
|
56
|
-
reason: "read-failed",
|
|
57
|
-
detail: gvk ? "declared entity has no metadata.name to query by" : `cannot derive a GCP kind from ${entityType}`,
|
|
58
|
-
};
|
|
54
|
+
if (!gvk) {
|
|
55
|
+
unobserved[entityName] = { type: entityType, reason: "read-failed", detail: `cannot derive a GCP kind from ${entityType}` };
|
|
59
56
|
return;
|
|
60
57
|
}
|
|
61
58
|
let project;
|
package/dist/integrity.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"algorithm": "sha256",
|
|
3
3
|
"artifacts": {
|
|
4
|
-
"manifest.json": "
|
|
4
|
+
"manifest.json": "648e7fb96c2a44b72459dc70e777c22836de776eb5f5b8017f8c6057135062a3",
|
|
5
5
|
"meta.json": "75643660010c044c6f465bef2688a864ab30cc96fd9b68111969749748ac64ca",
|
|
6
6
|
"types/index.d.ts": "da1ebc6bcf83e1a018a773b59714194aeeb74ae1d5c1252b737b7e730ca98bd5",
|
|
7
7
|
"rules/hardcoded-project.ts": "6d5ae9efa74d73800eebe1a0a0d43c619ee0fdebe3347195df93fcbe63b34f0d",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"skills/chant-gcp-patterns.md": "4c6809fc7c37fa1879379ad4c0e2d114dec9497bc6eb9d1bca4e79fddea4f509",
|
|
41
41
|
"skills/chant-gcp-gke.md": "be277019da9a722c851e47cd2dfb9c9536668948c3535fb20db7697e934c4e2b"
|
|
42
42
|
},
|
|
43
|
-
"composite": "
|
|
43
|
+
"composite": "12781f2fbe08546cbfed0496ef97a0cfc6f301c5576bfafad2cbd4bf3cac39f3"
|
|
44
44
|
}
|
package/dist/manifest.json
CHANGED
|
@@ -189,6 +189,13 @@ export declare const pubSubTopicMapper: ResourceMapper;
|
|
|
189
189
|
export declare function cloudRunServiceBody(resource: GcpResource, project?: string): {
|
|
190
190
|
template?: unknown;
|
|
191
191
|
};
|
|
192
|
+
/**
|
|
193
|
+
* A CNRM Direct VPC egress interface as Cloud Run v2 takes it (#4249):
|
|
194
|
+
* `networkRef` and `subnetworkRef` become `network` and `subnetwork` paths,
|
|
195
|
+
* `name` in the project (the subnetwork in the service's region) and
|
|
196
|
+
* `external` as given. `tags` and anything else pass through. Pure.
|
|
197
|
+
*/
|
|
198
|
+
export declare function networkInterface(iface: unknown, project: string | undefined, region: string): unknown;
|
|
192
199
|
/**
|
|
193
200
|
* The email a CNRM `serviceAccountRef` names: `external` as given (an email,
|
|
194
201
|
* or a `projects/<p>/serviceAccounts/<email>` path), `name` as an account id
|
|
@@ -242,7 +249,6 @@ export declare function orderByReferences(resources: GcpResource[]): GcpResource
|
|
|
242
249
|
export declare function resolveGcpEndpoint(args?: {
|
|
243
250
|
endpoint?: string;
|
|
244
251
|
}, env?: NodeJS.ProcessEnv): string | undefined;
|
|
245
|
-
/** Resolve the project: `GOOGLE_CLOUD_PROJECT` env, else the CNRM project-id annotation. Pure. */
|
|
246
252
|
/**
|
|
247
253
|
* The project a resource names in `spec.projectRef.external` (#4201): a
|
|
248
254
|
* project id or `projects/<id>`. A `GCP.ProjectId` pseudo-parameter there
|
|
@@ -250,7 +256,14 @@ export declare function resolveGcpEndpoint(args?: {
|
|
|
250
256
|
* `GCP_PROJECT_ID`, as the serializer does.
|
|
251
257
|
*/
|
|
252
258
|
export declare function projectRefProject(spec: Record<string, unknown> | undefined, env?: NodeJS.ProcessEnv): string | undefined;
|
|
259
|
+
/**
|
|
260
|
+
* The project a resource is applied in (#4252): its own `spec.projectRef.external`,
|
|
261
|
+
* else its project-id annotation (where chant.config's `gcp.project` is
|
|
262
|
+
* written at build), else `GCP_PROJECT_ID`, else `GOOGLE_CLOUD_PROJECT`. Pure.
|
|
263
|
+
*/
|
|
253
264
|
export declare function resolveGcpProject(resource: GcpResource, env?: NodeJS.ProcessEnv): string;
|
|
265
|
+
/** The error every stage gives when no project resolves. */
|
|
266
|
+
export declare const NO_PROJECT = "no GCP project \u2014 set gcp.project in chant.config, GCP_PROJECT_ID or GOOGLE_CLOUD_PROJECT, or the resource's spec.projectRef.external";
|
|
254
267
|
/** Injectable HTTP client — mirrors argo's injectable fetcher so tests avoid the network. */
|
|
255
268
|
export type GcpHttp = (method: string, url: string, body?: unknown, signal?: AbortSignal) => Promise<{
|
|
256
269
|
status: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gcp-apply.d.ts","sourceRoot":"","sources":["../../../src/op/activities/gcp-apply.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gcp-apply.d.ts","sourceRoot":"","sources":["../../../src/op/activities/gcp-apply.ts"],"names":[],"mappings":"AAgBA,OAAO,EAE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AE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAoB3D;AAED;;;;;GAKG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,YAAY,EAClB,MAAM,CAAC,EAAE,WAAW,EACpB,IAAI,GAAE,OAAqB,GAC1B,OAAO,CAAC;IACT,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACjE;;2EAEuE;IACvE,YAAY,EAAE,eAAe,EAAE,CAAC;CACjC,CAAC,CA2BD"}
|
|
@@ -4,7 +4,7 @@ import { sleep } from "@intentius/chant/op";
|
|
|
4
4
|
import { hasOwnershipMarker, OWNERSHIP_MANAGED_BY_VALUE } from "@intentius/chant/ownership";
|
|
5
5
|
import { GCP_RESOURCE_OWNERSHIP_KEYS } from "../../ownership.js";
|
|
6
6
|
import { iamPolicyMemberMapper } from "./gcp-iam.js";
|
|
7
|
-
import { backendServiceMapper, computeAddressMapper, forwardingRuleMapper, regionNetworkEndpointGroupMapper, targetHttpProxyMapper, urlMapMapper, } from "./gcp-compute.js";
|
|
7
|
+
import { backendServiceMapper, computeAddressMapper, forwardingRuleMapper, networkMapper, subnetworkMapper, regionNetworkEndpointGroupMapper, targetHttpProxyMapper, urlMapMapper, } from "./gcp-compute.js";
|
|
8
8
|
import { applyResult, } from "@intentius/chant/apply";
|
|
9
9
|
const PROJECT_ID_ANNOTATION = "cnrm.cloud.google.com/project-id";
|
|
10
10
|
/**
|
|
@@ -157,9 +157,40 @@ export function cloudRunServiceBody(resource, project) {
|
|
|
157
157
|
return body;
|
|
158
158
|
const { serviceAccountRef, ...template } = spec.template;
|
|
159
159
|
const email = serviceAccountEmail(serviceAccountRef, project);
|
|
160
|
-
|
|
160
|
+
const out = email ? { ...template, serviceAccount: email } : { ...template };
|
|
161
|
+
const vpcAccess = out.vpcAccess;
|
|
162
|
+
if (vpcAccess && Array.isArray(vpcAccess.networkInterfaces)) {
|
|
163
|
+
const region = (resource.spec ?? {}).location ?? "us-central1";
|
|
164
|
+
out.vpcAccess = { ...vpcAccess, networkInterfaces: vpcAccess.networkInterfaces.map((i) => networkInterface(i, project, region)) };
|
|
165
|
+
}
|
|
166
|
+
body.template = out;
|
|
161
167
|
return body;
|
|
162
168
|
}
|
|
169
|
+
/**
|
|
170
|
+
* A CNRM Direct VPC egress interface as Cloud Run v2 takes it (#4249):
|
|
171
|
+
* `networkRef` and `subnetworkRef` become `network` and `subnetwork` paths,
|
|
172
|
+
* `name` in the project (the subnetwork in the service's region) and
|
|
173
|
+
* `external` as given. `tags` and anything else pass through. Pure.
|
|
174
|
+
*/
|
|
175
|
+
export function networkInterface(iface, project, region) {
|
|
176
|
+
if (!iface || typeof iface !== "object")
|
|
177
|
+
return iface;
|
|
178
|
+
const { networkRef, subnetworkRef, ...rest } = iface;
|
|
179
|
+
const path = (ref, scoped, key) => {
|
|
180
|
+
if (!ref)
|
|
181
|
+
return undefined;
|
|
182
|
+
if (ref.external)
|
|
183
|
+
return ref.external;
|
|
184
|
+
if (!ref.name)
|
|
185
|
+
return undefined;
|
|
186
|
+
if (!project)
|
|
187
|
+
throw new Error(`${key} { name: "${ref.name}" } needs a project to form its path`);
|
|
188
|
+
return scoped(project, ref.name);
|
|
189
|
+
};
|
|
190
|
+
const network = path(networkRef, (p, n) => `projects/${p}/global/networks/${n}`, "networkRef");
|
|
191
|
+
const subnetwork = path(subnetworkRef, (p, n) => `projects/${p}/regions/${region}/subnetworks/${n}`, "subnetworkRef");
|
|
192
|
+
return { ...rest, ...(network ? { network } : {}), ...(subnetwork ? { subnetwork } : {}) };
|
|
193
|
+
}
|
|
163
194
|
/**
|
|
164
195
|
* The email a CNRM `serviceAccountRef` names: `external` as given (an email,
|
|
165
196
|
* or a `projects/<p>/serviceAccounts/<email>` path), `name` as an account id
|
|
@@ -295,6 +326,8 @@ export const MAPPERS = {
|
|
|
295
326
|
ComputeURLMap: urlMapMapper,
|
|
296
327
|
ComputeTargetHTTPProxy: targetHttpProxyMapper,
|
|
297
328
|
ComputeForwardingRule: forwardingRuleMapper,
|
|
329
|
+
ComputeNetwork: networkMapper,
|
|
330
|
+
ComputeSubnetwork: subnetworkMapper,
|
|
298
331
|
};
|
|
299
332
|
/**
|
|
300
333
|
* Collect the local resource names this resource references via CNRM `*Ref`
|
|
@@ -319,6 +352,8 @@ const REF_KINDS = {
|
|
|
319
352
|
backendServiceRef: "ComputeBackendService",
|
|
320
353
|
urlMapRef: "ComputeURLMap",
|
|
321
354
|
targetHTTPProxyRef: "ComputeTargetHTTPProxy",
|
|
355
|
+
networkRef: "ComputeNetwork",
|
|
356
|
+
subnetworkRef: "ComputeSubnetwork",
|
|
322
357
|
};
|
|
323
358
|
/** The local resources this resource references via `*Ref` fields, each with its kind when known. Pure. */
|
|
324
359
|
export function referencedResources(resource) {
|
|
@@ -390,7 +425,6 @@ export function orderByReferences(resources) {
|
|
|
390
425
|
export function resolveGcpEndpoint(args = {}, env = process.env) {
|
|
391
426
|
return args.endpoint || env.GCP_ENDPOINT_URL || undefined;
|
|
392
427
|
}
|
|
393
|
-
/** Resolve the project: `GOOGLE_CLOUD_PROJECT` env, else the CNRM project-id annotation. Pure. */
|
|
394
428
|
/**
|
|
395
429
|
* The project a resource names in `spec.projectRef.external` (#4201): a
|
|
396
430
|
* project id or `projects/<id>`. A `GCP.ProjectId` pseudo-parameter there
|
|
@@ -412,15 +446,22 @@ export function projectRefProject(spec, env = process.env) {
|
|
|
412
446
|
return undefined;
|
|
413
447
|
return external.startsWith("projects/") ? external.slice("projects/".length).split("/")[0] : external;
|
|
414
448
|
}
|
|
449
|
+
/**
|
|
450
|
+
* The project a resource is applied in (#4252): its own `spec.projectRef.external`,
|
|
451
|
+
* else its project-id annotation (where chant.config's `gcp.project` is
|
|
452
|
+
* written at build), else `GCP_PROJECT_ID`, else `GOOGLE_CLOUD_PROJECT`. Pure.
|
|
453
|
+
*/
|
|
415
454
|
export function resolveGcpProject(resource, env = process.env) {
|
|
416
455
|
const project = projectRefProject(resource.spec, env) ||
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
456
|
+
resource.metadata?.annotations?.[PROJECT_ID_ANNOTATION] ||
|
|
457
|
+
env.GCP_PROJECT_ID ||
|
|
458
|
+
env.GOOGLE_CLOUD_PROJECT;
|
|
459
|
+
if (!project)
|
|
460
|
+
throw new Error(NO_PROJECT);
|
|
422
461
|
return project;
|
|
423
462
|
}
|
|
463
|
+
/** The error every stage gives when no project resolves. */
|
|
464
|
+
export const NO_PROJECT = `no GCP project — set gcp.project in chant.config, GCP_PROJECT_ID or GOOGLE_CLOUD_PROJECT, or the resource's spec.projectRef.external`;
|
|
424
465
|
const defaultHttp = async (method, url, body, signal) => {
|
|
425
466
|
const res = await fetch(url, {
|
|
426
467
|
method,
|
|
@@ -31,6 +31,14 @@ export declare function computeLabels(labels: Record<string, string> | undefined
|
|
|
31
31
|
export declare function addressBody(resource: GcpResource, ctx: ComputeCtx): Obj;
|
|
32
32
|
/** ComputeRegionNetworkEndpointGroup → regionNetworkEndpointGroups.insert body (serverless NEGs). Pure. */
|
|
33
33
|
export declare function negBody(resource: GcpResource, ctx: ComputeCtx): Obj;
|
|
34
|
+
/**
|
|
35
|
+
* ComputeNetwork → networks.insert body. A network is global. CNRM's
|
|
36
|
+
* `autoCreateSubnetworks` defaults to false, where compute's default is true,
|
|
37
|
+
* so it is always sent. Pure.
|
|
38
|
+
*/
|
|
39
|
+
export declare function networkBody(resource: GcpResource): Obj;
|
|
40
|
+
/** ComputeSubnetwork → subnetworks.insert body. CNRM's `secondaryIpRange` and `logConfig` become compute's `secondaryIpRanges` and an enabled `logConfig`. Pure. */
|
|
41
|
+
export declare function subnetworkBody(resource: GcpResource, ctx: ComputeCtx): Obj;
|
|
34
42
|
/** ComputeBackendService → backendServices.insert body. Pure. */
|
|
35
43
|
export declare function backendServiceBody(resource: GcpResource, ctx: ComputeCtx): Obj;
|
|
36
44
|
/** ComputeURLMap → urlMaps.insert body. Pure. */
|
|
@@ -52,5 +60,7 @@ export declare const backendServiceMapper: ResourceMapper;
|
|
|
52
60
|
export declare const urlMapMapper: ResourceMapper;
|
|
53
61
|
export declare const targetHttpProxyMapper: ResourceMapper;
|
|
54
62
|
export declare const forwardingRuleMapper: ResourceMapper;
|
|
63
|
+
export declare const networkMapper: ResourceMapper;
|
|
64
|
+
export declare const subnetworkMapper: ResourceMapper;
|
|
55
65
|
export {};
|
|
56
66
|
//# sourceMappingURL=gcp-compute.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gcp-compute.d.ts","sourceRoot":"","sources":["../../../src/op/activities/gcp-compute.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gcp-compute.d.ts","sourceRoot":"","sources":["../../../src/op/activities/gcp-compute.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE9E,eAAO,MAAM,YAAY,mCAAmC,CAAC;AAI7D,KAAK,GAAG,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAC/D,KAAK,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAqBnC,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;CACnC;AAED,wGAAwG;AACxG,wBAAgB,OAAO,CAAC,IAAI,EAAE,GAAG,GAAG,SAAS,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAG3F;AAMD,4EAA4E;AAC5E,wBAAgB,WAAW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