@supacloud/compiler 0.46.0 → 0.46.2

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 CHANGED
@@ -5742,22 +5742,22 @@ var ByteMarker, Accumulator, Prime, Size, Bytes, F64, F64In, F64Out, encoder;
5742
5742
  var init_hash = __esm(() => {
5743
5743
  init_unreachable();
5744
5744
  init_guard2();
5745
- (function(ByteMarker) {
5746
- ByteMarker[ByteMarker["Array"] = 0] = "Array";
5747
- ByteMarker[ByteMarker["BigInt"] = 1] = "BigInt";
5748
- ByteMarker[ByteMarker["Boolean"] = 2] = "Boolean";
5749
- ByteMarker[ByteMarker["Date"] = 3] = "Date";
5750
- ByteMarker[ByteMarker["Constructor"] = 4] = "Constructor";
5751
- ByteMarker[ByteMarker["Function"] = 5] = "Function";
5752
- ByteMarker[ByteMarker["Null"] = 6] = "Null";
5753
- ByteMarker[ByteMarker["Number"] = 7] = "Number";
5754
- ByteMarker[ByteMarker["Object"] = 8] = "Object";
5755
- ByteMarker[ByteMarker["RegExp"] = 9] = "RegExp";
5756
- ByteMarker[ByteMarker["String"] = 10] = "String";
5757
- ByteMarker[ByteMarker["Symbol"] = 11] = "Symbol";
5758
- ByteMarker[ByteMarker["TypeArray"] = 12] = "TypeArray";
5759
- ByteMarker[ByteMarker["Undefined"] = 13] = "Undefined";
5760
- })(ByteMarker || (ByteMarker = {}));
5745
+ ByteMarker = {
5746
+ Array: 0,
5747
+ BigInt: 1,
5748
+ Boolean: 2,
5749
+ Date: 3,
5750
+ Constructor: 4,
5751
+ Function: 5,
5752
+ Null: 6,
5753
+ Number: 7,
5754
+ Object: 8,
5755
+ RegExp: 9,
5756
+ String: 10,
5757
+ Symbol: 11,
5758
+ TypeArray: 12,
5759
+ Undefined: 13
5760
+ };
5761
5761
  Accumulator = BigInt("14695981039346656037");
5762
5762
  [Prime, Size] = [BigInt("1099511628211"), BigInt("18446744073709551616")];
5763
5763
  Bytes = Array.from({ length: 256 }).map((_, i) => BigInt(i));
@@ -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 closed9, projectRef2, sha2563, nullableActivation2, nullableDigest, observation, blocker, ApplicationPromotionPlanSchema;
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
- closed9 = { additionalProperties: false };
17212
+ closed11 = { additionalProperties: false };
17049
17213
  projectRef2 = String2({ pattern: "^[a-z0-9-]{1,20}$" });
17050
- sha2563 = ApplicationReleaseIdSchema;
17214
+ sha2565 = ApplicationReleaseIdSchema;
17051
17215
  nullableActivation2 = Union([ApplicationActivationIdSchema, Null()]);
17052
- nullableDigest = Union([sha2563, Null()]);
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: sha2563,
17079
- plan_sha256: sha2563,
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: sha2563,
17247
+ release_id: sha2565,
17084
17248
  ...observation
17085
- }, closed9),
17249
+ }, closed11),
17086
17250
  target: _Object_({
17087
- candidate_release_id: sha2563,
17088
- current_release_id: Union([sha2563, Null()]),
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
- }, closed9),
17257
+ }, closed11),
17094
17258
  migrations: _Object_({
17095
- ledger_digest: sha2563,
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
- }, closed9),
17264
+ }, closed11),
17101
17265
  backup: _Object_({
17102
17266
  required: Boolean2(),
17103
17267
  confirmed: Literal(false)
17104
- }, closed9),
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
- }, closed9);
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 hash3(value) {
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("\\", "/")] = hash3(await readFile13(absolute, "utf8"));
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, hash3(text)]))
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.26.1";
24386
+ var MIGRATION_APP_VERSION = "0.27.1";
24220
24387
 
24221
24388
  // src/migration-elysia-version.ts
24222
- var MIGRATION_ELYSIA_VERSION = "0.29.2";
24389
+ var MIGRATION_ELYSIA_VERSION = "0.30.1";
24223
24390
 
24224
24391
  // src/migration-policy.ts
24225
24392
  var cachedCompilerVersion;
@@ -24238,7 +24405,7 @@ function migrationDependencies() {
24238
24405
  "@supacloud/app": MIGRATION_APP_VERSION,
24239
24406
  "@supacloud/compiler": compilerVersion(),
24240
24407
  "@supacloud/elysia": MIGRATION_ELYSIA_VERSION,
24241
- elysia: "2.0.0-beta.21",
24408
+ elysia: "2.0.0-beta.32",
24242
24409
  typescript: "7.0.2"
24243
24410
  };
24244
24411
  }
