@zmdb/core 1.0.0-beta.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/LICENSE +674 -0
- package/README.md +104 -0
- package/dist/app-commands.d.ts +3 -0
- package/dist/app-commands.d.ts.map +1 -0
- package/dist/app-commands.js +3 -0
- package/dist/app-commands.js.map +1 -0
- package/dist/app-cqrs.d.ts +3 -0
- package/dist/app-cqrs.d.ts.map +1 -0
- package/dist/app-cqrs.js +3 -0
- package/dist/app-cqrs.js.map +1 -0
- package/dist/app-data.d.ts +2 -0
- package/dist/app-data.d.ts.map +1 -0
- package/dist/app-data.js +3 -0
- package/dist/app-data.js.map +1 -0
- package/dist/app-di.d.ts +3 -0
- package/dist/app-di.d.ts.map +1 -0
- package/dist/app-di.js +3 -0
- package/dist/app-di.js.map +1 -0
- package/dist/app-events.d.ts +3 -0
- package/dist/app-events.d.ts.map +1 -0
- package/dist/app-events.js +3 -0
- package/dist/app-events.js.map +1 -0
- package/dist/app-health.d.ts +3 -0
- package/dist/app-health.d.ts.map +1 -0
- package/dist/app-health.js +3 -0
- package/dist/app-health.js.map +1 -0
- package/dist/app-lifecycle.d.ts +3 -0
- package/dist/app-lifecycle.d.ts.map +1 -0
- package/dist/app-lifecycle.js +3 -0
- package/dist/app-lifecycle.js.map +1 -0
- package/dist/app-messaging.d.ts +3 -0
- package/dist/app-messaging.d.ts.map +1 -0
- package/dist/app-messaging.js +3 -0
- package/dist/app-messaging.js.map +1 -0
- package/dist/app-modules.d.ts +3 -0
- package/dist/app-modules.d.ts.map +1 -0
- package/dist/app-modules.js +3 -0
- package/dist/app-modules.js.map +1 -0
- package/dist/app-observability.d.ts +3 -0
- package/dist/app-observability.d.ts.map +1 -0
- package/dist/app-observability.js +3 -0
- package/dist/app-observability.js.map +1 -0
- package/dist/app-state.d.ts +3 -0
- package/dist/app-state.d.ts.map +1 -0
- package/dist/app-state.js +3 -0
- package/dist/app-state.js.map +1 -0
- package/dist/app.d.ts +3 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +3 -0
- package/dist/app.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/compiler.d.ts +13 -0
- package/dist/compiler.d.ts.map +1 -0
- package/dist/compiler.js +8 -0
- package/dist/compiler.js.map +1 -0
- package/dist/config/index.d.ts +3 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +2 -0
- package/dist/config/index.js.map +1 -0
- package/dist/database-cockroach.d.ts +2 -0
- package/dist/database-cockroach.d.ts.map +1 -0
- package/dist/database-cockroach.js +2 -0
- package/dist/database-cockroach.js.map +1 -0
- package/dist/database-mssql.d.ts +2 -0
- package/dist/database-mssql.d.ts.map +1 -0
- package/dist/database-mssql.js +2 -0
- package/dist/database-mssql.js.map +1 -0
- package/dist/database-mysql.d.ts +2 -0
- package/dist/database-mysql.d.ts.map +1 -0
- package/dist/database-mysql.js +2 -0
- package/dist/database-mysql.js.map +1 -0
- package/dist/database-postgres.d.ts +2 -0
- package/dist/database-postgres.d.ts.map +1 -0
- package/dist/database-postgres.js +2 -0
- package/dist/database-postgres.js.map +1 -0
- package/dist/database-singlestore.d.ts +2 -0
- package/dist/database-singlestore.d.ts.map +1 -0
- package/dist/database-singlestore.js +2 -0
- package/dist/database-singlestore.js.map +1 -0
- package/dist/database-sqlite.d.ts +2 -0
- package/dist/database-sqlite.d.ts.map +1 -0
- package/dist/database-sqlite.js +2 -0
- package/dist/database-sqlite.js.map +1 -0
- package/dist/derive.d.ts +2 -0
- package/dist/derive.d.ts.map +1 -0
- package/dist/derive.js +13 -0
- package/dist/derive.js.map +1 -0
- package/dist/dto.d.ts +5 -0
- package/dist/dto.d.ts.map +1 -0
- package/dist/dto.js +7 -0
- package/dist/dto.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/ir.d.ts +3 -0
- package/dist/ir.d.ts.map +1 -0
- package/dist/ir.js +11 -0
- package/dist/ir.js.map +1 -0
- package/dist/migrations.d.ts +9 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +9 -0
- package/dist/migrations.js.map +1 -0
- package/dist/orm.d.ts +16 -0
- package/dist/orm.d.ts.map +1 -0
- package/dist/orm.js +18 -0
- package/dist/orm.js.map +1 -0
- package/dist/relations.d.ts +5 -0
- package/dist/relations.d.ts.map +1 -0
- package/dist/relations.js +12 -0
- package/dist/relations.js.map +1 -0
- package/dist/schema.d.ts +25 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +27 -0
- package/dist/schema.js.map +1 -0
- package/dist/sql.d.ts +14 -0
- package/dist/sql.d.ts.map +1 -0
- package/dist/sql.js +16 -0
- package/dist/sql.js.map +1 -0
- package/dist/tags.d.ts +2 -0
- package/dist/tags.d.ts.map +1 -0
- package/dist/tags.js +5 -0
- package/dist/tags.js.map +1 -0
- package/dist/testing/official-dialects.fixture.d.ts +16 -0
- package/dist/testing/official-dialects.fixture.d.ts.map +1 -0
- package/dist/testing/official-dialects.fixture.js +21 -0
- package/dist/testing/official-dialects.fixture.js.map +1 -0
- package/dist/testing.d.ts +5 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +4 -0
- package/dist/testing.js.map +1 -0
- package/dist/validator.d.ts +9 -0
- package/dist/validator.d.ts.map +1 -0
- package/dist/validator.js +11 -0
- package/dist/validator.js.map +1 -0
- package/dist/web-app.d.ts +3 -0
- package/dist/web-app.d.ts.map +1 -0
- package/dist/web-app.js +3 -0
- package/dist/web-app.js.map +1 -0
- package/dist/web-compression.d.ts +3 -0
- package/dist/web-compression.d.ts.map +1 -0
- package/dist/web-compression.js +3 -0
- package/dist/web-compression.js.map +1 -0
- package/dist/web-context.d.ts +3 -0
- package/dist/web-context.d.ts.map +1 -0
- package/dist/web-context.js +3 -0
- package/dist/web-context.js.map +1 -0
- package/dist/web-contract-compiler.d.ts +3 -0
- package/dist/web-contract-compiler.d.ts.map +1 -0
- package/dist/web-contract-compiler.js +3 -0
- package/dist/web-contract-compiler.js.map +1 -0
- package/dist/web-contract.d.ts +3 -0
- package/dist/web-contract.d.ts.map +1 -0
- package/dist/web-contract.js +3 -0
- package/dist/web-contract.js.map +1 -0
- package/dist/web-csrf.d.ts +3 -0
- package/dist/web-csrf.d.ts.map +1 -0
- package/dist/web-csrf.js +3 -0
- package/dist/web-csrf.js.map +1 -0
- package/dist/web-data.d.ts +2 -0
- package/dist/web-data.d.ts.map +1 -0
- package/dist/web-data.js +3 -0
- package/dist/web-data.js.map +1 -0
- package/dist/web-devtools.d.ts +3 -0
- package/dist/web-devtools.d.ts.map +1 -0
- package/dist/web-devtools.js +3 -0
- package/dist/web-devtools.js.map +1 -0
- package/dist/web-dto-pipes.d.ts +3 -0
- package/dist/web-dto-pipes.d.ts.map +1 -0
- package/dist/web-dto-pipes.js +3 -0
- package/dist/web-dto-pipes.js.map +1 -0
- package/dist/web-gateways.d.ts +3 -0
- package/dist/web-gateways.d.ts.map +1 -0
- package/dist/web-gateways.js +3 -0
- package/dist/web-gateways.js.map +1 -0
- package/dist/web-health.d.ts +3 -0
- package/dist/web-health.d.ts.map +1 -0
- package/dist/web-health.js +3 -0
- package/dist/web-health.js.map +1 -0
- package/dist/web-middleware.d.ts +3 -0
- package/dist/web-middleware.d.ts.map +1 -0
- package/dist/web-middleware.js +3 -0
- package/dist/web-middleware.js.map +1 -0
- package/dist/web-openapi.d.ts +3 -0
- package/dist/web-openapi.d.ts.map +1 -0
- package/dist/web-openapi.js +3 -0
- package/dist/web-openapi.js.map +1 -0
- package/dist/web-pipeline.d.ts +3 -0
- package/dist/web-pipeline.d.ts.map +1 -0
- package/dist/web-pipeline.js +3 -0
- package/dist/web-pipeline.js.map +1 -0
- package/dist/web-routing.d.ts +3 -0
- package/dist/web-routing.d.ts.map +1 -0
- package/dist/web-routing.js +3 -0
- package/dist/web-routing.js.map +1 -0
- package/dist/web-static.d.ts +3 -0
- package/dist/web-static.d.ts.map +1 -0
- package/dist/web-static.js +3 -0
- package/dist/web-static.js.map +1 -0
- package/dist/web-testing.d.ts +3 -0
- package/dist/web-testing.d.ts.map +1 -0
- package/dist/web-testing.js +3 -0
- package/dist/web-testing.js.map +1 -0
- package/dist/web-upload.d.ts +3 -0
- package/dist/web-upload.d.ts.map +1 -0
- package/dist/web-upload.js +3 -0
- package/dist/web-upload.js.map +1 -0
- package/dist/web-versioning.d.ts +3 -0
- package/dist/web-versioning.d.ts.map +1 -0
- package/dist/web-versioning.js +3 -0
- package/dist/web-versioning.js.map +1 -0
- package/dist/web.d.ts +5 -0
- package/dist/web.d.ts.map +1 -0
- package/dist/web.js +7 -0
- package/dist/web.js.map +1 -0
- package/package.json +292 -0
- package/src/app-commands.ts +3 -0
- package/src/app-cqrs.ts +10 -0
- package/src/app-data.ts +2 -0
- package/src/app-di.ts +3 -0
- package/src/app-events.ts +3 -0
- package/src/app-health.ts +10 -0
- package/src/app-lifecycle.ts +3 -0
- package/src/app-messaging.ts +43 -0
- package/src/app-modules.ts +11 -0
- package/src/app-observability.ts +25 -0
- package/src/app-state.ts +3 -0
- package/src/app.ts +42 -0
- package/src/cli/index.ts +28 -0
- package/src/compiler.ts +66 -0
- package/src/config/index.ts +13 -0
- package/src/database-cockroach.ts +10 -0
- package/src/database-mssql.ts +20 -0
- package/src/database-mysql.ts +24 -0
- package/src/database-postgres.ts +18 -0
- package/src/database-singlestore.ts +16 -0
- package/src/database-sqlite.ts +10 -0
- package/src/derive.ts +27 -0
- package/src/dto.ts +25 -0
- package/src/index.ts +57 -0
- package/src/ir.ts +62 -0
- package/src/migrations.ts +97 -0
- package/src/orm.ts +90 -0
- package/src/relations.ts +11 -0
- package/src/schema.ts +193 -0
- package/src/sql.ts +130 -0
- package/src/tags.ts +33 -0
- package/src/testing/official-dialects.fixture.ts +24 -0
- package/src/testing.ts +7 -0
- package/src/validator.ts +44 -0
- package/src/web-app.ts +9 -0
- package/src/web-compression.ts +3 -0
- package/src/web-context.ts +3 -0
- package/src/web-contract-compiler.ts +7 -0
- package/src/web-contract.ts +36 -0
- package/src/web-csrf.ts +3 -0
- package/src/web-data.ts +2 -0
- package/src/web-devtools.ts +12 -0
- package/src/web-dto-pipes.ts +3 -0
- package/src/web-gateways.ts +3 -0
- package/src/web-health.ts +3 -0
- package/src/web-middleware.ts +12 -0
- package/src/web-openapi.ts +15 -0
- package/src/web-pipeline.ts +28 -0
- package/src/web-routing.ts +3 -0
- package/src/web-static.ts +3 -0
- package/src/web-testing.ts +3 -0
- package/src/web-upload.ts +3 -0
- package/src/web-versioning.ts +3 -0
- package/src/web.ts +178 -0
package/src/orm.ts
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// Repository, transaction, loading, caching, seeding, outbox, replica, and
|
|
2
|
+
// entity-modeling concern. Database clients remain selected driver subpaths.
|
|
3
|
+
|
|
4
|
+
export {
|
|
5
|
+
BaseRepository,
|
|
6
|
+
IncompleteKeyError,
|
|
7
|
+
ValidationError,
|
|
8
|
+
batch,
|
|
9
|
+
createLoaderScope,
|
|
10
|
+
createTransactionalDb,
|
|
11
|
+
defineRepository,
|
|
12
|
+
markTransactionClosed,
|
|
13
|
+
memoryStore,
|
|
14
|
+
} from '@zmdb/orm';
|
|
15
|
+
export {
|
|
16
|
+
type ActiveTransactionContext,
|
|
17
|
+
type ArgsOf,
|
|
18
|
+
type CacheInvalidationOptions,
|
|
19
|
+
type CacheOptions,
|
|
20
|
+
type CacheStore,
|
|
21
|
+
type ClosedTransactionContext,
|
|
22
|
+
type DatabaseVertical,
|
|
23
|
+
type DefineRepositoryOptions,
|
|
24
|
+
type Driver,
|
|
25
|
+
type EntityLoader,
|
|
26
|
+
type ExecuteOptions,
|
|
27
|
+
type FilterDef,
|
|
28
|
+
type FilterOverride,
|
|
29
|
+
type FilterOverrides,
|
|
30
|
+
type FilterParams,
|
|
31
|
+
type FilterPredicate,
|
|
32
|
+
type LoaderScope,
|
|
33
|
+
type NumericColumnOf,
|
|
34
|
+
type QueryMeta,
|
|
35
|
+
type ReadOptions,
|
|
36
|
+
type RelationLoader,
|
|
37
|
+
type RelationValueOf,
|
|
38
|
+
type RepositoryAggregateBuilder,
|
|
39
|
+
type RepositoryOptions,
|
|
40
|
+
type ResultOf,
|
|
41
|
+
type StreamOptions,
|
|
42
|
+
type TransactionContext,
|
|
43
|
+
type TransactionOptions,
|
|
44
|
+
type TransactionRetryPolicy,
|
|
45
|
+
type TransactionState,
|
|
46
|
+
type TransactionalDb,
|
|
47
|
+
type TransactionalDriver,
|
|
48
|
+
type TxConnection,
|
|
49
|
+
type UpdatePatch,
|
|
50
|
+
type UpsertOptions,
|
|
51
|
+
type ValidationIssue,
|
|
52
|
+
type WriteOptions,
|
|
53
|
+
} from '@zmdb/orm';
|
|
54
|
+
|
|
55
|
+
export { makeRng, seedRows } from '@zmdb/orm/seeding';
|
|
56
|
+
export { type SeedOptions } from '@zmdb/orm/seeding';
|
|
57
|
+
|
|
58
|
+
export { OutboxSchema, createOutboxDispatcher, outboxWriter } from '@zmdb/orm/outbox';
|
|
59
|
+
export {
|
|
60
|
+
type DeadOutboxRow,
|
|
61
|
+
type OutboxDispatcher,
|
|
62
|
+
type OutboxDispatcherOptions,
|
|
63
|
+
type OutboxRow,
|
|
64
|
+
type OutboxStatus,
|
|
65
|
+
type OutboxWriter,
|
|
66
|
+
} from '@zmdb/orm/outbox';
|
|
67
|
+
|
|
68
|
+
export { isWrite, withReplicas } from '@zmdb/orm/replicas';
|
|
69
|
+
export { type ReplicaOptions } from '@zmdb/orm/replicas';
|
|
70
|
+
|
|
71
|
+
export { makeEndpoint } from '@zmdb/web/integrations';
|
|
72
|
+
export { type EndpointResult, type Handler } from '@zmdb/web/integrations';
|
|
73
|
+
|
|
74
|
+
export { EventBus } from '@zmdb/orm/entity-modeling';
|
|
75
|
+
export { discriminatorFor, flattenEmbeddable, liftEmbeddable, rowToSubtype } from '@zmdb/schema/entity-modeling';
|
|
76
|
+
export { type LifecycleEvent, type Subscriber } from '@zmdb/orm/entity-modeling';
|
|
77
|
+
export { type SingleTableInheritance } from '@zmdb/schema/entity-modeling';
|
|
78
|
+
|
|
79
|
+
export {
|
|
80
|
+
OUTBOX_TABLE,
|
|
81
|
+
outboxCandidatesQuery,
|
|
82
|
+
outboxClaimQuery,
|
|
83
|
+
outboxMarkDeadQuery,
|
|
84
|
+
outboxMarkDeliveredQuery,
|
|
85
|
+
outboxMarkRetryQuery,
|
|
86
|
+
outboxMigration,
|
|
87
|
+
outboxPendingIndexDdl,
|
|
88
|
+
outboxReadBackQuery,
|
|
89
|
+
outboxTableDdl,
|
|
90
|
+
} from '@zmdb/orm/outbox';
|
package/src/relations.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// zmdb/relations — explicit named re-exports of the relations surface.
|
|
2
|
+
//
|
|
3
|
+
// A relation is declared on the type it belongs to — `orders?: Order[] & OneToMany<'orders',
|
|
4
|
+
// 'userId'>`, from `@zmdb/schema/tags` — so there are no builders here to construct one
|
|
5
|
+
// with, and no relations map to pass anywhere. What a consumer needs is resolution and the
|
|
6
|
+
// two row helpers. `Populated`/`PopulatedEntity` live on `@zmdb/schema/derive` with the
|
|
7
|
+
// rest of the type derivation.
|
|
8
|
+
export { aliasRow, attachPopulated, compilePopulate } from '@zmdb/orm/relations';
|
|
9
|
+
export { resolveRelation } from '@zmdb/schema/relations';
|
|
10
|
+
export { type JoinRow, type PopulateDialect, type PopulateQuery } from '@zmdb/orm/relations';
|
|
11
|
+
export { type ResolvedRelation } from '@zmdb/schema/relations';
|
package/src/schema.ts
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
// Complete schema concern: declarations, derivation, DTOs, relations, IR,
|
|
2
|
+
// JSON Schema, custom codecs, and naming. Every name delegates by identity.
|
|
3
|
+
|
|
4
|
+
export { ValidationError, claimsValidationIssues, validationIssuesOf } from '@zmdb/validator';
|
|
5
|
+
export { aliasRow, attachPopulated, compilePopulate } from '@zmdb/orm/relations';
|
|
6
|
+
export { applyOrderBy, applyPagination, compileWhere } from '@zmdb/orm/dto';
|
|
7
|
+
export { buildListResult, isRecord, resolveRelation, schemaOf } from '@zmdb/schema';
|
|
8
|
+
export { createStateUpdatePayload, defineEntityStateMachine, defineStateTransitions } from '@zmdb/app';
|
|
9
|
+
export {
|
|
10
|
+
type AllowedTargetStates,
|
|
11
|
+
type EntityStateMachine,
|
|
12
|
+
type EntityStateMachineOptions,
|
|
13
|
+
type StateTransitions,
|
|
14
|
+
type StateUpdateDTO,
|
|
15
|
+
} from '@zmdb/app';
|
|
16
|
+
export {
|
|
17
|
+
type ColumnFlags,
|
|
18
|
+
type ColumnMeta,
|
|
19
|
+
type ColumnsMap,
|
|
20
|
+
type CoreSchema,
|
|
21
|
+
type CreateDTO,
|
|
22
|
+
type DeclaredTable,
|
|
23
|
+
type Entity,
|
|
24
|
+
type ListDTO,
|
|
25
|
+
type ListResult,
|
|
26
|
+
type OrderByDTO,
|
|
27
|
+
type PaginationDTO,
|
|
28
|
+
type Populated,
|
|
29
|
+
type PopulatedEntity,
|
|
30
|
+
type PrimaryKeyOf,
|
|
31
|
+
type ReadDTO,
|
|
32
|
+
type ResolvedRelation,
|
|
33
|
+
type SqlType,
|
|
34
|
+
type TaggedSchema,
|
|
35
|
+
type UpdateDTO,
|
|
36
|
+
type ValidationRule,
|
|
37
|
+
type WhereDTO,
|
|
38
|
+
} from '@zmdb/schema';
|
|
39
|
+
export { type JoinRow, type PopulateDialect, type PopulateQuery } from '@zmdb/orm/relations';
|
|
40
|
+
export { type OrderTarget } from '@zmdb/orm/dto';
|
|
41
|
+
export { type ValidationIssue } from '@zmdb/validator';
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
type AnyRelation,
|
|
45
|
+
type Codec,
|
|
46
|
+
type ColumnSqlType,
|
|
47
|
+
type Ext,
|
|
48
|
+
type ForeignKey,
|
|
49
|
+
type Fts,
|
|
50
|
+
type HasDefault,
|
|
51
|
+
type Length,
|
|
52
|
+
type ManyToMany,
|
|
53
|
+
type ManyToOne,
|
|
54
|
+
type Max,
|
|
55
|
+
type MaxLength,
|
|
56
|
+
type Min,
|
|
57
|
+
type MinLength,
|
|
58
|
+
type NonNull,
|
|
59
|
+
type Nullable,
|
|
60
|
+
type Numeric,
|
|
61
|
+
type OnDelete,
|
|
62
|
+
type OnUpdate,
|
|
63
|
+
type OneToMany,
|
|
64
|
+
type OneToOne,
|
|
65
|
+
type Pattern,
|
|
66
|
+
type Physical,
|
|
67
|
+
type PrimaryKey,
|
|
68
|
+
type Proto,
|
|
69
|
+
type ProtoField,
|
|
70
|
+
type References,
|
|
71
|
+
type ReferentialAction,
|
|
72
|
+
type RelationKind,
|
|
73
|
+
type Rowstore,
|
|
74
|
+
type Rule,
|
|
75
|
+
type Sensitive,
|
|
76
|
+
type Serial,
|
|
77
|
+
type ShardKey,
|
|
78
|
+
type SoftDelete,
|
|
79
|
+
type SortKey,
|
|
80
|
+
type Sql,
|
|
81
|
+
type Table,
|
|
82
|
+
type Unique,
|
|
83
|
+
type WireAs,
|
|
84
|
+
} from '@zmdb/schema/tags';
|
|
85
|
+
|
|
86
|
+
export {
|
|
87
|
+
type ColumnKeys,
|
|
88
|
+
type DefaultKeys,
|
|
89
|
+
type GetDTO,
|
|
90
|
+
type GetOptions,
|
|
91
|
+
type KeysCarrying,
|
|
92
|
+
type NullableKeys,
|
|
93
|
+
type PrimaryKeyKeys,
|
|
94
|
+
type Projection,
|
|
95
|
+
type RelationKeys,
|
|
96
|
+
type SensitiveKeys,
|
|
97
|
+
type SerialKeys,
|
|
98
|
+
type SoftDeleteKeys,
|
|
99
|
+
type UniqueKeys,
|
|
100
|
+
type Wire,
|
|
101
|
+
type WireCreateDTO,
|
|
102
|
+
} from '@zmdb/schema/derive';
|
|
103
|
+
|
|
104
|
+
export { applyKeysetFilter } from '@zmdb/orm/dto';
|
|
105
|
+
export { buildSearchResult, decodeCursor, describeAggregate, encodeCursor, getResult, project } from '@zmdb/schema/dto';
|
|
106
|
+
export {
|
|
107
|
+
type AggFn,
|
|
108
|
+
type AggregateColumn,
|
|
109
|
+
type AggregateResult,
|
|
110
|
+
type AggregateSpec,
|
|
111
|
+
type ComputedSpec,
|
|
112
|
+
type FieldOps,
|
|
113
|
+
type OffsetPage,
|
|
114
|
+
type OrderBySpec,
|
|
115
|
+
type OrderDir,
|
|
116
|
+
type PaginationSpec,
|
|
117
|
+
type SearchDTO,
|
|
118
|
+
type SearchHit,
|
|
119
|
+
type SearchResult,
|
|
120
|
+
type SubqueryTarget,
|
|
121
|
+
type UnknownRow,
|
|
122
|
+
} from '@zmdb/schema/dto';
|
|
123
|
+
export { type WhereTarget } from '@zmdb/orm/dto';
|
|
124
|
+
|
|
125
|
+
export {
|
|
126
|
+
KNOWN_CONSTRAINT_KINDS,
|
|
127
|
+
PROTO_SCALARS,
|
|
128
|
+
RELATION_KINDS,
|
|
129
|
+
SQL_TYPES,
|
|
130
|
+
appTypeOf,
|
|
131
|
+
dbDecodedColumns,
|
|
132
|
+
decodeDbValue,
|
|
133
|
+
decodeWire,
|
|
134
|
+
decodeWireValue,
|
|
135
|
+
encodeWire,
|
|
136
|
+
encodeWireValue,
|
|
137
|
+
jsonSchemaForColumn,
|
|
138
|
+
jsonSchemaFromIR,
|
|
139
|
+
jsonSchemaFromShape,
|
|
140
|
+
jsonSchemaFromTypeIR,
|
|
141
|
+
objectTypeFromIR,
|
|
142
|
+
objectTypeFromShape,
|
|
143
|
+
schemaFromIR,
|
|
144
|
+
shapeOfVariant,
|
|
145
|
+
wireTypeOf,
|
|
146
|
+
} from '@zmdb/schema/ir';
|
|
147
|
+
export {
|
|
148
|
+
type ArrayIR,
|
|
149
|
+
type CodecRegistry,
|
|
150
|
+
type ColumnIR,
|
|
151
|
+
type ConstraintKind,
|
|
152
|
+
type Constraints,
|
|
153
|
+
type ExtensionType,
|
|
154
|
+
type ForeignKeyIR,
|
|
155
|
+
type JsonValue,
|
|
156
|
+
type Layer,
|
|
157
|
+
type LiteralIR,
|
|
158
|
+
type NullIR,
|
|
159
|
+
type ObjectIR,
|
|
160
|
+
type PropertyIR,
|
|
161
|
+
type ProtoScalar,
|
|
162
|
+
type RefIR,
|
|
163
|
+
type RelationIR,
|
|
164
|
+
type ScalarIR,
|
|
165
|
+
type ScalarKind,
|
|
166
|
+
type SchemaIR,
|
|
167
|
+
type ShapeColumnIR,
|
|
168
|
+
type ShapeIR,
|
|
169
|
+
type TableOptions,
|
|
170
|
+
type TagField,
|
|
171
|
+
type TupleIR,
|
|
172
|
+
type TypeIR,
|
|
173
|
+
type UndefinedIR,
|
|
174
|
+
type UnionIR,
|
|
175
|
+
type UnknownIR,
|
|
176
|
+
type UnsupportedIR,
|
|
177
|
+
} from '@zmdb/schema/ir';
|
|
178
|
+
|
|
179
|
+
export {
|
|
180
|
+
componentName,
|
|
181
|
+
toJsonSchema,
|
|
182
|
+
toJsonSchemaWithRelations,
|
|
183
|
+
toListSchema,
|
|
184
|
+
toOpenApiComponents,
|
|
185
|
+
toSearchSchema,
|
|
186
|
+
} from '@zmdb/schema/openapi';
|
|
187
|
+
export { type EnvelopeSchema, type JsonSchemaObject, type Variant } from '@zmdb/schema/openapi';
|
|
188
|
+
|
|
189
|
+
export { decodeValue, defineType, encodeValue, wireCodec } from '@zmdb/schema/custom-types';
|
|
190
|
+
export { type CustomType } from '@zmdb/schema/custom-types';
|
|
191
|
+
|
|
192
|
+
export { resolveNaming, snakeCase, snakeCasePlural } from '@zmdb/schema/naming';
|
|
193
|
+
export { type NamingStrategy, type NamingStrategyConfig, type NamingStrategyName } from '@zmdb/schema/naming';
|
package/src/sql.ts
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
// Direct SQL compilation and DDL concern. Migration execution and catalog
|
|
2
|
+
// introspection live under `@zmdb/core/migrations`.
|
|
3
|
+
|
|
4
|
+
export {
|
|
5
|
+
DISTANCE_OPERATORS,
|
|
6
|
+
EXPR,
|
|
7
|
+
OP_MAP,
|
|
8
|
+
QueryCompilerError,
|
|
9
|
+
UnsupportedFeatureError,
|
|
10
|
+
appendComment,
|
|
11
|
+
coalesce,
|
|
12
|
+
concat,
|
|
13
|
+
createQueryCompiler,
|
|
14
|
+
dec,
|
|
15
|
+
defineSqlDialect,
|
|
16
|
+
dialectCapabilities,
|
|
17
|
+
dialectFamily,
|
|
18
|
+
dialectName,
|
|
19
|
+
dialectSupportsReturning,
|
|
20
|
+
dialectTraits,
|
|
21
|
+
distance,
|
|
22
|
+
extendSqlDialect,
|
|
23
|
+
formatPlaceholder,
|
|
24
|
+
inc,
|
|
25
|
+
isSqlDialect,
|
|
26
|
+
mul,
|
|
27
|
+
not,
|
|
28
|
+
proposed,
|
|
29
|
+
quoteColumn,
|
|
30
|
+
quoteIdentifier,
|
|
31
|
+
quoteTable,
|
|
32
|
+
renderPredicate,
|
|
33
|
+
renumberPlaceholders,
|
|
34
|
+
serializeComment,
|
|
35
|
+
stContains,
|
|
36
|
+
stDWithin,
|
|
37
|
+
withComments,
|
|
38
|
+
} from '@zmdb/sql';
|
|
39
|
+
export {
|
|
40
|
+
type AliasedColumn,
|
|
41
|
+
type AliasedDistanceExpression,
|
|
42
|
+
type ColumnExpr,
|
|
43
|
+
type CommentKey,
|
|
44
|
+
type CommentKeys,
|
|
45
|
+
type CommentPairs,
|
|
46
|
+
type ComparisonPredicate,
|
|
47
|
+
type CompiledQuery,
|
|
48
|
+
type DatabaseCapabilities,
|
|
49
|
+
type DeleteBuilder,
|
|
50
|
+
type DialectFeature,
|
|
51
|
+
type DialectSqlType,
|
|
52
|
+
type DialectTarget,
|
|
53
|
+
type DialectTypeMap,
|
|
54
|
+
type Direction,
|
|
55
|
+
type DistanceExpression,
|
|
56
|
+
type DistanceOp,
|
|
57
|
+
type ExtensionColumnOf,
|
|
58
|
+
type GeoJsonGeometry,
|
|
59
|
+
type GeometryColumnOf,
|
|
60
|
+
type GeometryValueOf,
|
|
61
|
+
type InsertBuilder,
|
|
62
|
+
type OnConflictBuilder,
|
|
63
|
+
type Operator,
|
|
64
|
+
type PaginationTail,
|
|
65
|
+
type PlaceholderStyle,
|
|
66
|
+
type Predicate,
|
|
67
|
+
type PredicateGroup,
|
|
68
|
+
type QueryCompiler,
|
|
69
|
+
type QueryCompilerOptions,
|
|
70
|
+
type QueryTelemetry,
|
|
71
|
+
type ResolvedDialectTraits,
|
|
72
|
+
type ReturningCapability,
|
|
73
|
+
type ReturningStatement,
|
|
74
|
+
type ReturningStyle,
|
|
75
|
+
type SchemaObjectOperation,
|
|
76
|
+
type SelectBuilder,
|
|
77
|
+
type SetValue,
|
|
78
|
+
type SpatialPredicate,
|
|
79
|
+
type SqlDialect,
|
|
80
|
+
type SqlDialectDefinition,
|
|
81
|
+
type SqlDialectExtension,
|
|
82
|
+
type UpdateBuilder,
|
|
83
|
+
type VectorColumnOf,
|
|
84
|
+
} from '@zmdb/sql';
|
|
85
|
+
|
|
86
|
+
export { escapeFts5Term, ftsSelectFrom } from '@zmdb/sql/fts';
|
|
87
|
+
export { type FtsOptions, type FtsSelect, type FtsTableOptions } from '@zmdb/sql/fts';
|
|
88
|
+
|
|
89
|
+
export { joinableSelectFrom } from '@zmdb/sql/joins';
|
|
90
|
+
export { type JoinCondition, type JoinKind, type JoinableSelect } from '@zmdb/sql/joins';
|
|
91
|
+
|
|
92
|
+
export { aggregateSelectFrom } from '@zmdb/sql/aggregations';
|
|
93
|
+
export { type AggregateSelect } from '@zmdb/sql/aggregations';
|
|
94
|
+
|
|
95
|
+
export { SET_KEYWORD, batch, setOperation } from '@zmdb/sql/set-ops';
|
|
96
|
+
export { type BatchHandle, type SetOp } from '@zmdb/sql/set-ops';
|
|
97
|
+
|
|
98
|
+
export {
|
|
99
|
+
checkConstraintDdl,
|
|
100
|
+
createExtensionDdl,
|
|
101
|
+
createIndexDdl,
|
|
102
|
+
createPolicyDdl,
|
|
103
|
+
createRoutineDdl,
|
|
104
|
+
createSchemaDdl,
|
|
105
|
+
createSequenceDdl,
|
|
106
|
+
createViewDdl,
|
|
107
|
+
ddlType,
|
|
108
|
+
dropRoutineDdl,
|
|
109
|
+
dropViewDdl,
|
|
110
|
+
enableRlsDdl,
|
|
111
|
+
generatedColumnDdl,
|
|
112
|
+
qualify,
|
|
113
|
+
quoteId,
|
|
114
|
+
replaceRoutineStatements,
|
|
115
|
+
routineFingerprint,
|
|
116
|
+
} from '@zmdb/sql/schema-objects';
|
|
117
|
+
export {
|
|
118
|
+
type ExtensionDef,
|
|
119
|
+
type GeneratedColumn,
|
|
120
|
+
type IndexColumn,
|
|
121
|
+
type IndexDef,
|
|
122
|
+
type IndexMethod,
|
|
123
|
+
type RlsPolicy,
|
|
124
|
+
type RoutineDef,
|
|
125
|
+
type RoutineSqlType,
|
|
126
|
+
type SequenceDef,
|
|
127
|
+
type ViewDef,
|
|
128
|
+
} from '@zmdb/sql/schema-objects';
|
|
129
|
+
|
|
130
|
+
export { singularPascalCase } from '@zmdb/schema/naming';
|
package/src/tags.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// zmdb/tags — explicit named type exports for schema declarations.
|
|
2
|
+
// The inline type specifiers erase their bindings. With verbatimModuleSyntax,
|
|
3
|
+
// the emitted module retains an empty re-export from @zmdb/schema/tags.
|
|
4
|
+
export {
|
|
5
|
+
type Codec,
|
|
6
|
+
type Ext,
|
|
7
|
+
type Fts,
|
|
8
|
+
type HasDefault,
|
|
9
|
+
type Length,
|
|
10
|
+
type ManyToMany,
|
|
11
|
+
type ManyToOne,
|
|
12
|
+
type Max,
|
|
13
|
+
type MaxLength,
|
|
14
|
+
type Min,
|
|
15
|
+
type MinLength,
|
|
16
|
+
type NonNull,
|
|
17
|
+
type Nullable,
|
|
18
|
+
type Numeric,
|
|
19
|
+
type OneToMany,
|
|
20
|
+
type OneToOne,
|
|
21
|
+
type Pattern,
|
|
22
|
+
type Physical,
|
|
23
|
+
type PrimaryKey,
|
|
24
|
+
type Proto,
|
|
25
|
+
type ProtoField,
|
|
26
|
+
type References,
|
|
27
|
+
type Rule,
|
|
28
|
+
type Sensitive,
|
|
29
|
+
type Serial,
|
|
30
|
+
type Sql,
|
|
31
|
+
type Table,
|
|
32
|
+
type Unique,
|
|
33
|
+
} from '@zmdb/schema/tags';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { cockroach } from '@zmdb/cockroach';
|
|
2
|
+
import { mssql } from '@zmdb/mssql';
|
|
3
|
+
import { mysql } from '@zmdb/mysql';
|
|
4
|
+
import { postgres } from '@zmdb/postgres';
|
|
5
|
+
import { singlestore } from '@zmdb/singlestore';
|
|
6
|
+
import { sqlite } from '@zmdb/sqlite';
|
|
7
|
+
|
|
8
|
+
export const cockroachDialect = cockroach;
|
|
9
|
+
export const mssqlDialect = mssql;
|
|
10
|
+
export const mysqlDialect = mysql;
|
|
11
|
+
export const postgresDialect = postgres;
|
|
12
|
+
export const singlestoreDialect = singlestore;
|
|
13
|
+
export const sqliteDialect = sqlite;
|
|
14
|
+
|
|
15
|
+
export const officialDialects = Object.freeze({
|
|
16
|
+
cockroach: cockroachDialect,
|
|
17
|
+
mssql: mssqlDialect,
|
|
18
|
+
mysql: mysqlDialect,
|
|
19
|
+
postgres: postgresDialect,
|
|
20
|
+
singlestore: singlestoreDialect,
|
|
21
|
+
sqlite: sqliteDialect,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export type OfficialDialectName = keyof typeof officialDialects;
|
package/src/testing.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Product-level test application and compiler-backed schema helpers.
|
|
2
|
+
|
|
3
|
+
export { schemaIrsFrom, schemasFrom, schemasFromFiles } from '@zmdb/compiler/testing';
|
|
4
|
+
export type { SchemasFromFilesOptions, SchemasFromOptions } from '@zmdb/compiler/testing';
|
|
5
|
+
|
|
6
|
+
export { createTestApp } from '@zmdb/web/testing';
|
|
7
|
+
export type { TestApp, TestAppOptions } from '@zmdb/web/testing';
|
package/src/validator.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Runtime validation, rule composition, and serialization. Compiler-backed
|
|
2
|
+
// reflection and transforms live under `@zmdb/core/compiler`.
|
|
3
|
+
|
|
4
|
+
export {
|
|
5
|
+
AssertError,
|
|
6
|
+
assert,
|
|
7
|
+
assertEquals,
|
|
8
|
+
assertShallow,
|
|
9
|
+
equals,
|
|
10
|
+
failWith,
|
|
11
|
+
is,
|
|
12
|
+
isShallow,
|
|
13
|
+
issuesFor,
|
|
14
|
+
random,
|
|
15
|
+
validate,
|
|
16
|
+
validateShallow,
|
|
17
|
+
} from '@zmdb/validator';
|
|
18
|
+
export { type TypeIR, type ValidateResult, type ValidationIssue } from '@zmdb/validator';
|
|
19
|
+
|
|
20
|
+
export { coerce, discriminated, evalRule, refine, transform, union, validateObject } from '@zmdb/validator/advanced';
|
|
21
|
+
export {
|
|
22
|
+
type Brand,
|
|
23
|
+
type DiscriminatedRule,
|
|
24
|
+
type ObjectMode,
|
|
25
|
+
type RefinePredicate,
|
|
26
|
+
type RefineRule,
|
|
27
|
+
type TransformFn,
|
|
28
|
+
type TransformRule,
|
|
29
|
+
type UnionRule,
|
|
30
|
+
} from '@zmdb/validator/advanced';
|
|
31
|
+
|
|
32
|
+
export { assertStringify, decode, parse, stringify } from '@zmdb/validator/serialization';
|
|
33
|
+
export { type ParseResult } from '@zmdb/validator/serialization';
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
MAX_REGEX_CACHE_SIZE,
|
|
37
|
+
ValidationError,
|
|
38
|
+
getCachedRegExp,
|
|
39
|
+
getEnumSet,
|
|
40
|
+
getRegExp,
|
|
41
|
+
tags,
|
|
42
|
+
validatePatternComplexity,
|
|
43
|
+
} from '@zmdb/validator';
|
|
44
|
+
export { type Rule } from '@zmdb/validator';
|
package/src/web-app.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// zmdb/web/contract/compiler — curated build-time re-export.
|
|
2
|
+
export { compileHttpContracts, generateHttpClient, HTTP_CLIENT_GENERATOR_VERSION } from '@zmdb/web/contract/compiler';
|
|
3
|
+
export type {
|
|
4
|
+
CompileHttpContractsOptions,
|
|
5
|
+
GeneratedHttpClientModule,
|
|
6
|
+
HttpContractSource,
|
|
7
|
+
} from '@zmdb/web/contract/compiler';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// zmdb/web/contract — curated runtime re-export of @zmdb/web/contract.
|
|
2
|
+
export { defineHttpContract, httpOperation } from '@zmdb/web/contract';
|
|
3
|
+
export type {
|
|
4
|
+
AuthorizationCodeFlow,
|
|
5
|
+
ClientCredentialsFlow,
|
|
6
|
+
CompiledHttpContract,
|
|
7
|
+
CompiledHttpOperation,
|
|
8
|
+
HttpBodyDeclaration,
|
|
9
|
+
HttpBodyIR,
|
|
10
|
+
HttpBodyKind,
|
|
11
|
+
HttpContractDeclaration,
|
|
12
|
+
HttpContractIR,
|
|
13
|
+
HttpController,
|
|
14
|
+
HttpMethod,
|
|
15
|
+
HttpOperationDeclaration,
|
|
16
|
+
HttpOperationIR,
|
|
17
|
+
HttpOperationTypes,
|
|
18
|
+
HttpParameterDeclaration,
|
|
19
|
+
HttpParameterIR,
|
|
20
|
+
HttpRequestBodyDeclaration,
|
|
21
|
+
HttpRequestBodyIR,
|
|
22
|
+
HttpResponseDeclaration,
|
|
23
|
+
HttpResponseHeaderDeclaration,
|
|
24
|
+
HttpResponseHeaderIR,
|
|
25
|
+
HttpResponseIR,
|
|
26
|
+
HttpTypeIR,
|
|
27
|
+
HttpVersionDeclaration,
|
|
28
|
+
HttpVersionIR,
|
|
29
|
+
ImplicitFlow,
|
|
30
|
+
JsonValue,
|
|
31
|
+
OAuthFlow,
|
|
32
|
+
OAuthFlows,
|
|
33
|
+
PasswordFlow,
|
|
34
|
+
SecurityRequirement,
|
|
35
|
+
SecurityScheme,
|
|
36
|
+
} from '@zmdb/web/contract';
|
package/src/web-csrf.ts
ADDED
package/src/web-data.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// zmdb/web/devtools — curated HTTP graph-inspection facade.
|
|
2
|
+
export { dependentsOf, describeGraph, renderDot, renderTree } from '@zmdb/web/devtools';
|
|
3
|
+
export type {
|
|
4
|
+
ClassNode,
|
|
5
|
+
Finding,
|
|
6
|
+
FindingKind,
|
|
7
|
+
GraphDescription,
|
|
8
|
+
GraphFilter,
|
|
9
|
+
ModuleNode,
|
|
10
|
+
ProviderNode,
|
|
11
|
+
RouteNode,
|
|
12
|
+
} from '@zmdb/web/devtools';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// zmdb/web/gateways — curated WebSocket and SSE declaration facade.
|
|
2
|
+
export { Gateway, Subscribe, createGatewayDispatcher, getSubscriptions, sseStream } from '@zmdb/web/gateways';
|
|
3
|
+
export type { GatewayDispatcher, MessageCtx, SseFrame, Subscription } from '@zmdb/web/gateways';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// zmdb/web/middleware — curated HTTP middleware-chain facade.
|
|
2
|
+
export { ChainError, runChain } from '@zmdb/web/middleware';
|
|
3
|
+
export type {
|
|
4
|
+
AnyCtx,
|
|
5
|
+
Chain,
|
|
6
|
+
ChainHandler,
|
|
7
|
+
ExceptionFilter,
|
|
8
|
+
Guard,
|
|
9
|
+
Interceptor,
|
|
10
|
+
Pipe,
|
|
11
|
+
SecurityAwareGuard,
|
|
12
|
+
} from '@zmdb/web/middleware';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// zmdb/web/openapi — curated OpenAPI projection facade.
|
|
2
|
+
export { serveOpenApi, toOpenApi } from '@zmdb/web/openapi';
|
|
3
|
+
export type {
|
|
4
|
+
AuthorizationCodeFlow,
|
|
5
|
+
ClientCredentialsFlow,
|
|
6
|
+
ImplicitFlow,
|
|
7
|
+
JsonSchema,
|
|
8
|
+
OAuthFlow,
|
|
9
|
+
OAuthFlows,
|
|
10
|
+
OpenApiDocument,
|
|
11
|
+
OpenApiRenderOptions,
|
|
12
|
+
PasswordFlow,
|
|
13
|
+
SecurityRequirement,
|
|
14
|
+
SecurityScheme,
|
|
15
|
+
} from '@zmdb/web/openapi';
|