@sequenceholdings/orm 2.8.1 → 2.8.3

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.d.cts CHANGED
@@ -46,13 +46,14 @@ declare function generateSdl(canonical: CanonicalDefinition, options?: GenerateS
46
46
  /** Columns a resolved-table mutation may write: authored data columns, never the view's system columns. */
47
47
  declare function resolvedWritableColumns(table: CanonicalRelation): CanonicalColumn[];
48
48
 
49
- declare const MANIFEST_VERSION: 1;
49
+ /** Client registry keyed by persistent operation names. Compilation digests stay server-side. */
50
+
51
+ declare const MANIFEST_VERSION: 2;
50
52
  declare const manifestRequiresSchema: z.ZodNullable<z.ZodObject<{
51
53
  capability: z.ZodOptional<z.ZodString>;
52
54
  role: z.ZodOptional<z.ZodString>;
53
55
  }, z.core.$strip>>;
54
56
  declare const manifestOperationSchema: z.ZodObject<{
55
- hash: z.ZodString;
56
57
  kind: z.ZodEnum<{
57
58
  query: "query";
58
59
  mutation: "mutation";
@@ -63,11 +64,8 @@ declare const manifestOperationSchema: z.ZodObject<{
63
64
  }, z.core.$strip>>;
64
65
  }, z.core.$strip>;
65
66
  declare const operationsManifestSchema: z.ZodObject<{
66
- manifestVersion: z.ZodLiteral<1>;
67
- schemaHash: z.ZodString;
68
- opsHash: z.ZodString;
67
+ manifestVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
69
68
  operations: z.ZodRecord<z.ZodString, z.ZodObject<{
70
- hash: z.ZodString;
71
69
  kind: z.ZodEnum<{
72
70
  query: "query";
73
71
  mutation: "mutation";
@@ -83,8 +81,8 @@ type ManifestOperation = z.infer<typeof manifestOperationSchema>;
83
81
  interface ManifestOperationInput {
84
82
  /** Operation name as authored in the document (the registry identity). */
85
83
  name: string;
86
- /** Compiled op hash (`sha256:<64 hex>` — the wire selector). */
87
- hash: string;
84
+ /** Legacy generator input; ignored in the client registry. */
85
+ hash?: string;
88
86
  kind: 'query' | 'mutation';
89
87
  /** `@requires` gate; absent/empty normalizes to null. */
90
88
  requires?: {
@@ -92,8 +90,9 @@ interface ManifestOperationInput {
92
90
  role?: string;
93
91
  } | null;
94
92
  }
95
- declare function buildOperationsManifest({ schemaHash, operations, }: {
96
- schemaHash: string;
93
+ declare function buildOperationsManifest({ operations, }: {
94
+ /** Accepted from older generator callers, never emitted. */
95
+ schemaHash?: string;
97
96
  operations: ManifestOperationInput[];
98
97
  }): OperationsManifest;
99
98
 
package/dist/sdl.d.ts CHANGED
@@ -46,13 +46,14 @@ declare function generateSdl(canonical: CanonicalDefinition, options?: GenerateS
46
46
  /** Columns a resolved-table mutation may write: authored data columns, never the view's system columns. */
47
47
  declare function resolvedWritableColumns(table: CanonicalRelation): CanonicalColumn[];
48
48
 
49
- declare const MANIFEST_VERSION: 1;
49
+ /** Client registry keyed by persistent operation names. Compilation digests stay server-side. */
50
+
51
+ declare const MANIFEST_VERSION: 2;
50
52
  declare const manifestRequiresSchema: z.ZodNullable<z.ZodObject<{
51
53
  capability: z.ZodOptional<z.ZodString>;
52
54
  role: z.ZodOptional<z.ZodString>;
53
55
  }, z.core.$strip>>;
54
56
  declare const manifestOperationSchema: z.ZodObject<{
55
- hash: z.ZodString;
56
57
  kind: z.ZodEnum<{
57
58
  query: "query";
58
59
  mutation: "mutation";
@@ -63,11 +64,8 @@ declare const manifestOperationSchema: z.ZodObject<{
63
64
  }, z.core.$strip>>;
64
65
  }, z.core.$strip>;
65
66
  declare const operationsManifestSchema: z.ZodObject<{
66
- manifestVersion: z.ZodLiteral<1>;
67
- schemaHash: z.ZodString;
68
- opsHash: z.ZodString;
67
+ manifestVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
69
68
  operations: z.ZodRecord<z.ZodString, z.ZodObject<{
70
- hash: z.ZodString;
71
69
  kind: z.ZodEnum<{
72
70
  query: "query";
73
71
  mutation: "mutation";
@@ -83,8 +81,8 @@ type ManifestOperation = z.infer<typeof manifestOperationSchema>;
83
81
  interface ManifestOperationInput {
84
82
  /** Operation name as authored in the document (the registry identity). */
85
83
  name: string;
86
- /** Compiled op hash (`sha256:<64 hex>` — the wire selector). */
87
- hash: string;
84
+ /** Legacy generator input; ignored in the client registry. */
85
+ hash?: string;
88
86
  kind: 'query' | 'mutation';
89
87
  /** `@requires` gate; absent/empty normalizes to null. */
90
88
  requires?: {
@@ -92,8 +90,9 @@ interface ManifestOperationInput {
92
90
  role?: string;
93
91
  } | null;
94
92
  }
95
- declare function buildOperationsManifest({ schemaHash, operations, }: {
96
- schemaHash: string;
93
+ declare function buildOperationsManifest({ operations, }: {
94
+ /** Accepted from older generator callers, never emitted. */
95
+ schemaHash?: string;
97
96
  operations: ManifestOperationInput[];
98
97
  }): OperationsManifest;
99
98
 
package/dist/sdl.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { createHash } from 'crypto';
2
+ import 'crypto';
3
3
 
4
4
  // src/canonical/v2.ts
5
5
  var quoteIdentifier = (name) => `"${name.replaceAll('"', '""')}"`;
@@ -2457,29 +2457,23 @@ var CodegenGqlError = class extends Error {
2457
2457
  };
2458
2458
 
2459
2459
  // src/codegen-gql/manifest.ts
2460
- var MANIFEST_VERSION = 1;
2461
- var OP_HASH_RE = /^sha256:[0-9a-f]{64}$/;
2460
+ var MANIFEST_VERSION = 2;
2462
2461
  var GRAPHQL_NAME_RE2 = /^[_A-Za-z][_0-9A-Za-z]*$/;
2463
2462
  var manifestRequiresSchema = z.object({
2464
2463
  capability: z.string().min(1).optional(),
2465
2464
  role: z.string().min(1).optional()
2466
2465
  }).nullable();
2467
2466
  var manifestOperationSchema = z.object({
2468
- hash: z.string().regex(OP_HASH_RE),
2469
2467
  kind: z.enum(["query", "mutation"]),
2470
2468
  requires: manifestRequiresSchema
2471
2469
  });
2472
2470
  var operationsManifestSchema = z.object({
2473
- manifestVersion: z.literal(MANIFEST_VERSION),
2474
- schemaHash: z.string().min(1),
2475
- opsHash: z.string().regex(OP_HASH_RE),
2471
+ manifestVersion: z.union([z.literal(1), z.literal(MANIFEST_VERSION)]),
2476
2472
  operations: z.record(z.string().regex(GRAPHQL_NAME_RE2), manifestOperationSchema)
2477
2473
  });
2478
2474
  function buildOperationsManifest({
2479
- schemaHash,
2480
2475
  operations
2481
2476
  }) {
2482
- if (schemaHash.length === 0) throw new CodegenGqlError("schemaHash must be a non-empty string.");
2483
2477
  const sorted = [...operations].sort((a, b) => a.name.localeCompare(b.name));
2484
2478
  const seen = /* @__PURE__ */ new Set();
2485
2479
  const entries = sorted.map((op) => {
@@ -2490,20 +2484,14 @@ function buildOperationsManifest({
2490
2484
  throw new CodegenGqlError(`Duplicate operation name "${op.name}" \u2014 operation names must be unique per namespace.`);
2491
2485
  }
2492
2486
  seen.add(op.name);
2493
- if (!OP_HASH_RE.test(op.hash)) {
2494
- throw new CodegenGqlError(`Operation "${op.name}" has malformed hash "${op.hash}" (expected sha256:<64 hex>).`);
2495
- }
2496
- return { name: op.name, hash: op.hash, kind: op.kind, requires: normalizeRequires(op.requires) };
2487
+ return { name: op.name, kind: op.kind, requires: normalizeRequires(op.requires) };
2497
2488
  });
2498
- const opsHash = `sha256:${createHash("sha256").update(stableJson(entries)).digest("hex")}`;
2499
2489
  const operationsRecord = {};
2500
2490
  for (const entry of entries) {
2501
- operationsRecord[entry.name] = { hash: entry.hash, kind: entry.kind, requires: entry.requires };
2491
+ operationsRecord[entry.name] = { kind: entry.kind, requires: entry.requires };
2502
2492
  }
2503
2493
  return {
2504
2494
  manifestVersion: MANIFEST_VERSION,
2505
- schemaHash,
2506
- opsHash,
2507
2495
  operations: operationsRecord
2508
2496
  };
2509
2497
  }