@mytecz/teczflow-core 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/config.json +32 -0
- package/assets/fixtures/git/payment-schema-change.json +14 -0
- package/assets/fixtures/shopflow.openapi.yaml +178 -0
- package/assets/fixtures/shopflow.postman.json +60 -0
- package/assets/fixtures/telemetry/checkout-errors.json +87 -0
- package/dist/adapters/git.adapter.d.ts +11 -0
- package/dist/adapters/git.adapter.d.ts.map +1 -0
- package/dist/adapters/git.adapter.js +61 -0
- package/dist/adapters/git.adapter.js.map +1 -0
- package/dist/adapters/graphql.adapter.d.ts +11 -0
- package/dist/adapters/graphql.adapter.d.ts.map +1 -0
- package/dist/adapters/graphql.adapter.js +86 -0
- package/dist/adapters/graphql.adapter.js.map +1 -0
- package/dist/adapters/logs.adapter.d.ts +11 -0
- package/dist/adapters/logs.adapter.d.ts.map +1 -0
- package/dist/adapters/logs.adapter.js +47 -0
- package/dist/adapters/logs.adapter.js.map +1 -0
- package/dist/adapters/openapi.adapter.d.ts +12 -0
- package/dist/adapters/openapi.adapter.d.ts.map +1 -0
- package/dist/adapters/openapi.adapter.js +143 -0
- package/dist/adapters/openapi.adapter.js.map +1 -0
- package/dist/adapters/postman.adapter.d.ts +11 -0
- package/dist/adapters/postman.adapter.d.ts.map +1 -0
- package/dist/adapters/postman.adapter.js +91 -0
- package/dist/adapters/postman.adapter.js.map +1 -0
- package/dist/adapters/telemetry.adapter.d.ts +32 -0
- package/dist/adapters/telemetry.adapter.d.ts.map +1 -0
- package/dist/adapters/telemetry.adapter.js +61 -0
- package/dist/adapters/telemetry.adapter.js.map +1 -0
- package/dist/core/config.manager.d.ts +17 -0
- package/dist/core/config.manager.d.ts.map +1 -0
- package/dist/core/config.manager.js +133 -0
- package/dist/core/config.manager.js.map +1 -0
- package/dist/core/graph.engine.d.ts +29 -0
- package/dist/core/graph.engine.d.ts.map +1 -0
- package/dist/core/graph.engine.js +207 -0
- package/dist/core/graph.engine.js.map +1 -0
- package/dist/core/graph.store.d.ts +10 -0
- package/dist/core/graph.store.d.ts.map +1 -0
- package/dist/core/graph.store.js +17 -0
- package/dist/core/graph.store.js.map +1 -0
- package/dist/core/reasoning.engine.d.ts +37 -0
- package/dist/core/reasoning.engine.d.ts.map +1 -0
- package/dist/core/reasoning.engine.js +265 -0
- package/dist/core/reasoning.engine.js.map +1 -0
- package/dist/core/telemetry.normalizer.d.ts +11 -0
- package/dist/core/telemetry.normalizer.d.ts.map +1 -0
- package/dist/core/telemetry.normalizer.js +87 -0
- package/dist/core/telemetry.normalizer.js.map +1 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +136 -0
- package/dist/index.js.map +1 -0
- package/dist/services/index.d.ts +70 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +181 -0
- package/dist/services/index.js.map +1 -0
- package/dist/types/index.d.ts +187 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tenantMode": true,
|
|
3
|
+
"defaultTenant": "default",
|
|
4
|
+
"features": {
|
|
5
|
+
"openapi": true,
|
|
6
|
+
"postman": true,
|
|
7
|
+
"graphql": true,
|
|
8
|
+
"logs": true,
|
|
9
|
+
"git": true,
|
|
10
|
+
"observability": true,
|
|
11
|
+
"workflow_inference": true,
|
|
12
|
+
"impact_analysis": true,
|
|
13
|
+
"telemetry": true
|
|
14
|
+
},
|
|
15
|
+
"telemetry": {
|
|
16
|
+
"enabled": true,
|
|
17
|
+
"defaultWindow": "24h",
|
|
18
|
+
"providers": [
|
|
19
|
+
{
|
|
20
|
+
"id": "mock-shopflow",
|
|
21
|
+
"type": "mock",
|
|
22
|
+
"enabled": true,
|
|
23
|
+
"fixture": "./fixtures/telemetry/checkout-errors.json"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"telemetryProviders": {
|
|
28
|
+
"aws-cloudwatch": { "enabled": false },
|
|
29
|
+
"azure-monitor": { "enabled": false }
|
|
30
|
+
},
|
|
31
|
+
"tenants": {}
|
|
32
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"commit": {
|
|
3
|
+
"sha": "a1b2c3d4e5f6789012345678901234567890abcd",
|
|
4
|
+
"message": "feat(payment): add required billingAddress to PaymentRequest schema",
|
|
5
|
+
"author": "dev@shopflow.example.com"
|
|
6
|
+
},
|
|
7
|
+
"changes": [
|
|
8
|
+
{
|
|
9
|
+
"file": "payments",
|
|
10
|
+
"schema": "PaymentRequest",
|
|
11
|
+
"description": "Added billingAddress as required field on POST /payments"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
openapi: 3.0.3
|
|
2
|
+
info:
|
|
3
|
+
title: ShopFlow API
|
|
4
|
+
description: E-commerce API for cart, checkout, payment, inventory, shipping, invoice, and notifications
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
servers:
|
|
7
|
+
- url: https://api.shopflow.example.com/v1
|
|
8
|
+
tags:
|
|
9
|
+
- name: cart
|
|
10
|
+
description: Shopping cart operations
|
|
11
|
+
- name: checkout
|
|
12
|
+
description: Checkout workflow
|
|
13
|
+
- name: payment
|
|
14
|
+
description: Payment processing
|
|
15
|
+
- name: inventory
|
|
16
|
+
description: Inventory management
|
|
17
|
+
- name: shipping
|
|
18
|
+
description: Shipping and fulfillment
|
|
19
|
+
- name: invoice
|
|
20
|
+
description: Billing and invoices
|
|
21
|
+
- name: notification
|
|
22
|
+
description: Customer notifications
|
|
23
|
+
- name: order
|
|
24
|
+
description: Order management
|
|
25
|
+
components:
|
|
26
|
+
securitySchemes:
|
|
27
|
+
bearerAuth:
|
|
28
|
+
type: http
|
|
29
|
+
scheme: bearer
|
|
30
|
+
bearerFormat: JWT
|
|
31
|
+
schemas:
|
|
32
|
+
Cart:
|
|
33
|
+
type: object
|
|
34
|
+
required: [items]
|
|
35
|
+
properties:
|
|
36
|
+
items:
|
|
37
|
+
type: array
|
|
38
|
+
items:
|
|
39
|
+
type: object
|
|
40
|
+
properties:
|
|
41
|
+
productId:
|
|
42
|
+
type: string
|
|
43
|
+
quantity:
|
|
44
|
+
type: integer
|
|
45
|
+
PaymentRequest:
|
|
46
|
+
type: object
|
|
47
|
+
required: [orderId, amount, billingAddress]
|
|
48
|
+
properties:
|
|
49
|
+
orderId:
|
|
50
|
+
type: string
|
|
51
|
+
amount:
|
|
52
|
+
type: number
|
|
53
|
+
billingAddress:
|
|
54
|
+
type: string
|
|
55
|
+
Order:
|
|
56
|
+
type: object
|
|
57
|
+
properties:
|
|
58
|
+
id:
|
|
59
|
+
type: string
|
|
60
|
+
status:
|
|
61
|
+
type: string
|
|
62
|
+
security:
|
|
63
|
+
- bearerAuth: []
|
|
64
|
+
paths:
|
|
65
|
+
/cart:
|
|
66
|
+
post:
|
|
67
|
+
tags: [cart, checkout]
|
|
68
|
+
operationId: createCart
|
|
69
|
+
summary: Create shopping cart
|
|
70
|
+
requestBody:
|
|
71
|
+
content:
|
|
72
|
+
application/json:
|
|
73
|
+
schema:
|
|
74
|
+
$ref: '#/components/schemas/Cart'
|
|
75
|
+
responses:
|
|
76
|
+
'201':
|
|
77
|
+
description: Cart created
|
|
78
|
+
/cart/{cartId}/items:
|
|
79
|
+
post:
|
|
80
|
+
tags: [cart]
|
|
81
|
+
operationId: addCartItem
|
|
82
|
+
summary: Add item to cart
|
|
83
|
+
responses:
|
|
84
|
+
'200':
|
|
85
|
+
description: Item added
|
|
86
|
+
/orders:
|
|
87
|
+
post:
|
|
88
|
+
tags: [order, checkout]
|
|
89
|
+
operationId: createOrder
|
|
90
|
+
summary: Create order from cart
|
|
91
|
+
requestBody:
|
|
92
|
+
content:
|
|
93
|
+
application/json:
|
|
94
|
+
schema:
|
|
95
|
+
type: object
|
|
96
|
+
required: [cartId]
|
|
97
|
+
properties:
|
|
98
|
+
cartId:
|
|
99
|
+
type: string
|
|
100
|
+
responses:
|
|
101
|
+
'201':
|
|
102
|
+
description: Order created
|
|
103
|
+
/orders/{orderId}:
|
|
104
|
+
get:
|
|
105
|
+
tags: [order]
|
|
106
|
+
operationId: getOrder
|
|
107
|
+
summary: Get order by ID
|
|
108
|
+
responses:
|
|
109
|
+
'200':
|
|
110
|
+
description: Order details
|
|
111
|
+
/payments:
|
|
112
|
+
post:
|
|
113
|
+
tags: [payment, checkout]
|
|
114
|
+
operationId: processPayment
|
|
115
|
+
summary: Process payment for order
|
|
116
|
+
security:
|
|
117
|
+
- bearerAuth: []
|
|
118
|
+
requestBody:
|
|
119
|
+
content:
|
|
120
|
+
application/json:
|
|
121
|
+
schema:
|
|
122
|
+
$ref: '#/components/schemas/PaymentRequest'
|
|
123
|
+
responses:
|
|
124
|
+
'200':
|
|
125
|
+
description: Payment successful
|
|
126
|
+
'400':
|
|
127
|
+
description: Bad request - missing fields
|
|
128
|
+
'401':
|
|
129
|
+
description: Unauthorized
|
|
130
|
+
/payments/{paymentId}/refund:
|
|
131
|
+
post:
|
|
132
|
+
tags: [payment]
|
|
133
|
+
operationId: refundPayment
|
|
134
|
+
summary: Refund a payment
|
|
135
|
+
responses:
|
|
136
|
+
'200':
|
|
137
|
+
description: Refund processed
|
|
138
|
+
/inventory/reserve:
|
|
139
|
+
post:
|
|
140
|
+
tags: [inventory, checkout]
|
|
141
|
+
operationId: reserveInventory
|
|
142
|
+
summary: Reserve inventory for order
|
|
143
|
+
responses:
|
|
144
|
+
'200':
|
|
145
|
+
description: Inventory reserved
|
|
146
|
+
'409':
|
|
147
|
+
description: Insufficient inventory
|
|
148
|
+
/shipping:
|
|
149
|
+
post:
|
|
150
|
+
tags: [shipping, checkout]
|
|
151
|
+
operationId: createShipment
|
|
152
|
+
summary: Create shipment for order
|
|
153
|
+
responses:
|
|
154
|
+
'201':
|
|
155
|
+
description: Shipment created
|
|
156
|
+
/invoices:
|
|
157
|
+
post:
|
|
158
|
+
tags: [invoice, checkout]
|
|
159
|
+
operationId: createInvoice
|
|
160
|
+
summary: Generate invoice for order
|
|
161
|
+
responses:
|
|
162
|
+
'201':
|
|
163
|
+
description: Invoice created
|
|
164
|
+
get:
|
|
165
|
+
tags: [invoice]
|
|
166
|
+
operationId: listInvoices
|
|
167
|
+
summary: List invoices
|
|
168
|
+
responses:
|
|
169
|
+
'200':
|
|
170
|
+
description: Invoice list
|
|
171
|
+
/notifications/order-complete:
|
|
172
|
+
post:
|
|
173
|
+
tags: [notification, checkout]
|
|
174
|
+
operationId: notifyOrderComplete
|
|
175
|
+
summary: Send order completion notification
|
|
176
|
+
responses:
|
|
177
|
+
'202':
|
|
178
|
+
description: Notification queued
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"info": {
|
|
3
|
+
"name": "ShopFlow Checkout",
|
|
4
|
+
"description": "Postman collection for ShopFlow checkout workflow"
|
|
5
|
+
},
|
|
6
|
+
"item": [
|
|
7
|
+
{
|
|
8
|
+
"name": "Create Cart",
|
|
9
|
+
"request": {
|
|
10
|
+
"method": "POST",
|
|
11
|
+
"url": "{{baseUrl}}/cart",
|
|
12
|
+
"description": "Create shopping cart"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name": "Create Order",
|
|
17
|
+
"request": {
|
|
18
|
+
"method": "POST",
|
|
19
|
+
"url": "{{baseUrl}}/orders",
|
|
20
|
+
"description": "Create order from cart"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "Process Payment",
|
|
25
|
+
"request": {
|
|
26
|
+
"method": "POST",
|
|
27
|
+
"url": "{{baseUrl}}/payments",
|
|
28
|
+
"description": "Process payment"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "Reserve Inventory",
|
|
33
|
+
"request": {
|
|
34
|
+
"method": "POST",
|
|
35
|
+
"url": "{{baseUrl}}/inventory/reserve"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "Create Shipment",
|
|
40
|
+
"request": {
|
|
41
|
+
"method": "POST",
|
|
42
|
+
"url": "{{baseUrl}}/shipping"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "Generate Invoice",
|
|
47
|
+
"request": {
|
|
48
|
+
"method": "POST",
|
|
49
|
+
"url": "{{baseUrl}}/invoices"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "Refund Payment",
|
|
54
|
+
"request": {
|
|
55
|
+
"method": "POST",
|
|
56
|
+
"url": "{{baseUrl}}/payments/{paymentId}/refund"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"logs": [
|
|
3
|
+
{
|
|
4
|
+
"timestamp": "2026-06-28T10:15:00Z",
|
|
5
|
+
"method": "POST",
|
|
6
|
+
"path": "/payments",
|
|
7
|
+
"status": 400,
|
|
8
|
+
"latencyMs": 145,
|
|
9
|
+
"message": "missing required field: billingAddress",
|
|
10
|
+
"service": "payment-service",
|
|
11
|
+
"requestId": "req-abc123"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"timestamp": "2026-06-28T10:16:00Z",
|
|
15
|
+
"method": "POST",
|
|
16
|
+
"path": "/payments",
|
|
17
|
+
"status": 400,
|
|
18
|
+
"latencyMs": 132,
|
|
19
|
+
"message": "missing required field: billingAddress",
|
|
20
|
+
"service": "payment-service",
|
|
21
|
+
"requestId": "req-abc124"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"timestamp": "2026-06-28T10:17:00Z",
|
|
25
|
+
"method": "POST",
|
|
26
|
+
"path": "/payments",
|
|
27
|
+
"status": 401,
|
|
28
|
+
"latencyMs": 45,
|
|
29
|
+
"message": "Invalid or missing bearer token",
|
|
30
|
+
"service": "payment-service",
|
|
31
|
+
"requestId": "req-abc125"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"metrics": [
|
|
35
|
+
{
|
|
36
|
+
"name": "api.errors.4xx",
|
|
37
|
+
"value": 47,
|
|
38
|
+
"unit": "count",
|
|
39
|
+
"timestamp": "2026-06-28T10:00:00Z",
|
|
40
|
+
"tags": { "endpoint": "POST /payments", "service": "payment-service" }
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "api.latency.p99",
|
|
44
|
+
"value": 320,
|
|
45
|
+
"unit": "ms",
|
|
46
|
+
"timestamp": "2026-06-28T10:00:00Z",
|
|
47
|
+
"tags": { "endpoint": "POST /payments" }
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"traces": [
|
|
51
|
+
{
|
|
52
|
+
"traceId": "trace-checkout-001",
|
|
53
|
+
"spanId": "span-1",
|
|
54
|
+
"serviceName": "cart-service",
|
|
55
|
+
"operationName": "POST /cart",
|
|
56
|
+
"httpMethod": "POST",
|
|
57
|
+
"httpRoute": "/cart",
|
|
58
|
+
"statusCode": 201,
|
|
59
|
+
"durationMs": 85,
|
|
60
|
+
"timestamp": "2026-06-28T09:00:00Z"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"traceId": "trace-checkout-001",
|
|
64
|
+
"spanId": "span-2",
|
|
65
|
+
"parentSpanId": "span-1",
|
|
66
|
+
"serviceName": "order-service",
|
|
67
|
+
"operationName": "POST /orders",
|
|
68
|
+
"httpMethod": "POST",
|
|
69
|
+
"httpRoute": "/orders",
|
|
70
|
+
"statusCode": 201,
|
|
71
|
+
"durationMs": 120,
|
|
72
|
+
"timestamp": "2026-06-28T09:00:01Z"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"traceId": "trace-checkout-001",
|
|
76
|
+
"spanId": "span-3",
|
|
77
|
+
"parentSpanId": "span-2",
|
|
78
|
+
"serviceName": "payment-service",
|
|
79
|
+
"operationName": "POST /payments",
|
|
80
|
+
"httpMethod": "POST",
|
|
81
|
+
"httpRoute": "/payments",
|
|
82
|
+
"statusCode": 400,
|
|
83
|
+
"durationMs": 145,
|
|
84
|
+
"timestamp": "2026-06-28T09:00:02Z"
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AdapterInput, IngestResult, SourceAdapter, TenantContext } from '../types/index.js';
|
|
2
|
+
import type { GraphEngine } from '../core/graph.engine.js';
|
|
3
|
+
export declare class GitAdapter implements SourceAdapter {
|
|
4
|
+
private getGraph;
|
|
5
|
+
name: string;
|
|
6
|
+
format: string;
|
|
7
|
+
constructor(getGraph: (ctx: TenantContext) => GraphEngine);
|
|
8
|
+
canHandle(input: AdapterInput): boolean;
|
|
9
|
+
ingest(input: AdapterInput, ctx: TenantContext): Promise<IngestResult>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=git.adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/git.adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,qBAAa,UAAW,YAAW,aAAa;IAIlC,OAAO,CAAC,QAAQ;IAH5B,IAAI,SAAS;IACb,MAAM,SAAS;gBAEK,QAAQ,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,WAAW;IAEjE,SAAS,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO;IAIjC,MAAM,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;CAuD7E"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
export class GitAdapter {
|
|
3
|
+
getGraph;
|
|
4
|
+
name = 'git';
|
|
5
|
+
format = 'git';
|
|
6
|
+
constructor(getGraph) {
|
|
7
|
+
this.getGraph = getGraph;
|
|
8
|
+
}
|
|
9
|
+
canHandle(input) {
|
|
10
|
+
return input.format === 'git';
|
|
11
|
+
}
|
|
12
|
+
async ingest(input, ctx) {
|
|
13
|
+
const graph = this.getGraph(ctx);
|
|
14
|
+
const content = input.path ? readFileSync(input.path, 'utf-8') : input.content;
|
|
15
|
+
const data = JSON.parse(content);
|
|
16
|
+
let nodesAdded = 0;
|
|
17
|
+
let edgesAdded = 0;
|
|
18
|
+
const commitId = `git:${data.commit?.sha ?? 'unknown'}`;
|
|
19
|
+
graph.addNode({
|
|
20
|
+
id: commitId,
|
|
21
|
+
type: 'Schema',
|
|
22
|
+
label: `Commit ${data.commit?.sha?.slice(0, 7) ?? 'unknown'}`,
|
|
23
|
+
properties: {
|
|
24
|
+
message: data.commit?.message,
|
|
25
|
+
author: data.commit?.author,
|
|
26
|
+
changes: data.changes,
|
|
27
|
+
source: 'github-mock'
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
nodesAdded++;
|
|
31
|
+
for (const change of data.changes ?? []) {
|
|
32
|
+
const affected = graph.findNodesByLabel(change.file ?? '', 'Endpoint');
|
|
33
|
+
for (const ep of affected) {
|
|
34
|
+
graph.addEdge({
|
|
35
|
+
id: `${commitId}-affects-${ep.id}`,
|
|
36
|
+
source: commitId,
|
|
37
|
+
target: ep.id,
|
|
38
|
+
type: 'triggers',
|
|
39
|
+
properties: { change: change.description }
|
|
40
|
+
});
|
|
41
|
+
edgesAdded++;
|
|
42
|
+
}
|
|
43
|
+
if (change.schema) {
|
|
44
|
+
const schemas = graph.getNodes('Schema').filter((s) => s.label.toLowerCase().includes(change.schema.toLowerCase()));
|
|
45
|
+
for (const schema of schemas) {
|
|
46
|
+
graph.addEdge({
|
|
47
|
+
id: `${commitId}-schema-${schema.id}`,
|
|
48
|
+
source: commitId,
|
|
49
|
+
target: schema.id,
|
|
50
|
+
type: 'triggers',
|
|
51
|
+
properties: { change: change.description }
|
|
52
|
+
});
|
|
53
|
+
edgesAdded++;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
graph.rebuildSearchIndex();
|
|
58
|
+
return { nodesAdded, edgesAdded, source: this.name };
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=git.adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.adapter.js","sourceRoot":"","sources":["../../src/adapters/git.adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAIvC,MAAM,OAAO,UAAU;IAID;IAHpB,IAAI,GAAG,KAAK,CAAC;IACb,MAAM,GAAG,KAAK,CAAC;IAEf,YAAoB,QAA6C;QAA7C,aAAQ,GAAR,QAAQ,CAAqC;IAAG,CAAC;IAErE,SAAS,CAAC,KAAmB;QAC3B,OAAO,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,KAAmB,EAAE,GAAkB;QAClD,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACjC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAQ,CAAC;QAChF,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAqB,CAAC;QAErD,IAAI,UAAU,GAAG,CAAC,CAAC;QACnB,IAAI,UAAU,GAAG,CAAC,CAAC;QAEnB,MAAM,QAAQ,GAAG,OAAO,IAAI,CAAC,MAAM,EAAE,GAAG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AAC;gBACF,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;oBAC7B,KAAK,CAAC,OAAO,CAAC;wBACZ,EAAE,EAAE,GAAG,QAAQ,WAAW,MAAM,CAAC,EAAE,EAAE;wBACrC,MAAM,EAAE,QAAQ;wBAChB,MAAM,EAAE,MAAM,CAAC,EAAE;wBACjB,IAAI,EAAE,UAAU;wBAChB,UAAU,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE;qBAC3C,CAAC,CAAC;oBACH,UAAU,EAAE,CAAC;gBACf,CAAC;YACH,CAAC;QACH,CAAC;QAED,KAAK,CAAC,kBAAkB,EAAE,CAAC;QAC3B,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;IACvD,CAAC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AdapterInput, IngestResult, SourceAdapter, TenantContext } from '../types/index.js';
|
|
2
|
+
import type { GraphEngine } from '../core/graph.engine.js';
|
|
3
|
+
export declare class GraphqlAdapter implements SourceAdapter {
|
|
4
|
+
private getGraph;
|
|
5
|
+
name: string;
|
|
6
|
+
format: string;
|
|
7
|
+
constructor(getGraph: (ctx: TenantContext) => GraphEngine);
|
|
8
|
+
canHandle(input: AdapterInput): boolean;
|
|
9
|
+
ingest(input: AdapterInput, ctx: TenantContext): Promise<IngestResult>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=graphql.adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql.adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/graphql.adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,qBAAa,cAAe,YAAW,aAAa;IAItC,OAAO,CAAC,QAAQ;IAH5B,IAAI,SAAa;IACjB,MAAM,SAAa;gBAEC,QAAQ,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,WAAW;IAEjE,SAAS,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO;IAIjC,MAAM,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;CAuE7E"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
export class GraphqlAdapter {
|
|
3
|
+
getGraph;
|
|
4
|
+
name = 'graphql';
|
|
5
|
+
format = 'graphql';
|
|
6
|
+
constructor(getGraph) {
|
|
7
|
+
this.getGraph = getGraph;
|
|
8
|
+
}
|
|
9
|
+
canHandle(input) {
|
|
10
|
+
return input.format === 'graphql' || Boolean(input.path?.match(/\.(graphql|gql)$/i));
|
|
11
|
+
}
|
|
12
|
+
async ingest(input, ctx) {
|
|
13
|
+
const graph = this.getGraph(ctx);
|
|
14
|
+
const content = input.path ? readFileSync(input.path, 'utf-8') : input.content;
|
|
15
|
+
const apiId = 'api:graphql:schema';
|
|
16
|
+
let nodesAdded = 0;
|
|
17
|
+
let edgesAdded = 0;
|
|
18
|
+
graph.addNode({
|
|
19
|
+
id: apiId,
|
|
20
|
+
type: 'API',
|
|
21
|
+
label: 'GraphQL Schema',
|
|
22
|
+
properties: { source: 'graphql' }
|
|
23
|
+
});
|
|
24
|
+
nodesAdded++;
|
|
25
|
+
const typeMatches = content.matchAll(/type\s+(\w+)\s*\{([^}]+)\}/g);
|
|
26
|
+
for (const match of typeMatches) {
|
|
27
|
+
const typeName = match[1];
|
|
28
|
+
const schemaId = `schema:graphql:${typeName}`;
|
|
29
|
+
graph.addNode({
|
|
30
|
+
id: schemaId,
|
|
31
|
+
type: 'Schema',
|
|
32
|
+
label: typeName,
|
|
33
|
+
properties: { kind: 'graphql-type', fields: match[2].trim() }
|
|
34
|
+
});
|
|
35
|
+
nodesAdded++;
|
|
36
|
+
graph.addEdge({
|
|
37
|
+
id: `${schemaId}-belongs-${apiId}`,
|
|
38
|
+
source: schemaId,
|
|
39
|
+
target: apiId,
|
|
40
|
+
type: 'belongs_to'
|
|
41
|
+
});
|
|
42
|
+
edgesAdded++;
|
|
43
|
+
}
|
|
44
|
+
const queryMatch = content.match(/type\s+Query\s*\{([^}]+)\}/);
|
|
45
|
+
const mutationMatch = content.match(/type\s+Mutation\s*\{([^}]+)\}/);
|
|
46
|
+
if (queryMatch) {
|
|
47
|
+
for (const field of parseFields(queryMatch[1])) {
|
|
48
|
+
const endpointId = `endpoint:QUERY:${field}`;
|
|
49
|
+
graph.addNode({
|
|
50
|
+
id: endpointId,
|
|
51
|
+
type: 'Endpoint',
|
|
52
|
+
label: `QUERY ${field}`,
|
|
53
|
+
properties: { method: 'QUERY', path: `/${field}`, apiId, tags: ['graphql'] }
|
|
54
|
+
});
|
|
55
|
+
nodesAdded++;
|
|
56
|
+
graph.addEdge({ id: `${endpointId}-${apiId}`, source: endpointId, target: apiId, type: 'belongs_to' });
|
|
57
|
+
edgesAdded++;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (mutationMatch) {
|
|
61
|
+
for (const field of parseFields(mutationMatch[1])) {
|
|
62
|
+
const endpointId = `endpoint:MUTATION:${field}`;
|
|
63
|
+
graph.addNode({
|
|
64
|
+
id: endpointId,
|
|
65
|
+
type: 'Endpoint',
|
|
66
|
+
label: `MUTATION ${field}`,
|
|
67
|
+
properties: { method: 'MUTATION', path: `/${field}`, apiId, tags: ['graphql'] }
|
|
68
|
+
});
|
|
69
|
+
nodesAdded++;
|
|
70
|
+
graph.addEdge({ id: `${endpointId}-${apiId}`, source: endpointId, target: apiId, type: 'belongs_to' });
|
|
71
|
+
edgesAdded++;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
graph.rebuildSearchIndex();
|
|
75
|
+
return { nodesAdded, edgesAdded, source: this.name };
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function parseFields(body) {
|
|
79
|
+
return body
|
|
80
|
+
.split('\n')
|
|
81
|
+
.map((l) => l.trim())
|
|
82
|
+
.filter((l) => l && !l.startsWith('#'))
|
|
83
|
+
.map((l) => l.split(/[:(]/)[0].trim())
|
|
84
|
+
.filter(Boolean);
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=graphql.adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql.adapter.js","sourceRoot":"","sources":["../../src/adapters/graphql.adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAIvC,MAAM,OAAO,cAAc;IAIL;IAHpB,IAAI,GAAG,SAAS,CAAC;IACjB,MAAM,GAAG,SAAS,CAAC;IAEnB,YAAoB,QAA6C;QAA7C,aAAQ,GAAR,QAAQ,CAAqC;IAAG,CAAC;IAErE,SAAS,CAAC,KAAmB;QAC3B,OAAO,KAAK,CAAC,MAAM,KAAK,SAAS,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC;IACvF,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,KAAmB,EAAE,GAAkB;QAClD,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACjC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAQ,CAAC;QAChF,MAAM,KAAK,GAAG,oBAAoB,CAAC;QACnC,IAAI,UAAU,GAAG,CAAC,CAAC;QACnB,IAAI,UAAU,GAAG,CAAC,CAAC;QAEnB,KAAK,CAAC,OAAO,CAAC;YACZ,EAAE,EAAE,KAAK;YACT,IAAI,EAAE,KAAK;YACX,KAAK,EAAE,gB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AAI;SACR,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACpB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;SACtC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACrC,MAAM,CAAC,OAAO,CAAC,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AdapterInput, IngestResult, SourceAdapter, TenantContext } from '../types/index.js';
|
|
2
|
+
import type { GraphEngine } from '../core/graph.engine.js';
|
|
3
|
+
export declare class LogsAdapter implements SourceAdapter {
|
|
4
|
+
private getGraph;
|
|
5
|
+
name: string;
|
|
6
|
+
format: string;
|
|
7
|
+
constructor(getGraph: (ctx: TenantContext) => GraphEngine);
|
|
8
|
+
canHandle(input: AdapterInput): boolean;
|
|
9
|
+
ingest(input: AdapterInput, ctx: TenantContext): Promise<IngestResult>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=logs.adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/logs.adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,qBAAa,WAAY,YAAW,aAAa;IAInC,OAAO,CAAC,QAAQ;IAH5B,IAAI,SAAU;IACd,MAAM,SAAU;gBAEI,QAAQ,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,WAAW;IAEjE,SAAS,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO;IAIjC,MAAM,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;CAoC7E"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
export class LogsAdapter {
|
|
3
|
+
getGraph;
|
|
4
|
+
name = 'logs';
|
|
5
|
+
format = 'logs';
|
|
6
|
+
constructor(getGraph) {
|
|
7
|
+
this.getGraph = getGraph;
|
|
8
|
+
}
|
|
9
|
+
canHandle(input) {
|
|
10
|
+
return input.format === 'logs';
|
|
11
|
+
}
|
|
12
|
+
async ingest(input, ctx) {
|
|
13
|
+
const graph = this.getGraph(ctx);
|
|
14
|
+
const content = input.path ? readFileSync(input.path, 'utf-8') : input.content;
|
|
15
|
+
const data = JSON.parse(content);
|
|
16
|
+
let nodesAdded = 0;
|
|
17
|
+
let edgesAdded = 0;
|
|
18
|
+
for (const event of data.events ?? []) {
|
|
19
|
+
if (!event.method || !event.path)
|
|
20
|
+
continue;
|
|
21
|
+
const ep = graph.findEndpointByPath(event.method, event.path);
|
|
22
|
+
if (!ep)
|
|
23
|
+
continue;
|
|
24
|
+
if (event.status && event.status >= 400) {
|
|
25
|
+
const errorId = `log-error:${event.requestId ?? Date.now()}`;
|
|
26
|
+
graph.addNode({
|
|
27
|
+
id: errorId,
|
|
28
|
+
type: 'Response',
|
|
29
|
+
label: `Log Error ${event.status}`,
|
|
30
|
+
properties: { ...event, source: 'splunk-mock' }
|
|
31
|
+
});
|
|
32
|
+
nodesAdded++;
|
|
33
|
+
graph.addEdge({
|
|
34
|
+
id: `${ep.id}-log-${errorId}`,
|
|
35
|
+
source: ep.id,
|
|
36
|
+
target: errorId,
|
|
37
|
+
type: 'observed_error',
|
|
38
|
+
properties: { message: event.message }
|
|
39
|
+
});
|
|
40
|
+
edgesAdded++;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
graph.rebuildSearchIndex();
|
|
44
|
+
return { nodesAdded, edgesAdded, source: this.name };
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=logs.adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.adapter.js","sourceRoot":"","sources":["../../src/adapters/logs.adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAIvC,MAAM,OAAO,WAAW;IAIF;IAHpB,IAAI,GAAG,MAAM,CAAC;IACd,MAAM,GAAG,MAAM,CAAC;IAEhB,YAAoB,QAA6C;QAA7C,aAAQ,GAAR,QAAQ,CAAqC;IAAG,CAAC;IAErE,SAAS,CAAC,KAAmB;QAC3B,OAAO,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC;IACjC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,KAAmB,EAAE,GAAkB;QAClD,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACjC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAQ,CAAC;QAChF,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAA4B,CAAC;QAE5D,IAAI,UAAU,GAAG,CAAC,CAAC;QACnB,IAAI,UAAU,GAAG,CAAC,CAAC;QAEnB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC;YACtC,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI;gBAAE,SAAS;YAC3C,MAAM,EAAE,GAAG,KAAK,CAAC,kBAAkB,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;YAC9D,IAAI,CAAC,EAAE;gBAAE,SAAS;YAElB,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC;gBACxC,MAAM,OAAO,GAAG,aAAa,KAAK,CAAC,SAAS,IAAI,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;gBAC7D,KAAK,CAAC,OAAO,CAAC;oBACZ,EAAE,EAAE,OAAO;oBACX,IAAI,EAAE,UAAU;oBAChB,KAAK,EAAE,aAAa,KAAK,CAAC,MAAM,EAAE;oBAClC,UAAU,EAAE,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE;iBAChD,CAAC,CAAC;gBACH,UAAU,EAAE,CAAC;gBACb,KAAK,CAAC,OAAO,CAAC;oBACZ,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,QAAQ,OAAO,EAAE;oBAC7B,MAAM,EAAE,EAAE,CAAC,EAAE;oBACb,MAAM,EAAE,OAAO;oBACf,IAAI,EAAE,gBAAgB;oBACtB,UAAU,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE;iBACvC,CAAC,CAAC;gBACH,UAAU,EAAE,CAAC;YACf,CAAC;QACH,CAAC;QAED,KAAK,CAAC,kBAAkB,EAAE,CAAC;QAC3B,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;IACvD,CAAC;CACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AdapterInput, IngestResult, SourceAdapter, TenantContext } from '../types/index.js';
|
|
2
|
+
import type { GraphEngine } from '../core/graph.engine.js';
|
|
3
|
+
export declare class OpenApiAdapter implements SourceAdapter {
|
|
4
|
+
private getGraph;
|
|
5
|
+
name: string;
|
|
6
|
+
format: string;
|
|
7
|
+
constructor(getGraph: (ctx: TenantContext) => GraphEngine);
|
|
8
|
+
canHandle(input: AdapterInput): boolean;
|
|
9
|
+
ingest(input: AdapterInput, ctx: TenantContext): Promise<IngestResult>;
|
|
10
|
+
}
|
|
11
|
+
export { OpenApiAdapter as default };
|
|
12
|
+
//# sourceMappingURL=openapi.adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi.adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/openapi.adapter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,qBAAa,cAAe,YAAW,aAAa;IAItC,OAAO,CAAC,QAAQ;IAH5B,IAAI,SAAa;IACjB,MAAM,SAAa;gBAEC,QAAQ,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,WAAW;IAEjE,SAAS,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO;IAYjC,MAAM,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;CAiG7E;AAoDD,OAAO,EAAE,cAAc,IAAI,OAAO,EAAE,CAAC"}
|