@@ -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 sha2564(path) {
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 sha2564(contractsManifestPath),
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 sha2564(baselinePath),
25459
+ baselineSha256: await sha2566(baselinePath),
25293
25460
  currentPath,
25294
- currentSha256: await sha2564(currentPath),
25461
+ currentSha256: await sha2566(currentPath),
25295
25462
  diff
25296
25463
  };
25297
25464
  if (!diff.ok) {
@@ -2815,22 +2815,22 @@ var ByteMarker, Accumulator, Prime, Size, Bytes, F64, F64In, F64Out, encoder;
2815
2815
  var init_hash = __esm(() => {
2816
2816
  init_unreachable();
2817
2817
  init_guard2();
2818
- (function(ByteMarker) {
2819
- ByteMarker[ByteMarker["Array"] = 0] = "Array";
2820
- ByteMarker[ByteMarker["BigInt"] = 1] = "BigInt";
2821
- ByteMarker[ByteMarker["Boolean"] = 2] = "Boolean";
2822
- ByteMarker[ByteMarker["Date"] = 3] = "Date";
2823
- ByteMarker[ByteMarker["Constructor"] = 4] = "Constructor";
2824
- ByteMarker[ByteMarker["Function"] = 5] = "Function";
2825
- ByteMarker[ByteMarker["Null"] = 6] = "Null";
2826
- ByteMarker[ByteMarker["Number"] = 7] = "Number";
2827
- ByteMarker[ByteMarker["Object"] = 8] = "Object";
2828
- ByteMarker[ByteMarker["RegExp"] = 9] = "RegExp";
2829
- ByteMarker[ByteMarker["String"] = 10] = "String";
2830
- ByteMarker[ByteMarker["Symbol"] = 11] = "Symbol";
2831
- ByteMarker[ByteMarker["TypeArray"] = 12] = "TypeArray";
2832
- ByteMarker[ByteMarker["Undefined"] = 13] = "Undefined";
2833
- })(ByteMarker || (ByteMarker = {}));
2818
+ ByteMarker = {
2819
+ Array: 0,
2820
+ BigInt: 1,
2821
+ Boolean: 2,
2822
+ Date: 3,
2823
+ Constructor: 4,
2824
+ Function: 5,
2825
+ Null: 6,
2826
+ Number: 7,
2827
+ Object: 8,
2828
+ RegExp: 9,
2829
+ String: 10,
2830
+ Symbol: 11,
2831
+ TypeArray: 12,
2832
+ Undefined: 13
2833
+ };
2834
2834
  Accumulator = BigInt("14695981039346656037");
2835
2835
  [Prime, Size] = [BigInt("1099511628211"), BigInt("18446744073709551616")];
2836
2836
  Bytes = Array.from({ length: 256 }).map((_, i) => BigInt(i));
package/dist/index.js CHANGED
@@ -5398,22 +5398,22 @@ var ByteMarker, Accumulator, Prime, Size, Bytes, F64, F64In, F64Out, encoder;
5398
5398
  var init_hash = __esm(() => {
5399
5399
  init_unreachable();
5400
5400
  init_guard2();
5401
- (function(ByteMarker) {
5402
- ByteMarker[ByteMarker["Array"] = 0] = "Array";
5403
- ByteMarker[ByteMarker["BigInt"] = 1] = "BigInt";
5404
- ByteMarker[ByteMarker["Boolean"] = 2] = "Boolean";
5405
- ByteMarker[ByteMarker["Date"] = 3] = "Date";
5406
- ByteMarker[ByteMarker["Constructor"] = 4] = "Constructor";
5407
- ByteMarker[ByteMarker["Function"] = 5] = "Function";
5408
- ByteMarker[ByteMarker["Null"] = 6] = "Null";
5409
- ByteMarker[ByteMarker["Number"] = 7] = "Number";
5410
- ByteMarker[ByteMarker["Object"] = 8] = "Object";
5411
- ByteMarker[ByteMarker["RegExp"] = 9] = "RegExp";
5412
- ByteMarker[ByteMarker["String"] = 10] = "String";
5413
- ByteMarker[ByteMarker["Symbol"] = 11] = "Symbol";
5414
- ByteMarker[ByteMarker["TypeArray"] = 12] = "TypeArray";
5415
- ByteMarker[ByteMarker["Undefined"] = 13] = "Undefined";
5416
- })(ByteMarker || (ByteMarker = {}));
5401
+ ByteMarker = {
5402
+ Array: 0,
5403
+ BigInt: 1,
5404
+ Boolean: 2,
5405
+ Date: 3,
5406
+ Constructor: 4,
5407
+ Function: 5,
5408
+ Null: 6,
5409
+ Number: 7,
5410
+ Object: 8,
5411
+ RegExp: 9,
5412
+ String: 10,
5413
+ Symbol: 11,
5414
+ TypeArray: 12,
5415
+ Undefined: 13
5416
+ };
5417
5417
  Accumulator = BigInt("14695981039346656037");
5418
5418
  [Prime, Size] = [BigInt("1099511628211"), BigInt("18446744073709551616")];
5419
5419
  Bytes = Array.from({ length: 256 }).map((_, i) => BigInt(i));
@@ -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 closed9, projectRef2, sha2563, nullableActivation2, nullableDigest, observation, blocker, ApplicationPromotionPlanSchema;
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
- closed9 = { additionalProperties: false };
16661
+ closed11 = { additionalProperties: false };
16498
16662
  projectRef2 = String2({ pattern: "^[a-z0-9-]{1,20}$" });
16499
- sha2563 = ApplicationReleaseIdSchema;
16663
+ sha2565 = ApplicationReleaseIdSchema;
16500
16664
  nullableActivation2 = Union([ApplicationActivationIdSchema, Null()]);
16501
- nullableDigest = Union([sha2563, Null()]);
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: sha2563,
16528
- plan_sha256: sha2563,
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: sha2563,
16696
+ release_id: sha2565,
16533
16697
  ...observation
16534
- }, closed9),
16698
+ }, closed11),
16535
16699
  target: _Object_({
16536
- candidate_release_id: sha2563,
16537
- current_release_id: Union([sha2563, Null()]),
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
- }, closed9),
16706
+ }, closed11),
16543
16707
  migrations: _Object_({
16544
- ledger_digest: sha2563,
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
- }, closed9),
16713
+ }, closed11),
16550
16714
  backup: _Object_({
16551
16715
  required: Boolean2(),
16552
16716
  confirmed: Literal(false)
16553
- }, closed9),
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
- }, closed9);
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 hash3(value) {
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("\\", "/")] = hash3(await readFile14(absolute, "utf8"));
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, hash3(text)]))
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.26.1";
24068
+ var MIGRATION_APP_VERSION = "0.27.1";
23902
24069
 
