@noodleseed/one 0.38.1 → 0.40.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/commands/billing-apply-ops.d.ts +2 -0
- package/dist/commands/billing-apply-ops.d.ts.map +1 -0
- package/dist/commands/billing-apply-ops.js +224 -0
- package/dist/commands/billing-apply-ops.js.map +1 -0
- package/dist/commands/billing-migration-files.d.ts +13 -0
- package/dist/commands/billing-migration-files.d.ts.map +1 -0
- package/dist/commands/billing-migration-files.js +84 -0
- package/dist/commands/billing-migration-files.js.map +1 -0
- package/dist/commands/billing-ops.d.ts +1 -1
- package/dist/commands/billing-ops.d.ts.map +1 -1
- package/dist/commands/billing-ops.js +13 -31
- package/dist/commands/billing-ops.js.map +1 -1
- package/dist/commands/billing-read-ops.d.ts +3 -0
- package/dist/commands/billing-read-ops.d.ts.map +1 -0
- package/dist/commands/billing-read-ops.js +289 -0
- package/dist/commands/billing-read-ops.js.map +1 -0
- package/dist/commands/catalog-data-resources.d.ts.map +1 -1
- package/dist/commands/catalog-data-resources.js +25 -2
- package/dist/commands/catalog-data-resources.js.map +1 -1
- package/dist/commands/catalog.d.ts.map +1 -1
- package/dist/commands/catalog.js +1 -0
- package/dist/commands/catalog.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/widget-scaffold-template.d.ts.map +1 -1
- package/dist/widget-scaffold-template.js +9 -0
- package/dist/widget-scaffold-template.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js +3 -3
- package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-embedded-assistant-ref.d.ts.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-embedded-assistant-ref.js +28 -0
- package/node_modules/@noodle-borg/agent-kit/dist/skill-embedded-assistant-ref.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
- package/node_modules/@noodle-borg/authoring/dist/assistant.d.ts +44 -0
- package/node_modules/@noodle-borg/authoring/dist/assistant.d.ts.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/assistant.js.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/index.d.ts +1 -1
- package/node_modules/@noodle-borg/authoring/dist/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/server.js +6 -1
- package/node_modules/@noodle-borg/authoring/dist/server.js.map +1 -1
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts +83 -0
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts.map +1 -1
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js +82 -14
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js.map +1 -1
- package/node_modules/@noodle-borg/module-audit/dist/index.d.ts +2 -1
- package/node_modules/@noodle-borg/module-audit/dist/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/module-audit/dist/index.js +1 -1
- package/node_modules/@noodle-borg/module-audit/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/module-audit/dist/postgres-audit.d.ts +12 -3
- package/node_modules/@noodle-borg/module-audit/dist/postgres-audit.d.ts.map +1 -1
- package/node_modules/@noodle-borg/module-audit/dist/postgres-audit.js +30 -20
- package/node_modules/@noodle-borg/module-audit/dist/postgres-audit.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/in-memory.d.ts +4 -1
- package/node_modules/@noodle-borg/service/dist/billing/in-memory.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/in-memory.js +18 -0
- package/node_modules/@noodle-borg/service/dist/billing/in-memory.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/migration-apply.d.ts +98 -0
- package/node_modules/@noodle-borg/service/dist/billing/migration-apply.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/migration-apply.js +194 -0
- package/node_modules/@noodle-borg/service/dist/billing/migration-apply.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/migration-contract.d.ts +79 -0
- package/node_modules/@noodle-borg/service/dist/billing/migration-contract.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/migration-contract.js +86 -0
- package/node_modules/@noodle-borg/service/dist/billing/migration-contract.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/migration.d.ts +4 -75
- package/node_modules/@noodle-borg/service/dist/billing/migration.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/migration.js +19 -74
- package/node_modules/@noodle-borg/service/dist/billing/migration.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres-migration-support.d.ts +36 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-migration-support.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-migration-support.js +122 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-migration-support.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-migration.d.ts +9 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-migration.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-migration.js +265 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-migration.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-read.d.ts +7 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-read.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-read.js +55 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-read.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-schema.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres-schema.js +71 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-schema.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres.d.ts +7 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres.js +21 -9
- package/node_modules/@noodle-borg/service/dist/billing/postgres.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/read-contract.d.ts +268 -0
- package/node_modules/@noodle-borg/service/dist/billing/read-contract.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/read-contract.js +138 -0
- package/node_modules/@noodle-borg/service/dist/billing/read-contract.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/store.d.ts +12 -0
- package/node_modules/@noodle-borg/service/dist/billing/store.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/index.d.ts +4 -2
- package/node_modules/@noodle-borg/service/dist/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/index.js +3 -1
- package/node_modules/@noodle-borg/service/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/modules/host.js +3 -0
- package/node_modules/@noodle-borg/service/dist/modules/host.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/options.d.ts +13 -4
- package/node_modules/@noodle-borg/service/dist/options.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/billing-read.d.ts +12 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing-read.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing-read.js +202 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing-read.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing.d.ts +10 -1
- package/node_modules/@noodle-borg/service/dist/routes/billing.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/billing.js +89 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/commercial-dispatch.d.ts +4 -1
- package/node_modules/@noodle-borg/service/dist/routes/commercial-dispatch.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/commercial-dispatch.js +54 -2
- package/node_modules/@noodle-borg/service/dist/routes/commercial-dispatch.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/paths.d.ts +8 -0
- package/node_modules/@noodle-borg/service/dist/routes/paths.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/paths.js +25 -0
- package/node_modules/@noodle-borg/service/dist/routes/paths.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/serve.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/serve.js +20 -6
- package/node_modules/@noodle-borg/service/dist/serve.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/service.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/service.js +7 -4
- package/node_modules/@noodle-borg/service/dist/service.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/audit.d.ts +8 -0
- package/node_modules/@noodle-borg/service/dist/store/audit.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/audit.js +15 -0
- package/node_modules/@noodle-borg/service/dist/store/audit.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-apps.d.ts +4 -2
- package/node_modules/@noodle-borg/service/dist/store/postgres-apps.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-apps.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-billing.d.ts +11 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-billing.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-billing.js +17 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-billing.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-schema.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-schema.js +2 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-schema.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-signup.d.ts +4 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-signup.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-signup.js +10 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-signup.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres.d.ts +2 -2
- package/node_modules/@noodle-borg/service/dist/store/postgres.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres.js +2 -2
- package/node_modules/@noodle-borg/service/dist/store/postgres.js.map +1 -1
- package/node_modules/@noodle-borg/wire-contracts/dist/assistant.d.ts +3 -2
- package/node_modules/@noodle-borg/wire-contracts/dist/assistant.d.ts.map +1 -1
- package/node_modules/@noodle-borg/wire-contracts/dist/assistant.js +3 -2
- package/node_modules/@noodle-borg/wire-contracts/dist/assistant.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-apply-ops.d.ts","sourceRoot":"","sources":["../../src/commands/billing-apply-ops.ts"],"names":[],"mappings":"AA+BA,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CA8GjB"}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { resolveControlPlaneToken, ServiceRequestError, serviceJson } from '../control-plane.js';
|
|
2
|
+
import { confirm, isInteractive } from '../prompts.js';
|
|
3
|
+
import { approvedPreviewFileFailure, mappingFileFailure, planEvidenceFileFailure, readApprovedPreview, readMappingRequest, readPlanEvidence, } from './billing-migration-files.js';
|
|
4
|
+
import { EXIT, printJsonOk } from './output.js';
|
|
5
|
+
import { printCliFailure, serviceFailure } from './shared.js';
|
|
6
|
+
export async function runBillingMigrationApply(rest, env, home) {
|
|
7
|
+
const json = rest.includes('--json');
|
|
8
|
+
const parsed = parseBillingApplyArgs(rest);
|
|
9
|
+
if (!parsed.ok)
|
|
10
|
+
return printCliFailure('billing migration apply', parsed.error, json);
|
|
11
|
+
const args = parsed.args;
|
|
12
|
+
if (!args.yes && (args.json || !isInteractive())) {
|
|
13
|
+
return printCliFailure('billing migration apply', confirmationRequired(args), args.json);
|
|
14
|
+
}
|
|
15
|
+
let mapping;
|
|
16
|
+
try {
|
|
17
|
+
mapping = await readMappingRequest(args.file);
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
return printCliFailure('billing migration apply', mappingFileFailure(args.file, error), args.json);
|
|
21
|
+
}
|
|
22
|
+
let approved;
|
|
23
|
+
try {
|
|
24
|
+
approved = await readApprovedPreview(args.previewFile);
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
return printCliFailure('billing migration apply', approvedPreviewFileFailure(args.previewFile, error), args.json);
|
|
28
|
+
}
|
|
29
|
+
if (!approved.preview.ready) {
|
|
30
|
+
return printCliFailure('billing migration apply', blockedApprovedPreview(args.previewFile, approved.preview.blockers), args.json);
|
|
31
|
+
}
|
|
32
|
+
let legacyPlanEvidence;
|
|
33
|
+
try {
|
|
34
|
+
legacyPlanEvidence = await readPlanEvidence(args.planEvidenceFile);
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
return printCliFailure('billing migration apply', planEvidenceFileFailure(args.planEvidenceFile, error), args.json);
|
|
38
|
+
}
|
|
39
|
+
if (!args.yes) {
|
|
40
|
+
const organizations = approved.preview.organizations.length + approved.preview.linkedOrganizations.length;
|
|
41
|
+
const confirmed = await confirm(`Prepare shadow billing data for ${organizations} organizations? This writes billing accounts and links, but does not start enforcement, usage metering, or the 90-day grant clock.`, { initial: false });
|
|
42
|
+
if (!confirmed) {
|
|
43
|
+
console.error('billing migration apply: cancelled');
|
|
44
|
+
return EXIT.USAGE;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const resolved = await resolveControlPlaneToken({
|
|
48
|
+
serviceFlag: args.service,
|
|
49
|
+
authFlag: args.authToken,
|
|
50
|
+
env,
|
|
51
|
+
home,
|
|
52
|
+
});
|
|
53
|
+
if (resolved.token === undefined) {
|
|
54
|
+
return printCliFailure('billing migration apply', missingLogin(), args.json);
|
|
55
|
+
}
|
|
56
|
+
if (normalizeService(approved.service) !== resolved.serviceUrl ||
|
|
57
|
+
normalizeService(legacyPlanEvidence.service) !== resolved.serviceUrl) {
|
|
58
|
+
return printCliFailure('billing migration apply', evidenceServiceMismatch(resolved.serviceUrl), args.json);
|
|
59
|
+
}
|
|
60
|
+
const request = {
|
|
61
|
+
schemaVersion: 1,
|
|
62
|
+
mode: args.mode,
|
|
63
|
+
mappings: mapping.mappings ?? [],
|
|
64
|
+
expectedPreviewChecksum: approved.preview.previewChecksum,
|
|
65
|
+
legacyPlanEvidence,
|
|
66
|
+
idempotencyKey: args.idempotencyKey,
|
|
67
|
+
reason: args.reason,
|
|
68
|
+
confirmed: true,
|
|
69
|
+
};
|
|
70
|
+
try {
|
|
71
|
+
const body = await serviceJson(`${resolved.serviceUrl}/v1/billing-accounts/migrations/legacy/apply`, resolved.token, {
|
|
72
|
+
method: 'POST',
|
|
73
|
+
headers: { 'content-type': 'application/json' },
|
|
74
|
+
body: JSON.stringify(request),
|
|
75
|
+
});
|
|
76
|
+
if (args.json)
|
|
77
|
+
printJsonOk({ service: resolved.serviceUrl, migration: body.data });
|
|
78
|
+
else
|
|
79
|
+
printHumanApply(body.data);
|
|
80
|
+
return EXIT.OK;
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
return printCliFailure('billing migration apply', applyServiceFailure(error, args), args.json);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function printHumanApply(result) {
|
|
87
|
+
console.log(`Billing migration: ${result.replayed ? 'ALREADY PREPARED' : 'PREPARED'}`);
|
|
88
|
+
console.log(`Organizations: ${result.counts.organizations}`);
|
|
89
|
+
console.log(`Billing accounts: ${result.counts.accountsCreated} created, ${result.counts.accountsReused} reused`);
|
|
90
|
+
console.log(`Organization links: ${result.counts.linksCreated} created, ${result.counts.linksPreserved} preserved`);
|
|
91
|
+
console.log(`Migration ID: ${result.migrationId}`);
|
|
92
|
+
if (result.replayed) {
|
|
93
|
+
console.log('The existing shadow preparation was returned; no duplicate writes were made.');
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
console.log('Billing data was written. Enforcement remains unchanged.');
|
|
97
|
+
}
|
|
98
|
+
console.log('Usage metering has not started. No 90-day grant clock has started.');
|
|
99
|
+
}
|
|
100
|
+
function parseBillingApplyArgs(rest) {
|
|
101
|
+
const values = new Map();
|
|
102
|
+
let json = false;
|
|
103
|
+
let yes = false;
|
|
104
|
+
const valueFlags = new Set([
|
|
105
|
+
'--file',
|
|
106
|
+
'--preview-file',
|
|
107
|
+
'--plan-evidence',
|
|
108
|
+
'--mode',
|
|
109
|
+
'--reason',
|
|
110
|
+
'--idempotency-key',
|
|
111
|
+
'--service',
|
|
112
|
+
'--auth-token',
|
|
113
|
+
]);
|
|
114
|
+
for (let index = 0; index < rest.length; index++) {
|
|
115
|
+
const arg = rest[index];
|
|
116
|
+
if (arg === '--json')
|
|
117
|
+
json = true;
|
|
118
|
+
else if (arg === '--yes')
|
|
119
|
+
yes = true;
|
|
120
|
+
else if (arg !== undefined && valueFlags.has(arg)) {
|
|
121
|
+
const value = rest[index + 1];
|
|
122
|
+
if (value === undefined || value.length === 0 || value.startsWith('--')) {
|
|
123
|
+
return { ok: false, error: applyUsage(`a value for ${arg} is required`) };
|
|
124
|
+
}
|
|
125
|
+
if (values.has(arg))
|
|
126
|
+
return { ok: false, error: applyUsage(`${arg} may be supplied once`) };
|
|
127
|
+
values.set(arg, value);
|
|
128
|
+
index++;
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
return { ok: false, error: applyUsage(`unknown argument: ${arg ?? ''}`) };
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
for (const flag of [
|
|
135
|
+
'--file',
|
|
136
|
+
'--preview-file',
|
|
137
|
+
'--plan-evidence',
|
|
138
|
+
'--mode',
|
|
139
|
+
'--reason',
|
|
140
|
+
'--idempotency-key',
|
|
141
|
+
]) {
|
|
142
|
+
if (!values.has(flag))
|
|
143
|
+
return { ok: false, error: applyUsage(`${flag} is required`) };
|
|
144
|
+
}
|
|
145
|
+
if (values.get('--mode') !== 'shadow') {
|
|
146
|
+
return { ok: false, error: applyUsage('--mode must be shadow') };
|
|
147
|
+
}
|
|
148
|
+
return {
|
|
149
|
+
ok: true,
|
|
150
|
+
args: {
|
|
151
|
+
file: values.get('--file'),
|
|
152
|
+
previewFile: values.get('--preview-file'),
|
|
153
|
+
planEvidenceFile: values.get('--plan-evidence'),
|
|
154
|
+
mode: 'shadow',
|
|
155
|
+
reason: values.get('--reason'),
|
|
156
|
+
idempotencyKey: values.get('--idempotency-key'),
|
|
157
|
+
...(values.has('--service') ? { service: values.get('--service') } : {}),
|
|
158
|
+
...(values.has('--auth-token') ? { authToken: values.get('--auth-token') } : {}),
|
|
159
|
+
json,
|
|
160
|
+
yes,
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
function applyUsage(message) {
|
|
165
|
+
return {
|
|
166
|
+
code: 'usage',
|
|
167
|
+
message,
|
|
168
|
+
cause: 'Shadow preparation requires the reviewed mapping, preview, and plan-evidence files.',
|
|
169
|
+
fix: 'Supply every required flag and use only --mode shadow.',
|
|
170
|
+
next: 'noodle billing migration apply --file <mapping.json> --preview-file <ready-preview.json> --plan-evidence <plan-evidence.json> --mode shadow --reason <text> --idempotency-key <key> --yes',
|
|
171
|
+
exitCode: EXIT.USAGE,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
function confirmationRequired(args) {
|
|
175
|
+
return {
|
|
176
|
+
code: 'confirmation_required',
|
|
177
|
+
message: 'billing migration shadow apply requires confirmation',
|
|
178
|
+
cause: 'The operation writes billing accounts and organization links in shadow mode.',
|
|
179
|
+
fix: 'Review the private evidence, then re-run with --yes.',
|
|
180
|
+
next: `noodle billing migration apply --file ${args.file} --preview-file ${args.previewFile} --plan-evidence ${args.planEvidenceFile} --mode shadow --reason <text> --idempotency-key <key> --yes`,
|
|
181
|
+
exitCode: EXIT.USAGE,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function blockedApprovedPreview(file, blockers) {
|
|
185
|
+
const codes = blockers.map((blocker) => `${blocker.org}:${blocker.code}`).join(', ');
|
|
186
|
+
return {
|
|
187
|
+
code: 'approved_preview_blocked',
|
|
188
|
+
message: 'The approved billing migration preview is not READY.',
|
|
189
|
+
cause: codes.length > 0 ? codes : 'The saved preview is blocked.',
|
|
190
|
+
fix: 'Resolve every blocker and capture a new READY preview.',
|
|
191
|
+
next: `noodle billing migration preview --file <mapping.json> --json > ${file}`,
|
|
192
|
+
exitCode: EXIT.FAILURE,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
function evidenceServiceMismatch(service) {
|
|
196
|
+
return {
|
|
197
|
+
code: 'evidence_service_mismatch',
|
|
198
|
+
message: 'The private migration evidence targets a different service.',
|
|
199
|
+
cause: `The approved preview and plan evidence must both name ${service}.`,
|
|
200
|
+
fix: 'Re-capture both evidence files from the exact service being migrated.',
|
|
201
|
+
next: `noodle billing migration preview --service ${service} --file <mapping.json> --json`,
|
|
202
|
+
exitCode: EXIT.FAILURE,
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
function applyServiceFailure(error, args) {
|
|
206
|
+
const failure = serviceFailure('billing migration apply', error, `noodle billing migration apply --file ${args.file} --preview-file ${args.previewFile} --plan-evidence ${args.planEvidenceFile} --mode shadow --reason <text> --idempotency-key ${args.idempotencyKey} --yes`);
|
|
207
|
+
if (!(error instanceof ServiceRequestError) || error.code === undefined)
|
|
208
|
+
return failure;
|
|
209
|
+
return { ...failure, code: error.code, message: error.message, cause: error.message };
|
|
210
|
+
}
|
|
211
|
+
function missingLogin() {
|
|
212
|
+
return {
|
|
213
|
+
code: 'auth_required',
|
|
214
|
+
message: 'A control-plane login token is required.',
|
|
215
|
+
cause: 'No control-plane login token is available.',
|
|
216
|
+
fix: 'Sign in or pass an explicit auth token.',
|
|
217
|
+
next: 'noodle login',
|
|
218
|
+
exitCode: EXIT.AUTH,
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
function normalizeService(value) {
|
|
222
|
+
return value.replace(/\/+$/, '');
|
|
223
|
+
}
|
|
224
|
+
//# sourceMappingURL=billing-apply-ops.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-apply-ops.js","sourceRoot":"","sources":["../../src/commands/billing-apply-ops.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACjG,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EACL,0BAA0B,EAC1B,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAmB,eAAe,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAe/E,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,IAAuB,EACvB,GAAsB,EACtB,IAAY;IAEZ,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACrC,MAAM,MAAM,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAC3C,IAAI,CAAC,MAAM,CAAC,EAAE;QAAE,OAAO,eAAe,CAAC,yBAAyB,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACtF,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IAEzB,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC,EAAE,CAAC;QACjD,OAAO,eAAe,CAAC,yBAAyB,EAAE,oBAAoB,C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AAC,KAAa;IACrC,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type LegacyBillingMigrationPreview, type LegacyBillingMigrationRequest, type LegacyBillingPlanEvidence } from '@noodle-borg/service';
|
|
2
|
+
import type { CliFailure } from './shared.js';
|
|
3
|
+
export interface ApprovedLegacyBillingMigrationPreview {
|
|
4
|
+
readonly service: string;
|
|
5
|
+
readonly preview: LegacyBillingMigrationPreview;
|
|
6
|
+
}
|
|
7
|
+
export declare function readMappingRequest(file: string | undefined): Promise<LegacyBillingMigrationRequest>;
|
|
8
|
+
export declare function readApprovedPreview(file: string): Promise<ApprovedLegacyBillingMigrationPreview>;
|
|
9
|
+
export declare function readPlanEvidence(file: string): Promise<LegacyBillingPlanEvidence>;
|
|
10
|
+
export declare function mappingFileFailure(file: string | undefined, error: unknown): CliFailure;
|
|
11
|
+
export declare function approvedPreviewFileFailure(file: string, error: unknown): CliFailure;
|
|
12
|
+
export declare function planEvidenceFileFailure(file: string, error: unknown): CliFailure;
|
|
13
|
+
//# sourceMappingURL=billing-migration-files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-migration-files.d.ts","sourceRoot":"","sources":["../../src/commands/billing-migration-files.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,6BAA6B,EAClC,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,EAI/B,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,WAAW,qCAAqC;IACpD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,6BAA6B,CAAC;CACjD;AAED,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,GAAG,SAAS,GACvB,OAAO,CAAC,6BAA6B,CAAC,CAKxC;AAED,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,qCAAqC,CAAC,CAyBhD;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAEvF;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,UAAU,CAUvF;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,UAAU,CASnF;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,UAAU,CAShF"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { legacyBillingMigrationPreviewChecksum, parseLegacyBillingMigrationPlanEvidence, parseLegacyBillingMigrationRequest, } from '@noodle-borg/service';
|
|
3
|
+
import { errorMessage } from '../diagnostics.js';
|
|
4
|
+
import { EXIT } from './output.js';
|
|
5
|
+
export async function readMappingRequest(file) {
|
|
6
|
+
if (file === undefined) {
|
|
7
|
+
return parseLegacyBillingMigrationRequest({ schemaVersion: 1, mappings: [] });
|
|
8
|
+
}
|
|
9
|
+
return parseLegacyBillingMigrationRequest(await readJsonFile(file, 'mapping'));
|
|
10
|
+
}
|
|
11
|
+
export async function readApprovedPreview(file) {
|
|
12
|
+
const value = await readJsonFile(file, 'approved preview');
|
|
13
|
+
if (!isRecord(value) || value.ok !== true || !isRecord(value.data)) {
|
|
14
|
+
throw new Error('expected the JSON envelope written by billing migration preview --json');
|
|
15
|
+
}
|
|
16
|
+
const { service, preview } = value.data;
|
|
17
|
+
if (typeof service !== 'string' ||
|
|
18
|
+
!isRecord(preview) ||
|
|
19
|
+
preview.schemaVersion !== 1 ||
|
|
20
|
+
typeof preview.ready !== 'boolean' ||
|
|
21
|
+
!Array.isArray(preview.organizations) ||
|
|
22
|
+
!Array.isArray(preview.linkedOrganizations) ||
|
|
23
|
+
!Array.isArray(preview.fundingSets) ||
|
|
24
|
+
!Array.isArray(preview.blockers) ||
|
|
25
|
+
!isRecord(preview.grantPolicy) ||
|
|
26
|
+
!isSha256(preview.previewChecksum)) {
|
|
27
|
+
throw new Error('approved preview file does not match the billing migration preview schema');
|
|
28
|
+
}
|
|
29
|
+
const approvedPreview = preview;
|
|
30
|
+
if (legacyBillingMigrationPreviewChecksum(approvedPreview) !== approvedPreview.previewChecksum) {
|
|
31
|
+
throw new Error('approved preview checksum does not match its contents');
|
|
32
|
+
}
|
|
33
|
+
return { service, preview: approvedPreview };
|
|
34
|
+
}
|
|
35
|
+
export async function readPlanEvidence(file) {
|
|
36
|
+
return parseLegacyBillingMigrationPlanEvidence(await readJsonFile(file, 'plan evidence'));
|
|
37
|
+
}
|
|
38
|
+
export function mappingFileFailure(file, error) {
|
|
39
|
+
const path = file ?? '<mapping.json>';
|
|
40
|
+
return {
|
|
41
|
+
code: 'invalid_mapping_file',
|
|
42
|
+
message: `Cannot use billing migration mapping file ${path}.`,
|
|
43
|
+
cause: errorMessage(error),
|
|
44
|
+
fix: 'Ensure the file exists, is readable JSON, and matches the billing migration schema.',
|
|
45
|
+
next: `noodle billing migration preview --file ${path}`,
|
|
46
|
+
exitCode: EXIT.FAILURE,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export function approvedPreviewFileFailure(file, error) {
|
|
50
|
+
return {
|
|
51
|
+
code: 'invalid_preview_file',
|
|
52
|
+
message: `Cannot use approved billing migration preview file ${file}.`,
|
|
53
|
+
cause: errorMessage(error),
|
|
54
|
+
fix: 'Save a READY JSON preview from the same service and do not edit it.',
|
|
55
|
+
next: `noodle billing migration preview --file <mapping.json> --json > ${file}`,
|
|
56
|
+
exitCode: EXIT.FAILURE,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export function planEvidenceFileFailure(file, error) {
|
|
60
|
+
return {
|
|
61
|
+
code: 'invalid_plan_evidence_file',
|
|
62
|
+
message: `Cannot use legacy billing plan evidence file ${file}.`,
|
|
63
|
+
cause: errorMessage(error),
|
|
64
|
+
fix: 'Ensure the file is readable JSON and contains a complete default-Free reconciliation.',
|
|
65
|
+
next: 'Re-capture and review the authoritative legacy plan projections.',
|
|
66
|
+
exitCode: EXIT.FAILURE,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
async function readJsonFile(file, label) {
|
|
70
|
+
const text = await readFile(file, 'utf8');
|
|
71
|
+
try {
|
|
72
|
+
return JSON.parse(text);
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
throw new Error(`${label} file is not valid JSON: ${errorMessage(error)}`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function isRecord(value) {
|
|
79
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
80
|
+
}
|
|
81
|
+
function isSha256(value) {
|
|
82
|
+
return typeof value === 'string' && /^[a-f0-9]{64}$/.test(value);
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=billing-migration-files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-migration-files.js","sourceRoot":"","sources":["../../src/commands/billing-migration-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAIL,qCAAqC,EACrC,uCAAuC,EACvC,kCAAkC,GACnC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAQnC,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,IAAwB;IAExB,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,kCAAkC,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;IAChF,CAAC;IACD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,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC1C,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAY,CAAC;IACrC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,4BAA4B,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC7E,CAAC;AACH,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACnE,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/** Operator-only billing migration commands.
|
|
1
|
+
/** Operator-only billing migration commands. */
|
|
2
2
|
export declare function runBilling(rest: readonly string[], env: NodeJS.ProcessEnv, home: string): Promise<number>;
|
|
3
3
|
//# sourceMappingURL=billing-ops.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing-ops.d.ts","sourceRoot":"","sources":["../../src/commands/billing-ops.ts"],"names":[],"mappings":"AAkBA,
|
|
1
|
+
{"version":3,"file":"billing-ops.d.ts","sourceRoot":"","sources":["../../src/commands/billing-ops.ts"],"names":[],"mappings":"AAkBA,gDAAgD;AAChD,wBAAsB,UAAU,CAC9B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CA0DjB"}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
import { readFile } from 'node:fs/promises';
|
|
2
|
-
import { parseLegacyBillingMigrationRequest, } from '@noodle-borg/service';
|
|
3
1
|
import { resolveControlPlaneToken, serviceJson } from '../control-plane.js';
|
|
4
|
-
import {
|
|
2
|
+
import { runBillingMigrationApply } from './billing-apply-ops.js';
|
|
3
|
+
import { mappingFileFailure, readMappingRequest } from './billing-migration-files.js';
|
|
4
|
+
import { runBillingAccounts, runBillingOrg } from './billing-read-ops.js';
|
|
5
5
|
import { EXIT, printJsonOk } from './output.js';
|
|
6
6
|
import { printCliFailure, serviceFailure } from './shared.js';
|
|
7
|
-
/** Operator-only billing migration commands.
|
|
7
|
+
/** Operator-only billing migration commands. */
|
|
8
8
|
export async function runBilling(rest, env, home) {
|
|
9
9
|
const json = rest.includes('--json');
|
|
10
|
+
if (rest[0] === 'accounts')
|
|
11
|
+
return runBillingAccounts(rest.slice(1), env, home);
|
|
12
|
+
if (rest[0] === 'org')
|
|
13
|
+
return runBillingOrg(rest.slice(1), env, home);
|
|
14
|
+
if (rest[0] === 'migration' && rest[1] === 'apply') {
|
|
15
|
+
return runBillingMigrationApply(rest.slice(2), env, home);
|
|
16
|
+
}
|
|
10
17
|
if (rest[0] !== 'migration' || rest[1] !== 'preview') {
|
|
11
18
|
return printCliFailure('billing', billingUsage(), json);
|
|
12
19
|
}
|
|
@@ -46,31 +53,6 @@ export async function runBilling(rest, env, home) {
|
|
|
46
53
|
return printCliFailure('billing migration preview', serviceFailure('billing migration preview', error, 'noodle billing migration preview --file <mapping.json>'), args.json);
|
|
47
54
|
}
|
|
48
55
|
}
|
|
49
|
-
async function readMappingRequest(file) {
|
|
50
|
-
if (file === undefined) {
|
|
51
|
-
return parseLegacyBillingMigrationRequest({ schemaVersion: 1, mappings: [] });
|
|
52
|
-
}
|
|
53
|
-
const text = await readFile(file, 'utf8');
|
|
54
|
-
let value;
|
|
55
|
-
try {
|
|
56
|
-
value = JSON.parse(text);
|
|
57
|
-
}
|
|
58
|
-
catch (error) {
|
|
59
|
-
throw new Error(`mapping file is not valid JSON: ${error.message}`);
|
|
60
|
-
}
|
|
61
|
-
return parseLegacyBillingMigrationRequest(value);
|
|
62
|
-
}
|
|
63
|
-
function mappingFileFailure(file, error) {
|
|
64
|
-
const path = file ?? '<mapping.json>';
|
|
65
|
-
return {
|
|
66
|
-
code: 'invalid_mapping_file',
|
|
67
|
-
message: `Cannot use billing migration mapping file ${path}.`,
|
|
68
|
-
cause: errorMessage(error),
|
|
69
|
-
fix: 'Ensure the file exists, is readable JSON, and matches the billing migration schema.',
|
|
70
|
-
next: `noodle billing migration preview --file ${path}`,
|
|
71
|
-
exitCode: EXIT.FAILURE,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
56
|
function printHumanPreview(preview, file) {
|
|
75
57
|
console.log(`Billing migration preview: ${preview.ready ? 'READY' : 'BLOCKED'}`);
|
|
76
58
|
console.log(`Organizations requiring mapping: ${preview.organizations.length}`);
|
|
@@ -121,12 +103,12 @@ function parseBillingArgs(rest) {
|
|
|
121
103
|
},
|
|
122
104
|
};
|
|
123
105
|
}
|
|
124
|
-
function billingUsage(message = 'billing migration preview
|
|
106
|
+
function billingUsage(message = 'billing migration requires preview or apply') {
|
|
125
107
|
return {
|
|
126
108
|
code: 'usage',
|
|
127
109
|
message,
|
|
128
110
|
cause: 'The billing command or one of its arguments is invalid.',
|
|
129
|
-
fix: 'Run
|
|
111
|
+
fix: 'Run preview first; use apply only with reviewed private evidence.',
|
|
130
112
|
next: 'noodle billing migration preview [--file <mapping.json>] [--json]',
|
|
131
113
|
exitCode: EXIT.USAGE,
|
|
132
114
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing-ops.js","sourceRoot":"","sources":["../../src/commands/billing-ops.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"billing-ops.js","sourceRoot":"","sources":["../../src/commands/billing-ops.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM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,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACvC,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7C,GAAG,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACjD,IAAI;SACL;KACF,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,OAAO,GAAG,6CAA6C;IAC3E,OAAO;QACL,IAAI,EAAE,OAAO;QACb,OAAO;QACP,KAAK,EAAE,yDAAyD;QAChE,GAAG,EAAE,mEAAmE;QACxE,IAAI,EAAE,mEAAmE;QACzE,QAAQ,EAAE,IAAI,CAAC,KAAK;KACrB,CAAC;AACJ,CAAC;AAED,SAAS,YAAY;IACnB,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,0CAA0C;QACnD,KAAK,EAAE,4CAA4C;QACnD,GAAG,EAAE,yCAAyC;QAC9C,IAAI,EAAE,cAAc;QACpB,QAAQ,EAAE,IAAI,CAAC,IAAI;KACpB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function runBillingAccounts(rest: readonly string[], env: NodeJS.ProcessEnv, home: string): Promise<number>;
|
|
2
|
+
export declare function runBillingOrg(rest: readonly string[], env: NodeJS.ProcessEnv, home: string): Promise<number>;
|
|
3
|
+
//# sourceMappingURL=billing-read-ops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-read-ops.d.ts","sourceRoot":"","sources":["../../src/commands/billing-read-ops.ts"],"names":[],"mappings":"AAoBA,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CA+BjB;AAED,wBAAsB,aAAa,CACjC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CAwCjB"}
|