@scoutflo/topology-contracts 0.1.0 → 0.3.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.
@@ -0,0 +1,145 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.gatewayTopologyContextSchema = exports.topologyBindingHintsSchema = exports.topologyBindingHintSchema = exports.topologyInvestigationContextSchema = exports.relatedServiceInfoSchema = exports.investigationResourceSchema = exports.targetServiceInfoSchema = exports.topologyInitializationStateSchema = exports.topologyPrimaryAnchorSchema = exports.topologyCandidateTargetSchema = exports.topologyReasonCodeSchema = exports.nestedTopologyResponseSchema = exports.nestedTopologyNodeSchema = exports.nestedTopologyChildSchema = exports.nestedTopologyRelationshipSchema = exports.diagnosticCriticalitySchema = exports.GATEWAY_TOPOLOGY_CONTEXT_VERSION = void 0;
4
+ const zod_1 = require("zod");
5
+ const correlation_core_1 = require("@scoutflo/correlation-core");
6
+ const providers_1 = require("../providers");
7
+ const common_1 = require("../source-sync/common");
8
+ exports.GATEWAY_TOPOLOGY_CONTEXT_VERSION = 'topology.gateway-context.v1';
9
+ exports.diagnosticCriticalitySchema = zod_1.z.enum([
10
+ 'blocking',
11
+ 'degrading',
12
+ 'optional',
13
+ ]);
14
+ exports.nestedTopologyRelationshipSchema = zod_1.z.object({
15
+ id: common_1.nonEmptyStringSchema,
16
+ relation: common_1.nonEmptyStringSchema,
17
+ relation_class: common_1.nonEmptyStringSchema.optional(),
18
+ diagnostic_criticality: exports.diagnosticCriticalitySchema.optional(),
19
+ attribute_schema_key: common_1.nonEmptyStringSchema.optional(),
20
+ attributes: common_1.recordSchema.optional(),
21
+ }).passthrough();
22
+ const nestedTopologyNodeBaseSchema = zod_1.z.object({
23
+ entity_type: common_1.entityKindSchema,
24
+ id: common_1.nonEmptyStringSchema,
25
+ entity: common_1.recordSchema.optional(),
26
+ root_refs: zod_1.z.record(common_1.nonEmptyStringSchema).optional(),
27
+ is_hierarchy_root_types: zod_1.z.array(common_1.nonEmptyStringSchema).optional(),
28
+ already_visited: zod_1.z.boolean().optional(),
29
+ });
30
+ exports.nestedTopologyChildSchema = zod_1.z.lazy(() => nestedTopologyNodeBaseSchema.extend({
31
+ relationship: exports.nestedTopologyRelationshipSchema,
32
+ children: zod_1.z.array(exports.nestedTopologyChildSchema),
33
+ }).passthrough());
34
+ exports.nestedTopologyNodeSchema = nestedTopologyNodeBaseSchema.extend({
35
+ children: zod_1.z.array(exports.nestedTopologyChildSchema),
36
+ }).passthrough();
37
+ exports.nestedTopologyResponseSchema = zod_1.z.object({
38
+ status: zod_1.z.union([zod_1.z.literal('success'), zod_1.z.number()]),
39
+ topology: exports.nestedTopologyNodeSchema,
40
+ stats: zod_1.z.object({
41
+ total_nodes: zod_1.z.number().int().min(0),
42
+ max_depth: zod_1.z.number().int().min(0),
43
+ structural_edges: zod_1.z.number().int().min(0),
44
+ associative_edges: zod_1.z.number().int().min(0),
45
+ }).optional(),
46
+ }).passthrough();
47
+ exports.topologyReasonCodeSchema = common_1.nonEmptyStringSchema;
48
+ exports.topologyCandidateTargetSchema = zod_1.z.object({
49
+ entityType: common_1.entityKindSchema,
50
+ id: common_1.nonEmptyStringSchema,
51
+ displayName: common_1.nonEmptyStringSchema.optional(),
52
+ confidence: zod_1.z.number().min(0).optional(),
53
+ }).passthrough();
54
+ exports.topologyPrimaryAnchorSchema = exports.topologyCandidateTargetSchema;
55
+ exports.topologyInitializationStateSchema = zod_1.z.object({
56
+ correlationState: zod_1.z.enum([
57
+ 'exact_match',
58
+ 'probable_match',
59
+ 'ambiguous_match',
60
+ 'resource_only',
61
+ 'unresolved',
62
+ 'topology_temporarily_unavailable',
63
+ ]),
64
+ resolvedVia: common_1.nonEmptyStringSchema,
65
+ confidence: zod_1.z.number().min(0),
66
+ reasonCodes: zod_1.z.array(exports.topologyReasonCodeSchema),
67
+ candidateTargets: zod_1.z.array(exports.topologyCandidateTargetSchema),
68
+ primaryAnchor: exports.topologyPrimaryAnchorSchema.nullable(),
69
+ topologyScope: zod_1.z.enum([
70
+ 'narrow',
71
+ 'inferred',
72
+ 'shared',
73
+ 'resource',
74
+ 'alert_only',
75
+ ]),
76
+ userMessage: common_1.nonEmptyStringSchema,
77
+ topologyAvailable: zod_1.z.boolean(),
78
+ }).passthrough();
79
+ exports.targetServiceInfoSchema = zod_1.z.object({
80
+ id: common_1.nonEmptyStringSchema,
81
+ name: common_1.nonEmptyStringSchema,
82
+ displayName: common_1.nonEmptyStringSchema,
83
+ serviceType: common_1.nonEmptyStringSchema,
84
+ criticality: common_1.nonEmptyStringSchema,
85
+ environment: common_1.nonEmptyStringSchema,
86
+ }).passthrough();
87
+ exports.investigationResourceSchema = zod_1.z.object({
88
+ id: common_1.nonEmptyStringSchema,
89
+ name: common_1.nonEmptyStringSchema,
90
+ type: common_1.nonEmptyStringSchema,
91
+ provider: providers_1.topologyProviderInputSchema.or(common_1.nonEmptyStringSchema),
92
+ relationship: common_1.nonEmptyStringSchema,
93
+ investigationHint: common_1.nonEmptyStringSchema,
94
+ attributeSchemaKey: common_1.nonEmptyStringSchema.optional(),
95
+ attributes: common_1.recordSchema.optional(),
96
+ }).passthrough();
97
+ exports.relatedServiceInfoSchema = zod_1.z.object({
98
+ name: common_1.nonEmptyStringSchema,
99
+ displayName: common_1.nonEmptyStringSchema,
100
+ relation: common_1.nonEmptyStringSchema,
101
+ criticality: common_1.nonEmptyStringSchema,
102
+ }).passthrough();
103
+ exports.topologyInvestigationContextSchema = zod_1.z.object({
104
+ topologyAvailable: zod_1.z.boolean(),
105
+ targetService: exports.targetServiceInfoSchema.nullable(),
106
+ investigationResources: zod_1.z.array(exports.investigationResourceSchema),
107
+ recommendedSpecialists: zod_1.z.array(common_1.recordSchema),
108
+ eligibleSpecialists: zod_1.z.array(common_1.nonEmptyStringSchema),
109
+ relatedServices: zod_1.z.object({
110
+ upstream: zod_1.z.array(exports.relatedServiceInfoSchema),
111
+ downstream: zod_1.z.array(exports.relatedServiceInfoSchema),
112
+ }),
113
+ naturalLanguageSummary: common_1.nonEmptyStringSchema,
114
+ inferenceMetadata: common_1.recordSchema.optional(),
115
+ }).passthrough();
116
+ exports.topologyBindingHintSchema = zod_1.z.object({
117
+ provider: providers_1.topologyProviderInputSchema.or(common_1.nonEmptyStringSchema),
118
+ resourceId: common_1.nonEmptyStringSchema.optional(),
119
+ externalId: common_1.nonEmptyStringSchema.optional(),
120
+ sourceCollection: common_1.nonEmptyStringSchema.optional(),
121
+ resourceType: common_1.nonEmptyStringSchema.optional(),
122
+ serviceId: common_1.nonEmptyStringSchema.optional(),
123
+ confidence: zod_1.z.number().min(0).optional(),
124
+ relation: common_1.nonEmptyStringSchema.optional(),
125
+ origin: zod_1.z.enum(['source', 'topology', 'source_and_topology']).optional(),
126
+ }).passthrough();
127
+ exports.topologyBindingHintsSchema = zod_1.z.object({
128
+ sourceIntegrationHint: zod_1.z.object({
129
+ provider: providers_1.topologyProviderInputSchema.or(common_1.nonEmptyStringSchema).optional(),
130
+ integrationId: common_1.nonEmptyStringSchema.optional(),
131
+ }).optional(),
132
+ candidateBindings: zod_1.z.array(exports.topologyBindingHintSchema),
133
+ preferredBindingsBySpecialist: zod_1.z.record(zod_1.z.array(exports.topologyBindingHintSchema)).optional(),
134
+ }).passthrough();
135
+ exports.gatewayTopologyContextSchema = zod_1.z.object({
136
+ version: zod_1.z.literal(exports.GATEWAY_TOPOLOGY_CONTEXT_VERSION),
137
+ initialization: exports.topologyInitializationStateSchema,
138
+ investigationContext: exports.topologyInvestigationContextSchema,
139
+ bindingHints: exports.topologyBindingHintsSchema,
140
+ reasonCodes: zod_1.z.array(exports.topologyReasonCodeSchema).optional(),
141
+ selectedTarget: correlation_core_1.correlationEntityRefSchema.optional(),
142
+ topologySlice: exports.nestedTopologyResponseSchema.nullable().optional(),
143
+ diagnostics: common_1.recordSchema.optional(),
144
+ }).passthrough();
145
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js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 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./context"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/investigation/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B"}
@@ -3,3 +3,5 @@ export { awsTopologyFamilySchema, kubernetesTopologyFamilySchema, integrationTop
3
3
  export { sourceSyncCapabilitySchema, topologySourceIntentIncludeSchema, topologySourceIntentSchema, topologySyncIntentOptionsSchema, topologySyncIntentSchema, topologySyncScopeSchema, topologySyncCompletenessStatusSchema, topologySyncCompletenessSchema, topologySyncWarningSeveritySchema, topologySyncWarningSchema, topologySourceRefStatusSchema, topologyEntitySourceRefCandidateSchema, topologyAccessRefCandidateSchema, topologySourceNodeCandidateSchema, topologyExistingEntityRefSchema, topologySourceRelationshipCandidateSchema, } from '../source-sync';
4
4
  export { topologyCorrelationApplyPolicySchema, topologyCorrelationRequiredEndpointSchema, topologyCorrelationRuleMetadataSchema, topologyCorrelationDecisionSchema, topologyCorrelationCandidateSchema, } from '../correlation';
5
5
  export { topologyResourceTypeSchema, topologyRelationTypeSchema, } from '../topology';
6
+ export { credentialSourceEntityTypeSchema, credentialResolutionModeSchema, credentialSourceExternalRefSchema, credentialSourceResultItemSchema, credentialSourceSingleResponseSchema, credentialSourceBulkRequestSchema, credentialSourceBulkResponseSchema, topologyApiErrorCodeSchema, topologyApiErrorEnvelopeSchema, } from '../credential-source';
7
+ export { diagnosticCriticalitySchema, nestedTopologyRelationshipSchema, nestedTopologyNodeSchema, nestedTopologyChildSchema, nestedTopologyResponseSchema, topologyReasonCodeSchema, topologyCandidateTargetSchema, topologyPrimaryAnchorSchema, topologyInitializationStateSchema, targetServiceInfoSchema, investigationResourceSchema, relatedServiceInfoSchema, topologyInvestigationContextSchema, topologyBindingHintSchema, topologyBindingHintsSchema, gatewayTopologyContextSchema, } from '../investigation';
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.topologyRelationTypeSchema = exports.topologyResourceTypeSchema = exports.topologyCorrelationCandidateSchema = exports.topologyCorrelationDecisionSchema = exports.topologyCorrelationRuleMetadataSchema = exports.topologyCorrelationRequiredEndpointSchema = exports.topologyCorrelationApplyPolicySchema = exports.topologySourceRelationshipCandidateSchema = exports.topologyExistingEntityRefSchema = exports.topologySourceNodeCandidateSchema = exports.topologyAccessRefCandidateSchema = exports.topologyEntitySourceRefCandidateSchema = exports.topologySourceRefStatusSchema = exports.topologySyncWarningSchema = exports.topologySyncWarningSeveritySchema = exports.topologySyncCompletenessSchema = exports.topologySyncCompletenessStatusSchema = exports.topologySyncScopeSchema = exports.topologySyncIntentSchema = exports.topologySyncIntentOptionsSchema = exports.topologySourceIntentSchema = exports.topologySourceIntentIncludeSchema = exports.sourceSyncCapabilitySchema = exports.topologyFamilySchema = exports.integrationTopologyFamilySchema = exports.kubernetesTopologyFamilySchema = exports.awsTopologyFamilySchema = exports.topologyProviderInputSchema = exports.topologyProviderSchema = void 0;
3
+ exports.relatedServiceInfoSchema = exports.investigationResourceSchema = exports.targetServiceInfoSchema = exports.topologyInitializationStateSchema = exports.topologyPrimaryAnchorSchema = exports.topologyCandidateTargetSchema = exports.topologyReasonCodeSchema = exports.nestedTopologyResponseSchema = exports.nestedTopologyChildSchema = exports.nestedTopologyNodeSchema = exports.nestedTopologyRelationshipSchema = exports.diagnosticCriticalitySchema = exports.topologyApiErrorEnvelopeSchema = exports.topologyApiErrorCodeSchema = exports.credentialSourceBulkResponseSchema = exports.credentialSourceBulkRequestSchema = exports.credentialSourceSingleResponseSchema = exports.credentialSourceResultItemSchema = exports.credentialSourceExternalRefSchema = exports.credentialResolutionModeSchema = exports.credentialSourceEntityTypeSchema = exports.topologyRelationTypeSchema = exports.topologyResourceTypeSchema = exports.topologyCorrelationCandidateSchema = exports.topologyCorrelationDecisionSchema = exports.topologyCorrelationRuleMetadataSchema = exports.topologyCorrelationRequiredEndpointSchema = exports.topologyCorrelationApplyPolicySchema = exports.topologySourceRelationshipCandidateSchema = exports.topologyExistingEntityRefSchema = exports.topologySourceNodeCandidateSchema = exports.topologyAccessRefCandidateSchema = exports.topologyEntitySourceRefCandidateSchema = exports.topologySourceRefStatusSchema = exports.topologySyncWarningSchema = exports.topologySyncWarningSeveritySchema = exports.topologySyncCompletenessSchema = exports.topologySyncCompletenessStatusSchema = exports.topologySyncScopeSchema = exports.topologySyncIntentSchema = exports.topologySyncIntentOptionsSchema = exports.topologySourceIntentSchema = exports.topologySourceIntentIncludeSchema = exports.sourceSyncCapabilitySchema = exports.topologyFamilySchema = exports.integrationTopologyFamilySchema = exports.kubernetesTopologyFamilySchema = exports.awsTopologyFamilySchema = exports.topologyProviderInputSchema = exports.topologyProviderSchema = void 0;
4
+ exports.gatewayTopologyContextSchema = exports.topologyBindingHintsSchema = exports.topologyBindingHintSchema = exports.topologyInvestigationContextSchema = void 0;
4
5
  var providers_1 = require("../providers");
5
6
  Object.defineProperty(exports, "topologyProviderSchema", { enumerable: true, get: function () { return providers_1.topologyProviderSchema; } });
6
7
  Object.defineProperty(exports, "topologyProviderInputSchema", { enumerable: true, get: function () { return providers_1.topologyProviderInputSchema; } });
@@ -35,4 +36,31 @@ Object.defineProperty(exports, "topologyCorrelationCandidateSchema", { enumerabl
35
36
  var topology_1 = require("../topology");
36
37
  Object.defineProperty(exports, "topologyResourceTypeSchema", { enumerable: true, get: function () { return topology_1.topologyResourceTypeSchema; } });
37
38
  Object.defineProperty(exports, "topologyRelationTypeSchema", { enumerable: true, get: function () { return topology_1.topologyRelationTypeSchema; } });
39
+ var credential_source_1 = require("../credential-source");
40
+ Object.defineProperty(exports, "credentialSourceEntityTypeSchema", { enumerable: true, get: function () { return credential_source_1.credentialSourceEntityTypeSchema; } });
41
+ Object.defineProperty(exports, "credentialResolutionModeSchema", { enumerable: true, get: function () { return credential_source_1.credentialResolutionModeSchema; } });
42
+ Object.defineProperty(exports, "credentialSourceExternalRefSchema", { enumerable: true, get: function () { return credential_source_1.credentialSourceExternalRefSchema; } });
43
+ Object.defineProperty(exports, "credentialSourceResultItemSchema", { enumerable: true, get: function () { return credential_source_1.credentialSourceResultItemSchema; } });
44
+ Object.defineProperty(exports, "credentialSourceSingleResponseSchema", { enumerable: true, get: function () { return credential_source_1.credentialSourceSingleResponseSchema; } });
45
+ Object.defineProperty(exports, "credentialSourceBulkRequestSchema", { enumerable: true, get: function () { return credential_source_1.credentialSourceBulkRequestSchema; } });
46
+ Object.defineProperty(exports, "credentialSourceBulkResponseSchema", { enumerable: true, get: function () { return credential_source_1.credentialSourceBulkResponseSchema; } });
47
+ Object.defineProperty(exports, "topologyApiErrorCodeSchema", { enumerable: true, get: function () { return credential_source_1.topologyApiErrorCodeSchema; } });
48
+ Object.defineProperty(exports, "topologyApiErrorEnvelopeSchema", { enumerable: true, get: function () { return credential_source_1.topologyApiErrorEnvelopeSchema; } });
49
+ var investigation_1 = require("../investigation");
50
+ Object.defineProperty(exports, "diagnosticCriticalitySchema", { enumerable: true, get: function () { return investigation_1.diagnosticCriticalitySchema; } });
51
+ Object.defineProperty(exports, "nestedTopologyRelationshipSchema", { enumerable: true, get: function () { return investigation_1.nestedTopologyRelationshipSchema; } });
52
+ Object.defineProperty(exports, "nestedTopologyNodeSchema", { enumerable: true, get: function () { return investigation_1.nestedTopologyNodeSchema; } });
53
+ Object.defineProperty(exports, "nestedTopologyChildSchema", { enumerable: true, get: function () { return investigation_1.nestedTopologyChildSchema; } });
54
+ Object.defineProperty(exports, "nestedTopologyResponseSchema", { enumerable: true, get: function () { return investigation_1.nestedTopologyResponseSchema; } });
55
+ Object.defineProperty(exports, "topologyReasonCodeSchema", { enumerable: true, get: function () { return investigation_1.topologyReasonCodeSchema; } });
56
+ Object.defineProperty(exports, "topologyCandidateTargetSchema", { enumerable: true, get: function () { return investigation_1.topologyCandidateTargetSchema; } });
57
+ Object.defineProperty(exports, "topologyPrimaryAnchorSchema", { enumerable: true, get: function () { return investigation_1.topologyPrimaryAnchorSchema; } });
58
+ Object.defineProperty(exports, "topologyInitializationStateSchema", { enumerable: true, get: function () { return investigation_1.topologyInitializationStateSchema; } });
59
+ Object.defineProperty(exports, "targetServiceInfoSchema", { enumerable: true, get: function () { return investigation_1.targetServiceInfoSchema; } });
60
+ Object.defineProperty(exports, "investigationResourceSchema", { enumerable: true, get: function () { return investigation_1.investigationResourceSchema; } });
61
+ Object.defineProperty(exports, "relatedServiceInfoSchema", { enumerable: true, get: function () { return investigation_1.relatedServiceInfoSchema; } });
62
+ Object.defineProperty(exports, "topologyInvestigationContextSchema", { enumerable: true, get: function () { return investigation_1.topologyInvestigationContextSchema; } });
63
+ Object.defineProperty(exports, "topologyBindingHintSchema", { enumerable: true, get: function () { return investigation_1.topologyBindingHintSchema; } });
64
+ Object.defineProperty(exports, "topologyBindingHintsSchema", { enumerable: true, get: function () { return investigation_1.topologyBindingHintsSchema; } });
65
+ Object.defineProperty(exports, "gatewayTopologyContextSchema", { enumerable: true, get: function () { return investigation_1.gatewayTopologyContextSchema; } });
38
66
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schemas/index.ts"],"names":[],"mappings":";;;AAAA,0CAGsB;AAFpB,mHAAA,sBAAsB,OAAA;AACtB,wHAAA,2BAA2B,OAAA;AAG7B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yB,OAAA;AACzB,2HAAA,0BAA0B,OAAA;AAC1B,6HAAA,4BAA4B,OAAA"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const strict_1 = __importDefault(require("node:assert/strict"));
7
+ const node_test_1 = __importDefault(require("node:test"));
8
+ const src_1 = require("../src");
9
+ const credentialItem = {
10
+ found: true,
11
+ entity_id: 'res-k8s-deployment-123',
12
+ entity_type: 'resource',
13
+ root_type: 'kubernetes_cluster',
14
+ source_resource_id: 'res-k8s-cluster-1',
15
+ externalRef: {
16
+ provider: 'k8s',
17
+ external_id: 'cluster-1',
18
+ source_collection: 'kubernetes_clusters',
19
+ source_document_id: 'cluster-doc-1',
20
+ },
21
+ resolution_mode: 'root_refs',
22
+ reason_codes: ['ROOT_REFS_HIT'],
23
+ traversal_path: ['root_refs.kubernetes_cluster'],
24
+ error: null,
25
+ };
26
+ (0, node_test_1.default)('parses credential-source single success envelope', () => {
27
+ const parsed = src_1.credentialSourceSingleResponseSchema.parse({
28
+ status: 'success',
29
+ data: credentialItem,
30
+ gateway_extension: 'allowed',
31
+ });
32
+ strict_1.default.equal(parsed.status, 'success');
33
+ strict_1.default.equal(parsed.data.entity_id, 'res-k8s-deployment-123');
34
+ strict_1.default.equal(parsed.gateway_extension, 'allowed');
35
+ });
36
+ (0, node_test_1.default)('parses credential-source bulk request and partial success response', () => {
37
+ const request = src_1.credentialSourceBulkRequestSchema.parse({
38
+ requests: [
39
+ {
40
+ entity_type: 'resource',
41
+ entity_id: 'res-k8s-deployment-123',
42
+ root_type: 'kubernetes_cluster',
43
+ },
44
+ ],
45
+ });
46
+ const response = src_1.credentialSourceBulkResponseSchema.parse({
47
+ status: 'partial_success',
48
+ results: [
49
+ credentialItem,
50
+ {
51
+ found: false,
52
+ entity_id: 'res-k8s-deployment-999',
53
+ entity_type: 'resource',
54
+ root_type: 'kubernetes_cluster',
55
+ source_resource_id: null,
56
+ externalRef: null,
57
+ resolution_mode: 'not_found',
58
+ reason_codes: ['BFS_EXHAUSTED'],
59
+ traversal_path: [],
60
+ error: null,
61
+ },
62
+ ],
63
+ });
64
+ strict_1.default.equal(request.requests[0]?.entity_type, 'resource');
65
+ strict_1.default.equal(response.status, 'partial_success');
66
+ strict_1.default.equal(response.results[1]?.resolution_mode, 'not_found');
67
+ });
68
+ (0, node_test_1.default)('parses topology API error envelope with retry hint', () => {
69
+ const parsed = src_1.topologyApiErrorEnvelopeSchema.parse({
70
+ status: 'error',
71
+ correlation_id: 'inv-123',
72
+ timestamp: '2026-03-11T10:00:00.000Z',
73
+ error: {
74
+ code: 'RATE_LIMITED',
75
+ message: 'Rate limit exceeded',
76
+ details: null,
77
+ retry_after_seconds: 2,
78
+ },
79
+ });
80
+ strict_1.default.equal(parsed.error.code, 'RATE_LIMITED');
81
+ strict_1.default.equal(parsed.error.retry_after_seconds, 2);
82
+ });
83
+ //# sourceMappingURL=credential-source.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential-source.test.js","sourceRoot":"","sources":["../../test/credential-source.test.ts"],"names":[],"mappings":";;;;;AAAA,gEAAwC;AACxC,0DAA6B;AAC7B,gCAKgB;AAEhB,MAAM,cAAc,GAAG;IACrB,KAAK,EAAE,IAAI;IACX,SAAS,EAAE,wBAAwB;IACnC,WAAW,EAAE,UAAU;IACvB,SAAS,EAAE,oBAAoB;IAC/B,kBAAkB,EAAE,mBAAmB;IACvC,WAAW,EAAE;QACX,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,WAAW;QACxB,iBAAiB,EAAE,qBAAqB;QACxC,kBAAkB,EAAE,eAAe;KACpC;IACD,eAAe,EAAE,WAAW;IAC5B,YAAY,EAAE,CAAC,eAAe,CAAC;IAC/B,cAAc,EAAE,CAAC,8BAA8B,CAAC;IAChD,KAAK,EAA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;IAC3D,gBAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACjD,gBAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,WAAW,CAAC,CAAC;AAClE,CAAC,CAAC,CAAC;AAEH,IAAA,mBAAI,EAAC,oDAAoD,EAAE,GAAG,EAAE;IAC9D,MAAM,MAAM,GAAG,oCAA8B,CAAC,KAAK,CAAC;QAClD,MAAM,EAAE,OAAO;QACf,cAAc,EAAE,SAAS;QACzB,SAAS,EAAE,0BAA0B;QACrC,KAAK,EAAE;YACL,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE,qBAAqB;YAC9B,OAAO,EAAE,IAAI;YACb,mBAAmB,EAAE,CAAC;SACvB;KACF,CAAC,CAAC;IAEH,gBAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAChD,gBAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC;AACpD,CAAC,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const strict_1 = __importDefault(require("node:assert/strict"));
7
+ const node_test_1 = __importDefault(require("node:test"));
8
+ const src_1 = require("../src");
9
+ (0, node_test_1.default)('parses Gateway topology context DTO for Voyager', () => {
10
+ const parsed = src_1.gatewayTopologyContextSchema.parse({
11
+ version: src_1.GATEWAY_TOPOLOGY_CONTEXT_VERSION,
12
+ initialization: {
13
+ correlationState: 'probable_match',
14
+ resolvedVia: 'relationship_attribute_match',
15
+ confidence: 9,
16
+ reasonCodes: ['deterministic_service_match'],
17
+ candidateTargets: [{
18
+ entityType: 'service',
19
+ id: 'svc-checkout',
20
+ displayName: 'checkout',
21
+ confidence: 9,
22
+ }],
23
+ primaryAnchor: {
24
+ entityType: 'service',
25
+ id: 'svc-checkout',
26
+ displayName: 'checkout',
27
+ },
28
+ topologyScope: 'inferred',
29
+ userMessage: 'Gateway returned a topology slice for service checkout.',
30
+ topologyAvailable: true,
31
+ },
32
+ investigationContext: {
33
+ topologyAvailable: true,
34
+ targetService: {
35
+ id: 'svc-checkout',
36
+ name: 'checkout',
37
+ displayName: 'checkout',
38
+ serviceType: 'service',
39
+ criticality: 'unknown',
40
+ environment: 'unknown',
41
+ },
42
+ investigationResources: [],
43
+ recommendedSpecialists: [],
44
+ eligibleSpecialists: [],
45
+ relatedServices: { upstream: [], downstream: [] },
46
+ naturalLanguageSummary: 'Gateway returned a topology slice for service checkout.',
47
+ },
48
+ bindingHints: {
49
+ sourceIntegrationHint: {
50
+ provider: 'prometheus',
51
+ integrationId: 'prometheus-prod',
52
+ },
53
+ candidateBindings: [],
54
+ },
55
+ reasonCodes: ['deterministic_service_match'],
56
+ });
57
+ strict_1.default.equal(parsed.version, 'topology.gateway-context.v1');
58
+ strict_1.default.equal(parsed.initialization.primaryAnchor?.id, 'svc-checkout');
59
+ });
60
+ (0, node_test_1.default)('parses nested topology response DTO used inside Gateway topology slices', () => {
61
+ const parsed = src_1.nestedTopologyResponseSchema.parse({
62
+ status: 'success',
63
+ topology: {
64
+ entity_type: 'service',
65
+ id: 'svc-checkout',
66
+ entity: { name: 'checkout', display_name: 'checkout' },
67
+ root_refs: {},
68
+ children: [
69
+ {
70
+ relationship: {
71
+ id: 'rel-checkout-deployment',
72
+ relation: 'DEPLOYED_AS',
73
+ diagnostic_criticality: 'blocking',
74
+ attribute_schema_key: 'deployment.kubernetes',
75
+ attributes: { namespace: 'prod' },
76
+ },
77
+ entity_type: 'resource',
78
+ id: 'res-k8s-deployment-checkout',
79
+ entity: {
80
+ name: 'checkout-deployment',
81
+ resource_type: 'kubernetes_deployment',
82
+ provider: 'k8s',
83
+ },
84
+ children: [],
85
+ },
86
+ ],
87
+ },
88
+ stats: {
89
+ total_nodes: 2,
90
+ max_depth: 1,
91
+ structural_edges: 1,
92
+ associative_edges: 0,
93
+ },
94
+ });
95
+ strict_1.default.equal(parsed.topology.children[0]?.relationship.relation, 'DEPLOYED_AS');
96
+ });
97
+ //# sourceMappingURL=investigation-context.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"investigation-context.test.js","sourceRoot":"","sources":["../../test/investigation-context.test.ts"],"names":[],"mappings":";;;;;AAAA,gEAAwC;AACxC,0DAA6B;AAC7B,gCAIgB;AAEhB,IAAA,mBAAI,EAAC,iDAAiD,EAAE,GAAG,EAAE;IAC3D,MAAM,MAAM,GAAG,kCAA4B,CAAC,KAAK,CAAC;QAChD,OAAO,EAAE,sCAAgC;QACzC,cAAc,EAAE;YACd,gBAAgB,EAAE,gBAAgB;YAClC,WAAW,EAAE,8BAA8B;YAC3C,UAAU,EAAE,CAAC;YACb,WAAW,EAAE,CAAC,6BAA6B,CAAC;YAC5C,gBAAgB,EAAE,CAAC;oBACjB,UAAU,EAAE,SAAS;oBACrB,EAAE,EAAE,cAAc;oBAClB,WAAW,EAAE,UAAU;oBACvB,UAAU,EAAE,CAAC;iBACd,CAAC;YACF,aAAa,EAAE;gBACb,UAAU,EAAE,SAAS;gBACrB,EAAE,EAAE,cAAc;gBAClB,WAAW,EAAE,UAAU;aACxB;YACD,aAAa,EAAE,UAAU;YACzB,WAAW,EAAE,yDAAyD;YACtE,iBAAiB,EAAE,IAAI;SACxB;QACD,oBAAoB,EAAE;YACpB,iBAAiB,EAAE,IAAI;YACvB,aAAa,EAAE;gBACb,EAAE,EAAE,cAAc;gBAClB,IAAI,EAAE,UAAU;gBAChB,WAAW,EAAE,UAAU;gBACvB,WAAW,EAAE,SAAS;gBACtB,WAAW,EAAE,SAAS;gBACtB,WAAW,EAAE,SAAS;aACvB;YACD,sBAAsB,EAAE,EAAE;YA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iBACb;aACF;SACF;QACD,KAAK,EAAE;YACL,WAAW,EAAE,CAAC;YACd,SAAS,EAAE,CAAC;YACZ,gBAAgB,EAAE,CAAC;YACnB,iBAAiB,EAAE,CAAC;SACrB;KACF,CAAC,CAAC;IAEH,gBAAM,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;AAClF,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scoutflo/topology-contracts",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "Pure shared topology vocabulary and Zod schemas for Scoutflo topology workflows.",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",