@capxul/observability 1.2.3 → 2.0.1
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/dist/engineering.d.mts +1 -2
- package/dist/engineering.mjs +0 -2
- package/dist/index.d.mts +404 -1159
- package/dist/index.mjs +101 -383
- 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` —
|
|
@@ -553,45 +466,6 @@ const FaucetFailedProps = Schema.Struct({
|
|
|
553
466
|
...TelemetryEnvelopeProps,
|
|
554
467
|
reason: OptionalString
|
|
555
468
|
});
|
|
556
|
-
const SubaccountCreatedProps = Schema.Struct({
|
|
557
|
-
...TelemetryEnvelopeProps,
|
|
558
|
-
sub_account_id: OptionalSubAccountId,
|
|
559
|
-
durationMs: OptionalDurationMs
|
|
560
|
-
});
|
|
561
|
-
const SubaccountRenamedProps = Schema.Struct({
|
|
562
|
-
...TelemetryEnvelopeProps,
|
|
563
|
-
sub_account_id: OptionalSubAccountId
|
|
564
|
-
});
|
|
565
|
-
const SubaccountDeletedProps = Schema.Struct({
|
|
566
|
-
...TelemetryEnvelopeProps,
|
|
567
|
-
sub_account_id: OptionalSubAccountId
|
|
568
|
-
});
|
|
569
|
-
const SubaccountOpFailedProps = Schema.Struct({
|
|
570
|
-
...TelemetryEnvelopeProps,
|
|
571
|
-
op: OptionalSubAccountOp,
|
|
572
|
-
reason: OptionalString
|
|
573
|
-
});
|
|
574
|
-
const TransferRequestedProps = Schema.Struct({
|
|
575
|
-
...TelemetryEnvelopeProps,
|
|
576
|
-
amount: OptionalWeiAmount,
|
|
577
|
-
direction: OptionalTransferDirection
|
|
578
|
-
});
|
|
579
|
-
const TransferBackendReceivedProps = Schema.Struct({
|
|
580
|
-
...TelemetryEnvelopeProps,
|
|
581
|
-
direction: OptionalTransferDirection
|
|
582
|
-
});
|
|
583
|
-
const TransferConfirmedProps = Schema.Struct({
|
|
584
|
-
...TelemetryEnvelopeProps,
|
|
585
|
-
amount: OptionalWeiAmount,
|
|
586
|
-
direction: OptionalTransferDirection,
|
|
587
|
-
available_bucket: OptionalBalanceBucket,
|
|
588
|
-
txless: OptionalTrue,
|
|
589
|
-
durationMs: OptionalDurationMs
|
|
590
|
-
});
|
|
591
|
-
const TransferFailedProps = Schema.Struct({
|
|
592
|
-
...TelemetryEnvelopeProps,
|
|
593
|
-
reason: OptionalString
|
|
594
|
-
});
|
|
595
469
|
const ORG_ID_TELEMETRY_RE = /^org_[0-9A-Za-z]+$/;
|
|
596
470
|
const OrgIdTelemetrySchema = Schema.String.pipe(Schema.refine((value) => ORG_ID_TELEMETRY_RE.test(value), { message: "must be org_ plus an alphanumeric id" }));
|
|
597
471
|
const OptionalOrgId = Schema.optional(OrgIdTelemetrySchema);
|
|
@@ -716,75 +590,70 @@ const OrgInviteAcceptedProps = Schema.Struct({
|
|
|
716
590
|
role: OptionalString,
|
|
717
591
|
status: OptionalString
|
|
718
592
|
});
|
|
719
|
-
const
|
|
593
|
+
const OrgInviteExpiredProps = Schema.Struct({
|
|
720
594
|
...TelemetryEnvelopeProps,
|
|
721
595
|
org_id: OptionalOrgId,
|
|
596
|
+
email_domain: OptionalString,
|
|
597
|
+
reason: OptionalString,
|
|
722
598
|
role: OptionalString,
|
|
723
|
-
status: OptionalString
|
|
724
|
-
txHash: OptionalTxHash
|
|
599
|
+
status: OptionalString
|
|
725
600
|
});
|
|
726
|
-
const
|
|
601
|
+
const PaymentInitiatedProps = Schema.Struct({
|
|
727
602
|
...TelemetryEnvelopeProps,
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
status: OptionalString,
|
|
731
|
-
durationMs: OptionalDurationMs
|
|
603
|
+
kind: Schema.String,
|
|
604
|
+
payment_id: Schema.String
|
|
732
605
|
});
|
|
733
|
-
const
|
|
606
|
+
const PaymentSettledL2Props = Schema.Struct({
|
|
734
607
|
...TelemetryEnvelopeProps,
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
txHash: OptionalTxHash
|
|
608
|
+
kind: Schema.String,
|
|
609
|
+
chain_id: Schema.Number,
|
|
610
|
+
settlement_id: Schema.String
|
|
739
611
|
});
|
|
740
|
-
const
|
|
612
|
+
const PaymentFailedL2Props = Schema.Struct({
|
|
741
613
|
...TelemetryEnvelopeProps,
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
role: OptionalString,
|
|
746
|
-
status: OptionalString
|
|
614
|
+
kind: Schema.String,
|
|
615
|
+
payment_id: Schema.String,
|
|
616
|
+
reason_code: Schema.String
|
|
747
617
|
});
|
|
748
|
-
const
|
|
618
|
+
const DepositInitiatedProps = Schema.Struct({ ...TelemetryEnvelopeProps });
|
|
619
|
+
const DepositSettledProps = Schema.Struct({
|
|
749
620
|
...TelemetryEnvelopeProps,
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
621
|
+
chain_id: Schema.Number,
|
|
622
|
+
tx_hash: Schema.String,
|
|
623
|
+
log_index: Schema.Number
|
|
753
624
|
});
|
|
754
|
-
const
|
|
755
|
-
const OptionalPayeeId = Schema.optional(PayeeIdTelemetrySchema);
|
|
756
|
-
const OptionalDocumentHash = Schema.optional(DocumentHashSchema);
|
|
757
|
-
const PaymentTargetTelemetryProps = Schema.Struct({
|
|
625
|
+
const PermissionMirrorVerificationProps = Schema.Struct({
|
|
758
626
|
...TelemetryEnvelopeProps,
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
});
|
|
768
|
-
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({
|
|
769
635
|
...TelemetryEnvelopeProps,
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
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
|
|
778
650
|
});
|
|
779
|
-
const
|
|
651
|
+
const MovementScanIncidentProps = Schema.Struct({
|
|
780
652
|
...TelemetryEnvelopeProps,
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
status: OptionalString,
|
|
786
|
-
reason: OptionalString,
|
|
787
|
-
durationMs: OptionalDurationMs
|
|
653
|
+
chain_id: Schema.Number,
|
|
654
|
+
token_address: Schema.String,
|
|
655
|
+
incident_kind: Schema.String,
|
|
656
|
+
anchor_block_number: Schema.Number
|
|
788
657
|
});
|
|
789
658
|
const AuthOtpRequestedTelemetryEventSchema = Schema.Struct({
|
|
790
659
|
name: Schema.Literal("auth_otp_requested"),
|
|
@@ -886,38 +755,6 @@ const FaucetFailedTelemetryEventSchema = Schema.Struct({
|
|
|
886
755
|
name: Schema.Literal("faucet_failed"),
|
|
887
756
|
props: FaucetFailedProps
|
|
888
757
|
});
|
|
889
|
-
const SubaccountCreatedTelemetryEventSchema = Schema.Struct({
|
|
890
|
-
name: Schema.Literal("subaccount_created"),
|
|
891
|
-
props: SubaccountCreatedProps
|
|
892
|
-
});
|
|
893
|
-
const SubaccountRenamedTelemetryEventSchema = Schema.Struct({
|
|
894
|
-
name: Schema.Literal("subaccount_renamed"),
|
|
895
|
-
props: SubaccountRenamedProps
|
|
896
|
-
});
|
|
897
|
-
const SubaccountDeletedTelemetryEventSchema = Schema.Struct({
|
|
898
|
-
name: Schema.Literal("subaccount_deleted"),
|
|
899
|
-
props: SubaccountDeletedProps
|
|
900
|
-
});
|
|
901
|
-
const SubaccountOpFailedTelemetryEventSchema = Schema.Struct({
|
|
902
|
-
name: Schema.Literal("subaccount_op_failed"),
|
|
903
|
-
props: SubaccountOpFailedProps
|
|
904
|
-
});
|
|
905
|
-
const TransferRequestedTelemetryEventSchema = Schema.Struct({
|
|
906
|
-
name: Schema.Literal("transfer_requested"),
|
|
907
|
-
props: TransferRequestedProps
|
|
908
|
-
});
|
|
909
|
-
const TransferBackendReceivedTelemetryEventSchema = Schema.Struct({
|
|
910
|
-
name: Schema.Literal("transfer_backend_received"),
|
|
911
|
-
props: TransferBackendReceivedProps
|
|
912
|
-
});
|
|
913
|
-
const TransferConfirmedTelemetryEventSchema = Schema.Struct({
|
|
914
|
-
name: Schema.Literal("transfer_confirmed"),
|
|
915
|
-
props: TransferConfirmedProps
|
|
916
|
-
});
|
|
917
|
-
const TransferFailedTelemetryEventSchema = Schema.Struct({
|
|
918
|
-
name: Schema.Literal("transfer_failed"),
|
|
919
|
-
props: TransferFailedProps
|
|
920
|
-
});
|
|
921
758
|
const OrgCreateStartedTelemetryEventSchema = Schema.Struct({
|
|
922
759
|
name: Schema.Literal("org_create_started"),
|
|
923
760
|
props: OrgCreateStartedProps
|
|
@@ -950,97 +787,45 @@ const OrgInviteAcceptedTelemetryEventSchema = Schema.Struct({
|
|
|
950
787
|
name: Schema.Literal("org_invite_accepted"),
|
|
951
788
|
props: OrgInviteAcceptedProps
|
|
952
789
|
});
|
|
953
|
-
const OrgRoleGrantedTelemetryEventSchema = Schema.Struct({
|
|
954
|
-
name: Schema.Literal("org_role_granted"),
|
|
955
|
-
props: OrgRoleGrantedProps
|
|
956
|
-
});
|
|
957
|
-
const OrgMemberActiveTelemetryEventSchema = Schema.Struct({
|
|
958
|
-
name: Schema.Literal("org_member_active"),
|
|
959
|
-
props: OrgMemberActiveProps
|
|
960
|
-
});
|
|
961
|
-
const OrgMemberRemovedTelemetryEventSchema = Schema.Struct({
|
|
962
|
-
name: Schema.Literal("org_member_removed"),
|
|
963
|
-
props: OrgMemberRemovedProps
|
|
964
|
-
});
|
|
965
790
|
const OrgInviteExpiredTelemetryEventSchema = Schema.Struct({
|
|
966
791
|
name: Schema.Literal("org_invite_expired"),
|
|
967
792
|
props: OrgInviteExpiredProps
|
|
968
793
|
});
|
|
969
|
-
const
|
|
970
|
-
name: Schema.Literal("
|
|
971
|
-
props:
|
|
972
|
-
});
|
|
973
|
-
const PaymentRequestedTelemetryEventSchema = Schema.Struct({
|
|
974
|
-
name: Schema.Literal("payment_requested"),
|
|
975
|
-
props: PaymentTargetTelemetryProps
|
|
976
|
-
});
|
|
977
|
-
const PaymentResolvedTelemetryEventSchema = Schema.Struct({
|
|
978
|
-
name: Schema.Literal("payment_resolved"),
|
|
979
|
-
props: PaymentTargetTelemetryProps
|
|
980
|
-
});
|
|
981
|
-
const PaymentDocumentAttachedTelemetryEventSchema = Schema.Struct({
|
|
982
|
-
name: Schema.Literal("payment_document_attached"),
|
|
983
|
-
props: PaymentTargetTelemetryProps
|
|
984
|
-
});
|
|
985
|
-
const PaymentSubmittedTelemetryEventSchema = Schema.Struct({
|
|
986
|
-
name: Schema.Literal("payment_submitted"),
|
|
987
|
-
props: PaymentTargetTelemetryProps
|
|
794
|
+
const PaymentInitiatedTelemetryEventSchema = Schema.Struct({
|
|
795
|
+
name: Schema.Literal("payment_initiated"),
|
|
796
|
+
props: PaymentInitiatedProps
|
|
988
797
|
});
|
|
989
798
|
const PaymentSettledTelemetryEventSchema = Schema.Struct({
|
|
990
799
|
name: Schema.Literal("payment_settled"),
|
|
991
|
-
props:
|
|
992
|
-
});
|
|
993
|
-
const PaymentClaimedTelemetryEventSchema = Schema.Struct({
|
|
994
|
-
name: Schema.Literal("payment_claimed"),
|
|
995
|
-
props: PaymentTargetTelemetryProps
|
|
996
|
-
});
|
|
997
|
-
const PaymentCancelledTelemetryEventSchema = Schema.Struct({
|
|
998
|
-
name: Schema.Literal("payment_cancelled"),
|
|
999
|
-
props: PaymentTargetTelemetryProps
|
|
1000
|
-
});
|
|
1001
|
-
const PaymentRedirectedTelemetryEventSchema = Schema.Struct({
|
|
1002
|
-
name: Schema.Literal("payment_redirected"),
|
|
1003
|
-
props: PaymentTargetTelemetryProps
|
|
800
|
+
props: PaymentSettledL2Props
|
|
1004
801
|
});
|
|
1005
802
|
const PaymentFailedTelemetryEventSchema = Schema.Struct({
|
|
1006
803
|
name: Schema.Literal("payment_failed"),
|
|
1007
|
-
props:
|
|
1008
|
-
});
|
|
1009
|
-
const StreamCreatedTelemetryEventSchema = Schema.Struct({
|
|
1010
|
-
name: Schema.Literal("stream_created"),
|
|
1011
|
-
props: StreamTargetTelemetryProps
|
|
804
|
+
props: PaymentFailedL2Props
|
|
1012
805
|
});
|
|
1013
|
-
const
|
|
1014
|
-
name: Schema.Literal("
|
|
1015
|
-
props:
|
|
806
|
+
const DepositInitiatedTelemetryEventSchema = Schema.Struct({
|
|
807
|
+
name: Schema.Literal("deposit_initiated"),
|
|
808
|
+
props: DepositInitiatedProps
|
|
1016
809
|
});
|
|
1017
|
-
const
|
|
1018
|
-
name: Schema.Literal("
|
|
1019
|
-
props:
|
|
810
|
+
const DepositSettledTelemetryEventSchema = Schema.Struct({
|
|
811
|
+
name: Schema.Literal("deposit_settled"),
|
|
812
|
+
props: DepositSettledProps
|
|
1020
813
|
});
|
|
1021
|
-
const
|
|
1022
|
-
name: Schema.Literal("
|
|
1023
|
-
props:
|
|
814
|
+
const PermissionMirrorVerificationTelemetryEventSchema = Schema.Struct({
|
|
815
|
+
name: Schema.Literal("permission_mirror_verification"),
|
|
816
|
+
props: PermissionMirrorVerificationProps
|
|
1024
817
|
});
|
|
1025
|
-
const
|
|
1026
|
-
name: Schema.Literal("
|
|
1027
|
-
props:
|
|
818
|
+
const MovementScanWindowTelemetryEventSchema = Schema.Struct({
|
|
819
|
+
name: Schema.Literal("movement_scan_window"),
|
|
820
|
+
props: MovementScanWindowProps
|
|
1028
821
|
});
|
|
1029
|
-
const
|
|
1030
|
-
name: Schema.Literal("
|
|
1031
|
-
props:
|
|
822
|
+
const MovementScanCheckpointTelemetryEventSchema = Schema.Struct({
|
|
823
|
+
name: Schema.Literal("movement_scan_checkpoint"),
|
|
824
|
+
props: MovementScanCheckpointProps
|
|
1032
825
|
});
|
|
1033
|
-
const
|
|
1034
|
-
name: Schema.Literal("
|
|
1035
|
-
props:
|
|
1036
|
-
});
|
|
1037
|
-
const WithdrawalSettledTelemetryEventSchema = Schema.Struct({
|
|
1038
|
-
name: Schema.Literal("withdrawal_settled"),
|
|
1039
|
-
props: WithdrawalTargetTelemetryProps
|
|
1040
|
-
});
|
|
1041
|
-
const WithdrawalFailedTelemetryEventSchema = Schema.Struct({
|
|
1042
|
-
name: Schema.Literal("withdrawal_failed"),
|
|
1043
|
-
props: WithdrawalTargetTelemetryProps
|
|
826
|
+
const MovementScanIncidentTelemetryEventSchema = Schema.Struct({
|
|
827
|
+
name: Schema.Literal("movement_scan_incident"),
|
|
828
|
+
props: MovementScanIncidentProps
|
|
1044
829
|
});
|
|
1045
830
|
const TELEMETRY_EVENT_SCHEMAS = {
|
|
1046
831
|
auth_otp_requested: AuthOtpRequestedTelemetryEventSchema,
|
|
@@ -1068,14 +853,6 @@ const TELEMETRY_EVENT_SCHEMAS = {
|
|
|
1068
853
|
faucet_requested: FaucetRequestedTelemetryEventSchema,
|
|
1069
854
|
faucet_confirmed: FaucetConfirmedTelemetryEventSchema,
|
|
1070
855
|
faucet_failed: FaucetFailedTelemetryEventSchema,
|
|
1071
|
-
subaccount_created: SubaccountCreatedTelemetryEventSchema,
|
|
1072
|
-
subaccount_renamed: SubaccountRenamedTelemetryEventSchema,
|
|
1073
|
-
subaccount_deleted: SubaccountDeletedTelemetryEventSchema,
|
|
1074
|
-
subaccount_op_failed: SubaccountOpFailedTelemetryEventSchema,
|
|
1075
|
-
transfer_requested: TransferRequestedTelemetryEventSchema,
|
|
1076
|
-
transfer_backend_received: TransferBackendReceivedTelemetryEventSchema,
|
|
1077
|
-
transfer_confirmed: TransferConfirmedTelemetryEventSchema,
|
|
1078
|
-
transfer_failed: TransferFailedTelemetryEventSchema,
|
|
1079
856
|
org_create_started: OrgCreateStartedTelemetryEventSchema,
|
|
1080
857
|
org_safe_created: OrgSafeCreatedTelemetryEventSchema,
|
|
1081
858
|
org_safe_confirmed: OrgSafeConfirmedTelemetryEventSchema,
|
|
@@ -1084,82 +861,25 @@ const TELEMETRY_EVENT_SCHEMAS = {
|
|
|
1084
861
|
org_create_failed: OrgCreateFailedTelemetryEventSchema,
|
|
1085
862
|
org_invite_sent: OrgInviteSentTelemetryEventSchema,
|
|
1086
863
|
org_invite_accepted: OrgInviteAcceptedTelemetryEventSchema,
|
|
1087
|
-
org_role_granted: OrgRoleGrantedTelemetryEventSchema,
|
|
1088
|
-
org_member_active: OrgMemberActiveTelemetryEventSchema,
|
|
1089
|
-
org_member_removed: OrgMemberRemovedTelemetryEventSchema,
|
|
1090
864
|
org_invite_expired: OrgInviteExpiredTelemetryEventSchema,
|
|
1091
|
-
|
|
1092
|
-
payment_requested: PaymentRequestedTelemetryEventSchema,
|
|
1093
|
-
payment_resolved: PaymentResolvedTelemetryEventSchema,
|
|
1094
|
-
payment_document_attached: PaymentDocumentAttachedTelemetryEventSchema,
|
|
1095
|
-
payment_submitted: PaymentSubmittedTelemetryEventSchema,
|
|
865
|
+
payment_initiated: PaymentInitiatedTelemetryEventSchema,
|
|
1096
866
|
payment_settled: PaymentSettledTelemetryEventSchema,
|
|
1097
|
-
payment_claimed: PaymentClaimedTelemetryEventSchema,
|
|
1098
|
-
payment_cancelled: PaymentCancelledTelemetryEventSchema,
|
|
1099
|
-
payment_redirected: PaymentRedirectedTelemetryEventSchema,
|
|
1100
867
|
payment_failed: PaymentFailedTelemetryEventSchema,
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
withdrawal_submitted: WithdrawalSubmittedTelemetryEventSchema,
|
|
1108
|
-
withdrawal_settled: WithdrawalSettledTelemetryEventSchema,
|
|
1109
|
-
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
|
|
1110
874
|
};
|
|
1111
|
-
const FINANCIAL_OPS_TARGET_TELEMETRY_PRODUCERS = [
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
ownerIssue: 410,
|
|
1120
|
-
producer: "sdk-target"
|
|
1121
|
-
},
|
|
1122
|
-
{
|
|
1123
|
-
eventName: "payment_document_attached",
|
|
1124
|
-
ownerIssue: 486,
|
|
1125
|
-
producer: "sdk-target"
|
|
1126
|
-
},
|
|
1127
|
-
{
|
|
1128
|
-
eventName: "payment_submitted",
|
|
1129
|
-
ownerIssue: 410,
|
|
1130
|
-
producer: "sdk-target"
|
|
1131
|
-
},
|
|
1132
|
-
{
|
|
1133
|
-
eventName: "payment_failed",
|
|
1134
|
-
ownerIssue: 410,
|
|
1135
|
-
producer: "sdk-target"
|
|
1136
|
-
},
|
|
1137
|
-
{
|
|
1138
|
-
eventName: "stream_created",
|
|
1139
|
-
ownerIssue: 411,
|
|
1140
|
-
producer: "sdk-target"
|
|
1141
|
-
},
|
|
1142
|
-
{
|
|
1143
|
-
eventName: "stream_failed",
|
|
1144
|
-
ownerIssue: 411,
|
|
1145
|
-
producer: "sdk-target"
|
|
1146
|
-
},
|
|
1147
|
-
{
|
|
1148
|
-
eventName: "withdrawal_requested",
|
|
1149
|
-
ownerIssue: 410,
|
|
1150
|
-
producer: "sdk-target"
|
|
1151
|
-
},
|
|
1152
|
-
{
|
|
1153
|
-
eventName: "withdrawal_submitted",
|
|
1154
|
-
ownerIssue: 410,
|
|
1155
|
-
producer: "sdk-target"
|
|
1156
|
-
},
|
|
1157
|
-
{
|
|
1158
|
-
eventName: "withdrawal_failed",
|
|
1159
|
-
ownerIssue: 410,
|
|
1160
|
-
producer: "sdk-target"
|
|
1161
|
-
}
|
|
1162
|
-
];
|
|
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 = [];
|
|
1163
883
|
/**
|
|
1164
884
|
* Catalog events whose product mapper remains gated on the #1150 frontend
|
|
1165
885
|
* adoption. L1 S1 removes their retired SDK-flow producers without inventing
|
|
@@ -1658,6 +1378,4 @@ function rotr(value, bits) {
|
|
|
1658
1378
|
return value >>> bits | value << 32 - bits;
|
|
1659
1379
|
}
|
|
1660
1380
|
//#endregion
|
|
1661
|
-
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,
|
|
1662
|
-
|
|
1663
|
-
//# 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.1",
|
|
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)."
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"engineering.d.mts","names":[],"sources":["../src/engineering.ts"],"mappings":";;;;KAWY,mBAAA;AAAA,KACA,oBAAA;AAAA,UAEK,0BAAA;EAAA,SACN,IAAA;EAAA,SACA,OAAA,EAAS,QAAA,CAAS,MAAA;EAAA,SAClB,SAAA,EAAW,oBAAA;EAAA,SACX,QAAA,EAAU,mBAAA;EAAA,SACV,UAAA;EAAA,SACA,WAAA;AAAA;AAAA,cAmBE,iBAAA,GAAqB,IAAY;AAAA,cAKjC,oBAAA,GAAwB,IAAA;EAAA;;;;cA8ExB,6BAAA,GAAiC,QAAA,EAAU,MAAA,CAAO,MAAA,KAAS,MAAA,CAAO,MAoB3E;;cAGS,6BAAA,GAAiC,MAAA,EAAQ,0BAAA,KAA0B,KAAA,CAAA,KAAA,CAAA,YAAA,CAAA,OAAA"}
|