@myvitalrx/metadata-runtime 1.14.0 → 1.17.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 +18 -1
- package/dist/index.d.ts +136 -34
- package/dist/index.js +1372 -1440
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -817,8 +817,22 @@ const validIn = await metadata.getRelationships({
|
|
|
817
817
|
releaseId: session.releaseId,
|
|
818
818
|
readPolicy: session.readPolicy,
|
|
819
819
|
});
|
|
820
|
+
|
|
821
|
+
const catalogueRelations = await metadata.queryRelationships([
|
|
822
|
+
{
|
|
823
|
+
sourceTypeCode: 'Module',
|
|
824
|
+
sourceValueCode: 'RPM_VITALS',
|
|
825
|
+
targetTypeCode: 'Feature',
|
|
826
|
+
relationType: 'PARENT_CHILD',
|
|
827
|
+
direction: 'OUTGOING',
|
|
828
|
+
releaseId: session.releaseId,
|
|
829
|
+
readPolicy: session.readPolicy,
|
|
830
|
+
},
|
|
831
|
+
]);
|
|
820
832
|
```
|
|
821
833
|
|
|
834
|
+
`queryRelationships` returns one result per query, in request order. The extension client sends at most 100 queries per request. One query uses `POST /v1/metadata/relationships/query`. Several queries use `POST /v1/metadata/relationships/batch`. Concurrent `getRelationships` calls started in the same turn are grouped the same way. Relationship lookups do not call `GET /v1/status` first. `getRelationships` and `getRelatedValues` keep their current signatures. `getRelatedValueGroups` is the batch form of `getRelatedValues`.
|
|
835
|
+
|
|
822
836
|
Pass the same `releaseId` on every call in one catalogue build. If a refresh activates another release, the call fails with `MetadataReleaseMismatchError` instead of mixing releases. Start a new session and rebuild the catalogue.
|
|
823
837
|
|
|
824
838
|
`REQUIRE_FRESH` accepts only a projection whose status is ready. `STALE` and `DEGRADED` fail with `MetadataFreshnessError`. The default remains `ALLOW_STALE`, including for these new methods. A strict read does not fall through to S3 when the extension cannot prove freshness.
|
|
@@ -831,6 +845,9 @@ Extension routes, also additive:
|
|
|
831
845
|
GET /v1/metadata/types/{typeCode}/values
|
|
832
846
|
POST /v1/metadata/types/values
|
|
833
847
|
POST /v1/metadata/relationships/query
|
|
848
|
+
POST /v1/metadata/relationships/batch
|
|
834
849
|
```
|
|
835
850
|
|
|
836
|
-
`
|
|
851
|
+
The batch route accepts `{ releaseId, readPolicy, queries }` and returns `{ releaseId, results }` in the same order. More than 100 queries, or a body over 256 KB, is rejected. A query the index cannot answer sets `errorCode` and `message` on that result. Freshness and an unavailable snapshot fail the whole request. An extension that does not implement the batch route responds with `Unknown extension route`. The SDK does not repeat those queries one by one.
|
|
852
|
+
|
|
853
|
+
`GET /v1/metadata/{typeCode}` and `GET /v1/relations` are unchanged. Cold start loads `relationship-index.json` and `typed-relations.json` into one snapshot. Relationship lookups read that snapshot.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { StructuredLogger } from '@api-hub/observability';
|
|
2
3
|
import { S3Client } from '@aws-sdk/client-s3';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -32,6 +33,10 @@ declare const RUNTIME_METADATA_EVENTS: {
|
|
|
32
33
|
readonly DOWNLOAD_COMPLETE: "runtimeMetadata.download.complete";
|
|
33
34
|
readonly DOWNLOAD_FAILED: "runtimeMetadata.download.failed";
|
|
34
35
|
readonly MANIFEST_LOADED: "runtimeMetadata.manifest.loaded";
|
|
36
|
+
/** Runtime cache received a release catalog (extension status or S3 manifest). */
|
|
37
|
+
readonly METADATA_MANIFEST_LOADED: "metadata.manifest.loaded";
|
|
38
|
+
/** supportsType decision against the published type catalog. */
|
|
39
|
+
readonly METADATA_TYPE_CHECK: "metadata.type.check";
|
|
35
40
|
/** Authoritative keys after manifest parse (metadataTypes + lookupIndex type prefixes). */
|
|
36
41
|
readonly PROJECTION_MANIFEST_LOADED: "projection.manifest.loaded";
|
|
37
42
|
/** Per-file download begin. */
|
|
@@ -480,30 +485,6 @@ interface ProjectionCurrentPointer {
|
|
|
480
485
|
projectionVersion: string;
|
|
481
486
|
}
|
|
482
487
|
|
|
483
|
-
interface LogEntry {
|
|
484
|
-
event?: string;
|
|
485
|
-
message?: string;
|
|
486
|
-
err?: unknown;
|
|
487
|
-
error?: unknown;
|
|
488
|
-
[key: string]: unknown;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
/**
|
|
492
|
-
* Structured logger compatible with legacy `@api-hub/logger` {@link LogEntry} call style
|
|
493
|
-
* (`logger.info({ event: 'x', ... } )`), backed by {@link getLogger} and AsyncLocalStorage context.
|
|
494
|
-
*/
|
|
495
|
-
declare class StructuredLogger {
|
|
496
|
-
private readonly persistentKeys;
|
|
497
|
-
constructor(persistentKeys?: Record<string, unknown>);
|
|
498
|
-
getPersistentKeys(): Record<string, unknown>;
|
|
499
|
-
info(entry: LogEntry): void;
|
|
500
|
-
warn(entry: LogEntry): void;
|
|
501
|
-
error(entry: LogEntry): void;
|
|
502
|
-
debug(entry: LogEntry): void;
|
|
503
|
-
http(entry: LogEntry): void;
|
|
504
|
-
verbose(entry: LogEntry): void;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
488
|
/** Document discriminator. Not part of a permission identity. */
|
|
508
489
|
declare const PERMISSION_REGISTRY_METADATA_TYPE: "PermissionRegistry";
|
|
509
490
|
/**
|
|
@@ -722,11 +703,20 @@ type CollectResponseMetadataOptions = {
|
|
|
722
703
|
* Known/supported metadata type codes to match against naked field names.
|
|
723
704
|
*/
|
|
724
705
|
knownTypes?: readonly string[] | Set<string>;
|
|
706
|
+
/**
|
|
707
|
+
* Catalog probe used when the full type list is not materialized.
|
|
708
|
+
* Return true when the published manifest contains the type.
|
|
709
|
+
*/
|
|
710
|
+
isKnownType?: (typeCode: string) => boolean;
|
|
725
711
|
/**
|
|
726
712
|
* Optional diagnostics accumulator for detailed tracing.
|
|
727
713
|
*/
|
|
728
714
|
diagnostics?: CollectMetadataDiagnostics;
|
|
729
715
|
};
|
|
716
|
+
/** Stop recursive discovery past this object/array depth. */
|
|
717
|
+
declare const METADATA_TRAVERSAL_MAX_DEPTH = 32;
|
|
718
|
+
/** Stop recursive discovery past this many objects and arrays. */
|
|
719
|
+
declare const METADATA_TRAVERSAL_MAX_NODES = 8000;
|
|
730
720
|
/**
|
|
731
721
|
* Recursively collect unique MetadataTypeCode values from:
|
|
732
722
|
* - explicit `{ typeCode, valueCode }` MetadataReference objects
|
|
@@ -745,6 +735,12 @@ declare function collectResponseTypeCodes(value: unknown, options?: CollectRespo
|
|
|
745
735
|
* Explicit MetadataReference.typeCode always wins over field-name inference.
|
|
746
736
|
*/
|
|
747
737
|
declare function collectResponseReferences(value: unknown, options?: CollectResponseMetadataOptions): MetadataReference[];
|
|
738
|
+
/**
|
|
739
|
+
* Field-key → MetadataTypeCode aliases evidenced by template / alert catalogs.
|
|
740
|
+
* Keys are PascalCase field names as stored on fieldValues maps.
|
|
741
|
+
* Prefer published type names over per-endpoint bindings.
|
|
742
|
+
*/
|
|
743
|
+
declare const FIELD_KEY_METADATA_TYPE_ALIASES: Readonly<Record<string, string>>;
|
|
748
744
|
declare function getCandidateTypeCodesForKey(key: string): string[];
|
|
749
745
|
/**
|
|
750
746
|
* Fast inspection to determine if a response payload might contain
|
|
@@ -754,8 +750,27 @@ declare function getCandidateTypeCodesForKey(key: string): string[];
|
|
|
754
750
|
declare function hasPotentialMetadata(value: unknown): boolean;
|
|
755
751
|
|
|
756
752
|
/**
|
|
757
|
-
*
|
|
758
|
-
*
|
|
753
|
+
* LinkedEntityCode is not a MetadataType. The concrete type is selected from
|
|
754
|
+
* the sibling AppliesToType (see helpers/catalog/types/hierarchy.ts).
|
|
755
|
+
*/
|
|
756
|
+
declare const APPLIES_TO_LINKED_ENTITY_METADATA_TYPE: Readonly<Record<string, string>>;
|
|
757
|
+
/**
|
|
758
|
+
* Map an AppliesToType value code to the LinkedEntity metadata type.
|
|
759
|
+
*/
|
|
760
|
+
declare function linkedEntityMetadataTypeFromAppliesTo(appliesToType: string | undefined | null): string | undefined;
|
|
761
|
+
/**
|
|
762
|
+
* Read AppliesToType / appliesToType from a parent fieldValues entry.
|
|
763
|
+
* Accepts a plain string, `{ value }`, `{ labelKey, value }`, or MetadataReference.
|
|
764
|
+
*/
|
|
765
|
+
declare function readAppliesToTypeValue(parent: Record<string, unknown> | undefined | null): string | undefined;
|
|
766
|
+
/**
|
|
767
|
+
* True when the DTO field name is LinkedEntityCode (any common casing).
|
|
768
|
+
*/
|
|
769
|
+
declare function isLinkedEntityCodeField(field: string): boolean;
|
|
770
|
+
|
|
771
|
+
/**
|
|
772
|
+
* Wire / Excel spellings that differ from the published MetadataTypeCode
|
|
773
|
+
* (and projection file name).
|
|
759
774
|
*/
|
|
760
775
|
declare const RUNTIME_METADATA_TYPE_CODE_ALIASES: Readonly<Record<string, string>>;
|
|
761
776
|
/**
|
|
@@ -799,6 +814,21 @@ declare function isWorkflowStepRecord(node: Record<string, unknown>): boolean;
|
|
|
799
814
|
* True when `key` is a workflow rule on a step and must not be resolved as metadata.
|
|
800
815
|
*/
|
|
801
816
|
declare function isWorkflowStepRuleField(key: string, parent: Record<string, unknown>): boolean;
|
|
817
|
+
/**
|
|
818
|
+
* Template `rules` leaf: flags and bounds, not a metadata `{ value }` reference.
|
|
819
|
+
* `rules.Condition` is this shape and must not be resolved as Condition metadata.
|
|
820
|
+
*/
|
|
821
|
+
declare function isTemplateRuleNode(value: unknown): value is Record<string, unknown>;
|
|
822
|
+
/**
|
|
823
|
+
* Map of template field rules (`rules.Condition`, nested `rules` maps).
|
|
824
|
+
*/
|
|
825
|
+
declare function isTemplateRulesMap(value: unknown): boolean;
|
|
826
|
+
/**
|
|
827
|
+
* Rule configuration must be copied through enrichment unchanged.
|
|
828
|
+
* The property name `rules` is the template rules map. A node that already
|
|
829
|
+
* matches the rule contract is skipped even when it is nested under another key.
|
|
830
|
+
*/
|
|
831
|
+
declare function isTemplateRuleConfiguration(key: string, value: unknown): boolean;
|
|
802
832
|
/**
|
|
803
833
|
* Map a DTO field name to MetadataTypeCode when the `*Code` convention applies.
|
|
804
834
|
*
|
|
@@ -807,7 +837,7 @@ declare function isWorkflowStepRuleField(key: string, parent: Record<string, unk
|
|
|
807
837
|
* `questionCode` → `QuestionCode`
|
|
808
838
|
*
|
|
809
839
|
* Returns undefined for non-code fields, excluded names, and empty input.
|
|
810
|
-
* Fields ending in `
|
|
840
|
+
* Fields ending in `__code` (enrichment siblings) are always skipped.
|
|
811
841
|
*/
|
|
812
842
|
declare function typeCodeFromCodeFieldName(fieldName: string, excluded?: ReadonlySet<string>): string | undefined;
|
|
813
843
|
declare function createCodeFieldExclusionSet(extra?: Iterable<string>): Set<string>;
|
|
@@ -1252,6 +1282,7 @@ declare class MetadataCache implements ReadModelCache<MetadataCacheSnapshot, Pro
|
|
|
1252
1282
|
getStatus(): CacheStatus;
|
|
1253
1283
|
setStatus(status: CacheStatus): void;
|
|
1254
1284
|
isReady(): boolean;
|
|
1285
|
+
hasCatalog(): boolean;
|
|
1255
1286
|
getSnapshot(): MetadataCacheSnapshot | null;
|
|
1256
1287
|
getManifest(): ProjectionManifest | null;
|
|
1257
1288
|
getRevision(): string | null;
|
|
@@ -1287,13 +1318,20 @@ declare class MetadataCache implements ReadModelCache<MetadataCacheSnapshot, Pro
|
|
|
1287
1318
|
/**
|
|
1288
1319
|
* Merge individual resolved entries into domain record maps (same release).
|
|
1289
1320
|
* Used after an extension batch lookup so {@link MetadataResolver.resolve}
|
|
1290
|
-
* remains synchronous.
|
|
1321
|
+
* remains synchronous. Also updates lookupIndex and default-locale labels so
|
|
1322
|
+
* cache-only helpers work from extension-provided data.
|
|
1291
1323
|
*/
|
|
1292
1324
|
hydrateEntries(entries: ReadonlyArray<{
|
|
1293
1325
|
typeCode: string;
|
|
1294
1326
|
valueCode: string;
|
|
1295
1327
|
entry: ProjectionEntry;
|
|
1328
|
+
localizedLabel?: string;
|
|
1296
1329
|
}>, guard?: MetadataCacheWriteGuard): MetadataCacheSnapshot;
|
|
1330
|
+
/**
|
|
1331
|
+
* Merge type-catalog fields (e.g. valueDataType) into the synthetic extension
|
|
1332
|
+
* manifest so synchronous helpers can read them after listTypeValues.
|
|
1333
|
+
*/
|
|
1334
|
+
mergeTypeCatalog(types: Readonly<Record<string, ManifestMetadataTypeEntry>>, guard?: MetadataCacheWriteGuard): MetadataCacheSnapshot;
|
|
1297
1335
|
/**
|
|
1298
1336
|
* Clear only when explicitly requested (e.g. tests). Refresh failures must NOT call this.
|
|
1299
1337
|
*/
|
|
@@ -1691,6 +1729,11 @@ interface MetadataRelationshipResult {
|
|
|
1691
1729
|
supported: boolean;
|
|
1692
1730
|
relationships: MetadataRelationship[];
|
|
1693
1731
|
}
|
|
1732
|
+
/**
|
|
1733
|
+
* Maximum relationship queries in one extension HTTP request.
|
|
1734
|
+
* Keep aligned with the extension `RELATIONSHIP_QUERY_BATCH_LIMIT`.
|
|
1735
|
+
*/
|
|
1736
|
+
declare const RELATIONSHIP_QUERY_BATCH_LIMIT = 100;
|
|
1694
1737
|
interface MetadataReadSession {
|
|
1695
1738
|
releaseId: string;
|
|
1696
1739
|
readPolicy: MetadataReadPolicy;
|
|
@@ -1702,6 +1745,12 @@ interface MetadataReadSession {
|
|
|
1702
1745
|
interface MetadataDiscoveryProvider {
|
|
1703
1746
|
listValuesByType(typeCode: string, options?: MetadataListOptions): Promise<MetadataListResult>;
|
|
1704
1747
|
getRelationships(query: MetadataRelationshipQuery): Promise<MetadataRelationshipResult>;
|
|
1748
|
+
/**
|
|
1749
|
+
* Resolve many relationship queries against one release.
|
|
1750
|
+
* Optional so existing providers stay valid. Callers fall back to
|
|
1751
|
+
* {@link getRelationships} when it is absent or the extension route is unsupported.
|
|
1752
|
+
*/
|
|
1753
|
+
queryRelationships?(queries: readonly MetadataRelationshipQuery[]): Promise<MetadataRelationshipResult[]>;
|
|
1705
1754
|
listValuesByTypes(typeCodes: readonly string[], options?: MetadataBatchListOptions): Promise<MetadataBatchListResult>;
|
|
1706
1755
|
}
|
|
1707
1756
|
declare function supportsMetadataDiscovery(provider: object): provider is MetadataDiscoveryProvider;
|
|
@@ -1739,7 +1788,12 @@ type SelectedMetadataProvider = {
|
|
|
1739
1788
|
* Preference:
|
|
1740
1789
|
* 1. Explicit test extension provider
|
|
1741
1790
|
* 2. Extension when enabled and a localhost URL / Lambda runtime is present
|
|
1742
|
-
* 3. S3
|
|
1791
|
+
* 3. Direct S3 only when extension is disabled (publisher/tools) or
|
|
1792
|
+
* `METADATA_EXTENSION_FALLBACK=s3` is set explicitly for legacy harnesses
|
|
1793
|
+
*
|
|
1794
|
+
* Consumer Lambdas must run with the extension attached and
|
|
1795
|
+
* `METADATA_EXTENSION_FALLBACK=none` (the default). Extension failures
|
|
1796
|
+
* propagate; they must not silently switch to S3.
|
|
1743
1797
|
*/
|
|
1744
1798
|
declare function selectMetadataProvider(input: SelectMetadataProviderInput): SelectedMetadataProvider | null;
|
|
1745
1799
|
declare function isExtensionEnabled(env?: NodeJS.ProcessEnv): boolean;
|
|
@@ -1908,7 +1962,19 @@ declare class RuntimeMetadataService implements ReadModelProvider<ProjectionEntr
|
|
|
1908
1962
|
listValuesByType(typeCode: string, options?: MetadataListOptions): Promise<MetadataListResult>;
|
|
1909
1963
|
listValuesByTypes(typeCodes: readonly string[], options?: MetadataBatchListOptions): Promise<MetadataBatchListResult>;
|
|
1910
1964
|
getRelationships(query: MetadataRelationshipQuery): Promise<MetadataRelationshipResult>;
|
|
1965
|
+
/**
|
|
1966
|
+
* Resolve many relationship queries with a bounded number of extension requests.
|
|
1967
|
+
* Providers without a batch method, and extensions that do not implement the
|
|
1968
|
+
* batch route, keep the existing per-query behavior.
|
|
1969
|
+
*/
|
|
1970
|
+
queryRelationships(queries: readonly MetadataRelationshipQuery[]): Promise<MetadataRelationshipResult[]>;
|
|
1911
1971
|
getActiveProviderKind(): MetadataProviderKind;
|
|
1972
|
+
/**
|
|
1973
|
+
* One localization dictionary for a locale (`localization/<locale>.json`).
|
|
1974
|
+
* A missing locale file returns undefined. Transport and projection failures throw.
|
|
1975
|
+
* An empty dictionary is a published file, not a failed read.
|
|
1976
|
+
*/
|
|
1977
|
+
getLocalizationMap(locale: string): Promise<Record<string, string> | undefined>;
|
|
1912
1978
|
getProviderTransportState(): string;
|
|
1913
1979
|
getExtensionHealthCheckCount(): number;
|
|
1914
1980
|
private usesExtensionTransport;
|
|
@@ -1917,6 +1983,7 @@ declare class RuntimeMetadataService implements ReadModelProvider<ProjectionEntr
|
|
|
1917
1983
|
private refreshViaExtension;
|
|
1918
1984
|
private initializeFromExtension;
|
|
1919
1985
|
private installExtensionManifest;
|
|
1986
|
+
private logInstalledManifest;
|
|
1920
1987
|
private hydrateProviderValues;
|
|
1921
1988
|
private currentWriteGuard;
|
|
1922
1989
|
private installBatchReleaseIfCurrent;
|
|
@@ -2039,6 +2106,12 @@ declare class ExtensionMetadataProvider implements MetadataProvider, MetadataDis
|
|
|
2039
2106
|
private readonly requestTimeoutMs;
|
|
2040
2107
|
private readonly logger;
|
|
2041
2108
|
private lifecycleSupport?;
|
|
2109
|
+
/** Last release observed in READY state. Not a time-based cache. */
|
|
2110
|
+
private verifiedFreshReleaseId;
|
|
2111
|
+
private readinessCheckCount;
|
|
2112
|
+
private relationshipRequestCount;
|
|
2113
|
+
private pendingRelationships;
|
|
2114
|
+
private relationshipFlushScheduled;
|
|
2042
2115
|
private readonly fetchImpl;
|
|
2043
2116
|
constructor(options: ExtensionMetadataProviderOptions);
|
|
2044
2117
|
isAvailable(): Promise<boolean>;
|
|
@@ -2054,6 +2127,15 @@ declare class ExtensionMetadataProvider implements MetadataProvider, MetadataDis
|
|
|
2054
2127
|
listValuesByType(typeCode: string, options?: MetadataListOptions): Promise<MetadataListResult>;
|
|
2055
2128
|
listValuesByTypes(typeCodes: readonly string[], options?: MetadataBatchListOptions): Promise<MetadataBatchListResult>;
|
|
2056
2129
|
getRelationships(query: MetadataRelationshipQuery): Promise<MetadataRelationshipResult>;
|
|
2130
|
+
/**
|
|
2131
|
+
* One or more extension requests, chunked at {@link RELATIONSHIP_QUERY_BATCH_LIMIT}.
|
|
2132
|
+
* A single query uses the single-query route. Several queries use the batch route.
|
|
2133
|
+
*/
|
|
2134
|
+
queryRelationships(queries: readonly MetadataRelationshipQuery[]): Promise<MetadataRelationshipResult[]>;
|
|
2135
|
+
getPerformanceCounters(): {
|
|
2136
|
+
readinessCheckCount: number;
|
|
2137
|
+
relationshipRequestCount: number;
|
|
2138
|
+
};
|
|
2057
2139
|
listRelations(query: MetadataRelationQuery): Promise<MetadataRelationListResult>;
|
|
2058
2140
|
getRelatedValues(sourceTypeCode: string, sourceValueCode: string, targetTypeCode: string, options?: MetadataResolveOptions): Promise<MetadataValue[]>;
|
|
2059
2141
|
getRelatedValueGroups(sourceTypeCode: string, sourceValueCodes: readonly string[], targetTypeCode: string, options?: MetadataResolveOptions): Promise<MetadataRelatedGroup[]>;
|
|
@@ -2064,6 +2146,14 @@ declare class ExtensionMetadataProvider implements MetadataProvider, MetadataDis
|
|
|
2064
2146
|
private assertQueryLifecycle;
|
|
2065
2147
|
private toMetadataValue;
|
|
2066
2148
|
private assertDiscoveryPolicy;
|
|
2149
|
+
private scheduleRelationshipFlush;
|
|
2150
|
+
private flushRelationships;
|
|
2151
|
+
private flushRelationshipGroup;
|
|
2152
|
+
private executeRelationshipGroup;
|
|
2153
|
+
private fetchRelationships;
|
|
2154
|
+
private settleSingleRelationship;
|
|
2155
|
+
private postSingleRelationship;
|
|
2156
|
+
private postRelationshipBatch;
|
|
2067
2157
|
private requestJson;
|
|
2068
2158
|
}
|
|
2069
2159
|
declare function defaultExtensionBaseUrl(port?: number): string;
|
|
@@ -2134,6 +2224,13 @@ type InMemoryMetadataProviderOptions = {
|
|
|
2134
2224
|
lifecycleSupported?: boolean;
|
|
2135
2225
|
/** When omitted, {@link InMemoryMetadataProvider.getPermissionRegistry} fails closed. */
|
|
2136
2226
|
permissionRegistry?: PermissionRegistryDocument;
|
|
2227
|
+
/**
|
|
2228
|
+
* Locale → localization key → text. A missing locale is undefined.
|
|
2229
|
+
* An empty object is a published dictionary.
|
|
2230
|
+
*/
|
|
2231
|
+
localization?: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
2232
|
+
/** When true, localization reads throw instead of returning a dictionary. */
|
|
2233
|
+
localizationUnavailable?: boolean;
|
|
2137
2234
|
};
|
|
2138
2235
|
/**
|
|
2139
2236
|
* Test / local provider. Never talks to S3 or the extension.
|
|
@@ -2149,6 +2246,8 @@ declare class InMemoryMetadataProvider implements MetadataProvider, MetadataDisc
|
|
|
2149
2246
|
private readonly knownTypeCodes;
|
|
2150
2247
|
private readonly lifecycleSupported;
|
|
2151
2248
|
private readonly permissionRegistry;
|
|
2249
|
+
private readonly localization;
|
|
2250
|
+
private readonly localizationUnavailable;
|
|
2152
2251
|
private readonly activeByType;
|
|
2153
2252
|
private readonly inactiveByType;
|
|
2154
2253
|
constructor(options?: InMemoryMetadataProviderOptions);
|
|
@@ -2164,6 +2263,7 @@ declare class InMemoryMetadataProvider implements MetadataProvider, MetadataDisc
|
|
|
2164
2263
|
batchGet(references: string[], options?: MetadataResolveOptions): Promise<MetadataBatchResult>;
|
|
2165
2264
|
listRelations(query: MetadataRelationQuery): Promise<MetadataRelationListResult>;
|
|
2166
2265
|
getRelatedValues(sourceTypeCode: string, sourceValueCode: string, targetTypeCode: string, options?: MetadataResolveOptions): Promise<MetadataValue[]>;
|
|
2266
|
+
getLocalizationMap(locale: string): Promise<Record<string, string> | undefined>;
|
|
2167
2267
|
getPermissionRegistry(): Promise<PermissionRegistryDocument>;
|
|
2168
2268
|
getRelatedValueGroups(sourceTypeCode: string, sourceValueCodes: readonly string[], targetTypeCode: string, options?: MetadataResolveOptions): Promise<MetadataRelatedGroup[]>;
|
|
2169
2269
|
private relatedValuesFor;
|
|
@@ -2197,11 +2297,13 @@ type ProviderFailoverCoordinatorOptions = {
|
|
|
2197
2297
|
onRecovered?: (status: MetadataProviderStatus) => Promise<void>;
|
|
2198
2298
|
};
|
|
2199
2299
|
/**
|
|
2200
|
-
* Deterministic, concurrency-safe extension
|
|
2300
|
+
* Deterministic, concurrency-safe extension transport coordinator.
|
|
2201
2301
|
*
|
|
2202
|
-
*
|
|
2203
|
-
*
|
|
2204
|
-
*
|
|
2302
|
+
* When a fallback provider is configured (`METADATA_EXTENSION_FALLBACK=s3`),
|
|
2303
|
+
* extension failures can activate S3 until the extension recovers. Production
|
|
2304
|
+
* consumers run with fallback disabled (`none`): activateFallback is a no-op
|
|
2305
|
+
* and callers must propagate the original error. Health probes are coalesced
|
|
2306
|
+
* and cooldown-gated so concurrent lookups cannot stampede localhost.
|
|
2205
2307
|
*/
|
|
2206
2308
|
declare class ProviderFailoverCoordinator {
|
|
2207
2309
|
private state;
|
|
@@ -2239,4 +2341,4 @@ declare class ProviderFailoverCoordinator {
|
|
|
2239
2341
|
}
|
|
2240
2342
|
declare function isExtensionServing(status: MetadataProviderStatus): boolean;
|
|
2241
2343
|
|
|
2242
|
-
export { CACHE_STATUS, type CacheStatus, type CandidateDiagnostic, type CollectMetadataDiagnostics, type CollectResponseMetadataOptions, type CreateRuntimeMetadataFromEnvOptions, DEFAULT_EXCLUDED_CODE_FIELDS, DEFAULT_PROVIDER_RECOVERY_COOLDOWN_MS, ExtensionMetadataProvider, type ExtensionMetadataProviderOptions, type ExtensionMetadataTypeInfo, InMemoryMetadataProvider, type InMemoryMetadataProviderOptions, type InMemoryMetadataRecord, InvalidMetadataReferenceError, type ListedMetadataType, type LoadedProjectionBundle, METADATA_ATTRIBUTE_FILTER_KEY, METADATA_PROJECTIONS_BUCKET_ENV, METADATA_PROVIDER_KIND, METADATA_READ_POLICY, METADATA_RELATION_DIRECTION, type ManifestCompareResult, type ManifestLookupIndexEntry, type ManifestMetadataTypeEntry, ManifestValidationError, type MetadataAttributeFilterKey, type MetadataBatchListOptions, type MetadataBatchListResult, type MetadataBatchResult, type MetadataBatchTypeList, MetadataCache, type MetadataCacheSnapshot, type MetadataCacheWriteGuard, MetadataDiscoveryError, type MetadataDiscoveryProvider, MetadataDownloader, type MetadataDownloaderOptions, MetadataExtensionContractError, MetadataFreshnessError, type MetadataHealthReport, MetadataHealthService, type MetadataHealthServiceOptions, type MetadataListOptions, type MetadataListResult, MetadataLoader, type MetadataLoaderOptions, MetadataLookupError, MetadataNotReadyError, MetadataProjectionUnavailableError, type MetadataProvider, type MetadataProviderKind, type MetadataProviderStatus, type MetadataReadPolicy, type MetadataReadSession, type MetadataReference, MetadataRefreshService, type MetadataRefreshServiceOptions, type MetadataRelatedGroup, type MetadataRelationDirection, type MetadataRelationListResult, type MetadataRelationQuery, type MetadataRelationRow, type MetadataRelationship, type MetadataRelationshipQuery, type MetadataRelationshipResult, MetadataReleaseMismatchError, type MetadataResolveOptions, MetadataResolver, type MetadataResolverOptions, type MetadataTypeCatalogInfo, type MetadataValue, NON_METADATA_KEYS, PROVIDER_TRANSPORT_STATE, ProjectionDownloadError, type ProjectionEntry, type ProjectionVersionEntry, ProviderFailoverCoordinator, type ProviderFailoverCoordinatorOptions, type ProviderTransportState, REFRESH_STATUS, RUNTIME_METADATA_EVENTS, RUNTIME_METADATA_INTEGRATION_TARGETS, RUNTIME_METADATA_TYPE_CODE_ALIASES, type ReadModelArtifact, type ReadModelBundle, type ReadModelCache, type ReadModelCacheLoader, type ReadModelDownloader, type ReadModelGroupDescriptor, type ReadModelGroupId, type ReadModelManifestGroupView, type ReadModelManifestGroups, type ReadModelProvider, type ReadModelRefreshCoordinator, type ReadModelResolver, type RefreshStatus, type ResolvableMetadataType, type ResolvedProjectionEntry, type RuntimeMetadataConfig, type RuntimeMetadataConfigInput, RuntimeMetadataError, RuntimeMetadataService, type RuntimeMetadataServiceOptions, S3MetadataProvider, type S3MetadataProviderClient, type S3MetadataProviderOptions, type SelectMetadataProviderInput, type SelectedMetadataProvider, UnknownMetadataTypeError, WORKFLOW_STEP_RULE_KEYS, assertMetadataReadPolicy, assertReleasePin, canonicalMetadataProjectionsBucketName, collectResponseReferences, collectResponseTypeCodes, createCodeFieldExclusionSet, createRuntimeMetadataFromEnv, defaultExtensionBaseUrl, ensureRuntimeMetadataLoaded, formatMetadataReference, getCandidateTypeCodesForKey, getRuntimeMetadataHealth, getRuntimeMetadataService, hasPotentialMetadata, isCompactMetadataReference, isExtensionEnabled, isExtensionServing, isFreshProjectionState, isMetadataProjectionConfigured, isMetadataProjectionsBucketConfigured, isMetadataReference, isMetadataValueObject, isMetadataValueObjectArray, isWorkflowStepRecord, isWorkflowStepRuleField, localizedLabelFromEntry, manifestLocalizationSchema, metadataGroupFromManifest, metadataValueToReference, normalizeRuntimeMetadataTypeCode, onMetadataProjectionCompleted, parseMetadataReference, projectionEntryToMetadataValue, projectionManifestSchema, readMetadataProjectionsBucket, readModelGroupsFromManifest, relatedValueCodes, resetRuntimeMetadataBootstrapState, resolveMetadataProjectionsBucket, resolveRuntimeMetadataConfig, runtimeMetadataConfigSchema, selectMetadataProvider, supportsMetadataDiscovery, throwPublishedListFailure, tryGetRuntimeMetadataService, tryParseMetadataReference, typeCodeFromCodeFieldName };
|
|
2344
|
+
export { APPLIES_TO_LINKED_ENTITY_METADATA_TYPE, CACHE_STATUS, type CacheStatus, type CandidateDiagnostic, type CollectMetadataDiagnostics, type CollectResponseMetadataOptions, type CreateRuntimeMetadataFromEnvOptions, DEFAULT_EXCLUDED_CODE_FIELDS, DEFAULT_PROVIDER_RECOVERY_COOLDOWN_MS, ExtensionMetadataProvider, type ExtensionMetadataProviderOptions, type ExtensionMetadataTypeInfo, FIELD_KEY_METADATA_TYPE_ALIASES, InMemoryMetadataProvider, type InMemoryMetadataProviderOptions, type InMemoryMetadataRecord, InvalidMetadataReferenceError, type ListedMetadataType, type LoadedProjectionBundle, METADATA_ATTRIBUTE_FILTER_KEY, METADATA_PROJECTIONS_BUCKET_ENV, METADATA_PROVIDER_KIND, METADATA_READ_POLICY, METADATA_RELATION_DIRECTION, METADATA_TRAVERSAL_MAX_DEPTH, METADATA_TRAVERSAL_MAX_NODES, type ManifestCompareResult, type ManifestLookupIndexEntry, type ManifestMetadataTypeEntry, ManifestValidationError, type MetadataAttributeFilterKey, type MetadataBatchListOptions, type MetadataBatchListResult, type MetadataBatchResult, type MetadataBatchTypeList, MetadataCache, type MetadataCacheSnapshot, type MetadataCacheWriteGuard, MetadataDiscoveryError, type MetadataDiscoveryProvider, MetadataDownloader, type MetadataDownloaderOptions, MetadataExtensionContractError, MetadataFreshnessError, type MetadataHealthReport, MetadataHealthService, type MetadataHealthServiceOptions, type MetadataListOptions, type MetadataListResult, MetadataLoader, type MetadataLoaderOptions, MetadataLookupError, MetadataNotReadyError, MetadataProjectionUnavailableError, type MetadataProvider, type MetadataProviderKind, type MetadataProviderStatus, type MetadataReadPolicy, type MetadataReadSession, type MetadataReference, MetadataRefreshService, type MetadataRefreshServiceOptions, type MetadataRelatedGroup, type MetadataRelationDirection, type MetadataRelationListResult, type MetadataRelationQuery, type MetadataRelationRow, type MetadataRelationship, type MetadataRelationshipQuery, type MetadataRelationshipResult, MetadataReleaseMismatchError, type MetadataResolveOptions, MetadataResolver, type MetadataResolverOptions, type MetadataTypeCatalogInfo, type MetadataValue, NON_METADATA_KEYS, PROVIDER_TRANSPORT_STATE, ProjectionDownloadError, type ProjectionEntry, type ProjectionVersionEntry, ProviderFailoverCoordinator, type ProviderFailoverCoordinatorOptions, type ProviderTransportState, REFRESH_STATUS, RELATIONSHIP_QUERY_BATCH_LIMIT, RUNTIME_METADATA_EVENTS, RUNTIME_METADATA_INTEGRATION_TARGETS, RUNTIME_METADATA_TYPE_CODE_ALIASES, type ReadModelArtifact, type ReadModelBundle, type ReadModelCache, type ReadModelCacheLoader, type ReadModelDownloader, type ReadModelGroupDescriptor, type ReadModelGroupId, type ReadModelManifestGroupView, type ReadModelManifestGroups, type ReadModelProvider, type ReadModelRefreshCoordinator, type ReadModelResolver, type RefreshStatus, type ResolvableMetadataType, type ResolvedProjectionEntry, type RuntimeMetadataConfig, type RuntimeMetadataConfigInput, RuntimeMetadataError, RuntimeMetadataService, type RuntimeMetadataServiceOptions, S3MetadataProvider, type S3MetadataProviderClient, type S3MetadataProviderOptions, type SelectMetadataProviderInput, type SelectedMetadataProvider, UnknownMetadataTypeError, WORKFLOW_STEP_RULE_KEYS, assertMetadataReadPolicy, assertReleasePin, canonicalMetadataProjectionsBucketName, collectResponseReferences, collectResponseTypeCodes, createCodeFieldExclusionSet, createRuntimeMetadataFromEnv, defaultExtensionBaseUrl, ensureRuntimeMetadataLoaded, formatMetadataReference, getCandidateTypeCodesForKey, getRuntimeMetadataHealth, getRuntimeMetadataService, hasPotentialMetadata, isCompactMetadataReference, isExtensionEnabled, isExtensionServing, isFreshProjectionState, isLinkedEntityCodeField, isMetadataProjectionConfigured, isMetadataProjectionsBucketConfigured, isMetadataReference, isMetadataValueObject, isMetadataValueObjectArray, isTemplateRuleConfiguration, isTemplateRuleNode, isTemplateRulesMap, isWorkflowStepRecord, isWorkflowStepRuleField, linkedEntityMetadataTypeFromAppliesTo, localizedLabelFromEntry, manifestLocalizationSchema, metadataGroupFromManifest, metadataValueToReference, normalizeRuntimeMetadataTypeCode, onMetadataProjectionCompleted, parseMetadataReference, projectionEntryToMetadataValue, projectionManifestSchema, readAppliesToTypeValue, readMetadataProjectionsBucket, readModelGroupsFromManifest, relatedValueCodes, resetRuntimeMetadataBootstrapState, resolveMetadataProjectionsBucket, resolveRuntimeMetadataConfig, runtimeMetadataConfigSchema, selectMetadataProvider, supportsMetadataDiscovery, throwPublishedListFailure, tryGetRuntimeMetadataService, tryParseMetadataReference, typeCodeFromCodeFieldName };
|