@open-e2ee/signal-protocol-sdk 0.4.0 → 1.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/CHANGELOG.md +63 -5
- package/README.md +10 -7
- package/SECURITY.md +2 -2
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/device/README.md +7 -5
- package/dist/client/client.d.ts +3 -2
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/client.js +58 -25
- package/dist/client/client.js.map +1 -1
- package/dist/client/config.d.ts +46 -7
- package/dist/client/config.d.ts.map +1 -1
- package/dist/client/config.js +2 -2
- package/dist/client/config.js.map +1 -1
- package/dist/client/group-outbox.d.ts +38 -0
- package/dist/client/group-outbox.d.ts.map +1 -0
- package/dist/client/group-outbox.js +221 -0
- package/dist/client/group-outbox.js.map +1 -0
- package/dist/client/group-sealed-sender.d.ts +28 -0
- package/dist/client/group-sealed-sender.d.ts.map +1 -0
- package/dist/client/group-sealed-sender.js +74 -0
- package/dist/client/group-sealed-sender.js.map +1 -0
- package/dist/client/hosted-push.d.ts +77 -0
- package/dist/client/hosted-push.d.ts.map +1 -0
- package/dist/client/hosted-push.js +90 -0
- package/dist/client/hosted-push.js.map +1 -0
- package/dist/client/hosted.d.ts +207 -0
- package/dist/client/hosted.d.ts.map +1 -0
- package/dist/client/hosted.js +505 -0
- package/dist/client/hosted.js.map +1 -0
- package/dist/client/index.d.ts +4 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +2 -0
- package/dist/client/index.js.map +1 -1
- package/dist/client/relay-subscription.d.ts.map +1 -1
- package/dist/client/relay-subscription.js +34 -7
- package/dist/client/relay-subscription.js.map +1 -1
- package/dist/client/{sealed-sender-ops.d.ts → sealed-sender.d.ts} +39 -22
- package/dist/client/sealed-sender.d.ts.map +1 -0
- package/dist/client/sealed-sender.js +296 -0
- package/dist/client/sealed-sender.js.map +1 -0
- package/dist/client/signal-service-cipher.d.ts +23 -26
- package/dist/client/signal-service-cipher.d.ts.map +1 -1
- package/dist/client/signal-service-cipher.js +465 -706
- package/dist/client/signal-service-cipher.js.map +1 -1
- package/dist/client/types.d.ts +18 -3
- package/dist/client/types.d.ts.map +1 -1
- package/dist/client/types.js +6 -0
- package/dist/client/types.js.map +1 -1
- package/dist/device/index.d.ts +2 -2
- package/dist/device/index.d.ts.map +1 -1
- package/dist/device/index.js +1 -1
- package/dist/device/index.js.map +1 -1
- package/dist/device/transfer.d.ts +7 -43
- package/dist/device/transfer.d.ts.map +1 -1
- package/dist/device/transfer.js +31 -150
- package/dist/device/transfer.js.map +1 -1
- package/dist/device/types.d.ts +6 -47
- package/dist/device/types.d.ts.map +1 -1
- package/dist/device/types.js +1 -1
- package/dist/device/types.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/encoding/proto/pq-ratchet-serialize.js +1 -1
- package/dist/internal/encoding/proto/pq-ratchet-serialize.js.map +1 -1
- package/dist/internal/encoding/proto/primitives.js +1 -1
- package/dist/internal/encoding/proto/primitives.js.map +1 -1
- package/dist/internal/groups/manager.d.ts +3 -3
- package/dist/internal/groups/manager.d.ts.map +1 -1
- package/dist/internal/groups/manager.js +5 -4
- package/dist/internal/groups/manager.js.map +1 -1
- package/dist/internal/protocol/sealed-sender/certificate.d.ts +10 -4
- package/dist/internal/protocol/sealed-sender/certificate.d.ts.map +1 -1
- package/dist/internal/protocol/sealed-sender/certificate.js +64 -7
- package/dist/internal/protocol/sealed-sender/certificate.js.map +1 -1
- package/dist/internal/protocol/sealed-sender/decryption.d.ts +34 -47
- package/dist/internal/protocol/sealed-sender/decryption.d.ts.map +1 -1
- package/dist/internal/protocol/sealed-sender/decryption.js +95 -182
- package/dist/internal/protocol/sealed-sender/decryption.js.map +1 -1
- package/dist/internal/protocol/sealed-sender/encryption.d.ts +49 -64
- package/dist/internal/protocol/sealed-sender/encryption.d.ts.map +1 -1
- package/dist/internal/protocol/sealed-sender/encryption.js +120 -123
- package/dist/internal/protocol/sealed-sender/encryption.js.map +1 -1
- package/dist/internal/protocol/sealed-sender/index.d.ts +5 -7
- package/dist/internal/protocol/sealed-sender/index.d.ts.map +1 -1
- package/dist/internal/protocol/sealed-sender/index.js +4 -12
- package/dist/internal/protocol/sealed-sender/index.js.map +1 -1
- package/dist/internal/protocol/sealed-sender/{v2-helpers.d.ts → multi-recipient-crypto.d.ts} +1 -1
- package/dist/internal/protocol/sealed-sender/multi-recipient-crypto.d.ts.map +1 -0
- package/dist/internal/protocol/sealed-sender/{v2-helpers.js → multi-recipient-crypto.js} +1 -1
- package/dist/internal/protocol/sealed-sender/multi-recipient-crypto.js.map +1 -0
- package/dist/internal/protocol/sealed-sender/{v2-binary.d.ts → multi-recipient-message.d.ts} +3 -2
- package/dist/internal/protocol/sealed-sender/multi-recipient-message.d.ts.map +1 -0
- package/dist/internal/protocol/sealed-sender/{v2-binary.js → multi-recipient-message.js} +16 -8
- package/dist/internal/protocol/sealed-sender/multi-recipient-message.js.map +1 -0
- package/dist/internal/protocol/sealed-sender/proto/index.d.ts +3 -0
- package/dist/internal/protocol/sealed-sender/proto/index.d.ts.map +1 -1
- package/dist/internal/protocol/sealed-sender/proto/index.js +25 -2
- package/dist/internal/protocol/sealed-sender/proto/index.js.map +1 -1
- package/dist/internal/protocol/sealed-sender/trust-root.d.ts +11 -1
- package/dist/internal/protocol/sealed-sender/trust-root.d.ts.map +1 -1
- package/dist/internal/protocol/sealed-sender/trust-root.js +13 -1
- package/dist/internal/protocol/sealed-sender/trust-root.js.map +1 -1
- package/dist/internal/protocol/sealed-sender/types.d.ts +20 -135
- package/dist/internal/protocol/sealed-sender/types.d.ts.map +1 -1
- package/dist/internal/protocol/sealed-sender/types.js +15 -6
- package/dist/internal/protocol/sealed-sender/types.js.map +1 -1
- package/dist/internal/protocol/sender-keys/manager.d.ts +22 -1
- package/dist/internal/protocol/sender-keys/manager.d.ts.map +1 -1
- package/dist/internal/protocol/sender-keys/manager.js +39 -4
- package/dist/internal/protocol/sender-keys/manager.js.map +1 -1
- package/dist/internal/protocol/spqr/braid-serialize.js +1 -1
- package/dist/internal/protocol/spqr/braid-serialize.js.map +1 -1
- package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.js +4 -4
- package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.js.map +1 -1
- package/dist/internal/protocol/zk/groups/index.d.ts +1 -1
- package/dist/internal/protocol/zk/groups/index.d.ts.map +1 -1
- package/dist/internal/protocol/zk/groups/index.js +1 -1
- package/dist/internal/protocol/zk/groups/index.js.map +1 -1
- package/dist/internal/protocol/zk/groups/profile-key-credential.d.ts +37 -12
- package/dist/internal/protocol/zk/groups/profile-key-credential.d.ts.map +1 -1
- package/dist/internal/protocol/zk/groups/profile-key-credential.js +104 -31
- package/dist/internal/protocol/zk/groups/profile-key-credential.js.map +1 -1
- package/dist/local/store/expo/adapter.d.ts +1 -0
- package/dist/local/store/expo/adapter.d.ts.map +1 -1
- package/dist/local/store/expo/adapter.js +3 -0
- package/dist/local/store/expo/adapter.js.map +1 -1
- package/dist/local/store/expo/key-storage.d.ts +1 -0
- package/dist/local/store/expo/key-storage.d.ts.map +1 -1
- package/dist/local/store/expo/key-storage.js +4 -0
- package/dist/local/store/expo/key-storage.js.map +1 -1
- package/dist/local/store/memory/adapter.d.ts +1 -0
- package/dist/local/store/memory/adapter.d.ts.map +1 -1
- package/dist/local/store/memory/adapter.js +4 -0
- package/dist/local/store/memory/adapter.js.map +1 -1
- package/dist/local/store/node/adapter.d.ts +1 -0
- package/dist/local/store/node/adapter.d.ts.map +1 -1
- package/dist/local/store/node/adapter.js +3 -0
- package/dist/local/store/node/adapter.js.map +1 -1
- package/dist/local/store/node/database.d.ts +1 -0
- package/dist/local/store/node/database.d.ts.map +1 -1
- package/dist/local/store/node/database.js +5 -0
- package/dist/local/store/node/database.js.map +1 -1
- package/dist/local/store/react-native/adapter.d.ts +1 -0
- package/dist/local/store/react-native/adapter.d.ts.map +1 -1
- package/dist/local/store/react-native/adapter.js +4 -0
- package/dist/local/store/react-native/adapter.js.map +1 -1
- package/dist/local/store/react-native/reference-backend.js +1 -1
- package/dist/local/store/react-native/reference-backend.js.map +1 -1
- package/dist/local/store/reliability.d.ts +63 -0
- package/dist/local/store/reliability.d.ts.map +1 -0
- package/dist/local/store/reliability.js +219 -0
- package/dist/local/store/reliability.js.map +1 -0
- package/dist/local/store/web/adapter.d.ts +1 -0
- package/dist/local/store/web/adapter.d.ts.map +1 -1
- package/dist/local/store/web/adapter.js +5 -0
- package/dist/local/store/web/adapter.js.map +1 -1
- package/dist/remote/relay/convex/backend.d.ts +4 -14
- package/dist/remote/relay/convex/backend.d.ts.map +1 -1
- package/dist/remote/relay/convex/backend.js +11 -20
- package/dist/remote/relay/convex/backend.js.map +1 -1
- package/dist/remote/relay/convex/component/_generated/component.d.ts +7 -14
- package/dist/remote/relay/convex/component/_generated/component.d.ts.map +1 -1
- package/dist/remote/relay/convex/component/certificates.d.ts.map +1 -1
- package/dist/remote/relay/convex/component/certificates.js +14 -5
- package/dist/remote/relay/convex/component/certificates.js.map +1 -1
- package/dist/remote/relay/convex/component/messages.d.ts +0 -13
- package/dist/remote/relay/convex/component/messages.d.ts.map +1 -1
- package/dist/remote/relay/convex/component/messages.js +13 -47
- package/dist/remote/relay/convex/component/messages.js.map +1 -1
- package/dist/remote/relay/convex/component/schema.d.ts +3 -1
- package/dist/remote/relay/convex/component/schema.js +1 -0
- package/dist/remote/relay/convex/component/schema.js.map +1 -1
- package/dist/remote/relay/convex/component/zkAuth.d.ts +7 -1
- package/dist/remote/relay/convex/component/zkAuth.d.ts.map +1 -1
- package/dist/remote/relay/convex/component/zkAuth.js +29 -14
- package/dist/remote/relay/convex/component/zkAuth.js.map +1 -1
- package/dist/remote/relay/convex/relay.d.ts +2 -5
- package/dist/remote/relay/convex/relay.d.ts.map +1 -1
- package/dist/remote/relay/convex/relay.js +17 -47
- package/dist/remote/relay/convex/relay.js.map +1 -1
- package/dist/remote/relay/memory/adapter.d.ts +4 -10
- package/dist/remote/relay/memory/adapter.d.ts.map +1 -1
- package/dist/remote/relay/memory/adapter.js +31 -34
- package/dist/remote/relay/memory/adapter.js.map +1 -1
- package/dist/remote/relay/types.d.ts +6 -19
- package/dist/remote/relay/types.d.ts.map +1 -1
- package/dist/types/api.d.ts +2 -0
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/errors.d.ts +3 -1
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/errors.js +4 -2
- package/dist/types/errors.js.map +1 -1
- package/dist/types/protocol-config.d.ts +1 -1
- package/dist/username/link.d.ts.map +1 -1
- package/dist/username/link.js +1 -1
- package/dist/username/link.js.map +1 -1
- package/docs/ASSURANCE.md +5 -5
- package/docs/DEVIATIONS.md +32 -61
- package/docs/GETTING_STARTED.md +7 -0
- package/docs/SECURITY.md +6 -0
- package/package.json +1 -1
- package/remote/relay/convex/component/README.md +20 -14
- package/scripts/oe-groups.mjs +5 -1
- package/dist/client/sealed-sender-ops.d.ts.map +0 -1
- package/dist/client/sealed-sender-ops.js +0 -203
- package/dist/client/sealed-sender-ops.js.map +0 -1
- package/dist/internal/protocol/sealed-sender/decryption-v2.d.ts +0 -46
- package/dist/internal/protocol/sealed-sender/decryption-v2.d.ts.map +0 -1
- package/dist/internal/protocol/sealed-sender/decryption-v2.js +0 -198
- package/dist/internal/protocol/sealed-sender/decryption-v2.js.map +0 -1
- package/dist/internal/protocol/sealed-sender/encryption-v2.d.ts +0 -56
- package/dist/internal/protocol/sealed-sender/encryption-v2.d.ts.map +0 -1
- package/dist/internal/protocol/sealed-sender/encryption-v2.js +0 -163
- package/dist/internal/protocol/sealed-sender/encryption-v2.js.map +0 -1
- package/dist/internal/protocol/sealed-sender/v2-binary.d.ts.map +0 -1
- package/dist/internal/protocol/sealed-sender/v2-binary.js.map +0 -1
- package/dist/internal/protocol/sealed-sender/v2-helpers.d.ts.map +0 -1
- package/dist/internal/protocol/sealed-sender/v2-helpers.js.map +0 -1
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import type { CompositeIdentityV1 } from '../keys/types.js';
|
|
2
|
+
import type { ISignalProtocolRelayServer } from '../remote/relay/types.js';
|
|
3
|
+
import type { ISignalProtocolLocalStore } from '../types/index.js';
|
|
4
|
+
import { SignalProtocolClient } from './client.js';
|
|
5
|
+
import type { SignalProtocolClientCompositionOptions } from './compose.js';
|
|
6
|
+
import type { SealedSenderAccessMode } from './config.js';
|
|
7
|
+
export { pullHostedRelayAfterWake, registerHostedRelayPush, removeHostedRelayPush, } from './hosted-push.js';
|
|
8
|
+
export type { HostedRelayMailboxAcknowledgmentRequest, HostedRelayMailboxPullRequest, HostedRelayPushAdapter, HostedRelayPushRegistration, HostedRelayPushRegistrationRequest, HostedRelayPushRemovalRequest, HostedRelayTokenPushRegistration, HostedRelayWakeClient, HostedRelayWakeOptions, HostedRelayWakeResult, HostedRelayWebPushRegistration, } from './hosted-push.js';
|
|
9
|
+
/** Why the hosted Relay needs a fresh identity assertion. */
|
|
10
|
+
export type IdentityAssertionPurpose = 'register' | 'refresh' | 'recover';
|
|
11
|
+
/** Assurance requested from the application's identity provider. */
|
|
12
|
+
export type IdentityAssertionAssurance = 'normal' | 'recent' | 'step-up';
|
|
13
|
+
/** Provider role requested while an identity migration is in progress. */
|
|
14
|
+
export type IdentityAssertionProviderRole = 'source' | 'target';
|
|
15
|
+
/** Additional context for a purpose-aware assertion request. */
|
|
16
|
+
export interface IdentityAssertionRequest {
|
|
17
|
+
readonly purpose: IdentityAssertionPurpose;
|
|
18
|
+
readonly assurance?: IdentityAssertionAssurance;
|
|
19
|
+
readonly migration?: {
|
|
20
|
+
readonly action: HostedRelayIdentityMigrationAction;
|
|
21
|
+
readonly providerRole: IdentityAssertionProviderRole;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/** Stable application callback for a signed identity-provider assertion. */
|
|
25
|
+
export type GetIdentityAssertion = (request: IdentityAssertionRequest) => Promise<string>;
|
|
26
|
+
/** Hosted identity operation progress suitable for application UI. */
|
|
27
|
+
export type HostedRelayIdentityProgress = {
|
|
28
|
+
readonly operation: 'bootstrap' | 'recovery';
|
|
29
|
+
readonly phase: 'preparing-local-state' | 'requesting-assertion' | 'submitting' | 'complete';
|
|
30
|
+
} | {
|
|
31
|
+
readonly operation: 'migration';
|
|
32
|
+
readonly action: HostedRelayIdentityMigrationAction;
|
|
33
|
+
readonly phase: 'requesting-assertion' | 'submitting' | 'complete';
|
|
34
|
+
readonly providerRole?: IdentityAssertionProviderRole;
|
|
35
|
+
readonly state?: HostedRelayIdentityMigrationState;
|
|
36
|
+
} | {
|
|
37
|
+
readonly operation: 'device-link';
|
|
38
|
+
readonly phase: 'preparing-linked-device' | 'submitting' | 'complete';
|
|
39
|
+
readonly deviceId?: number;
|
|
40
|
+
};
|
|
41
|
+
/** Receives typed progress without receiving assertions or private key material. */
|
|
42
|
+
export type HostedRelayIdentityProgressCallback = (progress: HostedRelayIdentityProgress) => void;
|
|
43
|
+
/** A device proof signer whose private key never leaves the SDK-owned local store. */
|
|
44
|
+
export interface HostedRelayDeviceAuthentication {
|
|
45
|
+
readonly publicKey: Uint8Array;
|
|
46
|
+
/**
|
|
47
|
+
* Sign a Relay challenge with domain separation and publishable-key binding.
|
|
48
|
+
* The adapter verifies `label || publishableKey || 0x00 || challenge`.
|
|
49
|
+
*/
|
|
50
|
+
signChallenge(challenge: Uint8Array): Promise<Uint8Array>;
|
|
51
|
+
}
|
|
52
|
+
/** Public prekey material sent during one atomic hosted Relay registration. */
|
|
53
|
+
export interface HostedRelayRegistrationPreKey {
|
|
54
|
+
readonly algorithm: 'ec-x25519' | 'kem-ml-kem-1024';
|
|
55
|
+
readonly keyId: number;
|
|
56
|
+
readonly publicKey: Uint8Array;
|
|
57
|
+
readonly signature?: Uint8Array;
|
|
58
|
+
}
|
|
59
|
+
/** Complete EC/PQ inventory bound to the hosted device registration. */
|
|
60
|
+
export interface HostedRelayRegistrationPreKeys {
|
|
61
|
+
readonly oneTimePreKeys: readonly HostedRelayRegistrationPreKey[];
|
|
62
|
+
readonly signedPreKeys: readonly HostedRelayRegistrationPreKey[];
|
|
63
|
+
}
|
|
64
|
+
/** Request passed to a hosted Relay bootstrap transport. */
|
|
65
|
+
export interface HostedRelayBootstrapRequest {
|
|
66
|
+
readonly publishableKey: string;
|
|
67
|
+
readonly assertion: string;
|
|
68
|
+
readonly assertionPurpose: IdentityAssertionPurpose;
|
|
69
|
+
readonly signalIdentity: CompositeIdentityV1;
|
|
70
|
+
readonly registrationId: number;
|
|
71
|
+
/** Stable for exact retries and changes when the public registration material changes. */
|
|
72
|
+
readonly operationId: string;
|
|
73
|
+
readonly registrationPreKeys: HostedRelayRegistrationPreKeys;
|
|
74
|
+
readonly deviceAuthentication: HostedRelayDeviceAuthentication;
|
|
75
|
+
}
|
|
76
|
+
/** Canonical identity and authenticated Relay returned by hosted bootstrap. */
|
|
77
|
+
export interface HostedRelayBootstrapResult {
|
|
78
|
+
readonly canonicalAccountId: string;
|
|
79
|
+
readonly deviceId: number;
|
|
80
|
+
readonly relayScopeId: Uint8Array;
|
|
81
|
+
readonly relay: ISignalProtocolRelayServer;
|
|
82
|
+
}
|
|
83
|
+
export type HostedRelayIdentityMigrationAction = 'prepare' | 'inspect' | 'cutover' | 'rollback' | 'finalize';
|
|
84
|
+
export type HostedRelayIdentityMigrationState = 'abandoned' | 'prepared' | 'cutover' | 'rolled-back' | 'finalized';
|
|
85
|
+
export interface HostedRelayIdentityMigrationSnapshot {
|
|
86
|
+
readonly accountPreserved: true;
|
|
87
|
+
readonly collision: false;
|
|
88
|
+
readonly expiresAt: number;
|
|
89
|
+
readonly manifestVersion: number;
|
|
90
|
+
readonly operationId: string;
|
|
91
|
+
readonly primaryProvider: IdentityAssertionProviderRole;
|
|
92
|
+
readonly proof: 'active-device' | 'dual-assertion';
|
|
93
|
+
readonly rollbackDeadline?: number;
|
|
94
|
+
readonly state: HostedRelayIdentityMigrationState;
|
|
95
|
+
}
|
|
96
|
+
export interface HostedRelayIdentityMigrationRequest {
|
|
97
|
+
readonly action: HostedRelayIdentityMigrationAction;
|
|
98
|
+
readonly publishableKey: string;
|
|
99
|
+
readonly operationId: string;
|
|
100
|
+
readonly manifestVersion?: number;
|
|
101
|
+
readonly authorization: {
|
|
102
|
+
readonly kind: 'active-device';
|
|
103
|
+
readonly deviceAuthentication: HostedRelayDeviceAuthentication;
|
|
104
|
+
} | {
|
|
105
|
+
readonly kind: 'assertion';
|
|
106
|
+
readonly assertion: string;
|
|
107
|
+
};
|
|
108
|
+
readonly targetAssertion?: string;
|
|
109
|
+
}
|
|
110
|
+
export interface HostedRelayManagedDeviceLinkRequest {
|
|
111
|
+
readonly publishableKey: string;
|
|
112
|
+
readonly signalIdentity: CompositeIdentityV1;
|
|
113
|
+
readonly registrationId: number;
|
|
114
|
+
readonly operationId: string;
|
|
115
|
+
readonly registrationPreKeys: HostedRelayRegistrationPreKeys;
|
|
116
|
+
readonly activeDeviceAuthentication: HostedRelayDeviceAuthentication;
|
|
117
|
+
readonly newDeviceAuthentication: HostedRelayDeviceAuthentication;
|
|
118
|
+
}
|
|
119
|
+
export interface HostedRelayManagedDeviceLinkResult extends HostedRelayBootstrapResult {
|
|
120
|
+
readonly accountPreserved: true;
|
|
121
|
+
readonly protocolStateCopied: false;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* SDK or integration-owned hosted Relay transport.
|
|
125
|
+
*
|
|
126
|
+
* Certificate roots are pinned in this adapter, outside the bootstrap response.
|
|
127
|
+
* A Relay response cannot select the root that validates its own certificates.
|
|
128
|
+
*/
|
|
129
|
+
export interface HostedRelayBootstrapAdapter {
|
|
130
|
+
readonly certificateTrust: {
|
|
131
|
+
readonly environment: 'development' | 'production';
|
|
132
|
+
readonly trustRoots: readonly Uint8Array[];
|
|
133
|
+
readonly revokedIssuerKeyIds: readonly number[];
|
|
134
|
+
};
|
|
135
|
+
bootstrap(request: HostedRelayBootstrapRequest): Promise<HostedRelayBootstrapResult>;
|
|
136
|
+
}
|
|
137
|
+
/** Transport boundary for the hosted Relay identity-migration state machine. */
|
|
138
|
+
export interface HostedRelayIdentityMigrationAdapter {
|
|
139
|
+
migrate(request: HostedRelayIdentityMigrationRequest): Promise<HostedRelayIdentityMigrationSnapshot>;
|
|
140
|
+
}
|
|
141
|
+
/** Transport boundary for canonical managed device linking. */
|
|
142
|
+
export interface HostedRelayManagedDeviceLinkAdapter extends HostedRelayBootstrapAdapter {
|
|
143
|
+
linkDevice(request: HostedRelayManagedDeviceLinkRequest): Promise<HostedRelayManagedDeviceLinkResult>;
|
|
144
|
+
}
|
|
145
|
+
/** Compact, runtime-neutral hosted Relay client configuration. */
|
|
146
|
+
export interface HostedSignalProtocolClientOptions extends Omit<SignalProtocolClientCompositionOptions, 'adapters' | 'identity' | 'sealedSender'> {
|
|
147
|
+
readonly adapters: Omit<SignalProtocolClientCompositionOptions['adapters'], 'relay'>;
|
|
148
|
+
readonly hosted: {
|
|
149
|
+
readonly publishableKey: string;
|
|
150
|
+
readonly bootstrap: HostedRelayBootstrapAdapter;
|
|
151
|
+
readonly getIdentityAssertion: GetIdentityAssertion;
|
|
152
|
+
readonly assertionPurpose?: IdentityAssertionPurpose;
|
|
153
|
+
readonly assurance?: IdentityAssertionAssurance;
|
|
154
|
+
readonly onProgress?: HostedRelayIdentityProgressCallback;
|
|
155
|
+
readonly sealedSenderAccessMode?: SealedSenderAccessMode;
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
export interface HostedRelayIdentityMigrationOptions {
|
|
159
|
+
readonly action: HostedRelayIdentityMigrationAction;
|
|
160
|
+
readonly adapter: HostedRelayIdentityMigrationAdapter;
|
|
161
|
+
readonly getIdentityAssertion: GetIdentityAssertion;
|
|
162
|
+
readonly manifestVersion?: number;
|
|
163
|
+
readonly operationId: string;
|
|
164
|
+
readonly onProgress?: HostedRelayIdentityProgressCallback;
|
|
165
|
+
readonly publishableKey: string;
|
|
166
|
+
readonly authorization: {
|
|
167
|
+
readonly kind: 'active-device';
|
|
168
|
+
readonly storage: ISignalProtocolLocalStore;
|
|
169
|
+
} | {
|
|
170
|
+
readonly kind: 'assertion';
|
|
171
|
+
readonly providerRole: IdentityAssertionProviderRole;
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
export interface HostedRelayManagedDeviceLinkOptions extends Omit<SignalProtocolClientCompositionOptions, 'adapters' | 'identity' | 'sealedSender'> {
|
|
175
|
+
readonly adapters: Omit<SignalProtocolClientCompositionOptions['adapters'], 'relay'>;
|
|
176
|
+
readonly activeDeviceStorage: ISignalProtocolLocalStore;
|
|
177
|
+
readonly hosted: {
|
|
178
|
+
readonly publishableKey: string;
|
|
179
|
+
readonly adapter: HostedRelayManagedDeviceLinkAdapter;
|
|
180
|
+
readonly onProgress?: HostedRelayIdentityProgressCallback;
|
|
181
|
+
readonly sealedSenderAccessMode?: SealedSenderAccessMode;
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Advance one hosted provider-migration transition without accepting an account ID.
|
|
186
|
+
*
|
|
187
|
+
* The application supplies provider assertions through the same purpose-aware
|
|
188
|
+
* callback used by hosted bootstrap. The transport owns device-token storage
|
|
189
|
+
* and the HTTP representation.
|
|
190
|
+
*/
|
|
191
|
+
export declare function advanceHostedRelayIdentityMigration(options: HostedRelayIdentityMigrationOptions): Promise<HostedRelayIdentityMigrationSnapshot>;
|
|
192
|
+
/**
|
|
193
|
+
* Bind a provisioned linked-device store to the Relay-authoritative account.
|
|
194
|
+
*
|
|
195
|
+
* The linked store must already contain the account identity delivered by the
|
|
196
|
+
* SDK provisioning protocol. Only public identity and fresh linked-device
|
|
197
|
+
* prekey material crosses this managed boundary.
|
|
198
|
+
*/
|
|
199
|
+
export declare function linkHostedRelayDevice(options: HostedRelayManagedDeviceLinkOptions): Promise<SignalProtocolClient>;
|
|
200
|
+
/**
|
|
201
|
+
* Create a hosted Relay client without accepting a caller-supplied account or device ID.
|
|
202
|
+
*
|
|
203
|
+
* The Relay verifies the assertion and device proof, then returns the canonical
|
|
204
|
+
* account, registered device, scope, and authenticated transport used by the client.
|
|
205
|
+
*/
|
|
206
|
+
export declare function createHostedSignalProtocolClient(options: HostedSignalProtocolClientOptions): Promise<SignalProtocolClient>;
|
|
207
|
+
//# sourceMappingURL=hosted.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosted.d.ts","sourceRoot":"","sources":["../../client/hosted.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAWzD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,KAAK,EAAE,yBAAyB,EAAU,MAAM,UAAU,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,WAAW,CAAC;AAExE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEvD,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,uCAAuC,EACvC,6BAA6B,EAC7B,sBAAsB,EACtB,2BAA2B,EAC3B,kCAAkC,EAClC,6BAA6B,EAC7B,gCAAgC,EAChC,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,8BAA8B,GAC/B,MAAM,eAAe,CAAC;AAWvB,6DAA6D;AAC7D,MAAM,MAAM,wBAAwB,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;AAE1E,oEAAoE;AACpE,MAAM,MAAM,0BAA0B,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEzE,0EAA0E;AAC1E,MAAM,MAAM,6BAA6B,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEhE,gEAAgE;AAChE,MAAM,WAAW,wBA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