@sequenceholdings/orm 2.1.1 → 2.2.0
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 +3 -1
- package/dist/authoring.cjs +284 -99
- package/dist/authoring.cjs.map +1 -1
- package/dist/authoring.d.cts +31 -8
- package/dist/authoring.d.ts +31 -8
- package/dist/authoring.js +282 -100
- package/dist/authoring.js.map +1 -1
- package/dist/canonical.cjs +51 -3
- package/dist/canonical.cjs.map +1 -1
- package/dist/canonical.d.cts +838 -12
- package/dist/canonical.d.ts +838 -12
- package/dist/canonical.js +47 -4
- package/dist/canonical.js.map +1 -1
- package/dist/cli.cjs +5838 -4197
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +5838 -4197
- package/dist/cli.js.map +1 -1
- package/dist/client.cjs +49 -32
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +49 -6
- package/dist/client.d.ts +49 -6
- package/dist/client.js +49 -32
- package/dist/client.js.map +1 -1
- package/dist/compiler.cjs +1237 -263
- package/dist/compiler.cjs.map +1 -1
- package/dist/compiler.d.cts +57 -3
- package/dist/compiler.d.ts +57 -3
- package/dist/compiler.js +1230 -264
- package/dist/compiler.js.map +1 -1
- package/dist/{constants-YoFGjIBM.d.cts → constants-C6EG6Wq7.d.cts} +1 -1
- package/dist/{constants-YoFGjIBM.d.ts → constants-C6EG6Wq7.d.ts} +1 -1
- package/dist/definition-DjfC7Lll.d.cts +91 -0
- package/dist/definition-DjfC7Lll.d.ts +91 -0
- package/dist/dynamic-input.cjs +2 -1
- package/dist/dynamic-input.cjs.map +1 -1
- package/dist/dynamic-input.d.cts +9 -2
- package/dist/dynamic-input.d.ts +9 -2
- package/dist/dynamic-input.js +2 -1
- package/dist/dynamic-input.js.map +1 -1
- package/dist/index.cjs +1094 -321
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +479 -19
- package/dist/index.d.ts +479 -19
- package/dist/index.js +1083 -322
- package/dist/index.js.map +1 -1
- package/dist/ir.cjs +84 -10
- package/dist/ir.cjs.map +1 -1
- package/dist/ir.d.cts +138 -13
- package/dist/ir.d.ts +138 -13
- package/dist/ir.js +81 -11
- package/dist/ir.js.map +1 -1
- package/dist/predicate-v2.cjs +78 -9
- package/dist/predicate-v2.cjs.map +1 -1
- package/dist/predicate-v2.d.cts +1 -1
- package/dist/predicate-v2.d.ts +1 -1
- package/dist/predicate-v2.js +78 -9
- package/dist/predicate-v2.js.map +1 -1
- package/dist/sdl.cjs +156 -21
- package/dist/sdl.cjs.map +1 -1
- package/dist/sdl.d.cts +8 -1
- package/dist/sdl.d.ts +8 -1
- package/dist/sdl.js +156 -21
- package/dist/sdl.js.map +1 -1
- package/package.json +5 -4
- package/src/codegen-gql/server-fns.cjs +2 -2
- package/templates/orm-namespace/AGENTS.md +10 -0
- package/templates/orm-namespace/CLAUDE.md +1 -84
- package/templates/orm-namespace/package.json +1 -1
package/dist/compiler.d.cts
CHANGED
|
@@ -3,9 +3,10 @@ import { ClaimKey, PredIr, RootIr, InputRefKind, TableMetaIr, CompiledOperation,
|
|
|
3
3
|
import { DocumentNode, OperationDefinitionNode, FragmentDefinitionNode, GraphQLSchema, ValueNode, SelectionSetNode } from 'graphql';
|
|
4
4
|
export { DynamicInputIssue, DynamicInputResult, NormalizedBoolExp, NormalizedOnConflict, NormalizedOrderBy, NormalizedRow, ORDER_BY_DIRECTIONS, ScalarKind, allowedBoolExpOperators, allowedOps, validateAppendInput, validateBoolExpInput, validateInsertInput, validateOnConflictInput, validateOrderByInput, validateSelectColumns, validateSetInput } from './dynamic-input.cjs';
|
|
5
5
|
export { CompilePolicyInput, CompilePredicateInput, POLICY_COMPARE_OPS, POLICY_MAX_LINK_DEPTH, ParsedPolicy, PolicyColumnInfo, PolicyCompareOp, PolicyCompileError, PolicyCompileErrorCode, PolicyLinkInfo, PolicyNode, PolicyOperand, PolicyParseError, PolicyResolver, PolicyTableInfo, assertClaimsOnlyWhen, compilePolicy, compilePredicateV2, parsePolicy, walkPolicy } from './predicate-v2.cjs';
|
|
6
|
+
import { z } from 'zod';
|
|
6
7
|
export { P as PLATFORM_USER_TYPENAME, c as camelCase, g as enumTypeName, p as pascalCase } from './naming-CU9ThP_E.cjs';
|
|
7
|
-
|
|
8
|
-
import './constants-
|
|
8
|
+
export { S as SqlOperationDefinition, d as defineOperation, s as sqlOperationDefinitionSchema } from './definition-DjfC7Lll.cjs';
|
|
9
|
+
import './constants-C6EG6Wq7.cjs';
|
|
9
10
|
import './policy-1iZbGnZZ.cjs';
|
|
10
11
|
|
|
11
12
|
type DiagnosticSeverity = 'error' | 'warning';
|
|
@@ -168,6 +169,7 @@ interface ResolvedMutationRootInfo {
|
|
|
168
169
|
type MutationRootInfo = CrudMutationRootInfo | CowMutationRootInfo | ResolvedMutationRootInfo;
|
|
169
170
|
interface CompileContext {
|
|
170
171
|
namespace: string;
|
|
172
|
+
composed: boolean;
|
|
171
173
|
tables: Record<string, TableMetaIr>;
|
|
172
174
|
/** GraphQL object type name → table name. */
|
|
173
175
|
tableByTypename: Map<string, string>;
|
|
@@ -439,4 +441,56 @@ declare function predContainsExists(pred: PredIr): boolean;
|
|
|
439
441
|
/** Structural containment: does `haystack` carry `needle` as a subtree? */
|
|
440
442
|
declare function predContains(haystack: PredIr, needle: PredIr): boolean;
|
|
441
443
|
|
|
442
|
-
|
|
444
|
+
declare function isSqlOperationDocument(path: string, contents?: string): boolean;
|
|
445
|
+
/** Additive language dispatch. GraphQL still uses its original compiler/hash. */
|
|
446
|
+
declare function compileOperationDocuments(input: CompileNamespaceInput): Promise<CompileNamespaceResult>;
|
|
447
|
+
|
|
448
|
+
/** This is deliberately not an arbitrary JSON variable: types and size are bounded. */
|
|
449
|
+
declare const sqlQueryInputSchema: z.ZodObject<{
|
|
450
|
+
sql: z.ZodString;
|
|
451
|
+
parameters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
452
|
+
type: z.ZodLiteral<"text">;
|
|
453
|
+
value: z.ZodNullable<z.ZodString>;
|
|
454
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
455
|
+
type: z.ZodLiteral<"uuid">;
|
|
456
|
+
value: z.ZodNullable<z.ZodGUID>;
|
|
457
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
458
|
+
type: z.ZodLiteral<"date">;
|
|
459
|
+
value: z.ZodNullable<z.ZodString>;
|
|
460
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
461
|
+
type: z.ZodLiteral<"timestamptz">;
|
|
462
|
+
value: z.ZodNullable<z.ZodString>;
|
|
463
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
464
|
+
type: z.ZodLiteral<"numeric">;
|
|
465
|
+
value: z.ZodNullable<z.ZodString>;
|
|
466
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
467
|
+
type: z.ZodLiteral<"bigint">;
|
|
468
|
+
value: z.ZodNullable<z.ZodString>;
|
|
469
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
470
|
+
type: z.ZodLiteral<"integer">;
|
|
471
|
+
value: z.ZodNullable<z.ZodNumber>;
|
|
472
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
473
|
+
type: z.ZodLiteral<"double">;
|
|
474
|
+
value: z.ZodNullable<z.ZodNumber>;
|
|
475
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
476
|
+
type: z.ZodLiteral<"boolean">;
|
|
477
|
+
value: z.ZodNullable<z.ZodBoolean>;
|
|
478
|
+
}, z.core.$strict>], "type">>>;
|
|
479
|
+
}, z.core.$strict>;
|
|
480
|
+
type SqlQueryInput = z.infer<typeof sqlQueryInputSchema>;
|
|
481
|
+
/** The returned plan contains no bound parameter values or caller identity. */
|
|
482
|
+
declare function compileRuntimeSql({ operation, input }: {
|
|
483
|
+
operation: CompiledOperation;
|
|
484
|
+
input: SqlQueryInput;
|
|
485
|
+
}): Promise<CompiledOperation>;
|
|
486
|
+
|
|
487
|
+
declare const DATASET_PREVIEW_LIMIT = 100;
|
|
488
|
+
/**
|
|
489
|
+
* Fixed runtime-owned reads, separate from the published operation manifest.
|
|
490
|
+
* Use logical column identities directly (no GraphQL naming conversion) and
|
|
491
|
+
* the normal compiler context/policy pass. Like generated GraphQL, internal
|
|
492
|
+
* source tables, raw synced backings, and cell metadata are not exposed.
|
|
493
|
+
*/
|
|
494
|
+
declare function compileDatasetPreviews(input: CanonicalDefinition): Record<string, CompiledOperation>;
|
|
495
|
+
|
|
496
|
+
export { type BuildContextResult, COMPILER_MAJOR, CONST_TRUE, type ClientManifest, type ClientManifestOperation, type CompileContext, type CompileNamespaceInput, type CompileNamespaceResult, type CompilerDiagnostic, DATASET_PREVIEW_LIMIT, DEFAULT_LIMIT, type DiagnosticSeverity, DocumentCompileError, MAX_LIMIT, type MutationOp, type MutationRootInfo, NamespaceCompileError, OperationLowerer, PLATFORM_USER_TABLE, type ParseDocumentsResult, type ParsedDocument, type PinnedColumn, type QueryRootInfo, type RestrictedOperation, type SourceDocument, type SqlQueryInput, andPred, buildCompileContext, canonicalOperationText, classifyInputType, collectPinnedColumns, compileDatasetPreviews, compileNamespace, compileNamespaceOrThrow, compileOperationDocuments, compileRuntimeSql, computeOpHash, computeOpsHash, computePinnedColumnsByTable, computeSchemaHash, flattenOperation, injectPolicies, inputTypeName, isSqlOperationDocument, lowerOperation, mutationRootNames, parseDocuments, parseSdl, platformUserMeta, predContains, predContainsExists, queryRootNames, restrictOperation, sqlQueryInputSchema, typeNameForTable, walkPred };
|
package/dist/compiler.d.ts
CHANGED
|
@@ -3,9 +3,10 @@ import { ClaimKey, PredIr, RootIr, InputRefKind, TableMetaIr, CompiledOperation,
|
|
|
3
3
|
import { DocumentNode, OperationDefinitionNode, FragmentDefinitionNode, GraphQLSchema, ValueNode, SelectionSetNode } from 'graphql';
|
|
4
4
|
export { DynamicInputIssue, DynamicInputResult, NormalizedBoolExp, NormalizedOnConflict, NormalizedOrderBy, NormalizedRow, ORDER_BY_DIRECTIONS, ScalarKind, allowedBoolExpOperators, allowedOps, validateAppendInput, validateBoolExpInput, validateInsertInput, validateOnConflictInput, validateOrderByInput, validateSelectColumns, validateSetInput } from './dynamic-input.js';
|
|
5
5
|
export { CompilePolicyInput, CompilePredicateInput, POLICY_COMPARE_OPS, POLICY_MAX_LINK_DEPTH, ParsedPolicy, PolicyColumnInfo, PolicyCompareOp, PolicyCompileError, PolicyCompileErrorCode, PolicyLinkInfo, PolicyNode, PolicyOperand, PolicyParseError, PolicyResolver, PolicyTableInfo, assertClaimsOnlyWhen, compilePolicy, compilePredicateV2, parsePolicy, walkPolicy } from './predicate-v2.js';
|
|
6
|
+
import { z } from 'zod';
|
|
6
7
|
export { P as PLATFORM_USER_TYPENAME, c as camelCase, g as enumTypeName, p as pascalCase } from './naming-CPfx7EfF.js';
|
|
7
|
-
|
|
8
|
-
import './constants-
|
|
8
|
+
export { S as SqlOperationDefinition, d as defineOperation, s as sqlOperationDefinitionSchema } from './definition-DjfC7Lll.js';
|
|
9
|
+
import './constants-C6EG6Wq7.js';
|
|
9
10
|
import './policy-1iZbGnZZ.js';
|
|
10
11
|
|
|
11
12
|
type DiagnosticSeverity = 'error' | 'warning';
|
|
@@ -168,6 +169,7 @@ interface ResolvedMutationRootInfo {
|
|
|
168
169
|
type MutationRootInfo = CrudMutationRootInfo | CowMutationRootInfo | ResolvedMutationRootInfo;
|
|
169
170
|
interface CompileContext {
|
|
170
171
|
namespace: string;
|
|
172
|
+
composed: boolean;
|
|
171
173
|
tables: Record<string, TableMetaIr>;
|
|
172
174
|
/** GraphQL object type name → table name. */
|
|
173
175
|
tableByTypename: Map<string, string>;
|
|
@@ -439,4 +441,56 @@ declare function predContainsExists(pred: PredIr): boolean;
|
|
|
439
441
|
/** Structural containment: does `haystack` carry `needle` as a subtree? */
|
|
440
442
|
declare function predContains(haystack: PredIr, needle: PredIr): boolean;
|
|
441
443
|
|
|
442
|
-
|
|
444
|
+
declare function isSqlOperationDocument(path: string, contents?: string): boolean;
|
|
445
|
+
/** Additive language dispatch. GraphQL still uses its original compiler/hash. */
|
|
446
|
+
declare function compileOperationDocuments(input: CompileNamespaceInput): Promise<CompileNamespaceResult>;
|
|
447
|
+
|
|
448
|
+
/** This is deliberately not an arbitrary JSON variable: types and size are bounded. */
|
|
449
|
+
declare const sqlQueryInputSchema: z.ZodObject<{
|
|
450
|
+
sql: z.ZodString;
|
|
451
|
+
parameters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
452
|
+
type: z.ZodLiteral<"text">;
|
|
453
|
+
value: z.ZodNullable<z.ZodString>;
|
|
454
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
455
|
+
type: z.ZodLiteral<"uuid">;
|
|
456
|
+
value: z.ZodNullable<z.ZodGUID>;
|
|
457
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
458
|
+
type: z.ZodLiteral<"date">;
|
|
459
|
+
value: z.ZodNullable<z.ZodString>;
|
|
460
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
461
|
+
type: z.ZodLiteral<"timestamptz">;
|
|
462
|
+
value: z.ZodNullable<z.ZodString>;
|
|
463
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
464
|
+
type: z.ZodLiteral<"numeric">;
|
|
465
|
+
value: z.ZodNullable<z.ZodString>;
|
|
466
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
467
|
+
type: z.ZodLiteral<"bigint">;
|
|
468
|
+
value: z.ZodNullable<z.ZodString>;
|
|
469
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
470
|
+
type: z.ZodLiteral<"integer">;
|
|
471
|
+
value: z.ZodNullable<z.ZodNumber>;
|
|
472
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
473
|
+
type: z.ZodLiteral<"double">;
|
|
474
|
+
value: z.ZodNullable<z.ZodNumber>;
|
|
475
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
476
|
+
type: z.ZodLiteral<"boolean">;
|
|
477
|
+
value: z.ZodNullable<z.ZodBoolean>;
|
|
478
|
+
}, z.core.$strict>], "type">>>;
|
|
479
|
+
}, z.core.$strict>;
|
|
480
|
+
type SqlQueryInput = z.infer<typeof sqlQueryInputSchema>;
|
|
481
|
+
/** The returned plan contains no bound parameter values or caller identity. */
|
|
482
|
+
declare function compileRuntimeSql({ operation, input }: {
|
|
483
|
+
operation: CompiledOperation;
|
|
484
|
+
input: SqlQueryInput;
|
|
485
|
+
}): Promise<CompiledOperation>;
|
|
486
|
+
|
|
487
|
+
declare const DATASET_PREVIEW_LIMIT = 100;
|
|
488
|
+
/**
|
|
489
|
+
* Fixed runtime-owned reads, separate from the published operation manifest.
|
|
490
|
+
* Use logical column identities directly (no GraphQL naming conversion) and
|
|
491
|
+
* the normal compiler context/policy pass. Like generated GraphQL, internal
|
|
492
|
+
* source tables, raw synced backings, and cell metadata are not exposed.
|
|
493
|
+
*/
|
|
494
|
+
declare function compileDatasetPreviews(input: CanonicalDefinition): Record<string, CompiledOperation>;
|
|
495
|
+
|
|
496
|
+
export { type BuildContextResult, COMPILER_MAJOR, CONST_TRUE, type ClientManifest, type ClientManifestOperation, type CompileContext, type CompileNamespaceInput, type CompileNamespaceResult, type CompilerDiagnostic, DATASET_PREVIEW_LIMIT, DEFAULT_LIMIT, type DiagnosticSeverity, DocumentCompileError, MAX_LIMIT, type MutationOp, type MutationRootInfo, NamespaceCompileError, OperationLowerer, PLATFORM_USER_TABLE, type ParseDocumentsResult, type ParsedDocument, type PinnedColumn, type QueryRootInfo, type RestrictedOperation, type SourceDocument, type SqlQueryInput, andPred, buildCompileContext, canonicalOperationText, classifyInputType, collectPinnedColumns, compileDatasetPreviews, compileNamespace, compileNamespaceOrThrow, compileOperationDocuments, compileRuntimeSql, computeOpHash, computeOpsHash, computePinnedColumnsByTable, computeSchemaHash, flattenOperation, injectPolicies, inputTypeName, isSqlOperationDocument, lowerOperation, mutationRootNames, parseDocuments, parseSdl, platformUserMeta, predContains, predContainsExists, queryRootNames, restrictOperation, sqlQueryInputSchema, typeNameForTable, walkPred };
|