@astram/core 1.5.0 → 1.7.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/dist/audit/index.d.ts +1 -1
- package/dist/audit/index.d.ts.map +1 -1
- package/dist/audit/index.js.map +1 -1
- package/dist/database/framework-schemas.d.ts +149 -0
- package/dist/database/framework-schemas.d.ts.map +1 -0
- package/dist/database/framework-schemas.js +222 -0
- package/dist/database/framework-schemas.js.map +1 -0
- package/dist/database/index.d.ts +9 -0
- package/dist/database/index.d.ts.map +1 -0
- package/dist/database/index.js +14 -0
- package/dist/database/index.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/storage/file-ingest.d.ts +90 -0
- package/dist/storage/file-ingest.d.ts.map +1 -0
- package/dist/storage/file-ingest.js +508 -0
- package/dist/storage/file-ingest.js.map +1 -0
- package/dist/storage/index.d.ts +13 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +11 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/ports.d.ts +66 -0
- package/dist/storage/ports.d.ts.map +1 -0
- package/dist/storage/ports.js +30 -0
- package/dist/storage/ports.js.map +1 -0
- package/dist-cjs/database/framework-schemas.js +233 -0
- package/dist-cjs/database/index.js +30 -0
- package/dist-cjs/index.js +3 -0
- package/dist-cjs/storage/file-ingest.js +512 -0
- package/dist-cjs/storage/index.js +19 -0
- package/dist-cjs/storage/ports.js +34 -0
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Object storage PORTS (SPEC docs/features/file-storage/SPEC.md §5 A-C) — the framework-agnostic
|
|
3
|
+
* contract for keeping file bytes OUTSIDE the database (a private, server-side-encrypted bucket),
|
|
4
|
+
* plus the byte-digest capability the pure ingest check needs.
|
|
5
|
+
*
|
|
6
|
+
* ADR-0003 (zero-dep core): the backends are real dependencies (an S3 SDK, `node:crypto`), so
|
|
7
|
+
* core defines only these interfaces; `@astram/guard` ships the concrete adapters
|
|
8
|
+
* (`S3ObjectStore`, `NodeSha256Digest`) and INJECTS them.
|
|
9
|
+
*
|
|
10
|
+
* SECURITY: keys are server-built (`t/<tenantId>/<id>`), never client input. Errors carry FIXED
|
|
11
|
+
* messages: no key, credential, endpoint userinfo, file name or bytes ever reaches a message.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* The object store cannot be reached or refused the operation. Fixed message, and deliberately no
|
|
15
|
+
* `cause`: backend (SDK) errors can carry the endpoint, request ids or userinfo, so adapters drop them.
|
|
16
|
+
*/
|
|
17
|
+
export class ObjectStoreUnavailableError extends Error {
|
|
18
|
+
constructor() {
|
|
19
|
+
super('object store unavailable');
|
|
20
|
+
this.name = 'ObjectStoreUnavailableError';
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/** The requested object does not exist. Fixed message (the key is never echoed). */
|
|
24
|
+
export class ObjectNotFoundError extends Error {
|
|
25
|
+
constructor() {
|
|
26
|
+
super('object not found');
|
|
27
|
+
this.name = 'ObjectNotFoundError';
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=ports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ports.js","sourceRoot":"","sources":["../../src/storage/ports.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAiDH;;;GAGG;AACH,MAAM,OAAO,2BAA4B,SAAQ,KAAK;IACpD;QACE,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAClC,IAAI,CAAC,IAAI,GAAG,6BAA6B,CAAC;IAC5C,CAAC;CACF;AAED,oFAAoF;AACpF,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAC5C;QACE,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF"}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Framework database names (configurable-framework-db, spec §5.A, §10, §13; ADR-0037).
|
|
4
|
+
*
|
|
5
|
+
* The single source of the four framework database names. `SHIELD_DB_NAMESPACE` renames all
|
|
6
|
+
* four together (`beta` ⇒ `beta_app`, `beta_identity`, `beta_authz`, `beta_audit`); unset keeps
|
|
7
|
+
* today's `shield_*` names. Pure and zero-dep (ADR-0003): the caller passes an env-like record,
|
|
8
|
+
* nothing here reads `process.env`.
|
|
9
|
+
*
|
|
10
|
+
* SECURITY: fail closed (Shield #1) — a set-but-empty or non-matching namespace throws; a
|
|
11
|
+
* failure never returns a partial set. Names reach SQL only after this validation, and the
|
|
12
|
+
* pattern admits no quote, backtick, dot or whitespace.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.LEDGER_DATABASE_NAME_PATTERN = exports.MIGRATION_LEDGER_TABLE_PATTERN = exports.DEFAULT_MIGRATION_LEDGER_TABLE = exports.SCHEMA_NAME_PATTERN = exports.FrameworkSchemaConfigError = exports.FRAMEWORK_SCHEMA_SUFFIXES = exports.FRAMEWORK_DB_NAMESPACE_PATTERN = exports.DEFAULT_FRAMEWORK_DB_NAMESPACE = exports.FRAMEWORK_DB_NAMESPACE_ENV = void 0;
|
|
16
|
+
exports.resolveFrameworkSchemas = resolveFrameworkSchemas;
|
|
17
|
+
exports.frameworkAccountName = frameworkAccountName;
|
|
18
|
+
exports.assertSchemaName = assertSchemaName;
|
|
19
|
+
exports.assertFrameworkSchemaNames = assertFrameworkSchemaNames;
|
|
20
|
+
exports.frameworkSchemasForMigration = frameworkSchemasForMigration;
|
|
21
|
+
exports.assertLedgerDatabaseName = assertLedgerDatabaseName;
|
|
22
|
+
exports.resolveMigrationLedgerLocation = resolveMigrationLedgerLocation;
|
|
23
|
+
exports.migrationLedgerCandidates = migrationLedgerCandidates;
|
|
24
|
+
/** The env variable that selects the namespace. */
|
|
25
|
+
exports.FRAMEWORK_DB_NAMESPACE_ENV = 'SHIELD_DB_NAMESPACE';
|
|
26
|
+
/** The namespace used when `SHIELD_DB_NAMESPACE` is unset (today's names). */
|
|
27
|
+
exports.DEFAULT_FRAMEWORK_DB_NAMESPACE = 'shield';
|
|
28
|
+
/**
|
|
29
|
+
* Allowed namespace. `<ns>_identity`, the longest name, stays within MariaDB's 64-character
|
|
30
|
+
* identifier limit (55 + 9).
|
|
31
|
+
*/
|
|
32
|
+
// Letters and digits only (spec v3): `_` is a one-character wildcard in MariaDB database-level
|
|
33
|
+
// grants, so a namespace containing `_` could make one environment's grants match another's
|
|
34
|
+
// databases (`team_a_app` also matches `team1a_app`).
|
|
35
|
+
exports.FRAMEWORK_DB_NAMESPACE_PATTERN = /^[a-z][a-z0-9]{0,54}$/;
|
|
36
|
+
/** The fixed database suffixes, one per framework module. */
|
|
37
|
+
exports.FRAMEWORK_SCHEMA_SUFFIXES = Object.freeze({
|
|
38
|
+
app: '_app',
|
|
39
|
+
identity: '_identity',
|
|
40
|
+
authz: '_authz',
|
|
41
|
+
audit: '_audit',
|
|
42
|
+
});
|
|
43
|
+
/** Thrown for an invalid framework database configuration. Never carries a secret. */
|
|
44
|
+
class FrameworkSchemaConfigError extends Error {
|
|
45
|
+
constructor(message) {
|
|
46
|
+
super(message);
|
|
47
|
+
this.name = 'FrameworkSchemaConfigError';
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.FrameworkSchemaConfigError = FrameworkSchemaConfigError;
|
|
51
|
+
function namesFor(namespace, isDefault) {
|
|
52
|
+
return Object.freeze({
|
|
53
|
+
namespace,
|
|
54
|
+
app: `${namespace}${exports.FRAMEWORK_SCHEMA_SUFFIXES.app}`,
|
|
55
|
+
identity: `${namespace}${exports.FRAMEWORK_SCHEMA_SUFFIXES.identity}`,
|
|
56
|
+
authz: `${namespace}${exports.FRAMEWORK_SCHEMA_SUFFIXES.authz}`,
|
|
57
|
+
audit: `${namespace}${exports.FRAMEWORK_SCHEMA_SUFFIXES.audit}`,
|
|
58
|
+
isDefault,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Resolve the four framework database names from an env-like record.
|
|
63
|
+
* @throws FrameworkSchemaConfigError when `SHIELD_DB_NAMESPACE` is set but empty or invalid.
|
|
64
|
+
*/
|
|
65
|
+
function resolveFrameworkSchemas(env) {
|
|
66
|
+
const raw = env[exports.FRAMEWORK_DB_NAMESPACE_ENV];
|
|
67
|
+
if (raw === undefined)
|
|
68
|
+
return namesFor(exports.DEFAULT_FRAMEWORK_DB_NAMESPACE, true);
|
|
69
|
+
if (!exports.FRAMEWORK_DB_NAMESPACE_PATTERN.test(raw)) {
|
|
70
|
+
// The value is not echoed: it is config, not a secret, but the message stays a fixed shape.
|
|
71
|
+
throw new FrameworkSchemaConfigError(`${exports.FRAMEWORK_DB_NAMESPACE_ENV} is set but ${raw === '' ? 'empty' : 'invalid'}; ` +
|
|
72
|
+
`expected ${exports.FRAMEWORK_DB_NAMESPACE_PATTERN.source} (unset it for the default "${exports.DEFAULT_FRAMEWORK_DB_NAMESPACE}")`);
|
|
73
|
+
}
|
|
74
|
+
// An explicit default namespace is the default: same names AND the same rules (ledger, old
|
|
75
|
+
// migrate fallback), so `SHIELD_DB_NAMESPACE=shield` never behaves differently from unset.
|
|
76
|
+
return namesFor(raw, raw === exports.DEFAULT_FRAMEWORK_DB_NAMESPACE);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The DB account name for a matrix account role under a namespace: `<ns>_<role>`
|
|
80
|
+
* (`frameworkAccountName('beta', 'core')` ⇒ `beta_core`). Roles are the matrix account names
|
|
81
|
+
* without the `shield_` prefix (`core`, `migrate`, `audit_ops`, ...).
|
|
82
|
+
*/
|
|
83
|
+
function frameworkAccountName(namespace, role) {
|
|
84
|
+
return `${namespace}_${role}`;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* A database name a caller may hand to framework SQL (`opts.schema`, `forRoot({ schemas })`):
|
|
88
|
+
* lower-case letters, digits and `_`, 1..64 characters (MariaDB's identifier limit). Names come
|
|
89
|
+
* from the resolver or from operator config, both lower-case (MariaDB database names are
|
|
90
|
+
* case-sensitive on Linux, so a mixed-case name is refused rather than guessed). It admits no
|
|
91
|
+
* backtick, quote, dot, whitespace or `;`, so a name that passes can be backtick-quoted safely.
|
|
92
|
+
*/
|
|
93
|
+
exports.SCHEMA_NAME_PATTERN = /^[a-z0-9_]{1,64}$/;
|
|
94
|
+
/**
|
|
95
|
+
* Check a caller-supplied database name before it reaches SQL (configurable-framework-db,
|
|
96
|
+
* spec §11). Returns the name unchanged.
|
|
97
|
+
* @param label names the setting in the error (e.g. `opts.schema`); the value is never echoed.
|
|
98
|
+
* @throws FrameworkSchemaConfigError when the name is not a string matching
|
|
99
|
+
* {@link SCHEMA_NAME_PATTERN}.
|
|
100
|
+
*/
|
|
101
|
+
function assertSchemaName(name, label) {
|
|
102
|
+
if (typeof name !== 'string' || !exports.SCHEMA_NAME_PATTERN.test(name)) {
|
|
103
|
+
throw new FrameworkSchemaConfigError(`${label} is not a valid database name; expected ${exports.SCHEMA_NAME_PATTERN.source}`);
|
|
104
|
+
}
|
|
105
|
+
return name;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Check all four names of a caller-supplied set (`forRoot({ schemas })`, a store's `schemas`
|
|
109
|
+
* argument, `ctx.schemas`) with {@link assertSchemaName}. Returns the same object.
|
|
110
|
+
* @throws FrameworkSchemaConfigError naming `<label>.<field>` for the first bad name.
|
|
111
|
+
*/
|
|
112
|
+
function assertFrameworkSchemaNames(schemas, label) {
|
|
113
|
+
if (typeof schemas !== 'object' || schemas === null) {
|
|
114
|
+
throw new FrameworkSchemaConfigError(`${label} must be an object with app, identity, authz and audit database names`);
|
|
115
|
+
}
|
|
116
|
+
for (const key of ['app', 'identity', 'authz', 'audit']) {
|
|
117
|
+
assertSchemaName(schemas[key], `${label}.${key}`);
|
|
118
|
+
}
|
|
119
|
+
return schemas;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* The framework database names for a framework migration's `up`/`down` (spec v2 §5.H, decided
|
|
123
|
+
* Q2). `@astram/guard` and `@astram/identity` do not depend on `@astram/migrate`, so their
|
|
124
|
+
* migrations may run under an older CLI that passes no `ctx.schemas`:
|
|
125
|
+
* - `ctx.schemas` present (current `@astram/migrate`) ⇒ those names, validated;
|
|
126
|
+
* - absent and `SHIELD_DB_NAMESPACE` unset (or `shield`) ⇒ the default `shield_*` names (today's
|
|
127
|
+
* behaviour);
|
|
128
|
+
* - absent and `SHIELD_DB_NAMESPACE` set to any other value ⇒ throws before any DDL, telling the
|
|
129
|
+
* operator to upgrade `@astram/migrate`.
|
|
130
|
+
*
|
|
131
|
+
* Usage in a migration file: `const s = frameworkSchemasForMigration(ctx, process.env);`.
|
|
132
|
+
* Pure: the caller passes the env.
|
|
133
|
+
* @throws FrameworkSchemaConfigError as above, or for an invalid name in `ctx.schemas`.
|
|
134
|
+
*/
|
|
135
|
+
function frameworkSchemasForMigration(ctx, env) {
|
|
136
|
+
const given = ctx?.schemas;
|
|
137
|
+
if (given !== undefined)
|
|
138
|
+
return assertFrameworkSchemaNames(given, 'ctx.schemas');
|
|
139
|
+
const ns = env[exports.FRAMEWORK_DB_NAMESPACE_ENV];
|
|
140
|
+
if (ns !== undefined && ns !== exports.DEFAULT_FRAMEWORK_DB_NAMESPACE) {
|
|
141
|
+
throw new FrameworkSchemaConfigError(`${exports.FRAMEWORK_DB_NAMESPACE_ENV} is set but this @astram/migrate does not pass ctx.schemas; ` +
|
|
142
|
+
'upgrade @astram/migrate');
|
|
143
|
+
}
|
|
144
|
+
return namesFor(exports.DEFAULT_FRAMEWORK_DB_NAMESPACE, true);
|
|
145
|
+
}
|
|
146
|
+
/** The `@astram/migrate` ledger table when `APP_MIGRATION_TABLE` is unset. */
|
|
147
|
+
exports.DEFAULT_MIGRATION_LEDGER_TABLE = 'schema_migrations';
|
|
148
|
+
/** A ledger table name: a plain identifier, safe to backtick-quote. */
|
|
149
|
+
exports.MIGRATION_LEDGER_TABLE_PATTERN = /^[A-Za-z0-9_$]{1,64}$/;
|
|
150
|
+
/**
|
|
151
|
+
* An operator-supplied ledger database name (`DDL_DB_NAME`, or a migrate job's `APP_DB_NAME` in
|
|
152
|
+
* default mode): any plain MariaDB identifier, mixed case included, so a name that worked with
|
|
153
|
+
* earlier `@astram/migrate` releases keeps working. Letters, digits and `_` only, 1..64: no
|
|
154
|
+
* backtick, quote, dot, whitespace or `;`, so it is safe to backtick-quote or single-quote.
|
|
155
|
+
* Resolver-produced names stay on the stricter {@link SCHEMA_NAME_PATTERN}.
|
|
156
|
+
*/
|
|
157
|
+
exports.LEDGER_DATABASE_NAME_PATTERN = /^[A-Za-z0-9_]{1,64}$/;
|
|
158
|
+
/**
|
|
159
|
+
* Check an operator-supplied ledger database name before it reaches SQL. Returns it unchanged.
|
|
160
|
+
* @param label names the setting in the error (e.g. `DDL_DB_NAME`); the value is never echoed.
|
|
161
|
+
* @throws FrameworkSchemaConfigError when the name does not match
|
|
162
|
+
* {@link LEDGER_DATABASE_NAME_PATTERN}.
|
|
163
|
+
*/
|
|
164
|
+
function assertLedgerDatabaseName(name, label) {
|
|
165
|
+
if (typeof name !== 'string' || !exports.LEDGER_DATABASE_NAME_PATTERN.test(name)) {
|
|
166
|
+
throw new FrameworkSchemaConfigError(`${label} is not a valid database name; expected ${exports.LEDGER_DATABASE_NAME_PATTERN.source}`);
|
|
167
|
+
}
|
|
168
|
+
return name;
|
|
169
|
+
}
|
|
170
|
+
function ledgerTable(env) {
|
|
171
|
+
const table = env.APP_MIGRATION_TABLE ?? exports.DEFAULT_MIGRATION_LEDGER_TABLE;
|
|
172
|
+
if (!exports.MIGRATION_LEDGER_TABLE_PATTERN.test(table)) {
|
|
173
|
+
throw new FrameworkSchemaConfigError(`APP_MIGRATION_TABLE is not a valid table name; expected ${exports.MIGRATION_LEDGER_TABLE_PATTERN.source}`);
|
|
174
|
+
}
|
|
175
|
+
return table;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* The ledger-location rule of the migrate CLI (configurable-framework-db spec 5.G):
|
|
179
|
+
* - namespace set ⇒ always `<ns>_app`; a `DDL_DB_NAME` other than `<ns>_app` throws;
|
|
180
|
+
* - namespace unset (or `shield`) ⇒ `DDL_DB_NAME`, else the default app database. (The CLI adds
|
|
181
|
+
* its released fallback to the job's `APP_DB_NAME` before `shield_app`.)
|
|
182
|
+
* Table: `APP_MIGRATION_TABLE`, else `schema_migrations`. The runtime boot check does not use this
|
|
183
|
+
* single location: it tries {@link migrationLedgerCandidates}. Pure: the caller passes the env.
|
|
184
|
+
* @throws FrameworkSchemaConfigError naming the variable on a conflicting or invalid name.
|
|
185
|
+
*/
|
|
186
|
+
function resolveMigrationLedgerLocation(schemas, env) {
|
|
187
|
+
const ddl = env.DDL_DB_NAME;
|
|
188
|
+
let database;
|
|
189
|
+
if (schemas.isDefault) {
|
|
190
|
+
database =
|
|
191
|
+
ddl === undefined
|
|
192
|
+
? assertSchemaName(schemas.app, 'ledger')
|
|
193
|
+
: assertLedgerDatabaseName(ddl, 'DDL_DB_NAME');
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
if (ddl !== undefined && ddl !== schemas.app) {
|
|
197
|
+
throw new FrameworkSchemaConfigError(`DDL_DB_NAME must be ${schemas.app} or unset when ` +
|
|
198
|
+
`${exports.FRAMEWORK_DB_NAMESPACE_ENV}=${schemas.namespace}: the migration ledger lives in ` +
|
|
199
|
+
`${schemas.app} (spec 5.G).`);
|
|
200
|
+
}
|
|
201
|
+
database = schemas.app;
|
|
202
|
+
}
|
|
203
|
+
return { database, table: ledgerTable(env) };
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Where the runtime boot check looks for the ledger, in order (G-007 QA P1). A standard scaffold
|
|
207
|
+
* runs `astram-migrate` with the server's env, so in default mode migrate writes the ledger to
|
|
208
|
+
* `DDL_DB_NAME`, else the job's `APP_DB_NAME`, else `shield_app`; the boot check cannot know
|
|
209
|
+
* which env the migrate job had, so it tries each:
|
|
210
|
+
* - namespace set ⇒ only `<ns>_app` (as {@link resolveMigrationLedgerLocation}; `APP_DB_NAME`
|
|
211
|
+
* is ignored, a conflicting `DDL_DB_NAME` throws);
|
|
212
|
+
* - namespace unset (or `shield`) ⇒ `DDL_DB_NAME`, the runtime `APP_DB_NAME`, then the default
|
|
213
|
+
* app database; unset or blank values skipped, duplicates dropped.
|
|
214
|
+
* The caller uses the first location whose ledger table exists and must still find every shipped
|
|
215
|
+
* id there; when none exists it fails closed naming every location. Pure: the caller passes the
|
|
216
|
+
* env. Returns a frozen, non-empty list.
|
|
217
|
+
* @throws FrameworkSchemaConfigError naming the variable on a conflicting or invalid name.
|
|
218
|
+
*/
|
|
219
|
+
function migrationLedgerCandidates(schemas, env) {
|
|
220
|
+
if (!schemas.isDefault) {
|
|
221
|
+
return Object.freeze([Object.freeze(resolveMigrationLedgerLocation(schemas, env))]);
|
|
222
|
+
}
|
|
223
|
+
const table = ledgerTable(env);
|
|
224
|
+
const databases = [];
|
|
225
|
+
for (const key of ['DDL_DB_NAME', 'APP_DB_NAME']) {
|
|
226
|
+
const raw = env[key];
|
|
227
|
+
if (raw === undefined || raw.trim() === '')
|
|
228
|
+
continue;
|
|
229
|
+
databases.push(assertLedgerDatabaseName(raw.trim(), key));
|
|
230
|
+
}
|
|
231
|
+
databases.push(assertSchemaName(schemas.app, 'ledger'));
|
|
232
|
+
return Object.freeze([...new Set(databases)].map((database) => Object.freeze({ database, table })));
|
|
233
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Framework database names (configurable-framework-db, ADR-0037): the single source of the
|
|
4
|
+
* four `<namespace>_{app,identity,authz,audit}` names and the namespaced account defaults.
|
|
5
|
+
* Pure + zero-dep (ADR-0003).
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.migrationLedgerCandidates = exports.assertLedgerDatabaseName = exports.LEDGER_DATABASE_NAME_PATTERN = exports.resolveMigrationLedgerLocation = exports.MIGRATION_LEDGER_TABLE_PATTERN = exports.DEFAULT_MIGRATION_LEDGER_TABLE = exports.frameworkSchemasForMigration = exports.assertFrameworkSchemaNames = exports.assertSchemaName = exports.SCHEMA_NAME_PATTERN = exports.resolveFrameworkSchemas = exports.frameworkAccountName = exports.FrameworkSchemaConfigError = exports.FRAMEWORK_SCHEMA_SUFFIXES = exports.FRAMEWORK_DB_NAMESPACE_PATTERN = exports.FRAMEWORK_DB_NAMESPACE_ENV = exports.DEFAULT_FRAMEWORK_DB_NAMESPACE = void 0;
|
|
9
|
+
var framework_schemas_js_1 = require("./framework-schemas.js");
|
|
10
|
+
Object.defineProperty(exports, "DEFAULT_FRAMEWORK_DB_NAMESPACE", { enumerable: true, get: function () { return framework_schemas_js_1.DEFAULT_FRAMEWORK_DB_NAMESPACE; } });
|
|
11
|
+
Object.defineProperty(exports, "FRAMEWORK_DB_NAMESPACE_ENV", { enumerable: true, get: function () { return framework_schemas_js_1.FRAMEWORK_DB_NAMESPACE_ENV; } });
|
|
12
|
+
Object.defineProperty(exports, "FRAMEWORK_DB_NAMESPACE_PATTERN", { enumerable: true, get: function () { return framework_schemas_js_1.FRAMEWORK_DB_NAMESPACE_PATTERN; } });
|
|
13
|
+
Object.defineProperty(exports, "FRAMEWORK_SCHEMA_SUFFIXES", { enumerable: true, get: function () { return framework_schemas_js_1.FRAMEWORK_SCHEMA_SUFFIXES; } });
|
|
14
|
+
Object.defineProperty(exports, "FrameworkSchemaConfigError", { enumerable: true, get: function () { return framework_schemas_js_1.FrameworkSchemaConfigError; } });
|
|
15
|
+
Object.defineProperty(exports, "frameworkAccountName", { enumerable: true, get: function () { return framework_schemas_js_1.frameworkAccountName; } });
|
|
16
|
+
Object.defineProperty(exports, "resolveFrameworkSchemas", { enumerable: true, get: function () { return framework_schemas_js_1.resolveFrameworkSchemas; } });
|
|
17
|
+
// Phase 4: caller-supplied name checks + the migration fallback helper (append-only).
|
|
18
|
+
Object.defineProperty(exports, "SCHEMA_NAME_PATTERN", { enumerable: true, get: function () { return framework_schemas_js_1.SCHEMA_NAME_PATTERN; } });
|
|
19
|
+
Object.defineProperty(exports, "assertSchemaName", { enumerable: true, get: function () { return framework_schemas_js_1.assertSchemaName; } });
|
|
20
|
+
Object.defineProperty(exports, "assertFrameworkSchemaNames", { enumerable: true, get: function () { return framework_schemas_js_1.assertFrameworkSchemaNames; } });
|
|
21
|
+
Object.defineProperty(exports, "frameworkSchemasForMigration", { enumerable: true, get: function () { return framework_schemas_js_1.frameworkSchemasForMigration; } });
|
|
22
|
+
// Phase 6: the one migration-ledger location rule (migrate CLI + runtime boot check).
|
|
23
|
+
Object.defineProperty(exports, "DEFAULT_MIGRATION_LEDGER_TABLE", { enumerable: true, get: function () { return framework_schemas_js_1.DEFAULT_MIGRATION_LEDGER_TABLE; } });
|
|
24
|
+
Object.defineProperty(exports, "MIGRATION_LEDGER_TABLE_PATTERN", { enumerable: true, get: function () { return framework_schemas_js_1.MIGRATION_LEDGER_TABLE_PATTERN; } });
|
|
25
|
+
Object.defineProperty(exports, "resolveMigrationLedgerLocation", { enumerable: true, get: function () { return framework_schemas_js_1.resolveMigrationLedgerLocation; } });
|
|
26
|
+
// G-007 QA P1/P2-3: the boot check's candidate ledger locations and the operator ledger-name
|
|
27
|
+
// check (append-only).
|
|
28
|
+
Object.defineProperty(exports, "LEDGER_DATABASE_NAME_PATTERN", { enumerable: true, get: function () { return framework_schemas_js_1.LEDGER_DATABASE_NAME_PATTERN; } });
|
|
29
|
+
Object.defineProperty(exports, "assertLedgerDatabaseName", { enumerable: true, get: function () { return framework_schemas_js_1.assertLedgerDatabaseName; } });
|
|
30
|
+
Object.defineProperty(exports, "migrationLedgerCandidates", { enumerable: true, get: function () { return framework_schemas_js_1.migrationLedgerCandidates; } });
|
package/dist-cjs/index.js
CHANGED
|
@@ -63,3 +63,6 @@ __exportStar(require("./metadata/index.js"), exports);
|
|
|
63
63
|
// prior-layer seam changed): admin ports + query/command types + §11.3 safeguard
|
|
64
64
|
// signatures + the query/command service factories + command-pipeline order.
|
|
65
65
|
__exportStar(require("./admin/index.js"), exports);
|
|
66
|
+
__exportStar(require("./storage/index.js"), exports);
|
|
67
|
+
// Framework database names (configurable-framework-db, ADR-0037) — append-only.
|
|
68
|
+
__exportStar(require("./database/index.js"), exports);
|