@capxul/observability 1.2.2 → 2.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/README.md +1 -1
- package/dist/engineering.d.mts +1 -2
- package/dist/engineering.mjs +1 -3
- package/dist/index.d.mts +404 -1287
- package/dist/index.mjs +101 -384
- package/package.json +6 -3
- package/dist/engineering.d.mts.map +0 -1
- package/dist/engineering.mjs.map +0 -1
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -7,6 +7,7 @@ new Set([
|
|
|
7
7
|
"PLAYER_NOT_FOUND",
|
|
8
8
|
"ACCOUNT_NOT_FOUND",
|
|
9
9
|
"PROVIDER_ERROR",
|
|
10
|
+
"CAPABILITY_UNAVAILABLE",
|
|
10
11
|
"INVALID_INPUT",
|
|
11
12
|
"ENV_MISSING",
|
|
12
13
|
"NOT_IMPLEMENTED",
|
|
@@ -31,6 +32,7 @@ new Set([
|
|
|
31
32
|
//#region ../types/src/index.ts
|
|
32
33
|
const EVM_ADDRESS_RE = /^0x[0-9a-f]{40}$/i;
|
|
33
34
|
const BYTES32_RE = /^0x[0-9a-f]{64}$/i;
|
|
35
|
+
`${"0".repeat(64)}`;
|
|
34
36
|
const SUPPORTED_CURRENCIES = [
|
|
35
37
|
{
|
|
36
38
|
code: "USD",
|
|
@@ -90,14 +92,6 @@ const TELEMETRY_EVENT_NAMES = [
|
|
|
90
92
|
"faucet_requested",
|
|
91
93
|
"faucet_confirmed",
|
|
92
94
|
"faucet_failed",
|
|
93
|
-
"subaccount_created",
|
|
94
|
-
"subaccount_renamed",
|
|
95
|
-
"subaccount_deleted",
|
|
96
|
-
"subaccount_op_failed",
|
|
97
|
-
"transfer_requested",
|
|
98
|
-
"transfer_backend_received",
|
|
99
|
-
"transfer_confirmed",
|
|
100
|
-
"transfer_failed",
|
|
101
95
|
"org_create_started",
|
|
102
96
|
"org_safe_created",
|
|
103
97
|
"org_safe_confirmed",
|
|
@@ -106,29 +100,16 @@ const TELEMETRY_EVENT_NAMES = [
|
|
|
106
100
|
"org_create_failed",
|
|
107
101
|
"org_invite_sent",
|
|
108
102
|
"org_invite_accepted",
|
|
109
|
-
"org_role_granted",
|
|
110
|
-
"org_member_active",
|
|
111
|
-
"org_member_removed",
|
|
112
103
|
"org_invite_expired",
|
|
113
|
-
"
|
|
114
|
-
"payment_requested",
|
|
115
|
-
"payment_resolved",
|
|
116
|
-
"payment_document_attached",
|
|
117
|
-
"payment_submitted",
|
|
104
|
+
"payment_initiated",
|
|
118
105
|
"payment_settled",
|
|
119
|
-
"payment_claimed",
|
|
120
|
-
"payment_cancelled",
|
|
121
|
-
"payment_redirected",
|
|
122
106
|
"payment_failed",
|
|
123
|
-
"
|
|
124
|
-
"
|
|
125
|
-
"
|
|
126
|
-
"
|
|
127
|
-
"
|
|
128
|
-
"
|
|
129
|
-
"withdrawal_submitted",
|
|
130
|
-
"withdrawal_settled",
|
|
131
|
-
"withdrawal_failed"
|
|
107
|
+
"deposit_initiated",
|
|
108
|
+
"deposit_settled",
|
|
109
|
+
"permission_mirror_verification",
|
|
110
|
+
"movement_scan_window",
|
|
111
|
+
"movement_scan_checkpoint",
|
|
112
|
+
"movement_scan_incident"
|
|
132
113
|
];
|
|
133
114
|
const TELEMETRY_JOURNEYS = {
|
|
134
115
|
returning_user_login: {
|
|
@@ -277,19 +258,6 @@ const TELEMETRY_JOURNEYS = {
|
|
|
277
258
|
steps: ["faucet_requested", "faucet_confirmed"],
|
|
278
259
|
drops_on: ["faucet_failed"]
|
|
279
260
|
},
|
|
280
|
-
first_value_movement: {
|
|
281
|
-
type: "funnel",
|
|
282
|
-
steps: [
|
|
283
|
-
"account_balance_read",
|
|
284
|
-
"transfer_requested",
|
|
285
|
-
"transfer_confirmed"
|
|
286
|
-
],
|
|
287
|
-
drops_on: ["transfer_failed"]
|
|
288
|
-
},
|
|
289
|
-
subaccount_lifecycle: {
|
|
290
|
-
type: "point_event",
|
|
291
|
-
point_event: "subaccount_created"
|
|
292
|
-
},
|
|
293
261
|
org_creation: {
|
|
294
262
|
type: "funnel",
|
|
295
263
|
steps: [
|
|
@@ -303,51 +271,17 @@ const TELEMETRY_JOURNEYS = {
|
|
|
303
271
|
},
|
|
304
272
|
org_member_onboarding: {
|
|
305
273
|
type: "funnel",
|
|
306
|
-
steps: [
|
|
307
|
-
|
|
308
|
-
"org_invite_accepted",
|
|
309
|
-
"org_role_granted",
|
|
310
|
-
"org_member_active"
|
|
311
|
-
],
|
|
312
|
-
drops_on: ["org_invite_expired", "org_role_grant_failed"]
|
|
274
|
+
steps: ["org_invite_sent", "org_invite_accepted"],
|
|
275
|
+
drops_on: ["org_invite_expired"]
|
|
313
276
|
},
|
|
314
277
|
direct_payment: {
|
|
315
278
|
type: "funnel",
|
|
316
|
-
steps: [
|
|
317
|
-
"payment_requested",
|
|
318
|
-
"payment_resolved",
|
|
319
|
-
"payment_document_attached",
|
|
320
|
-
"payment_submitted",
|
|
321
|
-
"payment_settled"
|
|
322
|
-
],
|
|
279
|
+
steps: ["payment_initiated", "payment_settled"],
|
|
323
280
|
drops_on: ["payment_failed"]
|
|
324
281
|
},
|
|
325
|
-
|
|
326
|
-
type: "funnel",
|
|
327
|
-
steps: ["payment_submitted", "payment_claimed"],
|
|
328
|
-
drops_on: ["payment_cancelled"]
|
|
329
|
-
},
|
|
330
|
-
commitment_redirect: {
|
|
331
|
-
type: "point_event",
|
|
332
|
-
point_event: "payment_redirected"
|
|
333
|
-
},
|
|
334
|
-
salary_stream: {
|
|
282
|
+
deposit: {
|
|
335
283
|
type: "funnel",
|
|
336
|
-
steps: [
|
|
337
|
-
"stream_created",
|
|
338
|
-
"stream_claimed",
|
|
339
|
-
"stream_completed"
|
|
340
|
-
],
|
|
341
|
-
drops_on: ["stream_cancelled", "stream_failed"]
|
|
342
|
-
},
|
|
343
|
-
cash_out: {
|
|
344
|
-
type: "funnel",
|
|
345
|
-
steps: [
|
|
346
|
-
"withdrawal_requested",
|
|
347
|
-
"withdrawal_submitted",
|
|
348
|
-
"withdrawal_settled"
|
|
349
|
-
],
|
|
350
|
-
drops_on: ["withdrawal_failed"]
|
|
284
|
+
steps: ["deposit_initiated", "deposit_settled"]
|
|
351
285
|
}
|
|
352
286
|
};
|
|
353
287
|
const PII = Schema.String.pipe(Schema.brand("PII"));
|
|
@@ -364,31 +298,15 @@ const EpochMsSchema = Schema.Number.pipe(Schema.refine((value) => Number.isSafeI
|
|
|
364
298
|
const PublishableKeyIdSchema = Schema.String.pipe(Schema.refine((value) => value.length > 0, { message: "must be a non-empty string" }));
|
|
365
299
|
const TxHashSchema = Schema.String.pipe(Schema.refine((value) => BYTES32_RE.test(value), { message: "must be 0x + 64 hex chars" }));
|
|
366
300
|
const ACCOUNT_ID_TELEMETRY_RE = /^account_[0-9A-Za-z]+$/;
|
|
367
|
-
const SUBACCOUNT_ID_TELEMETRY_RE = /^subaccount_[0-9A-Za-z]+$/;
|
|
368
301
|
const WEI_AMOUNT_TELEMETRY_RE = /^[0-9]+$/;
|
|
369
302
|
const AccountIdSchema = Schema.String.pipe(Schema.refine((value) => ACCOUNT_ID_TELEMETRY_RE.test(value), { message: "must be account_ plus an alphanumeric id" }));
|
|
370
|
-
const SubAccountIdSchema = Schema.String.pipe(Schema.refine((value) => SUBACCOUNT_ID_TELEMETRY_RE.test(value), { message: "must be subaccount_ plus an alphanumeric id" }));
|
|
371
303
|
const WeiAmountSchema = Schema.String.pipe(Schema.refine((value) => WEI_AMOUNT_TELEMETRY_RE.test(value), { message: "must be a non-negative integer string" }));
|
|
372
304
|
const CurrencyCodeSchema = Schema.String.pipe(Schema.refine((value) => value.length > 0, { message: "must be a non-empty currency code" }));
|
|
373
305
|
const BalanceBucketSchema = Schema.Literals(["zero", "nonzero"]);
|
|
374
|
-
const TransferDirectionSchema = Schema.Literals([
|
|
375
|
-
"add",
|
|
376
|
-
"out",
|
|
377
|
-
"between"
|
|
378
|
-
]);
|
|
379
|
-
const SubAccountOpSchema = Schema.Literals([
|
|
380
|
-
"create",
|
|
381
|
-
"rename",
|
|
382
|
-
"delete"
|
|
383
|
-
]);
|
|
384
306
|
const OptionalAccountId = Schema.optional(AccountIdSchema);
|
|
385
|
-
const OptionalSubAccountId = Schema.optional(SubAccountIdSchema);
|
|
386
307
|
const OptionalWeiAmount = Schema.optional(WeiAmountSchema);
|
|
387
308
|
const OptionalCurrencyCode = Schema.optional(CurrencyCodeSchema);
|
|
388
309
|
const OptionalBalanceBucket = Schema.optional(BalanceBucketSchema);
|
|
389
|
-
const OptionalTransferDirection = Schema.optional(TransferDirectionSchema);
|
|
390
|
-
const OptionalSubAccountOp = Schema.optional(SubAccountOpSchema);
|
|
391
|
-
const OptionalTrue = Schema.optional(Schema.Literal(true));
|
|
392
310
|
const OptionalAddress = Schema.optional(AddressSchema);
|
|
393
311
|
const OptionalAppId = Schema.optional(AppIdSchema);
|
|
394
312
|
const OptionalBlockNumber = Schema.optional(BlockNumberSchema);
|
|
@@ -397,11 +315,6 @@ const OptionalDurationMs = Schema.optional(DurationMsSchema);
|
|
|
397
315
|
const OptionalEpochMs = Schema.optional(EpochMsSchema);
|
|
398
316
|
const OptionalPublishableKeyId = Schema.optional(PublishableKeyIdSchema);
|
|
399
317
|
const OptionalTxHash = Schema.optional(TxHashSchema);
|
|
400
|
-
const PAYMENT_ID_TELEMETRY_RE = /^payment_[0-9A-Za-z]+$/;
|
|
401
|
-
const PAYEE_ID_TELEMETRY_RE = /^payee_[0-9A-Za-z]+$/;
|
|
402
|
-
const PaymentIdTelemetrySchema = Schema.String.pipe(Schema.refine((value) => PAYMENT_ID_TELEMETRY_RE.test(value), { message: "must be payment_ plus an alphanumeric id" }));
|
|
403
|
-
const PayeeIdTelemetrySchema = Schema.String.pipe(Schema.refine((value) => PAYEE_ID_TELEMETRY_RE.test(value), { message: "must be payee_ plus an alphanumeric id" }));
|
|
404
|
-
const DocumentHashSchema = Schema.String.pipe(Schema.refine((value) => BYTES32_RE.test(value), { message: "must be 0x + 64 hex chars" }));
|
|
405
318
|
/**
|
|
406
319
|
* Environment discriminator (ADR-0020 A1 amendment, 2026-08-07). PostHog
|
|
407
320
|
* project 368736 is the SINGLE sink for every environment, so `capxul_env` —
|
|
@@ -450,7 +363,6 @@ const TELEMETRY_PRODUCERS = [
|
|
|
450
363
|
const TelemetryEnvelopeProps = {
|
|
451
364
|
capxul_env: Schema.Literals(CAPXUL_ENVS),
|
|
452
365
|
producer: Schema.Literals(TELEMETRY_PRODUCERS),
|
|
453
|
-
capxul_e2e_run_id: OptionalString,
|
|
454
366
|
journey_id: OptionalString,
|
|
455
367
|
correlation_id: OptionalString,
|
|
456
368
|
sdk_version: OptionalString
|
|
@@ -554,45 +466,6 @@ const FaucetFailedProps = Schema.Struct({
|
|
|
554
466
|
...TelemetryEnvelopeProps,
|
|
555
467
|
reason: OptionalString
|
|
556
468
|
});
|
|
557
|
-
const SubaccountCreatedProps = Schema.Struct({
|
|
558
|
-
...TelemetryEnvelopeProps,
|
|
559
|
-
sub_account_id: OptionalSubAccountId,
|
|
560
|
-
durationMs: OptionalDurationMs
|
|
561
|
-
});
|
|
562
|
-
const SubaccountRenamedProps = Schema.Struct({
|
|
563
|
-
...TelemetryEnvelopeProps,
|
|
564
|
-
sub_account_id: OptionalSubAccountId
|
|
565
|
-
});
|
|
566
|
-
const SubaccountDeletedProps = Schema.Struct({
|
|
567
|
-
...TelemetryEnvelopeProps,
|
|
568
|
-
sub_account_id: OptionalSubAccountId
|
|
569
|
-
});
|
|
570
|
-
const SubaccountOpFailedProps = Schema.Struct({
|
|
571
|
-
...TelemetryEnvelopeProps,
|
|
572
|
-
op: OptionalSubAccountOp,
|
|
573
|
-
reason: OptionalString
|
|
574
|
-
});
|
|
575
|
-
const TransferRequestedProps = Schema.Struct({
|
|
576
|
-
...TelemetryEnvelopeProps,
|
|
577
|
-
amount: OptionalWeiAmount,
|
|
578
|
-
direction: OptionalTransferDirection
|
|
579
|
-
});
|
|
580
|
-
const TransferBackendReceivedProps = Schema.Struct({
|
|
581
|
-
...TelemetryEnvelopeProps,
|
|
582
|
-
direction: OptionalTransferDirection
|
|
583
|
-
});
|
|
584
|
-
const TransferConfirmedProps = Schema.Struct({
|
|
585
|
-
...TelemetryEnvelopeProps,
|
|
586
|
-
amount: OptionalWeiAmount,
|
|
587
|
-
direction: OptionalTransferDirection,
|
|
588
|
-
available_bucket: OptionalBalanceBucket,
|
|
589
|
-
txless: OptionalTrue,
|
|
590
|
-
durationMs: OptionalDurationMs
|
|
591
|
-
});
|
|
592
|
-
const TransferFailedProps = Schema.Struct({
|
|
593
|
-
...TelemetryEnvelopeProps,
|
|
594
|
-
reason: OptionalString
|
|
595
|
-
});
|
|
596
469
|
const ORG_ID_TELEMETRY_RE = /^org_[0-9A-Za-z]+$/;
|
|
597
470
|
const OrgIdTelemetrySchema = Schema.String.pipe(Schema.refine((value) => ORG_ID_TELEMETRY_RE.test(value), { message: "must be org_ plus an alphanumeric id" }));
|
|
598
471
|
const OptionalOrgId = Schema.optional(OrgIdTelemetrySchema);
|
|
@@ -717,75 +590,70 @@ const OrgInviteAcceptedProps = Schema.Struct({
|
|
|
717
590
|
role: OptionalString,
|
|
718
591
|
status: OptionalString
|
|
719
592
|
});
|
|
720
|
-
const
|
|
593
|
+
const OrgInviteExpiredProps = Schema.Struct({
|
|
721
594
|
...TelemetryEnvelopeProps,
|
|
722
595
|
org_id: OptionalOrgId,
|
|
596
|
+
email_domain: OptionalString,
|
|
597
|
+
reason: OptionalString,
|
|
723
598
|
role: OptionalString,
|
|
724
|
-
status: OptionalString
|
|
725
|
-
txHash: OptionalTxHash
|
|
599
|
+
status: OptionalString
|
|
726
600
|
});
|
|
727
|
-
const
|
|
601
|
+
const PaymentInitiatedProps = Schema.Struct({
|
|
728
602
|
...TelemetryEnvelopeProps,
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
status: OptionalString,
|
|
732
|
-
durationMs: OptionalDurationMs
|
|
603
|
+
kind: Schema.String,
|
|
604
|
+
payment_id: Schema.String
|
|
733
605
|
});
|
|
734
|
-
const
|
|
606
|
+
const PaymentSettledL2Props = Schema.Struct({
|
|
735
607
|
...TelemetryEnvelopeProps,
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
txHash: OptionalTxHash
|
|
608
|
+
kind: Schema.String,
|
|
609
|
+
chain_id: Schema.Number,
|
|
610
|
+
settlement_id: Schema.String
|
|
740
611
|
});
|
|
741
|
-
const
|
|
612
|
+
const PaymentFailedL2Props = Schema.Struct({
|
|
742
613
|
...TelemetryEnvelopeProps,
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
role: OptionalString,
|
|
747
|
-
status: OptionalString
|
|
614
|
+
kind: Schema.String,
|
|
615
|
+
payment_id: Schema.String,
|
|
616
|
+
reason_code: Schema.String
|
|
748
617
|
});
|
|
749
|
-
const
|
|
618
|
+
const DepositInitiatedProps = Schema.Struct({ ...TelemetryEnvelopeProps });
|
|
619
|
+
const DepositSettledProps = Schema.Struct({
|
|
750
620
|
...TelemetryEnvelopeProps,
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
621
|
+
chain_id: Schema.Number,
|
|
622
|
+
tx_hash: Schema.String,
|
|
623
|
+
log_index: Schema.Number
|
|
754
624
|
});
|
|
755
|
-
const
|
|
756
|
-
const OptionalPayeeId = Schema.optional(PayeeIdTelemetrySchema);
|
|
757
|
-
const OptionalDocumentHash = Schema.optional(DocumentHashSchema);
|
|
758
|
-
const PaymentTargetTelemetryProps = Schema.Struct({
|
|
625
|
+
const PermissionMirrorVerificationProps = Schema.Struct({
|
|
759
626
|
...TelemetryEnvelopeProps,
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
});
|
|
769
|
-
const StreamTargetTelemetryProps = Schema.Struct({
|
|
627
|
+
outcome: Schema.String,
|
|
628
|
+
reason: Schema.String,
|
|
629
|
+
chain_id: Schema.Number,
|
|
630
|
+
finality: Schema.String,
|
|
631
|
+
lag_blocks: Schema.Number,
|
|
632
|
+
retry_count: Schema.Number
|
|
633
|
+
});
|
|
634
|
+
const MovementScanWindowProps = Schema.Struct({
|
|
770
635
|
...TelemetryEnvelopeProps,
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
636
|
+
chain_id: Schema.Number,
|
|
637
|
+
token_address: Schema.String,
|
|
638
|
+
from_block: Schema.Number,
|
|
639
|
+
to_block: Schema.Number,
|
|
640
|
+
log_count: Schema.Number,
|
|
641
|
+
request_count: Schema.Number,
|
|
642
|
+
outcome: Schema.String
|
|
643
|
+
});
|
|
644
|
+
const MovementScanCheckpointProps = Schema.Struct({
|
|
645
|
+
...TelemetryEnvelopeProps,
|
|
646
|
+
chain_id: Schema.Number,
|
|
647
|
+
token_address: Schema.String,
|
|
648
|
+
next_block: Schema.Number,
|
|
649
|
+
anchor_block_number: Schema.Number
|
|
779
650
|
});
|
|
780
|
-
const
|
|
651
|
+
const MovementScanIncidentProps = Schema.Struct({
|
|
781
652
|
...TelemetryEnvelopeProps,
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
status: OptionalString,
|
|
787
|
-
reason: OptionalString,
|
|
788
|
-
durationMs: OptionalDurationMs
|
|
653
|
+
chain_id: Schema.Number,
|
|
654
|
+
token_address: Schema.String,
|
|
655
|
+
incident_kind: Schema.String,
|
|
656
|
+
anchor_block_number: Schema.Number
|
|
789
657
|
});
|
|
790
658
|
const AuthOtpRequestedTelemetryEventSchema = Schema.Struct({
|
|
791
659
|
name: Schema.Literal("auth_otp_requested"),
|
|
@@ -887,38 +755,6 @@ const FaucetFailedTelemetryEventSchema = Schema.Struct({
|
|
|
887
755
|
name: Schema.Literal("faucet_failed"),
|
|
888
756
|
props: FaucetFailedProps
|
|
889
757
|
});
|
|
890
|
-
const SubaccountCreatedTelemetryEventSchema = Schema.Struct({
|
|
891
|
-
name: Schema.Literal("subaccount_created"),
|
|
892
|
-
props: SubaccountCreatedProps
|
|
893
|
-
});
|
|
894
|
-
const SubaccountRenamedTelemetryEventSchema = Schema.Struct({
|
|
895
|
-
name: Schema.Literal("subaccount_renamed"),
|
|
896
|
-
props: SubaccountRenamedProps
|
|
897
|
-
});
|
|
898
|
-
const SubaccountDeletedTelemetryEventSchema = Schema.Struct({
|
|
899
|
-
name: Schema.Literal("subaccount_deleted"),
|
|
900
|
-
props: SubaccountDeletedProps
|
|
901
|
-
});
|
|
902
|
-
const SubaccountOpFailedTelemetryEventSchema = Schema.Struct({
|
|
903
|
-
name: Schema.Literal("subaccount_op_failed"),
|
|
904
|
-
props: SubaccountOpFailedProps
|
|
905
|
-
});
|
|
906
|
-
const TransferRequestedTelemetryEventSchema = Schema.Struct({
|
|
907
|
-
name: Schema.Literal("transfer_requested"),
|
|
908
|
-
props: TransferRequestedProps
|
|
909
|
-
});
|
|
910
|
-
const TransferBackendReceivedTelemetryEventSchema = Schema.Struct({
|
|
911
|
-
name: Schema.Literal("transfer_backend_received"),
|
|
912
|
-
props: TransferBackendReceivedProps
|
|
913
|
-
});
|
|
914
|
-
const TransferConfirmedTelemetryEventSchema = Schema.Struct({
|
|
915
|
-
name: Schema.Literal("transfer_confirmed"),
|
|
916
|
-
props: TransferConfirmedProps
|
|
917
|
-
});
|
|
918
|
-
const TransferFailedTelemetryEventSchema = Schema.Struct({
|
|
919
|
-
name: Schema.Literal("transfer_failed"),
|
|
920
|
-
props: TransferFailedProps
|
|
921
|
-
});
|
|
922
758
|
const OrgCreateStartedTelemetryEventSchema = Schema.Struct({
|
|
923
759
|
name: Schema.Literal("org_create_started"),
|
|
924
760
|
props: OrgCreateStartedProps
|
|
@@ -951,97 +787,45 @@ const OrgInviteAcceptedTelemetryEventSchema = Schema.Struct({
|
|
|
951
787
|
name: Schema.Literal("org_invite_accepted"),
|
|
952
788
|
props: OrgInviteAcceptedProps
|
|
953
789
|
});
|
|
954
|
-
const OrgRoleGrantedTelemetryEventSchema = Schema.Struct({
|
|
955
|
-
name: Schema.Literal("org_role_granted"),
|
|
956
|
-
props: OrgRoleGrantedProps
|
|
957
|
-
});
|
|
958
|
-
const OrgMemberActiveTelemetryEventSchema = Schema.Struct({
|
|
959
|
-
name: Schema.Literal("org_member_active"),
|
|
960
|
-
props: OrgMemberActiveProps
|
|
961
|
-
});
|
|
962
|
-
const OrgMemberRemovedTelemetryEventSchema = Schema.Struct({
|
|
963
|
-
name: Schema.Literal("org_member_removed"),
|
|
964
|
-
props: OrgMemberRemovedProps
|
|
965
|
-
});
|
|
966
790
|
const OrgInviteExpiredTelemetryEventSchema = Schema.Struct({
|
|
967
791
|
name: Schema.Literal("org_invite_expired"),
|
|
968
792
|
props: OrgInviteExpiredProps
|
|
969
793
|
});
|
|
970
|
-
const
|
|
971
|
-
name: Schema.Literal("
|
|
972
|
-
props:
|
|
973
|
-
});
|
|
974
|
-
const PaymentRequestedTelemetryEventSchema = Schema.Struct({
|
|
975
|
-
name: Schema.Literal("payment_requested"),
|
|
976
|
-
props: PaymentTargetTelemetryProps
|
|
977
|
-
});
|
|
978
|
-
const PaymentResolvedTelemetryEventSchema = Schema.Struct({
|
|
979
|
-
name: Schema.Literal("payment_resolved"),
|
|
980
|
-
props: PaymentTargetTelemetryProps
|
|
981
|
-
});
|
|
982
|
-
const PaymentDocumentAttachedTelemetryEventSchema = Schema.Struct({
|
|
983
|
-
name: Schema.Literal("payment_document_attached"),
|
|
984
|
-
props: PaymentTargetTelemetryProps
|
|
985
|
-
});
|
|
986
|
-
const PaymentSubmittedTelemetryEventSchema = Schema.Struct({
|
|
987
|
-
name: Schema.Literal("payment_submitted"),
|
|
988
|
-
props: PaymentTargetTelemetryProps
|
|
794
|
+
const PaymentInitiatedTelemetryEventSchema = Schema.Struct({
|
|
795
|
+
name: Schema.Literal("payment_initiated"),
|
|
796
|
+
props: PaymentInitiatedProps
|
|
989
797
|
});
|
|
990
798
|
const PaymentSettledTelemetryEventSchema = Schema.Struct({
|
|
991
799
|
name: Schema.Literal("payment_settled"),
|
|
992
|
-
props:
|
|
993
|
-
});
|
|
994
|
-
const PaymentClaimedTelemetryEventSchema = Schema.Struct({
|
|
995
|
-
name: Schema.Literal("payment_claimed"),
|
|
996
|
-
props: PaymentTargetTelemetryProps
|
|
997
|
-
});
|
|
998
|
-
const PaymentCancelledTelemetryEventSchema = Schema.Struct({
|
|
999
|
-
name: Schema.Literal("payment_cancelled"),
|
|
1000
|
-
props: PaymentTargetTelemetryProps
|
|
1001
|
-
});
|
|
1002
|
-
const PaymentRedirectedTelemetryEventSchema = Schema.Struct({
|
|
1003
|
-
name: Schema.Literal("payment_redirected"),
|
|
1004
|
-
props: PaymentTargetTelemetryProps
|
|
800
|
+
props: PaymentSettledL2Props
|
|
1005
801
|
});
|
|
1006
802
|
const PaymentFailedTelemetryEventSchema = Schema.Struct({
|
|
1007
803
|
name: Schema.Literal("payment_failed"),
|
|
1008
|
-
props:
|
|
1009
|
-
});
|
|
1010
|
-
const StreamCreatedTelemetryEventSchema = Schema.Struct({
|
|
1011
|
-
name: Schema.Literal("stream_created"),
|
|
1012
|
-
props: StreamTargetTelemetryProps
|
|
804
|
+
props: PaymentFailedL2Props
|
|
1013
805
|
});
|
|
1014
|
-
const
|
|
1015
|
-
name: Schema.Literal("
|
|
1016
|
-
props:
|
|
806
|
+
const DepositInitiatedTelemetryEventSchema = Schema.Struct({
|
|
807
|
+
name: Schema.Literal("deposit_initiated"),
|
|
808
|
+
props: DepositInitiatedProps
|
|
1017
809
|
});
|
|
1018
|
-
const
|
|
1019
|
-
name: Schema.Literal("
|
|
1020
|
-
props:
|
|
810
|
+
const DepositSettledTelemetryEventSchema = Schema.Struct({
|
|
811
|
+
name: Schema.Literal("deposit_settled"),
|
|
812
|
+
props: DepositSettledProps
|
|
1021
813
|
});
|
|
1022
|
-
const
|
|
1023
|
-
name: Schema.Literal("
|
|
1024
|
-
props:
|
|
814
|
+
const PermissionMirrorVerificationTelemetryEventSchema = Schema.Struct({
|
|
815
|
+
name: Schema.Literal("permission_mirror_verification"),
|
|
816
|
+
props: PermissionMirrorVerificationProps
|
|
1025
817
|
});
|
|
1026
|
-
const
|
|
1027
|
-
name: Schema.Literal("
|
|
1028
|
-
props:
|
|
818
|
+
const MovementScanWindowTelemetryEventSchema = Schema.Struct({
|
|
819
|
+
name: Schema.Literal("movement_scan_window"),
|
|
820
|
+
props: MovementScanWindowProps
|
|
1029
821
|
});
|
|
1030
|
-
const
|
|
1031
|
-
name: Schema.Literal("
|
|
1032
|
-
props:
|
|
822
|
+
const MovementScanCheckpointTelemetryEventSchema = Schema.Struct({
|
|
823
|
+
name: Schema.Literal("movement_scan_checkpoint"),
|
|
824
|
+
props: MovementScanCheckpointProps
|
|
1033
825
|
});
|
|
1034
|
-
const
|
|
1035
|
-
name: Schema.Literal("
|
|
1036
|
-
props:
|
|
1037
|
-
});
|
|
1038
|
-
const WithdrawalSettledTelemetryEventSchema = Schema.Struct({
|
|
1039
|
-
name: Schema.Literal("withdrawal_settled"),
|
|
1040
|
-
props: WithdrawalTargetTelemetryProps
|
|
1041
|
-
});
|
|
1042
|
-
const WithdrawalFailedTelemetryEventSchema = Schema.Struct({
|
|
1043
|
-
name: Schema.Literal("withdrawal_failed"),
|
|
1044
|
-
props: WithdrawalTargetTelemetryProps
|
|
826
|
+
const MovementScanIncidentTelemetryEventSchema = Schema.Struct({
|
|
827
|
+
name: Schema.Literal("movement_scan_incident"),
|
|
828
|
+
props: MovementScanIncidentProps
|
|
1045
829
|
});
|
|
1046
830
|
const TELEMETRY_EVENT_SCHEMAS = {
|
|
1047
831
|
auth_otp_requested: AuthOtpRequestedTelemetryEventSchema,
|
|
@@ -1069,14 +853,6 @@ const TELEMETRY_EVENT_SCHEMAS = {
|
|
|
1069
853
|
faucet_requested: FaucetRequestedTelemetryEventSchema,
|
|
1070
854
|
faucet_confirmed: FaucetConfirmedTelemetryEventSchema,
|
|
1071
855
|
faucet_failed: FaucetFailedTelemetryEventSchema,
|
|
1072
|
-
subaccount_created: SubaccountCreatedTelemetryEventSchema,
|
|
1073
|
-
subaccount_renamed: SubaccountRenamedTelemetryEventSchema,
|
|
1074
|
-
subaccount_deleted: SubaccountDeletedTelemetryEventSchema,
|
|
1075
|
-
subaccount_op_failed: SubaccountOpFailedTelemetryEventSchema,
|
|
1076
|
-
transfer_requested: TransferRequestedTelemetryEventSchema,
|
|
1077
|
-
transfer_backend_received: TransferBackendReceivedTelemetryEventSchema,
|
|
1078
|
-
transfer_confirmed: TransferConfirmedTelemetryEventSchema,
|
|
1079
|
-
transfer_failed: TransferFailedTelemetryEventSchema,
|
|
1080
856
|
org_create_started: OrgCreateStartedTelemetryEventSchema,
|
|
1081
857
|
org_safe_created: OrgSafeCreatedTelemetryEventSchema,
|
|
1082
858
|
org_safe_confirmed: OrgSafeConfirmedTelemetryEventSchema,
|
|
@@ -1085,82 +861,25 @@ const TELEMETRY_EVENT_SCHEMAS = {
|
|
|
1085
861
|
org_create_failed: OrgCreateFailedTelemetryEventSchema,
|
|
1086
862
|
org_invite_sent: OrgInviteSentTelemetryEventSchema,
|
|
1087
863
|
org_invite_accepted: OrgInviteAcceptedTelemetryEventSchema,
|
|
1088
|
-
org_role_granted: OrgRoleGrantedTelemetryEventSchema,
|
|
1089
|
-
org_member_active: OrgMemberActiveTelemetryEventSchema,
|
|
1090
|
-
org_member_removed: OrgMemberRemovedTelemetryEventSchema,
|
|
1091
864
|
org_invite_expired: OrgInviteExpiredTelemetryEventSchema,
|
|
1092
|
-
|
|
1093
|
-
payment_requested: PaymentRequestedTelemetryEventSchema,
|
|
1094
|
-
payment_resolved: PaymentResolvedTelemetryEventSchema,
|
|
1095
|
-
payment_document_attached: PaymentDocumentAttachedTelemetryEventSchema,
|
|
1096
|
-
payment_submitted: PaymentSubmittedTelemetryEventSchema,
|
|
865
|
+
payment_initiated: PaymentInitiatedTelemetryEventSchema,
|
|
1097
866
|
payment_settled: PaymentSettledTelemetryEventSchema,
|
|
1098
|
-
payment_claimed: PaymentClaimedTelemetryEventSchema,
|
|
1099
|
-
payment_cancelled: PaymentCancelledTelemetryEventSchema,
|
|
1100
|
-
payment_redirected: PaymentRedirectedTelemetryEventSchema,
|
|
1101
867
|
payment_failed: PaymentFailedTelemetryEventSchema,
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
withdrawal_submitted: WithdrawalSubmittedTelemetryEventSchema,
|
|
1109
|
-
withdrawal_settled: WithdrawalSettledTelemetryEventSchema,
|
|
1110
|
-
withdrawal_failed: WithdrawalFailedTelemetryEventSchema
|
|
868
|
+
deposit_initiated: DepositInitiatedTelemetryEventSchema,
|
|
869
|
+
deposit_settled: DepositSettledTelemetryEventSchema,
|
|
870
|
+
permission_mirror_verification: PermissionMirrorVerificationTelemetryEventSchema,
|
|
871
|
+
movement_scan_window: MovementScanWindowTelemetryEventSchema,
|
|
872
|
+
movement_scan_checkpoint: MovementScanCheckpointTelemetryEventSchema,
|
|
873
|
+
movement_scan_incident: MovementScanIncidentTelemetryEventSchema
|
|
1111
874
|
};
|
|
1112
|
-
const FINANCIAL_OPS_TARGET_TELEMETRY_PRODUCERS = [
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
ownerIssue: 410,
|
|
1121
|
-
producer: "sdk-target"
|
|
1122
|
-
},
|
|
1123
|
-
{
|
|
1124
|
-
eventName: "payment_document_attached",
|
|
1125
|
-
ownerIssue: 486,
|
|
1126
|
-
producer: "sdk-target"
|
|
1127
|
-
},
|
|
1128
|
-
{
|
|
1129
|
-
eventName: "payment_submitted",
|
|
1130
|
-
ownerIssue: 410,
|
|
1131
|
-
producer: "sdk-target"
|
|
1132
|
-
},
|
|
1133
|
-
{
|
|
1134
|
-
eventName: "payment_failed",
|
|
1135
|
-
ownerIssue: 410,
|
|
1136
|
-
producer: "sdk-target"
|
|
1137
|
-
},
|
|
1138
|
-
{
|
|
1139
|
-
eventName: "stream_created",
|
|
1140
|
-
ownerIssue: 411,
|
|
1141
|
-
producer: "sdk-target"
|
|
1142
|
-
},
|
|
1143
|
-
{
|
|
1144
|
-
eventName: "stream_failed",
|
|
1145
|
-
ownerIssue: 411,
|
|
1146
|
-
producer: "sdk-target"
|
|
1147
|
-
},
|
|
1148
|
-
{
|
|
1149
|
-
eventName: "withdrawal_requested",
|
|
1150
|
-
ownerIssue: 410,
|
|
1151
|
-
producer: "sdk-target"
|
|
1152
|
-
},
|
|
1153
|
-
{
|
|
1154
|
-
eventName: "withdrawal_submitted",
|
|
1155
|
-
ownerIssue: 410,
|
|
1156
|
-
producer: "sdk-target"
|
|
1157
|
-
},
|
|
1158
|
-
{
|
|
1159
|
-
eventName: "withdrawal_failed",
|
|
1160
|
-
ownerIssue: 410,
|
|
1161
|
-
producer: "sdk-target"
|
|
1162
|
-
}
|
|
1163
|
-
];
|
|
875
|
+
const FINANCIAL_OPS_TARGET_TELEMETRY_PRODUCERS = [];
|
|
876
|
+
/**
|
|
877
|
+
* Contract-first events whose producer is owned by a later domain node.
|
|
878
|
+
*
|
|
879
|
+
* A domain node removes its entry when it adds the producer. The telemetry
|
|
880
|
+
* gate rejects an entry that has a producer.
|
|
881
|
+
*/
|
|
882
|
+
const CONTRACT_FIRST_TELEMETRY_EVENTS = [];
|
|
1164
883
|
/**
|
|
1165
884
|
* Catalog events whose product mapper remains gated on the #1150 frontend
|
|
1166
885
|
* adoption. L1 S1 removes their retired SDK-flow producers without inventing
|
|
@@ -1659,6 +1378,4 @@ function rotr(value, bits) {
|
|
|
1659
1378
|
return value >>> bits | value << 32 - bits;
|
|
1660
1379
|
}
|
|
1661
1380
|
//#endregion
|
|
1662
|
-
export { AccountBalanceFailedTelemetryEventSchema, AccountBalanceReadTelemetryEventSchema, AuthFailedTelemetryEventSchema, AuthOtpDeliveredTelemetryEventSchema, AuthOtpExpiredTelemetryEventSchema, AuthOtpRequestedTelemetryEventSchema, AuthSignedOutTelemetryEventSchema, AuthVerifiedTelemetryEventSchema, BROWSER_GATED_TELEMETRY_EVENTS, BootstrapFailedTelemetryEventSchema, BootstrapResolvedTelemetryEventSchema, CAPXUL_ENVS, FINANCIAL_OPS_TARGET_TELEMETRY_PRODUCERS, FaucetConfirmedTelemetryEventSchema, FaucetFailedTelemetryEventSchema, FaucetRequestedTelemetryEventSchema, InMemoryTelemetryBusAdapter, MemberActivationFailedTelemetryEventSchema, MemberActivationReadyTelemetryEventSchema, MemberActivationStartedTelemetryEventSchema, OnboardingDashboardReachedTelemetryEventSchema, OnboardingIntentSelectedTelemetryEventSchema, OnboardingOrganizationSubmittedTelemetryEventSchema, OnboardingProfileSubmittedTelemetryEventSchema, OrgCreateFailedTelemetryEventSchema, OrgCreateStartedTelemetryEventSchema, OrgCreatedTelemetryEventSchema, OrgInviteAcceptedTelemetryEventSchema, OrgInviteExpiredTelemetryEventSchema, OrgInviteSentTelemetryEventSchema,
|
|
1663
|
-
|
|
1664
|
-
//# sourceMappingURL=index.mjs.map
|
|
1381
|
+
export { AccountBalanceFailedTelemetryEventSchema, AccountBalanceReadTelemetryEventSchema, AuthFailedTelemetryEventSchema, AuthOtpDeliveredTelemetryEventSchema, AuthOtpExpiredTelemetryEventSchema, AuthOtpRequestedTelemetryEventSchema, AuthSignedOutTelemetryEventSchema, AuthVerifiedTelemetryEventSchema, BROWSER_GATED_TELEMETRY_EVENTS, BootstrapFailedTelemetryEventSchema, BootstrapResolvedTelemetryEventSchema, CAPXUL_ENVS, CONTRACT_FIRST_TELEMETRY_EVENTS, DepositInitiatedTelemetryEventSchema, DepositSettledTelemetryEventSchema, FINANCIAL_OPS_TARGET_TELEMETRY_PRODUCERS, FaucetConfirmedTelemetryEventSchema, FaucetFailedTelemetryEventSchema, FaucetRequestedTelemetryEventSchema, InMemoryTelemetryBusAdapter, MemberActivationFailedTelemetryEventSchema, MemberActivationReadyTelemetryEventSchema, MemberActivationStartedTelemetryEventSchema, MovementScanCheckpointTelemetryEventSchema, MovementScanIncidentTelemetryEventSchema, MovementScanWindowTelemetryEventSchema, OnboardingDashboardReachedTelemetryEventSchema, OnboardingIntentSelectedTelemetryEventSchema, OnboardingOrganizationSubmittedTelemetryEventSchema, OnboardingProfileSubmittedTelemetryEventSchema, OrgCreateFailedTelemetryEventSchema, OrgCreateStartedTelemetryEventSchema, OrgCreatedTelemetryEventSchema, OrgInviteAcceptedTelemetryEventSchema, OrgInviteExpiredTelemetryEventSchema, OrgInviteSentTelemetryEventSchema, OrgRolesSeededTelemetryEventSchema, OrgSafeConfirmedTelemetryEventSchema, OrgSafeCreatedTelemetryEventSchema, OrganizationCreationFailedTelemetryEventSchema, OrganizationCreationReadyTelemetryEventSchema, OrganizationCreationStartedTelemetryEventSchema, PII, PRODUCT_MAPPER_GATED_TELEMETRY_EVENTS, PaymentFailedTelemetryEventSchema, PaymentInitiatedTelemetryEventSchema, PaymentSettledTelemetryEventSchema, PermissionMirrorVerificationTelemetryEventSchema, PostHogTelemetryAdapter, ProvisioningSafeConfirmedTelemetryEventSchema, ProvisioningSafeCreatedTelemetryEventSchema, RecordingTelemetryAdapter, SYNCABLE_CAPXUL_ENVS, TELEMETRY_EVENT_NAMES, TELEMETRY_EVENT_SCHEMAS, TELEMETRY_JOURNEYS, TELEMETRY_PRODUCERS, createCapxulBeforeSend, createPostHogBrowserPageviewTracker, getTrackHandler, initializeCapxulBrowserAnalytics, initializePostHogBrowserAnalytics, productAppAnalytics, redactTelemetryEvent, redactTelemetryProps, sanitizePostHogBrowserEvent, setTrackHandler, stampTelemetryEnvelope, track, utilityAppAnalytics };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capxul/observability",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,15 +30,18 @@
|
|
|
30
30
|
"effect": "4.0.0-beta.105"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
+
"@typescript/native": "npm:typescript@7.0.2",
|
|
33
34
|
"@vitest/coverage-v8": "4.1.7",
|
|
34
35
|
"jsdom": "^29.1.1",
|
|
35
36
|
"posthog-js": "^1.399.2",
|
|
37
|
+
"vite-plus": "0.1.23",
|
|
36
38
|
"vitest": "npm:@voidzero-dev/vite-plus-test@0.1.23",
|
|
37
39
|
"@capxul/errors": "0.0.1",
|
|
38
|
-
"@capxul/types": "0.1.0"
|
|
40
|
+
"@capxul/types": "0.1.0",
|
|
41
|
+
"@capxul/typescript-config": "0.0.0"
|
|
39
42
|
},
|
|
40
43
|
"scripts": {
|
|
41
|
-
"check-types": "tsc -p tsconfig.json --noEmit",
|
|
44
|
+
"check-types": "vp exec ../../node_modules/@typescript/native/bin/tsc -p tsconfig.json --noEmit",
|
|
42
45
|
"lint": "oxlint -c ../../.oxlintrc.json . --deny-warnings",
|
|
43
46
|
"build": "NODE_OPTIONS=--max-old-space-size=8192 vp pack",
|
|
44
47
|
"_vp-tasks-allowed": "vp-allowed: `test` + `test:coverage` are vp tasks in vite.config.ts so vitest self-writes don't bust cache (#205)."
|