23903
24070
  // src/migration-elysia-version.ts
23904
- var MIGRATION_ELYSIA_VERSION = "0.29.2";
24071
+ var MIGRATION_ELYSIA_VERSION = "0.30.1";
23905
24072
 
23906
24073
  // src/migration-policy.ts
23907
24074
  var cachedCompilerVersion;
@@ -23920,7 +24087,7 @@ function migrationDependencies() {
23920
24087
  "@supacloud/app": MIGRATION_APP_VERSION,
23921
24088
  "@supacloud/compiler": compilerVersion(),
23922
24089
  "@supacloud/elysia": MIGRATION_ELYSIA_VERSION,
23923
- elysia: "2.0.0-beta.21",
24090
+ elysia: "2.0.0-beta.32",
23924
24091
  typescript: "7.0.2"
23925
24092
  };
23926
24093
  }
@@ -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 sha2564(path) {
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 sha2564(contractsManifestPath),
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 sha2564(baselinePath),
25140
+ baselineSha256: await sha2566(baselinePath),
24974
25141
  currentPath,
24975
- currentSha256: await sha2564(currentPath),
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.26.1";
1
+ export declare const MIGRATION_APP_VERSION = "0.27.1";
@@ -1 +1 @@
1
- export declare const MIGRATION_ELYSIA_VERSION = "0.29.2";
1
+ export declare const MIGRATION_ELYSIA_VERSION = "0.30.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supacloud/compiler",
3
- "version": "0.46.0",
3
+ "version": "0.46.2",
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",
@@ -57,24 +57,24 @@
57
57
  "directory": "packages/compiler"
58
58
  },
59
59
  "dependencies": {
60
- "@supacloud/db": "0.17.0",
61
- "@supacloud/delivery": "0.17.0",
62
- "typebox": "1.3.36",
60
+ "@supacloud/db": "0.17.1",
61
+ "@supacloud/delivery": "0.18.1",
62
+ "typebox": "1.3.37",
63
63
  "@graphql-codegen/core": "^6.2.2",
64
- "@graphql-codegen/typed-document-node": "^7.1.1",
64
+ "@graphql-codegen/typed-document-node": "^7.2.0",
65
65
  "@graphql-codegen/typescript-operations": "^6.1.10",
66
66
  "@graphql-typed-document-node/core": "^3.2.0",
67
67
  "@typescript/typescript6": "^6.0.2",
68
68
  "graphql": "^16"
69
69
  },
70
70
  "overrides": {
71
- "@supacloud/contracts": "0.8.1",
72
- "@graphql-tools/utils": "^12.0.3",
73
- "@whatwg-node/promise-helpers": "1.3.2"
71
+ "@supacloud/contracts": "0.9.0",
72
+ "@graphql-tools/utils": "^12.0.4",
73
+ "@whatwg-node/promise-helpers": "2.0.0"
74
74
  },
75
75
  "devDependencies": {
76
76
  "@supabase/supabase-js": "2.117.3",
77
- "drizzle-orm": "1.0.0-rc.5-169397b",
77
+ "drizzle-orm": "1.0.0-rc.5-5935859",
78
78
  "@types/bun": "^1.4.3",
79
79
  "typescript": "^7.0.2"
80
80
  }