@q9labsai/chalk-client 4.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/LICENSE +21 -0
- package/README.md +173 -0
- package/dist/access/base64-url.d.ts +2 -0
- package/dist/access/base64-url.d.ts.map +1 -0
- package/dist/access/episode-diagnostic-credential.d.ts +11 -0
- package/dist/access/episode-diagnostic-credential.d.ts.map +1 -0
- package/dist/access/grant.d.ts +53 -0
- package/dist/access/grant.d.ts.map +1 -0
- package/dist/access/grant.test.helpers.d.ts +10 -0
- package/dist/access/grant.test.helpers.d.ts.map +1 -0
- package/dist/access/manager.d.ts +36 -0
- package/dist/access/manager.d.ts.map +1 -0
- package/dist/chat-files/http-transport.d.ts +8 -0
- package/dist/chat-files/http-transport.d.ts.map +1 -0
- package/dist/chat-files/index.d.ts +3 -0
- package/dist/chat-files/index.d.ts.map +1 -0
- package/dist/chat-files/types.d.ts +37 -0
- package/dist/chat-files/types.d.ts.map +1 -0
- package/dist/chunk-5VXGLI3T.js +3385 -0
- package/dist/chunk-O22WFBKF.js +5161 -0
- package/dist/chunk-PBCGWE2V.js +811 -0
- package/dist/chunk-PBSYXPNJ.js +23 -0
- package/dist/chunk-QVHR3RMB.js +1229 -0
- package/dist/client.d.ts +6785 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/collaboration/index.d.ts +3 -0
- package/dist/collaboration/index.d.ts.map +1 -0
- package/dist/collaboration/types.d.ts +94 -0
- package/dist/collaboration/types.d.ts.map +1 -0
- package/dist/collaboration/wire.d.ts +19 -0
- package/dist/collaboration/wire.d.ts.map +1 -0
- package/dist/connection/dependencies.d.ts +112 -0
- package/dist/connection/dependencies.d.ts.map +1 -0
- package/dist/connection/diagnostics.d.ts +52 -0
- package/dist/connection/diagnostics.d.ts.map +1 -0
- package/dist/connection/index.d.ts +47 -0
- package/dist/connection/index.d.ts.map +1 -0
- package/dist/connection/lifecycle.d.ts +58 -0
- package/dist/connection/lifecycle.d.ts.map +1 -0
- package/dist/connection/media-devices.d.ts +6 -0
- package/dist/connection/media-devices.d.ts.map +1 -0
- package/dist/connection/production.d.ts +13 -0
- package/dist/connection/production.d.ts.map +1 -0
- package/dist/connection/snapshot.d.ts +23 -0
- package/dist/connection/snapshot.d.ts.map +1 -0
- package/dist/connection/types.d.ts +128 -0
- package/dist/connection/types.d.ts.map +1 -0
- package/dist/effect.d.ts +19 -0
- package/dist/effect.d.ts.map +1 -0
- package/dist/effect.js +7846 -0
- package/dist/episode-diagnostic-runtime.test.helpers.d.ts +3 -0
- package/dist/episode-diagnostic-runtime.test.helpers.d.ts.map +1 -0
- package/dist/generated/http-api.d.ts +6658 -0
- package/dist/generated/http-api.d.ts.map +1 -0
- package/dist/generated/schemas.d.ts +12076 -0
- package/dist/generated/schemas.d.ts.map +1 -0
- package/dist/generated/sync.d.ts +3947 -0
- package/dist/generated/sync.d.ts.map +1 -0
- package/dist/generated/whiteboard-v1.d.ts +334 -0
- package/dist/generated/whiteboard-v1.d.ts.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +152 -0
- package/dist/media/client.d.ts +18 -0
- package/dist/media/client.d.ts.map +1 -0
- package/dist/media/cloudflare-sfu.d.ts +5 -0
- package/dist/media/cloudflare-sfu.d.ts.map +1 -0
- package/dist/media/index.d.ts +3 -0
- package/dist/media/index.d.ts.map +1 -0
- package/dist/media/index.js +24 -0
- package/dist/media/plane.d.ts +24 -0
- package/dist/media/plane.d.ts.map +1 -0
- package/dist/media/tracks.d.ts +21 -0
- package/dist/media/tracks.d.ts.map +1 -0
- package/dist/media/transport.d.ts +3 -0
- package/dist/media/transport.d.ts.map +1 -0
- package/dist/media/types.d.ts +114 -0
- package/dist/media/types.d.ts.map +1 -0
- package/dist/server/chunk-A6YMG5FM.js +61 -0
- package/dist/server/client.d.cts +2 -0
- package/dist/server/client.d.ts +3 -0
- package/dist/server/client.d.ts.map +1 -0
- package/dist/server/errors.d.cts +18 -0
- package/dist/server/errors.d.ts +19 -0
- package/dist/server/errors.d.ts.map +1 -0
- package/dist/server/index.cjs +551 -0
- package/dist/server/index.d.cts +3 -0
- package/dist/server/index.d.ts +4 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +474 -0
- package/dist/server/server-only.cjs +40 -0
- package/dist/server/server-only.d.cts +1 -0
- package/dist/server/server-only.d.ts +2 -0
- package/dist/server/server-only.d.ts.map +1 -0
- package/dist/server/server-only.js +9 -0
- package/dist/server/transport.d.cts +12 -0
- package/dist/server/transport.d.ts +13 -0
- package/dist/server/transport.d.ts.map +1 -0
- package/dist/server/types.d.cts +201 -0
- package/dist/server/types.d.ts +202 -0
- package/dist/server/types.d.ts.map +1 -0
- package/dist/space-client/chat-controller-helpers.d.ts +15 -0
- package/dist/space-client/chat-controller-helpers.d.ts.map +1 -0
- package/dist/space-client/chat-controller.d.ts +34 -0
- package/dist/space-client/chat-controller.d.ts.map +1 -0
- package/dist/space-client/controller-effects.d.ts +45 -0
- package/dist/space-client/controller-effects.d.ts.map +1 -0
- package/dist/space-client/controller-parity.test.helpers.d.ts +150 -0
- package/dist/space-client/controller-parity.test.helpers.d.ts.map +1 -0
- package/dist/space-client/core.d.ts +52 -0
- package/dist/space-client/core.d.ts.map +1 -0
- package/dist/space-client/core.test.helpers.d.ts +14 -0
- package/dist/space-client/core.test.helpers.d.ts.map +1 -0
- package/dist/space-client/effect.d.ts +44 -0
- package/dist/space-client/effect.d.ts.map +1 -0
- package/dist/space-client/episode-diagnostic-registry.d.ts +13 -0
- package/dist/space-client/episode-diagnostic-registry.d.ts.map +1 -0
- package/dist/space-client/episode-diagnostic-render-registry.d.ts +4 -0
- package/dist/space-client/episode-diagnostic-render-registry.d.ts.map +1 -0
- package/dist/space-client/episode-diagnostic-runtime.d.ts +102 -0
- package/dist/space-client/episode-diagnostic-runtime.d.ts.map +1 -0
- package/dist/space-client/errors.d.ts +11 -0
- package/dist/space-client/errors.d.ts.map +1 -0
- package/dist/space-client/index.d.ts +5 -0
- package/dist/space-client/index.d.ts.map +1 -0
- package/dist/space-client/media-controller.d.ts +30 -0
- package/dist/space-client/media-controller.d.ts.map +1 -0
- package/dist/space-client/media-controller.test.helpers.d.ts +105 -0
- package/dist/space-client/media-controller.test.helpers.d.ts.map +1 -0
- package/dist/space-client/media-device-selection.d.ts +13 -0
- package/dist/space-client/media-device-selection.d.ts.map +1 -0
- package/dist/space-client/participants-controller.d.ts +33 -0
- package/dist/space-client/participants-controller.d.ts.map +1 -0
- package/dist/space-client/promise-facade.d.ts +12 -0
- package/dist/space-client/promise-facade.d.ts.map +1 -0
- package/dist/space-client/reactions-controller.d.ts +19 -0
- package/dist/space-client/reactions-controller.d.ts.map +1 -0
- package/dist/space-client/space-client.d.ts +5 -0
- package/dist/space-client/space-client.d.ts.map +1 -0
- package/dist/space-client/store.d.ts +29 -0
- package/dist/space-client/store.d.ts.map +1 -0
- package/dist/space-client/types.d.ts +222 -0
- package/dist/space-client/types.d.ts.map +1 -0
- package/dist/space-client/whiteboard-controller.d.ts +17 -0
- package/dist/space-client/whiteboard-controller.d.ts.map +1 -0
- package/dist/sync/browser.d.ts +9 -0
- package/dist/sync/browser.d.ts.map +1 -0
- package/dist/sync/canonical.d.ts +7 -0
- package/dist/sync/canonical.d.ts.map +1 -0
- package/dist/sync/errors.d.ts +9 -0
- package/dist/sync/errors.d.ts.map +1 -0
- package/dist/sync/index.d.ts +13 -0
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/index.js +51 -0
- package/dist/sync/react-native.d.ts +42 -0
- package/dist/sync/react-native.d.ts.map +1 -0
- package/dist/sync/types.d.ts +28 -0
- package/dist/sync/types.d.ts.map +1 -0
- package/dist/sync/v1-client.d.ts +59 -0
- package/dist/sync/v1-client.d.ts.map +1 -0
- package/dist/sync/v1-codec.d.ts +5 -0
- package/dist/sync/v1-codec.d.ts.map +1 -0
- package/dist/sync/v1-create.d.ts +12 -0
- package/dist/sync/v1-create.d.ts.map +1 -0
- package/dist/sync/v1-persistence.d.ts +10 -0
- package/dist/sync/v1-persistence.d.ts.map +1 -0
- package/dist/sync/v1-platform-persistence.d.ts +26 -0
- package/dist/sync/v1-platform-persistence.d.ts.map +1 -0
- package/dist/sync/v1-reducer.d.ts +17 -0
- package/dist/sync/v1-reducer.d.ts.map +1 -0
- package/dist/sync/v1-types.d.ts +197 -0
- package/dist/sync/v1-types.d.ts.map +1 -0
- package/dist/telemetry/attributes.d.ts +7 -0
- package/dist/telemetry/attributes.d.ts.map +1 -0
- package/dist/telemetry/client.d.ts +44 -0
- package/dist/telemetry/client.d.ts.map +1 -0
- package/dist/telemetry/delivery.d.ts +107 -0
- package/dist/telemetry/delivery.d.ts.map +1 -0
- package/dist/telemetry/exporter.d.ts +38 -0
- package/dist/telemetry/exporter.d.ts.map +1 -0
- package/dist/telemetry/index.d.ts +7 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +48 -0
- package/dist/telemetry/journey.d.ts +52 -0
- package/dist/telemetry/journey.d.ts.map +1 -0
- package/dist/telemetry/random.d.ts +18 -0
- package/dist/telemetry/random.d.ts.map +1 -0
- package/dist/telemetry/rtc.d.ts +35 -0
- package/dist/telemetry/rtc.d.ts.map +1 -0
- package/dist/telemetry/storage.d.ts +22 -0
- package/dist/telemetry/storage.d.ts.map +1 -0
- package/dist/telemetry/sync.d.ts +10 -0
- package/dist/telemetry/sync.d.ts.map +1 -0
- package/dist/telemetry/test-support.d.ts +51 -0
- package/dist/telemetry/test-support.d.ts.map +1 -0
- package/dist/telemetry/trace.d.ts +18 -0
- package/dist/telemetry/trace.d.ts.map +1 -0
- package/dist/telemetry/types.d.ts +109 -0
- package/dist/telemetry/types.d.ts.map +1 -0
- package/dist/webhooks/chunk-UNMJZNTZ.js +31 -0
- package/dist/webhooks/errors.d.cts +8 -0
- package/dist/webhooks/errors.d.ts +9 -0
- package/dist/webhooks/errors.d.ts.map +1 -0
- package/dist/webhooks/generated/event-v1.d.cts +764 -0
- package/dist/webhooks/generated/event-v1.d.ts +765 -0
- package/dist/webhooks/generated/event-v1.d.ts.map +1 -0
- package/dist/webhooks/generated/fixtures-v1.d.cts +46 -0
- package/dist/webhooks/generated/fixtures-v1.d.ts +47 -0
- package/dist/webhooks/generated/fixtures-v1.d.ts.map +1 -0
- package/dist/webhooks/index.cjs +1242 -0
- package/dist/webhooks/index.d.cts +5 -0
- package/dist/webhooks/index.d.ts +6 -0
- package/dist/webhooks/index.d.ts.map +1 -0
- package/dist/webhooks/index.js +1197 -0
- package/dist/webhooks/processor.d.cts +21 -0
- package/dist/webhooks/processor.d.ts +22 -0
- package/dist/webhooks/processor.d.ts.map +1 -0
- package/dist/webhooks/server-only.cjs +36 -0
- package/dist/webhooks/server-only.d.cts +1 -0
- package/dist/webhooks/server-only.d.ts +2 -0
- package/dist/webhooks/server-only.d.ts.map +1 -0
- package/dist/webhooks/server-only.js +9 -0
- package/dist/webhooks/test.cjs +160 -0
- package/dist/webhooks/test.d.cts +42 -0
- package/dist/webhooks/test.d.ts +43 -0
- package/dist/webhooks/test.d.ts.map +1 -0
- package/dist/webhooks/test.js +137 -0
- package/dist/webhooks/types.d.cts +55 -0
- package/dist/webhooks/types.d.ts +56 -0
- package/dist/webhooks/types.d.ts.map +1 -0
- package/dist/webhooks/validate.d.cts +5 -0
- package/dist/webhooks/validate.d.ts +6 -0
- package/dist/webhooks/validate.d.ts.map +1 -0
- package/dist/webhooks/verify.d.cts +10 -0
- package/dist/webhooks/verify.d.ts +11 -0
- package/dist/webhooks/verify.d.ts.map +1 -0
- package/dist/whiteboard/file-http-transport.d.ts +9 -0
- package/dist/whiteboard/file-http-transport.d.ts.map +1 -0
- package/dist/whiteboard/index.d.ts +7 -0
- package/dist/whiteboard/index.d.ts.map +1 -0
- package/dist/whiteboard/types.d.ts +139 -0
- package/dist/whiteboard/types.d.ts.map +1 -0
- package/dist/whiteboard/v1-client.d.ts +18 -0
- package/dist/whiteboard/v1-client.d.ts.map +1 -0
- package/dist/whiteboard/v1-codec.d.ts +5 -0
- package/dist/whiteboard/v1-codec.d.ts.map +1 -0
- package/dist/whiteboard/v1-create.d.ts +8 -0
- package/dist/whiteboard/v1-create.d.ts.map +1 -0
- package/dist/whiteboard/v1-multipart.d.ts +30 -0
- package/dist/whiteboard/v1-multipart.d.ts.map +1 -0
- package/dist/whiteboard/v1-persistence.d.ts +9 -0
- package/dist/whiteboard/v1-persistence.d.ts.map +1 -0
- package/package.json +222 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { ChalkChatMessage, ChalkChatPageResult, ChalkChatReadReceipt, ChalkReaction, ChalkReactionEvent, ChalkSendChatMessageInput, ChalkSyncV1CollaborationCapability } from "../collaboration/types";
|
|
2
|
+
import type { V1AdmissionPolicy, V1AssignableRole, V1CommandResult, V1DirectedRequest, V1DirectedRequestResult, V1CollaborationEvent, V1CollaborationClient, V1CollaborationExtensionState, V1EpisodeSnapshot, V1SelfMediaTargetResult, V1SyncClientOptions } from "./v1-types";
|
|
3
|
+
type CommandOptions = {
|
|
4
|
+
readonly commandId?: string;
|
|
5
|
+
};
|
|
6
|
+
type RequestOptions = {
|
|
7
|
+
readonly requestId?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare class V1SyncError extends Error {
|
|
10
|
+
readonly code: string;
|
|
11
|
+
constructor(message: string, code: string);
|
|
12
|
+
}
|
|
13
|
+
export declare class V1SyncClient implements V1CollaborationClient {
|
|
14
|
+
#private;
|
|
15
|
+
constructor(options: V1SyncClientOptions);
|
|
16
|
+
start(): Promise<void>;
|
|
17
|
+
stop(): void;
|
|
18
|
+
getSnapshot(): V1EpisodeSnapshot;
|
|
19
|
+
subscribe(listener: (snapshot: V1EpisodeSnapshot) => void): () => void;
|
|
20
|
+
onDirectedRequest(listener: (request: V1DirectedRequest) => void): () => void;
|
|
21
|
+
getCollaborationExtensionState(): V1CollaborationExtensionState;
|
|
22
|
+
getParticipantCollaborationCapabilities(): Readonly<Record<string, readonly ChalkSyncV1CollaborationCapability[]>>;
|
|
23
|
+
subscribeCollaboration(listener: (event: V1CollaborationEvent) => void): () => void;
|
|
24
|
+
sendReaction(reaction: ChalkReaction): Promise<ChalkReactionEvent>;
|
|
25
|
+
sendChatMessage(input: ChalkSendChatMessageInput): Promise<ChalkChatMessage>;
|
|
26
|
+
markChatRead(sequence: string): Promise<ChalkChatReadReceipt>;
|
|
27
|
+
readChatPage(input: {
|
|
28
|
+
readonly beforeSequence?: string;
|
|
29
|
+
readonly afterSequence?: string;
|
|
30
|
+
readonly limit: number;
|
|
31
|
+
}): Promise<ChalkChatPageResult>;
|
|
32
|
+
setHandRaised(raised: boolean, options?: CommandOptions): Promise<V1CommandResult>;
|
|
33
|
+
setDisplayName(displayName: string, options?: CommandOptions): Promise<V1CommandResult>;
|
|
34
|
+
setAdmissionPolicy(policy: V1AdmissionPolicy, options?: CommandOptions): Promise<V1CommandResult>;
|
|
35
|
+
assignRole(participantId: string, role: V1AssignableRole, options?: CommandOptions): Promise<V1CommandResult>;
|
|
36
|
+
admit(admissionRequestId: string, options?: CommandOptions): Promise<V1CommandResult>;
|
|
37
|
+
deny(admissionRequestId: string, options?: CommandOptions): Promise<V1CommandResult>;
|
|
38
|
+
muteParticipant(participantId: string, options?: CommandOptions): Promise<V1CommandResult>;
|
|
39
|
+
stopParticipantCamera(participantId: string, options?: CommandOptions): Promise<V1CommandResult>;
|
|
40
|
+
stopParticipantScreenShare(participantId: string, options?: CommandOptions): Promise<V1CommandResult>;
|
|
41
|
+
removeParticipant(participantId: string, options?: CommandOptions): Promise<V1CommandResult>;
|
|
42
|
+
startRecording(options?: CommandOptions & {
|
|
43
|
+
readonly recordingId?: string;
|
|
44
|
+
}): Promise<{
|
|
45
|
+
readonly recordingId: string;
|
|
46
|
+
readonly result: V1CommandResult;
|
|
47
|
+
}>;
|
|
48
|
+
stopRecording(recordingId: string, options?: CommandOptions): Promise<V1CommandResult>;
|
|
49
|
+
leave(options?: CommandOptions): Promise<V1CommandResult>;
|
|
50
|
+
endEpisode(options?: CommandOptions): Promise<V1CommandResult>;
|
|
51
|
+
extendEpisode(minutes: number, options?: CommandOptions): Promise<V1CommandResult>;
|
|
52
|
+
setMicrophoneEnabled(enabled: boolean, options?: RequestOptions): Promise<V1SelfMediaTargetResult>;
|
|
53
|
+
setCameraEnabled(enabled: boolean, options?: RequestOptions): Promise<V1SelfMediaTargetResult>;
|
|
54
|
+
setScreenShareEnabled(enabled: boolean, options?: RequestOptions): Promise<V1SelfMediaTargetResult>;
|
|
55
|
+
requestUnmute(participantId: string, options?: RequestOptions): Promise<V1DirectedRequestResult>;
|
|
56
|
+
requestStartCamera(participantId: string, options?: RequestOptions): Promise<V1DirectedRequestResult>;
|
|
57
|
+
}
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=v1-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1-client.d.ts","sourceRoot":"","sources":["../../src/sync/v1-client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,aAAa,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,kCAAkC,EAAE,MAAM,wBAAwB,CAAC;AAO5M,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EAEf,iBAAiB,EACjB,uBAAuB,EASvB,oBAAoB,EACpB,qBAAqB,EACrB,6BAA6B,EAC7B,iBAAiB,EACjB,uBAAuB,EAEvB,mBAAmB,EAEpB,MAAM,YAAY,CAAC;AAsCpB,KAAK,cAAc,GAAG;IAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACtD,KAAK,cAAc,GAAG;IAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtD,qBAAa,WAAY,SAAQ,KAAK;IAGlC,QAAQ,CAAC,IAAI,EAAE,MAAM;IAFvB,YACE,OAAO,EAAE,M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C,eAAe,CAAC,CAErF;IAED,KAAK,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,CAExD;IAED,UAAU,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,CAE7D;IAED,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,CAGjF;IAED,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAEjG;IAED,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAE7F;IAED,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAElG;IAED,aAAa,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAE/F;IAED,kBAAkB,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAEpG;CAigCF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type SyncV1ClientFrame, type SyncV1ServerFrame } from "../generated/sync";
|
|
2
|
+
export declare function encodeV1ClientFrame(frame: unknown): string;
|
|
3
|
+
export declare function decodeV1ServerFrame(wire: string): SyncV1ServerFrame;
|
|
4
|
+
export declare function decodeV1ClientFrame(value: unknown): SyncV1ClientFrame;
|
|
5
|
+
//# sourceMappingURL=v1-codec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1-codec.d.ts","sourceRoot":"","sources":["../../src/sync/v1-codec.ts"],"names":[],"mappings":"AACA,OAAO,EAAqE,KAAK,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtJ,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE1D;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAEnE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,iBAAiB,CAErE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { V1SyncClient } from "./v1-client";
|
|
2
|
+
import { type IndexedDbV1PendingTargetStoreOptions } from "./v1-platform-persistence";
|
|
3
|
+
import type { V1SyncClientOptions } from "./v1-types";
|
|
4
|
+
export type CreateV1SyncClientOptions = Omit<V1SyncClientOptions, "lifecycle" | "pendingStore" | "webSocket"> & {
|
|
5
|
+
readonly lifecycle?: V1SyncClientOptions["lifecycle"];
|
|
6
|
+
readonly pendingStore?: V1SyncClientOptions["pendingStore"];
|
|
7
|
+
readonly webSocket?: V1SyncClientOptions["webSocket"];
|
|
8
|
+
readonly persistenceScope?: string;
|
|
9
|
+
readonly indexedDb?: Omit<IndexedDbV1PendingTargetStoreOptions, "scope">;
|
|
10
|
+
};
|
|
11
|
+
export declare function createV1SyncClient(options: CreateV1SyncClientOptions): V1SyncClient;
|
|
12
|
+
//# sourceMappingURL=v1-create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1-create.d.ts","sourceRoot":"","sources":["../../src/sync/v1-create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAiC,KAAK,oCAAoC,EAAE,MAAM,2BAA2B,CAAC;AACrH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAAC,mBAAmB,EAAE,WAAW,GAAG,cAAc,GAAG,WAAW,CAAC,GAAG;IAC9G,QAAQ,CAAC,SAAS,CAAC,EAAE,mBAAmB,CAAC,WAAW,CAAC,CAAC;IACtD,QAAQ,CAAC,YAAY,CAAC,EAAE,mBAAmB,CAAC,cAAc,CAAC,CAAC;IAC5D,QAAQ,CAAC,SAAS,CAAC,EAAE,mBAAmB,CAAC,WAAW,CAAC,CAAC;IACtD,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,oCAAoC,EAAE,OAAO,CAAC,CAAC;CAC1E,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,YAAY,CASnF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { V1PendingTarget, V1PendingTargetStore } from "./v1-types";
|
|
2
|
+
export declare class InMemoryV1PendingTargetStore implements V1PendingTargetStore {
|
|
3
|
+
#private;
|
|
4
|
+
constructor(commands?: readonly V1PendingTarget[]);
|
|
5
|
+
load(): Promise<readonly V1PendingTarget[]>;
|
|
6
|
+
put(command: V1PendingTarget): Promise<void>;
|
|
7
|
+
remove(commandId: string): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export declare function compareV1PendingTargets(left: V1PendingTarget, right: V1PendingTarget): number;
|
|
10
|
+
//# sourceMappingURL=v1-persistence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1-persistence.d.ts","sourceRoot":"","sources":["../../src/sync/v1-persistence.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAExE,qBAAa,4BAA6B,YAAW,oBAAoB;;IAGvE,YAAY,QAAQ,GAAE,SAAS,eAAe,EAAO,EAEpD;IAEK,IAAI,IAAI,OAAO,CAAC,SAAS,eAAe,EAAE,CAAC,CAEhD;IAEK,GAAG,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAEjD;IAEK,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE7C;CACF;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,GAAG,MAAM,CAE7F"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ReactNativeAsyncStorage } from "./react-native";
|
|
2
|
+
import type { V1PendingTarget, V1PendingTargetStore } from "./v1-types";
|
|
3
|
+
export type IndexedDbV1PendingTargetStoreOptions = {
|
|
4
|
+
readonly scope: string;
|
|
5
|
+
readonly databaseName?: string;
|
|
6
|
+
readonly indexedDb?: IDBFactory;
|
|
7
|
+
};
|
|
8
|
+
export declare class IndexedDbV1PendingTargetStore implements V1PendingTargetStore {
|
|
9
|
+
#private;
|
|
10
|
+
constructor(options: IndexedDbV1PendingTargetStoreOptions);
|
|
11
|
+
load(): Promise<readonly V1PendingTarget[]>;
|
|
12
|
+
put(command: V1PendingTarget): Promise<void>;
|
|
13
|
+
remove(commandId: string): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export type AsyncStorageV1PendingTargetStoreOptions = {
|
|
16
|
+
readonly scope: string;
|
|
17
|
+
readonly storage: ReactNativeAsyncStorage;
|
|
18
|
+
};
|
|
19
|
+
export declare class AsyncStorageV1PendingTargetStore implements V1PendingTargetStore {
|
|
20
|
+
#private;
|
|
21
|
+
constructor(options: AsyncStorageV1PendingTargetStoreOptions);
|
|
22
|
+
load(): Promise<readonly V1PendingTarget[]>;
|
|
23
|
+
put(command: V1PendingTarget): Promise<void>;
|
|
24
|
+
remove(commandId: string): Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=v1-platform-persistence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1-platform-persistence.d.ts","sourceRoot":"","sources":["../../src/sync/v1-platform-persistence.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAmB,MAAM,YAAY,CAAC;AAMzF,MAAM,MAAM,oCAAoC,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC;AAE/I,qBAAa,6BAA8B,YAAW,oBAAoB;;IAMxE,YAAY,OAAO,EAAE,oCAAoC,EAKxD;IAEK,IAAI,IAAI,OAAO,CAAC,SAAS,eAAe,EAAE,CAAC,CAMhD;IAEK,GAAG,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAKjD;IAEK,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAK7C;CAMF;AAED,MAAM,MAAM,uCAAuC,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,uBAAuB,CAAA;CAAE,CAAC;AAE5H,qBAAa,gCAAiC,YAAW,oBAAoB;;IAK3E,YAAY,OAAO,EAAE,uCAAuC,EAI3D;IAED,IAAI,IAAI,OAAO,CAAC,SAAS,eAAe,EAAE,CAAC,CAE1C;IAED,GAAG,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAM3C;IAED,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEvC;CA0BF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SnapshotSchema, type SyncV1ServerFrame } from "../generated/sync";
|
|
2
|
+
import type { V1ControlState, V1TargetCommand } from "./v1-types";
|
|
3
|
+
type EventFrame = Extract<SyncV1ServerFrame, {
|
|
4
|
+
readonly type: "event";
|
|
5
|
+
}>;
|
|
6
|
+
type Snapshot = typeof SnapshotSchema.Type;
|
|
7
|
+
export declare class V1ReplicaError extends Error {
|
|
8
|
+
constructor(message: string);
|
|
9
|
+
}
|
|
10
|
+
export declare function restoreV1Snapshot(snapshot: Snapshot): Promise<V1ControlState>;
|
|
11
|
+
export declare function applyV1Event(state: V1ControlState, event: EventFrame): Promise<V1ControlState>;
|
|
12
|
+
export declare function optimisticV1Control(state: V1ControlState, actorId: string, commands: readonly V1TargetCommand[]): V1ControlState;
|
|
13
|
+
export declare function snapshotToState(snapshot: Snapshot): V1ControlState;
|
|
14
|
+
export declare function assertV1ControlSemantics(state: V1ControlState): void;
|
|
15
|
+
export declare function computeV1StateDigest(state: V1ControlState): Promise<string>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=v1-reducer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1-reducer.d.ts","sourceRoot":"","sources":["../../src/sync/v1-reducer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAG3E,OAAO,KAAK,EAAsB,cAAc,EAAyB,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7G,KAAK,UAAU,GAAG,OAAO,CAAC,iBAAiB,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AACzE,KAAK,QAAQ,GAAG,OAAO,cAAc,CAAC,IAAI,CAAC;AAK3C,qBAAa,cAAe,SAAQ,KAAK;IACvC,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AAED,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC,CAKnF;AAED,wBAAsB,YAAY,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC,CAWpG;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,eAAe,EAAE,GAAG,cAAc,CAEhI;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,cAAc,CAgClE;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CA2BpE;AAED,wBAAsB,oBAAoB,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAKjF"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import type { SyncV1ServerFrame } from "../generated/sync";
|
|
2
|
+
import type { JourneyTelemetryContext } from "../telemetry/types";
|
|
3
|
+
import type { ClientMediaPlane, MediaPlaneOutcome, MediaPlaneResult, MediaPlaneTarget, MediaPublication, MediaSource } from "../media/plane";
|
|
4
|
+
import type { ChalkChatMessage, ChalkChatPageResult, ChalkChatReadReceipt, ChalkReaction, ChalkReactionEvent, ChalkSendChatMessageInput, ChalkSyncV1CollaborationCapability } from "../collaboration/types";
|
|
5
|
+
import type { SyncClock, SyncIdGenerator, SyncLifecycle, SyncSocket, SyncWebSocketFactory } from "./types";
|
|
6
|
+
export declare const V1_CAPABILITIES: readonly ["publishAudio", "publishVideo", "publishScreen", "subscribe", "raiseHand", "renameSelf", "sendChat", "sendReaction", "drawWhiteboard", "manageWhiteboard", "manageAdmission", "assignRoles", "muteOthers", "stopVideoOthers", "stopScreenOthers", "requestMediaOthers", "removeParticipant", "manageRecording", "startEpisode", "extendEpisode", "endEpisode", "manageMembers", "clearSpaceContent"];
|
|
7
|
+
export type V1Capability = (typeof V1_CAPABILITIES)[number];
|
|
8
|
+
export type V1Role = string;
|
|
9
|
+
export type V1AssignableRole = string;
|
|
10
|
+
export type V1AdmissionPolicy = "open" | "knock" | "members_only";
|
|
11
|
+
export type V1MediaSource = MediaSource;
|
|
12
|
+
export type V1ConnectionPhase = "idle" | "connecting" | "recovering" | "live" | "terminal" | "stopped";
|
|
13
|
+
export type V1Participant = {
|
|
14
|
+
readonly participantId: string;
|
|
15
|
+
readonly displayName: string;
|
|
16
|
+
readonly handRaised: boolean;
|
|
17
|
+
readonly admissionRevision: number;
|
|
18
|
+
readonly role: V1Role;
|
|
19
|
+
readonly eligibleRoles: readonly V1Role[];
|
|
20
|
+
readonly capabilities: readonly V1Capability[];
|
|
21
|
+
};
|
|
22
|
+
export type V1AdmissionRequest = {
|
|
23
|
+
readonly admissionRequestId: string;
|
|
24
|
+
readonly participantId: string;
|
|
25
|
+
readonly displayName: string;
|
|
26
|
+
readonly initialRole: V1Role;
|
|
27
|
+
readonly eligibleRoles: readonly V1Role[];
|
|
28
|
+
readonly expiresAtMs: number;
|
|
29
|
+
};
|
|
30
|
+
export type V1Recording = {
|
|
31
|
+
readonly recordingId: string;
|
|
32
|
+
readonly status: "starting" | "recording" | "stopping" | "stopped" | "failed";
|
|
33
|
+
readonly failureCode: string | null;
|
|
34
|
+
};
|
|
35
|
+
export type V1ControlState = {
|
|
36
|
+
readonly revision: number;
|
|
37
|
+
readonly stateSchemaVersion: number;
|
|
38
|
+
readonly stateDigest: string;
|
|
39
|
+
readonly status: "active" | "ended";
|
|
40
|
+
readonly admissionPolicy: V1AdmissionPolicy;
|
|
41
|
+
readonly deadlineAtMs: number;
|
|
42
|
+
readonly deadlineGeneration: number;
|
|
43
|
+
readonly roleCapabilities: Readonly<Record<string, readonly V1Capability[]>>;
|
|
44
|
+
readonly recording: V1Recording | null;
|
|
45
|
+
readonly participants: readonly V1Participant[];
|
|
46
|
+
readonly admissionRequests: readonly V1AdmissionRequest[];
|
|
47
|
+
};
|
|
48
|
+
export type V1MediaPublication = MediaPublication;
|
|
49
|
+
export type V1Presence = {
|
|
50
|
+
readonly participantId: string;
|
|
51
|
+
readonly state: "connected" | "disconnected";
|
|
52
|
+
readonly speaking: boolean;
|
|
53
|
+
readonly activeSpeaker: boolean;
|
|
54
|
+
};
|
|
55
|
+
export type V1Projection<T> = {
|
|
56
|
+
readonly projectionId: string;
|
|
57
|
+
readonly sequence: number;
|
|
58
|
+
readonly items: readonly T[];
|
|
59
|
+
};
|
|
60
|
+
export type V1MediaPlaneOutcome = MediaPlaneOutcome;
|
|
61
|
+
export type V1MediaPlaneTarget = MediaPlaneTarget;
|
|
62
|
+
export type V1MediaPlaneResult = MediaPlaneResult;
|
|
63
|
+
export type V1ClientMediaPlane = ClientMediaPlane;
|
|
64
|
+
export type V1SelfMediaTargetResult = {
|
|
65
|
+
readonly operationId: string;
|
|
66
|
+
readonly name: "set_microphone_enabled" | "set_camera_enabled" | "set_screen_share_enabled";
|
|
67
|
+
readonly serverOutcome: "confirmed" | "satisfied";
|
|
68
|
+
readonly mediaPlaneOutcome: "confirmed" | "satisfied";
|
|
69
|
+
};
|
|
70
|
+
export type V1EpisodeSnapshot = {
|
|
71
|
+
readonly connection: {
|
|
72
|
+
readonly phase: V1ConnectionPhase;
|
|
73
|
+
readonly terminalReason?: string;
|
|
74
|
+
};
|
|
75
|
+
readonly participantId: string | null;
|
|
76
|
+
readonly participantGeneration: number | null;
|
|
77
|
+
readonly control: V1ControlState | null;
|
|
78
|
+
readonly optimisticControl: V1ControlState | null;
|
|
79
|
+
readonly media: V1Projection<V1MediaPublication> | null;
|
|
80
|
+
readonly presence: V1Projection<V1Presence> | null;
|
|
81
|
+
readonly mediaPlane: {
|
|
82
|
+
readonly local: readonly V1MediaPublication[];
|
|
83
|
+
readonly remote: readonly V1MediaPublication[];
|
|
84
|
+
};
|
|
85
|
+
readonly localMedia: Readonly<Record<V1MediaSource, "unknown" | "requesting" | "enabled" | "disabled" | "failed">>;
|
|
86
|
+
readonly pendingCommandCount: number;
|
|
87
|
+
};
|
|
88
|
+
export type V1TargetCommand = {
|
|
89
|
+
readonly name: "set_hand_raised";
|
|
90
|
+
readonly payload: {
|
|
91
|
+
readonly raised: boolean;
|
|
92
|
+
};
|
|
93
|
+
} | {
|
|
94
|
+
readonly name: "set_display_name";
|
|
95
|
+
readonly payload: {
|
|
96
|
+
readonly display_name: string;
|
|
97
|
+
};
|
|
98
|
+
} | {
|
|
99
|
+
readonly name: "set_admission_policy";
|
|
100
|
+
readonly payload: {
|
|
101
|
+
readonly policy: V1AdmissionPolicy;
|
|
102
|
+
};
|
|
103
|
+
} | {
|
|
104
|
+
readonly name: "assign_roles";
|
|
105
|
+
readonly payload: {
|
|
106
|
+
readonly participant_id: string;
|
|
107
|
+
readonly role: V1AssignableRole;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
export type V1OperationName = "admit_participant" | "deny_admission" | "mute_participant" | "stop_participant_camera" | "stop_participant_screen_share" | "remove_participant" | "start_recording" | "stop_recording" | "participant_leave" | "start_episode" | "extend_episode" | "end_episode";
|
|
111
|
+
export type V1PendingTarget = {
|
|
112
|
+
readonly commandId: string;
|
|
113
|
+
readonly command: V1TargetCommand;
|
|
114
|
+
readonly createdAt: number;
|
|
115
|
+
readonly bytes: number;
|
|
116
|
+
};
|
|
117
|
+
export type V1PendingTargetStore = {
|
|
118
|
+
load(): Promise<readonly V1PendingTarget[]>;
|
|
119
|
+
put(command: V1PendingTarget): Promise<void>;
|
|
120
|
+
remove(commandId: string): Promise<void>;
|
|
121
|
+
};
|
|
122
|
+
export type V1CommandResult = Extract<SyncV1ServerFrame, {
|
|
123
|
+
readonly type: "ack";
|
|
124
|
+
}>;
|
|
125
|
+
export type V1LiveTargetResult = Extract<SyncV1ServerFrame, {
|
|
126
|
+
readonly type: "live_target_result";
|
|
127
|
+
}>;
|
|
128
|
+
export type V1DirectedRequestResult = Extract<SyncV1ServerFrame, {
|
|
129
|
+
readonly type: "directed_request_result";
|
|
130
|
+
}>;
|
|
131
|
+
export type V1DirectedRequest = Extract<SyncV1ServerFrame, {
|
|
132
|
+
readonly type: "directed_request";
|
|
133
|
+
}>;
|
|
134
|
+
export type V1ChatCursor = {
|
|
135
|
+
readonly afterSequence: string | null;
|
|
136
|
+
readonly retainedFloorSequence: string | null;
|
|
137
|
+
};
|
|
138
|
+
export type V1CollaborationExtensionRequest = {
|
|
139
|
+
readonly name: "collaboration_v1";
|
|
140
|
+
readonly chatCursor: V1ChatCursor;
|
|
141
|
+
};
|
|
142
|
+
export type V1CollaborationExtensionState = {
|
|
143
|
+
readonly negotiated: boolean;
|
|
144
|
+
readonly version: 1 | null;
|
|
145
|
+
readonly capabilities: readonly ChalkSyncV1CollaborationCapability[];
|
|
146
|
+
readonly chatHeadSequence: string | null;
|
|
147
|
+
readonly retainedFloorSequence: string | null;
|
|
148
|
+
readonly readReceipts: readonly ChalkChatReadReceipt[];
|
|
149
|
+
};
|
|
150
|
+
export type V1CollaborationEvent = {
|
|
151
|
+
readonly type: "reaction";
|
|
152
|
+
readonly reaction: ChalkReactionEvent;
|
|
153
|
+
} | {
|
|
154
|
+
readonly type: "chat_message";
|
|
155
|
+
readonly message: ChalkChatMessage;
|
|
156
|
+
} | {
|
|
157
|
+
readonly type: "chat_read_receipt";
|
|
158
|
+
readonly receipt: ChalkChatReadReceipt;
|
|
159
|
+
} | {
|
|
160
|
+
readonly type: "chat_cursor_reset";
|
|
161
|
+
readonly retainedFloorSequence: string;
|
|
162
|
+
};
|
|
163
|
+
export type V1CollaborationClient = {
|
|
164
|
+
readonly getCollaborationExtensionState: () => V1CollaborationExtensionState;
|
|
165
|
+
readonly getParticipantCollaborationCapabilities: () => Readonly<Record<string, readonly ChalkSyncV1CollaborationCapability[]>>;
|
|
166
|
+
readonly subscribeCollaboration: (listener: (event: V1CollaborationEvent) => void) => () => void;
|
|
167
|
+
readonly sendReaction: (reaction: ChalkReaction) => Promise<ChalkReactionEvent>;
|
|
168
|
+
readonly sendChatMessage: (input: ChalkSendChatMessageInput) => Promise<ChalkChatMessage>;
|
|
169
|
+
readonly markChatRead: (sequence: string) => Promise<ChalkChatReadReceipt>;
|
|
170
|
+
readonly readChatPage: (input: {
|
|
171
|
+
readonly beforeSequence?: string;
|
|
172
|
+
readonly afterSequence?: string;
|
|
173
|
+
readonly limit: number;
|
|
174
|
+
}) => Promise<ChalkChatPageResult>;
|
|
175
|
+
};
|
|
176
|
+
export type V1SyncClientOptions = {
|
|
177
|
+
readonly url: string;
|
|
178
|
+
readonly token: () => Promise<string>;
|
|
179
|
+
readonly webSocket: SyncWebSocketFactory;
|
|
180
|
+
readonly pendingStore?: V1PendingTargetStore;
|
|
181
|
+
readonly mediaPlane?: V1ClientMediaPlane;
|
|
182
|
+
readonly ids?: SyncIdGenerator;
|
|
183
|
+
readonly requestIds?: SyncIdGenerator;
|
|
184
|
+
readonly clock?: SyncClock;
|
|
185
|
+
readonly lifecycle?: SyncLifecycle;
|
|
186
|
+
readonly reconnectDelayMs?: number;
|
|
187
|
+
readonly maxPendingCommands?: number;
|
|
188
|
+
readonly maxPendingBytes?: number;
|
|
189
|
+
readonly maxPendingAgeMs?: number;
|
|
190
|
+
readonly maxOperationPendingAgeMs?: number;
|
|
191
|
+
readonly retryDelayMs?: number;
|
|
192
|
+
readonly collaboration?: V1CollaborationExtensionRequest | false;
|
|
193
|
+
readonly telemetry?: JourneyTelemetryContext;
|
|
194
|
+
readonly maxPendingCollaborationRequests?: number;
|
|
195
|
+
};
|
|
196
|
+
export type V1Socket = SyncSocket;
|
|
197
|
+
//# sourceMappingURL=v1-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1-types.d.ts","sourceRoot":"","sources":["../../src/sync/v1-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7I,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,aAAa,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,kCAAkC,EAAE,MAAM,wBAAwB,CAAC;AA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E,MAAM,CAAC;IACrC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAC3C,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,aAAa,CAAC,EAAE,+BAA+B,GAAG,KAAK,CAAC;IACjE,QAAQ,CAAC,SAAS,CAAC,EAAE,uBAAuB,CAAC;IAC7C,QAAQ,CAAC,+BAA+B,CAAC,EAAE,MAAM,CAAC;CACnD,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TelemetryAttributes } from "./types";
|
|
2
|
+
export declare const TELEMETRY_BUILT_IN_ATTRIBUTE_KEYS: readonly ["journey_kind", "category", "code", "metric_value", "child_journey_id", "relationship", "method", "route", "duration_ms", "status_code", "direction", "frame_type", "connection_state", "ice_connection_state", "signaling_state", "bytes_received", "bytes_sent", "frames_dropped", "inbound_streams", "outbound_streams", "packets_lost", "packets_received", "packets_sent", "transport_entries", "jitter_ms", "round_trip_time_ms"];
|
|
3
|
+
export type TelemetryAttributeNormalizationOptions = {
|
|
4
|
+
readonly reservedKeys?: readonly string[];
|
|
5
|
+
};
|
|
6
|
+
export declare function normalizeTelemetryAttributes(attributes: TelemetryAttributes | undefined, options?: TelemetryAttributeNormalizationOptions): TelemetryAttributes | undefined;
|
|
7
|
+
//# sourceMappingURL=attributes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../src/telemetry/attributes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAA2B,MAAM,SAAS,CAAC;AAM5E,eAAO,MAAM,iCAAiC,YAC5C,cAAc,EACd,UAAU,EACV,MAAM,EACN,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,QAAQ,EACR,OAAO,EACP,aAAa,EACb,aAAa,EACb,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,WAAW,EACX,oBAAoB,CACZ,CAAC;AAgCX,MAAM,MAAM,sCAAsC,GAAG;IACnD,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3C,CAAC;AAEF,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,mBAAmB,GAAG,SAAS,EAAE,OAAO,GAAE,sCAA2C,GAAG,mBAAmB,GAAG,SAAS,CAW/K"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type TelemetryAttributeNormalizationOptions } from "./attributes";
|
|
2
|
+
import { type TelemetryExporterHealth, type TelemetryTimelineEntry } from "./delivery";
|
|
3
|
+
import { type TelemetryExporter, type TelemetryExportOptions } from "./exporter";
|
|
4
|
+
import { TelemetryJourney, type StartJourneyOptions } from "./journey";
|
|
5
|
+
import type { TelemetryStorage } from "./storage";
|
|
6
|
+
import { type JourneyTelemetryContext, type TelemetryEvent, type TelemetryEventDraft } from "./types";
|
|
7
|
+
export type { TelemetryExporterHealth, TelemetryTimelineEntry } from "./delivery";
|
|
8
|
+
export { createJourneyIntakeExporter, toJourneyIntakeEvent } from "./exporter";
|
|
9
|
+
export type { JourneyIntakeExporterOptions, TelemetryExporter, TelemetryExportOptions } from "./exporter";
|
|
10
|
+
export { TelemetryJourney } from "./journey";
|
|
11
|
+
export type { DiagnosticObservation, HttpRequestObservation, StartJourneyOptions, SyncFrameObservation } from "./journey";
|
|
12
|
+
export type TelemetryClientOptions = {
|
|
13
|
+
/** Telemetry remains inert until a first-party surface explicitly sets this to true. */
|
|
14
|
+
readonly enabled?: boolean;
|
|
15
|
+
readonly baseUrl?: string | URL;
|
|
16
|
+
readonly credentials?: RequestCredentials;
|
|
17
|
+
readonly exporter?: TelemetryExporter;
|
|
18
|
+
readonly exporterPath?: string;
|
|
19
|
+
readonly fetch?: typeof globalThis.fetch;
|
|
20
|
+
/** Caps each request at 100 events, the v1 journey intake limit. */
|
|
21
|
+
readonly maxBatchSize?: number;
|
|
22
|
+
readonly maxQueueSize?: number;
|
|
23
|
+
readonly maxTimelineEntries?: number;
|
|
24
|
+
readonly now?: () => Date;
|
|
25
|
+
readonly onDrop?: (droppedEvents: readonly TelemetryEvent[]) => void;
|
|
26
|
+
readonly retryDelayMs?: number;
|
|
27
|
+
readonly storage?: TelemetryStorage;
|
|
28
|
+
};
|
|
29
|
+
export declare class TelemetryClient {
|
|
30
|
+
#private;
|
|
31
|
+
readonly enabled: boolean;
|
|
32
|
+
constructor(options?: TelemetryClientOptions);
|
|
33
|
+
startJourney(options: StartJourneyOptions): TelemetryJourney;
|
|
34
|
+
getExporterHealth(): TelemetryExporterHealth;
|
|
35
|
+
getTimeline(): readonly TelemetryTimelineEntry[];
|
|
36
|
+
getPendingEvents(): readonly TelemetryEvent[];
|
|
37
|
+
subscribeExporterHealth(listener: (health: TelemetryExporterHealth) => void): () => void;
|
|
38
|
+
flush(options?: TelemetryExportOptions): Promise<void>;
|
|
39
|
+
dispose(): void;
|
|
40
|
+
/** Internal for TelemetryJourney. Event construction remains synchronous and never waits for storage or network I/O. */
|
|
41
|
+
emit(context: JourneyTelemetryContext, sequence: number, draft: TelemetryEventDraft, options?: TelemetryAttributeNormalizationOptions): TelemetryEvent;
|
|
42
|
+
}
|
|
43
|
+
export declare function createTelemetryClient(options?: TelemetryClientOptions): TelemetryClient;
|
|
44
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/telemetry/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAg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C/B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,aAAa,EAAE,SAAS,cAAc,EAAE,KAAK,IAAI,CAAC;IACrE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,OAAO,CAAC,EAAE,gBAAgB,CAAC;CACrC,CAAC;AAIF,qBAAa,eAAe;;IAC1B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAO1B,YAAY,OAAO,GAAE,sBAA2B,EAiB/C;IAED,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,gBAAgB,CAI3D;IAED,iBAAiB,IAAI,uBAAuB,CAE3C;IAED,WAAW,IAAI,SAAS,sBAAsB,EAAE,CAE/C;IAED,gBAAgB,IAAI,SAAS,cAAc,EAAE,CAE5C;IAED,uBAAuB,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,uBAAuB,KAAK,IAAI,GAAG,MAAM,IAAI,CAEvF;IAEK,KAAK,CAAC,OAAO,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAK3D;IAED,OAAO,IAAI,IAAI,CAId;IAED,wHAAwH;IACxH,IAAI,CAAC,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,sCAAsC,GAAG,cAAc,CAsBrJ;CACF;AAED,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,sBAA2B,GAAG,eAAe,CAE3F"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { Context, Effect, Layer, SubscriptionRef, type Scope } from "effect";
|
|
2
|
+
import { toJourneyIntakeEvent, type TelemetryExporter, type TelemetryExportOptions } from "./exporter";
|
|
3
|
+
import type { TelemetryStorage } from "./storage";
|
|
4
|
+
import type { JourneyPhase, JourneyState, TelemetryEvent } from "./types";
|
|
5
|
+
export type TelemetryExporterHealth = {
|
|
6
|
+
readonly droppedEvents: number;
|
|
7
|
+
readonly exportedEvents: number;
|
|
8
|
+
readonly failedBatches: number;
|
|
9
|
+
readonly lastError?: string;
|
|
10
|
+
readonly queueDepth: number;
|
|
11
|
+
readonly status: "degraded" | "idle" | "healthy";
|
|
12
|
+
};
|
|
13
|
+
export type TelemetryTimelineEntry = {
|
|
14
|
+
readonly eventId: string;
|
|
15
|
+
readonly name: TelemetryEvent["name"];
|
|
16
|
+
readonly occurredAt: string;
|
|
17
|
+
readonly phase: JourneyPhase;
|
|
18
|
+
readonly state: JourneyState;
|
|
19
|
+
};
|
|
20
|
+
export type TelemetryDeliveryOptions = {
|
|
21
|
+
readonly batchSize: number;
|
|
22
|
+
readonly enabled: boolean;
|
|
23
|
+
readonly exporter?: TelemetryExporter;
|
|
24
|
+
readonly maxQueueSize: number;
|
|
25
|
+
readonly maxTimelineEntries: number;
|
|
26
|
+
readonly onDrop?: (droppedEvents: readonly TelemetryEvent[]) => void;
|
|
27
|
+
readonly retryDelayMs: number;
|
|
28
|
+
readonly storage?: TelemetryStorage;
|
|
29
|
+
};
|
|
30
|
+
export declare const NORMAL_FLUSH_DELAY_MS = 50;
|
|
31
|
+
declare const TelemetryExportFailure_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
32
|
+
readonly _tag: "TelemetryExportFailure";
|
|
33
|
+
} & Readonly<A>;
|
|
34
|
+
export declare class TelemetryExportFailure extends TelemetryExportFailure_base<{
|
|
35
|
+
readonly cause: unknown;
|
|
36
|
+
readonly retriable: boolean;
|
|
37
|
+
}> {
|
|
38
|
+
}
|
|
39
|
+
declare const TelemetryStorageFailure_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
40
|
+
readonly _tag: "TelemetryStorageFailure";
|
|
41
|
+
} & Readonly<A>;
|
|
42
|
+
export declare class TelemetryStorageFailure extends TelemetryStorageFailure_base<{
|
|
43
|
+
readonly cause: unknown;
|
|
44
|
+
}> {
|
|
45
|
+
}
|
|
46
|
+
export type TelemetryExporterCapability = {
|
|
47
|
+
readonly configured: boolean;
|
|
48
|
+
readonly export: (events: readonly ReturnType<typeof toJourneyIntakeEvent>[], options?: TelemetryExportOptions) => Effect.Effect<void, TelemetryExportFailure>;
|
|
49
|
+
};
|
|
50
|
+
export type TelemetryStorageCapability = {
|
|
51
|
+
readonly configured: boolean;
|
|
52
|
+
readonly load: Effect.Effect<readonly TelemetryEvent[], TelemetryStorageFailure>;
|
|
53
|
+
readonly save: (events: readonly TelemetryEvent[]) => Effect.Effect<void, TelemetryStorageFailure>;
|
|
54
|
+
};
|
|
55
|
+
declare const TelemetryExporterService_base: Context.ServiceClass<TelemetryExporterService, "@chalk/telemetry/TelemetryExporter", TelemetryExporterCapability>;
|
|
56
|
+
/** Capability boundary for the existing Promise-based exporter. */
|
|
57
|
+
export declare class TelemetryExporterService extends TelemetryExporterService_base {
|
|
58
|
+
}
|
|
59
|
+
declare const TelemetryStorageService_base: Context.ServiceClass<TelemetryStorageService, "@chalk/telemetry/TelemetryStorage", TelemetryStorageCapability>;
|
|
60
|
+
/** Capability boundary for the existing Promise-based durable queue. */
|
|
61
|
+
export declare class TelemetryStorageService extends TelemetryStorageService_base {
|
|
62
|
+
}
|
|
63
|
+
export declare const makeTelemetryExporterLayer: (exporter?: TelemetryExporter) => Layer.Layer<TelemetryExporterService, never, never>;
|
|
64
|
+
export declare const makeFakeTelemetryExporterLayer: (exporter: TelemetryExporter) => Layer.Layer<TelemetryExporterService, never, never>;
|
|
65
|
+
export declare const makeTelemetryStorageLayer: (storage?: TelemetryStorage) => Layer.Layer<TelemetryStorageService, never, never>;
|
|
66
|
+
export declare const makeFakeTelemetryStorageLayer: (storage: TelemetryStorage) => Layer.Layer<TelemetryStorageService, never, never>;
|
|
67
|
+
export type TelemetryDeliveryEffectService = {
|
|
68
|
+
readonly healthRef: SubscriptionRef.SubscriptionRef<TelemetryExporterHealth>;
|
|
69
|
+
readonly pendingRef: SubscriptionRef.SubscriptionRef<readonly TelemetryEvent[]>;
|
|
70
|
+
readonly enqueue: (event: TelemetryEvent) => Effect.Effect<void>;
|
|
71
|
+
readonly enqueueUnsafe: (event: TelemetryEvent) => boolean;
|
|
72
|
+
readonly flush: (options?: TelemetryExportOptions) => Effect.Effect<void>;
|
|
73
|
+
readonly persist: () => Effect.Effect<void>;
|
|
74
|
+
readonly dispose: () => Effect.Effect<void>;
|
|
75
|
+
readonly awaitReady: () => Effect.Effect<void>;
|
|
76
|
+
readonly getHealthUnsafe: () => TelemetryExporterHealth;
|
|
77
|
+
readonly getPendingEventsUnsafe: () => readonly TelemetryEvent[];
|
|
78
|
+
readonly getTimelineUnsafe: () => readonly TelemetryTimelineEntry[];
|
|
79
|
+
readonly subscribe: (listener: (health: TelemetryExporterHealth) => void) => () => void;
|
|
80
|
+
};
|
|
81
|
+
declare const TelemetryDeliveryService_base: Context.ServiceClass<TelemetryDeliveryService, "@chalk/telemetry/TelemetryDelivery", TelemetryDeliveryEffectService>;
|
|
82
|
+
/** The scoped, Effect-native delivery capability. */
|
|
83
|
+
export declare class TelemetryDeliveryService extends TelemetryDeliveryService_base {
|
|
84
|
+
}
|
|
85
|
+
/** Builds a scoped delivery capability using production wrappers around the legacy interfaces. */
|
|
86
|
+
export declare const makeTelemetryDeliveryLayer: (options: TelemetryDeliveryOptions) => Layer.Layer<TelemetryDeliveryService, never, never>;
|
|
87
|
+
/** Builds a scoped delivery capability from exporter and storage services supplied by a test or application layer. */
|
|
88
|
+
export declare const makeTelemetryDeliveryLayerFromServices: (options: Omit<TelemetryDeliveryOptions, "exporter" | "storage">) => Layer.Layer<TelemetryDeliveryService, never, TelemetryExporterService | TelemetryStorageService>;
|
|
89
|
+
export declare function makeTelemetryDeliveryService(options: TelemetryDeliveryOptions, exporter?: TelemetryExporterCapability, storage?: TelemetryStorageCapability): Effect.Effect<TelemetryDeliveryEffectService, never, Scope.Scope>;
|
|
90
|
+
/**
|
|
91
|
+
* Compatibility facade for the synchronous client API. All durable work stays
|
|
92
|
+
* in the scoped Effect pipeline below; this class only bridges its public
|
|
93
|
+
* Promise methods and immediate snapshots.
|
|
94
|
+
*/
|
|
95
|
+
export declare class TelemetryDelivery {
|
|
96
|
+
#private;
|
|
97
|
+
constructor(options: TelemetryDeliveryOptions);
|
|
98
|
+
getHealth(): TelemetryExporterHealth;
|
|
99
|
+
getTimeline(): readonly TelemetryTimelineEntry[];
|
|
100
|
+
getPendingEvents(): readonly TelemetryEvent[];
|
|
101
|
+
subscribe(listener: (health: TelemetryExporterHealth) => void): () => void;
|
|
102
|
+
flush(options?: TelemetryExportOptions): Promise<void>;
|
|
103
|
+
dispose(): void;
|
|
104
|
+
enqueue(event: TelemetryEvent): void;
|
|
105
|
+
}
|
|
106
|
+
export {};
|
|
107
|
+
//# sourceMappingURL=delivery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delivery.d.ts","sourceRoot":"","sources":["../../src/telemetry/delivery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAkB,MAAM,EAAE,KAAK,EAAsD,eAAe,EAAE,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEjJ,OAAO,EAAqL,oBAAoB,EAAE,KAAK,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAC1R,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE1E,MAAM,MAAM,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AC,8BAA8B,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAUlQ;AAED;;;;GAIG;AACH,qBAAa,iBAAiB;;IAQ5B,YAAY,OAAO,EAAE,wBAAwB,EAS5C;IAED,SAAS,IAAI,uBAAuB,CAEnC;IAED,WAAW,IAAI,SAAS,sBAAsB,EAAE,CAE/C;IAED,gBAAgB,IAAI,SAAS,cAAc,EAAE,CAE5C;IAED,SAAS,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,uBAAuB,KAAK,IAAI,GAAG,MAAM,IAAI,CAEzE;IAEK,KAAK,CAAC,OAAO,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAG3D;IAED,OAAO,IAAI,IAAI,CAKd;IAED,OAAO,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAGnC;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { JourneyIntakeEvent, JourneyIntakeResponse, TelemetryEvent } from "./types";
|
|
2
|
+
export type JourneyIntakeExporterOptions = {
|
|
3
|
+
readonly baseUrl: string | URL;
|
|
4
|
+
readonly credentials?: RequestCredentials;
|
|
5
|
+
readonly fetch?: typeof globalThis.fetch;
|
|
6
|
+
readonly headers?: Readonly<Record<string, string>> | (() => Readonly<Record<string, string>> | Promise<Readonly<Record<string, string>>>);
|
|
7
|
+
readonly path?: string;
|
|
8
|
+
};
|
|
9
|
+
export type TelemetryExportOptions = {
|
|
10
|
+
/** Keeps a browser request eligible to complete while the page is unloading. */
|
|
11
|
+
readonly keepalive?: boolean;
|
|
12
|
+
};
|
|
13
|
+
/** Reserves headroom below the browser's 64 KiB aggregate quota for a concurrent terminal event. */
|
|
14
|
+
export declare const MAX_KEEPALIVE_BODY_BYTES: number;
|
|
15
|
+
/** Matches the v1 journey intake API's maximum events per request. */
|
|
16
|
+
export declare const MAX_JOURNEY_INTAKE_EVENTS_PER_BATCH = 100;
|
|
17
|
+
/** Matches the v1 journey intake API's 1 MiB request-body limit. */
|
|
18
|
+
export declare const MAX_JOURNEY_INTAKE_BODY_BYTES: number;
|
|
19
|
+
/** Reserves 64 KiB below the API request-body limit for request-processing headroom. */
|
|
20
|
+
export declare const MAX_JOURNEY_INTAKE_BATCH_BODY_BYTES: number;
|
|
21
|
+
export type TelemetryExporter = (events: readonly JourneyIntakeEvent[], options?: TelemetryExportOptions) => Promise<JourneyIntakeResponse | void>;
|
|
22
|
+
export declare class TelemetryExportError extends Error {
|
|
23
|
+
readonly retriable: boolean;
|
|
24
|
+
readonly status: number;
|
|
25
|
+
constructor(status: number);
|
|
26
|
+
}
|
|
27
|
+
export declare function isRetriableTelemetryExportError(error: unknown): boolean;
|
|
28
|
+
export declare function createJourneyIntakeExporter(options: JourneyIntakeExporterOptions): TelemetryExporter;
|
|
29
|
+
export declare class TelemetryPayloadTooLargeError extends Error {
|
|
30
|
+
readonly retriable = false;
|
|
31
|
+
constructor();
|
|
32
|
+
}
|
|
33
|
+
export declare function toJourneyIntakeEvent(event: TelemetryEvent): JourneyIntakeEvent;
|
|
34
|
+
export declare function journeyContextBatches<TEvent extends Pick<JourneyIntakeEvent, "journey_id" | "traceparent" | "tracestate">>(events: readonly TEvent[]): TEvent[][];
|
|
35
|
+
export declare function sharesJourneyContext(left: Pick<JourneyIntakeEvent, "journey_id" | "traceparent" | "tracestate">, right: Pick<JourneyIntakeEvent, "journey_id" | "traceparent" | "tracestate">): boolean;
|
|
36
|
+
export declare function journeyIntakeBody(events: readonly JourneyIntakeEvent[]): string;
|
|
37
|
+
export declare function encodedByteLength(value: string): number;
|
|
38
|
+
//# sourceMappingURL=exporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exporter.d.ts","sourceRoot":"","sources":["../../src/telemetry/exporter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzF,MAAM,MAAM,4BAA4B,GA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