@objectstack/core 17.0.0-rc.6 → 17.0.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/CHANGELOG.md +2823 -0
- package/dist/index.cjs +153 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +184 -4
- package/dist/index.d.ts +184 -4
- package/dist/index.js +135 -11
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -35,6 +35,8 @@ __export(index_exports, {
|
|
|
35
35
|
ANONYMOUS_DENY_MESSAGE: () => ANONYMOUS_DENY_MESSAGE,
|
|
36
36
|
ANONYMOUS_DENY_STATUS: () => ANONYMOUS_DENY_STATUS,
|
|
37
37
|
API_KEY_PREFIX: () => API_KEY_PREFIX,
|
|
38
|
+
AUDIENCE_BINDING_SUGGESTION_STATUSES: () => AUDIENCE_BINDING_SUGGESTION_STATUSES,
|
|
39
|
+
AUDIENCE_BINDING_SUGGESTION_STATUS_VALUES: () => AUDIENCE_BINDING_SUGGESTION_STATUS_VALUES,
|
|
38
40
|
CORE_FALLBACK_FACTORIES: () => CORE_FALLBACK_FACTORIES,
|
|
39
41
|
DependencyResolver: () => DependencyResolver,
|
|
40
42
|
ENTRY_EXECUTION_CONTEXT_FIELDS: () => ENTRY_EXECUTION_CONTEXT_FIELDS,
|
|
@@ -68,11 +70,14 @@ __export(index_exports, {
|
|
|
68
70
|
assembleExecutionContext: () => assembleExecutionContext,
|
|
69
71
|
assembleExecutionContextOrGuest: () => assembleExecutionContextOrGuest,
|
|
70
72
|
assertInitServiceRequirements: () => assertInitServiceRequirements,
|
|
73
|
+
assertMetadataRegisterContract: () => assertMetadataRegisterContract,
|
|
71
74
|
bucketKeyToCalendarRange: () => bucketKeyToCalendarRange,
|
|
72
75
|
buildPermissionsFromGrants: () => buildPermissionsFromGrants,
|
|
73
76
|
bulkWrite: () => bulkWrite,
|
|
74
77
|
calendarPartsInTz: () => calendarPartsInTz,
|
|
75
78
|
calendarPartsInTzOrUtc: () => calendarPartsInTzOrUtc,
|
|
79
|
+
canonicalMetadataServiceType: () => canonicalMetadataServiceType,
|
|
80
|
+
collectInternalWriteResponseFields: () => collectInternalWriteResponseFields,
|
|
76
81
|
counterSignPayload: () => counterSignPayload,
|
|
77
82
|
createLogger: () => createLogger,
|
|
78
83
|
createMemoryCache: () => createMemoryCache,
|
|
@@ -97,6 +102,7 @@ __export(index_exports, {
|
|
|
97
102
|
getMemoryUsage: () => getMemoryUsage,
|
|
98
103
|
hashApiKey: () => hashApiKey,
|
|
99
104
|
hashMigrationPlan: () => hashMigrationPlan,
|
|
105
|
+
isAudienceBindingSuggestionStatus: () => isAudienceBindingSuggestionStatus,
|
|
100
106
|
isAuthGateAllowlisted: () => isAuthGateAllowlisted,
|
|
101
107
|
isExpired: () => isExpired,
|
|
102
108
|
isGrantActive: () => isGrantActive,
|
|
@@ -104,12 +110,14 @@ __export(index_exports, {
|
|
|
104
110
|
isNode: () => isNode,
|
|
105
111
|
nextUtcCalendarDay: () => import_data.nextUtcCalendarDay,
|
|
106
112
|
normalizeAuthGate: () => normalizeAuthGate,
|
|
113
|
+
omitInternalFieldsFromWriteResponse: () => omitInternalFieldsFromWriteResponse,
|
|
107
114
|
parseScopes: () => parseScopes,
|
|
108
115
|
parseSignature: () => parseSignature,
|
|
109
116
|
planChunks: () => planChunks,
|
|
110
117
|
postureVisibleRows: () => postureVisibleRows,
|
|
111
118
|
readAuthoredTranslationLayer: () => readAuthoredTranslationLayer,
|
|
112
119
|
readRunJournal: () => readRunJournal,
|
|
120
|
+
recordNotFoundError: () => recordNotFoundError,
|
|
113
121
|
resolveApiKeyPrincipal: () => resolveApiKeyPrincipal,
|
|
114
122
|
resolveAuthzContext: () => resolveAuthzContext,
|
|
115
123
|
resolveFilterToken: () => resolveFilterToken,
|
|
@@ -123,6 +131,7 @@ __export(index_exports, {
|
|
|
123
131
|
safeExit: () => safeExit,
|
|
124
132
|
shouldDenyAnonymous: () => shouldDenyAnonymous,
|
|
125
133
|
signPayload: () => signPayload,
|
|
134
|
+
unknownAudienceBindingSuggestionStatusMessage: () => unknownAudienceBindingSuggestionStatusMessage,
|
|
126
135
|
utcInstantMs: () => import_data.utcInstantMs,
|
|
127
136
|
validateInitServiceContract: () => validateInitServiceContract,
|
|
128
137
|
verifyPayload: () => verifyPayload,
|
|
@@ -837,7 +846,7 @@ function createLogger(config) {
|
|
|
837
846
|
}
|
|
838
847
|
|
|
839
848
|
// src/kernel.ts
|
|
840
|
-
var
|
|
849
|
+
var import_system3 = require("@objectstack/spec/system");
|
|
841
850
|
|
|
842
851
|
// src/security/plugin-config-validator.ts
|
|
843
852
|
var import_zod = require("zod");
|
|
@@ -1505,6 +1514,7 @@ function createMemoryJob() {
|
|
|
1505
1514
|
}
|
|
1506
1515
|
|
|
1507
1516
|
// src/fallbacks/memory-i18n.ts
|
|
1517
|
+
var import_system = require("@objectstack/spec/system");
|
|
1508
1518
|
function deepMerge(target, source) {
|
|
1509
1519
|
const result = { ...target };
|
|
1510
1520
|
for (const key of Object.keys(source)) {
|
|
@@ -1538,6 +1548,7 @@ function createMemoryI18n() {
|
|
|
1538
1548
|
const translations = /* @__PURE__ */ new Map();
|
|
1539
1549
|
const authored = /* @__PURE__ */ new Map();
|
|
1540
1550
|
let defaultLocale = "en";
|
|
1551
|
+
let supportedLocales;
|
|
1541
1552
|
function resolveKey(data, key) {
|
|
1542
1553
|
const parts = key.split(".");
|
|
1543
1554
|
let current = data;
|
|
@@ -1603,9 +1614,29 @@ function createMemoryI18n() {
|
|
|
1603
1614
|
authored.set(locale, { ...data });
|
|
1604
1615
|
}
|
|
1605
1616
|
},
|
|
1617
|
+
/**
|
|
1618
|
+
* Report the locales this stack offers.
|
|
1619
|
+
*
|
|
1620
|
+
* [#7679] When the app declared `i18n.supportedLocales`, that declaration
|
|
1621
|
+
* IS the answer — in declared order, and including a declared locale no
|
|
1622
|
+
* bundle was ever loaded for (declared-but-unserved). Reporting the
|
|
1623
|
+
* declaration rather than an intersection is what gives a client the
|
|
1624
|
+
* signal that the locale it is being offered has nothing behind it yet;
|
|
1625
|
+
* quietly dropping it would leave the gap invisible on both sides. It is
|
|
1626
|
+
* also the only answer that does not depend on how much had loaded by the
|
|
1627
|
+
* time this was called.
|
|
1628
|
+
*
|
|
1629
|
+
* With nothing declared, the loaded set — the behaviour every app that
|
|
1630
|
+
* never opted in already has.
|
|
1631
|
+
*/
|
|
1606
1632
|
getLocales() {
|
|
1633
|
+
if (supportedLocales) return [...supportedLocales];
|
|
1607
1634
|
return [.../* @__PURE__ */ new Set([...translations.keys(), ...authored.keys()])];
|
|
1608
1635
|
},
|
|
1636
|
+
/** @see II18nService.setSupportedLocales — [#7679] */
|
|
1637
|
+
setSupportedLocales(locales) {
|
|
1638
|
+
supportedLocales = (0, import_system.normalizeSupportedLocales)(locales);
|
|
1639
|
+
},
|
|
1609
1640
|
getDefaultLocale() {
|
|
1610
1641
|
return defaultLocale;
|
|
1611
1642
|
},
|
|
@@ -1615,14 +1646,42 @@ function createMemoryI18n() {
|
|
|
1615
1646
|
};
|
|
1616
1647
|
}
|
|
1617
1648
|
|
|
1649
|
+
// src/metadata-service-contract.ts
|
|
1650
|
+
var import_shared = require("@objectstack/spec/shared");
|
|
1651
|
+
var REGISTER_REFUSAL_CODE = "VALIDATION_ERROR";
|
|
1652
|
+
function canonicalMetadataServiceType(type) {
|
|
1653
|
+
return (0, import_shared.pluralToSingular)(type);
|
|
1654
|
+
}
|
|
1655
|
+
function registerRefusal(message) {
|
|
1656
|
+
const err = new Error(message);
|
|
1657
|
+
err.code = REGISTER_REFUSAL_CODE;
|
|
1658
|
+
err.status = 400;
|
|
1659
|
+
return err;
|
|
1660
|
+
}
|
|
1661
|
+
function assertMetadataRegisterContract(type, name, data) {
|
|
1662
|
+
if (typeof data !== "object" || data === null || Array.isArray(data)) {
|
|
1663
|
+
const shape = data === null ? "null" : Array.isArray(data) ? "an array" : `a ${typeof data}`;
|
|
1664
|
+
throw registerRefusal(
|
|
1665
|
+
`IMetadataService.register('${type}', '${name}'): data is ${shape}, not a metadata document. register() stores plain-object documents only \u2014 accepting a value the service cannot key was measured as accept-then-drop on document-keyed stores (#7378 row 3: refuse loudly, never coerce into storability). Wrap the value in a document object whose shape the '${type}' type's schema accepts, or store it under a type that declares one.`
|
|
1666
|
+
);
|
|
1667
|
+
}
|
|
1668
|
+
const documentName = data.name;
|
|
1669
|
+
if (documentName !== void 0 && documentName !== name) {
|
|
1670
|
+
throw registerRefusal(
|
|
1671
|
+
`IMetadataService.register('${type}', '${name}'): data.name is '${String(documentName)}', which disagrees with the name argument '${name}'. A disagreement is almost always an authoring bug, and resolving it silently in either direction can file the item under a key the caller never wrote (#7378 row 1: refuse loudly, locate the mismatch). Register under one name: pass the intended key as the argument and make data.name match it, or omit data.name.`
|
|
1672
|
+
);
|
|
1673
|
+
}
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1618
1676
|
// src/fallbacks/memory-metadata.ts
|
|
1619
1677
|
function createMemoryMetadata() {
|
|
1620
1678
|
const store = /* @__PURE__ */ new Map();
|
|
1621
1679
|
function getTypeMap(type) {
|
|
1622
|
-
|
|
1680
|
+
const canonical = canonicalMetadataServiceType(type);
|
|
1681
|
+
let map = store.get(canonical);
|
|
1623
1682
|
if (!map) {
|
|
1624
1683
|
map = /* @__PURE__ */ new Map();
|
|
1625
|
-
store.set(
|
|
1684
|
+
store.set(canonical, map);
|
|
1626
1685
|
}
|
|
1627
1686
|
return map;
|
|
1628
1687
|
}
|
|
@@ -1637,6 +1696,7 @@ function createMemoryMetadata() {
|
|
|
1637
1696
|
},
|
|
1638
1697
|
_serviceName: "metadata",
|
|
1639
1698
|
async register(type, name, data) {
|
|
1699
|
+
assertMetadataRegisterContract(type, name, data);
|
|
1640
1700
|
getTypeMap(type).set(name, data);
|
|
1641
1701
|
},
|
|
1642
1702
|
// Mirror MetadataManager.registerInMemory (synchronous, no persistence).
|
|
@@ -1648,7 +1708,11 @@ function createMemoryMetadata() {
|
|
|
1648
1708
|
// so `defineStack({ datasources })` entries silently never reached the
|
|
1649
1709
|
// registry and were absent from GET /api/v1/datasources and
|
|
1650
1710
|
// GET /api/v1/meta/datasource (ADR-0015 §18). This store is already
|
|
1651
|
-
// in-memory only, so registerInMemory and register share
|
|
1711
|
+
// in-memory only, so registerInMemory and register share a store — but
|
|
1712
|
+
// NOT the [#7378] refusals: the ruling names `register`, and this member
|
|
1713
|
+
// is a boot-time seeding primitive for source-control-owned artefacts
|
|
1714
|
+
// (see assertMetadataRegisterContract's header for the boundary). It does
|
|
1715
|
+
// share the row-2 canonical type fold, via getTypeMap.
|
|
1652
1716
|
registerInMemory(type, name, data) {
|
|
1653
1717
|
getTypeMap(type).set(name, data);
|
|
1654
1718
|
},
|
|
@@ -1677,7 +1741,7 @@ function createMemoryMetadata() {
|
|
|
1677
1741
|
}
|
|
1678
1742
|
|
|
1679
1743
|
// src/fallbacks/authored-translation-sync.ts
|
|
1680
|
-
var
|
|
1744
|
+
var import_system2 = require("@objectstack/spec/system");
|
|
1681
1745
|
var OWNER_PROP = "__authoredTranslationSyncOwner";
|
|
1682
1746
|
var LOCALE_LIKE = /^[a-z]{2,3}([_-]([A-Za-z]{4}|[A-Za-z]{2}|[0-9]{3}))?$/;
|
|
1683
1747
|
async function readAuthoredTranslationLayer(engine, logger) {
|
|
@@ -1707,7 +1771,7 @@ async function readAuthoredTranslationLayer(engine, logger) {
|
|
|
1707
1771
|
continue;
|
|
1708
1772
|
}
|
|
1709
1773
|
if (!data || typeof data !== "object") continue;
|
|
1710
|
-
const legacyKeys =
|
|
1774
|
+
const legacyKeys = import_system2.LEGACY_OBJECT_FIRST_KEYS.filter((key) => data[key] !== void 0);
|
|
1711
1775
|
if (legacyKeys.length > 0) {
|
|
1712
1776
|
logger?.warn?.(
|
|
1713
1777
|
`[i18n] authored translation '${row?.name}' uses the retired object-first shape (${legacyKeys.join(", ")}) \u2014 nothing resolves from it; re-author it under 'objects.<object_name>' with a top-level 'locale' \u2014 skipped`
|
|
@@ -1945,7 +2009,7 @@ var ObjectKernel = class {
|
|
|
1945
2009
|
*/
|
|
1946
2010
|
preInjectCoreFallbacks() {
|
|
1947
2011
|
if (this.config.skipSystemValidation) return;
|
|
1948
|
-
for (const [serviceName, criticality] of Object.entries(
|
|
2012
|
+
for (const [serviceName, criticality] of Object.entries(import_system3.ServiceRequirementDef)) {
|
|
1949
2013
|
if (criticality !== "core") continue;
|
|
1950
2014
|
const hasService = this.services.has(serviceName) || this.pluginLoader.hasService(serviceName);
|
|
1951
2015
|
if (!hasService) {
|
|
@@ -1969,7 +2033,7 @@ var ObjectKernel = class {
|
|
|
1969
2033
|
this.logger.debug("Validating system service requirements...");
|
|
1970
2034
|
const missingServices = [];
|
|
1971
2035
|
const missingCoreServices = [];
|
|
1972
|
-
for (const [serviceName, criticality] of Object.entries(
|
|
2036
|
+
for (const [serviceName, criticality] of Object.entries(import_system3.ServiceRequirementDef)) {
|
|
1973
2037
|
const hasService = this.services.has(serviceName) || this.pluginLoader.hasService(serviceName);
|
|
1974
2038
|
if (!hasService) {
|
|
1975
2039
|
if (criticality === "required") {
|
|
@@ -2644,11 +2708,29 @@ var TestRunner = class {
|
|
|
2644
2708
|
};
|
|
2645
2709
|
|
|
2646
2710
|
// src/qa/http-adapter.ts
|
|
2711
|
+
var import_api = require("@objectstack/spec/api");
|
|
2712
|
+
var dataPathCache;
|
|
2713
|
+
function defaultDataPath() {
|
|
2714
|
+
if (dataPathCache === void 0) {
|
|
2715
|
+
const api = import_api.RestApiConfigSchema.parse({});
|
|
2716
|
+
const crud = import_api.CrudEndpointsConfigSchema.parse({});
|
|
2717
|
+
dataPathCache = `${api.apiPath ?? `${api.basePath}/${api.version}`}${crud.dataPrefix}`;
|
|
2718
|
+
}
|
|
2719
|
+
return dataPathCache;
|
|
2720
|
+
}
|
|
2647
2721
|
var HttpTestAdapter = class {
|
|
2648
2722
|
constructor(baseUrl, authToken) {
|
|
2649
2723
|
this.baseUrl = baseUrl;
|
|
2650
2724
|
this.authToken = authToken;
|
|
2651
2725
|
}
|
|
2726
|
+
/** `{baseUrl}{apiBasePath}{dataPrefix}/{object}` — the collection URL. */
|
|
2727
|
+
collectionUrl(objectName) {
|
|
2728
|
+
return `${this.baseUrl}${defaultDataPath()}/${encodeURIComponent(objectName)}`;
|
|
2729
|
+
}
|
|
2730
|
+
/** `{collection}/{id}` — the single-record URL. */
|
|
2731
|
+
recordUrl(objectName, id) {
|
|
2732
|
+
return `${this.collectionUrl(objectName)}/${encodeURIComponent(String(id))}`;
|
|
2733
|
+
}
|
|
2652
2734
|
async execute(action, _context) {
|
|
2653
2735
|
const headers = {
|
|
2654
2736
|
"Content-Type": "application/json"
|
|
@@ -2680,7 +2762,7 @@ var HttpTestAdapter = class {
|
|
|
2680
2762
|
}
|
|
2681
2763
|
}
|
|
2682
2764
|
async createRecord(objectName, data, headers) {
|
|
2683
|
-
const response = await fetch(
|
|
2765
|
+
const response = await fetch(this.collectionUrl(objectName), {
|
|
2684
2766
|
method: "POST",
|
|
2685
2767
|
headers,
|
|
2686
2768
|
body: JSON.stringify(data)
|
|
@@ -2688,19 +2770,19 @@ var HttpTestAdapter = class {
|
|
|
2688
2770
|
return this.handleResponse(response);
|
|
2689
2771
|
}
|
|
2690
2772
|
async updateRecord(objectName, data, headers) {
|
|
2691
|
-
const id = data
|
|
2773
|
+
const { id, ...fields } = data;
|
|
2692
2774
|
if (!id) throw new Error("Update record requires id in payload");
|
|
2693
|
-
const response = await fetch(
|
|
2694
|
-
method: "
|
|
2775
|
+
const response = await fetch(this.recordUrl(objectName, id), {
|
|
2776
|
+
method: "PATCH",
|
|
2695
2777
|
headers,
|
|
2696
|
-
body: JSON.stringify(
|
|
2778
|
+
body: JSON.stringify(fields)
|
|
2697
2779
|
});
|
|
2698
2780
|
return this.handleResponse(response);
|
|
2699
2781
|
}
|
|
2700
2782
|
async deleteRecord(objectName, data, headers) {
|
|
2701
2783
|
const id = data.id;
|
|
2702
2784
|
if (!id) throw new Error("Delete record requires id in payload");
|
|
2703
|
-
const response = await fetch(
|
|
2785
|
+
const response = await fetch(this.recordUrl(objectName, id), {
|
|
2704
2786
|
method: "DELETE",
|
|
2705
2787
|
headers
|
|
2706
2788
|
});
|
|
@@ -2709,14 +2791,14 @@ var HttpTestAdapter = class {
|
|
|
2709
2791
|
async readRecord(objectName, data, headers) {
|
|
2710
2792
|
const id = data.id;
|
|
2711
2793
|
if (!id) throw new Error("Read record requires id in payload");
|
|
2712
|
-
const response = await fetch(
|
|
2794
|
+
const response = await fetch(this.recordUrl(objectName, id), {
|
|
2713
2795
|
method: "GET",
|
|
2714
2796
|
headers
|
|
2715
2797
|
});
|
|
2716
2798
|
return this.handleResponse(response);
|
|
2717
2799
|
}
|
|
2718
2800
|
async queryRecords(objectName, data, headers) {
|
|
2719
|
-
const response = await fetch(`${this.
|
|
2801
|
+
const response = await fetch(`${this.collectionUrl(objectName)}/query`, {
|
|
2720
2802
|
method: "POST",
|
|
2721
2803
|
headers,
|
|
2722
2804
|
body: JSON.stringify(data)
|
|
@@ -4661,6 +4743,18 @@ function shouldDenyAnonymous(input) {
|
|
|
4661
4743
|
return true;
|
|
4662
4744
|
}
|
|
4663
4745
|
|
|
4746
|
+
// src/security/audience-binding-suggestion-status.ts
|
|
4747
|
+
var AUDIENCE_BINDING_SUGGESTION_STATUSES = {
|
|
4748
|
+
pending: true,
|
|
4749
|
+
confirmed: true,
|
|
4750
|
+
dismissed: true
|
|
4751
|
+
};
|
|
4752
|
+
var AUDIENCE_BINDING_SUGGESTION_STATUS_VALUES = Object.keys(
|
|
4753
|
+
AUDIENCE_BINDING_SUGGESTION_STATUSES
|
|
4754
|
+
);
|
|
4755
|
+
var isAudienceBindingSuggestionStatus = (value) => Object.prototype.hasOwnProperty.call(AUDIENCE_BINDING_SUGGESTION_STATUSES, value);
|
|
4756
|
+
var unknownAudienceBindingSuggestionStatusMessage = (value) => `Unknown status filter '${value}' \u2014 expected one of: ${AUDIENCE_BINDING_SUGGESTION_STATUS_VALUES.join(", ")}`;
|
|
4757
|
+
|
|
4664
4758
|
// src/security/operation-private-keys.ts
|
|
4665
4759
|
var OPERATION_PRIVATE_KEY_PREFIX = "__";
|
|
4666
4760
|
function withoutOperationPrivateKeys(exec) {
|
|
@@ -4914,9 +5008,30 @@ async function bulkWrite(rows, opts) {
|
|
|
4914
5008
|
return results;
|
|
4915
5009
|
}
|
|
4916
5010
|
|
|
5011
|
+
// src/utils/internal-write-response.ts
|
|
5012
|
+
function collectInternalWriteResponseFields(schema) {
|
|
5013
|
+
const fields = schema?.fields;
|
|
5014
|
+
if (!fields || typeof fields !== "object") return [];
|
|
5015
|
+
const out = [];
|
|
5016
|
+
for (const [name, def] of Object.entries(fields)) {
|
|
5017
|
+
if (def && def.internal === true) out.push(name);
|
|
5018
|
+
}
|
|
5019
|
+
return out;
|
|
5020
|
+
}
|
|
5021
|
+
function omitInternalFieldsFromWriteResponse(schema, records) {
|
|
5022
|
+
if (!records) return;
|
|
5023
|
+
const internalFields = collectInternalWriteResponseFields(schema);
|
|
5024
|
+
if (internalFields.length === 0) return;
|
|
5025
|
+
const list = Array.isArray(records) ? records : [records];
|
|
5026
|
+
for (const row of list) {
|
|
5027
|
+
if (!row || typeof row !== "object") continue;
|
|
5028
|
+
for (const field of internalFields) delete row[field];
|
|
5029
|
+
}
|
|
5030
|
+
}
|
|
5031
|
+
|
|
4917
5032
|
// src/utils/migration-journal.ts
|
|
4918
5033
|
var import_node_crypto3 = require("crypto");
|
|
4919
|
-
var
|
|
5034
|
+
var import_system4 = require("@objectstack/spec/system");
|
|
4920
5035
|
var SYSTEM_CTX = { isSystem: true };
|
|
4921
5036
|
var DEFAULT_CHUNK_SIZE = 200;
|
|
4922
5037
|
function engineCanRollBack(engine) {
|
|
@@ -4974,14 +5089,14 @@ function hashMigrationPlan(plan, chunks) {
|
|
|
4974
5089
|
}
|
|
4975
5090
|
async function appendEvent(engine, event, execContext) {
|
|
4976
5091
|
await engine.insert(
|
|
4977
|
-
|
|
5092
|
+
import_system4.MIGRATION_JOURNAL_OBJECT,
|
|
4978
5093
|
{ ...event, created_at: event.created_at ?? (/* @__PURE__ */ new Date()).toISOString() },
|
|
4979
5094
|
{ context: execContext ?? { ...SYSTEM_CTX } }
|
|
4980
5095
|
);
|
|
4981
5096
|
}
|
|
4982
5097
|
async function readRunJournal(engine, runId) {
|
|
4983
5098
|
const rows = await engine.find(
|
|
4984
|
-
|
|
5099
|
+
import_system4.MIGRATION_JOURNAL_OBJECT,
|
|
4985
5100
|
{ where: { run_id: runId } },
|
|
4986
5101
|
{ context: { ...SYSTEM_CTX } }
|
|
4987
5102
|
);
|
|
@@ -4996,7 +5111,7 @@ function chunkSetOf(events, kind) {
|
|
|
4996
5111
|
}
|
|
4997
5112
|
async function findInterruptedRuns(engine) {
|
|
4998
5113
|
const started = await engine.find(
|
|
4999
|
-
|
|
5114
|
+
import_system4.MIGRATION_JOURNAL_OBJECT,
|
|
5000
5115
|
{ where: { kind: "run_started" } },
|
|
5001
5116
|
{ context: { ...SYSTEM_CTX } }
|
|
5002
5117
|
);
|
|
@@ -5504,6 +5619,15 @@ function filterTokenContextFrom(execCtx, now) {
|
|
|
5504
5619
|
};
|
|
5505
5620
|
}
|
|
5506
5621
|
|
|
5622
|
+
// src/utils/record-not-found.ts
|
|
5623
|
+
function recordNotFoundError(object, id) {
|
|
5624
|
+
const err = new Error(`Record ${id} not found in ${object}`);
|
|
5625
|
+
err.code = "RECORD_NOT_FOUND";
|
|
5626
|
+
err.status = 404;
|
|
5627
|
+
err.object = object;
|
|
5628
|
+
return err;
|
|
5629
|
+
}
|
|
5630
|
+
|
|
5507
5631
|
// src/health-monitor.ts
|
|
5508
5632
|
var PluginHealthMonitor = class {
|
|
5509
5633
|
constructor(logger) {
|
|
@@ -6487,6 +6611,8 @@ var NamespaceResolver = class {
|
|
|
6487
6611
|
ANONYMOUS_DENY_MESSAGE,
|
|
6488
6612
|
ANONYMOUS_DENY_STATUS,
|
|
6489
6613
|
API_KEY_PREFIX,
|
|
6614
|
+
AUDIENCE_BINDING_SUGGESTION_STATUSES,
|
|
6615
|
+
AUDIENCE_BINDING_SUGGESTION_STATUS_VALUES,
|
|
6490
6616
|
CORE_FALLBACK_FACTORIES,
|
|
6491
6617
|
DependencyResolver,
|
|
6492
6618
|
ENTRY_EXECUTION_CONTEXT_FIELDS,
|
|
@@ -6520,11 +6646,14 @@ var NamespaceResolver = class {
|
|
|
6520
6646
|
assembleExecutionContext,
|
|
6521
6647
|
assembleExecutionContextOrGuest,
|
|
6522
6648
|
assertInitServiceRequirements,
|
|
6649
|
+
assertMetadataRegisterContract,
|
|
6523
6650
|
bucketKeyToCalendarRange,
|
|
6524
6651
|
buildPermissionsFromGrants,
|
|
6525
6652
|
bulkWrite,
|
|
6526
6653
|
calendarPartsInTz,
|
|
6527
6654
|
calendarPartsInTzOrUtc,
|
|
6655
|
+
canonicalMetadataServiceType,
|
|
6656
|
+
collectInternalWriteResponseFields,
|
|
6528
6657
|
counterSignPayload,
|
|
6529
6658
|
createLogger,
|
|
6530
6659
|
createMemoryCache,
|
|
@@ -6549,6 +6678,7 @@ var NamespaceResolver = class {
|
|
|
6549
6678
|
getMemoryUsage,
|
|
6550
6679
|
hashApiKey,
|
|
6551
6680
|
hashMigrationPlan,
|
|
6681
|
+
isAudienceBindingSuggestionStatus,
|
|
6552
6682
|
isAuthGateAllowlisted,
|
|
6553
6683
|
isExpired,
|
|
6554
6684
|
isGrantActive,
|
|
@@ -6556,12 +6686,14 @@ var NamespaceResolver = class {
|
|
|
6556
6686
|
isNode,
|
|
6557
6687
|
nextUtcCalendarDay,
|
|
6558
6688
|
normalizeAuthGate,
|
|
6689
|
+
omitInternalFieldsFromWriteResponse,
|
|
6559
6690
|
parseScopes,
|
|
6560
6691
|
parseSignature,
|
|
6561
6692
|
planChunks,
|
|
6562
6693
|
postureVisibleRows,
|
|
6563
6694
|
readAuthoredTranslationLayer,
|
|
6564
6695
|
readRunJournal,
|
|
6696
|
+
recordNotFoundError,
|
|
6565
6697
|
resolveApiKeyPrincipal,
|
|
6566
6698
|
resolveAuthzContext,
|
|
6567
6699
|
resolveFilterToken,
|
|
@@ -6575,6 +6707,7 @@ var NamespaceResolver = class {
|
|
|
6575
6707
|
safeExit,
|
|
6576
6708
|
shouldDenyAnonymous,
|
|
6577
6709
|
signPayload,
|
|
6710
|
+
unknownAudienceBindingSuggestionStatusMessage,
|
|
6578
6711
|
utcInstantMs,
|
|
6579
6712
|
validateInitServiceContract,
|
|
6580
6713
|
verifyPayload,
|