@q9labsai/chalk-client 5.0.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/README.md +39 -0
- package/dist/access/base64-url.d.ts +0 -1
- package/dist/access/grant.d.ts +0 -1
- package/dist/access/manager.d.ts +0 -1
- package/dist/chat-files/http-transport.d.ts +0 -1
- package/dist/chat-files/index.d.ts +0 -1
- package/dist/chat-files/types.d.ts +0 -1
- package/dist/{chunk-2HJIJVE2.js → chunk-3ZN7IXOZ.js} +341 -3
- package/dist/{chunk-O2NOZKJP.js → chunk-DWKTGBHR.js} +20 -8
- package/dist/{chunk-AVXJ4HQU.js → chunk-K7PNW3KI.js} +156 -35
- package/dist/{chunk-CMVO7USN.js → chunk-KHHULLBZ.js} +1 -1
- package/dist/{chunk-IPAN4LUZ.js → chunk-RJRSLXVT.js} +863 -409
- package/dist/client.d.ts +76 -1
- package/dist/collaboration/index.d.ts +0 -1
- package/dist/collaboration/types.d.ts +0 -1
- package/dist/collaboration/wire.d.ts +0 -1
- package/dist/connection/dependencies.d.ts +5 -3
- package/dist/connection/diagnostics.d.ts +1 -2
- package/dist/connection/index.d.ts +1 -1
- package/dist/connection/lifecycle.d.ts +2 -3
- package/dist/connection/media-devices.d.ts +0 -1
- package/dist/connection/production.d.ts +0 -1
- package/dist/connection/types.d.ts +2 -2
- package/dist/effect.d.ts +0 -1
- package/dist/effect.js +88 -4
- package/dist/foreground-deadline.d.ts +0 -1
- package/dist/generated/http-api.d.ts +76 -1
- package/dist/generated/schemas.d.ts +366 -7
- package/dist/generated/sync.d.ts +0 -1
- package/dist/generated/whiteboard-v1.d.ts +50 -7
- package/dist/index.d.ts +0 -1
- package/dist/index.js +7 -5
- package/dist/media/camera-uplink.d.ts +0 -1
- package/dist/media/capture-error.d.ts +0 -1
- package/dist/media/client.d.ts +3 -2
- package/dist/media/cloudflare-sfu.d.ts +0 -1
- package/dist/media/index.d.ts +0 -1
- package/dist/media/index.js +1 -1
- package/dist/media/observers.d.ts +0 -1
- package/dist/media/plane.d.ts +0 -1
- package/dist/media/remote-track-response.d.ts +0 -1
- package/dist/media/target.d.ts +0 -1
- package/dist/media/tracks.d.ts +0 -1
- package/dist/media/transport.d.ts +0 -1
- package/dist/media/types.d.ts +0 -1
- package/dist/public-invites/client.d.ts +0 -1
- package/dist/public-invites/index.d.ts +0 -1
- package/dist/public-invites/index.js +2 -2
- package/dist/public-invites/types.d.ts +0 -1
- package/dist/server/access-refresh.d.ts +0 -1
- package/dist/server/{chunk-C4XITY5U.js → chunk-XQOQTCUL.js} +22 -0
- package/dist/server/client.d.ts +0 -1
- package/dist/server/errors.d.cts +8 -1
- package/dist/server/errors.d.ts +8 -2
- package/dist/server/index.cjs +31 -7
- package/dist/server/index.d.cts +1 -1
- package/dist/server/index.d.ts +1 -2
- package/dist/server/index.js +10 -7
- package/dist/server/server-only.d.ts +0 -1
- package/dist/server/server-only.js +1 -1
- package/dist/server/transport.d.ts +0 -1
- package/dist/server/types.d.ts +0 -1
- package/dist/space-client/chat-controller-helpers.d.ts +0 -1
- package/dist/space-client/chat-controller.d.ts +0 -1
- package/dist/space-client/controller-effects.d.ts +0 -1
- package/dist/space-client/core.d.ts +0 -1
- package/dist/space-client/effect.d.ts +0 -1
- package/dist/space-client/errors.d.ts +4 -2
- package/dist/space-client/index.d.ts +1 -2
- package/dist/space-client/media-controller.d.ts +3 -2
- package/dist/space-client/media-device-selection.d.ts +0 -1
- package/dist/space-client/offline-actions-storage.d.ts +0 -1
- package/dist/space-client/offline-actions.d.ts +0 -1
- package/dist/space-client/participants-controller.d.ts +0 -1
- package/dist/space-client/promise-facade.d.ts +0 -1
- package/dist/space-client/reactions-controller.d.ts +0 -1
- package/dist/space-client/recording-controller.d.ts +0 -1
- package/dist/space-client/reload-rejoin.d.ts +0 -1
- package/dist/space-client/space-client.d.ts +0 -1
- package/dist/space-client/store.d.ts +0 -1
- package/dist/space-client/types.d.ts +7 -2
- package/dist/space-client/whiteboard-controller.d.ts +0 -1
- package/dist/sync/browser.d.ts +0 -1
- package/dist/sync/canonical.d.ts +0 -1
- package/dist/sync/dial-deadline.d.ts +3 -0
- package/dist/sync/errors.d.ts +0 -1
- package/dist/sync/index.d.ts +0 -1
- package/dist/sync/index.js +1 -1
- package/dist/sync/react-native.d.ts +0 -1
- package/dist/sync/types.d.ts +0 -1
- package/dist/sync/v1-client.d.ts +2 -2
- package/dist/sync/v1-codec.d.ts +0 -1
- package/dist/sync/v1-collaboration-state.d.ts +1 -1
- package/dist/sync/v1-command-scheduler.d.ts +0 -1
- package/dist/sync/v1-create.d.ts +0 -1
- package/dist/sync/v1-deferred.d.ts +0 -1
- package/dist/sync/v1-error.d.ts +0 -1
- package/dist/sync/v1-frame-signature.d.ts +0 -1
- package/dist/sync/v1-health.d.ts +15 -0
- package/dist/sync/v1-live-target-coordinator.d.ts +0 -1
- package/dist/sync/v1-persistence.d.ts +0 -1
- package/dist/sync/v1-platform-persistence.d.ts +0 -1
- package/dist/sync/v1-reducer.d.ts +3 -1
- package/dist/sync/v1-types.d.ts +10 -1
- package/dist/webhooks/errors.d.ts +0 -1
- package/dist/webhooks/generated/event-v1.d.ts +0 -1
- package/dist/webhooks/generated/fixtures-v1.d.ts +0 -1
- package/dist/webhooks/index.d.ts +0 -1
- package/dist/webhooks/processor.d.ts +0 -1
- package/dist/webhooks/server-only.d.ts +0 -1
- package/dist/webhooks/test.d.ts +0 -1
- package/dist/webhooks/types.d.ts +0 -1
- package/dist/webhooks/validate.d.ts +0 -1
- package/dist/webhooks/verify.d.ts +0 -1
- package/dist/whiteboard/file-download-transport.d.ts +0 -1
- package/dist/whiteboard/index.d.ts +5 -1
- package/dist/whiteboard/types.d.ts +28 -2
- package/dist/whiteboard/v1-client.d.ts +3 -2
- package/dist/whiteboard/v1-codec.d.ts +0 -1
- package/dist/whiteboard/v1-create.d.ts +0 -1
- package/dist/whiteboard/v1-multipart.d.ts +0 -1
- package/dist/whiteboard/v1-persistence.d.ts +0 -1
- package/package.json +4 -2
- package/dist/access/base64-url.d.ts.map +0 -1
- package/dist/access/grant.d.ts.map +0 -1
- package/dist/access/grant.test.helpers.d.ts +0 -10
- package/dist/access/grant.test.helpers.d.ts.map +0 -1
- package/dist/access/manager.d.ts.map +0 -1
- package/dist/chat-files/http-transport.d.ts.map +0 -1
- package/dist/chat-files/index.d.ts.map +0 -1
- package/dist/chat-files/types.d.ts.map +0 -1
- package/dist/client.d.ts.map +0 -1
- package/dist/collaboration/index.d.ts.map +0 -1
- package/dist/collaboration/types.d.ts.map +0 -1
- package/dist/collaboration/wire.d.ts.map +0 -1
- package/dist/connection/dependencies.d.ts.map +0 -1
- package/dist/connection/diagnostics.d.ts.map +0 -1
- package/dist/connection/index.d.ts.map +0 -1
- package/dist/connection/lifecycle.d.ts.map +0 -1
- package/dist/connection/media-devices.d.ts.map +0 -1
- package/dist/connection/production.d.ts.map +0 -1
- package/dist/connection/types.d.ts.map +0 -1
- package/dist/effect.d.ts.map +0 -1
- package/dist/foreground-deadline.d.ts.map +0 -1
- package/dist/generated/http-api.d.ts.map +0 -1
- package/dist/generated/schemas.d.ts.map +0 -1
- package/dist/generated/sync.d.ts.map +0 -1
- package/dist/generated/whiteboard-v1.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/media/camera-uplink.d.ts.map +0 -1
- package/dist/media/capture-error.d.ts.map +0 -1
- package/dist/media/client.d.ts.map +0 -1
- package/dist/media/cloudflare-sfu.d.ts.map +0 -1
- package/dist/media/index.d.ts.map +0 -1
- package/dist/media/observers.d.ts.map +0 -1
- package/dist/media/plane.d.ts.map +0 -1
- package/dist/media/remote-track-response.d.ts.map +0 -1
- package/dist/media/target.d.ts.map +0 -1
- package/dist/media/tracks.d.ts.map +0 -1
- package/dist/media/transport.d.ts.map +0 -1
- package/dist/media/types.d.ts.map +0 -1
- package/dist/public-invites/client.d.ts.map +0 -1
- package/dist/public-invites/index.d.ts.map +0 -1
- package/dist/public-invites/types.d.ts.map +0 -1
- package/dist/server/access-refresh.d.ts.map +0 -1
- package/dist/server/client.d.ts.map +0 -1
- package/dist/server/errors.d.ts.map +0 -1
- package/dist/server/index.d.ts.map +0 -1
- package/dist/server/server-only.d.ts.map +0 -1
- package/dist/server/transport.d.ts.map +0 -1
- package/dist/server/types.d.ts.map +0 -1
- package/dist/space-client/chat-controller-helpers.d.ts.map +0 -1
- package/dist/space-client/chat-controller.d.ts.map +0 -1
- package/dist/space-client/controller-effects.d.ts.map +0 -1
- package/dist/space-client/core.d.ts.map +0 -1
- package/dist/space-client/core.test.helpers.d.ts +0 -15
- package/dist/space-client/core.test.helpers.d.ts.map +0 -1
- package/dist/space-client/effect.d.ts.map +0 -1
- package/dist/space-client/errors.d.ts.map +0 -1
- package/dist/space-client/index.d.ts.map +0 -1
- package/dist/space-client/media-controller.d.ts.map +0 -1
- package/dist/space-client/media-device-selection.d.ts.map +0 -1
- package/dist/space-client/offline-actions-storage.d.ts.map +0 -1
- package/dist/space-client/offline-actions.d.ts.map +0 -1
- package/dist/space-client/participants-controller.d.ts.map +0 -1
- package/dist/space-client/promise-facade.d.ts.map +0 -1
- package/dist/space-client/reactions-controller.d.ts.map +0 -1
- package/dist/space-client/recording-controller.d.ts.map +0 -1
- package/dist/space-client/reload-rejoin.d.ts.map +0 -1
- package/dist/space-client/space-client.d.ts.map +0 -1
- package/dist/space-client/store.d.ts.map +0 -1
- package/dist/space-client/terminal.test.helpers.d.ts +0 -136
- package/dist/space-client/terminal.test.helpers.d.ts.map +0 -1
- package/dist/space-client/types.d.ts.map +0 -1
- package/dist/space-client/whiteboard-controller.d.ts.map +0 -1
- package/dist/sync/browser.d.ts.map +0 -1
- package/dist/sync/canonical.d.ts.map +0 -1
- package/dist/sync/errors.d.ts.map +0 -1
- package/dist/sync/index.d.ts.map +0 -1
- package/dist/sync/react-native.d.ts.map +0 -1
- package/dist/sync/types.d.ts.map +0 -1
- package/dist/sync/v1-client.d.ts.map +0 -1
- package/dist/sync/v1-codec.d.ts.map +0 -1
- package/dist/sync/v1-collaboration-state.d.ts.map +0 -1
- package/dist/sync/v1-command-scheduler.d.ts.map +0 -1
- package/dist/sync/v1-create.d.ts.map +0 -1
- package/dist/sync/v1-deferred.d.ts.map +0 -1
- package/dist/sync/v1-error.d.ts.map +0 -1
- package/dist/sync/v1-frame-signature.d.ts.map +0 -1
- package/dist/sync/v1-live-target-coordinator.d.ts.map +0 -1
- package/dist/sync/v1-persistence.d.ts.map +0 -1
- package/dist/sync/v1-platform-persistence.d.ts.map +0 -1
- package/dist/sync/v1-reducer.d.ts.map +0 -1
- package/dist/sync/v1-types.d.ts.map +0 -1
- package/dist/webhooks/errors.d.ts.map +0 -1
- package/dist/webhooks/generated/event-v1.d.ts.map +0 -1
- package/dist/webhooks/generated/fixtures-v1.d.ts.map +0 -1
- package/dist/webhooks/index.d.ts.map +0 -1
- package/dist/webhooks/processor.d.ts.map +0 -1
- package/dist/webhooks/server-only.d.ts.map +0 -1
- package/dist/webhooks/test.d.ts.map +0 -1
- package/dist/webhooks/types.d.ts.map +0 -1
- package/dist/webhooks/validate.d.ts.map +0 -1
- package/dist/webhooks/verify.d.ts.map +0 -1
- package/dist/whiteboard/file-download-transport.d.ts.map +0 -1
- package/dist/whiteboard/index.d.ts.map +0 -1
- package/dist/whiteboard/types.d.ts.map +0 -1
- package/dist/whiteboard/v1-client.d.ts.map +0 -1
- package/dist/whiteboard/v1-codec.d.ts.map +0 -1
- package/dist/whiteboard/v1-create.d.ts.map +0 -1
- package/dist/whiteboard/v1-multipart.d.ts.map +0 -1
- package/dist/whiteboard/v1-persistence.d.ts.map +0 -1
package/dist/media/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export * from "./cloudflare-sfu";
|
|
2
2
|
export type { ClientMediaPlane, ConnectionMediaLocalTrack, ConnectionMediaPhase, ConnectionMediaRemoteTrack, ConnectionMediaSnapshot, MediaPlaneOutcome, MediaPlaneResult, MediaPlaneTarget, MediaPublication, MediaPublicationSource, MediaSource } from "./plane";
|
|
3
3
|
export { describeMediaCaptureError } from "./capture-error";
|
|
4
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/media/index.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
export declare function subscribeSnapshot(listeners: Set<() => void>, listener: () => void): () => void;
|
|
2
2
|
export declare function observePublications<T>(listeners: Set<() => void>, listener: (value: T) => void, project: () => T): () => void;
|
|
3
|
-
//# sourceMappingURL=observers.d.ts.map
|
package/dist/media/plane.d.ts
CHANGED
package/dist/media/target.d.ts
CHANGED
|
@@ -9,4 +9,3 @@ export type MediaTargetResolution<T> = {
|
|
|
9
9
|
export declare function resolveMediaTarget<T>(participantId: string, stopped: boolean, tracks: ReadonlyMap<MediaPublicationSource, T>, target: Omit<MediaPlaneTarget, "source"> & {
|
|
10
10
|
readonly source: MediaPublicationSource;
|
|
11
11
|
}): MediaTargetResolution<T>;
|
|
12
|
-
//# sourceMappingURL=target.d.ts.map
|
package/dist/media/tracks.d.ts
CHANGED
|
@@ -18,4 +18,3 @@ export declare function publicationKey(publication: {
|
|
|
18
18
|
readonly source: MediaPublicationSource;
|
|
19
19
|
}): string;
|
|
20
20
|
export declare function waitFor(predicate: () => boolean, timeoutMs: number, timeoutMessage?: string): Promise<void>;
|
|
21
|
-
//# sourceMappingURL=tracks.d.ts.map
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import type { CloudflareSFUHTTPTransportOptions, CloudflareSFUSignalingTransport } from "./types";
|
|
2
2
|
export declare function createCloudflareSFUHTTPTransport(options: CloudflareSFUHTTPTransportOptions): CloudflareSFUSignalingTransport;
|
|
3
|
-
//# sourceMappingURL=transport.d.ts.map
|
package/dist/media/types.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { ChalkPublicClient, ChalkPublicClientOptions } from "./types.js";
|
|
2
2
|
export declare function createChalkPublicClient(options: ChalkPublicClientOptions): ChalkPublicClient;
|
|
3
3
|
export declare const createChalkPublicInviteClient: typeof createChalkPublicClient;
|
|
4
|
-
//# sourceMappingURL=client.d.ts.map
|
|
@@ -2,4 +2,3 @@ export { createChalkPublicClient, createChalkPublicInviteClient } from "./client
|
|
|
2
2
|
export type { ArriveBySpacePublicInviteInput, ChalkPublicClient, ChalkPublicClientOptions, ChalkPublicClientRuntime, ChalkPublicIdempotencyOptions, ChalkPublicInviteError, CreatePublicSpace, CreatePublicSpaceInput, ArriveBySpacePublicInvite, GetSpacePublicInviteArrival, LeaveSpacePublicInviteArrival, PublicArrivalOptions, PublicArrivalReference, PublicRefreshAccessInput, PublicLeaveOptions, PublicSpaceArrival, PublicSpaceArrivalAccess, PublicSpaceCreated, RefreshSpacePublicInviteAccess, } from "./types.js";
|
|
3
3
|
export { ArrivalInvalidHandleError, ArrivalUnavailableError, SpacePublicInviteUnavailableError } from "../generated/schemas.js";
|
|
4
4
|
export type { ApproveSpacePublicAdmissionRequestError, ArriveBySpacePublicInviteError, CreatePublicSpaceError, DenySpacePublicAdmissionRequestError, GetSpacePublicInviteArrivalError, LeaveSpacePublicInviteArrivalError, RefreshSpacePublicInviteAccessError } from "../generated/schemas.js";
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createChalkPublicClient,
|
|
3
3
|
createChalkPublicInviteClient
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-KHHULLBZ.js";
|
|
5
5
|
import {
|
|
6
6
|
ArrivalInvalidHandleError,
|
|
7
7
|
ArrivalUnavailableError,
|
|
8
8
|
SpacePublicInviteUnavailableError
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-3ZN7IXOZ.js";
|
|
10
10
|
export {
|
|
11
11
|
ArrivalInvalidHandleError,
|
|
12
12
|
ArrivalUnavailableError,
|
|
@@ -63,4 +63,3 @@ export type ChalkPublicClient = {
|
|
|
63
63
|
};
|
|
64
64
|
export type ChalkPublicInviteError = PreparePublicSpaceEntranceError | ApproveSpacePublicAdmissionRequestError | ArriveBySpacePublicInviteError | DenySpacePublicAdmissionRequestError | CreatePublicSpaceError | GetSpacePublicInviteArrivalError | LeaveSpacePublicInviteArrivalError | RefreshSpacePublicInviteAccessError | ArrivalInvalidHandleError | ArrivalUnavailableError | SpacePublicInviteUnavailableError;
|
|
65
65
|
export type PublicSpaceArrivalAccess = PublicSpaceArrival["access"];
|
|
66
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -11,4 +11,3 @@ export type AccessRefreshState = {
|
|
|
11
11
|
/** Retain after admission and every issueAccess response; pass directly to participants.issueAccess for refresh. */
|
|
12
12
|
export declare function getAccessRefreshState(access: AccessGrant): AccessRefreshState;
|
|
13
13
|
export declare function accessRefreshInput(state: IssueAccessGrantInput, request?: AccessRefreshRequest): IssueAccessGrantInput;
|
|
14
|
-
//# sourceMappingURL=access-refresh.d.ts.map
|
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
// src/server/errors.ts
|
|
2
|
+
var accessGrantErrorCodes = [
|
|
3
|
+
"media_token.required",
|
|
4
|
+
"media_token.malformed",
|
|
5
|
+
"media_token.invalid_header",
|
|
6
|
+
"media_token.unknown_key",
|
|
7
|
+
"media_token.invalid_signature",
|
|
8
|
+
"media_token.invalid_issuer",
|
|
9
|
+
"media_token.invalid_audience",
|
|
10
|
+
"media_token.invalid_time_claims",
|
|
11
|
+
"media_token.not_yet_valid",
|
|
12
|
+
"media_token.expired",
|
|
13
|
+
"media_token.lifetime_exceeded",
|
|
14
|
+
"media_token.invalid_subject",
|
|
15
|
+
"media_token.subject_mismatch",
|
|
16
|
+
"participant.generation_mismatch",
|
|
17
|
+
"participant.connection_superseded",
|
|
18
|
+
"access.forbidden"
|
|
19
|
+
];
|
|
2
20
|
var safeCodePattern = /^[a-z][a-z0-9_.-]{0,63}$/u;
|
|
3
21
|
var safeRequestIdPattern = /^[A-Za-z0-9._:-]{1,128}$/u;
|
|
4
22
|
var ChalkAPIError = class extends Error {
|
|
@@ -15,6 +33,9 @@ var ChalkAPIError = class extends Error {
|
|
|
15
33
|
this.requestId = input.requestId;
|
|
16
34
|
}
|
|
17
35
|
};
|
|
36
|
+
function isChalkAccessGrantError(error) {
|
|
37
|
+
return error instanceof ChalkAPIError && accessGrantErrorCodes.some((code) => code === error.code);
|
|
38
|
+
}
|
|
18
39
|
var ChalkServerOnlyError = class extends Error {
|
|
19
40
|
constructor() {
|
|
20
41
|
super("The Chalk server client is available only in Node.js runtimes.");
|
|
@@ -55,6 +76,7 @@ function isRecord(value) {
|
|
|
55
76
|
|
|
56
77
|
export {
|
|
57
78
|
ChalkAPIError,
|
|
79
|
+
isChalkAccessGrantError,
|
|
58
80
|
ChalkServerOnlyError,
|
|
59
81
|
errorCode,
|
|
60
82
|
requestId
|
package/dist/server/client.d.ts
CHANGED
package/dist/server/errors.d.cts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
declare const accessGrantErrorCodes: readonly ["media_token.required", "media_token.malformed", "media_token.invalid_header", "media_token.unknown_key", "media_token.invalid_signature", "media_token.invalid_issuer", "media_token.invalid_audience", "media_token.invalid_time_claims", "media_token.not_yet_valid", "media_token.expired", "media_token.lifetime_exceeded", "media_token.invalid_subject", "media_token.subject_mismatch", "participant.generation_mismatch", "participant.connection_superseded", "access.forbidden"];
|
|
2
|
+
export type ChalkAccessGrantErrorCode = (typeof accessGrantErrorCodes)[number];
|
|
3
|
+
export type ChalkAPIErrorCode = ChalkAccessGrantErrorCode | "network_error" | "invalid_response" | "request_failed" | (string & {});
|
|
2
4
|
export declare class ChalkAPIError extends Error {
|
|
3
5
|
readonly code: ChalkAPIErrorCode;
|
|
4
6
|
readonly requestId: string | undefined;
|
|
@@ -11,8 +13,13 @@ export declare class ChalkAPIError extends Error {
|
|
|
11
13
|
status: number;
|
|
12
14
|
});
|
|
13
15
|
}
|
|
16
|
+
/** Narrows known access-grant failures while preserving their status and request ID. */
|
|
17
|
+
export declare function isChalkAccessGrantError(error: unknown): error is ChalkAPIError & {
|
|
18
|
+
readonly code: ChalkAccessGrantErrorCode;
|
|
19
|
+
};
|
|
14
20
|
export declare class ChalkServerOnlyError extends Error {
|
|
15
21
|
constructor();
|
|
16
22
|
}
|
|
17
23
|
export declare function errorCode(value: unknown): ChalkAPIErrorCode;
|
|
18
24
|
export declare function requestId(headers: Headers): string | undefined;
|
|
25
|
+
export {};
|
package/dist/server/errors.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
declare const accessGrantErrorCodes: readonly ["media_token.required", "media_token.malformed", "media_token.invalid_header", "media_token.unknown_key", "media_token.invalid_signature", "media_token.invalid_issuer", "media_token.invalid_audience", "media_token.invalid_time_claims", "media_token.not_yet_valid", "media_token.expired", "media_token.lifetime_exceeded", "media_token.invalid_subject", "media_token.subject_mismatch", "participant.generation_mismatch", "participant.connection_superseded", "access.forbidden"];
|
|
2
|
+
export type ChalkAccessGrantErrorCode = (typeof accessGrantErrorCodes)[number];
|
|
3
|
+
export type ChalkAPIErrorCode = ChalkAccessGrantErrorCode | "network_error" | "invalid_response" | "request_failed" | (string & {});
|
|
2
4
|
export declare class ChalkAPIError extends Error {
|
|
3
5
|
readonly code: ChalkAPIErrorCode;
|
|
4
6
|
readonly requestId: string | undefined;
|
|
@@ -11,9 +13,13 @@ export declare class ChalkAPIError extends Error {
|
|
|
11
13
|
status: number;
|
|
12
14
|
});
|
|
13
15
|
}
|
|
16
|
+
/** Narrows known access-grant failures while preserving their status and request ID. */
|
|
17
|
+
export declare function isChalkAccessGrantError(error: unknown): error is ChalkAPIError & {
|
|
18
|
+
readonly code: ChalkAccessGrantErrorCode;
|
|
19
|
+
};
|
|
14
20
|
export declare class ChalkServerOnlyError extends Error {
|
|
15
21
|
constructor();
|
|
16
22
|
}
|
|
17
23
|
export declare function errorCode(value: unknown): ChalkAPIErrorCode;
|
|
18
24
|
export declare function requestId(headers: Headers): string | undefined;
|
|
19
|
-
|
|
25
|
+
export {};
|
package/dist/server/index.cjs
CHANGED
|
@@ -23,7 +23,8 @@ __export(index_exports, {
|
|
|
23
23
|
ChalkAPIError: () => ChalkAPIError,
|
|
24
24
|
ChalkServerOnlyError: () => ChalkServerOnlyError,
|
|
25
25
|
createChalkServerClient: () => createChalkServerClient,
|
|
26
|
-
getAccessRefreshState: () => getAccessRefreshState
|
|
26
|
+
getAccessRefreshState: () => getAccessRefreshState,
|
|
27
|
+
isChalkAccessGrantError: () => isChalkAccessGrantError
|
|
27
28
|
});
|
|
28
29
|
module.exports = __toCommonJS(index_exports);
|
|
29
30
|
|
|
@@ -169,6 +170,24 @@ function accessRefreshInput(state, request) {
|
|
|
169
170
|
}
|
|
170
171
|
|
|
171
172
|
// src/server/errors.ts
|
|
173
|
+
var accessGrantErrorCodes = [
|
|
174
|
+
"media_token.required",
|
|
175
|
+
"media_token.malformed",
|
|
176
|
+
"media_token.invalid_header",
|
|
177
|
+
"media_token.unknown_key",
|
|
178
|
+
"media_token.invalid_signature",
|
|
179
|
+
"media_token.invalid_issuer",
|
|
180
|
+
"media_token.invalid_audience",
|
|
181
|
+
"media_token.invalid_time_claims",
|
|
182
|
+
"media_token.not_yet_valid",
|
|
183
|
+
"media_token.expired",
|
|
184
|
+
"media_token.lifetime_exceeded",
|
|
185
|
+
"media_token.invalid_subject",
|
|
186
|
+
"media_token.subject_mismatch",
|
|
187
|
+
"participant.generation_mismatch",
|
|
188
|
+
"participant.connection_superseded",
|
|
189
|
+
"access.forbidden"
|
|
190
|
+
];
|
|
172
191
|
var safeCodePattern = /^[a-z][a-z0-9_.-]{0,63}$/u;
|
|
173
192
|
var safeRequestIdPattern = /^[A-Za-z0-9._:-]{1,128}$/u;
|
|
174
193
|
var ChalkAPIError = class extends Error {
|
|
@@ -185,6 +204,9 @@ var ChalkAPIError = class extends Error {
|
|
|
185
204
|
this.requestId = input.requestId;
|
|
186
205
|
}
|
|
187
206
|
};
|
|
207
|
+
function isChalkAccessGrantError(error) {
|
|
208
|
+
return error instanceof ChalkAPIError && accessGrantErrorCodes.some((code) => code === error.code);
|
|
209
|
+
}
|
|
188
210
|
var ChalkServerOnlyError = class extends Error {
|
|
189
211
|
constructor() {
|
|
190
212
|
super("The Chalk server client is available only in Node.js runtimes.");
|
|
@@ -245,7 +267,7 @@ async function performAttempt(attempt, index) {
|
|
|
245
267
|
const response = await fetchAttempt(attempt, index);
|
|
246
268
|
if (response.status === attempt.input.expectedStatus) return decodeSuccess(response);
|
|
247
269
|
if (canRetryResponse(response, attempt.retries, index)) return retryResponse(response, attempt, index);
|
|
248
|
-
throw await responseError(response);
|
|
270
|
+
throw await responseError(response, attempt.input.retry !== "never");
|
|
249
271
|
}
|
|
250
272
|
async function fetchAttempt(attempt, index) {
|
|
251
273
|
try {
|
|
@@ -255,7 +277,7 @@ async function fetchAttempt(attempt, index) {
|
|
|
255
277
|
}
|
|
256
278
|
}
|
|
257
279
|
async function retryTransport(attempt, index) {
|
|
258
|
-
if (index >= attempt.retries) throw new ChalkAPIError({ code: "network_error", retryable:
|
|
280
|
+
if (index >= attempt.retries) throw new ChalkAPIError({ code: "network_error", retryable: attempt.input.retry !== "never", status: 0 });
|
|
259
281
|
await retryDelay(index);
|
|
260
282
|
return fetchAttempt(attempt, index + 1);
|
|
261
283
|
}
|
|
@@ -303,8 +325,8 @@ function setContentType(headers, hasBody) {
|
|
|
303
325
|
function setOptionalHeader(headers, name, value) {
|
|
304
326
|
if (value !== void 0) headers.set(name, value);
|
|
305
327
|
}
|
|
306
|
-
async function responseError(response) {
|
|
307
|
-
return new ChalkAPIError({ code: errorCode(await errorBody(response)), requestId: requestId(response.headers), retryable: retryableStatuses.has(response.status), status: response.status });
|
|
328
|
+
async function responseError(response, retryable) {
|
|
329
|
+
return new ChalkAPIError({ code: errorCode(await errorBody(response)), requestId: requestId(response.headers), retryable: retryable && retryableStatuses.has(response.status), status: response.status });
|
|
308
330
|
}
|
|
309
331
|
async function errorBody(response) {
|
|
310
332
|
try {
|
|
@@ -420,7 +442,8 @@ function createChalkServerClient(options) {
|
|
|
420
442
|
path: `${tenantPath}/spaces/${segment(spaceId)}/episodes/${segment(episodeId)}/participants/${segment(participantId)}/access-grant`,
|
|
421
443
|
body: accessGrantRequest(resolvedInput),
|
|
422
444
|
expectedStatus: 201,
|
|
423
|
-
|
|
445
|
+
// An expired token can cause replacement even without the explicit flag.
|
|
446
|
+
retry: "never"
|
|
424
447
|
});
|
|
425
448
|
return accessGrant(access);
|
|
426
449
|
},
|
|
@@ -686,5 +709,6 @@ function invalidResponse(status) {
|
|
|
686
709
|
ChalkAPIError,
|
|
687
710
|
ChalkServerOnlyError,
|
|
688
711
|
createChalkServerClient,
|
|
689
|
-
getAccessRefreshState
|
|
712
|
+
getAccessRefreshState,
|
|
713
|
+
isChalkAccessGrantError
|
|
690
714
|
});
|
package/dist/server/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { getAccessRefreshState, type AccessRefreshRequest, type AccessRefreshState } from "./access-refresh.cjs";
|
|
2
2
|
export { createChalkServerClient } from "./client.cjs";
|
|
3
|
-
export { ChalkAPIError, ChalkServerOnlyError } from "./errors.cjs";
|
|
3
|
+
export { ChalkAPIError, ChalkServerOnlyError, isChalkAccessGrantError, type ChalkAccessGrantErrorCode } from "./errors.cjs";
|
|
4
4
|
export type { APIKey, APIKeyList, APIKeyWithSecret, AdmitParticipantInput, ChalkIdempotencyOptions, ChalkServerClient, ChalkServerClientOptions, ChalkServerHeaders, CreateAPIKeyInput, CreateEpisodeInput, CreateRecordingDownloadURLInput, CreateSpaceInput, Episode, EpisodeEnd, IssueAccessGrantInput, ListPublicAdmissionRequestsInput, ListRecordingsInput, ListAPIKeysInput, ListSpacesInput, AccessGrant, ParticipantLifecycle, ParticipantRemoval, PublicAdmissionRequest, PublicAdmissionRequestPage, Recording, RecordingDownloadURL, RecordingExport, RecordingExportRequestAcceptedResponse, RecordingExportStatus, RecordingList, RecordingSource, RecordingSourceStatus, RecordingPolicy, RemoveParticipantInput, RotateAPIKeyInput, Space, SpacePublicInvite, SpaceList, TranscriptionPolicy, UpdateSpaceInput, UpdateSpacePublicInviteInput, } from "./types.cjs";
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { getAccessRefreshState, type AccessRefreshRequest, type AccessRefreshState } from "./access-refresh.js";
|
|
2
2
|
export { createChalkServerClient } from "./client.js";
|
|
3
|
-
export { ChalkAPIError, ChalkServerOnlyError } from "./errors.js";
|
|
3
|
+
export { ChalkAPIError, ChalkServerOnlyError, isChalkAccessGrantError, type ChalkAccessGrantErrorCode } from "./errors.js";
|
|
4
4
|
export type { APIKey, APIKeyList, APIKeyWithSecret, AdmitParticipantInput, ChalkIdempotencyOptions, ChalkServerClient, ChalkServerClientOptions, ChalkServerHeaders, CreateAPIKeyInput, CreateEpisodeInput, CreateRecordingDownloadURLInput, CreateSpaceInput, Episode, EpisodeEnd, IssueAccessGrantInput, ListPublicAdmissionRequestsInput, ListRecordingsInput, ListAPIKeysInput, ListSpacesInput, AccessGrant, ParticipantLifecycle, ParticipantRemoval, PublicAdmissionRequest, PublicAdmissionRequestPage, Recording, RecordingDownloadURL, RecordingExport, RecordingExportRequestAcceptedResponse, RecordingExportStatus, RecordingList, RecordingSource, RecordingSourceStatus, RecordingPolicy, RemoveParticipantInput, RotateAPIKeyInput, Space, SpacePublicInvite, SpaceList, TranscriptionPolicy, UpdateSpaceInput, UpdateSpacePublicInviteInput, } from "./types.js";
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/server/index.js
CHANGED
|
@@ -2,8 +2,9 @@ import {
|
|
|
2
2
|
ChalkAPIError,
|
|
3
3
|
ChalkServerOnlyError,
|
|
4
4
|
errorCode,
|
|
5
|
+
isChalkAccessGrantError,
|
|
5
6
|
requestId
|
|
6
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XQOQTCUL.js";
|
|
7
8
|
|
|
8
9
|
// src/access/base64-url.ts
|
|
9
10
|
function decodeBase64Url(value) {
|
|
@@ -168,7 +169,7 @@ async function performAttempt(attempt, index) {
|
|
|
168
169
|
const response = await fetchAttempt(attempt, index);
|
|
169
170
|
if (response.status === attempt.input.expectedStatus) return decodeSuccess(response);
|
|
170
171
|
if (canRetryResponse(response, attempt.retries, index)) return retryResponse(response, attempt, index);
|
|
171
|
-
throw await responseError(response);
|
|
172
|
+
throw await responseError(response, attempt.input.retry !== "never");
|
|
172
173
|
}
|
|
173
174
|
async function fetchAttempt(attempt, index) {
|
|
174
175
|
try {
|
|
@@ -178,7 +179,7 @@ async function fetchAttempt(attempt, index) {
|
|
|
178
179
|
}
|
|
179
180
|
}
|
|
180
181
|
async function retryTransport(attempt, index) {
|
|
181
|
-
if (index >= attempt.retries) throw new ChalkAPIError({ code: "network_error", retryable:
|
|
182
|
+
if (index >= attempt.retries) throw new ChalkAPIError({ code: "network_error", retryable: attempt.input.retry !== "never", status: 0 });
|
|
182
183
|
await retryDelay(index);
|
|
183
184
|
return fetchAttempt(attempt, index + 1);
|
|
184
185
|
}
|
|
@@ -226,8 +227,8 @@ function setContentType(headers, hasBody) {
|
|
|
226
227
|
function setOptionalHeader(headers, name, value) {
|
|
227
228
|
if (value !== void 0) headers.set(name, value);
|
|
228
229
|
}
|
|
229
|
-
async function responseError(response) {
|
|
230
|
-
return new ChalkAPIError({ code: errorCode(await errorBody(response)), requestId: requestId(response.headers), retryable: retryableStatuses.has(response.status), status: response.status });
|
|
230
|
+
async function responseError(response, retryable) {
|
|
231
|
+
return new ChalkAPIError({ code: errorCode(await errorBody(response)), requestId: requestId(response.headers), retryable: retryable && retryableStatuses.has(response.status), status: response.status });
|
|
231
232
|
}
|
|
232
233
|
async function errorBody(response) {
|
|
233
234
|
try {
|
|
@@ -343,7 +344,8 @@ function createChalkServerClient(options) {
|
|
|
343
344
|
path: `${tenantPath}/spaces/${segment(spaceId)}/episodes/${segment(episodeId)}/participants/${segment(participantId)}/access-grant`,
|
|
344
345
|
body: accessGrantRequest(resolvedInput),
|
|
345
346
|
expectedStatus: 201,
|
|
346
|
-
|
|
347
|
+
// An expired token can cause replacement even without the explicit flag.
|
|
348
|
+
retry: "never"
|
|
347
349
|
});
|
|
348
350
|
return accessGrant(access);
|
|
349
351
|
},
|
|
@@ -608,5 +610,6 @@ export {
|
|
|
608
610
|
ChalkAPIError,
|
|
609
611
|
ChalkServerOnlyError,
|
|
610
612
|
createChalkServerClient,
|
|
611
|
-
getAccessRefreshState
|
|
613
|
+
getAccessRefreshState,
|
|
614
|
+
isChalkAccessGrantError
|
|
612
615
|
};
|
|
@@ -10,4 +10,3 @@ export type ServerRequest = {
|
|
|
10
10
|
};
|
|
11
11
|
export declare function createServerRequester(options: ChalkServerClientOptions, apiKey: string, apiBaseURL: string, fetchImplementation: typeof globalThis.fetch): <T>(input: ServerRequest) => Promise<T>;
|
|
12
12
|
export {};
|
|
13
|
-
//# sourceMappingURL=transport.d.ts.map
|
package/dist/server/types.d.ts
CHANGED
|
@@ -12,4 +12,3 @@ export declare function chatMessageFor(message: ChalkChatMessage): ChatMessage;
|
|
|
12
12
|
export declare function chatReceiptFor(receipt: ChalkChatReadReceipt): ChatReadReceipt;
|
|
13
13
|
export declare function mergeChatMessage(messages: readonly ChatMessage[], existing: ChatMessage, incoming: ChatMessage): readonly ChatMessage[];
|
|
14
14
|
export declare function compareChatSequence(left: string, right: string): number;
|
|
15
|
-
//# sourceMappingURL=chat-controller-helpers.d.ts.map
|
|
@@ -33,4 +33,3 @@ export declare const makeChatController: (input: {
|
|
|
33
33
|
}) => Effect.Effect<ChatControllerEffects, never, Scope.Scope>;
|
|
34
34
|
export declare const makeChatControllerLayer: (input: Parameters<typeof makeChatController>[0]) => Layer.Layer<ChatControllerService, never, never>;
|
|
35
35
|
export {};
|
|
36
|
-
//# sourceMappingURL=chat-controller.d.ts.map
|
|
@@ -45,4 +45,3 @@ export declare function uploadFileEffect(file: ChatUploadFile, input: {
|
|
|
45
45
|
readonly fetch: typeof globalThis.fetch;
|
|
46
46
|
}): ClientEffect<ChatAttachment>;
|
|
47
47
|
export type { ActiveReaction, ChatAttachment, ChatMessage, ChatReadReceipt, ChatSendInput, MediaRequestKind, Reaction };
|
|
48
|
-
//# sourceMappingURL=controller-effects.d.ts.map
|
|
@@ -44,4 +44,3 @@ export declare function createEffectSpaceClient(options: SpaceClientOptions, pla
|
|
|
44
44
|
export declare function effectClientFromCore(core: SpaceClientCore, dispose?: () => Effect.Effect<void, unknown>): EffectSpaceClient;
|
|
45
45
|
export type { SpaceClientPlatform } from "./core";
|
|
46
46
|
export type { ChalkChatPageResult, ChalkDirectedRequestResult, MediaRequestKind, Reaction, ActiveReaction };
|
|
47
|
-
//# sourceMappingURL=effect.d.ts.map
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import type { ConnectionError } from "../connection/types";
|
|
1
2
|
import type { ClientFailure, ErrorCode } from "./types";
|
|
2
3
|
declare const SpaceClientError_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 & {
|
|
3
4
|
readonly _tag: "SpaceClientError";
|
|
4
5
|
} & Readonly<A>;
|
|
5
6
|
export declare class SpaceClientError extends SpaceClientError_base<ClientFailure> {
|
|
6
7
|
}
|
|
7
|
-
export declare function
|
|
8
|
+
export declare function normalizeMediaError(cause: unknown): SpaceClientError;
|
|
9
|
+
export declare function normalizeClientError(cause: unknown, fallback?: ErrorCode, scope?: "media"): SpaceClientError;
|
|
8
10
|
export declare function failureFromError(error: SpaceClientError): ClientFailure;
|
|
9
11
|
export declare function isAccessInvalid(cause: unknown): boolean;
|
|
12
|
+
export declare function connectionErrorCode(code: ConnectionError["code"], action: ConnectionError["action"]): ErrorCode;
|
|
10
13
|
export {};
|
|
11
|
-
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { SpaceClientError } from "./errors";
|
|
2
2
|
export { createSpaceClient } from "./space-client";
|
|
3
3
|
export type { AccessGrant } from "../access/grant";
|
|
4
|
-
export type { AccessContext, AccessGrantSource, AccessReason, ActiveReaction, AdmissionRequest, Capability, ChatAttachment, ChatController, ChatFilesController, ChatMessage, ChatReactionInput, ChatReaction, ChatReactions, ChatReadReceipt, ChatSendInput, ChatSlice, ChatUploadFile, ClientEventHandler, ClientEventMap, ClientEventName, ClientFailure, ConnectionSlice, ConnectionStatus, EpisodeSummary, ErrorCode, GetAccess, IncomingMediaRequest, JoinOptions, LocalMedia, Logger, OfflineAction, OfflineActionKind, OfflineActionsPolicy, OfflineController, OfflineSlice, MediaController, MediaDevice, MediaRequestKind, MediaSlice, Participant, PendingChatSend, ParticipantPresence, ParticipantsController, ParticipantsSlice, Reaction, Recording, RecordingController, RecordingSlice, ReactionsController, ReactionsSlice, RemoteMedia, SelfSlice, ScreenShareOptions, ScreenShareSurface, ScreenShareCapture, SpaceClient, SpaceClientOptions, SpaceSnapshot, WhiteboardController, WhiteboardSlice, } from "./types";
|
|
4
|
+
export type { AccessContext, AccessGrantSource, AccessReason, ActiveReaction, AdmissionRequest, Capability, CameraPreview, ChatAttachment, ChatController, ChatFilesController, ChatMessage, ChatReactionInput, ChatReaction, ChatReactions, ChatReadReceipt, ChatSendInput, ChatSlice, ChatUploadFile, ClientEventHandler, ClientEventMap, ClientEventName, ClientFailure, ConnectionSlice, ConnectionStatus, EpisodeSummary, ErrorCode, GetAccess, IncomingMediaRequest, JoinOptions, LocalMedia, Logger, OfflineAction, OfflineActionKind, OfflineActionsPolicy, OfflineController, OfflineSlice, MediaController, MediaDevice, MediaRequestKind, MediaSlice, Participant, PendingChatSend, ParticipantPresence, ParticipantsController, ParticipantsSlice, Reaction, Recording, RecordingController, RecordingSlice, ReactionsController, ReactionsSlice, RemoteMedia, SelfSlice, ScreenShareOptions, ScreenShareSurface, ScreenShareCapture, SpaceClient, SpaceClientOptions, SpaceSnapshot, WhiteboardController, WhiteboardSlice, } from "./types";
|
|
5
5
|
export { reloadRejoinAccess, readReloadRejoin, writeReloadRejoin, resumeReloadRejoin, reloadRejoinStorageKey } from "./reload-rejoin";
|
|
6
6
|
export type { ReloadRejoinMarker } from "./reload-rejoin";
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -3,7 +3,7 @@ import type { ConnectionLifecycleCapability } from "../connection";
|
|
|
3
3
|
import { SpaceClientError } from "./errors";
|
|
4
4
|
import type { MediaDeviceSelection } from "./media-device-selection";
|
|
5
5
|
import { SpaceStore } from "./store";
|
|
6
|
-
import type { ScreenShareOptions } from "./types";
|
|
6
|
+
import type { CameraPreview, ScreenShareOptions } from "./types";
|
|
7
7
|
type ClientEffect<A> = Effect.Effect<A, SpaceClientError>;
|
|
8
8
|
export type MediaControllerEffects = {
|
|
9
9
|
readonly configure: (intent: Readonly<{
|
|
@@ -12,6 +12,8 @@ export type MediaControllerEffects = {
|
|
|
12
12
|
}>) => void;
|
|
13
13
|
readonly setMicrophoneEnabled: (enabled: boolean) => ClientEffect<void>;
|
|
14
14
|
readonly setCameraEnabled: (enabled: boolean) => ClientEffect<void>;
|
|
15
|
+
/** Borrows the current camera or captures privately. The caller must release the preview. */
|
|
16
|
+
readonly captureCameraPreview: () => ClientEffect<CameraPreview>;
|
|
15
17
|
readonly setScreenShareEnabled: (enabled: boolean, options?: ScreenShareOptions) => ClientEffect<void>;
|
|
16
18
|
readonly selectMicrophone: (deviceId: string) => ClientEffect<void>;
|
|
17
19
|
readonly selectCamera: (deviceId: string) => ClientEffect<void>;
|
|
@@ -27,4 +29,3 @@ export declare class MediaControllerService extends MediaControllerService_base
|
|
|
27
29
|
export declare const makeMediaController: (connection: ConnectionLifecycleCapability, store: SpaceStore, selection: MediaDeviceSelection) => Effect.Effect<MediaControllerEffects, never, Clock.Clock | Scope.Scope>;
|
|
28
30
|
export declare const makeMediaControllerLayer: (connection: ConnectionLifecycleCapability, store: SpaceStore, selection: MediaDeviceSelection) => Layer.Layer<MediaControllerService, never, Clock.Clock>;
|
|
29
31
|
export {};
|
|
30
|
-
//# sourceMappingURL=media-controller.d.ts.map
|
|
@@ -34,4 +34,3 @@ export declare const makeOfflineActions: (input: {
|
|
|
34
34
|
}) => Effect.Effect<OfflineActionsControllerEffects & OfflineActionsHold, never, Scope.Scope>;
|
|
35
35
|
export declare const makeOfflineActionsLayer: (input: Parameters<typeof makeOfflineActions>[0]) => Layer.Layer<OfflineActionsService, never, never>;
|
|
36
36
|
export {};
|
|
37
|
-
//# sourceMappingURL=offline-actions.d.ts.map
|
|
@@ -30,4 +30,3 @@ export declare class ParticipantsControllerService extends ParticipantsControlle
|
|
|
30
30
|
export declare const makeParticipantsController: (connection: ConnectionLifecycleCapability, store: SpaceStore, offline?: OfflineActionsHold) => Effect.Effect<ParticipantsControllerEffects, never, import("effect").Scope.Scope>;
|
|
31
31
|
export declare const makeParticipantsControllerLayer: (connection: ConnectionLifecycleCapability, store: SpaceStore) => Layer.Layer<ParticipantsControllerService, never, never>;
|
|
32
32
|
export {};
|
|
33
|
-
//# sourceMappingURL=participants-controller.d.ts.map
|
|
@@ -9,4 +9,3 @@ export type PromiseController<Controller extends Record<string, ControllerComman
|
|
|
9
9
|
};
|
|
10
10
|
export declare function toPromiseController<Controller extends Record<string, ControllerCommand>>(runtime: PromiseRuntime, controller: Controller): PromiseController<Omit<Controller, "configure" | "dispose">>;
|
|
11
11
|
export {};
|
|
12
|
-
//# sourceMappingURL=promise-facade.d.ts.map
|
|
@@ -15,4 +15,3 @@ export declare class ReactionsControllerService extends ReactionsControllerServi
|
|
|
15
15
|
export declare const makeReactionsController: (connection: ConnectionLifecycleCapability, store: SpaceStore) => Effect.Effect<ReactionsControllerEffects, never, Clock.Clock | Scope.Scope>;
|
|
16
16
|
export declare const makeReactionsControllerLayer: (connection: ConnectionLifecycleCapability, store: SpaceStore) => Layer.Layer<ReactionsControllerService, never, Clock.Clock>;
|
|
17
17
|
export {};
|
|
18
|
-
//# sourceMappingURL=reactions-controller.d.ts.map
|
|
@@ -16,4 +16,3 @@ export declare class RecordingControllerService extends RecordingControllerServi
|
|
|
16
16
|
export declare const makeRecordingController: (connection: ConnectionLifecycleCapability, store: SpaceStore) => Effect.Effect<RecordingControllerEffects, never, import("effect").Scope.Scope>;
|
|
17
17
|
export declare const makeRecordingControllerLayer: (connection: ConnectionLifecycleCapability, store: SpaceStore) => Layer.Layer<RecordingControllerService, never, never>;
|
|
18
18
|
export {};
|
|
19
|
-
//# sourceMappingURL=recording-controller.d.ts.map
|
|
@@ -21,4 +21,3 @@ export declare function writeReloadRejoin(storage: Pick<Storage, "setItem">, mar
|
|
|
21
21
|
/** Refuse a fresh Episode or Participant even if an integration returns a new grant. */
|
|
22
22
|
export declare function resumeReloadRejoin(marker: ReloadRejoinMarker, refresh: () => Promise<unknown>): Promise<AccessGrant>;
|
|
23
23
|
export declare function reloadRejoinAccess(access: unknown): Pick<ReloadRejoinMarker, "episodeId" | "participantId" | "participantGeneration" | "mediaProof">;
|
|
24
|
-
//# sourceMappingURL=reload-rejoin.d.ts.map
|
|
@@ -2,4 +2,3 @@ import { type SpaceClientPlatform } from "./core";
|
|
|
2
2
|
import type { SpaceClient, SpaceClientOptions } from "./types";
|
|
3
3
|
export declare function createSpaceClient(options: SpaceClientOptions): SpaceClient;
|
|
4
4
|
export declare function createSpaceClientForPlatform(options: SpaceClientOptions, platform: SpaceClientPlatform): SpaceClient;
|
|
5
|
-
//# sourceMappingURL=space-client.d.ts.map
|
|
@@ -28,4 +28,3 @@ export declare class SpaceStoreService extends SpaceStoreService_base {
|
|
|
28
28
|
export declare const makeSpaceStoreLayer: Layer.Layer<SpaceStoreService, never, never>;
|
|
29
29
|
export declare const makeFakeSpaceStoreLayer: (store?: SpaceStore) => Layer.Layer<SpaceStoreService, never, never>;
|
|
30
30
|
export {};
|
|
31
|
-
//# sourceMappingURL=store.d.ts.map
|
|
@@ -47,7 +47,7 @@ export type JoinOptions = {
|
|
|
47
47
|
};
|
|
48
48
|
export type ConnectionStatus = "idle" | "joining" | "live" | "reconnecting" | "leaving" | "left" | "failed";
|
|
49
49
|
export type Capability = V1Capability;
|
|
50
|
-
export type ErrorCode = "access.invalid" | "access.unavailable" | "chat.cursor_reset_required" | "chat.payload_invalid" | "client.internal_error" | "collaboration.unavailable" | "command.rate_limited" | "command.rejected" | "connection.invalid_state" | "connection.join_cleanup_unconfirmed" | "connection.leave_unconfirmed" | "connection.media_recovery_exhausted" | "connection.media_start_failed" | "connection.sync_recovery_exhausted" | "connection.sync_start_failed" | "environment.unsupported" | "episode.ended" | "media.permission_denied" | "media.device_not_found" | "media.device_busy" | "media.device_constraint_invalid" | "media.capture_failed" | "media.request_invalid" | "media.timeout" | "offline.discarded" | "participant.invalid" | "reaction.invalid" | "whiteboard.unavailable";
|
|
50
|
+
export type ErrorCode = "access.invalid" | "access.unavailable" | "chat.cursor_reset_required" | "chat.payload_invalid" | "client.internal_error" | "collaboration.unavailable" | "command.rate_limited" | "command.rejected" | "connection.invalid_state" | "connection.join_cleanup_unconfirmed" | "connection.leave_unconfirmed" | "connection.media_recovery_exhausted" | "connection.media_start_failed" | "connection.state_digest_recovery_failed" | "connection.sync_recovery_exhausted" | "connection.sync_start_failed" | "connection.sync_hello_timeout" | "environment.unsupported" | "episode.ended" | "media.permission_denied" | "media.device_not_found" | "media.device_busy" | "media.device_constraint_invalid" | "media.capture_failed" | "media.request_invalid" | "media.timeout" | "offline.discarded" | "participant.invalid" | "reaction.invalid" | "whiteboard.unavailable";
|
|
51
51
|
export type ClientFailure = {
|
|
52
52
|
readonly code: ErrorCode;
|
|
53
53
|
readonly recoverable: boolean;
|
|
@@ -60,6 +60,8 @@ export type EpisodeSummary = {
|
|
|
60
60
|
};
|
|
61
61
|
export type ConnectionSlice = {
|
|
62
62
|
readonly status: ConnectionStatus;
|
|
63
|
+
/** Pong health; degradation keeps the public status live and controls usable. */
|
|
64
|
+
readonly syncHealth?: import("../sync/v1-health").SyncHealth;
|
|
63
65
|
readonly episode: EpisodeSummary | null;
|
|
64
66
|
readonly lastError: ClientFailure | null;
|
|
65
67
|
/** The Episode ended while this person was in it. */
|
|
@@ -228,6 +230,10 @@ export type ChatUploadFile = {
|
|
|
228
230
|
readonly mimeType: string;
|
|
229
231
|
readonly bytes: ArrayBuffer;
|
|
230
232
|
};
|
|
233
|
+
export type CameraPreview = {
|
|
234
|
+
readonly track: MediaStreamTrack;
|
|
235
|
+
readonly release: () => void;
|
|
236
|
+
};
|
|
231
237
|
export type MediaController = PromiseController<Omit<MediaControllerEffects, "configure" | "dispose">>;
|
|
232
238
|
export type ChatFilesController = PromiseController<Pick<ChatControllerEffects, "upload" | "url" | "resolveUrl">>;
|
|
233
239
|
export type ChatController = PromiseController<Omit<ChatControllerEffects, "upload" | "url" | "resolveUrl" | "dispose">> & {
|
|
@@ -277,4 +283,3 @@ export type SpaceClient = {
|
|
|
277
283
|
readonly extendEpisode: (minutes: number) => Promise<void>;
|
|
278
284
|
readonly on: <TEvent extends ClientEventName>(event: TEvent, handler: ClientEventHandler<TEvent>) => () => void;
|
|
279
285
|
};
|
|
280
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -14,4 +14,3 @@ export declare class WhiteboardControllerService extends WhiteboardControllerSer
|
|
|
14
14
|
export declare const makeWhiteboardController: (connection: ConnectionLifecycleCapability, store: SpaceStore, create?: (input: ConnectionWhiteboardFactoryInput) => ChalkWhiteboardV1Transport | null) => Effect.Effect<WhiteboardControllerEffects, never, import("effect").Scope.Scope>;
|
|
15
15
|
export declare const makeWhiteboardControllerLayer: (connection: ConnectionLifecycleCapability, store: SpaceStore, create?: (input: ConnectionWhiteboardFactoryInput) => ChalkWhiteboardV1Transport | null) => Layer.Layer<WhiteboardControllerService, never, never>;
|
|
16
16
|
export {};
|
|
17
|
-
//# sourceMappingURL=whiteboard-controller.d.ts.map
|
package/dist/sync/browser.d.ts
CHANGED
|
@@ -6,4 +6,3 @@ export type BrowserLifecycleEnvironment = {
|
|
|
6
6
|
};
|
|
7
7
|
export declare function createBrowserWebSocketFactory(WebSocketConstructor?: BrowserWebSocketConstructor): SyncWebSocketFactory;
|
|
8
8
|
export declare function createBrowserSyncLifecycle(environment?: BrowserLifecycleEnvironment): SyncLifecycle;
|
|
9
|
-
//# sourceMappingURL=browser.d.ts.map
|
package/dist/sync/canonical.d.ts
CHANGED
|
@@ -4,4 +4,3 @@ export type CanonicalJson = null | boolean | number | string | readonly Canonica
|
|
|
4
4
|
export declare function canonicalJson(value: CanonicalJson): string;
|
|
5
5
|
export declare function canonicalJsonBytes(value: CanonicalJson): Uint8Array;
|
|
6
6
|
export declare function canonicalJsonBytesFromUnknown(value: unknown): Uint8Array;
|
|
7
|
-
//# sourceMappingURL=canonical.d.ts.map
|
package/dist/sync/errors.d.ts
CHANGED