@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/README.md +11 -6
- package/dist/authoring.d.cts +1 -1
- package/dist/authoring.d.ts +1 -1
- package/dist/canonical.d.cts +71 -71
- package/dist/canonical.d.ts +71 -71
- package/dist/cli.cjs +38 -54
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +42 -58
- package/dist/cli.js.map +1 -1
- package/dist/client.cjs +66 -70
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +32 -17
- package/dist/client.d.ts +32 -17
- package/dist/client.js +66 -71
- package/dist/client.js.map +1 -1
- package/dist/compiler.cjs.map +1 -1
- package/dist/compiler.d.cts +1 -1
- package/dist/compiler.d.ts +1 -1
- package/dist/compiler.js.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +57 -57
- package/dist/index.d.ts +57 -57
- package/dist/index.js.map +1 -1
- package/dist/ir.cjs.map +1 -1
- package/dist/ir.d.cts +72 -72
- package/dist/ir.d.ts +72 -72
- package/dist/ir.js.map +1 -1
- package/dist/predicate-v2.cjs.map +1 -1
- package/dist/predicate-v2.js.map +1 -1
- package/dist/sdl.cjs +5 -17
- package/dist/sdl.cjs.map +1 -1
- package/dist/sdl.d.cts +9 -10
- package/dist/sdl.d.ts +9 -10
- package/dist/sdl.js +5 -17
- package/dist/sdl.js.map +1 -1
- package/package.json +2 -1
- package/dist/{definition-B99BsOAO.d.cts → definition-DjfC7Lll.d.cts} +4 -4
- package/dist/{definition-B99BsOAO.d.ts → definition-DjfC7Lll.d.ts} +4 -4
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
|
-
|
|
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
|
-
/**
|
|
87
|
-
hash
|
|
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({
|
|
96
|
-
|
|
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
|
-
|
|
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
|
-
/**
|
|
87
|
-
hash
|
|
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({
|
|
96
|
-
|
|
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
|
|
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 =
|
|
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
|
-
|
|
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] = {
|
|
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
|
}
|