@sequenceholdings/orm 2.8.1 → 2.8.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/sdl.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var zod = require('zod');
4
- var crypto = require('crypto');
4
+ require('crypto');
5
5
 
6
6
  // src/canonical/v2.ts
7
7
  var quoteIdentifier = (name) => `"${name.replaceAll('"', '""')}"`;
@@ -2459,29 +2459,23 @@ var CodegenGqlError = class extends Error {
2459
2459
  };
2460
2460
 
2461
2461
  // src/codegen-gql/manifest.ts
2462
- var MANIFEST_VERSION = 1;
2463
- var OP_HASH_RE = /^sha256:[0-9a-f]{64}$/;
2462
+ var MANIFEST_VERSION = 2;
2464
2463
  var GRAPHQL_NAME_RE2 = /^[_A-Za-z][_0-9A-Za-z]*$/;
2465
2464
  var manifestRequiresSchema = zod.z.object({
2466
2465
  capability: zod.z.string().min(1).optional(),
2467
2466
  role: zod.z.string().min(1).optional()
2468
2467
  }).nullable();
2469
2468
  var manifestOperationSchema = zod.z.object({
2470
- hash: zod.z.string().regex(OP_HASH_RE),
2471
2469
  kind: zod.z.enum(["query", "mutation"]),
2472
2470
  requires: manifestRequiresSchema
2473
2471
  });
2474
2472
  var operationsManifestSchema = zod.z.object({
2475
- manifestVersion: zod.z.literal(MANIFEST_VERSION),
2476
- schemaHash: zod.z.string().min(1),
2477
- opsHash: zod.z.string().regex(OP_HASH_RE),
2473
+ manifestVersion: zod.z.union([zod.z.literal(1), zod.z.literal(MANIFEST_VERSION)]),
2478
2474
  operations: zod.z.record(zod.z.string().regex(GRAPHQL_NAME_RE2), manifestOperationSchema)
2479
2475
  });
2480
2476
  function buildOperationsManifest({
2481
- schemaHash,
2482
2477
  operations
2483
2478
  }) {
2484
- if (schemaHash.length === 0) throw new CodegenGqlError("schemaHash must be a non-empty string.");
2485
2479
  const sorted = [...operations].sort((a, b) => a.name.localeCompare(b.name));
2486
2480
  const seen = /* @__PURE__ */ new Set();
2487
2481
  const entries = sorted.map((op) => {
@@ -2492,20 +2486,14 @@ function buildOperationsManifest({
2492
2486
  throw new CodegenGqlError(`Duplicate operation name "${op.name}" \u2014 operation names must be unique per namespace.`);
2493
2487
  }
2494
2488
  seen.add(op.name);
2495
- if (!OP_HASH_RE.test(op.hash)) {
2496
- throw new CodegenGqlError(`Operation "${op.name}" has malformed hash "${op.hash}" (expected sha256:<64 hex>).`);
2497
- }
2498
- return { name: op.name, hash: op.hash, kind: op.kind, requires: normalizeRequires(op.requires) };
2489
+ return { name: op.name, kind: op.kind, requires: normalizeRequires(op.requires) };
2499
2490
  });
2500
- const opsHash = `sha256:${crypto.createHash("sha256").update(stableJson(entries)).digest("hex")}`;
2501
2491
  const operationsRecord = {};
2502
2492
  for (const entry of entries) {
2503
- operationsRecord[entry.name] = { hash: entry.hash, kind: entry.kind, requires: entry.requires };
2493
+ operationsRecord[entry.name] = { kind: entry.kind, requires: entry.requires };
2504
2494
  }
2505
2495
  return {
2506
2496
  manifestVersion: MANIFEST_VERSION,
2507
- schemaHash,
2508
- opsHash,
2509
2497
  operations: operationsRecord
2510
2498
  };
2511
2499
  }