@echovisionlab/geul-telemetry 0.1.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/LICENSE.md +6 -0
- package/README.md +38 -0
- package/fixtures/audit-records.json +316 -0
- package/fixtures/collaboration-checkpoint-entity-types.json +15 -0
- package/fixtures/domain-audit-actions.json +132 -0
- package/fixtures/domain-audit-wire-parity.json +1751 -0
- package/fixtures/http-request-results.json +21 -0
- package/fixtures/job-catalog.json +23 -0
- package/fixtures/locale-content-audit.json +126 -0
- package/fixtures/log-redaction.json +72 -0
- package/fixtures/request-record.json +14 -0
- package/fixtures/security-access-records.json +61 -0
- package/fixtures/service-identities.json +11 -0
- package/fixtures/system-catalog.json +28 -0
- package/fixtures/translation-job-terminal-catalog.json +45 -0
- package/fixtures/translation-settings-fields.json +1 -0
- package/package.json +61 -0
- package/policy/log-redaction.json +113 -0
- package/src/actor.ts +81 -0
- package/src/audit/account.ts +206 -0
- package/src/audit/actor-policy.ts +63 -0
- package/src/audit/artist-label.ts +312 -0
- package/src/audit/attributes.ts +107 -0
- package/src/audit/builder.ts +25 -0
- package/src/audit/catalog.ts +116 -0
- package/src/audit/content.ts +723 -0
- package/src/audit/email-authoring.ts +220 -0
- package/src/audit/file.ts +168 -0
- package/src/audit/form.ts +229 -0
- package/src/audit/integrations.ts +207 -0
- package/src/audit/locale-code.ts +6 -0
- package/src/audit/locale-content.ts +358 -0
- package/src/audit/member-account.ts +313 -0
- package/src/audit/member.ts +171 -0
- package/src/audit/program.ts +339 -0
- package/src/audit/reference-data.ts +230 -0
- package/src/audit/reference-entities.ts +332 -0
- package/src/audit/relation-download-policy.ts +292 -0
- package/src/audit/release-campaign.ts +422 -0
- package/src/audit/series-type.ts +298 -0
- package/src/audit/settings.ts +306 -0
- package/src/audit/source-locale.ts +337 -0
- package/src/audit/types.ts +9 -0
- package/src/audit.ts +21 -0
- package/src/authentication.ts +183 -0
- package/src/error-metadata.ts +11 -0
- package/src/index.ts +11 -0
- package/src/job.ts +56 -0
- package/src/log-attribute-policy.ts +21 -0
- package/src/otel.ts +64 -0
- package/src/records.ts +1244 -0
- package/src/redaction.ts +35 -0
- package/src/request-context.ts +73 -0
- package/src/request-id.ts +13 -0
- package/src/request-result.ts +73 -0
- package/src/request.ts +60 -0
- package/src/system.ts +355 -0
- package/src/trace.ts +13 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
[
|
|
2
|
+
{ "status_code": 100, "outcome": "succeeded" },
|
|
3
|
+
{ "status_code": 200, "outcome": "succeeded" },
|
|
4
|
+
{ "status_code": 302, "outcome": "succeeded" },
|
|
5
|
+
{ "status_code": 400, "outcome": "failed", "reason": "client_error" },
|
|
6
|
+
{
|
|
7
|
+
"status_code": 401,
|
|
8
|
+
"outcome": "blocked",
|
|
9
|
+
"reason": "authentication_required"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"status_code": 403,
|
|
13
|
+
"outcome": "blocked",
|
|
14
|
+
"reason": "permission_denied"
|
|
15
|
+
},
|
|
16
|
+
{ "status_code": 404, "outcome": "failed", "reason": "client_error" },
|
|
17
|
+
{ "status_code": 429, "outcome": "blocked", "reason": "rate_limited" },
|
|
18
|
+
{ "status_code": 499, "outcome": "failed", "reason": "client_error" },
|
|
19
|
+
{ "status_code": 500, "outcome": "failed", "reason": "server_error" },
|
|
20
|
+
{ "status_code": 599, "outcome": "failed", "reason": "server_error" }
|
|
21
|
+
]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"job_kind": "mesh_optimization",
|
|
4
|
+
"failure_reasons": [
|
|
5
|
+
"rejected",
|
|
6
|
+
"source_not_found",
|
|
7
|
+
"download_failed",
|
|
8
|
+
"optimization_failed",
|
|
9
|
+
"upload_failed",
|
|
10
|
+
"internal"
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"job_kind": "og_generation",
|
|
15
|
+
"failure_reasons": [
|
|
16
|
+
"invalid_claim",
|
|
17
|
+
"source_rejected",
|
|
18
|
+
"processing_failed",
|
|
19
|
+
"integrity_failed",
|
|
20
|
+
"completion_rejected"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
]
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"case": "post locale created",
|
|
4
|
+
"action": "post.updated",
|
|
5
|
+
"target_type": "post",
|
|
6
|
+
"target_id": "post-1",
|
|
7
|
+
"locale": "ko",
|
|
8
|
+
"item_operation": "created"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"case": "page locale updated",
|
|
12
|
+
"action": "page.updated",
|
|
13
|
+
"target_type": "page",
|
|
14
|
+
"target_id": "page-1",
|
|
15
|
+
"locale": "en-US",
|
|
16
|
+
"item_operation": "updated"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"case": "work locale deleted",
|
|
20
|
+
"action": "work.updated",
|
|
21
|
+
"target_type": "work",
|
|
22
|
+
"target_id": "work-1",
|
|
23
|
+
"locale": "ja",
|
|
24
|
+
"item_operation": "deleted"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"case": "post series locale updated",
|
|
28
|
+
"action": "post_series.updated",
|
|
29
|
+
"target_type": "post_series",
|
|
30
|
+
"target_id": "series-1",
|
|
31
|
+
"locale": "fr",
|
|
32
|
+
"item_operation": "updated"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"case": "program event locale updated",
|
|
36
|
+
"action": "program_event.updated",
|
|
37
|
+
"target_type": "program_event",
|
|
38
|
+
"target_id": "event-1",
|
|
39
|
+
"locale": "de",
|
|
40
|
+
"item_operation": "updated"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"case": "release locale updated",
|
|
44
|
+
"action": "release.updated",
|
|
45
|
+
"target_type": "release",
|
|
46
|
+
"target_id": "release-1",
|
|
47
|
+
"locale": "es-419",
|
|
48
|
+
"item_operation": "updated"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"case": "artist locale updated",
|
|
52
|
+
"action": "artist.updated",
|
|
53
|
+
"target_type": "artist",
|
|
54
|
+
"target_id": "artist-1",
|
|
55
|
+
"locale": "pt-PT",
|
|
56
|
+
"item_operation": "updated"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"case": "label locale updated",
|
|
60
|
+
"action": "label.updated",
|
|
61
|
+
"target_type": "label",
|
|
62
|
+
"target_id": "label-1",
|
|
63
|
+
"locale": "it",
|
|
64
|
+
"item_operation": "updated"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"case": "menu locale updated",
|
|
68
|
+
"action": "menu.updated",
|
|
69
|
+
"target_type": "menu",
|
|
70
|
+
"target_id": "menu-1",
|
|
71
|
+
"locale": "zh-CN",
|
|
72
|
+
"item_operation": "updated"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"case": "campaign locale updated",
|
|
76
|
+
"action": "campaign.updated",
|
|
77
|
+
"target_type": "campaign",
|
|
78
|
+
"target_id": "campaign-1",
|
|
79
|
+
"locale": "nl",
|
|
80
|
+
"item_operation": "updated"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"case": "form locale updated",
|
|
84
|
+
"action": "form.updated",
|
|
85
|
+
"target_type": "form",
|
|
86
|
+
"target_id": "form-1",
|
|
87
|
+
"locale": "pl",
|
|
88
|
+
"item_operation": "updated"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"case": "email template locale updated",
|
|
92
|
+
"action": "email_template.updated",
|
|
93
|
+
"target_type": "email_template",
|
|
94
|
+
"target_id": "template-1",
|
|
95
|
+
"locale": "ru",
|
|
96
|
+
"item_operation": "updated"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"case": "email layout locale updated",
|
|
100
|
+
"action": "email_layout.updated",
|
|
101
|
+
"target_type": "email_layout",
|
|
102
|
+
"target_id": "layout-1",
|
|
103
|
+
"locale": "tr",
|
|
104
|
+
"item_operation": "updated"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"case": "privacy locale updated",
|
|
108
|
+
"action": "legal_policy.updated",
|
|
109
|
+
"target_type": "legal_policy",
|
|
110
|
+
"target_id": "privacy-1",
|
|
111
|
+
"locale": "vi",
|
|
112
|
+
"item_operation": "updated",
|
|
113
|
+
"policy_type": "privacy",
|
|
114
|
+
"version_number": 2
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"case": "terms locale updated",
|
|
118
|
+
"action": "legal_policy.updated",
|
|
119
|
+
"target_type": "legal_policy",
|
|
120
|
+
"target_id": "terms-1",
|
|
121
|
+
"locale": "th",
|
|
122
|
+
"item_operation": "updated",
|
|
123
|
+
"policy_type": "terms",
|
|
124
|
+
"version_number": 1
|
|
125
|
+
}
|
|
126
|
+
]
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"forbidden": [
|
|
3
|
+
{ "key": "api_key", "normalized": "api_key" },
|
|
4
|
+
{ "key": "APIKey", "normalized": "apikey" },
|
|
5
|
+
{ "key": "translation.api-key", "normalized": "translation_api_key" },
|
|
6
|
+
{
|
|
7
|
+
"key": "provider.document.id",
|
|
8
|
+
"normalized": "provider_document_id"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"key": "translationProviderDocumentKey",
|
|
12
|
+
"normalized": "translation_provider_document_key"
|
|
13
|
+
},
|
|
14
|
+
{ "key": "XLIFF", "normalized": "xliff" },
|
|
15
|
+
{ "key": "translation-xliff", "normalized": "translation_xliff" },
|
|
16
|
+
{ "key": "sourceText", "normalized": "source_text" },
|
|
17
|
+
{ "key": "target.text", "normalized": "target_text" },
|
|
18
|
+
{
|
|
19
|
+
"key": "translationTranslatedText",
|
|
20
|
+
"normalized": "translation_translated_text"
|
|
21
|
+
},
|
|
22
|
+
{ "key": "systemPrompt", "normalized": "system_prompt" },
|
|
23
|
+
{ "key": "glossary", "normalized": "glossary" },
|
|
24
|
+
{
|
|
25
|
+
"key": "translationGlossary",
|
|
26
|
+
"normalized": "translation_glossary"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"key": "translationGlossaryPayload",
|
|
30
|
+
"normalized": "translation_glossary_payload"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"key": "translationContextPayload",
|
|
34
|
+
"normalized": "translation_context_payload"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"key": "providerRequestBody",
|
|
38
|
+
"normalized": "provider_request_body"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"key": "provider.response.body",
|
|
42
|
+
"normalized": "provider_response_body"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"key": "providerResponseMessage",
|
|
46
|
+
"normalized": "provider_response_message"
|
|
47
|
+
},
|
|
48
|
+
{ "key": "providerError", "normalized": "provider_error" },
|
|
49
|
+
{
|
|
50
|
+
"key": "translationProviderRawError",
|
|
51
|
+
"normalized": "translation_provider_raw_error"
|
|
52
|
+
},
|
|
53
|
+
{ "key": "raw-error", "normalized": "raw_error" },
|
|
54
|
+
{ "key": "error.message", "normalized": "error_message" }
|
|
55
|
+
],
|
|
56
|
+
"allowed": [
|
|
57
|
+
{ "key": "provider", "normalized": "provider" },
|
|
58
|
+
{ "key": "providerType", "normalized": "provider_type" },
|
|
59
|
+
{ "key": "model", "normalized": "model" },
|
|
60
|
+
{ "key": "modelCatalogValue", "normalized": "model_catalog_value" },
|
|
61
|
+
{ "key": "operation", "normalized": "operation" },
|
|
62
|
+
{ "key": "HTTP status class", "normalized": "http_status_class" },
|
|
63
|
+
{ "key": "exceptionType", "normalized": "exception_type" },
|
|
64
|
+
{ "key": "reason", "normalized": "reason" },
|
|
65
|
+
{ "key": "failureReason", "normalized": "failure_reason" },
|
|
66
|
+
{
|
|
67
|
+
"key": "providerDocumentSubmittedAt",
|
|
68
|
+
"normalized": "provider_document_submitted_at"
|
|
69
|
+
},
|
|
70
|
+
{ "key": "promptLength", "normalized": "prompt_length" }
|
|
71
|
+
]
|
|
72
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"event": "request.completed",
|
|
3
|
+
"occurred_at": "2026-08-09T03:04:05Z",
|
|
4
|
+
"request_id": "018f47a2-8a3d-4e17-9d42-6f12c89b1234",
|
|
5
|
+
"trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
|
|
6
|
+
"span_id": "00f067aa0ba902b7",
|
|
7
|
+
"actor_kind": "member",
|
|
8
|
+
"actor_member_id": "member_123",
|
|
9
|
+
"http_method": "PATCH",
|
|
10
|
+
"http_route": "/posts/{post_id}",
|
|
11
|
+
"status_code": 200,
|
|
12
|
+
"duration_ms": 42,
|
|
13
|
+
"outcome": "succeeded"
|
|
14
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"access_id": "7a7a8fd4-1f69-4e9a-9dc2-2378926ff351",
|
|
4
|
+
"occurred_at": "2026-08-09T03:04:05Z",
|
|
5
|
+
"action": "authentication.succeeded",
|
|
6
|
+
"request_id": "018f47a2-8a3d-4e17-9d42-6f12c89b1234",
|
|
7
|
+
"trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
|
|
8
|
+
"span_id": "00f067aa0ba902b7",
|
|
9
|
+
"actor_kind": "member",
|
|
10
|
+
"actor_member_id": "member-1",
|
|
11
|
+
"source_ip": "192.0.2.4",
|
|
12
|
+
"flow_kind": "login",
|
|
13
|
+
"authentication_method": "passkey",
|
|
14
|
+
"principal_state": "active"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"access_id": "0b6bcad2-c90d-49e9-bec7-f9a4ba6b2894",
|
|
18
|
+
"occurred_at": "2026-08-09T03:04:06Z",
|
|
19
|
+
"action": "authentication.failed",
|
|
20
|
+
"request_id": "018f47a2-8a3d-4e17-9d42-6f12c89b1234",
|
|
21
|
+
"actor_kind": "anonymous",
|
|
22
|
+
"source_ip": "2001:db8::4",
|
|
23
|
+
"flow_kind": "login",
|
|
24
|
+
"authentication_method": "oidc",
|
|
25
|
+
"provider": "google",
|
|
26
|
+
"reason": "provider_denied"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"access_id": "ade2d4c8-ca22-4c73-838e-104106ae20bb",
|
|
30
|
+
"occurred_at": "2026-08-09T03:04:07Z",
|
|
31
|
+
"action": "authentication.blocked",
|
|
32
|
+
"request_id": "018f47a2-8a3d-4e17-9d42-6f12c89b1234",
|
|
33
|
+
"actor_kind": "anonymous",
|
|
34
|
+
"source_ip": "192.0.2.5",
|
|
35
|
+
"reason": "rate_limited"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"access_id": "c64e7917-d837-4d2f-a043-d12d99b07494",
|
|
39
|
+
"occurred_at": "2026-08-09T03:04:08Z",
|
|
40
|
+
"action": "authorization.denied",
|
|
41
|
+
"request_id": "018f47a2-8a3d-4e17-9d42-6f12c89b1234",
|
|
42
|
+
"actor_kind": "anonymous",
|
|
43
|
+
"source_ip": "192.0.2.6",
|
|
44
|
+
"reason": "authentication_required",
|
|
45
|
+
"attempted_action": "/geul.api.v1.MemberService/ListMembersAdmin",
|
|
46
|
+
"permission": "procedure:invoke"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"access_id": "7ef4d464-532a-4921-91e7-d63e06c31842",
|
|
50
|
+
"occurred_at": "2026-08-09T03:04:09Z",
|
|
51
|
+
"action": "personal_data.accessed",
|
|
52
|
+
"request_id": "018f47a2-8a3d-4e17-9d42-6f12c89b1234",
|
|
53
|
+
"actor_kind": "member",
|
|
54
|
+
"actor_member_id": "7a7a8fd4-1f69-4e9a-9dc2-2378926ff351",
|
|
55
|
+
"source_ip": "192.0.2.7",
|
|
56
|
+
"subject_type": "member_collection",
|
|
57
|
+
"subject_id": "1",
|
|
58
|
+
"access_kind": "read",
|
|
59
|
+
"data_category": "member_administration"
|
|
60
|
+
}
|
|
61
|
+
]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
[
|
|
2
|
+
{ "event": "service.ready", "outcome": "ready" },
|
|
3
|
+
{ "event": "service.degraded", "outcome": "degraded" },
|
|
4
|
+
{ "event": "service.stopping", "outcome": "stopping" },
|
|
5
|
+
{ "event": "service.failed", "outcome": "failed" },
|
|
6
|
+
{ "event": "dependency.degraded", "outcome": "degraded" },
|
|
7
|
+
{ "event": "dependency.recovered", "outcome": "recovered" },
|
|
8
|
+
{ "event": "queue.publish.succeeded", "outcome": "succeeded" },
|
|
9
|
+
{ "event": "queue.publish.failed", "outcome": "failed" },
|
|
10
|
+
{ "event": "queue.delivery.succeeded", "outcome": "succeeded" },
|
|
11
|
+
{ "event": "queue.delivery.failed", "outcome": "failed" },
|
|
12
|
+
{ "event": "queue.delivery.requeued", "outcome": "requeued" },
|
|
13
|
+
{ "event": "queue.retry.accepted", "outcome": "accepted" },
|
|
14
|
+
{ "event": "queue.retry.failed", "outcome": "failed" },
|
|
15
|
+
{ "event": "queue.dlq.accepted", "outcome": "accepted" },
|
|
16
|
+
{ "event": "queue.dlq.failed", "outcome": "failed" },
|
|
17
|
+
{ "event": "job.started", "outcome": "started" },
|
|
18
|
+
{ "event": "job.succeeded", "outcome": "succeeded" },
|
|
19
|
+
{ "event": "job.failed", "outcome": "failed" },
|
|
20
|
+
{ "event": "audit.append.failed", "outcome": "failed" },
|
|
21
|
+
{ "event": "collaboration.checkpoint.failed", "outcome": "failed" },
|
|
22
|
+
{ "event": "client.render.failed", "outcome": "failed" },
|
|
23
|
+
{ "event": "telemetry.pipeline.degraded", "outcome": "degraded" },
|
|
24
|
+
{ "event": "telemetry.pipeline.recovered", "outcome": "recovered" },
|
|
25
|
+
{ "event": "translation.job.terminal", "outcome": "applied" },
|
|
26
|
+
{ "event": "translation.job.terminal", "outcome": "failed" },
|
|
27
|
+
{ "event": "translation.job.terminal", "outcome": "cancelled" }
|
|
28
|
+
]
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"event": "translation.job.terminal",
|
|
3
|
+
"outcomes": ["applied", "failed", "cancelled"],
|
|
4
|
+
"entity_types": [
|
|
5
|
+
"post",
|
|
6
|
+
"page",
|
|
7
|
+
"work",
|
|
8
|
+
"program_event",
|
|
9
|
+
"release",
|
|
10
|
+
"artist",
|
|
11
|
+
"label",
|
|
12
|
+
"menu",
|
|
13
|
+
"email_template",
|
|
14
|
+
"email_layout",
|
|
15
|
+
"campaign",
|
|
16
|
+
"form",
|
|
17
|
+
"privacy",
|
|
18
|
+
"terms",
|
|
19
|
+
"series"
|
|
20
|
+
],
|
|
21
|
+
"failure_reasons": [
|
|
22
|
+
"provider_configuration",
|
|
23
|
+
"provider_authentication",
|
|
24
|
+
"provider_rate_limited",
|
|
25
|
+
"provider_unavailable",
|
|
26
|
+
"provider_rejected",
|
|
27
|
+
"provider_response_invalid",
|
|
28
|
+
"target_apply_failed",
|
|
29
|
+
"og_handoff_failed",
|
|
30
|
+
"internal"
|
|
31
|
+
],
|
|
32
|
+
"valid_job_ids": [
|
|
33
|
+
"018f47a2-8a3d-1e17-9d42-6f12c89b1234",
|
|
34
|
+
"018f47a2-8a3d-4e17-9d42-6f12c89b1234",
|
|
35
|
+
"018f47a2-8a3d-7e17-9d42-6f12c89b1234",
|
|
36
|
+
"018f47a2-8a3d-8e17-9d42-6f12c89b1234"
|
|
37
|
+
],
|
|
38
|
+
"invalid_job_ids": [
|
|
39
|
+
"018F47A2-8A3D-4E17-9D42-6F12C89B1234",
|
|
40
|
+
"018f47a2-8a3d-0e17-9d42-6f12c89b1234",
|
|
41
|
+
"018f47a2-8a3d-9e17-9d42-6f12c89b1234",
|
|
42
|
+
"018f47a2-8a3d-4e17-7d42-6f12c89b1234",
|
|
43
|
+
"018f47a28a3d-4e17-9d42-6f12c89b1234"
|
|
44
|
+
]
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
["default_locale", "protected_terms"]
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@echovisionlab/geul-telemetry",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/echovisionlab/geul-telemetry.git"
|
|
9
|
+
},
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": "24.19.0"
|
|
12
|
+
},
|
|
13
|
+
"packageManager": "pnpm@11.22.0+sha512.1ff870c4c6133dfd88fb2afc46dd13d47f09c9794b438c6fdb47ca98caf3bc16381ee0be93a091b8e3824cf01f889f46d7d9e20910fb0be1ab0fb5baa80dd621",
|
|
14
|
+
"files": [
|
|
15
|
+
"README.md",
|
|
16
|
+
"src",
|
|
17
|
+
"!src/**/*.test.ts",
|
|
18
|
+
"fixtures",
|
|
19
|
+
"policy"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"format:check": "prettier --check .",
|
|
23
|
+
"format": "prettier --write .",
|
|
24
|
+
"lint": "eslint --cache .",
|
|
25
|
+
"lint:fix": "eslint --cache . --fix",
|
|
26
|
+
"deadcode": "knip --include files,dependencies,unlisted,exports,types",
|
|
27
|
+
"typecheck": "tsc --noEmit",
|
|
28
|
+
"test": "vitest run",
|
|
29
|
+
"test:coverage": "vitest run --coverage",
|
|
30
|
+
"package:smoke": "npm pack --dry-run"
|
|
31
|
+
},
|
|
32
|
+
"exports": {
|
|
33
|
+
".": "./src/index.ts",
|
|
34
|
+
"./actor": "./src/actor.ts",
|
|
35
|
+
"./redaction": "./src/redaction.ts",
|
|
36
|
+
"./request-id": "./src/request-id.ts",
|
|
37
|
+
"./trace": "./src/trace.ts"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@opentelemetry/api": "^1.9.1"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/node": "^24.13.3",
|
|
44
|
+
"@typescript/native": "npm:typescript@7.0.2",
|
|
45
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
46
|
+
"eslint": "^10.8.1",
|
|
47
|
+
"knip": "^6.32.2",
|
|
48
|
+
"prettier": "^3.9.6",
|
|
49
|
+
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
50
|
+
"typescript-eslint": "^8.67.0",
|
|
51
|
+
"vitest": "^4.1.10"
|
|
52
|
+
},
|
|
53
|
+
"license": "PolyForm-Noncommercial-1.0.0",
|
|
54
|
+
"homepage": "https://github.com/echovisionlab/geul-telemetry#readme",
|
|
55
|
+
"bugs": {
|
|
56
|
+
"url": "https://github.com/echovisionlab/geul-telemetry/issues"
|
|
57
|
+
},
|
|
58
|
+
"publishConfig": {
|
|
59
|
+
"access": "public"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
{
|
|
2
|
+
"exact": [
|
|
3
|
+
"api_key",
|
|
4
|
+
"apikey",
|
|
5
|
+
"authorization",
|
|
6
|
+
"auth_code",
|
|
7
|
+
"body",
|
|
8
|
+
"campaign_content",
|
|
9
|
+
"client_ip",
|
|
10
|
+
"cookie",
|
|
11
|
+
"credentials",
|
|
12
|
+
"document_content",
|
|
13
|
+
"document_name",
|
|
14
|
+
"display_name",
|
|
15
|
+
"email",
|
|
16
|
+
"email_address",
|
|
17
|
+
"error_message",
|
|
18
|
+
"error_reason",
|
|
19
|
+
"file_name",
|
|
20
|
+
"filename",
|
|
21
|
+
"flow_id",
|
|
22
|
+
"from",
|
|
23
|
+
"context_payload",
|
|
24
|
+
"glossary",
|
|
25
|
+
"glossary_payload",
|
|
26
|
+
"html",
|
|
27
|
+
"identity_id",
|
|
28
|
+
"identity_subject",
|
|
29
|
+
"input",
|
|
30
|
+
"kratos_id",
|
|
31
|
+
"member_id",
|
|
32
|
+
"member_name",
|
|
33
|
+
"nickname",
|
|
34
|
+
"object_key",
|
|
35
|
+
"ory_subject",
|
|
36
|
+
"output",
|
|
37
|
+
"password",
|
|
38
|
+
"path",
|
|
39
|
+
"payload",
|
|
40
|
+
"prompt",
|
|
41
|
+
"provider_document_id",
|
|
42
|
+
"provider_document_key",
|
|
43
|
+
"provider_error",
|
|
44
|
+
"provider_raw_error",
|
|
45
|
+
"provider_request_body",
|
|
46
|
+
"provider_response_body",
|
|
47
|
+
"provider_response_message",
|
|
48
|
+
"query",
|
|
49
|
+
"raw_error",
|
|
50
|
+
"recipient",
|
|
51
|
+
"request_body",
|
|
52
|
+
"response_body",
|
|
53
|
+
"sender",
|
|
54
|
+
"session_id",
|
|
55
|
+
"share_token",
|
|
56
|
+
"signed_url",
|
|
57
|
+
"source_ip",
|
|
58
|
+
"source_key",
|
|
59
|
+
"source_text",
|
|
60
|
+
"stack",
|
|
61
|
+
"subject",
|
|
62
|
+
"target_text",
|
|
63
|
+
"text",
|
|
64
|
+
"to",
|
|
65
|
+
"token",
|
|
66
|
+
"token_prefix",
|
|
67
|
+
"unsubscribe_token",
|
|
68
|
+
"url",
|
|
69
|
+
"user_id",
|
|
70
|
+
"user_name",
|
|
71
|
+
"translated_text",
|
|
72
|
+
"verification_url",
|
|
73
|
+
"waveform_key",
|
|
74
|
+
"work_dir",
|
|
75
|
+
"workdir",
|
|
76
|
+
"xliff"
|
|
77
|
+
],
|
|
78
|
+
"suffixes": [
|
|
79
|
+
"_api_key",
|
|
80
|
+
"_apikey",
|
|
81
|
+
"_authorization",
|
|
82
|
+
"_context_payload",
|
|
83
|
+
"_cookie",
|
|
84
|
+
"_display_name",
|
|
85
|
+
"_email",
|
|
86
|
+
"_error_message",
|
|
87
|
+
"_filename",
|
|
88
|
+
"_glossary",
|
|
89
|
+
"_glossary_payload",
|
|
90
|
+
"_object_key",
|
|
91
|
+
"_member_name",
|
|
92
|
+
"_nickname",
|
|
93
|
+
"_password",
|
|
94
|
+
"_path",
|
|
95
|
+
"_prompt",
|
|
96
|
+
"_provider_document_id",
|
|
97
|
+
"_provider_document_key",
|
|
98
|
+
"_provider_error",
|
|
99
|
+
"_provider_raw_error",
|
|
100
|
+
"_provider_request_body",
|
|
101
|
+
"_provider_response_body",
|
|
102
|
+
"_provider_response_message",
|
|
103
|
+
"_raw_error",
|
|
104
|
+
"_secret",
|
|
105
|
+
"_source_text",
|
|
106
|
+
"_target_text",
|
|
107
|
+
"_token",
|
|
108
|
+
"_translated_text",
|
|
109
|
+
"_url",
|
|
110
|
+
"_xliff"
|
|
111
|
+
],
|
|
112
|
+
"prefixes": ["authorization_", "cookie_", "password_", "secret_", "token_"]
|
|
113
|
+
}
|
package/src/actor.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export type Actor = AnonymousActor | MemberActor | SystemActor;
|
|
2
|
+
|
|
3
|
+
export const SERVICE_BACKEND = "geul-backend";
|
|
4
|
+
export const SERVICE_WEB = "geul-web";
|
|
5
|
+
export const SERVICE_IDENTITY = "geul-identity";
|
|
6
|
+
export const SERVICE_EDITOR_COLLAB = "geul-collab";
|
|
7
|
+
export const SERVICE_CDN = "geul-cdn";
|
|
8
|
+
export const SERVICE_OG = "geul-og";
|
|
9
|
+
export const SERVICE_ASSET_OPTIMIZER = "geul-asset-optimizer";
|
|
10
|
+
export const SERVICE_TRANSCODER = "geul-transcoder";
|
|
11
|
+
export const SERVICE_WAVEFORM_PROCESSOR = "geul-waveform-processor";
|
|
12
|
+
|
|
13
|
+
export const CANONICAL_SERVICE_NAMES = [
|
|
14
|
+
SERVICE_BACKEND,
|
|
15
|
+
SERVICE_WEB,
|
|
16
|
+
SERVICE_IDENTITY,
|
|
17
|
+
SERVICE_EDITOR_COLLAB,
|
|
18
|
+
SERVICE_CDN,
|
|
19
|
+
SERVICE_OG,
|
|
20
|
+
SERVICE_ASSET_OPTIMIZER,
|
|
21
|
+
SERVICE_TRANSCODER,
|
|
22
|
+
SERVICE_WAVEFORM_PROCESSOR,
|
|
23
|
+
] as const;
|
|
24
|
+
|
|
25
|
+
export type ServiceName = (typeof CANONICAL_SERVICE_NAMES)[number];
|
|
26
|
+
|
|
27
|
+
const canonicalServiceNames = new Set<string>(CANONICAL_SERVICE_NAMES);
|
|
28
|
+
|
|
29
|
+
export function parseServiceName(value: string): ServiceName {
|
|
30
|
+
if (!canonicalServiceNames.has(value)) {
|
|
31
|
+
throw new TypeError(
|
|
32
|
+
`unknown canonical service name ${JSON.stringify(value)}`,
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
return value as ServiceName;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function instrumentationName(
|
|
39
|
+
serviceName: ServiceName,
|
|
40
|
+
component: string,
|
|
41
|
+
): string {
|
|
42
|
+
return `${serviceName}/${component}`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface AnonymousActor {
|
|
46
|
+
readonly kind: "anonymous";
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface MemberActor {
|
|
50
|
+
readonly kind: "member";
|
|
51
|
+
readonly sessionId: string;
|
|
52
|
+
readonly identityId: string;
|
|
53
|
+
readonly memberId: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface SystemActor {
|
|
57
|
+
readonly kind: "system";
|
|
58
|
+
readonly serviceName: ServiceName;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export type RecordActor =
|
|
62
|
+
| { readonly actor_kind: "anonymous" }
|
|
63
|
+
| { readonly actor_kind: "member"; readonly actor_member_id: string }
|
|
64
|
+
| { readonly actor_kind: "system"; readonly actor_service: string };
|
|
65
|
+
|
|
66
|
+
export function actorForRecord(actor: Actor): RecordActor {
|
|
67
|
+
switch (actor.kind) {
|
|
68
|
+
case "anonymous":
|
|
69
|
+
return { actor_kind: "anonymous" };
|
|
70
|
+
case "member":
|
|
71
|
+
if (actor.memberId === "") {
|
|
72
|
+
throw new TypeError("member actor requires memberId");
|
|
73
|
+
}
|
|
74
|
+
return { actor_kind: "member", actor_member_id: actor.memberId };
|
|
75
|
+
case "system":
|
|
76
|
+
return {
|
|
77
|
+
actor_kind: "system",
|
|
78
|
+
actor_service: parseServiceName(actor.serviceName),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}
|