Start separating calls made to chat service
This commit is contained in:
parent
5b25de10f1
commit
c521568610
1 changed files with 150 additions and 70 deletions
|
@ -86,6 +86,7 @@ import { ToastType } from '../types/Toast';
|
||||||
import { isProduction } from '../util/version';
|
import { isProduction } from '../util/version';
|
||||||
import type { ServerAlert } from '../util/handleServerAlerts';
|
import type { ServerAlert } from '../util/handleServerAlerts';
|
||||||
import { isAbortError } from '../util/isAbortError';
|
import { isAbortError } from '../util/isAbortError';
|
||||||
|
import { missingCaseError } from '../util/missingCaseError';
|
||||||
|
|
||||||
// Note: this will break some code that expects to be able to use err.response when a
|
// Note: this will break some code that expects to be able to use err.response when a
|
||||||
// web request fails, because it will force it to text. But it is very useful for
|
// web request fails, because it will force it to text. But it is very useful for
|
||||||
|
@ -674,7 +675,7 @@ export function makeKeysLowercase<V>(
|
||||||
return lowerCase;
|
return lowerCase;
|
||||||
}
|
}
|
||||||
|
|
||||||
const URL_CALLS = {
|
const CHAT_CALLS = {
|
||||||
accountExistence: 'v1/accounts/account',
|
accountExistence: 'v1/accounts/account',
|
||||||
attachmentUploadForm: 'v4/attachments/form/upload',
|
attachmentUploadForm: 'v4/attachments/form/upload',
|
||||||
attestation: 'v1/attestation',
|
attestation: 'v1/attestation',
|
||||||
|
@ -685,21 +686,13 @@ const URL_CALLS = {
|
||||||
devices: 'v1/devices',
|
devices: 'v1/devices',
|
||||||
directoryAuthV2: 'v2/directory/auth',
|
directoryAuthV2: 'v2/directory/auth',
|
||||||
discovery: 'v1/discovery',
|
discovery: 'v1/discovery',
|
||||||
getGroupAvatarUpload: 'v1/groups/avatar/form',
|
|
||||||
getGroupCredentials: 'v1/certificate/auth/group',
|
getGroupCredentials: 'v1/certificate/auth/group',
|
||||||
getIceServers: 'v2/calling/relays',
|
getIceServers: 'v2/calling/relays',
|
||||||
getOnboardingStoryManifest:
|
|
||||||
'dynamic/desktop/stories/onboarding/manifest.json',
|
|
||||||
getStickerPackUpload: 'v1/sticker/pack/form',
|
getStickerPackUpload: 'v1/sticker/pack/form',
|
||||||
getBackupCredentials: 'v1/archives/auth',
|
getBackupCredentials: 'v1/archives/auth',
|
||||||
getBackupCDNCredentials: 'v1/archives/auth/read',
|
getBackupCDNCredentials: 'v1/archives/auth/read',
|
||||||
getBackupUploadForm: 'v1/archives/upload/form',
|
getBackupUploadForm: 'v1/archives/upload/form',
|
||||||
getBackupMediaUploadForm: 'v1/archives/media/upload/form',
|
getBackupMediaUploadForm: 'v1/archives/media/upload/form',
|
||||||
groupLog: 'v2/groups/logs',
|
|
||||||
groupJoinedAtVersion: 'v1/groups/joined_at_version',
|
|
||||||
groups: 'v2/groups',
|
|
||||||
groupsViaLink: 'v1/groups/join/',
|
|
||||||
groupToken: 'v1/groups/token',
|
|
||||||
keys: 'v2/keys',
|
keys: 'v2/keys',
|
||||||
linkDevice: 'v1/devices/link',
|
linkDevice: 'v1/devices/link',
|
||||||
messages: 'v1/messages',
|
messages: 'v1/messages',
|
||||||
|
@ -713,15 +706,10 @@ const URL_CALLS = {
|
||||||
callLinkCreateAuth: 'v1/call-link/create-auth',
|
callLinkCreateAuth: 'v1/call-link/create-auth',
|
||||||
registration: 'v1/registration',
|
registration: 'v1/registration',
|
||||||
registerCapabilities: 'v1/devices/capabilities',
|
registerCapabilities: 'v1/devices/capabilities',
|
||||||
releaseNotesManifest: 'dynamic/release-notes/release-notes-v2.json',
|
|
||||||
releaseNotes: 'static/release-notes',
|
|
||||||
reportMessage: 'v1/messages/report',
|
reportMessage: 'v1/messages/report',
|
||||||
setBackupId: 'v1/archives/backupid',
|
setBackupId: 'v1/archives/backupid',
|
||||||
setBackupSignatureKey: 'v1/archives/keys',
|
setBackupSignatureKey: 'v1/archives/keys',
|
||||||
signed: 'v2/keys/signed',
|
signed: 'v2/keys/signed',
|
||||||
storageManifest: 'v1/storage/manifest',
|
|
||||||
storageModify: 'v1/storage/',
|
|
||||||
storageRead: 'v1/storage/read',
|
|
||||||
storageToken: 'v1/storage/auth',
|
storageToken: 'v1/storage/auth',
|
||||||
subscriptions: 'v1/subscription',
|
subscriptions: 'v1/subscription',
|
||||||
subscriptionConfiguration: 'v1/subscription/configuration',
|
subscriptionConfiguration: 'v1/subscription/configuration',
|
||||||
|
@ -734,6 +722,25 @@ const URL_CALLS = {
|
||||||
whoami: 'v1/accounts/whoami',
|
whoami: 'v1/accounts/whoami',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const STORAGE_CALLS = {
|
||||||
|
getGroupAvatarUpload: 'v1/groups/avatar/form',
|
||||||
|
groupLog: 'v2/groups/logs',
|
||||||
|
groupJoinedAtVersion: 'v1/groups/joined_at_version',
|
||||||
|
groups: 'v2/groups',
|
||||||
|
groupsViaLink: 'v1/groups/join/',
|
||||||
|
groupToken: 'v1/groups/token',
|
||||||
|
storageManifest: 'v1/storage/manifest',
|
||||||
|
storageModify: 'v1/storage/',
|
||||||
|
storageRead: 'v1/storage/read',
|
||||||
|
};
|
||||||
|
|
||||||
|
const RESOURCE_CALLS = {
|
||||||
|
getOnboardingStoryManifest:
|
||||||
|
'dynamic/desktop/stories/onboarding/manifest.json',
|
||||||
|
releaseNotesManifest: 'dynamic/release-notes/release-notes-v2.json',
|
||||||
|
releaseNotes: 'static/release-notes',
|
||||||
|
};
|
||||||
|
|
||||||
type InitializeOptionsType = {
|
type InitializeOptionsType = {
|
||||||
chatServiceUrl: string;
|
chatServiceUrl: string;
|
||||||
storageUrl: string;
|
storageUrl: string;
|
||||||
|
@ -757,38 +764,50 @@ export type MessageType = Readonly<{
|
||||||
content: string;
|
content: string;
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
type AjaxOptionsType<Type extends ResponseType, OutputShape = unknown> = {
|
type AjaxChatOptionsType = {
|
||||||
|
host: 'chatService';
|
||||||
|
call: keyof typeof CHAT_CALLS;
|
||||||
|
unauthenticated?: true;
|
||||||
|
accessKey?: string;
|
||||||
|
groupSendToken?: GroupSendToken;
|
||||||
|
isRegistration?: true;
|
||||||
|
};
|
||||||
|
|
||||||
|
type AjaxStorageOptionsType = {
|
||||||
|
host: 'storageService';
|
||||||
|
call: keyof typeof STORAGE_CALLS;
|
||||||
basicAuth?: string;
|
basicAuth?: string;
|
||||||
call: keyof typeof URL_CALLS;
|
disableSessionResumption?: true;
|
||||||
|
} & ({ username: string; password: string } | object);
|
||||||
|
|
||||||
|
type AjaxResourceOptionsType = {
|
||||||
|
host: 'resources';
|
||||||
|
call: keyof typeof RESOURCE_CALLS;
|
||||||
|
};
|
||||||
|
|
||||||
|
type AjaxResponseType =
|
||||||
|
| 'json'
|
||||||
|
| 'jsonwithdetails'
|
||||||
|
| 'bytes'
|
||||||
|
| 'byteswithdetails';
|
||||||
|
|
||||||
|
type AjaxOptionsType<Type extends AjaxResponseType, OutputShape = unknown> = (
|
||||||
|
| AjaxStorageOptionsType
|
||||||
|
| AjaxResourceOptionsType
|
||||||
|
| AjaxChatOptionsType
|
||||||
|
) & {
|
||||||
contentType?: string;
|
contentType?: string;
|
||||||
data?: Buffer | Uint8Array | string;
|
data?: Buffer | Uint8Array | string;
|
||||||
disableSessionResumption?: boolean;
|
|
||||||
headers?: HeaderListType;
|
headers?: HeaderListType;
|
||||||
host?: string;
|
|
||||||
httpType: HTTPCodeType;
|
httpType: HTTPCodeType;
|
||||||
jsonData?: unknown;
|
jsonData?: unknown;
|
||||||
password?: string;
|
|
||||||
redactUrl?: RedactUrl;
|
redactUrl?: RedactUrl;
|
||||||
responseType?: Type;
|
responseType?: Type;
|
||||||
timeout?: number;
|
timeout?: number;
|
||||||
urlParameters?: string;
|
urlParameters?: string;
|
||||||
username?: string;
|
|
||||||
validateResponse?: any;
|
validateResponse?: any;
|
||||||
isRegistration?: true;
|
|
||||||
abortSignal?: AbortSignal;
|
abortSignal?: AbortSignal;
|
||||||
} & (
|
} & (Type extends 'json' | 'jsonwithdetails'
|
||||||
| {
|
|
||||||
unauthenticated?: false;
|
|
||||||
accessKey?: string;
|
|
||||||
groupSendToken?: GroupSendToken;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
unauthenticated: true;
|
|
||||||
accessKey: undefined | string;
|
|
||||||
groupSendToken: undefined | GroupSendToken;
|
|
||||||
}
|
|
||||||
) &
|
|
||||||
(Type extends 'json' | 'jsonwithdetails'
|
|
||||||
? {
|
? {
|
||||||
zodSchema: Schema<unknown, OutputShape>;
|
zodSchema: Schema<unknown, OutputShape>;
|
||||||
}
|
}
|
||||||
|
@ -1922,6 +1941,7 @@ export function initialize({
|
||||||
|
|
||||||
async getAuth() {
|
async getAuth() {
|
||||||
return (await _ajax({
|
return (await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'directoryAuthV2',
|
call: 'directoryAuthV2',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
responseType: 'json',
|
responseType: 'json',
|
||||||
|
@ -2086,10 +2106,6 @@ export function initialize({
|
||||||
function _ajax(
|
function _ajax(
|
||||||
param: AjaxOptionsType<'byteswithdetails', never>
|
param: AjaxOptionsType<'byteswithdetails', never>
|
||||||
): Promise<BytesWithDetailsType>;
|
): Promise<BytesWithDetailsType>;
|
||||||
function _ajax(param: AjaxOptionsType<'stream', never>): Promise<Readable>;
|
|
||||||
function _ajax(
|
|
||||||
param: AjaxOptionsType<'streamwithdetails', never>
|
|
||||||
): Promise<StreamWithDetailsType>;
|
|
||||||
function _ajax<OutputShape>(
|
function _ajax<OutputShape>(
|
||||||
param: AjaxOptionsType<'json', OutputShape>
|
param: AjaxOptionsType<'json', OutputShape>
|
||||||
): Promise<OutputShape>;
|
): Promise<OutputShape>;
|
||||||
|
@ -2097,14 +2113,13 @@ export function initialize({
|
||||||
param: AjaxOptionsType<'jsonwithdetails', OutputShape>
|
param: AjaxOptionsType<'jsonwithdetails', OutputShape>
|
||||||
): Promise<JSONWithDetailsType<OutputShape>>;
|
): Promise<JSONWithDetailsType<OutputShape>>;
|
||||||
|
|
||||||
async function _ajax<Type extends ResponseType, OutputShape>(
|
async function _ajax<Type extends AjaxResponseType, OutputShape>(
|
||||||
param: AjaxOptionsType<Type, OutputShape>
|
param: AjaxOptionsType<Type, OutputShape>
|
||||||
): Promise<unknown> {
|
): Promise<unknown> {
|
||||||
if (
|
const continueDuringRegistration =
|
||||||
!param.unauthenticated &&
|
param.host === 'chatService' &&
|
||||||
activeRegistration &&
|
(param.unauthenticated || param.isRegistration);
|
||||||
!param.isRegistration
|
if (activeRegistration && !continueDuringRegistration) {
|
||||||
) {
|
|
||||||
log.info('WebAPI: request blocked by active registration');
|
log.info('WebAPI: request blocked by active registration');
|
||||||
const start = Date.now();
|
const start = Date.now();
|
||||||
await activeRegistration.promise;
|
await activeRegistration.promise;
|
||||||
|
@ -2116,13 +2131,26 @@ export function initialize({
|
||||||
param.urlParameters = '';
|
param.urlParameters = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// When host is not provided, assume chat service
|
let host: string;
|
||||||
const host = param.host || chatServiceUrl;
|
let path: string;
|
||||||
const useWebSocketForEndpoint = host === chatServiceUrl;
|
switch (param.host) {
|
||||||
|
case 'chatService':
|
||||||
|
[host, path] = [chatServiceUrl, CHAT_CALLS[param.call]];
|
||||||
|
break;
|
||||||
|
case 'resources':
|
||||||
|
[host, path] = [resourcesUrl, RESOURCE_CALLS[param.call]];
|
||||||
|
break;
|
||||||
|
case 'storageService':
|
||||||
|
[host, path] = [storageUrl, STORAGE_CALLS[param.call]];
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw missingCaseError(param);
|
||||||
|
}
|
||||||
|
const useWebSocketForEndpoint = param.host === 'chatService';
|
||||||
|
|
||||||
const outerParams: PromiseAjaxOptionsType<Type, OutputShape> = {
|
const outerParams: PromiseAjaxOptionsType<Type, OutputShape> = {
|
||||||
socketManager: useWebSocketForEndpoint ? socketManager : undefined,
|
socketManager: useWebSocketForEndpoint ? socketManager : undefined,
|
||||||
basicAuth: param.basicAuth,
|
basicAuth: 'basicAuth' in param ? param.basicAuth : undefined,
|
||||||
certificateAuthority,
|
certificateAuthority,
|
||||||
chatServiceUrl,
|
chatServiceUrl,
|
||||||
contentType: param.contentType || 'application/json; charset=utf-8',
|
contentType: param.contentType || 'application/json; charset=utf-8',
|
||||||
|
@ -2131,20 +2159,22 @@ export function initialize({
|
||||||
(param.jsonData ? JSON.stringify(param.jsonData) : undefined),
|
(param.jsonData ? JSON.stringify(param.jsonData) : undefined),
|
||||||
headers: param.headers,
|
headers: param.headers,
|
||||||
host,
|
host,
|
||||||
password: param.password ?? password,
|
password: 'password' in param ? param.password : password,
|
||||||
path: URL_CALLS[param.call] + param.urlParameters,
|
path: path + param.urlParameters,
|
||||||
proxyUrl,
|
proxyUrl,
|
||||||
responseType: param.responseType ?? ('raw' as Type),
|
responseType: param.responseType ?? ('raw' as Type),
|
||||||
timeout: param.timeout,
|
timeout: param.timeout,
|
||||||
type: param.httpType,
|
type: param.httpType,
|
||||||
user: param.username ?? username,
|
user: 'username' in param ? param.username : username,
|
||||||
redactUrl: param.redactUrl,
|
redactUrl: param.redactUrl,
|
||||||
storageUrl,
|
storageUrl,
|
||||||
validateResponse: param.validateResponse,
|
validateResponse: param.validateResponse,
|
||||||
version,
|
version,
|
||||||
unauthenticated: param.unauthenticated,
|
unauthenticated:
|
||||||
accessKey: param.accessKey,
|
'unauthenticated' in param ? param.unauthenticated : undefined,
|
||||||
groupSendToken: param.groupSendToken,
|
accessKey: 'accessKey' in param ? param.accessKey : undefined,
|
||||||
|
groupSendToken:
|
||||||
|
'groupSendToken' in param ? param.groupSendToken : undefined,
|
||||||
abortSignal: param.abortSignal,
|
abortSignal: param.abortSignal,
|
||||||
zodSchema: param.zodSchema,
|
zodSchema: param.zodSchema,
|
||||||
};
|
};
|
||||||
|
@ -2193,6 +2223,7 @@ export function initialize({
|
||||||
|
|
||||||
async function whoami(): Promise<WhoamiResultType> {
|
async function whoami(): Promise<WhoamiResultType> {
|
||||||
return _ajax({
|
return _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'whoami',
|
call: 'whoami',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
responseType: 'json',
|
responseType: 'json',
|
||||||
|
@ -2202,6 +2233,7 @@ export function initialize({
|
||||||
|
|
||||||
async function sendChallengeResponse(challengeResponse: ChallengeType) {
|
async function sendChallengeResponse(challengeResponse: ChallengeType) {
|
||||||
await _ajax({
|
await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'challenge',
|
call: 'challenge',
|
||||||
httpType: 'PUT',
|
httpType: 'PUT',
|
||||||
jsonData: challengeResponse,
|
jsonData: challengeResponse,
|
||||||
|
@ -2273,6 +2305,7 @@ export function initialize({
|
||||||
|
|
||||||
async function getConfig() {
|
async function getConfig() {
|
||||||
const { data, response } = await _ajax({
|
const { data, response } = await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'config',
|
call: 'config',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
responseType: 'jsonwithdetails',
|
responseType: 'jsonwithdetails',
|
||||||
|
@ -2300,6 +2333,7 @@ export function initialize({
|
||||||
|
|
||||||
async function getSenderCertificate(omitE164?: boolean) {
|
async function getSenderCertificate(omitE164?: boolean) {
|
||||||
return (await _ajax({
|
return (await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'deliveryCert',
|
call: 'deliveryCert',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
responseType: 'json',
|
responseType: 'json',
|
||||||
|
@ -2312,6 +2346,7 @@ export function initialize({
|
||||||
|
|
||||||
async function getStorageCredentials(): Promise<StorageServiceCredentials> {
|
async function getStorageCredentials(): Promise<StorageServiceCredentials> {
|
||||||
return _ajax({
|
return _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'storageToken',
|
call: 'storageToken',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
responseType: 'json',
|
responseType: 'json',
|
||||||
|
@ -2322,7 +2357,7 @@ export function initialize({
|
||||||
async function getOnboardingStoryManifest() {
|
async function getOnboardingStoryManifest() {
|
||||||
const res = await _ajax({
|
const res = await _ajax({
|
||||||
call: 'getOnboardingStoryManifest',
|
call: 'getOnboardingStoryManifest',
|
||||||
host: resourcesUrl,
|
host: 'resources',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
responseType: 'json',
|
responseType: 'json',
|
||||||
// TODO DESKTOP-8719
|
// TODO DESKTOP-8719
|
||||||
|
@ -2344,7 +2379,7 @@ export function initialize({
|
||||||
}): Promise<string | undefined> {
|
}): Promise<string | undefined> {
|
||||||
const { response } = await _ajax({
|
const { response } = await _ajax({
|
||||||
call: 'releaseNotes',
|
call: 'releaseNotes',
|
||||||
host: resourcesUrl,
|
host: 'resources',
|
||||||
httpType: 'HEAD',
|
httpType: 'HEAD',
|
||||||
urlParameters: `/${uuid}/${locale}.json`,
|
urlParameters: `/${uuid}/${locale}.json`,
|
||||||
responseType: 'byteswithdetails',
|
responseType: 'byteswithdetails',
|
||||||
|
@ -2367,7 +2402,7 @@ export function initialize({
|
||||||
}): Promise<ReleaseNoteResponseType> {
|
}): Promise<ReleaseNoteResponseType> {
|
||||||
return _ajax({
|
return _ajax({
|
||||||
call: 'releaseNotes',
|
call: 'releaseNotes',
|
||||||
host: resourcesUrl,
|
host: 'resources',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
responseType: 'json',
|
responseType: 'json',
|
||||||
urlParameters: `/${uuid}/${locale}.json`,
|
urlParameters: `/${uuid}/${locale}.json`,
|
||||||
|
@ -2378,7 +2413,7 @@ export function initialize({
|
||||||
async function getReleaseNotesManifest(): Promise<ReleaseNotesManifestResponseType> {
|
async function getReleaseNotesManifest(): Promise<ReleaseNotesManifestResponseType> {
|
||||||
return _ajax({
|
return _ajax({
|
||||||
call: 'releaseNotesManifest',
|
call: 'releaseNotesManifest',
|
||||||
host: resourcesUrl,
|
host: 'resources',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
responseType: 'json',
|
responseType: 'json',
|
||||||
zodSchema: releaseNotesManifestSchema,
|
zodSchema: releaseNotesManifestSchema,
|
||||||
|
@ -2388,7 +2423,7 @@ export function initialize({
|
||||||
async function getReleaseNotesManifestHash(): Promise<string | undefined> {
|
async function getReleaseNotesManifestHash(): Promise<string | undefined> {
|
||||||
const { response } = await _ajax({
|
const { response } = await _ajax({
|
||||||
call: 'releaseNotesManifest',
|
call: 'releaseNotesManifest',
|
||||||
host: resourcesUrl,
|
host: 'resources',
|
||||||
httpType: 'HEAD',
|
httpType: 'HEAD',
|
||||||
responseType: 'byteswithdetails',
|
responseType: 'byteswithdetails',
|
||||||
});
|
});
|
||||||
|
@ -2432,7 +2467,7 @@ export function initialize({
|
||||||
const { data, response } = await _ajax({
|
const { data, response } = await _ajax({
|
||||||
call: 'storageManifest',
|
call: 'storageManifest',
|
||||||
contentType: 'application/x-protobuf',
|
contentType: 'application/x-protobuf',
|
||||||
host: storageUrl,
|
host: 'storageService',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
responseType: 'byteswithdetails',
|
responseType: 'byteswithdetails',
|
||||||
urlParameters: greaterThanVersion
|
urlParameters: greaterThanVersion
|
||||||
|
@ -2464,7 +2499,7 @@ export function initialize({
|
||||||
call: 'storageRead',
|
call: 'storageRead',
|
||||||
contentType: 'application/x-protobuf',
|
contentType: 'application/x-protobuf',
|
||||||
data,
|
data,
|
||||||
host: storageUrl,
|
host: 'storageService',
|
||||||
httpType: 'PUT',
|
httpType: 'PUT',
|
||||||
responseType: 'bytes',
|
responseType: 'bytes',
|
||||||
...credentials,
|
...credentials,
|
||||||
|
@ -2481,7 +2516,7 @@ export function initialize({
|
||||||
call: 'storageModify',
|
call: 'storageModify',
|
||||||
contentType: 'application/x-protobuf',
|
contentType: 'application/x-protobuf',
|
||||||
data,
|
data,
|
||||||
host: storageUrl,
|
host: 'storageService',
|
||||||
httpType: 'PUT',
|
httpType: 'PUT',
|
||||||
// If we run into a conflict, the current manifest is returned -
|
// If we run into a conflict, the current manifest is returned -
|
||||||
// it will will be an Uint8Array at the response key on the Error
|
// it will will be an Uint8Array at the response key on the Error
|
||||||
|
@ -2492,6 +2527,7 @@ export function initialize({
|
||||||
|
|
||||||
async function registerCapabilities(capabilities: CapabilitiesUploadType) {
|
async function registerCapabilities(capabilities: CapabilitiesUploadType) {
|
||||||
await _ajax({
|
await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'registerCapabilities',
|
call: 'registerCapabilities',
|
||||||
httpType: 'PUT',
|
httpType: 'PUT',
|
||||||
jsonData: capabilities,
|
jsonData: capabilities,
|
||||||
|
@ -2502,6 +2538,7 @@ export function initialize({
|
||||||
elements: VerifyServiceIdRequestType
|
elements: VerifyServiceIdRequestType
|
||||||
) {
|
) {
|
||||||
const res = await _ajax({
|
const res = await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
data: JSON.stringify({ elements }),
|
data: JSON.stringify({ elements }),
|
||||||
call: 'batchIdentityCheck',
|
call: 'batchIdentityCheck',
|
||||||
httpType: 'POST',
|
httpType: 'POST',
|
||||||
|
@ -2557,6 +2594,7 @@ export function initialize({
|
||||||
options;
|
options;
|
||||||
|
|
||||||
return (await _ajax({
|
return (await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'profile',
|
call: 'profile',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
urlParameters: getProfileUrl(serviceId, options),
|
urlParameters: getProfileUrl(serviceId, options),
|
||||||
|
@ -2594,6 +2632,7 @@ export function initialize({
|
||||||
|
|
||||||
// eslint-disable-next-line no-await-in-loop
|
// eslint-disable-next-line no-await-in-loop
|
||||||
const { data, response } = await _ajax({
|
const { data, response } = await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'transferArchive',
|
call: 'transferArchive',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
responseType: 'jsonwithdetails',
|
responseType: 'jsonwithdetails',
|
||||||
|
@ -2628,6 +2667,7 @@ export function initialize({
|
||||||
}: GetAccountForUsernameOptionsType) {
|
}: GetAccountForUsernameOptionsType) {
|
||||||
const hashBase64 = toWebSafeBase64(Bytes.toBase64(hash));
|
const hashBase64 = toWebSafeBase64(Bytes.toBase64(hash));
|
||||||
return _ajax({
|
return _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'username',
|
call: 'username',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
urlParameters: `/${hashBase64}`,
|
urlParameters: `/${hashBase64}`,
|
||||||
|
@ -2644,6 +2684,7 @@ export function initialize({
|
||||||
jsonData: ProfileRequestDataType
|
jsonData: ProfileRequestDataType
|
||||||
): Promise<UploadAvatarHeadersOrOtherType> {
|
): Promise<UploadAvatarHeadersOrOtherType> {
|
||||||
return _ajax({
|
return _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'profile',
|
call: 'profile',
|
||||||
httpType: 'PUT',
|
httpType: 'PUT',
|
||||||
responseType: 'json',
|
responseType: 'json',
|
||||||
|
@ -2674,6 +2715,7 @@ export function initialize({
|
||||||
}
|
}
|
||||||
|
|
||||||
return (await _ajax({
|
return (await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'profile',
|
call: 'profile',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
urlParameters: getProfileUrl(serviceId, options),
|
urlParameters: getProfileUrl(serviceId, options),
|
||||||
|
@ -2748,6 +2790,7 @@ export function initialize({
|
||||||
userLanguages: ReadonlyArray<string>
|
userLanguages: ReadonlyArray<string>
|
||||||
): Promise<unknown> {
|
): Promise<unknown> {
|
||||||
return _ajax({
|
return _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'subscriptionConfiguration',
|
call: 'subscriptionConfiguration',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -2779,6 +2822,7 @@ export function initialize({
|
||||||
|
|
||||||
async function deleteUsername(abortSignal?: AbortSignal) {
|
async function deleteUsername(abortSignal?: AbortSignal) {
|
||||||
await _ajax({
|
await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'username',
|
call: 'username',
|
||||||
httpType: 'DELETE',
|
httpType: 'DELETE',
|
||||||
abortSignal,
|
abortSignal,
|
||||||
|
@ -2790,6 +2834,7 @@ export function initialize({
|
||||||
abortSignal,
|
abortSignal,
|
||||||
}: ReserveUsernameOptionsType) {
|
}: ReserveUsernameOptionsType) {
|
||||||
return _ajax({
|
return _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'reserveUsername',
|
call: 'reserveUsername',
|
||||||
httpType: 'PUT',
|
httpType: 'PUT',
|
||||||
jsonData: {
|
jsonData: {
|
||||||
|
@ -2809,6 +2854,7 @@ export function initialize({
|
||||||
abortSignal,
|
abortSignal,
|
||||||
}: ConfirmUsernameOptionsType): Promise<ConfirmUsernameResultType> {
|
}: ConfirmUsernameOptionsType): Promise<ConfirmUsernameResultType> {
|
||||||
return _ajax({
|
return _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'confirmUsername',
|
call: 'confirmUsername',
|
||||||
httpType: 'PUT',
|
httpType: 'PUT',
|
||||||
jsonData: {
|
jsonData: {
|
||||||
|
@ -2827,6 +2873,7 @@ export function initialize({
|
||||||
keepLinkHandle,
|
keepLinkHandle,
|
||||||
}: ReplaceUsernameLinkOptionsType): Promise<ReplaceUsernameLinkResultType> {
|
}: ReplaceUsernameLinkOptionsType): Promise<ReplaceUsernameLinkResultType> {
|
||||||
return _ajax({
|
return _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'usernameLink',
|
call: 'usernameLink',
|
||||||
httpType: 'PUT',
|
httpType: 'PUT',
|
||||||
responseType: 'json',
|
responseType: 'json',
|
||||||
|
@ -2842,6 +2889,7 @@ export function initialize({
|
||||||
|
|
||||||
async function deleteUsernameLink(): Promise<void> {
|
async function deleteUsernameLink(): Promise<void> {
|
||||||
await _ajax({
|
await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'usernameLink',
|
call: 'usernameLink',
|
||||||
httpType: 'DELETE',
|
httpType: 'DELETE',
|
||||||
});
|
});
|
||||||
|
@ -2851,6 +2899,7 @@ export function initialize({
|
||||||
serverId: string
|
serverId: string
|
||||||
): Promise<ResolveUsernameLinkResultType> {
|
): Promise<ResolveUsernameLinkResultType> {
|
||||||
return _ajax({
|
return _ajax({
|
||||||
|
host: 'chatService',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
call: 'usernameLink',
|
call: 'usernameLink',
|
||||||
urlParameters: `/${encodeURIComponent(serverId)}`,
|
urlParameters: `/${encodeURIComponent(serverId)}`,
|
||||||
|
@ -2870,6 +2919,7 @@ export function initialize({
|
||||||
const jsonData = { token };
|
const jsonData = { token };
|
||||||
|
|
||||||
await _ajax({
|
await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'reportMessage',
|
call: 'reportMessage',
|
||||||
httpType: 'POST',
|
httpType: 'POST',
|
||||||
urlParameters: urlPathFromComponents([senderAci, serverGuid]),
|
urlParameters: urlPathFromComponents([senderAci, serverGuid]),
|
||||||
|
@ -2910,6 +2960,7 @@ export function initialize({
|
||||||
async function checkAccountExistence(serviceId: ServiceIdString) {
|
async function checkAccountExistence(serviceId: ServiceIdString) {
|
||||||
try {
|
try {
|
||||||
await _ajax({
|
await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
httpType: 'HEAD',
|
httpType: 'HEAD',
|
||||||
call: 'accountExistence',
|
call: 'accountExistence',
|
||||||
urlParameters: `/${serviceId}`,
|
urlParameters: `/${serviceId}`,
|
||||||
|
@ -3094,6 +3145,7 @@ export function initialize({
|
||||||
},
|
},
|
||||||
async () => {
|
async () => {
|
||||||
const response = await _ajax({
|
const response = await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
isRegistration: true,
|
isRegistration: true,
|
||||||
call: 'linkDevice',
|
call: 'linkDevice',
|
||||||
httpType: 'PUT',
|
httpType: 'PUT',
|
||||||
|
@ -3114,6 +3166,7 @@ export function initialize({
|
||||||
|
|
||||||
const [, deviceId] = username.split('.');
|
const [, deviceId] = username.split('.');
|
||||||
await _ajax({
|
await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'devices',
|
call: 'devices',
|
||||||
httpType: 'DELETE',
|
httpType: 'DELETE',
|
||||||
urlParameters: `/${deviceId}`,
|
urlParameters: `/${deviceId}`,
|
||||||
|
@ -3122,6 +3175,7 @@ export function initialize({
|
||||||
|
|
||||||
async function getDevices() {
|
async function getDevices() {
|
||||||
return _ajax({
|
return _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'devices',
|
call: 'devices',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
responseType: 'json',
|
responseType: 'json',
|
||||||
|
@ -3131,6 +3185,7 @@ export function initialize({
|
||||||
|
|
||||||
async function updateDeviceName(deviceName: string) {
|
async function updateDeviceName(deviceName: string) {
|
||||||
await _ajax({
|
await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'updateDeviceName',
|
call: 'updateDeviceName',
|
||||||
httpType: 'PUT',
|
httpType: 'PUT',
|
||||||
jsonData: {
|
jsonData: {
|
||||||
|
@ -3141,6 +3196,7 @@ export function initialize({
|
||||||
|
|
||||||
async function getIceServers() {
|
async function getIceServers() {
|
||||||
return (await _ajax({
|
return (await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'getIceServers',
|
call: 'getIceServers',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
responseType: 'json',
|
responseType: 'json',
|
||||||
|
@ -3210,6 +3266,7 @@ export function initialize({
|
||||||
};
|
};
|
||||||
|
|
||||||
await _ajax({
|
await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
isRegistration: true,
|
isRegistration: true,
|
||||||
call: 'keys',
|
call: 'keys',
|
||||||
urlParameters: `?${serviceIdKindToQuery(serviceIdKind)}`,
|
urlParameters: `?${serviceIdKindToQuery(serviceIdKind)}`,
|
||||||
|
@ -3220,6 +3277,7 @@ export function initialize({
|
||||||
|
|
||||||
async function getBackupInfo(headers: BackupPresentationHeadersType) {
|
async function getBackupInfo(headers: BackupPresentationHeadersType) {
|
||||||
return _ajax({
|
return _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'backup',
|
call: 'backup',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
unauthenticated: true,
|
unauthenticated: true,
|
||||||
|
@ -3295,6 +3353,7 @@ export function initialize({
|
||||||
headers: BackupPresentationHeadersType
|
headers: BackupPresentationHeadersType
|
||||||
): Promise<AttachmentUploadFormResponseType> {
|
): Promise<AttachmentUploadFormResponseType> {
|
||||||
return _ajax({
|
return _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'getBackupMediaUploadForm',
|
call: 'getBackupMediaUploadForm',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
unauthenticated: true,
|
unauthenticated: true,
|
||||||
|
@ -3348,6 +3407,7 @@ export function initialize({
|
||||||
headers: BackupPresentationHeadersType
|
headers: BackupPresentationHeadersType
|
||||||
): Promise<AttachmentUploadFormResponseType> {
|
): Promise<AttachmentUploadFormResponseType> {
|
||||||
return _ajax({
|
return _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'getBackupUploadForm',
|
call: 'getBackupUploadForm',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
unauthenticated: true,
|
unauthenticated: true,
|
||||||
|
@ -3361,6 +3421,7 @@ export function initialize({
|
||||||
|
|
||||||
async function refreshBackup(headers: BackupPresentationHeadersType) {
|
async function refreshBackup(headers: BackupPresentationHeadersType) {
|
||||||
await _ajax({
|
await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'backup',
|
call: 'backup',
|
||||||
httpType: 'POST',
|
httpType: 'POST',
|
||||||
unauthenticated: true,
|
unauthenticated: true,
|
||||||
|
@ -3377,6 +3438,7 @@ export function initialize({
|
||||||
const startDayInSeconds = startDayInMs / SECOND;
|
const startDayInSeconds = startDayInMs / SECOND;
|
||||||
const endDayInSeconds = endDayInMs / SECOND;
|
const endDayInSeconds = endDayInMs / SECOND;
|
||||||
return _ajax({
|
return _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'getBackupCredentials',
|
call: 'getBackupCredentials',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
urlParameters:
|
urlParameters:
|
||||||
|
@ -3392,6 +3454,7 @@ export function initialize({
|
||||||
cdn,
|
cdn,
|
||||||
}: GetBackupCDNCredentialsOptionsType) {
|
}: GetBackupCDNCredentialsOptionsType) {
|
||||||
return _ajax({
|
return _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'getBackupCDNCredentials',
|
call: 'getBackupCDNCredentials',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
unauthenticated: true,
|
unauthenticated: true,
|
||||||
|
@ -3409,6 +3472,7 @@ export function initialize({
|
||||||
mediaBackupAuthCredentialRequest,
|
mediaBackupAuthCredentialRequest,
|
||||||
}: SetBackupIdOptionsType) {
|
}: SetBackupIdOptionsType) {
|
||||||
await _ajax({
|
await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'setBackupId',
|
call: 'setBackupId',
|
||||||
httpType: 'PUT',
|
httpType: 'PUT',
|
||||||
jsonData: {
|
jsonData: {
|
||||||
|
@ -3427,6 +3491,7 @@ export function initialize({
|
||||||
backupIdPublicKey,
|
backupIdPublicKey,
|
||||||
}: SetBackupSignatureKeyOptionsType) {
|
}: SetBackupSignatureKeyOptionsType) {
|
||||||
await _ajax({
|
await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'setBackupSignatureKey',
|
call: 'setBackupSignatureKey',
|
||||||
httpType: 'PUT',
|
httpType: 'PUT',
|
||||||
unauthenticated: true,
|
unauthenticated: true,
|
||||||
|
@ -3444,6 +3509,7 @@ export function initialize({
|
||||||
items,
|
items,
|
||||||
}: BackupMediaBatchOptionsType) {
|
}: BackupMediaBatchOptionsType) {
|
||||||
return _ajax({
|
return _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'backupMediaBatch',
|
call: 'backupMediaBatch',
|
||||||
httpType: 'PUT',
|
httpType: 'PUT',
|
||||||
unauthenticated: true,
|
unauthenticated: true,
|
||||||
|
@ -3482,6 +3548,7 @@ export function initialize({
|
||||||
mediaToDelete,
|
mediaToDelete,
|
||||||
}: BackupDeleteMediaOptionsType) {
|
}: BackupDeleteMediaOptionsType) {
|
||||||
await _ajax({
|
await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'backupMediaDelete',
|
call: 'backupMediaDelete',
|
||||||
httpType: 'POST',
|
httpType: 'POST',
|
||||||
unauthenticated: true,
|
unauthenticated: true,
|
||||||
|
@ -3512,6 +3579,7 @@ export function initialize({
|
||||||
params.push(`limit=${limit}`);
|
params.push(`limit=${limit}`);
|
||||||
|
|
||||||
return _ajax({
|
return _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'backupMedia',
|
call: 'backupMedia',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
unauthenticated: true,
|
unauthenticated: true,
|
||||||
|
@ -3528,6 +3596,7 @@ export function initialize({
|
||||||
requestBase64: string
|
requestBase64: string
|
||||||
): Promise<CallLinkCreateAuthResponseType> {
|
): Promise<CallLinkCreateAuthResponseType> {
|
||||||
return _ajax({
|
return _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'callLinkCreateAuth',
|
call: 'callLinkCreateAuth',
|
||||||
httpType: 'POST',
|
httpType: 'POST',
|
||||||
responseType: 'json',
|
responseType: 'json',
|
||||||
|
@ -3538,6 +3607,7 @@ export function initialize({
|
||||||
|
|
||||||
async function setPhoneNumberDiscoverability(newValue: boolean) {
|
async function setPhoneNumberDiscoverability(newValue: boolean) {
|
||||||
await _ajax({
|
await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'phoneNumberDiscoverability',
|
call: 'phoneNumberDiscoverability',
|
||||||
httpType: 'PUT',
|
httpType: 'PUT',
|
||||||
jsonData: {
|
jsonData: {
|
||||||
|
@ -3550,6 +3620,7 @@ export function initialize({
|
||||||
serviceIdKind: ServiceIdKind
|
serviceIdKind: ServiceIdKind
|
||||||
): Promise<z.infer<typeof ServerKeyCountSchema>> {
|
): Promise<z.infer<typeof ServerKeyCountSchema>> {
|
||||||
return _ajax({
|
return _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'keys',
|
call: 'keys',
|
||||||
urlParameters: `?${serviceIdKindToQuery(serviceIdKind)}`,
|
urlParameters: `?${serviceIdKindToQuery(serviceIdKind)}`,
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
|
@ -3625,6 +3696,7 @@ export function initialize({
|
||||||
deviceId?: number
|
deviceId?: number
|
||||||
) {
|
) {
|
||||||
const keys = await _ajax({
|
const keys = await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'keys',
|
call: 'keys',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
urlParameters: `/${serviceId}/${deviceId || '*'}`,
|
urlParameters: `/${serviceId}/${deviceId || '*'}`,
|
||||||
|
@ -3643,6 +3715,7 @@ export function initialize({
|
||||||
}: { accessKey?: string; groupSendToken?: GroupSendToken } = {}
|
}: { accessKey?: string; groupSendToken?: GroupSendToken } = {}
|
||||||
) {
|
) {
|
||||||
const keys = await _ajax({
|
const keys = await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'keys',
|
call: 'keys',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
urlParameters: `/${serviceId}/${deviceId || '*'}`,
|
urlParameters: `/${serviceId}/${deviceId || '*'}`,
|
||||||
|
@ -3681,6 +3754,7 @@ export function initialize({
|
||||||
};
|
};
|
||||||
|
|
||||||
await _ajax({
|
await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'messages',
|
call: 'messages',
|
||||||
httpType: 'PUT',
|
httpType: 'PUT',
|
||||||
urlParameters: `/${destination}?story=${booleanToString(story)}`,
|
urlParameters: `/${destination}?story=${booleanToString(story)}`,
|
||||||
|
@ -3712,6 +3786,7 @@ export function initialize({
|
||||||
};
|
};
|
||||||
|
|
||||||
await _ajax({
|
await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'messages',
|
call: 'messages',
|
||||||
httpType: 'PUT',
|
httpType: 'PUT',
|
||||||
urlParameters: `/${destination}?story=${booleanToString(story)}`,
|
urlParameters: `/${destination}?story=${booleanToString(story)}`,
|
||||||
|
@ -3746,6 +3821,7 @@ export function initialize({
|
||||||
const storyParam = `&story=${booleanToString(story)}`;
|
const storyParam = `&story=${booleanToString(story)}`;
|
||||||
|
|
||||||
const response = await _ajax({
|
const response = await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'multiRecipient',
|
call: 'multiRecipient',
|
||||||
httpType: 'PUT',
|
httpType: 'PUT',
|
||||||
contentType: 'application/vnd.signal-messenger.mrm',
|
contentType: 'application/vnd.signal-messenger.mrm',
|
||||||
|
@ -3891,6 +3967,7 @@ export function initialize({
|
||||||
) {
|
) {
|
||||||
// Get manifest and sticker upload parameters
|
// Get manifest and sticker upload parameters
|
||||||
const { packId, manifest, stickers } = await _ajax({
|
const { packId, manifest, stickers } = await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'getStickerPackUpload',
|
call: 'getStickerPackUpload',
|
||||||
responseType: 'json',
|
responseType: 'json',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
|
@ -4140,6 +4217,7 @@ export function initialize({
|
||||||
|
|
||||||
async function getAttachmentUploadForm(): Promise<AttachmentUploadFormResponseType> {
|
async function getAttachmentUploadForm(): Promise<AttachmentUploadFormResponseType> {
|
||||||
return _ajax({
|
return _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'attachmentUploadForm',
|
call: 'attachmentUploadForm',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
responseType: 'json',
|
responseType: 'json',
|
||||||
|
@ -4365,6 +4443,7 @@ export function initialize({
|
||||||
const endDayInSeconds = endDayInMs / SECOND;
|
const endDayInSeconds = endDayInMs / SECOND;
|
||||||
|
|
||||||
const response = await _ajax({
|
const response = await _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'getGroupCredentials',
|
call: 'getGroupCredentials',
|
||||||
urlParameters:
|
urlParameters:
|
||||||
`?redemptionStartSeconds=${startDayInSeconds}&` +
|
`?redemptionStartSeconds=${startDayInSeconds}&` +
|
||||||
|
@ -4393,7 +4472,7 @@ export function initialize({
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
contentType: 'application/x-protobuf',
|
contentType: 'application/x-protobuf',
|
||||||
responseType: 'bytes',
|
responseType: 'bytes',
|
||||||
host: storageUrl,
|
host: 'storageService',
|
||||||
disableSessionResumption: true,
|
disableSessionResumption: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -4465,7 +4544,7 @@ export function initialize({
|
||||||
call: 'getGroupAvatarUpload',
|
call: 'getGroupAvatarUpload',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
responseType: 'bytes',
|
responseType: 'bytes',
|
||||||
host: storageUrl,
|
host: 'storageService',
|
||||||
disableSessionResumption: true,
|
disableSessionResumption: true,
|
||||||
});
|
});
|
||||||
const attributes = Proto.AvatarUploadAttributes.decode(response);
|
const attributes = Proto.AvatarUploadAttributes.decode(response);
|
||||||
|
@ -4515,7 +4594,7 @@ export function initialize({
|
||||||
call: 'groups',
|
call: 'groups',
|
||||||
contentType: 'application/x-protobuf',
|
contentType: 'application/x-protobuf',
|
||||||
data,
|
data,
|
||||||
host: storageUrl,
|
host: 'storageService',
|
||||||
disableSessionResumption: true,
|
disableSessionResumption: true,
|
||||||
httpType: 'PUT',
|
httpType: 'PUT',
|
||||||
responseType: 'bytes',
|
responseType: 'bytes',
|
||||||
|
@ -4536,7 +4615,7 @@ export function initialize({
|
||||||
basicAuth,
|
basicAuth,
|
||||||
call: 'groups',
|
call: 'groups',
|
||||||
contentType: 'application/x-protobuf',
|
contentType: 'application/x-protobuf',
|
||||||
host: storageUrl,
|
host: 'storageService',
|
||||||
disableSessionResumption: true,
|
disableSessionResumption: true,
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
responseType: 'bytes',
|
responseType: 'bytes',
|
||||||
|
@ -4561,7 +4640,7 @@ export function initialize({
|
||||||
basicAuth,
|
basicAuth,
|
||||||
call: 'groupsViaLink',
|
call: 'groupsViaLink',
|
||||||
contentType: 'application/x-protobuf',
|
contentType: 'application/x-protobuf',
|
||||||
host: storageUrl,
|
host: 'storageService',
|
||||||
disableSessionResumption: true,
|
disableSessionResumption: true,
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
responseType: 'bytes',
|
responseType: 'bytes',
|
||||||
|
@ -4593,7 +4672,7 @@ export function initialize({
|
||||||
call: 'groups',
|
call: 'groups',
|
||||||
contentType: 'application/x-protobuf',
|
contentType: 'application/x-protobuf',
|
||||||
data,
|
data,
|
||||||
host: storageUrl,
|
host: 'storageService',
|
||||||
disableSessionResumption: true,
|
disableSessionResumption: true,
|
||||||
httpType: 'PATCH',
|
httpType: 'PATCH',
|
||||||
responseType: 'bytes',
|
responseType: 'bytes',
|
||||||
|
@ -4631,7 +4710,7 @@ export function initialize({
|
||||||
basicAuth,
|
basicAuth,
|
||||||
call: 'groupJoinedAtVersion',
|
call: 'groupJoinedAtVersion',
|
||||||
contentType: 'application/x-protobuf',
|
contentType: 'application/x-protobuf',
|
||||||
host: storageUrl,
|
host: 'storageService',
|
||||||
disableSessionResumption: true,
|
disableSessionResumption: true,
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
responseType: 'byteswithdetails',
|
responseType: 'byteswithdetails',
|
||||||
|
@ -4652,7 +4731,7 @@ export function initialize({
|
||||||
basicAuth,
|
basicAuth,
|
||||||
call: 'groupLog',
|
call: 'groupLog',
|
||||||
contentType: 'application/x-protobuf',
|
contentType: 'application/x-protobuf',
|
||||||
host: storageUrl,
|
host: 'storageService',
|
||||||
disableSessionResumption: true,
|
disableSessionResumption: true,
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
responseType: 'byteswithdetails',
|
responseType: 'byteswithdetails',
|
||||||
|
@ -4706,6 +4785,7 @@ export function initialize({
|
||||||
): Promise<SubscriptionResponseType> {
|
): Promise<SubscriptionResponseType> {
|
||||||
const formattedId = toWebSafeBase64(Bytes.toBase64(subscriberId));
|
const formattedId = toWebSafeBase64(Bytes.toBase64(subscriberId));
|
||||||
return _ajax({
|
return _ajax({
|
||||||
|
host: 'chatService',
|
||||||
call: 'subscriptions',
|
call: 'subscriptions',
|
||||||
httpType: 'GET',
|
httpType: 'GET',
|
||||||
urlParameters: `/${formattedId}`,
|
urlParameters: `/${formattedId}`,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue