@myvitalrx/metadata-runtime 1.14.0 → 1.16.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 +41 -1
- package/dist/index.js +785 -275
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -121,6 +121,7 @@ var PROJECTION_FILE_NAME = {
|
|
|
121
121
|
[PROJECTION_TYPE.LANGUAGE]: "Language.json",
|
|
122
122
|
[PROJECTION_TYPE.COMMON]: "common.json",
|
|
123
123
|
[PROJECTION_TYPE.RELATIONSHIP_INDEX]: "relationship-index.json",
|
|
124
|
+
/** Type-relationship catalog: relation types and published relationship rows. */
|
|
124
125
|
[PROJECTION_TYPE.TYPED_RELATIONS]: "typed-relations.json",
|
|
125
126
|
[PROJECTION_TYPE.PERMISSION_REGISTRY]: PERMISSION_REGISTRY_FILE_NAME,
|
|
126
127
|
/** @deprecated No longer published. */
|
|
@@ -525,6 +526,218 @@ function createPerformanceTimer(...args) {
|
|
|
525
526
|
);
|
|
526
527
|
}
|
|
527
528
|
|
|
529
|
+
// ../../libs/observability/src/logging/operational-logger.ts
|
|
530
|
+
var LEVEL_RANK = {
|
|
531
|
+
DEBUG: 10,
|
|
532
|
+
INFO: 20,
|
|
533
|
+
WARN: 30,
|
|
534
|
+
ERROR: 40
|
|
535
|
+
};
|
|
536
|
+
var SENSITIVE_KEYS = /* @__PURE__ */ new Set([
|
|
537
|
+
"payload",
|
|
538
|
+
"body",
|
|
539
|
+
"records",
|
|
540
|
+
"items",
|
|
541
|
+
"relationships",
|
|
542
|
+
"token",
|
|
543
|
+
"authorization",
|
|
544
|
+
"secret",
|
|
545
|
+
"password",
|
|
546
|
+
"accesskey",
|
|
547
|
+
"accesskeyid",
|
|
548
|
+
"secretaccesskey",
|
|
549
|
+
"sessiontoken",
|
|
550
|
+
"credentials",
|
|
551
|
+
"cookie",
|
|
552
|
+
"metadata",
|
|
553
|
+
"response",
|
|
554
|
+
"request",
|
|
555
|
+
"attributes",
|
|
556
|
+
"lookupindex",
|
|
557
|
+
"domainfiles",
|
|
558
|
+
"snapshot"
|
|
559
|
+
]);
|
|
560
|
+
var METADATA_LOG_DEFAULTS = {
|
|
561
|
+
SLOW_HTTP_MS: 100,
|
|
562
|
+
SLOW_S3_MS: 500,
|
|
563
|
+
SLOW_REFRESH_MS: 2e3,
|
|
564
|
+
SLOW_LOOKUP_MS: 50,
|
|
565
|
+
SLOW_INIT_MS: 3e3,
|
|
566
|
+
SUMMARY_EVERY: 200
|
|
567
|
+
};
|
|
568
|
+
function resolveMetadataLogPolicy(env = process.env) {
|
|
569
|
+
const verbose = isTruthy(env.METADATA_LOG_VERBOSE);
|
|
570
|
+
const level = verbose ? "DEBUG" : normalizeLevel(env.METADATA_LOG_LEVEL ?? env.LOG_LEVEL) ?? "INFO";
|
|
571
|
+
return {
|
|
572
|
+
level,
|
|
573
|
+
verbose,
|
|
574
|
+
sampleInfo: sampleRate(env.METADATA_LOG_SAMPLE_INFO, 1),
|
|
575
|
+
sampleDebug: sampleRate(env.METADATA_LOG_SAMPLE_DEBUG, 1),
|
|
576
|
+
slowHttpMs: positiveInt(env.METADATA_SLOW_HTTP_MS, METADATA_LOG_DEFAULTS.SLOW_HTTP_MS),
|
|
577
|
+
slowS3Ms: positiveInt(env.METADATA_SLOW_S3_MS, METADATA_LOG_DEFAULTS.SLOW_S3_MS),
|
|
578
|
+
slowRefreshMs: positiveInt(
|
|
579
|
+
env.METADATA_SLOW_REFRESH_MS,
|
|
580
|
+
METADATA_LOG_DEFAULTS.SLOW_REFRESH_MS
|
|
581
|
+
),
|
|
582
|
+
slowLookupMs: positiveInt(
|
|
583
|
+
env.METADATA_SLOW_LOOKUP_MS,
|
|
584
|
+
METADATA_LOG_DEFAULTS.SLOW_LOOKUP_MS
|
|
585
|
+
),
|
|
586
|
+
slowInitMs: positiveInt(env.METADATA_SLOW_INIT_MS, METADATA_LOG_DEFAULTS.SLOW_INIT_MS),
|
|
587
|
+
summaryEvery: nonNegativeInt(
|
|
588
|
+
env.METADATA_LOG_SUMMARY_EVERY,
|
|
589
|
+
METADATA_LOG_DEFAULTS.SUMMARY_EVERY
|
|
590
|
+
)
|
|
591
|
+
};
|
|
592
|
+
}
|
|
593
|
+
function createOperationalLogger(sink, env = process.env) {
|
|
594
|
+
const policy = resolveMetadataLogPolicy(env);
|
|
595
|
+
function enabled(level) {
|
|
596
|
+
return LEVEL_RANK[policy.level] <= LEVEL_RANK[methodLevel(level)];
|
|
597
|
+
}
|
|
598
|
+
function emit(level, event, fields) {
|
|
599
|
+
if (!enabled(level)) {
|
|
600
|
+
return;
|
|
601
|
+
}
|
|
602
|
+
if (level === "info" && !sampled(policy.sampleInfo)) {
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
if (level === "debug" && !sampled(policy.sampleDebug)) {
|
|
606
|
+
return;
|
|
607
|
+
}
|
|
608
|
+
const entry = {
|
|
609
|
+
event,
|
|
610
|
+
...sanitize(resolveFields(fields))
|
|
611
|
+
};
|
|
612
|
+
deliver(sink, level, entry, env);
|
|
613
|
+
}
|
|
614
|
+
return {
|
|
615
|
+
policy,
|
|
616
|
+
isEnabled: enabled,
|
|
617
|
+
debug: (event, fields) => emit("debug", event, fields),
|
|
618
|
+
info: (event, fields) => emit("info", event, fields),
|
|
619
|
+
warn: (event, fields) => emit("warn", event, fields),
|
|
620
|
+
error: (event, fields) => emit("error", event, fields),
|
|
621
|
+
observe(input) {
|
|
622
|
+
const slow = input.durationMs >= input.thresholdMs;
|
|
623
|
+
if (slow) {
|
|
624
|
+
if (!enabled("warn")) {
|
|
625
|
+
return;
|
|
626
|
+
}
|
|
627
|
+
emit("warn", input.event, () => ({
|
|
628
|
+
...resolveFields(input.fields),
|
|
629
|
+
durationMs: input.durationMs,
|
|
630
|
+
thresholdMs: input.thresholdMs,
|
|
631
|
+
slow: true
|
|
632
|
+
}));
|
|
633
|
+
return;
|
|
634
|
+
}
|
|
635
|
+
emit("debug", input.event, () => ({
|
|
636
|
+
...resolveFields(input.fields),
|
|
637
|
+
durationMs: input.durationMs
|
|
638
|
+
}));
|
|
639
|
+
}
|
|
640
|
+
};
|
|
641
|
+
}
|
|
642
|
+
function deliver(sink, level, entry, env) {
|
|
643
|
+
if (level === "debug" && !platformEmits("debug", env)) {
|
|
644
|
+
sink.info({ ...entry, logLevel: "debug" });
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
647
|
+
const method = sink[level];
|
|
648
|
+
if (typeof method === "function") {
|
|
649
|
+
method.call(sink, entry);
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
function platformEmits(level, env) {
|
|
653
|
+
const platform = normalizeLevel(env.LOG_LEVEL) ?? "ERROR";
|
|
654
|
+
return LEVEL_RANK[platform] <= LEVEL_RANK[methodLevel(level)];
|
|
655
|
+
}
|
|
656
|
+
function methodLevel(level) {
|
|
657
|
+
switch (level) {
|
|
658
|
+
case "debug":
|
|
659
|
+
return "DEBUG";
|
|
660
|
+
case "info":
|
|
661
|
+
return "INFO";
|
|
662
|
+
case "warn":
|
|
663
|
+
return "WARN";
|
|
664
|
+
default:
|
|
665
|
+
return "ERROR";
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
function resolveFields(fields) {
|
|
669
|
+
if (!fields) {
|
|
670
|
+
return {};
|
|
671
|
+
}
|
|
672
|
+
return typeof fields === "function" ? fields() : fields;
|
|
673
|
+
}
|
|
674
|
+
function sanitize(fields) {
|
|
675
|
+
const out = {};
|
|
676
|
+
for (const [key, value] of Object.entries(fields)) {
|
|
677
|
+
if (value === void 0 || SENSITIVE_KEYS.has(key.toLowerCase())) {
|
|
678
|
+
continue;
|
|
679
|
+
}
|
|
680
|
+
if (key === "message" && typeof value === "string") {
|
|
681
|
+
if (out.errorMessage === void 0) {
|
|
682
|
+
out.errorMessage = value;
|
|
683
|
+
}
|
|
684
|
+
continue;
|
|
685
|
+
}
|
|
686
|
+
out[key] = value;
|
|
687
|
+
}
|
|
688
|
+
return out;
|
|
689
|
+
}
|
|
690
|
+
function normalizeLevel(value) {
|
|
691
|
+
const upper = (value ?? "").trim().toUpperCase();
|
|
692
|
+
if (upper === "DEBUG" || upper === "INFO" || upper === "WARN" || upper === "ERROR") {
|
|
693
|
+
return upper;
|
|
694
|
+
}
|
|
695
|
+
return void 0;
|
|
696
|
+
}
|
|
697
|
+
function sampleRate(raw, fallback) {
|
|
698
|
+
if (raw == null || raw.trim() === "") {
|
|
699
|
+
return fallback;
|
|
700
|
+
}
|
|
701
|
+
const parsed = Number(raw);
|
|
702
|
+
if (!Number.isFinite(parsed) || parsed < 0) {
|
|
703
|
+
return 0;
|
|
704
|
+
}
|
|
705
|
+
if (parsed > 1) {
|
|
706
|
+
return 1;
|
|
707
|
+
}
|
|
708
|
+
return parsed;
|
|
709
|
+
}
|
|
710
|
+
function sampled(rate) {
|
|
711
|
+
if (rate <= 0) {
|
|
712
|
+
return false;
|
|
713
|
+
}
|
|
714
|
+
if (rate >= 1) {
|
|
715
|
+
return true;
|
|
716
|
+
}
|
|
717
|
+
return Math.random() < rate;
|
|
718
|
+
}
|
|
719
|
+
function positiveInt(raw, fallback) {
|
|
720
|
+
const parsed = Number(raw);
|
|
721
|
+
if (!raw || !Number.isFinite(parsed) || parsed < 0) {
|
|
722
|
+
return fallback;
|
|
723
|
+
}
|
|
724
|
+
return Math.floor(parsed);
|
|
725
|
+
}
|
|
726
|
+
function nonNegativeInt(raw, fallback) {
|
|
727
|
+
if (raw == null || raw.trim() === "") {
|
|
728
|
+
return fallback;
|
|
729
|
+
}
|
|
730
|
+
const parsed = Number(raw);
|
|
731
|
+
if (!Number.isFinite(parsed) || parsed < 0) {
|
|
732
|
+
return fallback;
|
|
733
|
+
}
|
|
734
|
+
return Math.floor(parsed);
|
|
735
|
+
}
|
|
736
|
+
function isTruthy(value) {
|
|
737
|
+
const normalized = (value ?? "").trim().toLowerCase();
|
|
738
|
+
return normalized === "true" || normalized === "1" || normalized === "yes";
|
|
739
|
+
}
|
|
740
|
+
|
|
528
741
|
// ../../libs/utils/src/errors/base.error.ts
|
|
529
742
|
var BaseError = class extends Error {
|
|
530
743
|
statusCode;
|
|
@@ -2454,6 +2667,10 @@ function queryPublishedRelationships(query) {
|
|
|
2454
2667
|
message: "Typed relationship catalog contains a row that cannot be queried"
|
|
2455
2668
|
};
|
|
2456
2669
|
}
|
|
2670
|
+
const unpublished = unpublishedRelationType(query.relations, relationType);
|
|
2671
|
+
if (unpublished) {
|
|
2672
|
+
return { ok: false, ...unpublished };
|
|
2673
|
+
}
|
|
2457
2674
|
const sourceKey = typedRelationEndpointKey(sourceTypeCode, sourceValueCode);
|
|
2458
2675
|
const bucket = typedRelationsForEndpoint(index, direction, sourceKey, status.filter);
|
|
2459
2676
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -2537,6 +2754,34 @@ function optionalCode(value) {
|
|
|
2537
2754
|
}
|
|
2538
2755
|
return value.trim();
|
|
2539
2756
|
}
|
|
2757
|
+
var publishedRelationTypeCache = /* @__PURE__ */ new WeakMap();
|
|
2758
|
+
function publishedRelationTypes(relations) {
|
|
2759
|
+
const cached = publishedRelationTypeCache.get(relations);
|
|
2760
|
+
if (cached) {
|
|
2761
|
+
return cached;
|
|
2762
|
+
}
|
|
2763
|
+
const types = /* @__PURE__ */ new Set();
|
|
2764
|
+
for (const relation of relations) {
|
|
2765
|
+
if (typeof relation.relationType === "string" && relation.relationType.trim()) {
|
|
2766
|
+
types.add(relation.relationType);
|
|
2767
|
+
}
|
|
2768
|
+
}
|
|
2769
|
+
publishedRelationTypeCache.set(relations, types);
|
|
2770
|
+
return types;
|
|
2771
|
+
}
|
|
2772
|
+
function unpublishedRelationType(relations, relationType) {
|
|
2773
|
+
const type = relationType?.trim();
|
|
2774
|
+
if (!type) {
|
|
2775
|
+
return void 0;
|
|
2776
|
+
}
|
|
2777
|
+
if (publishedRelationTypes(relations).has(type)) {
|
|
2778
|
+
return void 0;
|
|
2779
|
+
}
|
|
2780
|
+
return {
|
|
2781
|
+
code: METADATA_RELATION_SEMANTICS_UNSUPPORTED,
|
|
2782
|
+
message: `Relationship type ${type} is not published in typed-relations.json`
|
|
2783
|
+
};
|
|
2784
|
+
}
|
|
2540
2785
|
function resolvePublishedRelationshipQuery(input) {
|
|
2541
2786
|
const validated = validateRelationshipQuery(input);
|
|
2542
2787
|
if (validated) {
|
|
@@ -3449,8 +3694,8 @@ var MetadataLoader = class {
|
|
|
3449
3694
|
)
|
|
3450
3695
|
)
|
|
3451
3696
|
].sort();
|
|
3452
|
-
this.logger
|
|
3453
|
-
|
|
3697
|
+
const logs = createOperationalLogger(this.logger);
|
|
3698
|
+
logs.info(RUNTIME_METADATA_EVENTS.MANIFEST_LOADED, {
|
|
3454
3699
|
releaseId: manifest.releaseId,
|
|
3455
3700
|
revision: manifest.revision,
|
|
3456
3701
|
contentHash: manifest.contentHash,
|
|
@@ -3458,18 +3703,12 @@ var MetadataLoader = class {
|
|
|
3458
3703
|
metadataTypeCount: metadataTypes.length,
|
|
3459
3704
|
lookupIndexSize: Object.keys(manifest.lookupIndex).length
|
|
3460
3705
|
});
|
|
3461
|
-
|
|
3462
|
-
event: RUNTIME_METADATA_EVENTS.PROJECTION_MANIFEST_LOADED,
|
|
3706
|
+
logs.debug(RUNTIME_METADATA_EVENTS.PROJECTION_MANIFEST_LOADED, () => ({
|
|
3463
3707
|
releaseId: manifest.releaseId,
|
|
3464
|
-
metadataTypes,
|
|
3465
|
-
|
|
3466
|
-
lookupIndexSize: Object.keys(manifest.lookupIndex).length,
|
|
3467
|
-
files: manifest.files.map((f) => ({
|
|
3468
|
-
fileName: f.fileName,
|
|
3469
|
-
projectionType: f.projectionType
|
|
3470
|
-
})),
|
|
3708
|
+
metadataTypeCount: metadataTypes.length,
|
|
3709
|
+
lookupIndexTypeCount: lookupIndexTypes.length,
|
|
3471
3710
|
consistent: metadataTypes.length === lookupIndexTypes.length && metadataTypes.every((t) => lookupIndexTypes.includes(t))
|
|
3472
|
-
});
|
|
3711
|
+
}));
|
|
3473
3712
|
return manifest;
|
|
3474
3713
|
}
|
|
3475
3714
|
/**
|
|
@@ -3678,11 +3917,10 @@ var MetadataDownloader = class {
|
|
|
3678
3917
|
const timer = createPerformanceTimer("runtimeMetadata.downloadBootstrap");
|
|
3679
3918
|
const releaseId = manifest.releaseId;
|
|
3680
3919
|
const manifestFileName = PROJECTION_FILE_NAME[PROJECTION_TYPE.MANIFEST];
|
|
3681
|
-
this.logger
|
|
3682
|
-
|
|
3920
|
+
const logs = createOperationalLogger(this.logger);
|
|
3921
|
+
const started = Date.now();
|
|
3922
|
+
logs.debug(RUNTIME_METADATA_EVENTS.DOWNLOAD_START, {
|
|
3683
3923
|
releaseId,
|
|
3684
|
-
revision: releaseId,
|
|
3685
|
-
fileCount: 0,
|
|
3686
3924
|
mode: "bootstrap"
|
|
3687
3925
|
});
|
|
3688
3926
|
try {
|
|
@@ -3716,13 +3954,12 @@ var MetadataDownloader = class {
|
|
|
3716
3954
|
loadedFiles.push(relativePath);
|
|
3717
3955
|
}
|
|
3718
3956
|
} catch (locErr) {
|
|
3719
|
-
|
|
3720
|
-
event: RUNTIME_METADATA_EVENTS.PROJECTION_FILE_SKIPPED,
|
|
3957
|
+
logs.warn(RUNTIME_METADATA_EVENTS.PROJECTION_FILE_SKIPPED, {
|
|
3721
3958
|
releaseId,
|
|
3722
3959
|
locale,
|
|
3723
3960
|
relativePath,
|
|
3724
3961
|
reason: "localizationFileDownloadFailed",
|
|
3725
|
-
|
|
3962
|
+
message: locErr instanceof Error ? locErr.message : String(locErr)
|
|
3726
3963
|
});
|
|
3727
3964
|
}
|
|
3728
3965
|
})
|
|
@@ -3739,21 +3976,21 @@ var MetadataDownloader = class {
|
|
|
3739
3976
|
localization: localization.size > 0 ? localization : void 0,
|
|
3740
3977
|
downloadedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
3741
3978
|
};
|
|
3742
|
-
|
|
3743
|
-
event: RUNTIME_METADATA_EVENTS.DOWNLOAD_COMPLETE,
|
|
3979
|
+
logs.info(RUNTIME_METADATA_EVENTS.DOWNLOAD_COMPLETE, {
|
|
3744
3980
|
releaseId,
|
|
3745
|
-
|
|
3746
|
-
mode: "bootstrap"
|
|
3981
|
+
loadedFileCount: bundle.loadedFiles.length,
|
|
3982
|
+
mode: "bootstrap",
|
|
3983
|
+
durationMs: Date.now() - started
|
|
3747
3984
|
});
|
|
3748
3985
|
timer.end();
|
|
3749
3986
|
return bundle;
|
|
3750
3987
|
} catch (err) {
|
|
3751
3988
|
timer.end();
|
|
3752
|
-
|
|
3753
|
-
event: RUNTIME_METADATA_EVENTS.DOWNLOAD_FAILED,
|
|
3989
|
+
logs.error(RUNTIME_METADATA_EVENTS.DOWNLOAD_FAILED, {
|
|
3754
3990
|
err: err instanceof Error ? err : void 0,
|
|
3755
3991
|
releaseId,
|
|
3756
|
-
mode: "bootstrap"
|
|
3992
|
+
mode: "bootstrap",
|
|
3993
|
+
durationMs: Date.now() - started
|
|
3757
3994
|
});
|
|
3758
3995
|
if (err instanceof ProjectionDownloadError || err instanceof RuntimeMetadataError) {
|
|
3759
3996
|
throw err;
|
|
@@ -3786,21 +4023,19 @@ var MetadataDownloader = class {
|
|
|
3786
4023
|
const integrityByFileName = new Map(
|
|
3787
4024
|
manifest.files.map((f) => [f.fileName, f])
|
|
3788
4025
|
);
|
|
3789
|
-
this.logger
|
|
3790
|
-
|
|
4026
|
+
const logs = createOperationalLogger(this.logger);
|
|
4027
|
+
const started = Date.now();
|
|
4028
|
+
logs.debug(RUNTIME_METADATA_EVENTS.DOWNLOAD_START, {
|
|
3791
4029
|
releaseId,
|
|
3792
|
-
revision: releaseId,
|
|
3793
4030
|
fileCount: uniqueTypeCodes.length,
|
|
3794
|
-
mode: "selective"
|
|
3795
|
-
metadataTypes: uniqueTypeCodes
|
|
4031
|
+
mode: "selective"
|
|
3796
4032
|
});
|
|
3797
4033
|
const results = await Promise.all(
|
|
3798
4034
|
uniqueTypeCodes.map(async (metadataTypeCode) => {
|
|
3799
4035
|
const fileName = projectionFileName(metadataTypeCode);
|
|
3800
4036
|
const entry = integrityByFileName.get(fileName);
|
|
3801
4037
|
if (!entry) {
|
|
3802
|
-
|
|
3803
|
-
event: RUNTIME_METADATA_EVENTS.PROJECTION_FILE_SKIPPED,
|
|
4038
|
+
logs.warn(RUNTIME_METADATA_EVENTS.PROJECTION_FILE_SKIPPED, {
|
|
3804
4039
|
metadataTypeCode,
|
|
3805
4040
|
projectionFile: fileName,
|
|
3806
4041
|
releaseId,
|
|
@@ -3809,14 +4044,6 @@ var MetadataDownloader = class {
|
|
|
3809
4044
|
});
|
|
3810
4045
|
return null;
|
|
3811
4046
|
}
|
|
3812
|
-
this.logger.info({
|
|
3813
|
-
event: RUNTIME_METADATA_EVENTS.PROJECTION_FILE_LOADING,
|
|
3814
|
-
releaseId,
|
|
3815
|
-
metadataType: metadataTypeCode,
|
|
3816
|
-
projectionFile: fileName,
|
|
3817
|
-
projectionType: entry.projectionType,
|
|
3818
|
-
mode: "selective"
|
|
3819
|
-
});
|
|
3820
4047
|
const body = await this.getObjectBody(
|
|
3821
4048
|
this.buildKey(releaseId, fileName)
|
|
3822
4049
|
);
|
|
@@ -3844,31 +4071,21 @@ var MetadataDownloader = class {
|
|
|
3844
4071
|
);
|
|
3845
4072
|
loadedFiles.push(fileName);
|
|
3846
4073
|
domainFiles.set(metadataTypeCode, file);
|
|
3847
|
-
|
|
3848
|
-
this.logger.info({
|
|
3849
|
-
event: RUNTIME_METADATA_EVENTS.PROJECTION_FILE_LOADED,
|
|
4074
|
+
logs.debug(RUNTIME_METADATA_EVENTS.PROJECTION_FILE_LOADED, () => ({
|
|
3850
4075
|
releaseId,
|
|
3851
4076
|
metadataType: metadataTypeCode,
|
|
3852
4077
|
projectionFile: fileName,
|
|
3853
|
-
recordCount,
|
|
3854
|
-
fileEnvelopeMetadataType: file.metadataType,
|
|
4078
|
+
recordCount: typeof file.records === "object" && file.records ? Object.keys(file.records).length : 0,
|
|
3855
4079
|
mode: "selective"
|
|
3856
|
-
});
|
|
3857
|
-
this.logger.info({
|
|
3858
|
-
event: RUNTIME_METADATA_EVENTS.PROJECTION_CACHE_REGISTER,
|
|
3859
|
-
releaseId,
|
|
3860
|
-
metadataType: metadataTypeCode,
|
|
3861
|
-
cacheSize: domainFiles.size,
|
|
3862
|
-
projectionFile: fileName,
|
|
3863
|
-
mode: "selective"
|
|
3864
|
-
});
|
|
4080
|
+
}));
|
|
3865
4081
|
}
|
|
3866
4082
|
const sortedLoadedFiles = loadedFiles.sort((a, b) => a.localeCompare(b));
|
|
3867
|
-
|
|
3868
|
-
event: RUNTIME_METADATA_EVENTS.DOWNLOAD_COMPLETE,
|
|
4083
|
+
logs.info(RUNTIME_METADATA_EVENTS.DOWNLOAD_COMPLETE, {
|
|
3869
4084
|
releaseId,
|
|
3870
|
-
|
|
3871
|
-
|
|
4085
|
+
loadedFileCount: sortedLoadedFiles.length,
|
|
4086
|
+
requested: uniqueTypeCodes.length,
|
|
4087
|
+
mode: "selective",
|
|
4088
|
+
durationMs: Date.now() - started
|
|
3872
4089
|
});
|
|
3873
4090
|
return {
|
|
3874
4091
|
domainFiles,
|
|
@@ -4470,29 +4687,24 @@ var MetadataResolver = class {
|
|
|
4470
4687
|
*/
|
|
4471
4688
|
supportsType(typeCode) {
|
|
4472
4689
|
const requestedType = typeCode?.trim() ?? "";
|
|
4690
|
+
const logs = createOperationalLogger(this.logger);
|
|
4473
4691
|
if (!this.cache.isReady()) {
|
|
4474
|
-
|
|
4475
|
-
event: RUNTIME_METADATA_EVENTS.PROJECTION_PROVIDER_SUPPORTS_TYPE,
|
|
4692
|
+
logs.debug(RUNTIME_METADATA_EVENTS.PROJECTION_PROVIDER_SUPPORTS_TYPE, {
|
|
4476
4693
|
requestedType,
|
|
4477
4694
|
supported: false,
|
|
4478
|
-
availableTypes: [],
|
|
4479
4695
|
reason: "cacheNotReady",
|
|
4480
4696
|
cacheStatus: this.cache.getStatus()
|
|
4481
4697
|
});
|
|
4482
4698
|
return false;
|
|
4483
4699
|
}
|
|
4484
4700
|
const supported = this.resolveMetadataTypeCode(requestedType) !== void 0;
|
|
4485
|
-
|
|
4486
|
-
this.cache.getManifest()?.metadataTypes ?? {}
|
|
4487
|
-
).sort();
|
|
4488
|
-
this.logger.info({
|
|
4489
|
-
event: RUNTIME_METADATA_EVENTS.PROJECTION_PROVIDER_SUPPORTS_TYPE,
|
|
4701
|
+
logs.debug(RUNTIME_METADATA_EVENTS.PROJECTION_PROVIDER_SUPPORTS_TYPE, () => ({
|
|
4490
4702
|
requestedType,
|
|
4491
4703
|
supported,
|
|
4492
|
-
|
|
4704
|
+
availableTypeCount: Object.keys(this.cache.getManifest()?.metadataTypes ?? {}).length,
|
|
4493
4705
|
cacheStatus: this.cache.getStatus(),
|
|
4494
4706
|
releaseId: this.cache.getReleaseId()
|
|
4495
|
-
});
|
|
4707
|
+
}));
|
|
4496
4708
|
return supported;
|
|
4497
4709
|
}
|
|
4498
4710
|
/** MetadataTypeCodes available for resolve (from manifest.metadataTypes). */
|
|
@@ -4558,17 +4770,13 @@ var MetadataResolver = class {
|
|
|
4558
4770
|
requireSupportedType(metadataType) {
|
|
4559
4771
|
const metadataTypeCode = this.resolveMetadataTypeCode(metadataType);
|
|
4560
4772
|
if (!metadataTypeCode) {
|
|
4561
|
-
const availableTypes = Object.keys(
|
|
4562
|
-
this.cache.getManifest()?.metadataTypes ?? {}
|
|
4563
|
-
).sort();
|
|
4564
4773
|
const trimmed = metadataType?.trim() ?? "";
|
|
4565
|
-
this.logger.warn({
|
|
4566
|
-
event: RUNTIME_METADATA_EVENTS.LOOKUP_MISS,
|
|
4774
|
+
createOperationalLogger(this.logger).warn(RUNTIME_METADATA_EVENTS.LOOKUP_MISS, () => ({
|
|
4567
4775
|
metadataType,
|
|
4568
4776
|
metadataTypeCode: trimmed,
|
|
4569
|
-
|
|
4777
|
+
availableTypeCount: Object.keys(this.cache.getManifest()?.metadataTypes ?? {}).length,
|
|
4570
4778
|
message: "Unknown metadata type"
|
|
4571
|
-
});
|
|
4779
|
+
}));
|
|
4572
4780
|
throw new UnknownMetadataTypeError(metadataType);
|
|
4573
4781
|
}
|
|
4574
4782
|
return metadataTypeCode;
|
|
@@ -4589,8 +4797,7 @@ var MetadataResolver = class {
|
|
|
4589
4797
|
requireEntry(metadataTypeCode, code, version) {
|
|
4590
4798
|
const entry = this.lookupEntry(metadataTypeCode, code, version);
|
|
4591
4799
|
if (!entry) {
|
|
4592
|
-
this.logger.warn({
|
|
4593
|
-
event: RUNTIME_METADATA_EVENTS.LOOKUP_MISS,
|
|
4800
|
+
createOperationalLogger(this.logger).warn(RUNTIME_METADATA_EVENTS.LOOKUP_MISS, {
|
|
4594
4801
|
projectionType: metadataTypeCode,
|
|
4595
4802
|
code,
|
|
4596
4803
|
version: version ?? null
|
|
@@ -4667,8 +4874,9 @@ var MetadataRefreshService = class {
|
|
|
4667
4874
|
*/
|
|
4668
4875
|
async initialize(revision) {
|
|
4669
4876
|
const target = revision?.trim() || this.configuredRevision || await this.downloader.discoverLatestRevision();
|
|
4670
|
-
this.logger
|
|
4671
|
-
|
|
4877
|
+
const logs = createOperationalLogger(this.logger);
|
|
4878
|
+
const started = Date.now();
|
|
4879
|
+
logs.debug(RUNTIME_METADATA_EVENTS.INIT_START, {
|
|
4672
4880
|
revision: target
|
|
4673
4881
|
});
|
|
4674
4882
|
try {
|
|
@@ -4676,35 +4884,33 @@ var MetadataRefreshService = class {
|
|
|
4676
4884
|
this.cache.replace(bundle);
|
|
4677
4885
|
this.refreshStatus = REFRESH_STATUS.SUCCEEDED;
|
|
4678
4886
|
this.lastRefreshError = null;
|
|
4679
|
-
const loadedTypes = Object.keys(bundle.manifest.metadataTypes)
|
|
4680
|
-
const
|
|
4681
|
-
|
|
4682
|
-
|
|
4887
|
+
const loadedTypes = Object.keys(bundle.manifest.metadataTypes);
|
|
4888
|
+
const lookupIndexTypes = new Set(
|
|
4889
|
+
Object.keys(bundle.manifest.lookupIndex).map(
|
|
4890
|
+
(key) => key.split(":")[0] ?? key
|
|
4891
|
+
)
|
|
4892
|
+
);
|
|
4893
|
+
logs.info(RUNTIME_METADATA_EVENTS.INIT_COMPLETE, {
|
|
4894
|
+
releaseId: bundle.releaseId,
|
|
4683
4895
|
revision: bundle.releaseId,
|
|
4684
4896
|
contentHash: bundle.manifest.contentHash,
|
|
4685
|
-
|
|
4686
|
-
|
|
4897
|
+
mode: "bootstrap",
|
|
4898
|
+
durationMs: Date.now() - started,
|
|
4899
|
+
loadedFileCount: bundle.loadedFiles.length,
|
|
4900
|
+
metadataTypeCount: loadedTypes.length,
|
|
4901
|
+
domainFileCount: bundle.domainFiles.size,
|
|
4902
|
+
lookupIndexTypeCount: lookupIndexTypes.size
|
|
4687
4903
|
});
|
|
4688
|
-
|
|
4689
|
-
event: RUNTIME_METADATA_EVENTS.RUNTIME_METADATA_INITIALIZED,
|
|
4904
|
+
logs.debug(RUNTIME_METADATA_EVENTS.RUNTIME_METADATA_INITIALIZED, () => ({
|
|
4690
4905
|
releaseId: bundle.releaseId,
|
|
4691
|
-
loadedTypes,
|
|
4692
|
-
domainFileTypes,
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
Object.keys(bundle.manifest.lookupIndex).map(
|
|
4696
|
-
(key) => key.split(":")[0] ?? key
|
|
4697
|
-
)
|
|
4698
|
-
)
|
|
4699
|
-
].sort(),
|
|
4700
|
-
hasMetric: loadedTypes.includes("MetricCode"),
|
|
4701
|
-
metadataTypesMetricEntry: bundle.manifest.metadataTypes["MetricCode"] ?? null
|
|
4702
|
-
});
|
|
4906
|
+
loadedTypes: [...loadedTypes].sort(),
|
|
4907
|
+
domainFileTypes: [...bundle.domainFiles.keys()].sort(),
|
|
4908
|
+
lookupIndexTypeCount: lookupIndexTypes.size
|
|
4909
|
+
}));
|
|
4703
4910
|
} catch (err) {
|
|
4704
4911
|
this.refreshStatus = REFRESH_STATUS.FAILED;
|
|
4705
4912
|
this.lastRefreshError = err instanceof Error ? err.message : String(err);
|
|
4706
|
-
this.logger.error({
|
|
4707
|
-
event: RUNTIME_METADATA_EVENTS.INIT_FAILED,
|
|
4913
|
+
createOperationalLogger(this.logger).error(RUNTIME_METADATA_EVENTS.INIT_FAILED, {
|
|
4708
4914
|
err: err instanceof Error ? err : void 0,
|
|
4709
4915
|
revision: target,
|
|
4710
4916
|
message: this.lastRefreshError
|
|
@@ -4726,8 +4932,8 @@ var MetadataRefreshService = class {
|
|
|
4726
4932
|
async checkAndRefresh(preferredRevision) {
|
|
4727
4933
|
const current = this.cache.getManifest();
|
|
4728
4934
|
const target = preferredRevision?.trim() || this.configuredRevision || await this.downloader.discoverLatestRevision();
|
|
4729
|
-
this.logger
|
|
4730
|
-
|
|
4935
|
+
const logs = createOperationalLogger(this.logger);
|
|
4936
|
+
logs.debug(RUNTIME_METADATA_EVENTS.PERIODIC_CHECK, {
|
|
4731
4937
|
revision: target,
|
|
4732
4938
|
currentRevision: current?.revision ?? null
|
|
4733
4939
|
});
|
|
@@ -4735,11 +4941,10 @@ var MetadataRefreshService = class {
|
|
|
4735
4941
|
const nextManifest = await this.downloader.downloadManifest(target);
|
|
4736
4942
|
const comparison = this.loader.compare(current, nextManifest);
|
|
4737
4943
|
if (!comparison.changed) {
|
|
4738
|
-
|
|
4739
|
-
event: RUNTIME_METADATA_EVENTS.REFRESH_SKIPPED,
|
|
4944
|
+
logs.debug(RUNTIME_METADATA_EVENTS.REFRESH_SKIPPED, {
|
|
4740
4945
|
reason: "unchanged",
|
|
4741
4946
|
revision: target,
|
|
4742
|
-
|
|
4947
|
+
releaseId: nextManifest.releaseId
|
|
4743
4948
|
});
|
|
4744
4949
|
return false;
|
|
4745
4950
|
}
|
|
@@ -4750,8 +4955,7 @@ var MetadataRefreshService = class {
|
|
|
4750
4955
|
if (this.cache.isReady()) {
|
|
4751
4956
|
this.cache.setStatus(CACHE_STATUS.DEGRADED);
|
|
4752
4957
|
}
|
|
4753
|
-
this.logger.error({
|
|
4754
|
-
event: RUNTIME_METADATA_EVENTS.REFRESH_FAILED,
|
|
4958
|
+
createOperationalLogger(this.logger).error(RUNTIME_METADATA_EVENTS.REFRESH_FAILED, {
|
|
4755
4959
|
err: err instanceof Error ? err : void 0,
|
|
4756
4960
|
revision: target,
|
|
4757
4961
|
message: this.lastRefreshError,
|
|
@@ -4795,8 +4999,9 @@ var MetadataRefreshService = class {
|
|
|
4795
4999
|
if (this.cache.isReady()) {
|
|
4796
5000
|
this.cache.setStatus(CACHE_STATUS.REFRESHING);
|
|
4797
5001
|
}
|
|
4798
|
-
this.logger
|
|
4799
|
-
|
|
5002
|
+
const logs = createOperationalLogger(this.logger);
|
|
5003
|
+
const started = Date.now();
|
|
5004
|
+
logs.debug(RUNTIME_METADATA_EVENTS.REFRESH_START, {
|
|
4800
5005
|
revision: revision ?? "current",
|
|
4801
5006
|
reason
|
|
4802
5007
|
});
|
|
@@ -4821,16 +5026,25 @@ var MetadataRefreshService = class {
|
|
|
4821
5026
|
this.cache.replace(bundle);
|
|
4822
5027
|
this.refreshStatus = REFRESH_STATUS.SUCCEEDED;
|
|
4823
5028
|
this.lastRefreshError = null;
|
|
4824
|
-
|
|
4825
|
-
|
|
5029
|
+
const durationMs = Date.now() - started;
|
|
5030
|
+
logs.info(RUNTIME_METADATA_EVENTS.REFRESH_COMPLETE, {
|
|
4826
5031
|
revision: bundle.releaseId,
|
|
4827
5032
|
oldReleaseId: previousReleaseId,
|
|
4828
5033
|
newReleaseId: bundle.releaseId,
|
|
4829
|
-
|
|
5034
|
+
releaseId: bundle.releaseId,
|
|
4830
5035
|
reason,
|
|
4831
5036
|
mode: previousTypes.length > 0 ? "snapshot" : "bootstrap",
|
|
4832
|
-
|
|
5037
|
+
retainedDomainCount: previousTypes.length,
|
|
5038
|
+
durationMs
|
|
4833
5039
|
});
|
|
5040
|
+
if (durationMs >= logs.policy.slowRefreshMs) {
|
|
5041
|
+
logs.warn("runtimeMetadata.refresh.slow", {
|
|
5042
|
+
releaseId: bundle.releaseId,
|
|
5043
|
+
durationMs,
|
|
5044
|
+
thresholdMs: logs.policy.slowRefreshMs,
|
|
5045
|
+
reason
|
|
5046
|
+
});
|
|
5047
|
+
}
|
|
4834
5048
|
return true;
|
|
4835
5049
|
} catch (err) {
|
|
4836
5050
|
this.refreshStatus = REFRESH_STATUS.FAILED;
|
|
@@ -4840,13 +5054,13 @@ var MetadataRefreshService = class {
|
|
|
4840
5054
|
} else if (previousStatus !== CACHE_STATUS.REFRESHING) {
|
|
4841
5055
|
this.cache.setStatus(previousStatus);
|
|
4842
5056
|
}
|
|
4843
|
-
|
|
4844
|
-
event: RUNTIME_METADATA_EVENTS.REFRESH_FAILED,
|
|
5057
|
+
logs.error(RUNTIME_METADATA_EVENTS.REFRESH_FAILED, {
|
|
4845
5058
|
err: err instanceof Error ? err : void 0,
|
|
4846
5059
|
revision: revision ?? "current",
|
|
4847
5060
|
reason,
|
|
4848
5061
|
message: this.lastRefreshError,
|
|
4849
|
-
retainedCache: this.cache.isReady()
|
|
5062
|
+
retainedCache: this.cache.isReady(),
|
|
5063
|
+
durationMs: Date.now() - started
|
|
4850
5064
|
});
|
|
4851
5065
|
return false;
|
|
4852
5066
|
}
|
|
@@ -4963,6 +5177,7 @@ var METADATA_RELATION_DIRECTION = {
|
|
|
4963
5177
|
INCOMING: "INCOMING"
|
|
4964
5178
|
};
|
|
4965
5179
|
var METADATA_ATTRIBUTE_FILTER_KEY = PUBLISHED_VALUE_ATTRIBUTE_FILTER_KEY;
|
|
5180
|
+
var RELATIONSHIP_QUERY_BATCH_LIMIT = 100;
|
|
4966
5181
|
function supportsMetadataDiscovery(provider) {
|
|
4967
5182
|
const candidate = provider;
|
|
4968
5183
|
return typeof candidate.listValuesByType === "function" && typeof candidate.getRelationships === "function" && typeof candidate.listValuesByTypes === "function";
|
|
@@ -5028,6 +5243,12 @@ var ExtensionMetadataProvider = class {
|
|
|
5028
5243
|
requestTimeoutMs;
|
|
5029
5244
|
logger;
|
|
5030
5245
|
lifecycleSupport;
|
|
5246
|
+
/** Last release observed in READY state. Not a time-based cache. */
|
|
5247
|
+
verifiedFreshReleaseId = null;
|
|
5248
|
+
readinessCheckCount = 0;
|
|
5249
|
+
relationshipRequestCount = 0;
|
|
5250
|
+
pendingRelationships = [];
|
|
5251
|
+
relationshipFlushScheduled = false;
|
|
5031
5252
|
fetchImpl;
|
|
5032
5253
|
constructor(options) {
|
|
5033
5254
|
this.baseUrl = options.baseUrl.replace(/\/+$/, "");
|
|
@@ -5054,12 +5275,11 @@ var ExtensionMetadataProvider = class {
|
|
|
5054
5275
|
try {
|
|
5055
5276
|
const status = await this.getStatus();
|
|
5056
5277
|
if (isServingState(status.state) && status.releaseId) {
|
|
5057
|
-
this.logger.
|
|
5058
|
-
event: "templates.performance",
|
|
5059
|
-
phase: "metadataExtension.ready",
|
|
5278
|
+
createOperationalLogger(this.logger).debug("metadataExtension.ready", {
|
|
5060
5279
|
durationMs: Date.now() - started,
|
|
5061
5280
|
attempts,
|
|
5062
|
-
state: status.state
|
|
5281
|
+
state: status.state,
|
|
5282
|
+
releaseId: status.releaseId
|
|
5063
5283
|
});
|
|
5064
5284
|
return status;
|
|
5065
5285
|
}
|
|
@@ -5081,9 +5301,7 @@ var ExtensionMetadataProvider = class {
|
|
|
5081
5301
|
const unreachable = lastError instanceof MetadataProjectionUnavailableError && lastError.metadata?.unreachable === true;
|
|
5082
5302
|
const timedOut = detail.includes("timed out");
|
|
5083
5303
|
const reason = timedOut ? "Metadata extension readiness timed out" : unreachable ? "Metadata extension connection was refused" : "Metadata extension did not become ready";
|
|
5084
|
-
this.logger.warn({
|
|
5085
|
-
event: "templates.performance",
|
|
5086
|
-
phase: "metadataExtension.ready",
|
|
5304
|
+
createOperationalLogger(this.logger).warn("metadataExtension.ready", {
|
|
5087
5305
|
durationMs: Date.now() - started,
|
|
5088
5306
|
attempts,
|
|
5089
5307
|
outcome: "unavailable",
|
|
@@ -5104,13 +5322,21 @@ var ExtensionMetadataProvider = class {
|
|
|
5104
5322
|
);
|
|
5105
5323
|
}
|
|
5106
5324
|
async getStatus() {
|
|
5325
|
+
this.readinessCheckCount += 1;
|
|
5107
5326
|
const body = await this.requestJson(
|
|
5108
5327
|
"GET",
|
|
5109
5328
|
"/v1/status"
|
|
5110
5329
|
);
|
|
5330
|
+
const state = body.state ?? "UNKNOWN";
|
|
5331
|
+
const releaseId = body.releaseId ?? null;
|
|
5332
|
+
if (isFreshProjectionState(state) && releaseId) {
|
|
5333
|
+
this.verifiedFreshReleaseId = releaseId;
|
|
5334
|
+
} else {
|
|
5335
|
+
this.verifiedFreshReleaseId = null;
|
|
5336
|
+
}
|
|
5111
5337
|
return {
|
|
5112
|
-
state
|
|
5113
|
-
releaseId
|
|
5338
|
+
state,
|
|
5339
|
+
releaseId,
|
|
5114
5340
|
lastError: body.lastError ?? null,
|
|
5115
5341
|
loadedAt: body.loadedAt ?? null,
|
|
5116
5342
|
lastRefreshAttemptAt: body.lastRefreshAttemptAt ?? null,
|
|
@@ -5247,7 +5473,7 @@ var ExtensionMetadataProvider = class {
|
|
|
5247
5473
|
}
|
|
5248
5474
|
}
|
|
5249
5475
|
async listValuesByType(typeCode, options) {
|
|
5250
|
-
await this.assertDiscoveryPolicy(options?.readPolicy);
|
|
5476
|
+
await this.assertDiscoveryPolicy(options?.readPolicy, options?.releaseId);
|
|
5251
5477
|
const filter = await this.assertQueryLifecycle("values", { status: options?.status });
|
|
5252
5478
|
const body = await this.requestJson("GET", `/v1/metadata/types/${encodeURIComponent(typeCode)}/values${discoveryQuery(options)}`);
|
|
5253
5479
|
const items = Array.isArray(body.items) ? body.items : [];
|
|
@@ -5258,7 +5484,7 @@ var ExtensionMetadataProvider = class {
|
|
|
5258
5484
|
};
|
|
5259
5485
|
}
|
|
5260
5486
|
async listValuesByTypes(typeCodes, options) {
|
|
5261
|
-
await this.assertDiscoveryPolicy(options?.readPolicy);
|
|
5487
|
+
await this.assertDiscoveryPolicy(options?.readPolicy, options?.releaseId);
|
|
5262
5488
|
const filter = await this.assertQueryLifecycle("values", { status: options?.status });
|
|
5263
5489
|
const body = await this.requestJson(
|
|
5264
5490
|
"POST",
|
|
@@ -5277,20 +5503,31 @@ var ExtensionMetadataProvider = class {
|
|
|
5277
5503
|
};
|
|
5278
5504
|
}
|
|
5279
5505
|
async getRelationships(query) {
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5506
|
+
return new Promise((resolve, reject) => {
|
|
5507
|
+
this.pendingRelationships.push({ query, resolve, reject });
|
|
5508
|
+
this.scheduleRelationshipFlush();
|
|
5509
|
+
});
|
|
5510
|
+
}
|
|
5511
|
+
/**
|
|
5512
|
+
* One or more extension requests, chunked at {@link RELATIONSHIP_QUERY_BATCH_LIMIT}.
|
|
5513
|
+
* A single query uses the single-query route. Several queries use the batch route.
|
|
5514
|
+
*/
|
|
5515
|
+
async queryRelationships(queries) {
|
|
5516
|
+
if (queries.length === 0) {
|
|
5517
|
+
return [];
|
|
5518
|
+
}
|
|
5519
|
+
const outcomes = await this.executeRelationshipGroup(queries);
|
|
5520
|
+
return outcomes.map((outcome) => {
|
|
5521
|
+
if (!outcome.ok) {
|
|
5522
|
+
throw outcome.error;
|
|
5523
|
+
}
|
|
5524
|
+
return outcome.result;
|
|
5525
|
+
});
|
|
5526
|
+
}
|
|
5527
|
+
getPerformanceCounters() {
|
|
5287
5528
|
return {
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
relationships: lifecycleRows(
|
|
5291
|
-
Array.isArray(body.relationships) ? body.relationships : [],
|
|
5292
|
-
filter
|
|
5293
|
-
)
|
|
5529
|
+
readinessCheckCount: this.readinessCheckCount,
|
|
5530
|
+
relationshipRequestCount: this.relationshipRequestCount
|
|
5294
5531
|
};
|
|
5295
5532
|
}
|
|
5296
5533
|
async listRelations(query) {
|
|
@@ -5410,6 +5647,7 @@ var ExtensionMetadataProvider = class {
|
|
|
5410
5647
|
}
|
|
5411
5648
|
async requestRefresh(releaseId) {
|
|
5412
5649
|
this.lifecycleSupport = void 0;
|
|
5650
|
+
this.verifiedFreshReleaseId = null;
|
|
5413
5651
|
const body = await this.requestJson(
|
|
5414
5652
|
"POST",
|
|
5415
5653
|
"/v1/refresh",
|
|
@@ -5479,12 +5717,228 @@ var ExtensionMetadataProvider = class {
|
|
|
5479
5717
|
}
|
|
5480
5718
|
};
|
|
5481
5719
|
}
|
|
5482
|
-
async assertDiscoveryPolicy(readPolicy) {
|
|
5720
|
+
async assertDiscoveryPolicy(readPolicy, releaseId) {
|
|
5483
5721
|
if (readPolicy !== "REQUIRE_FRESH") {
|
|
5484
5722
|
return;
|
|
5485
5723
|
}
|
|
5724
|
+
if (releaseId && this.verifiedFreshReleaseId === releaseId) {
|
|
5725
|
+
return;
|
|
5726
|
+
}
|
|
5486
5727
|
const status = await this.getStatus();
|
|
5487
5728
|
assertMetadataReadPolicy(readPolicy, status.state, status.releaseId);
|
|
5729
|
+
assertReleasePin(releaseId, status.releaseId);
|
|
5730
|
+
}
|
|
5731
|
+
scheduleRelationshipFlush() {
|
|
5732
|
+
if (this.relationshipFlushScheduled) {
|
|
5733
|
+
return;
|
|
5734
|
+
}
|
|
5735
|
+
this.relationshipFlushScheduled = true;
|
|
5736
|
+
queueMicrotask(() => {
|
|
5737
|
+
this.relationshipFlushScheduled = false;
|
|
5738
|
+
const pending = this.pendingRelationships;
|
|
5739
|
+
this.pendingRelationships = [];
|
|
5740
|
+
void this.flushRelationships(pending);
|
|
5741
|
+
});
|
|
5742
|
+
}
|
|
5743
|
+
async flushRelationships(pending) {
|
|
5744
|
+
if (pending.length === 0) {
|
|
5745
|
+
return;
|
|
5746
|
+
}
|
|
5747
|
+
const groups = /* @__PURE__ */ new Map();
|
|
5748
|
+
for (const item of pending) {
|
|
5749
|
+
const key = `${item.query.readPolicy ?? ""}\0${item.query.releaseId ?? ""}`;
|
|
5750
|
+
const group = groups.get(key) ?? [];
|
|
5751
|
+
group.push(item);
|
|
5752
|
+
groups.set(key, group);
|
|
5753
|
+
}
|
|
5754
|
+
await Promise.all(
|
|
5755
|
+
[...groups.values()].map((group) => this.flushRelationshipGroup(group))
|
|
5756
|
+
);
|
|
5757
|
+
}
|
|
5758
|
+
async flushRelationshipGroup(group) {
|
|
5759
|
+
try {
|
|
5760
|
+
const outcomes = await this.executeRelationshipGroup(group.map((item) => item.query));
|
|
5761
|
+
group.forEach((item, index) => {
|
|
5762
|
+
const outcome = outcomes[index];
|
|
5763
|
+
if (!outcome?.ok) {
|
|
5764
|
+
item.reject(
|
|
5765
|
+
outcome?.error ?? new MetadataDiscoveryError("Metadata relationship batch returned no result")
|
|
5766
|
+
);
|
|
5767
|
+
return;
|
|
5768
|
+
}
|
|
5769
|
+
item.resolve(outcome.result);
|
|
5770
|
+
});
|
|
5771
|
+
} catch (error) {
|
|
5772
|
+
if (error instanceof MetadataFreshnessError || error instanceof MetadataReleaseMismatchError) {
|
|
5773
|
+
this.verifiedFreshReleaseId = null;
|
|
5774
|
+
}
|
|
5775
|
+
for (const item of group) {
|
|
5776
|
+
item.reject(error);
|
|
5777
|
+
}
|
|
5778
|
+
}
|
|
5779
|
+
}
|
|
5780
|
+
async executeRelationshipGroup(queries) {
|
|
5781
|
+
const prepared = [];
|
|
5782
|
+
for (const query of queries) {
|
|
5783
|
+
try {
|
|
5784
|
+
prepared.push({
|
|
5785
|
+
filter: await this.assertQueryLifecycle("relations", { status: query.status })
|
|
5786
|
+
});
|
|
5787
|
+
} catch (error) {
|
|
5788
|
+
prepared.push({ error });
|
|
5789
|
+
}
|
|
5790
|
+
}
|
|
5791
|
+
const runnableIndexes = prepared.flatMap(
|
|
5792
|
+
(item, index) => "filter" in item ? [index] : []
|
|
5793
|
+
);
|
|
5794
|
+
const outcomes = prepared.map(
|
|
5795
|
+
(item) => "error" in item ? { ok: false, error: item.error } : {
|
|
5796
|
+
ok: false,
|
|
5797
|
+
error: new MetadataDiscoveryError("Metadata relationship batch returned no result")
|
|
5798
|
+
}
|
|
5799
|
+
);
|
|
5800
|
+
try {
|
|
5801
|
+
if (runnableIndexes.length === 0) {
|
|
5802
|
+
return outcomes;
|
|
5803
|
+
}
|
|
5804
|
+
const runnable = runnableIndexes.map((index) => queries[index]);
|
|
5805
|
+
const raw = await this.fetchRelationships(runnable);
|
|
5806
|
+
runnableIndexes.forEach((queryIndex, rawIndex) => {
|
|
5807
|
+
const fetched = raw[rawIndex];
|
|
5808
|
+
const filter = prepared[queryIndex];
|
|
5809
|
+
if (!fetched || !filter || !("filter" in filter)) {
|
|
5810
|
+
outcomes[queryIndex] = {
|
|
5811
|
+
ok: false,
|
|
5812
|
+
error: new MetadataDiscoveryError("Metadata relationship batch returned no result")
|
|
5813
|
+
};
|
|
5814
|
+
return;
|
|
5815
|
+
}
|
|
5816
|
+
if (fetched.error) {
|
|
5817
|
+
outcomes[queryIndex] = { ok: false, error: fetched.error };
|
|
5818
|
+
return;
|
|
5819
|
+
}
|
|
5820
|
+
try {
|
|
5821
|
+
outcomes[queryIndex] = {
|
|
5822
|
+
ok: true,
|
|
5823
|
+
result: {
|
|
5824
|
+
releaseId: fetched.releaseId,
|
|
5825
|
+
supported: fetched.supported,
|
|
5826
|
+
relationships: lifecycleRows(fetched.relationships, filter.filter)
|
|
5827
|
+
}
|
|
5828
|
+
};
|
|
5829
|
+
} catch (error) {
|
|
5830
|
+
outcomes[queryIndex] = { ok: false, error };
|
|
5831
|
+
}
|
|
5832
|
+
});
|
|
5833
|
+
return outcomes;
|
|
5834
|
+
} catch (error) {
|
|
5835
|
+
if (error instanceof MetadataFreshnessError || error instanceof MetadataReleaseMismatchError) {
|
|
5836
|
+
this.verifiedFreshReleaseId = null;
|
|
5837
|
+
}
|
|
5838
|
+
for (const queryIndex of runnableIndexes) {
|
|
5839
|
+
outcomes[queryIndex] = { ok: false, error };
|
|
5840
|
+
}
|
|
5841
|
+
return outcomes;
|
|
5842
|
+
}
|
|
5843
|
+
}
|
|
5844
|
+
async fetchRelationships(queries) {
|
|
5845
|
+
if (queries.length === 0) {
|
|
5846
|
+
return [];
|
|
5847
|
+
}
|
|
5848
|
+
if (queries.length === 1) {
|
|
5849
|
+
return [await this.settleSingleRelationship(queries[0])];
|
|
5850
|
+
}
|
|
5851
|
+
const fetched = [];
|
|
5852
|
+
for (let offset = 0; offset < queries.length; offset += RELATIONSHIP_QUERY_BATCH_LIMIT) {
|
|
5853
|
+
const chunk = queries.slice(offset, offset + RELATIONSHIP_QUERY_BATCH_LIMIT);
|
|
5854
|
+
if (chunk.length === 1) {
|
|
5855
|
+
fetched.push(await this.settleSingleRelationship(chunk[0]));
|
|
5856
|
+
continue;
|
|
5857
|
+
}
|
|
5858
|
+
fetched.push(...await this.postRelationshipBatch(chunk));
|
|
5859
|
+
}
|
|
5860
|
+
return fetched;
|
|
5861
|
+
}
|
|
5862
|
+
async settleSingleRelationship(query) {
|
|
5863
|
+
try {
|
|
5864
|
+
return await this.postSingleRelationship(query);
|
|
5865
|
+
} catch (error) {
|
|
5866
|
+
if (error instanceof MetadataFreshnessError || error instanceof MetadataReleaseMismatchError || error instanceof MetadataProjectionUnavailableError || error instanceof MetadataExtensionContractError) {
|
|
5867
|
+
throw error;
|
|
5868
|
+
}
|
|
5869
|
+
return {
|
|
5870
|
+
releaseId: null,
|
|
5871
|
+
supported: false,
|
|
5872
|
+
relationships: [],
|
|
5873
|
+
error
|
|
5874
|
+
};
|
|
5875
|
+
}
|
|
5876
|
+
}
|
|
5877
|
+
async postSingleRelationship(query) {
|
|
5878
|
+
this.relationshipRequestCount += 1;
|
|
5879
|
+
const body = await this.requestJson(
|
|
5880
|
+
"POST",
|
|
5881
|
+
"/v1/metadata/relationships/query",
|
|
5882
|
+
query
|
|
5883
|
+
);
|
|
5884
|
+
return {
|
|
5885
|
+
releaseId: body.releaseId ?? null,
|
|
5886
|
+
supported: body.supported === true,
|
|
5887
|
+
relationships: Array.isArray(body.relationships) ? body.relationships : []
|
|
5888
|
+
};
|
|
5889
|
+
}
|
|
5890
|
+
async postRelationshipBatch(queries) {
|
|
5891
|
+
const readPolicy = queries.some((query) => query.readPolicy === "REQUIRE_FRESH") ? "REQUIRE_FRESH" : queries[0]?.readPolicy;
|
|
5892
|
+
const releaseId = queries.find((query) => query.releaseId)?.releaseId;
|
|
5893
|
+
this.relationshipRequestCount += 1;
|
|
5894
|
+
const body = await this.requestJson("POST", "/v1/metadata/relationships/batch", {
|
|
5895
|
+
releaseId,
|
|
5896
|
+
readPolicy,
|
|
5897
|
+
queries: queries.map((query) => ({
|
|
5898
|
+
sourceTypeCode: query.sourceTypeCode,
|
|
5899
|
+
sourceValueCode: query.sourceValueCode,
|
|
5900
|
+
targetTypeCode: query.targetTypeCode,
|
|
5901
|
+
relationType: query.relationType,
|
|
5902
|
+
direction: query.direction,
|
|
5903
|
+
status: query.status,
|
|
5904
|
+
releaseId: query.releaseId
|
|
5905
|
+
}))
|
|
5906
|
+
});
|
|
5907
|
+
const results = Array.isArray(body.results) ? body.results : [];
|
|
5908
|
+
if (results.length !== queries.length) {
|
|
5909
|
+
throw new MetadataDiscoveryError(
|
|
5910
|
+
"Metadata relationship batch did not return one result per query"
|
|
5911
|
+
);
|
|
5912
|
+
}
|
|
5913
|
+
return results.map((item, index) => {
|
|
5914
|
+
if (item.errorCode === "METADATA_RELEASE_MISMATCH") {
|
|
5915
|
+
return {
|
|
5916
|
+
releaseId: body.releaseId ?? null,
|
|
5917
|
+
supported: false,
|
|
5918
|
+
relationships: [],
|
|
5919
|
+
error: new MetadataReleaseMismatchError(
|
|
5920
|
+
queries[index]?.releaseId ?? "",
|
|
5921
|
+
body.releaseId ?? null
|
|
5922
|
+
)
|
|
5923
|
+
};
|
|
5924
|
+
}
|
|
5925
|
+
if (item.errorCode) {
|
|
5926
|
+
return {
|
|
5927
|
+
releaseId: body.releaseId ?? null,
|
|
5928
|
+
supported: false,
|
|
5929
|
+
relationships: [],
|
|
5930
|
+
error: new MetadataDiscoveryError(
|
|
5931
|
+
item.message ?? "Metadata relationship query failed",
|
|
5932
|
+
item.errorCode
|
|
5933
|
+
)
|
|
5934
|
+
};
|
|
5935
|
+
}
|
|
5936
|
+
return {
|
|
5937
|
+
releaseId: body.releaseId ?? null,
|
|
5938
|
+
supported: item.supported === true,
|
|
5939
|
+
relationships: Array.isArray(item.relationships) ? item.relationships : []
|
|
5940
|
+
};
|
|
5941
|
+
});
|
|
5488
5942
|
}
|
|
5489
5943
|
async requestJson(method, path, payload) {
|
|
5490
5944
|
const started = Date.now();
|
|
@@ -5519,12 +5973,14 @@ var ExtensionMetadataProvider = class {
|
|
|
5519
5973
|
);
|
|
5520
5974
|
}
|
|
5521
5975
|
if (code === "METADATA_FRESHNESS_NOT_SATISFIED") {
|
|
5976
|
+
this.verifiedFreshReleaseId = null;
|
|
5522
5977
|
throw new MetadataFreshnessError(
|
|
5523
5978
|
errorBody.state ?? "UNKNOWN",
|
|
5524
5979
|
errorBody.releaseId ?? null
|
|
5525
5980
|
);
|
|
5526
5981
|
}
|
|
5527
5982
|
if (code === "METADATA_RELEASE_MISMATCH") {
|
|
5983
|
+
this.verifiedFreshReleaseId = null;
|
|
5528
5984
|
throw new MetadataReleaseMismatchError(
|
|
5529
5985
|
errorBody.requestedReleaseId ?? "",
|
|
5530
5986
|
errorBody.actualReleaseId ?? errorBody.releaseId ?? null
|
|
@@ -5567,11 +6023,10 @@ var ExtensionMetadataProvider = class {
|
|
|
5567
6023
|
throw err;
|
|
5568
6024
|
}
|
|
5569
6025
|
const aborted = err.name === "AbortError";
|
|
5570
|
-
this.logger.warn({
|
|
5571
|
-
event: "runtimeMetadata.extension.requestFailed",
|
|
6026
|
+
createOperationalLogger(this.logger).warn("runtimeMetadata.extension.requestFailed", {
|
|
5572
6027
|
path,
|
|
5573
6028
|
aborted,
|
|
5574
|
-
|
|
6029
|
+
message: err instanceof Error ? err.message : String(err)
|
|
5575
6030
|
});
|
|
5576
6031
|
throw new MetadataProjectionUnavailableError(
|
|
5577
6032
|
aborted ? "Metadata extension request timed out" : "Metadata extension is unavailable",
|
|
@@ -5911,8 +6366,7 @@ var ProviderFailoverCoordinator = class {
|
|
|
5911
6366
|
}
|
|
5912
6367
|
this.state = PROVIDER_TRANSPORT_STATE.EXTENSION_UNAVAILABLE;
|
|
5913
6368
|
this.lastProbeAt = this.now();
|
|
5914
|
-
this.logger.warn({
|
|
5915
|
-
event: RUNTIME_METADATA_EVENTS.PROVIDER_FALLBACK,
|
|
6369
|
+
createOperationalLogger(this.logger).warn(RUNTIME_METADATA_EVENTS.PROVIDER_FALLBACK, {
|
|
5916
6370
|
reason,
|
|
5917
6371
|
fallback: METADATA_PROVIDER_KIND.S3,
|
|
5918
6372
|
recoverable: true
|
|
@@ -5926,8 +6380,7 @@ var ProviderFailoverCoordinator = class {
|
|
|
5926
6380
|
const status = await this.extension.getStatus();
|
|
5927
6381
|
if (isExtensionServing(status)) {
|
|
5928
6382
|
this.state = PROVIDER_TRANSPORT_STATE.EXTENSION_READY;
|
|
5929
|
-
this.logger.info({
|
|
5930
|
-
event: RUNTIME_METADATA_EVENTS.PROVIDER_RECOVERED,
|
|
6383
|
+
createOperationalLogger(this.logger).info(RUNTIME_METADATA_EVENTS.PROVIDER_RECOVERED, {
|
|
5931
6384
|
releaseId: status.releaseId,
|
|
5932
6385
|
extensionState: status.state
|
|
5933
6386
|
});
|
|
@@ -6084,10 +6537,8 @@ var S3MetadataProvider = class {
|
|
|
6084
6537
|
options
|
|
6085
6538
|
);
|
|
6086
6539
|
const values = groups[0]?.values ?? [];
|
|
6087
|
-
this.logger.
|
|
6088
|
-
event: "runtimeMetadata.related.lookup",
|
|
6540
|
+
createOperationalLogger(this.logger).debug("runtimeMetadata.related.lookup", {
|
|
6089
6541
|
sourceTypeCode,
|
|
6090
|
-
sourceValueCode,
|
|
6091
6542
|
targetTypeCode,
|
|
6092
6543
|
count: values.length
|
|
6093
6544
|
});
|
|
@@ -6118,41 +6569,18 @@ var S3MetadataProvider = class {
|
|
|
6118
6569
|
options
|
|
6119
6570
|
);
|
|
6120
6571
|
}
|
|
6121
|
-
const
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
targetTypeCode
|
|
6129
|
-
);
|
|
6130
|
-
if (codes.length === 0) {
|
|
6131
|
-
codes.push(
|
|
6132
|
-
...relatedValueCodesFromEntry(
|
|
6133
|
-
this.resolver,
|
|
6134
|
-
sourceTypeCode,
|
|
6135
|
-
sourceValueCode,
|
|
6136
|
-
targetTypeCode
|
|
6137
|
-
)
|
|
6138
|
-
);
|
|
6139
|
-
}
|
|
6140
|
-
const values = [];
|
|
6141
|
-
for (const valueCode of codes) {
|
|
6142
|
-
const value = await this.getValue(targetTypeCode, valueCode, options);
|
|
6143
|
-
if (value) {
|
|
6144
|
-
values.push(value);
|
|
6145
|
-
}
|
|
6146
|
-
}
|
|
6147
|
-
groups.push({ sourceValueCode, values });
|
|
6148
|
-
}
|
|
6149
|
-
this.logger.info({
|
|
6150
|
-
event: "runtimeMetadata.related.batch",
|
|
6572
|
+
const groups = await this.relatedGroupsFromAdjacency(
|
|
6573
|
+
sourceTypeCode,
|
|
6574
|
+
sourceValueCodes,
|
|
6575
|
+
targetTypeCode,
|
|
6576
|
+
options
|
|
6577
|
+
);
|
|
6578
|
+
createOperationalLogger(this.logger).debug("runtimeMetadata.related.batch", () => ({
|
|
6151
6579
|
sourceTypeCode,
|
|
6152
6580
|
targetTypeCode,
|
|
6153
6581
|
sources: sourceValueCodes.length,
|
|
6154
6582
|
count: groups.reduce((sum, group) => sum + group.values.length, 0)
|
|
6155
|
-
});
|
|
6583
|
+
}));
|
|
6156
6584
|
return groups;
|
|
6157
6585
|
}
|
|
6158
6586
|
async listTypeValues(typeCode, options) {
|
|
@@ -6408,16 +6836,6 @@ var S3MetadataProvider = class {
|
|
|
6408
6836
|
sourceValueCode,
|
|
6409
6837
|
targetTypeCode
|
|
6410
6838
|
);
|
|
6411
|
-
if (codes.length === 0) {
|
|
6412
|
-
codes.push(
|
|
6413
|
-
...relatedValueCodesFromEntry(
|
|
6414
|
-
this.resolver,
|
|
6415
|
-
sourceTypeCode,
|
|
6416
|
-
sourceValueCode,
|
|
6417
|
-
targetTypeCode
|
|
6418
|
-
)
|
|
6419
|
-
);
|
|
6420
|
-
}
|
|
6421
6839
|
const values = [];
|
|
6422
6840
|
for (const valueCode of codes) {
|
|
6423
6841
|
const value = await this.getValue(targetTypeCode, valueCode, {
|
|
@@ -6468,14 +6886,6 @@ function typeCatalogFromProjection(typeCode, file, common) {
|
|
|
6468
6886
|
status: ""
|
|
6469
6887
|
};
|
|
6470
6888
|
}
|
|
6471
|
-
function relatedValueCodesFromEntry(resolver, sourceTypeCode, sourceValueCode, targetTypeCode) {
|
|
6472
|
-
try {
|
|
6473
|
-
const entry = resolver.resolve(sourceTypeCode, sourceValueCode);
|
|
6474
|
-
return (entry.relationships ?? []).filter((rel) => rel.targetMetadataTypeCode === targetTypeCode).map((rel) => rel.targetValueCode);
|
|
6475
|
-
} catch {
|
|
6476
|
-
return [];
|
|
6477
|
-
}
|
|
6478
|
-
}
|
|
6479
6889
|
|
|
6480
6890
|
// ../../libs/runtime-metadata/src/lib/services/RuntimeMetadataService.ts
|
|
6481
6891
|
var RuntimeMetadataService = class {
|
|
@@ -6578,8 +6988,7 @@ var RuntimeMetadataService = class {
|
|
|
6578
6988
|
);
|
|
6579
6989
|
}
|
|
6580
6990
|
});
|
|
6581
|
-
this.logger.info({
|
|
6582
|
-
event: RUNTIME_METADATA_EVENTS.PROVIDER_SELECTED,
|
|
6991
|
+
createOperationalLogger(this.logger).info(RUNTIME_METADATA_EVENTS.PROVIDER_SELECTED, {
|
|
6583
6992
|
kind: this.metadataProviderKind,
|
|
6584
6993
|
hasFallback: Boolean(this.metadataProviderFallback)
|
|
6585
6994
|
});
|
|
@@ -6599,25 +7008,38 @@ var RuntimeMetadataService = class {
|
|
|
6599
7008
|
await this.initializeInFlight;
|
|
6600
7009
|
}
|
|
6601
7010
|
async initializeInternal(revision) {
|
|
7011
|
+
const started = Date.now();
|
|
7012
|
+
const logs = createOperationalLogger(this.logger);
|
|
6602
7013
|
if (this.usesExtensionTransport()) {
|
|
6603
|
-
|
|
6604
|
-
event: RUNTIME_METADATA_EVENTS.INIT_START,
|
|
7014
|
+
logs.debug(RUNTIME_METADATA_EVENTS.INIT_START, {
|
|
6605
7015
|
transport: "extension"
|
|
6606
7016
|
});
|
|
6607
7017
|
const ready = await this.initializeFromExtension();
|
|
6608
7018
|
if (ready) {
|
|
6609
|
-
|
|
6610
|
-
|
|
7019
|
+
const durationMs = Date.now() - started;
|
|
7020
|
+
logs.info(RUNTIME_METADATA_EVENTS.INIT_COMPLETE, {
|
|
6611
7021
|
transport: "extension",
|
|
6612
|
-
releaseId: this.cache.getReleaseId()
|
|
7022
|
+
releaseId: this.cache.getReleaseId(),
|
|
7023
|
+
durationMs,
|
|
7024
|
+
...correlationFields()
|
|
6613
7025
|
});
|
|
7026
|
+
if (durationMs >= logs.policy.slowInitMs) {
|
|
7027
|
+
logs.warn("runtimeMetadata.init.slow", {
|
|
7028
|
+
transport: "extension",
|
|
7029
|
+
releaseId: this.cache.getReleaseId(),
|
|
7030
|
+
durationMs,
|
|
7031
|
+
thresholdMs: logs.policy.slowInitMs,
|
|
7032
|
+
...correlationFields()
|
|
7033
|
+
});
|
|
7034
|
+
}
|
|
6614
7035
|
return;
|
|
6615
7036
|
}
|
|
6616
7037
|
if (!this.metadataProviderFallback) {
|
|
6617
|
-
|
|
6618
|
-
event: RUNTIME_METADATA_EVENTS.INIT_FAILED,
|
|
7038
|
+
logs.error(RUNTIME_METADATA_EVENTS.INIT_FAILED, {
|
|
6619
7039
|
transport: "extension",
|
|
6620
|
-
reason: "fallback-disabled"
|
|
7040
|
+
reason: "fallback-disabled",
|
|
7041
|
+
durationMs: Date.now() - started,
|
|
7042
|
+
...correlationFields()
|
|
6621
7043
|
});
|
|
6622
7044
|
throw new MetadataProjectionUnavailableError(
|
|
6623
7045
|
"Metadata extension is unavailable and S3 fallback is disabled",
|
|
@@ -6646,8 +7068,7 @@ var RuntimeMetadataService = class {
|
|
|
6646
7068
|
if (!this.metadataProviderFallback || err instanceof MetadataExtensionContractError) {
|
|
6647
7069
|
throw err;
|
|
6648
7070
|
}
|
|
6649
|
-
this.logger.warn({
|
|
6650
|
-
event: RUNTIME_METADATA_EVENTS.PROVIDER_FALLBACK,
|
|
7071
|
+
createOperationalLogger(this.logger).warn(RUNTIME_METADATA_EVENTS.PROVIDER_FALLBACK, {
|
|
6651
7072
|
reason: "extension-refresh-failed",
|
|
6652
7073
|
message: err instanceof Error ? err.message : String(err)
|
|
6653
7074
|
});
|
|
@@ -6671,8 +7092,7 @@ var RuntimeMetadataService = class {
|
|
|
6671
7092
|
if (!this.metadataProviderFallback || err instanceof MetadataExtensionContractError) {
|
|
6672
7093
|
throw err;
|
|
6673
7094
|
}
|
|
6674
|
-
this.logger.warn({
|
|
6675
|
-
event: RUNTIME_METADATA_EVENTS.PROVIDER_FALLBACK,
|
|
7095
|
+
createOperationalLogger(this.logger).warn(RUNTIME_METADATA_EVENTS.PROVIDER_FALLBACK, {
|
|
6676
7096
|
reason: "extension-check-failed",
|
|
6677
7097
|
message: err instanceof Error ? err.message : String(err)
|
|
6678
7098
|
});
|
|
@@ -6708,13 +7128,12 @@ var RuntimeMetadataService = class {
|
|
|
6708
7128
|
*/
|
|
6709
7129
|
async ensureProjectionsForResponse(response) {
|
|
6710
7130
|
const potential = hasPotentialMetadata(response);
|
|
7131
|
+
const logs = createOperationalLogger(this.logger);
|
|
6711
7132
|
if (!potential) {
|
|
6712
|
-
|
|
6713
|
-
event: "metadata-enrichment.trace.typeDetection.completed",
|
|
7133
|
+
logs.debug("metadata-enrichment.trace.typeDetection.completed", {
|
|
6714
7134
|
stage: "ensureProjectionsForResponse",
|
|
6715
7135
|
hasPotentialMetadata: false,
|
|
6716
|
-
referencesFound: 0
|
|
6717
|
-
typeCodesFound: []
|
|
7136
|
+
referencesFound: 0
|
|
6718
7137
|
});
|
|
6719
7138
|
return;
|
|
6720
7139
|
}
|
|
@@ -6730,18 +7149,16 @@ var RuntimeMetadataService = class {
|
|
|
6730
7149
|
};
|
|
6731
7150
|
const references = collectResponseReferences(response, { knownTypes, diagnostics });
|
|
6732
7151
|
const typeCodes = collectResponseTypeCodes(response, { knownTypes, diagnostics });
|
|
6733
|
-
|
|
6734
|
-
event: "metadata-enrichment.trace.typeDetection.completed",
|
|
7152
|
+
logs.debug("metadata-enrichment.trace.typeDetection.completed", () => ({
|
|
6735
7153
|
stage: "ensureProjectionsForResponse",
|
|
6736
7154
|
hasPotentialMetadata: true,
|
|
6737
7155
|
totalCandidatesDiscovered: diagnostics.totalCandidatesDiscovered,
|
|
6738
7156
|
totalUniqueTypesDiscovered: diagnostics.totalUniqueTypesDiscovered,
|
|
6739
7157
|
totalUniqueTypeValuesDiscovered: diagnostics.totalUniqueTypeValuesDiscovered,
|
|
6740
7158
|
referencesFound: references.length,
|
|
6741
|
-
|
|
6742
|
-
sampleCandidates: diagnostics.candidateFields.slice(0, 15),
|
|
7159
|
+
typeCodeCount: typeCodes.length,
|
|
6743
7160
|
knownTypesAvailable: knownTypes ? knownTypes.length : 0
|
|
6744
|
-
});
|
|
7161
|
+
}));
|
|
6745
7162
|
if (references.length === 0) {
|
|
6746
7163
|
return;
|
|
6747
7164
|
}
|
|
@@ -6778,12 +7195,9 @@ var RuntimeMetadataService = class {
|
|
|
6778
7195
|
const startLoadTime = Date.now();
|
|
6779
7196
|
const inMemoryBefore = metadataTypeCodes.filter((c) => Boolean(this.cache.getDomainFile(c)));
|
|
6780
7197
|
const missingInitial = this.findMissingTypeCodes(metadataTypeCodes);
|
|
6781
|
-
this.logger
|
|
6782
|
-
|
|
7198
|
+
const logs = createOperationalLogger(this.logger);
|
|
7199
|
+
logs.debug("metadata-enrichment.trace.metadataLoading.start", {
|
|
6783
7200
|
stage: "ensureProjectionTypesLoaded",
|
|
6784
|
-
requestedTypes: metadataTypeCodes,
|
|
6785
|
-
typesInMemory: inMemoryBefore,
|
|
6786
|
-
typesMissing: missingInitial,
|
|
6787
7201
|
totalRequested: metadataTypeCodes.length,
|
|
6788
7202
|
totalInMemory: inMemoryBefore.length,
|
|
6789
7203
|
totalMissing: missingInitial.length
|
|
@@ -6791,13 +7205,12 @@ var RuntimeMetadataService = class {
|
|
|
6791
7205
|
while (true) {
|
|
6792
7206
|
const missing = this.findMissingTypeCodes(metadataTypeCodes);
|
|
6793
7207
|
if (missing.length === 0) {
|
|
6794
|
-
|
|
6795
|
-
event: "metadata-enrichment.trace.metadataLoading.completed",
|
|
7208
|
+
logs.debug("metadata-enrichment.trace.metadataLoading.completed", {
|
|
6796
7209
|
stage: "ensureProjectionTypesLoaded",
|
|
6797
|
-
requestedTypes: metadataTypeCodes,
|
|
6798
7210
|
durationMs: Date.now() - startLoadTime,
|
|
6799
7211
|
s3IoAttempted: missingInitial.length > 0,
|
|
6800
|
-
outcome: "all_types_in_cache"
|
|
7212
|
+
outcome: "all_types_in_cache",
|
|
7213
|
+
totalRequested: metadataTypeCodes.length
|
|
6801
7214
|
});
|
|
6802
7215
|
return;
|
|
6803
7216
|
}
|
|
@@ -7018,12 +7431,14 @@ var RuntimeMetadataService = class {
|
|
|
7018
7431
|
const guard = this.currentWriteGuard();
|
|
7019
7432
|
const value = await provider.getValue(typeCode, valueCode, options);
|
|
7020
7433
|
this.hydrateProviderValues(value ? [value] : [], guard);
|
|
7021
|
-
this.logger.
|
|
7022
|
-
|
|
7023
|
-
|
|
7024
|
-
|
|
7025
|
-
|
|
7026
|
-
|
|
7434
|
+
createOperationalLogger(this.logger).debug(
|
|
7435
|
+
value ? RUNTIME_METADATA_EVENTS.CACHE_HIT : RUNTIME_METADATA_EVENTS.CACHE_MISS,
|
|
7436
|
+
{
|
|
7437
|
+
typeCode,
|
|
7438
|
+
valueCode,
|
|
7439
|
+
transport: this.providerCoordinator.getActiveKind()
|
|
7440
|
+
}
|
|
7441
|
+
);
|
|
7027
7442
|
return value;
|
|
7028
7443
|
} catch (err) {
|
|
7029
7444
|
if (await this.tryActivateFallbackFromError(err, "extension-lookup", provider)) {
|
|
@@ -7041,8 +7456,7 @@ var RuntimeMetadataService = class {
|
|
|
7041
7456
|
provider = await this.activeProvider();
|
|
7042
7457
|
const generationAtStart = this.cache.getGeneration();
|
|
7043
7458
|
const result = await provider.batchGet(references, options);
|
|
7044
|
-
this.logger.
|
|
7045
|
-
event: RUNTIME_METADATA_EVENTS.BATCH_LOOKUP,
|
|
7459
|
+
createOperationalLogger(this.logger).debug(RUNTIME_METADATA_EVENTS.BATCH_LOOKUP, {
|
|
7046
7460
|
requested: references.length,
|
|
7047
7461
|
resolved: Object.keys(result.items).length,
|
|
7048
7462
|
invalid: result.invalidReferences.length,
|
|
@@ -7214,6 +7628,7 @@ var RuntimeMetadataService = class {
|
|
|
7214
7628
|
* snapshot, so a mismatched pin must be retried as a new session.
|
|
7215
7629
|
*/
|
|
7216
7630
|
async beginMetadataRead(options) {
|
|
7631
|
+
const started = Date.now();
|
|
7217
7632
|
const provider = await this.activeProvider();
|
|
7218
7633
|
const status = await provider.getStatus();
|
|
7219
7634
|
const readPolicy = options?.readPolicy ?? METADATA_READ_POLICY.ALLOW_STALE;
|
|
@@ -7228,6 +7643,19 @@ var RuntimeMetadataService = class {
|
|
|
7228
7643
|
"Metadata projection release is unavailable"
|
|
7229
7644
|
);
|
|
7230
7645
|
}
|
|
7646
|
+
const counters = performanceCounters(provider);
|
|
7647
|
+
const logs = createOperationalLogger(this.logger);
|
|
7648
|
+
logs.observe({
|
|
7649
|
+
event: "runtimeMetadata.metadataRead",
|
|
7650
|
+
durationMs: Date.now() - started,
|
|
7651
|
+
thresholdMs: logs.policy.slowLookupMs,
|
|
7652
|
+
fields: {
|
|
7653
|
+
releaseId: status.releaseId,
|
|
7654
|
+
readPolicy,
|
|
7655
|
+
...counters ? { readinessCheckCount: counters.readinessCheckCount } : {},
|
|
7656
|
+
...correlationFields()
|
|
7657
|
+
}
|
|
7658
|
+
});
|
|
7231
7659
|
return { releaseId: status.releaseId, readPolicy };
|
|
7232
7660
|
}
|
|
7233
7661
|
async listValuesByType(typeCode, options) {
|
|
@@ -7236,14 +7664,18 @@ var RuntimeMetadataService = class {
|
|
|
7236
7664
|
options?.readPolicy,
|
|
7237
7665
|
(provider) => provider.listValuesByType(typeCode, options)
|
|
7238
7666
|
);
|
|
7239
|
-
this.logger
|
|
7667
|
+
const logs = createOperationalLogger(this.logger);
|
|
7668
|
+
logs.observe({
|
|
7240
7669
|
event: RUNTIME_METADATA_EVENTS.TYPE_ENUMERATION,
|
|
7241
|
-
typeCode,
|
|
7242
|
-
releaseId: result.releaseId,
|
|
7243
|
-
itemCount: result.items.length,
|
|
7244
|
-
paged: Boolean(options?.limit),
|
|
7245
7670
|
durationMs: Date.now() - started,
|
|
7246
|
-
|
|
7671
|
+
thresholdMs: logs.policy.slowLookupMs,
|
|
7672
|
+
fields: {
|
|
7673
|
+
typeCode,
|
|
7674
|
+
releaseId: result.releaseId,
|
|
7675
|
+
itemCount: result.items.length,
|
|
7676
|
+
paged: Boolean(options?.limit),
|
|
7677
|
+
transport: this.providerCoordinator.getActiveKind()
|
|
7678
|
+
}
|
|
7247
7679
|
});
|
|
7248
7680
|
return result;
|
|
7249
7681
|
}
|
|
@@ -7253,14 +7685,18 @@ var RuntimeMetadataService = class {
|
|
|
7253
7685
|
options?.readPolicy,
|
|
7254
7686
|
(provider) => provider.listValuesByTypes(typeCodes, options)
|
|
7255
7687
|
);
|
|
7256
|
-
this.logger
|
|
7688
|
+
const logs = createOperationalLogger(this.logger);
|
|
7689
|
+
logs.observe({
|
|
7257
7690
|
event: RUNTIME_METADATA_EVENTS.TYPE_BATCH_ENUMERATION,
|
|
7258
|
-
typeCount: typeCodes.length,
|
|
7259
|
-
releaseId: result.releaseId,
|
|
7260
|
-
failed: result.types.filter((type) => type.errorCode).length,
|
|
7261
|
-
unknown: result.types.filter((type) => !type.found).length,
|
|
7262
7691
|
durationMs: Date.now() - started,
|
|
7263
|
-
|
|
7692
|
+
thresholdMs: logs.policy.slowLookupMs,
|
|
7693
|
+
fields: {
|
|
7694
|
+
typeCount: typeCodes.length,
|
|
7695
|
+
releaseId: result.releaseId,
|
|
7696
|
+
failed: result.types.filter((type) => type.errorCode).length,
|
|
7697
|
+
unknown: result.types.filter((type) => !type.found).length,
|
|
7698
|
+
transport: this.providerCoordinator.getActiveKind()
|
|
7699
|
+
}
|
|
7264
7700
|
});
|
|
7265
7701
|
return result;
|
|
7266
7702
|
}
|
|
@@ -7270,19 +7706,74 @@ var RuntimeMetadataService = class {
|
|
|
7270
7706
|
query.readPolicy,
|
|
7271
7707
|
(provider) => provider.getRelationships(query)
|
|
7272
7708
|
);
|
|
7273
|
-
this.
|
|
7709
|
+
const counters = performanceCounters(await this.activeProvider());
|
|
7710
|
+
const logs = createOperationalLogger(this.logger);
|
|
7711
|
+
logs.observe({
|
|
7274
7712
|
event: RUNTIME_METADATA_EVENTS.RELATIONSHIP_QUERY,
|
|
7275
|
-
sourceTypeCode: query.sourceTypeCode,
|
|
7276
|
-
relationType: query.relationType,
|
|
7277
|
-
direction: query.direction ?? "OUTGOING",
|
|
7278
|
-
releaseId: result.releaseId,
|
|
7279
|
-
supported: result.supported,
|
|
7280
|
-
count: result.relationships.length,
|
|
7281
7713
|
durationMs: Date.now() - started,
|
|
7282
|
-
|
|
7714
|
+
thresholdMs: logs.policy.slowLookupMs,
|
|
7715
|
+
fields: {
|
|
7716
|
+
sourceTypeCode: query.sourceTypeCode,
|
|
7717
|
+
relationType: query.relationType,
|
|
7718
|
+
direction: query.direction ?? "OUTGOING",
|
|
7719
|
+
releaseId: result.releaseId,
|
|
7720
|
+
supported: result.supported,
|
|
7721
|
+
count: result.relationships.length,
|
|
7722
|
+
transport: this.providerCoordinator.getActiveKind(),
|
|
7723
|
+
...counters ? {
|
|
7724
|
+
relationshipRequestCount: counters.relationshipRequestCount,
|
|
7725
|
+
readinessCheckCount: counters.readinessCheckCount
|
|
7726
|
+
} : {},
|
|
7727
|
+
...correlationFields()
|
|
7728
|
+
}
|
|
7283
7729
|
});
|
|
7284
7730
|
return result;
|
|
7285
7731
|
}
|
|
7732
|
+
/**
|
|
7733
|
+
* Resolve many relationship queries with a bounded number of extension requests.
|
|
7734
|
+
* Providers without a batch method, and extensions that do not implement the
|
|
7735
|
+
* batch route, keep the existing per-query behavior.
|
|
7736
|
+
*/
|
|
7737
|
+
async queryRelationships(queries) {
|
|
7738
|
+
if (queries.length === 0) {
|
|
7739
|
+
return [];
|
|
7740
|
+
}
|
|
7741
|
+
const started = Date.now();
|
|
7742
|
+
const readPolicy = queries.some(
|
|
7743
|
+
(query) => query.readPolicy === METADATA_READ_POLICY.REQUIRE_FRESH
|
|
7744
|
+
) ? METADATA_READ_POLICY.REQUIRE_FRESH : queries[0]?.readPolicy;
|
|
7745
|
+
const results = await this.withDiscoveryProvider(readPolicy, async (provider) => {
|
|
7746
|
+
const batch = provider.queryRelationships;
|
|
7747
|
+
if (typeof batch === "function") {
|
|
7748
|
+
try {
|
|
7749
|
+
return await batch.call(provider, queries);
|
|
7750
|
+
} catch (error) {
|
|
7751
|
+
if (!(error instanceof MetadataExtensionContractError)) {
|
|
7752
|
+
throw error;
|
|
7753
|
+
}
|
|
7754
|
+
}
|
|
7755
|
+
}
|
|
7756
|
+
return mapPool(queries, 10, (query) => provider.getRelationships(query));
|
|
7757
|
+
});
|
|
7758
|
+
const counters = performanceCounters(await this.activeProvider());
|
|
7759
|
+
const logs = createOperationalLogger(this.logger);
|
|
7760
|
+
logs.observe({
|
|
7761
|
+
event: "runtimeMetadata.relationshipBatch",
|
|
7762
|
+
durationMs: Date.now() - started,
|
|
7763
|
+
thresholdMs: logs.policy.slowLookupMs,
|
|
7764
|
+
fields: {
|
|
7765
|
+
queryCount: queries.length,
|
|
7766
|
+
releaseId: results[0]?.releaseId ?? null,
|
|
7767
|
+
transport: this.providerCoordinator.getActiveKind(),
|
|
7768
|
+
...counters ? {
|
|
7769
|
+
relationshipRequestCount: counters.relationshipRequestCount,
|
|
7770
|
+
readinessCheckCount: counters.readinessCheckCount
|
|
7771
|
+
} : {},
|
|
7772
|
+
...correlationFields()
|
|
7773
|
+
}
|
|
7774
|
+
});
|
|
7775
|
+
return results;
|
|
7776
|
+
}
|
|
7286
7777
|
getActiveProviderKind() {
|
|
7287
7778
|
return this.providerCoordinator.getActiveKind();
|
|
7288
7779
|
}
|
|
@@ -7333,15 +7824,13 @@ var RuntimeMetadataService = class {
|
|
|
7333
7824
|
return true;
|
|
7334
7825
|
} catch (err) {
|
|
7335
7826
|
if (err instanceof MetadataExtensionContractError) {
|
|
7336
|
-
this.logger.
|
|
7337
|
-
event: RUNTIME_METADATA_EVENTS.INIT_FAILED,
|
|
7827
|
+
createOperationalLogger(this.logger).error(RUNTIME_METADATA_EVENTS.INIT_FAILED, {
|
|
7338
7828
|
reason: "extension-contract",
|
|
7339
7829
|
message: err.message
|
|
7340
7830
|
});
|
|
7341
7831
|
throw err;
|
|
7342
7832
|
}
|
|
7343
|
-
this.logger.warn({
|
|
7344
|
-
event: RUNTIME_METADATA_EVENTS.PROVIDER_FALLBACK,
|
|
7833
|
+
createOperationalLogger(this.logger).warn(RUNTIME_METADATA_EVENTS.PROVIDER_FALLBACK, {
|
|
7345
7834
|
reason: "extension-unavailable",
|
|
7346
7835
|
recoverable: true,
|
|
7347
7836
|
message: err instanceof Error ? err.message : String(err)
|
|
@@ -7466,8 +7955,7 @@ var RuntimeMetadataService = class {
|
|
|
7466
7955
|
} catch (err) {
|
|
7467
7956
|
this.logFreshnessRejection(err);
|
|
7468
7957
|
if (err instanceof MetadataExtensionContractError) {
|
|
7469
|
-
this.logger.warn({
|
|
7470
|
-
event: "runtimeMetadata.extension.contract",
|
|
7958
|
+
createOperationalLogger(this.logger).warn("runtimeMetadata.extension.contract", {
|
|
7471
7959
|
code: err.code,
|
|
7472
7960
|
message: err.message
|
|
7473
7961
|
});
|
|
@@ -7486,8 +7974,7 @@ var RuntimeMetadataService = class {
|
|
|
7486
7974
|
if (!(err instanceof MetadataFreshnessError)) {
|
|
7487
7975
|
return;
|
|
7488
7976
|
}
|
|
7489
|
-
this.logger.
|
|
7490
|
-
event: RUNTIME_METADATA_EVENTS.FRESHNESS_REJECTED,
|
|
7977
|
+
createOperationalLogger(this.logger).warn(RUNTIME_METADATA_EVENTS.FRESHNESS_REJECTED, {
|
|
7491
7978
|
state: err.metadata?.state,
|
|
7492
7979
|
releaseId: err.metadata?.releaseId
|
|
7493
7980
|
});
|
|
@@ -7506,6 +7993,33 @@ var RuntimeMetadataService = class {
|
|
|
7506
7993
|
function recoveryCooldownMs(env) {
|
|
7507
7994
|
return resolveExtensionRecoveryIntervalMs(env);
|
|
7508
7995
|
}
|
|
7996
|
+
function correlationFields() {
|
|
7997
|
+
const correlationId = getContext().correlationId;
|
|
7998
|
+
if (!correlationId || correlationId === "unknown") {
|
|
7999
|
+
return {};
|
|
8000
|
+
}
|
|
8001
|
+
return { correlationId };
|
|
8002
|
+
}
|
|
8003
|
+
function performanceCounters(provider) {
|
|
8004
|
+
const candidate = provider;
|
|
8005
|
+
if (typeof candidate.getPerformanceCounters !== "function") {
|
|
8006
|
+
return void 0;
|
|
8007
|
+
}
|
|
8008
|
+
return candidate.getPerformanceCounters();
|
|
8009
|
+
}
|
|
8010
|
+
async function mapPool(items, limit, run) {
|
|
8011
|
+
const results = new Array(items.length);
|
|
8012
|
+
let next = 0;
|
|
8013
|
+
const workers = Array.from({ length: Math.min(Math.max(limit, 1), items.length) }, async () => {
|
|
8014
|
+
while (next < items.length) {
|
|
8015
|
+
const index = next;
|
|
8016
|
+
next += 1;
|
|
8017
|
+
results[index] = await run(items[index]);
|
|
8018
|
+
}
|
|
8019
|
+
});
|
|
8020
|
+
await Promise.all(workers);
|
|
8021
|
+
return results;
|
|
8022
|
+
}
|
|
7509
8023
|
|
|
7510
8024
|
// ../../libs/runtime-metadata/src/lib/integration/createRuntimeMetadataFromEnv.ts
|
|
7511
8025
|
function createRuntimeMetadataFromEnv(options) {
|
|
@@ -7566,10 +8080,6 @@ async function ensureRuntimeMetadataLoaded() {
|
|
|
7566
8080
|
initialized = true;
|
|
7567
8081
|
lastUpdateCheckAtMs = Date.now();
|
|
7568
8082
|
}).catch((error) => {
|
|
7569
|
-
logger2.error({
|
|
7570
|
-
error,
|
|
7571
|
-
message: "Failed to initialize runtime metadata"
|
|
7572
|
-
});
|
|
7573
8083
|
initializePromise = void 0;
|
|
7574
8084
|
throw error;
|
|
7575
8085
|
});
|
|
@@ -8070,6 +8580,6 @@ var InMemoryMetadataProvider = class {
|
|
|
8070
8580
|
}
|
|
8071
8581
|
};
|
|
8072
8582
|
|
|
8073
|
-
export { CACHE_STATUS, DEFAULT_EXCLUDED_CODE_FIELDS, DEFAULT_PROVIDER_RECOVERY_COOLDOWN_MS, ExtensionMetadataProvider, InMemoryMetadataProvider, InvalidMetadataReferenceError, METADATA_ATTRIBUTE_FILTER_KEY, METADATA_PROJECTIONS_BUCKET_ENV, METADATA_PROVIDER_KIND, METADATA_READ_POLICY, METADATA_RELATION_DIRECTION, ManifestValidationError, MetadataCache, MetadataDiscoveryError, MetadataDownloader, MetadataExtensionContractError, MetadataFreshnessError, MetadataHealthService, MetadataLoader, MetadataLookupError, MetadataNotReadyError, MetadataProjectionUnavailableError, MetadataRefreshService, MetadataReleaseMismatchError, MetadataResolver, NON_METADATA_KEYS, PROVIDER_TRANSPORT_STATE, ProjectionDownloadError, ProviderFailoverCoordinator, REFRESH_STATUS, RUNTIME_METADATA_EVENTS, RUNTIME_METADATA_INTEGRATION_TARGETS, RUNTIME_METADATA_TYPE_CODE_ALIASES, RuntimeMetadataError, RuntimeMetadataService, S3MetadataProvider, 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 };
|
|
8583
|
+
export { CACHE_STATUS, DEFAULT_EXCLUDED_CODE_FIELDS, DEFAULT_PROVIDER_RECOVERY_COOLDOWN_MS, ExtensionMetadataProvider, InMemoryMetadataProvider, InvalidMetadataReferenceError, METADATA_ATTRIBUTE_FILTER_KEY, METADATA_PROJECTIONS_BUCKET_ENV, METADATA_PROVIDER_KIND, METADATA_READ_POLICY, METADATA_RELATION_DIRECTION, ManifestValidationError, MetadataCache, MetadataDiscoveryError, MetadataDownloader, MetadataExtensionContractError, MetadataFreshnessError, MetadataHealthService, MetadataLoader, MetadataLookupError, MetadataNotReadyError, MetadataProjectionUnavailableError, MetadataRefreshService, MetadataReleaseMismatchError, MetadataResolver, NON_METADATA_KEYS, PROVIDER_TRANSPORT_STATE, ProjectionDownloadError, ProviderFailoverCoordinator, REFRESH_STATUS, RELATIONSHIP_QUERY_BATCH_LIMIT, RUNTIME_METADATA_EVENTS, RUNTIME_METADATA_INTEGRATION_TARGETS, RUNTIME_METADATA_TYPE_CODE_ALIASES, RuntimeMetadataError, RuntimeMetadataService, S3MetadataProvider, 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 };
|
|
8074
8584
|
//# sourceMappingURL=index.js.map
|
|
8075
8585
|
//# sourceMappingURL=index.js.map
|