@supacloud/compiler 0.46.0 → 0.46.1
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/cli.js +191 -24
- package/dist/index.js +191 -24
- package/dist/migration-app-version.d.ts +1 -1
- package/dist/migration-elysia-version.d.ts +1 -1
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -17036,8 +17036,172 @@ var init_deployment_evidence = __esm(() => {
|
|
|
17036
17036
|
}, closed8);
|
|
17037
17037
|
});
|
|
17038
17038
|
|
|
17039
|
+
// node_modules/@supacloud/delivery/src/delivery-tuple.ts
|
|
17040
|
+
var sha2563, commit, isoDate2, DELIVERY_TUPLE_SCHEMA = "supacloud.fa-delivery-tuple.v1", FaDeliveryTupleSchema;
|
|
17041
|
+
var init_delivery_tuple = __esm(() => {
|
|
17042
|
+
init_build();
|
|
17043
|
+
init_value2();
|
|
17044
|
+
sha2563 = String2({ pattern: "^[a-f0-9]{64}$" });
|
|
17045
|
+
commit = String2({ pattern: "^(?:[a-f0-9]{40}|[a-f0-9]{64})$" });
|
|
17046
|
+
isoDate2 = String2({ minLength: 20, maxLength: 40 });
|
|
17047
|
+
FaDeliveryTupleSchema = _Object_({
|
|
17048
|
+
schema: Literal(DELIVERY_TUPLE_SCHEMA),
|
|
17049
|
+
customer: Literal("xigu-fa"),
|
|
17050
|
+
fa_commit: commit,
|
|
17051
|
+
cli: _Object_({
|
|
17052
|
+
version: String2({ pattern: "^\\d+\\.\\d+\\.\\d+$" })
|
|
17053
|
+
}, { additionalProperties: false }),
|
|
17054
|
+
platform_commit: commit,
|
|
17055
|
+
edge_runtime: _Object_({
|
|
17056
|
+
version: String2({ minLength: 1, maxLength: 128 }),
|
|
17057
|
+
artifact_sha256: sha2563
|
|
17058
|
+
}, { additionalProperties: false }),
|
|
17059
|
+
compatibility_window: _Object_({
|
|
17060
|
+
contract_schema: String2({ minLength: 1, maxLength: 128 }),
|
|
17061
|
+
starts_at: isoDate2,
|
|
17062
|
+
ends_at: isoDate2,
|
|
17063
|
+
old_client_supported: Boolean2(),
|
|
17064
|
+
partial_deployment_supported: Boolean2()
|
|
17065
|
+
}, { additionalProperties: false })
|
|
17066
|
+
}, { additionalProperties: false });
|
|
17067
|
+
});
|
|
17068
|
+
|
|
17069
|
+
// node_modules/@supacloud/delivery/src/contract-matrix.ts
|
|
17070
|
+
var closed9, sha2564, generation, versions, CONTRACT_MATRIX_SCHEMA = "supacloud.consumer-contract-matrix.v1", FA_CONTRACT_SCENARIOS, ConsumerContractMatrixSchema;
|
|
17071
|
+
var init_contract_matrix = __esm(() => {
|
|
17072
|
+
init_build();
|
|
17073
|
+
init_value2();
|
|
17074
|
+
closed9 = { additionalProperties: false };
|
|
17075
|
+
sha2564 = String2({ pattern: "^[a-f0-9]{64}$" });
|
|
17076
|
+
generation = Union([Literal("old"), Literal("new")]);
|
|
17077
|
+
versions = _Object_({ old: sha2564, new: sha2564 }, closed9);
|
|
17078
|
+
FA_CONTRACT_SCENARIOS = [
|
|
17079
|
+
"missing-display-field",
|
|
17080
|
+
"missing-authority-field",
|
|
17081
|
+
"added-field",
|
|
17082
|
+
"legacy-envelope",
|
|
17083
|
+
"lost-write-response",
|
|
17084
|
+
"downgrade"
|
|
17085
|
+
];
|
|
17086
|
+
ConsumerContractMatrixSchema = _Object_({
|
|
17087
|
+
schema: Literal(CONTRACT_MATRIX_SCHEMA),
|
|
17088
|
+
customer: Literal("xigu-fa"),
|
|
17089
|
+
baseline_tuple_sha256: sha2564,
|
|
17090
|
+
candidate_tuple_sha256: sha2564,
|
|
17091
|
+
artifacts: _Object_({ frontend: versions, functions: versions, database: versions }, closed9),
|
|
17092
|
+
cases: _Array_(_Object_({
|
|
17093
|
+
frontend: generation,
|
|
17094
|
+
functions: generation,
|
|
17095
|
+
database: generation,
|
|
17096
|
+
scenarios: _Array_(_Object_({
|
|
17097
|
+
name: Enum(FA_CONTRACT_SCENARIOS),
|
|
17098
|
+
expected: Union([Literal("compatible"), Literal("blocked-safely")])
|
|
17099
|
+
}, closed9), { minItems: FA_CONTRACT_SCENARIOS.length, maxItems: FA_CONTRACT_SCENARIOS.length })
|
|
17100
|
+
}, closed9), { minItems: 8, maxItems: 8 })
|
|
17101
|
+
}, closed9);
|
|
17102
|
+
});
|
|
17103
|
+
|
|
17104
|
+
// node_modules/@supacloud/delivery/src/fa-stability.ts
|
|
17105
|
+
var closed10, hash3, label, timestamp2, count2, environment2, FA_REQUIRED_ACCEPTANCE, FA_BUSINESS_OPERATIONS, operation, proof, FaBusinessObservationSchema, FaServiceObjectivesSchema, FaStabilityEvidenceSchema;
|
|
17106
|
+
var init_fa_stability = __esm(() => {
|
|
17107
|
+
init_build();
|
|
17108
|
+
init_value2();
|
|
17109
|
+
init_delivery_files();
|
|
17110
|
+
init_contract_matrix();
|
|
17111
|
+
init_delivery_tuple();
|
|
17112
|
+
closed10 = { additionalProperties: false };
|
|
17113
|
+
hash3 = String2({ pattern: "^[a-f0-9]{64}$" });
|
|
17114
|
+
label = String2({ minLength: 1, maxLength: 256, pattern: "\\S" });
|
|
17115
|
+
timestamp2 = String2({ minLength: 24, maxLength: 24 });
|
|
17116
|
+
count2 = Integer({ minimum: 0, maximum: Number.MAX_SAFE_INTEGER });
|
|
17117
|
+
environment2 = Union([Literal("test"), Literal("production")]);
|
|
17118
|
+
FA_REQUIRED_ACCEPTANCE = {
|
|
17119
|
+
login: "real-browser",
|
|
17120
|
+
permissions: "real-http",
|
|
17121
|
+
upload: "real-http",
|
|
17122
|
+
"async-task": "real-worker",
|
|
17123
|
+
deploy: "real-http",
|
|
17124
|
+
"database-migration": "real-database",
|
|
17125
|
+
schedule: "real-worker",
|
|
17126
|
+
rollback: "real-drill",
|
|
17127
|
+
"error-policy": "real-http",
|
|
17128
|
+
"alert-delivery": "real-drill"
|
|
17129
|
+
};
|
|
17130
|
+
FA_BUSINESS_OPERATIONS = ["login", "permissions", "upload", "async-task", "report", "deploy"];
|
|
17131
|
+
operation = Enum(FA_BUSINESS_OPERATIONS);
|
|
17132
|
+
proof = _Object_({
|
|
17133
|
+
path: String2({ pattern: "^[A-Za-z0-9_-][A-Za-z0-9_./-]{0,255}$" }),
|
|
17134
|
+
sha256: hash3
|
|
17135
|
+
}, closed10);
|
|
17136
|
+
FaBusinessObservationSchema = _Object_({
|
|
17137
|
+
id: String2({ pattern: "^[A-Za-z0-9_-]{1,128}$" }),
|
|
17138
|
+
tuple_sha256: hash3,
|
|
17139
|
+
operation,
|
|
17140
|
+
started_at: timestamp2,
|
|
17141
|
+
finished_at: timestamp2,
|
|
17142
|
+
outcome: Enum(["success", "failure", "timeout", "unknown"]),
|
|
17143
|
+
attempts: Integer({ minimum: 1, maximum: 1000 }),
|
|
17144
|
+
rollbacks: count2
|
|
17145
|
+
}, closed10);
|
|
17146
|
+
FaServiceObjectivesSchema = _Object_({
|
|
17147
|
+
status: Literal("approved"),
|
|
17148
|
+
owner: label,
|
|
17149
|
+
approval_reference: label,
|
|
17150
|
+
approved_at: timestamp2,
|
|
17151
|
+
project_ref: String2({ pattern: "^[a-z0-9-]{1,20}$" }),
|
|
17152
|
+
environment: environment2,
|
|
17153
|
+
alert_route: label,
|
|
17154
|
+
window_hours: Number2({ exclusiveMinimum: 0, maximum: 8760 }),
|
|
17155
|
+
max_evidence_age_hours: Number2({ exclusiveMinimum: 0, maximum: 168 }),
|
|
17156
|
+
operations: _Array_(_Object_({
|
|
17157
|
+
operation,
|
|
17158
|
+
minimum_samples: Integer({ minimum: 1, maximum: Number.MAX_SAFE_INTEGER }),
|
|
17159
|
+
availability_percent: Number2({ exclusiveMinimum: 0, maximum: 100 }),
|
|
17160
|
+
p95_ms: Number2({ exclusiveMinimum: 0, maximum: Number.MAX_SAFE_INTEGER })
|
|
17161
|
+
}, closed10), { minItems: FA_BUSINESS_OPERATIONS.length, maxItems: FA_BUSINESS_OPERATIONS.length })
|
|
17162
|
+
}, closed10);
|
|
17163
|
+
FaStabilityEvidenceSchema = _Object_({
|
|
17164
|
+
schema: Literal("supacloud.fa-stability-evidence.v1"),
|
|
17165
|
+
environment: environment2,
|
|
17166
|
+
project_ref: String2({ pattern: "^[a-z0-9-]{1,20}$" }),
|
|
17167
|
+
tuple_sha256: hash3,
|
|
17168
|
+
matrix_sha256: hash3,
|
|
17169
|
+
objectives_sha256: hash3,
|
|
17170
|
+
recorded_at: timestamp2,
|
|
17171
|
+
window_start: timestamp2,
|
|
17172
|
+
window_end: timestamp2,
|
|
17173
|
+
reviewed_by: label,
|
|
17174
|
+
review_reference: label,
|
|
17175
|
+
acceptance: _Array_(_Object_({
|
|
17176
|
+
id: Enum(Object.keys(FA_REQUIRED_ACCEPTANCE)),
|
|
17177
|
+
execution: Enum([
|
|
17178
|
+
"real-browser",
|
|
17179
|
+
"real-http",
|
|
17180
|
+
"real-worker",
|
|
17181
|
+
"real-database",
|
|
17182
|
+
"real-drill",
|
|
17183
|
+
"local-fake"
|
|
17184
|
+
]),
|
|
17185
|
+
passed: Boolean2(),
|
|
17186
|
+
measured_at: timestamp2,
|
|
17187
|
+
proof
|
|
17188
|
+
}, closed10), { minItems: 10, maxItems: 10 }),
|
|
17189
|
+
matrix: _Array_(_Object_({
|
|
17190
|
+
combination: label,
|
|
17191
|
+
scenario: label,
|
|
17192
|
+
outcome: Union([Literal("compatible"), Literal("blocked-safely")]),
|
|
17193
|
+
execution: Union([Literal("real-http-and-database"), Literal("local-fake")]),
|
|
17194
|
+
passed: Boolean2(),
|
|
17195
|
+
measured_at: timestamp2,
|
|
17196
|
+
proof
|
|
17197
|
+
}, closed10), { minItems: 48, maxItems: 48 }),
|
|
17198
|
+
observation: proof,
|
|
17199
|
+
alert: _Object_({ route: label, acknowledged_by: label, delivered_at: timestamp2 }, closed10)
|
|
17200
|
+
}, closed10);
|
|
17201
|
+
});
|
|
17202
|
+
|
|
17039
17203
|
// node_modules/@supacloud/delivery/src/application-promotion.ts
|
|
17040
|
-
var
|
|
17204
|
+
var closed11, projectRef2, sha2565, nullableActivation2, nullableDigest, observation, blocker, ApplicationPromotionPlanSchema;
|
|
17041
17205
|
var init_application_promotion = __esm(() => {
|
|
17042
17206
|
init_build();
|
|
17043
17207
|
init_value2();
|
|
@@ -17045,11 +17209,11 @@ var init_application_promotion = __esm(() => {
|
|
|
17045
17209
|
init_application_activation();
|
|
17046
17210
|
init_application_configuration();
|
|
17047
17211
|
init_application_release();
|
|
17048
|
-
|
|
17212
|
+
closed11 = { additionalProperties: false };
|
|
17049
17213
|
projectRef2 = String2({ pattern: "^[a-z0-9-]{1,20}$" });
|
|
17050
|
-
|
|
17214
|
+
sha2565 = ApplicationReleaseIdSchema;
|
|
17051
17215
|
nullableActivation2 = Union([ApplicationActivationIdSchema, Null()]);
|
|
17052
|
-
nullableDigest = Union([
|
|
17216
|
+
nullableDigest = Union([sha2565, Null()]);
|
|
17053
17217
|
observation = {
|
|
17054
17218
|
activation_id: nullableActivation2,
|
|
17055
17219
|
receipt_confirmed: Boolean2(),
|
|
@@ -17075,33 +17239,33 @@ var init_application_promotion = __esm(() => {
|
|
|
17075
17239
|
project_ref: projectRef2,
|
|
17076
17240
|
application_id: ApplicationIdSchema,
|
|
17077
17241
|
environment_id: ApplicationIdSchema,
|
|
17078
|
-
manifest_sha256:
|
|
17079
|
-
plan_sha256:
|
|
17242
|
+
manifest_sha256: sha2565,
|
|
17243
|
+
plan_sha256: sha2565,
|
|
17080
17244
|
source: _Object_({
|
|
17081
17245
|
project_ref: projectRef2,
|
|
17082
17246
|
environment_id: ApplicationIdSchema,
|
|
17083
|
-
release_id:
|
|
17247
|
+
release_id: sha2565,
|
|
17084
17248
|
...observation
|
|
17085
|
-
},
|
|
17249
|
+
}, closed11),
|
|
17086
17250
|
target: _Object_({
|
|
17087
|
-
candidate_release_id:
|
|
17088
|
-
current_release_id: Union([
|
|
17251
|
+
candidate_release_id: sha2565,
|
|
17252
|
+
current_release_id: Union([sha2565, Null()]),
|
|
17089
17253
|
artifact_action: Union([Literal("materialize"), Literal("reuse")]),
|
|
17090
17254
|
configuration_id: Union([ApplicationConfigurationIdSchema, Null()]),
|
|
17091
17255
|
configuration: Union([ApplicationConfigurationViewSchema, Null()]),
|
|
17092
17256
|
...observation
|
|
17093
|
-
},
|
|
17257
|
+
}, closed11),
|
|
17094
17258
|
migrations: _Object_({
|
|
17095
|
-
ledger_digest:
|
|
17259
|
+
ledger_digest: sha2565,
|
|
17096
17260
|
ledger_compatible: Boolean2(),
|
|
17097
17261
|
project_migrations_applied: Boolean2(),
|
|
17098
17262
|
pending_versions: _Array_(String2({ pattern: "^\\d{1,20}$" }), { maxItems: 4096, uniqueItems: true }),
|
|
17099
17263
|
operator_provisioning_required: Boolean2()
|
|
17100
|
-
},
|
|
17264
|
+
}, closed11),
|
|
17101
17265
|
backup: _Object_({
|
|
17102
17266
|
required: Boolean2(),
|
|
17103
17267
|
confirmed: Literal(false)
|
|
17104
|
-
},
|
|
17268
|
+
}, closed11),
|
|
17105
17269
|
action: Union([Literal("promote"), Literal("no-op"), Literal("blocked")]),
|
|
17106
17270
|
blockers: _Array_(Enum([...blocker]), {
|
|
17107
17271
|
maxItems: blocker.length,
|
|
@@ -17110,7 +17274,7 @@ var init_application_promotion = __esm(() => {
|
|
|
17110
17274
|
steps: _Array_(String2({ minLength: 1, maxLength: 64 }), { maxItems: 8, uniqueItems: true }),
|
|
17111
17275
|
execution_performed: Literal(false),
|
|
17112
17276
|
data_recovery: Literal("separate-required")
|
|
17113
|
-
},
|
|
17277
|
+
}, closed11);
|
|
17114
17278
|
});
|
|
17115
17279
|
|
|
17116
17280
|
// node_modules/@supacloud/delivery/src/application-runtime-identity.ts
|
|
@@ -17242,6 +17406,9 @@ var init_src = __esm(() => {
|
|
|
17242
17406
|
init_application_release_transfer();
|
|
17243
17407
|
init_application_configuration();
|
|
17244
17408
|
init_deployment_evidence();
|
|
17409
|
+
init_delivery_tuple();
|
|
17410
|
+
init_contract_matrix();
|
|
17411
|
+
init_fa_stability();
|
|
17245
17412
|
init_application_promotion();
|
|
17246
17413
|
init_application_runtime_identity();
|
|
17247
17414
|
init_delivery_build_schema();
|
|
@@ -17405,7 +17572,7 @@ import { createHash as createHash12 } from "node:crypto";
|
|
|
17405
17572
|
import { mkdir as mkdir5, readFile as readFile13 } from "node:fs/promises";
|
|
17406
17573
|
import { dirname as dirname11, relative as relative12, resolve as resolve24 } from "node:path";
|
|
17407
17574
|
import * as ts18 from "@typescript/typescript6";
|
|
17408
|
-
function
|
|
17575
|
+
function hash4(value) {
|
|
17409
17576
|
return createHash12("sha256").update(value).digest("hex");
|
|
17410
17577
|
}
|
|
17411
17578
|
function importPath(out, path) {
|
|
@@ -17471,7 +17638,7 @@ async function generateDatabaseContracts(options, check = false) {
|
|
|
17471
17638
|
const inputs = {};
|
|
17472
17639
|
const addInput = async (path) => {
|
|
17473
17640
|
const absolute = resolve24(rootDir, path);
|
|
17474
|
-
inputs[relative12(rootDir, absolute).replaceAll("\\", "/")] =
|
|
17641
|
+
inputs[relative12(rootDir, absolute).replaceAll("\\", "/")] = hash4(await readFile13(absolute, "utf8"));
|
|
17475
17642
|
};
|
|
17476
17643
|
await addInput(postgrestTypes);
|
|
17477
17644
|
await addInput(drizzleSchema);
|
|
@@ -17510,7 +17677,7 @@ async function generateDatabaseContracts(options, check = false) {
|
|
|
17510
17677
|
role: options.role,
|
|
17511
17678
|
inputs: Object.fromEntries(Object.entries(inputs).sort(([a], [b]) => a.localeCompare(b))),
|
|
17512
17679
|
migrationOrder: options.migrations.map((path) => relative12(rootDir, resolve24(rootDir, path)).replaceAll("\\", "/")),
|
|
17513
|
-
outputs: Object.fromEntries(Object.entries(files).sort(([a], [b]) => a.localeCompare(b)).map(([file, text]) => [file,
|
|
17680
|
+
outputs: Object.fromEntries(Object.entries(files).sort(([a], [b]) => a.localeCompare(b)).map(([file, text]) => [file, hash4(text)]))
|
|
17514
17681
|
};
|
|
17515
17682
|
files["database.manifest.json"] = JSON.stringify(manifest, null, 2) + `
|
|
17516
17683
|
`;
|
|
@@ -24216,10 +24383,10 @@ import { readFileSync as readFileSync4 } from "node:fs";
|
|
|
24216
24383
|
import { resolve as resolve18 } from "node:path";
|
|
24217
24384
|
|
|
24218
24385
|
// src/migration-app-version.ts
|
|
24219
|
-
var MIGRATION_APP_VERSION = "0.
|
|
24386
|
+
var MIGRATION_APP_VERSION = "0.27.0";
|
|
24220
24387
|
|
|
24221
24388
|
// src/migration-elysia-version.ts
|
|
24222
|
-
var MIGRATION_ELYSIA_VERSION = "0.
|
|
24389
|
+
var MIGRATION_ELYSIA_VERSION = "0.30.0";
|
|
24223
24390
|
|
|
24224
24391
|
// src/migration-policy.ts
|
|
24225
24392
|
var cachedCompilerVersion;
|
|
@@ -25189,7 +25356,7 @@ function isRecord2(value) {
|
|
|
25189
25356
|
function arrayLength(value) {
|
|
25190
25357
|
return Array.isArray(value) ? value.length : undefined;
|
|
25191
25358
|
}
|
|
25192
|
-
async function
|
|
25359
|
+
async function sha2566(path) {
|
|
25193
25360
|
return createHash11("sha256").update(await readFile11(path)).digest("hex");
|
|
25194
25361
|
}
|
|
25195
25362
|
function overallStatus(findings) {
|
|
@@ -25266,7 +25433,7 @@ async function assessMigration(options) {
|
|
|
25266
25433
|
contractsManifest = {
|
|
25267
25434
|
path: contractsManifestPath,
|
|
25268
25435
|
present: true,
|
|
25269
|
-
sha256: await
|
|
25436
|
+
sha256: await sha2566(contractsManifestPath),
|
|
25270
25437
|
version: 1,
|
|
25271
25438
|
...commands === undefined ? {} : { commands },
|
|
25272
25439
|
...routes === undefined ? {} : { routes },
|
|
@@ -25289,9 +25456,9 @@ async function assessMigration(options) {
|
|
|
25289
25456
|
const diff = diffOpenApiDocuments(await readOpenApiJson(baselinePath), await readOpenApiJson(currentPath));
|
|
25290
25457
|
openApi = {
|
|
25291
25458
|
baselinePath,
|
|
25292
|
-
baselineSha256: await
|
|
25459
|
+
baselineSha256: await sha2566(baselinePath),
|
|
25293
25460
|
currentPath,
|
|
25294
|
-
currentSha256: await
|
|
25461
|
+
currentSha256: await sha2566(currentPath),
|
|
25295
25462
|
diff
|
|
25296
25463
|
};
|
|
25297
25464
|
if (!diff.ok) {
|
package/dist/index.js
CHANGED
|
@@ -16485,8 +16485,172 @@ var init_deployment_evidence = __esm(() => {
|
|
|
16485
16485
|
}, closed8);
|
|
16486
16486
|
});
|
|
16487
16487
|
|
|
16488
|
+
// node_modules/@supacloud/delivery/src/delivery-tuple.ts
|
|
16489
|
+
var sha2563, commit, isoDate2, DELIVERY_TUPLE_SCHEMA = "supacloud.fa-delivery-tuple.v1", FaDeliveryTupleSchema;
|
|
16490
|
+
var init_delivery_tuple = __esm(() => {
|
|
16491
|
+
init_build();
|
|
16492
|
+
init_value2();
|
|
16493
|
+
sha2563 = String2({ pattern: "^[a-f0-9]{64}$" });
|
|
16494
|
+
commit = String2({ pattern: "^(?:[a-f0-9]{40}|[a-f0-9]{64})$" });
|
|
16495
|
+
isoDate2 = String2({ minLength: 20, maxLength: 40 });
|
|
16496
|
+
FaDeliveryTupleSchema = _Object_({
|
|
16497
|
+
schema: Literal(DELIVERY_TUPLE_SCHEMA),
|
|
16498
|
+
customer: Literal("xigu-fa"),
|
|
16499
|
+
fa_commit: commit,
|
|
16500
|
+
cli: _Object_({
|
|
16501
|
+
version: String2({ pattern: "^\\d+\\.\\d+\\.\\d+$" })
|
|
16502
|
+
}, { additionalProperties: false }),
|
|
16503
|
+
platform_commit: commit,
|
|
16504
|
+
edge_runtime: _Object_({
|
|
16505
|
+
version: String2({ minLength: 1, maxLength: 128 }),
|
|
16506
|
+
artifact_sha256: sha2563
|
|
16507
|
+
}, { additionalProperties: false }),
|
|
16508
|
+
compatibility_window: _Object_({
|
|
16509
|
+
contract_schema: String2({ minLength: 1, maxLength: 128 }),
|
|
16510
|
+
starts_at: isoDate2,
|
|
16511
|
+
ends_at: isoDate2,
|
|
16512
|
+
old_client_supported: Boolean2(),
|
|
16513
|
+
partial_deployment_supported: Boolean2()
|
|
16514
|
+
}, { additionalProperties: false })
|
|
16515
|
+
}, { additionalProperties: false });
|
|
16516
|
+
});
|
|
16517
|
+
|
|
16518
|
+
// node_modules/@supacloud/delivery/src/contract-matrix.ts
|
|
16519
|
+
var closed9, sha2564, generation, versions, CONTRACT_MATRIX_SCHEMA = "supacloud.consumer-contract-matrix.v1", FA_CONTRACT_SCENARIOS, ConsumerContractMatrixSchema;
|
|
16520
|
+
var init_contract_matrix = __esm(() => {
|
|
16521
|
+
init_build();
|
|
16522
|
+
init_value2();
|
|
16523
|
+
closed9 = { additionalProperties: false };
|
|
16524
|
+
sha2564 = String2({ pattern: "^[a-f0-9]{64}$" });
|
|
16525
|
+
generation = Union([Literal("old"), Literal("new")]);
|
|
16526
|
+
versions = _Object_({ old: sha2564, new: sha2564 }, closed9);
|
|
16527
|
+
FA_CONTRACT_SCENARIOS = [
|
|
16528
|
+
"missing-display-field",
|
|
16529
|
+
"missing-authority-field",
|
|
16530
|
+
"added-field",
|
|
16531
|
+
"legacy-envelope",
|
|
16532
|
+
"lost-write-response",
|
|
16533
|
+
"downgrade"
|
|
16534
|
+
];
|
|
16535
|
+
ConsumerContractMatrixSchema = _Object_({
|
|
16536
|
+
schema: Literal(CONTRACT_MATRIX_SCHEMA),
|
|
16537
|
+
customer: Literal("xigu-fa"),
|
|
16538
|
+
baseline_tuple_sha256: sha2564,
|
|
16539
|
+
candidate_tuple_sha256: sha2564,
|
|
16540
|
+
artifacts: _Object_({ frontend: versions, functions: versions, database: versions }, closed9),
|
|
16541
|
+
cases: _Array_(_Object_({
|
|
16542
|
+
frontend: generation,
|
|
16543
|
+
functions: generation,
|
|
16544
|
+
database: generation,
|
|
16545
|
+
scenarios: _Array_(_Object_({
|
|
16546
|
+
name: Enum(FA_CONTRACT_SCENARIOS),
|
|
16547
|
+
expected: Union([Literal("compatible"), Literal("blocked-safely")])
|
|
16548
|
+
}, closed9), { minItems: FA_CONTRACT_SCENARIOS.length, maxItems: FA_CONTRACT_SCENARIOS.length })
|
|
16549
|
+
}, closed9), { minItems: 8, maxItems: 8 })
|
|
16550
|
+
}, closed9);
|
|
16551
|
+
});
|
|
16552
|
+
|
|
16553
|
+
// node_modules/@supacloud/delivery/src/fa-stability.ts
|
|
16554
|
+
var closed10, hash3, label, timestamp2, count2, environment2, FA_REQUIRED_ACCEPTANCE, FA_BUSINESS_OPERATIONS, operation, proof, FaBusinessObservationSchema, FaServiceObjectivesSchema, FaStabilityEvidenceSchema;
|
|
16555
|
+
var init_fa_stability = __esm(() => {
|
|
16556
|
+
init_build();
|
|
16557
|
+
init_value2();
|
|
16558
|
+
init_delivery_files();
|
|
16559
|
+
init_contract_matrix();
|
|
16560
|
+
init_delivery_tuple();
|
|
16561
|
+
closed10 = { additionalProperties: false };
|
|
16562
|
+
hash3 = String2({ pattern: "^[a-f0-9]{64}$" });
|
|
16563
|
+
label = String2({ minLength: 1, maxLength: 256, pattern: "\\S" });
|
|
16564
|
+
timestamp2 = String2({ minLength: 24, maxLength: 24 });
|
|
16565
|
+
count2 = Integer({ minimum: 0, maximum: Number.MAX_SAFE_INTEGER });
|
|
16566
|
+
environment2 = Union([Literal("test"), Literal("production")]);
|
|
16567
|
+
FA_REQUIRED_ACCEPTANCE = {
|
|
16568
|
+
login: "real-browser",
|
|
16569
|
+
permissions: "real-http",
|
|
16570
|
+
upload: "real-http",
|
|
16571
|
+
"async-task": "real-worker",
|
|
16572
|
+
deploy: "real-http",
|
|
16573
|
+
"database-migration": "real-database",
|
|
16574
|
+
schedule: "real-worker",
|
|
16575
|
+
rollback: "real-drill",
|
|
16576
|
+
"error-policy": "real-http",
|
|
16577
|
+
"alert-delivery": "real-drill"
|
|
16578
|
+
};
|
|
16579
|
+
FA_BUSINESS_OPERATIONS = ["login", "permissions", "upload", "async-task", "report", "deploy"];
|
|
16580
|
+
operation = Enum(FA_BUSINESS_OPERATIONS);
|
|
16581
|
+
proof = _Object_({
|
|
16582
|
+
path: String2({ pattern: "^[A-Za-z0-9_-][A-Za-z0-9_./-]{0,255}$" }),
|
|
16583
|
+
sha256: hash3
|
|
16584
|
+
}, closed10);
|
|
16585
|
+
FaBusinessObservationSchema = _Object_({
|
|
16586
|
+
id: String2({ pattern: "^[A-Za-z0-9_-]{1,128}$" }),
|
|
16587
|
+
tuple_sha256: hash3,
|
|
16588
|
+
operation,
|
|
16589
|
+
started_at: timestamp2,
|
|
16590
|
+
finished_at: timestamp2,
|
|
16591
|
+
outcome: Enum(["success", "failure", "timeout", "unknown"]),
|
|
16592
|
+
attempts: Integer({ minimum: 1, maximum: 1000 }),
|
|
16593
|
+
rollbacks: count2
|
|
16594
|
+
}, closed10);
|
|
16595
|
+
FaServiceObjectivesSchema = _Object_({
|
|
16596
|
+
status: Literal("approved"),
|
|
16597
|
+
owner: label,
|
|
16598
|
+
approval_reference: label,
|
|
16599
|
+
approved_at: timestamp2,
|
|
16600
|
+
project_ref: String2({ pattern: "^[a-z0-9-]{1,20}$" }),
|
|
16601
|
+
environment: environment2,
|
|
16602
|
+
alert_route: label,
|
|
16603
|
+
window_hours: Number2({ exclusiveMinimum: 0, maximum: 8760 }),
|
|
16604
|
+
max_evidence_age_hours: Number2({ exclusiveMinimum: 0, maximum: 168 }),
|
|
16605
|
+
operations: _Array_(_Object_({
|
|
16606
|
+
operation,
|
|
16607
|
+
minimum_samples: Integer({ minimum: 1, maximum: Number.MAX_SAFE_INTEGER }),
|
|
16608
|
+
availability_percent: Number2({ exclusiveMinimum: 0, maximum: 100 }),
|
|
16609
|
+
p95_ms: Number2({ exclusiveMinimum: 0, maximum: Number.MAX_SAFE_INTEGER })
|
|
16610
|
+
}, closed10), { minItems: FA_BUSINESS_OPERATIONS.length, maxItems: FA_BUSINESS_OPERATIONS.length })
|
|
16611
|
+
}, closed10);
|
|
16612
|
+
FaStabilityEvidenceSchema = _Object_({
|
|
16613
|
+
schema: Literal("supacloud.fa-stability-evidence.v1"),
|
|
16614
|
+
environment: environment2,
|
|
16615
|
+
project_ref: String2({ pattern: "^[a-z0-9-]{1,20}$" }),
|
|
16616
|
+
tuple_sha256: hash3,
|
|
16617
|
+
matrix_sha256: hash3,
|
|
16618
|
+
objectives_sha256: hash3,
|
|
16619
|
+
recorded_at: timestamp2,
|
|
16620
|
+
window_start: timestamp2,
|
|
16621
|
+
window_end: timestamp2,
|
|
16622
|
+
reviewed_by: label,
|
|
16623
|
+
review_reference: label,
|
|
16624
|
+
acceptance: _Array_(_Object_({
|
|
16625
|
+
id: Enum(Object.keys(FA_REQUIRED_ACCEPTANCE)),
|
|
16626
|
+
execution: Enum([
|
|
16627
|
+
"real-browser",
|
|
16628
|
+
"real-http",
|
|
16629
|
+
"real-worker",
|
|
16630
|
+
"real-database",
|
|
16631
|
+
"real-drill",
|
|
16632
|
+
"local-fake"
|
|
16633
|
+
]),
|
|
16634
|
+
passed: Boolean2(),
|
|
16635
|
+
measured_at: timestamp2,
|
|
16636
|
+
proof
|
|
16637
|
+
}, closed10), { minItems: 10, maxItems: 10 }),
|
|
16638
|
+
matrix: _Array_(_Object_({
|
|
16639
|
+
combination: label,
|
|
16640
|
+
scenario: label,
|
|
16641
|
+
outcome: Union([Literal("compatible"), Literal("blocked-safely")]),
|
|
16642
|
+
execution: Union([Literal("real-http-and-database"), Literal("local-fake")]),
|
|
16643
|
+
passed: Boolean2(),
|
|
16644
|
+
measured_at: timestamp2,
|
|
16645
|
+
proof
|
|
16646
|
+
}, closed10), { minItems: 48, maxItems: 48 }),
|
|
16647
|
+
observation: proof,
|
|
16648
|
+
alert: _Object_({ route: label, acknowledged_by: label, delivered_at: timestamp2 }, closed10)
|
|
16649
|
+
}, closed10);
|
|
16650
|
+
});
|
|
16651
|
+
|
|
16488
16652
|
// node_modules/@supacloud/delivery/src/application-promotion.ts
|
|
16489
|
-
var
|
|
16653
|
+
var closed11, projectRef2, sha2565, nullableActivation2, nullableDigest, observation, blocker, ApplicationPromotionPlanSchema;
|
|
16490
16654
|
var init_application_promotion = __esm(() => {
|
|
16491
16655
|
init_build();
|
|
16492
16656
|
init_value2();
|
|
@@ -16494,11 +16658,11 @@ var init_application_promotion = __esm(() => {
|
|
|
16494
16658
|
init_application_activation();
|
|
16495
16659
|
init_application_configuration();
|
|
16496
16660
|
init_application_release();
|
|
16497
|
-
|
|
16661
|
+
closed11 = { additionalProperties: false };
|
|
16498
16662
|
projectRef2 = String2({ pattern: "^[a-z0-9-]{1,20}$" });
|
|
16499
|
-
|
|
16663
|
+
sha2565 = ApplicationReleaseIdSchema;
|
|
16500
16664
|
nullableActivation2 = Union([ApplicationActivationIdSchema, Null()]);
|
|
16501
|
-
nullableDigest = Union([
|
|
16665
|
+
nullableDigest = Union([sha2565, Null()]);
|
|
16502
16666
|
observation = {
|
|
16503
16667
|
activation_id: nullableActivation2,
|
|
16504
16668
|
receipt_confirmed: Boolean2(),
|
|
@@ -16524,33 +16688,33 @@ var init_application_promotion = __esm(() => {
|
|
|
16524
16688
|
project_ref: projectRef2,
|
|
16525
16689
|
application_id: ApplicationIdSchema,
|
|
16526
16690
|
environment_id: ApplicationIdSchema,
|
|
16527
|
-
manifest_sha256:
|
|
16528
|
-
plan_sha256:
|
|
16691
|
+
manifest_sha256: sha2565,
|
|
16692
|
+
plan_sha256: sha2565,
|
|
16529
16693
|
source: _Object_({
|
|
16530
16694
|
project_ref: projectRef2,
|
|
16531
16695
|
environment_id: ApplicationIdSchema,
|
|
16532
|
-
release_id:
|
|
16696
|
+
release_id: sha2565,
|
|
16533
16697
|
...observation
|
|
16534
|
-
},
|
|
16698
|
+
}, closed11),
|
|
16535
16699
|
target: _Object_({
|
|
16536
|
-
candidate_release_id:
|
|
16537
|
-
current_release_id: Union([
|
|
16700
|
+
candidate_release_id: sha2565,
|
|
16701
|
+
current_release_id: Union([sha2565, Null()]),
|
|
16538
16702
|
artifact_action: Union([Literal("materialize"), Literal("reuse")]),
|
|
16539
16703
|
configuration_id: Union([ApplicationConfigurationIdSchema, Null()]),
|
|
16540
16704
|
configuration: Union([ApplicationConfigurationViewSchema, Null()]),
|
|
16541
16705
|
...observation
|
|
16542
|
-
},
|
|
16706
|
+
}, closed11),
|
|
16543
16707
|
migrations: _Object_({
|
|
16544
|
-
ledger_digest:
|
|
16708
|
+
ledger_digest: sha2565,
|
|
16545
16709
|
ledger_compatible: Boolean2(),
|
|
16546
16710
|
project_migrations_applied: Boolean2(),
|
|
16547
16711
|
pending_versions: _Array_(String2({ pattern: "^\\d{1,20}$" }), { maxItems: 4096, uniqueItems: true }),
|
|
16548
16712
|
operator_provisioning_required: Boolean2()
|
|
16549
|
-
},
|
|
16713
|
+
}, closed11),
|
|
16550
16714
|
backup: _Object_({
|
|
16551
16715
|
required: Boolean2(),
|
|
16552
16716
|
confirmed: Literal(false)
|
|
16553
|
-
},
|
|
16717
|
+
}, closed11),
|
|
16554
16718
|
action: Union([Literal("promote"), Literal("no-op"), Literal("blocked")]),
|
|
16555
16719
|
blockers: _Array_(Enum([...blocker]), {
|
|
16556
16720
|
maxItems: blocker.length,
|
|
@@ -16559,7 +16723,7 @@ var init_application_promotion = __esm(() => {
|
|
|
16559
16723
|
steps: _Array_(String2({ minLength: 1, maxLength: 64 }), { maxItems: 8, uniqueItems: true }),
|
|
16560
16724
|
execution_performed: Literal(false),
|
|
16561
16725
|
data_recovery: Literal("separate-required")
|
|
16562
|
-
},
|
|
16726
|
+
}, closed11);
|
|
16563
16727
|
});
|
|
16564
16728
|
|
|
16565
16729
|
// node_modules/@supacloud/delivery/src/application-runtime-identity.ts
|
|
@@ -16691,6 +16855,9 @@ var init_src = __esm(() => {
|
|
|
16691
16855
|
init_application_release_transfer();
|
|
16692
16856
|
init_application_configuration();
|
|
16693
16857
|
init_deployment_evidence();
|
|
16858
|
+
init_delivery_tuple();
|
|
16859
|
+
init_contract_matrix();
|
|
16860
|
+
init_fa_stability();
|
|
16694
16861
|
init_application_promotion();
|
|
16695
16862
|
init_application_runtime_identity();
|
|
16696
16863
|
init_delivery_build_schema();
|
|
@@ -17437,7 +17604,7 @@ import { createHash as createHash12 } from "node:crypto";
|
|
|
17437
17604
|
import { mkdir as mkdir6, readFile as readFile14 } from "node:fs/promises";
|
|
17438
17605
|
import { dirname as dirname12, relative as relative12, resolve as resolve24 } from "node:path";
|
|
17439
17606
|
import * as ts18 from "@typescript/typescript6";
|
|
17440
|
-
function
|
|
17607
|
+
function hash4(value) {
|
|
17441
17608
|
return createHash12("sha256").update(value).digest("hex");
|
|
17442
17609
|
}
|
|
17443
17610
|
function importPath(out, path) {
|
|
@@ -17503,7 +17670,7 @@ async function generateDatabaseContracts(options, check = false) {
|
|
|
17503
17670
|
const inputs = {};
|
|
17504
17671
|
const addInput = async (path) => {
|
|
17505
17672
|
const absolute = resolve24(rootDir, path);
|
|
17506
|
-
inputs[relative12(rootDir, absolute).replaceAll("\\", "/")] =
|
|
17673
|
+
inputs[relative12(rootDir, absolute).replaceAll("\\", "/")] = hash4(await readFile14(absolute, "utf8"));
|
|
17507
17674
|
};
|
|
17508
17675
|
await addInput(postgrestTypes);
|
|
17509
17676
|
await addInput(drizzleSchema);
|
|
@@ -17542,7 +17709,7 @@ async function generateDatabaseContracts(options, check = false) {
|
|
|
17542
17709
|
role: options.role,
|
|
17543
17710
|
inputs: Object.fromEntries(Object.entries(inputs).sort(([a], [b]) => a.localeCompare(b))),
|
|
17544
17711
|
migrationOrder: options.migrations.map((path) => relative12(rootDir, resolve24(rootDir, path)).replaceAll("\\", "/")),
|
|
17545
|
-
outputs: Object.fromEntries(Object.entries(files).sort(([a], [b]) => a.localeCompare(b)).map(([file, text]) => [file,
|
|
17712
|
+
outputs: Object.fromEntries(Object.entries(files).sort(([a], [b]) => a.localeCompare(b)).map(([file, text]) => [file, hash4(text)]))
|
|
17546
17713
|
};
|
|
17547
17714
|
files["database.manifest.json"] = JSON.stringify(manifest, null, 2) + `
|
|
17548
17715
|
`;
|
|
@@ -23898,10 +24065,10 @@ import { readFileSync as readFileSync4 } from "node:fs";
|
|
|
23898
24065
|
import { resolve as resolve17 } from "node:path";
|
|
23899
24066
|
|
|
23900
24067
|
// src/migration-app-version.ts
|
|
23901
|
-
var MIGRATION_APP_VERSION = "0.
|
|
24068
|
+
var MIGRATION_APP_VERSION = "0.27.0";
|
|
23902
24069
|
|
|
23903
24070
|
// src/migration-elysia-version.ts
|
|
23904
|
-
var MIGRATION_ELYSIA_VERSION = "0.
|
|
24071
|
+
var MIGRATION_ELYSIA_VERSION = "0.30.0";
|
|
23905
24072
|
|
|
23906
24073
|
// src/migration-policy.ts
|
|
23907
24074
|
var cachedCompilerVersion;
|
|
@@ -24870,7 +25037,7 @@ function isRecord2(value) {
|
|
|
24870
25037
|
function arrayLength(value) {
|
|
24871
25038
|
return Array.isArray(value) ? value.length : undefined;
|
|
24872
25039
|
}
|
|
24873
|
-
async function
|
|
25040
|
+
async function sha2566(path) {
|
|
24874
25041
|
return createHash11("sha256").update(await readFile11(path)).digest("hex");
|
|
24875
25042
|
}
|
|
24876
25043
|
function overallStatus(findings) {
|
|
@@ -24947,7 +25114,7 @@ async function assessMigration(options) {
|
|
|
24947
25114
|
contractsManifest = {
|
|
24948
25115
|
path: contractsManifestPath,
|
|
24949
25116
|
present: true,
|
|
24950
|
-
sha256: await
|
|
25117
|
+
sha256: await sha2566(contractsManifestPath),
|
|
24951
25118
|
version: 1,
|
|
24952
25119
|
...commands === undefined ? {} : { commands },
|
|
24953
25120
|
...routes === undefined ? {} : { routes },
|
|
@@ -24970,9 +25137,9 @@ async function assessMigration(options) {
|
|
|
24970
25137
|
const diff = diffOpenApiDocuments(await readOpenApiJson(baselinePath), await readOpenApiJson(currentPath));
|
|
24971
25138
|
openApi = {
|
|
24972
25139
|
baselinePath,
|
|
24973
|
-
baselineSha256: await
|
|
25140
|
+
baselineSha256: await sha2566(baselinePath),
|
|
24974
25141
|
currentPath,
|
|
24975
|
-
currentSha256: await
|
|
25142
|
+
currentSha256: await sha2566(currentPath),
|
|
24976
25143
|
diff
|
|
24977
25144
|
};
|
|
24978
25145
|
if (!diff.ok) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const MIGRATION_APP_VERSION = "0.
|
|
1
|
+
export declare const MIGRATION_APP_VERSION = "0.27.0";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const MIGRATION_ELYSIA_VERSION = "0.
|
|
1
|
+
export declare const MIGRATION_ELYSIA_VERSION = "0.30.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supacloud/compiler",
|
|
3
|
-
"version": "0.46.
|
|
3
|
+
"version": "0.46.1",
|
|
4
4
|
"description": "Static compiler for @supacloud/app metadata: builds the application graph from AST, validates it, and generates reflection-free factory code",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@supacloud/db": "0.17.0",
|
|
61
|
-
"@supacloud/delivery": "0.
|
|
61
|
+
"@supacloud/delivery": "0.18.0",
|
|
62
62
|
"typebox": "1.3.36",
|
|
63
63
|
"@graphql-codegen/core": "^6.2.2",
|
|
64
64
|
"@graphql-codegen/typed-document-node": "^7.1.1",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"graphql": "^16"
|
|
69
69
|
},
|
|
70
70
|
"overrides": {
|
|
71
|
-
"@supacloud/contracts": "0.
|
|
71
|
+
"@supacloud/contracts": "0.9.0",
|
|
72
72
|
"@graphql-tools/utils": "^12.0.3",
|
|
73
73
|
"@whatwg-node/promise-helpers": "1.3.2"
|
|
74
74
|
},
|