Worker build updates

This commit is contained in:
Darren Clarke 2024-06-28 07:49:39 +02:00
parent 45c80ca98a
commit 0cf1c3b8fd
64 changed files with 4216 additions and 3450 deletions

View file

@ -5,259 +5,322 @@
* This is the Signal Cli REST API documentation.
*
* The version of the OpenAPI document: 1.0
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import * as runtime from "../runtime.js";
import type {
ApiError,
ApiRateLimitChallengeRequest,
ApiSetUsernameRequest,
ApiUpdateAccountSettingsRequest,
ClientSetUsernameResponse,
} from '../models/index';
} from "../models/index.js";
import {
ApiErrorFromJSON,
ApiErrorToJSON,
ApiRateLimitChallengeRequestFromJSON,
ApiRateLimitChallengeRequestToJSON,
ApiSetUsernameRequestFromJSON,
ApiSetUsernameRequestToJSON,
ApiUpdateAccountSettingsRequestFromJSON,
ApiUpdateAccountSettingsRequestToJSON,
ClientSetUsernameResponseFromJSON,
ClientSetUsernameResponseToJSON,
} from '../models/index';
ApiErrorFromJSON,
ApiErrorToJSON,
ApiRateLimitChallengeRequestFromJSON,
ApiRateLimitChallengeRequestToJSON,
ApiSetUsernameRequestFromJSON,
ApiSetUsernameRequestToJSON,
ApiUpdateAccountSettingsRequestFromJSON,
ApiUpdateAccountSettingsRequestToJSON,
ClientSetUsernameResponseFromJSON,
ClientSetUsernameResponseToJSON,
} from "../models/index.js";
export interface V1AccountsNumberRateLimitChallengePostRequest {
number: string;
data: ApiRateLimitChallengeRequest;
number: string;
data: ApiRateLimitChallengeRequest;
}
export interface V1AccountsNumberSettingsPutRequest {
number: string;
data: ApiUpdateAccountSettingsRequest;
number: string;
data: ApiUpdateAccountSettingsRequest;
}
export interface V1AccountsNumberUsernameDeleteRequest {
number: string;
number: string;
}
export interface V1AccountsNumberUsernamePostRequest {
number: string;
data: ApiSetUsernameRequest;
number: string;
data: ApiSetUsernameRequest;
}
/**
*
*
*/
export class AccountsApi extends runtime.BaseAPI {
/**
* Lists all of the accounts linked or registered
* List all accounts
*/
async v1AccountsGetRaw(
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<Array<string>>> {
const queryParameters: any = {};
/**
* Lists all of the accounts linked or registered
* List all accounts
*/
async v1AccountsGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<string>>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request(
{
path: `/v1/accounts`,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
const response = await this.request({
path: `/v1/accounts`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse<any>(response);
}
return new runtime.JSONApiResponse<any>(response);
/**
* Lists all of the accounts linked or registered
* List all accounts
*/
async v1AccountsGet(
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<Array<string>> {
const response = await this.v1AccountsGetRaw(initOverrides);
return await response.value();
}
/**
* When running into rate limits, sometimes the limit can be lifted, by solving a CAPTCHA. To get the captcha token, go to https://signalcaptchas.org/challenge/generate.html For the staging environment, use: https://signalcaptchas.org/staging/registration/generate.html. The \"challenge_token\" is the token from the failed send attempt. The \"captcha\" is the captcha result, starting with signalcaptcha://
* Lift rate limit restrictions by solving a captcha.
*/
async v1AccountsNumberRateLimitChallengePostRaw(
requestParameters: V1AccountsNumberRateLimitChallengePostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<void>> {
if (requestParameters["number"] == null) {
throw new runtime.RequiredError(
"number",
'Required parameter "number" was null or undefined when calling v1AccountsNumberRateLimitChallengePost().',
);
}
/**
* Lists all of the accounts linked or registered
* List all accounts
*/
async v1AccountsGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<string>> {
const response = await this.v1AccountsGetRaw(initOverrides);
if (requestParameters["data"] == null) {
throw new runtime.RequiredError(
"data",
'Required parameter "data" was null or undefined when calling v1AccountsNumberRateLimitChallengePost().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
const response = await this.request(
{
path: `/v1/accounts/{number}/rate-limit-challenge`.replace(
`{${"number"}}`,
encodeURIComponent(String(requestParameters["number"])),
),
method: "POST",
headers: headerParameters,
query: queryParameters,
body: ApiRateLimitChallengeRequestToJSON(requestParameters["data"]),
},
initOverrides,
);
return new runtime.VoidApiResponse(response);
}
/**
* When running into rate limits, sometimes the limit can be lifted, by solving a CAPTCHA. To get the captcha token, go to https://signalcaptchas.org/challenge/generate.html For the staging environment, use: https://signalcaptchas.org/staging/registration/generate.html. The \"challenge_token\" is the token from the failed send attempt. The \"captcha\" is the captcha result, starting with signalcaptcha://
* Lift rate limit restrictions by solving a captcha.
*/
async v1AccountsNumberRateLimitChallengePost(
requestParameters: V1AccountsNumberRateLimitChallengePostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<void> {
await this.v1AccountsNumberRateLimitChallengePostRaw(
requestParameters,
initOverrides,
);
}
/**
* Update the account attributes on the signal server.
* Update the account settings.
*/
async v1AccountsNumberSettingsPutRaw(
requestParameters: V1AccountsNumberSettingsPutRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<void>> {
if (requestParameters["number"] == null) {
throw new runtime.RequiredError(
"number",
'Required parameter "number" was null or undefined when calling v1AccountsNumberSettingsPut().',
);
}
if (requestParameters["data"] == null) {
throw new runtime.RequiredError(
"data",
'Required parameter "data" was null or undefined when calling v1AccountsNumberSettingsPut().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
const response = await this.request(
{
path: `/v1/accounts/{number}/settings`.replace(
`{${"number"}}`,
encodeURIComponent(String(requestParameters["number"])),
),
method: "PUT",
headers: headerParameters,
query: queryParameters,
body: ApiUpdateAccountSettingsRequestToJSON(requestParameters["data"]),
},
initOverrides,
);
return new runtime.VoidApiResponse(response);
}
/**
* Update the account attributes on the signal server.
* Update the account settings.
*/
async v1AccountsNumberSettingsPut(
requestParameters: V1AccountsNumberSettingsPutRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<void> {
await this.v1AccountsNumberSettingsPutRaw(requestParameters, initOverrides);
}
/**
* Delete the username associated with this account.
* Remove a username.
*/
async v1AccountsNumberUsernameDeleteRaw(
requestParameters: V1AccountsNumberUsernameDeleteRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<void>> {
if (requestParameters["number"] == null) {
throw new runtime.RequiredError(
"number",
'Required parameter "number" was null or undefined when calling v1AccountsNumberUsernameDelete().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request(
{
path: `/v1/accounts/{number}/username`.replace(
`{${"number"}}`,
encodeURIComponent(String(requestParameters["number"])),
),
method: "DELETE",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.VoidApiResponse(response);
}
/**
* Delete the username associated with this account.
* Remove a username.
*/
async v1AccountsNumberUsernameDelete(
requestParameters: V1AccountsNumberUsernameDeleteRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<void> {
await this.v1AccountsNumberUsernameDeleteRaw(
requestParameters,
initOverrides,
);
}
/**
* Allows to set the username that should be used for this account. This can either be just the nickname (e.g. test) or the complete username with discriminator (e.g. test.123). Returns the new username with discriminator and the username link.
* Set a username.
*/
async v1AccountsNumberUsernamePostRaw(
requestParameters: V1AccountsNumberUsernamePostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<ClientSetUsernameResponse>> {
if (requestParameters["number"] == null) {
throw new runtime.RequiredError(
"number",
'Required parameter "number" was null or undefined when calling v1AccountsNumberUsernamePost().',
);
}
if (requestParameters["data"] == null) {
throw new runtime.RequiredError(
"data",
'Required parameter "data" was null or undefined when calling v1AccountsNumberUsernamePost().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
const response = await this.request(
{
path: `/v1/accounts/{number}/username`.replace(
`{${"number"}}`,
encodeURIComponent(String(requestParameters["number"])),
),
method: "POST",
headers: headerParameters,
query: queryParameters,
body: ApiSetUsernameRequestToJSON(requestParameters["data"]),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
ClientSetUsernameResponseFromJSON(jsonValue),
);
}
/**
* Allows to set the username that should be used for this account. This can either be just the nickname (e.g. test) or the complete username with discriminator (e.g. test.123). Returns the new username with discriminator and the username link.
* Set a username.
*/
async v1AccountsNumberUsernamePost(
requestParameters: V1AccountsNumberUsernamePostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<ClientSetUsernameResponse | null | undefined> {
const response = await this.v1AccountsNumberUsernamePostRaw(
requestParameters,
initOverrides,
);
switch (response.raw.status) {
case 201:
return await response.value();
case 204:
return null;
default:
return await response.value();
}
/**
* When running into rate limits, sometimes the limit can be lifted, by solving a CAPTCHA. To get the captcha token, go to https://signalcaptchas.org/challenge/generate.html For the staging environment, use: https://signalcaptchas.org/staging/registration/generate.html. The \"challenge_token\" is the token from the failed send attempt. The \"captcha\" is the captcha result, starting with signalcaptcha://
* Lift rate limit restrictions by solving a captcha.
*/
async v1AccountsNumberRateLimitChallengePostRaw(requestParameters: V1AccountsNumberRateLimitChallengePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
if (requestParameters['number'] == null) {
throw new runtime.RequiredError(
'number',
'Required parameter "number" was null or undefined when calling v1AccountsNumberRateLimitChallengePost().'
);
}
if (requestParameters['data'] == null) {
throw new runtime.RequiredError(
'data',
'Required parameter "data" was null or undefined when calling v1AccountsNumberRateLimitChallengePost().'
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
const response = await this.request({
path: `/v1/accounts/{number}/rate-limit-challenge`.replace(`{${"number"}}`, encodeURIComponent(String(requestParameters['number']))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: ApiRateLimitChallengeRequestToJSON(requestParameters['data']),
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* When running into rate limits, sometimes the limit can be lifted, by solving a CAPTCHA. To get the captcha token, go to https://signalcaptchas.org/challenge/generate.html For the staging environment, use: https://signalcaptchas.org/staging/registration/generate.html. The \"challenge_token\" is the token from the failed send attempt. The \"captcha\" is the captcha result, starting with signalcaptcha://
* Lift rate limit restrictions by solving a captcha.
*/
async v1AccountsNumberRateLimitChallengePost(requestParameters: V1AccountsNumberRateLimitChallengePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.v1AccountsNumberRateLimitChallengePostRaw(requestParameters, initOverrides);
}
/**
* Update the account attributes on the signal server.
* Update the account settings.
*/
async v1AccountsNumberSettingsPutRaw(requestParameters: V1AccountsNumberSettingsPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
if (requestParameters['number'] == null) {
throw new runtime.RequiredError(
'number',
'Required parameter "number" was null or undefined when calling v1AccountsNumberSettingsPut().'
);
}
if (requestParameters['data'] == null) {
throw new runtime.RequiredError(
'data',
'Required parameter "data" was null or undefined when calling v1AccountsNumberSettingsPut().'
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
const response = await this.request({
path: `/v1/accounts/{number}/settings`.replace(`{${"number"}}`, encodeURIComponent(String(requestParameters['number']))),
method: 'PUT',
headers: headerParameters,
query: queryParameters,
body: ApiUpdateAccountSettingsRequestToJSON(requestParameters['data']),
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Update the account attributes on the signal server.
* Update the account settings.
*/
async v1AccountsNumberSettingsPut(requestParameters: V1AccountsNumberSettingsPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.v1AccountsNumberSettingsPutRaw(requestParameters, initOverrides);
}
/**
* Delete the username associated with this account.
* Remove a username.
*/
async v1AccountsNumberUsernameDeleteRaw(requestParameters: V1AccountsNumberUsernameDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
if (requestParameters['number'] == null) {
throw new runtime.RequiredError(
'number',
'Required parameter "number" was null or undefined when calling v1AccountsNumberUsernameDelete().'
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request({
path: `/v1/accounts/{number}/username`.replace(`{${"number"}}`, encodeURIComponent(String(requestParameters['number']))),
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Delete the username associated with this account.
* Remove a username.
*/
async v1AccountsNumberUsernameDelete(requestParameters: V1AccountsNumberUsernameDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.v1AccountsNumberUsernameDeleteRaw(requestParameters, initOverrides);
}
/**
* Allows to set the username that should be used for this account. This can either be just the nickname (e.g. test) or the complete username with discriminator (e.g. test.123). Returns the new username with discriminator and the username link.
* Set a username.
*/
async v1AccountsNumberUsernamePostRaw(requestParameters: V1AccountsNumberUsernamePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ClientSetUsernameResponse>> {
if (requestParameters['number'] == null) {
throw new runtime.RequiredError(
'number',
'Required parameter "number" was null or undefined when calling v1AccountsNumberUsernamePost().'
);
}
if (requestParameters['data'] == null) {
throw new runtime.RequiredError(
'data',
'Required parameter "data" was null or undefined when calling v1AccountsNumberUsernamePost().'
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
const response = await this.request({
path: `/v1/accounts/{number}/username`.replace(`{${"number"}}`, encodeURIComponent(String(requestParameters['number']))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: ApiSetUsernameRequestToJSON(requestParameters['data']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => ClientSetUsernameResponseFromJSON(jsonValue));
}
/**
* Allows to set the username that should be used for this account. This can either be just the nickname (e.g. test) or the complete username with discriminator (e.g. test.123). Returns the new username with discriminator and the username link.
* Set a username.
*/
async v1AccountsNumberUsernamePost(requestParameters: V1AccountsNumberUsernamePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ClientSetUsernameResponse | null | undefined > {
const response = await this.v1AccountsNumberUsernamePostRaw(requestParameters, initOverrides);
switch (response.raw.status) {
case 201:
return await response.value();
case 204:
return null;
default:
return await response.value();
}
}
}
}

View file

@ -5,140 +5,169 @@
* This is the Signal Cli REST API documentation.
*
* The version of the OpenAPI document: 1.0
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import type {
ApiError,
} from '../models/index';
import {
ApiErrorFromJSON,
ApiErrorToJSON,
} from '../models/index';
import * as runtime from "../runtime.js";
import type { ApiError } from "../models/index.js";
import { ApiErrorFromJSON, ApiErrorToJSON } from "../models/index.js";
export interface V1AttachmentsAttachmentDeleteRequest {
attachment: string;
attachment: string;
}
export interface V1AttachmentsAttachmentGetRequest {
attachment: string;
attachment: string;
}
/**
*
*
*/
export class AttachmentsApi extends runtime.BaseAPI {
/**
* Remove the attachment with the given id from filesystem.
* Remove attachment.
*/
async v1AttachmentsAttachmentDeleteRaw(requestParameters: V1AttachmentsAttachmentDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
if (requestParameters['attachment'] == null) {
throw new runtime.RequiredError(
'attachment',
'Required parameter "attachment" was null or undefined when calling v1AttachmentsAttachmentDelete().'
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request({
path: `/v1/attachments/{attachment}`.replace(`{${"attachment"}}`, encodeURIComponent(String(requestParameters['attachment']))),
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
if (this.isJsonMime(response.headers.get('content-type'))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
/**
* Remove the attachment with the given id from filesystem.
* Remove attachment.
*/
async v1AttachmentsAttachmentDeleteRaw(
requestParameters: V1AttachmentsAttachmentDeleteRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<string>> {
if (requestParameters["attachment"] == null) {
throw new runtime.RequiredError(
"attachment",
'Required parameter "attachment" was null or undefined when calling v1AttachmentsAttachmentDelete().',
);
}
/**
* Remove the attachment with the given id from filesystem.
* Remove attachment.
*/
async v1AttachmentsAttachmentDelete(requestParameters: V1AttachmentsAttachmentDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
const response = await this.v1AttachmentsAttachmentDeleteRaw(requestParameters, initOverrides);
return await response.value();
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request(
{
path: `/v1/attachments/{attachment}`.replace(
`{${"attachment"}}`,
encodeURIComponent(String(requestParameters["attachment"])),
),
method: "DELETE",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
if (this.isJsonMime(response.headers.get("content-type"))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
}
/**
* Remove the attachment with the given id from filesystem.
* Remove attachment.
*/
async v1AttachmentsAttachmentDelete(
requestParameters: V1AttachmentsAttachmentDeleteRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<string> {
const response = await this.v1AttachmentsAttachmentDeleteRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Serve the attachment with the given id
* Serve Attachment.
*/
async v1AttachmentsAttachmentGetRaw(
requestParameters: V1AttachmentsAttachmentGetRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<string>> {
if (requestParameters["attachment"] == null) {
throw new runtime.RequiredError(
"attachment",
'Required parameter "attachment" was null or undefined when calling v1AttachmentsAttachmentGet().',
);
}
/**
* Serve the attachment with the given id
* Serve Attachment.
*/
async v1AttachmentsAttachmentGetRaw(requestParameters: V1AttachmentsAttachmentGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
if (requestParameters['attachment'] == null) {
throw new runtime.RequiredError(
'attachment',
'Required parameter "attachment" was null or undefined when calling v1AttachmentsAttachmentGet().'
);
}
const queryParameters: any = {};
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request(
{
path: `/v1/attachments/{attachment}`.replace(
`{${"attachment"}}`,
encodeURIComponent(String(requestParameters["attachment"])),
),
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
const response = await this.request({
path: `/v1/attachments/{attachment}`.replace(`{${"attachment"}}`, encodeURIComponent(String(requestParameters['attachment']))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
if (this.isJsonMime(response.headers.get('content-type'))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
if (this.isJsonMime(response.headers.get("content-type"))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
}
/**
* Serve the attachment with the given id
* Serve Attachment.
*/
async v1AttachmentsAttachmentGet(requestParameters: V1AttachmentsAttachmentGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
const response = await this.v1AttachmentsAttachmentGetRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Serve the attachment with the given id
* Serve Attachment.
*/
async v1AttachmentsAttachmentGet(
requestParameters: V1AttachmentsAttachmentGetRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<string> {
const response = await this.v1AttachmentsAttachmentGetRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* List all downloaded attachments
* List all attachments.
*/
async v1AttachmentsGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<string>>> {
const queryParameters: any = {};
/**
* List all downloaded attachments
* List all attachments.
*/
async v1AttachmentsGetRaw(
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<Array<string>>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request({
path: `/v1/attachments`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
const response = await this.request(
{
path: `/v1/attachments`,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse<any>(response);
}
/**
* List all downloaded attachments
* List all attachments.
*/
async v1AttachmentsGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<string>> {
const response = await this.v1AttachmentsGetRaw(initOverrides);
return await response.value();
}
return new runtime.JSONApiResponse<any>(response);
}
/**
* List all downloaded attachments
* List all attachments.
*/
async v1AttachmentsGet(
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<Array<string>> {
const response = await this.v1AttachmentsGetRaw(initOverrides);
return await response.value();
}
}

View file

@ -5,116 +5,134 @@
* This is the Signal Cli REST API documentation.
*
* The version of the OpenAPI document: 1.0
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import type {
ApiError,
ApiUpdateContactRequest,
} from '../models/index';
import * as runtime from "../runtime.js";
import type { ApiError, ApiUpdateContactRequest } from "../models/index.js";
import {
ApiErrorFromJSON,
ApiErrorToJSON,
ApiUpdateContactRequestFromJSON,
ApiUpdateContactRequestToJSON,
} from '../models/index';
ApiErrorFromJSON,
ApiErrorToJSON,
ApiUpdateContactRequestFromJSON,
ApiUpdateContactRequestToJSON,
} from "../models/index.js";
export interface V1ContactsNumberPutRequest {
number: string;
data: ApiUpdateContactRequest;
number: string;
data: ApiUpdateContactRequest;
}
export interface V1ContactsNumberSyncPostRequest {
number: string;
number: string;
}
/**
*
*
*/
export class ContactsApi extends runtime.BaseAPI {
/**
* Updates the info associated to a number on the contact list.
* Updates the info associated to a number on the contact list. If the contact doesnt exist yet, it will be added.
*/
async v1ContactsNumberPutRaw(requestParameters: V1ContactsNumberPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
if (requestParameters['number'] == null) {
throw new runtime.RequiredError(
'number',
'Required parameter "number" was null or undefined when calling v1ContactsNumberPut().'
);
}
if (requestParameters['data'] == null) {
throw new runtime.RequiredError(
'data',
'Required parameter "data" was null or undefined when calling v1ContactsNumberPut().'
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
const response = await this.request({
path: `/v1/contacts/{number}`.replace(`{${"number"}}`, encodeURIComponent(String(requestParameters['number']))),
method: 'PUT',
headers: headerParameters,
query: queryParameters,
body: ApiUpdateContactRequestToJSON(requestParameters['data']),
}, initOverrides);
return new runtime.VoidApiResponse(response);
/**
* Updates the info associated to a number on the contact list.
* Updates the info associated to a number on the contact list. If the contact doesnt exist yet, it will be added.
*/
async v1ContactsNumberPutRaw(
requestParameters: V1ContactsNumberPutRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<void>> {
if (requestParameters["number"] == null) {
throw new runtime.RequiredError(
"number",
'Required parameter "number" was null or undefined when calling v1ContactsNumberPut().',
);
}
/**
* Updates the info associated to a number on the contact list.
* Updates the info associated to a number on the contact list. If the contact doesnt exist yet, it will be added.
*/
async v1ContactsNumberPut(requestParameters: V1ContactsNumberPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.v1ContactsNumberPutRaw(requestParameters, initOverrides);
if (requestParameters["data"] == null) {
throw new runtime.RequiredError(
"data",
'Required parameter "data" was null or undefined when calling v1ContactsNumberPut().',
);
}
/**
* Send a synchronization message with the local contacts list to all linked devices. This command should only be used if this is the primary device.
* Send a synchronization message with the local contacts list to all linked devices.
*/
async v1ContactsNumberSyncPostRaw(requestParameters: V1ContactsNumberSyncPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
if (requestParameters['number'] == null) {
throw new runtime.RequiredError(
'number',
'Required parameter "number" was null or undefined when calling v1ContactsNumberSyncPost().'
);
}
const queryParameters: any = {};
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
const response = await this.request({
path: `/v1/contacts/{number}/sync`.replace(`{${"number"}}`, encodeURIComponent(String(requestParameters['number']))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
const response = await this.request(
{
path: `/v1/contacts/{number}`.replace(
`{${"number"}}`,
encodeURIComponent(String(requestParameters["number"])),
),
method: "PUT",
headers: headerParameters,
query: queryParameters,
body: ApiUpdateContactRequestToJSON(requestParameters["data"]),
},
initOverrides,
);
return new runtime.VoidApiResponse(response);
return new runtime.VoidApiResponse(response);
}
/**
* Updates the info associated to a number on the contact list.
* Updates the info associated to a number on the contact list. If the contact doesnt exist yet, it will be added.
*/
async v1ContactsNumberPut(
requestParameters: V1ContactsNumberPutRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<void> {
await this.v1ContactsNumberPutRaw(requestParameters, initOverrides);
}
/**
* Send a synchronization message with the local contacts list to all linked devices. This command should only be used if this is the primary device.
* Send a synchronization message with the local contacts list to all linked devices.
*/
async v1ContactsNumberSyncPostRaw(
requestParameters: V1ContactsNumberSyncPostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<void>> {
if (requestParameters["number"] == null) {
throw new runtime.RequiredError(
"number",
'Required parameter "number" was null or undefined when calling v1ContactsNumberSyncPost().',
);
}
/**
* Send a synchronization message with the local contacts list to all linked devices. This command should only be used if this is the primary device.
* Send a synchronization message with the local contacts list to all linked devices.
*/
async v1ContactsNumberSyncPost(requestParameters: V1ContactsNumberSyncPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.v1ContactsNumberSyncPostRaw(requestParameters, initOverrides);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request(
{
path: `/v1/contacts/{number}/sync`.replace(
`{${"number"}}`,
encodeURIComponent(String(requestParameters["number"])),
),
method: "POST",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.VoidApiResponse(response);
}
/**
* Send a synchronization message with the local contacts list to all linked devices. This command should only be used if this is the primary device.
* Send a synchronization message with the local contacts list to all linked devices.
*/
async v1ContactsNumberSyncPost(
requestParameters: V1ContactsNumberSyncPostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<void> {
await this.v1ContactsNumberSyncPostRaw(requestParameters, initOverrides);
}
}

View file

@ -12,14 +12,14 @@
* Do not edit the class manually.
*/
import * as runtime from "../runtime";
import * as runtime from "../runtime.js";
import type {
ApiAddDeviceRequest,
ApiError,
ApiRegisterNumberRequest,
ApiUnregisterNumberRequest,
ApiVerifyNumberSettings,
} from "../models/index";
} from "../models/index.js";
import {
ApiAddDeviceRequestFromJSON,
ApiAddDeviceRequestToJSON,
@ -31,7 +31,7 @@ import {
ApiUnregisterNumberRequestToJSON,
ApiVerifyNumberSettingsFromJSON,
ApiVerifyNumberSettingsToJSON,
} from "../models/index";
} from "../models/index.js";
export interface V1DevicesNumberPostRequest {
number: string;

View file

@ -5,270 +5,334 @@
* This is the Signal Cli REST API documentation.
*
* The version of the OpenAPI document: 1.0
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import * as runtime from "../runtime.js";
import type {
ApiConfiguration,
ApiError,
ApiTrustModeRequest,
ApiTrustModeResponse,
ClientAbout,
} from '../models/index';
} from "../models/index.js";
import {
ApiConfigurationFromJSON,
ApiConfigurationToJSON,
ApiErrorFromJSON,
ApiErrorToJSON,
ApiTrustModeRequestFromJSON,
ApiTrustModeRequestToJSON,
ApiTrustModeResponseFromJSON,
ApiTrustModeResponseToJSON,
ClientAboutFromJSON,
ClientAboutToJSON,
} from '../models/index';
ApiConfigurationFromJSON,
ApiConfigurationToJSON,
ApiErrorFromJSON,
ApiErrorToJSON,
ApiTrustModeRequestFromJSON,
ApiTrustModeRequestToJSON,
ApiTrustModeResponseFromJSON,
ApiTrustModeResponseToJSON,
ClientAboutFromJSON,
ClientAboutToJSON,
} from "../models/index.js";
export interface V1ConfigurationNumberSettingsGetRequest {
number: string;
data: ApiTrustModeResponse;
number: string;
data: ApiTrustModeResponse;
}
export interface V1ConfigurationNumberSettingsPostRequest {
number: string;
data: ApiTrustModeRequest;
number: string;
data: ApiTrustModeRequest;
}
export interface V1ConfigurationPostRequest {
data: ApiConfiguration;
data: ApiConfiguration;
}
/**
*
*
*/
export class GeneralApi extends runtime.BaseAPI {
/**
* Returns the supported API versions and the internal build nr
* Lists general information about the API
*/
async v1AboutGetRaw(
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<ClientAbout>> {
const queryParameters: any = {};
/**
* Returns the supported API versions and the internal build nr
* Lists general information about the API
*/
async v1AboutGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ClientAbout>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request(
{
path: `/v1/about`,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
const response = await this.request({
path: `/v1/about`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) =>
ClientAboutFromJSON(jsonValue),
);
}
return new runtime.JSONApiResponse(response, (jsonValue) => ClientAboutFromJSON(jsonValue));
/**
* Returns the supported API versions and the internal build nr
* Lists general information about the API
*/
async v1AboutGet(
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<ClientAbout> {
const response = await this.v1AboutGetRaw(initOverrides);
return await response.value();
}
/**
* List the REST API configuration.
* List the REST API configuration.
*/
async v1ConfigurationGetRaw(
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<ApiConfiguration>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request(
{
path: `/v1/configuration`,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
ApiConfigurationFromJSON(jsonValue),
);
}
/**
* List the REST API configuration.
* List the REST API configuration.
*/
async v1ConfigurationGet(
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<ApiConfiguration> {
const response = await this.v1ConfigurationGetRaw(initOverrides);
return await response.value();
}
/**
* List account specific settings.
* List account specific settings.
*/
async v1ConfigurationNumberSettingsGetRaw(
requestParameters: V1ConfigurationNumberSettingsGetRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<void>> {
if (requestParameters["number"] == null) {
throw new runtime.RequiredError(
"number",
'Required parameter "number" was null or undefined when calling v1ConfigurationNumberSettingsGet().',
);
}
/**
* Returns the supported API versions and the internal build nr
* Lists general information about the API
*/
async v1AboutGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ClientAbout> {
const response = await this.v1AboutGetRaw(initOverrides);
return await response.value();
if (requestParameters["data"] == null) {
throw new runtime.RequiredError(
"data",
'Required parameter "data" was null or undefined when calling v1ConfigurationNumberSettingsGet().',
);
}
/**
* List the REST API configuration.
* List the REST API configuration.
*/
async v1ConfigurationGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ApiConfiguration>> {
const queryParameters: any = {};
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request({
path: `/v1/configuration`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
headerParameters["Content-Type"] = "application/json";
return new runtime.JSONApiResponse(response, (jsonValue) => ApiConfigurationFromJSON(jsonValue));
const response = await this.request(
{
path: `/v1/configuration/{number}/settings`.replace(
`{${"number"}}`,
encodeURIComponent(String(requestParameters["number"])),
),
method: "GET",
headers: headerParameters,
query: queryParameters,
body: ApiTrustModeResponseToJSON(requestParameters["data"]),
},
initOverrides,
);
return new runtime.VoidApiResponse(response);
}
/**
* List account specific settings.
* List account specific settings.
*/
async v1ConfigurationNumberSettingsGet(
requestParameters: V1ConfigurationNumberSettingsGetRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<void> {
await this.v1ConfigurationNumberSettingsGetRaw(
requestParameters,
initOverrides,
);
}
/**
* Set account specific settings.
* Set account specific settings.
*/
async v1ConfigurationNumberSettingsPostRaw(
requestParameters: V1ConfigurationNumberSettingsPostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<void>> {
if (requestParameters["number"] == null) {
throw new runtime.RequiredError(
"number",
'Required parameter "number" was null or undefined when calling v1ConfigurationNumberSettingsPost().',
);
}
/**
* List the REST API configuration.
* List the REST API configuration.
*/
async v1ConfigurationGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiConfiguration> {
const response = await this.v1ConfigurationGetRaw(initOverrides);
return await response.value();
if (requestParameters["data"] == null) {
throw new runtime.RequiredError(
"data",
'Required parameter "data" was null or undefined when calling v1ConfigurationNumberSettingsPost().',
);
}
/**
* List account specific settings.
* List account specific settings.
*/
async v1ConfigurationNumberSettingsGetRaw(requestParameters: V1ConfigurationNumberSettingsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
if (requestParameters['number'] == null) {
throw new runtime.RequiredError(
'number',
'Required parameter "number" was null or undefined when calling v1ConfigurationNumberSettingsGet().'
);
}
const queryParameters: any = {};
if (requestParameters['data'] == null) {
throw new runtime.RequiredError(
'data',
'Required parameter "data" was null or undefined when calling v1ConfigurationNumberSettingsGet().'
);
}
const headerParameters: runtime.HTTPHeaders = {};
const queryParameters: any = {};
headerParameters["Content-Type"] = "application/json";
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request(
{
path: `/v1/configuration/{number}/settings`.replace(
`{${"number"}}`,
encodeURIComponent(String(requestParameters["number"])),
),
method: "POST",
headers: headerParameters,
query: queryParameters,
body: ApiTrustModeRequestToJSON(requestParameters["data"]),
},
initOverrides,
);
headerParameters['Content-Type'] = 'application/json';
return new runtime.VoidApiResponse(response);
}
const response = await this.request({
path: `/v1/configuration/{number}/settings`.replace(`{${"number"}}`, encodeURIComponent(String(requestParameters['number']))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
body: ApiTrustModeResponseToJSON(requestParameters['data']),
}, initOverrides);
/**
* Set account specific settings.
* Set account specific settings.
*/
async v1ConfigurationNumberSettingsPost(
requestParameters: V1ConfigurationNumberSettingsPostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<void> {
await this.v1ConfigurationNumberSettingsPostRaw(
requestParameters,
initOverrides,
);
}
return new runtime.VoidApiResponse(response);
/**
* Set the REST API configuration.
* Set the REST API configuration.
*/
async v1ConfigurationPostRaw(
requestParameters: V1ConfigurationPostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<string>> {
if (requestParameters["data"] == null) {
throw new runtime.RequiredError(
"data",
'Required parameter "data" was null or undefined when calling v1ConfigurationPost().',
);
}
/**
* List account specific settings.
* List account specific settings.
*/
async v1ConfigurationNumberSettingsGet(requestParameters: V1ConfigurationNumberSettingsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.v1ConfigurationNumberSettingsGetRaw(requestParameters, initOverrides);
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
const response = await this.request(
{
path: `/v1/configuration`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: ApiConfigurationToJSON(requestParameters["data"]),
},
initOverrides,
);
if (this.isJsonMime(response.headers.get("content-type"))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
}
/**
* Set account specific settings.
* Set account specific settings.
*/
async v1ConfigurationNumberSettingsPostRaw(requestParameters: V1ConfigurationNumberSettingsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
if (requestParameters['number'] == null) {
throw new runtime.RequiredError(
'number',
'Required parameter "number" was null or undefined when calling v1ConfigurationNumberSettingsPost().'
);
}
/**
* Set the REST API configuration.
* Set the REST API configuration.
*/
async v1ConfigurationPost(
requestParameters: V1ConfigurationPostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<string> {
const response = await this.v1ConfigurationPostRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
if (requestParameters['data'] == null) {
throw new runtime.RequiredError(
'data',
'Required parameter "data" was null or undefined when calling v1ConfigurationNumberSettingsPost().'
);
}
/**
* Internally used by the docker container to perform the health check.
* API Health Check
*/
async v1HealthGetRaw(
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<string>> {
const queryParameters: any = {};
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request(
{
path: `/v1/health`,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
headerParameters['Content-Type'] = 'application/json';
const response = await this.request({
path: `/v1/configuration/{number}/settings`.replace(`{${"number"}}`, encodeURIComponent(String(requestParameters['number']))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: ApiTrustModeRequestToJSON(requestParameters['data']),
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Set account specific settings.
* Set account specific settings.
*/
async v1ConfigurationNumberSettingsPost(requestParameters: V1ConfigurationNumberSettingsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.v1ConfigurationNumberSettingsPostRaw(requestParameters, initOverrides);
}
/**
* Set the REST API configuration.
* Set the REST API configuration.
*/
async v1ConfigurationPostRaw(requestParameters: V1ConfigurationPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
if (requestParameters['data'] == null) {
throw new runtime.RequiredError(
'data',
'Required parameter "data" was null or undefined when calling v1ConfigurationPost().'
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
const response = await this.request({
path: `/v1/configuration`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: ApiConfigurationToJSON(requestParameters['data']),
}, initOverrides);
if (this.isJsonMime(response.headers.get('content-type'))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
}
/**
* Set the REST API configuration.
* Set the REST API configuration.
*/
async v1ConfigurationPost(requestParameters: V1ConfigurationPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
const response = await this.v1ConfigurationPostRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Internally used by the docker container to perform the health check.
* API Health Check
*/
async v1HealthGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request({
path: `/v1/health`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
if (this.isJsonMime(response.headers.get('content-type'))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
}
/**
* Internally used by the docker container to perform the health check.
* API Health Check
*/
async v1HealthGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
const response = await this.v1HealthGetRaw(initOverrides);
return await response.value();
if (this.isJsonMime(response.headers.get("content-type"))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
}
/**
* Internally used by the docker container to perform the health check.
* API Health Check
*/
async v1HealthGet(
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<string> {
const response = await this.v1HealthGetRaw(initOverrides);
return await response.value();
}
}

File diff suppressed because it is too large Load diff

View file

@ -5,130 +5,164 @@
* This is the Signal Cli REST API documentation.
*
* The version of the OpenAPI document: 1.0
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import * as runtime from "../runtime.js";
import type {
ApiTrustIdentityRequest,
ClientIdentityEntry,
} from '../models/index';
} from "../models/index.js";
import {
ApiTrustIdentityRequestFromJSON,
ApiTrustIdentityRequestToJSON,
ClientIdentityEntryFromJSON,
ClientIdentityEntryToJSON,
} from '../models/index';
ApiTrustIdentityRequestFromJSON,
ApiTrustIdentityRequestToJSON,
ClientIdentityEntryFromJSON,
ClientIdentityEntryToJSON,
} from "../models/index.js";
export interface V1IdentitiesNumberGetRequest {
number: string;
number: string;
}
export interface V1IdentitiesNumberTrustNumberToTrustPutRequest {
number: string;
numberToTrust: string;
data: ApiTrustIdentityRequest;
number: string;
numberToTrust: string;
data: ApiTrustIdentityRequest;
}
/**
*
*
*/
export class IdentitiesApi extends runtime.BaseAPI {
/**
* List all identities for the given number.
* List Identities
*/
async v1IdentitiesNumberGetRaw(requestParameters: V1IdentitiesNumberGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ClientIdentityEntry>>> {
if (requestParameters['number'] == null) {
throw new runtime.RequiredError(
'number',
'Required parameter "number" was null or undefined when calling v1IdentitiesNumberGet().'
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request({
path: `/v1/identities/{number}`.replace(`{${"number"}}`, encodeURIComponent(String(requestParameters['number']))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(ClientIdentityEntryFromJSON));
/**
* List all identities for the given number.
* List Identities
*/
async v1IdentitiesNumberGetRaw(
requestParameters: V1IdentitiesNumberGetRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<Array<ClientIdentityEntry>>> {
if (requestParameters["number"] == null) {
throw new runtime.RequiredError(
"number",
'Required parameter "number" was null or undefined when calling v1IdentitiesNumberGet().',
);
}
/**
* List all identities for the given number.
* List Identities
*/
async v1IdentitiesNumberGet(requestParameters: V1IdentitiesNumberGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ClientIdentityEntry>> {
const response = await this.v1IdentitiesNumberGetRaw(requestParameters, initOverrides);
return await response.value();
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request(
{
path: `/v1/identities/{number}`.replace(
`{${"number"}}`,
encodeURIComponent(String(requestParameters["number"])),
),
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
jsonValue.map(ClientIdentityEntryFromJSON),
);
}
/**
* List all identities for the given number.
* List Identities
*/
async v1IdentitiesNumberGet(
requestParameters: V1IdentitiesNumberGetRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<Array<ClientIdentityEntry>> {
const response = await this.v1IdentitiesNumberGetRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Trust an identity. When \'trust_all_known_keys\' is set to\' true\', all known keys of this user are trusted. **This is only recommended for testing.**
* Trust Identity
*/
async v1IdentitiesNumberTrustNumberToTrustPutRaw(
requestParameters: V1IdentitiesNumberTrustNumberToTrustPutRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<string>> {
if (requestParameters["number"] == null) {
throw new runtime.RequiredError(
"number",
'Required parameter "number" was null or undefined when calling v1IdentitiesNumberTrustNumberToTrustPut().',
);
}
/**
* Trust an identity. When \'trust_all_known_keys\' is set to\' true\', all known keys of this user are trusted. **This is only recommended for testing.**
* Trust Identity
*/
async v1IdentitiesNumberTrustNumberToTrustPutRaw(requestParameters: V1IdentitiesNumberTrustNumberToTrustPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
if (requestParameters['number'] == null) {
throw new runtime.RequiredError(
'number',
'Required parameter "number" was null or undefined when calling v1IdentitiesNumberTrustNumberToTrustPut().'
);
}
if (requestParameters['numberToTrust'] == null) {
throw new runtime.RequiredError(
'numberToTrust',
'Required parameter "numberToTrust" was null or undefined when calling v1IdentitiesNumberTrustNumberToTrustPut().'
);
}
if (requestParameters['data'] == null) {
throw new runtime.RequiredError(
'data',
'Required parameter "data" was null or undefined when calling v1IdentitiesNumberTrustNumberToTrustPut().'
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
const response = await this.request({
path: `/v1/identities/{number}/trust/{numberToTrust}`.replace(`{${"number"}}`, encodeURIComponent(String(requestParameters['number']))).replace(`{${"numberToTrust"}}`, encodeURIComponent(String(requestParameters['numberToTrust']))),
method: 'PUT',
headers: headerParameters,
query: queryParameters,
body: ApiTrustIdentityRequestToJSON(requestParameters['data']),
}, initOverrides);
if (this.isJsonMime(response.headers.get('content-type'))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
if (requestParameters["numberToTrust"] == null) {
throw new runtime.RequiredError(
"numberToTrust",
'Required parameter "numberToTrust" was null or undefined when calling v1IdentitiesNumberTrustNumberToTrustPut().',
);
}
/**
* Trust an identity. When \'trust_all_known_keys\' is set to\' true\', all known keys of this user are trusted. **This is only recommended for testing.**
* Trust Identity
*/
async v1IdentitiesNumberTrustNumberToTrustPut(requestParameters: V1IdentitiesNumberTrustNumberToTrustPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
const response = await this.v1IdentitiesNumberTrustNumberToTrustPutRaw(requestParameters, initOverrides);
return await response.value();
if (requestParameters["data"] == null) {
throw new runtime.RequiredError(
"data",
'Required parameter "data" was null or undefined when calling v1IdentitiesNumberTrustNumberToTrustPut().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
const response = await this.request(
{
path: `/v1/identities/{number}/trust/{numberToTrust}`
.replace(
`{${"number"}}`,
encodeURIComponent(String(requestParameters["number"])),
)
.replace(
`{${"numberToTrust"}}`,
encodeURIComponent(String(requestParameters["numberToTrust"])),
),
method: "PUT",
headers: headerParameters,
query: queryParameters,
body: ApiTrustIdentityRequestToJSON(requestParameters["data"]),
},
initOverrides,
);
if (this.isJsonMime(response.headers.get("content-type"))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
}
/**
* Trust an identity. When \'trust_all_known_keys\' is set to\' true\', all known keys of this user are trusted. **This is only recommended for testing.**
* Trust Identity
*/
async v1IdentitiesNumberTrustNumberToTrustPut(
requestParameters: V1IdentitiesNumberTrustNumberToTrustPutRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<string> {
const response = await this.v1IdentitiesNumberTrustNumberToTrustPutRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
}

View file

@ -5,15 +5,14 @@
* This is the Signal Cli REST API documentation.
*
* The version of the OpenAPI document: 1.0
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import * as runtime from "../runtime.js";
import type {
ApiError,
ApiSendMessageError,
@ -21,287 +20,352 @@ import type {
ApiSendMessageV1,
ApiSendMessageV2,
ApiTypingIndicatorRequest,
} from '../models/index';
} from "../models/index.js";
import {
ApiErrorFromJSON,
ApiErrorToJSON,
ApiSendMessageErrorFromJSON,
ApiSendMessageErrorToJSON,
ApiSendMessageResponseFromJSON,
ApiSendMessageResponseToJSON,
ApiSendMessageV1FromJSON,
ApiSendMessageV1ToJSON,
ApiSendMessageV2FromJSON,
ApiSendMessageV2ToJSON,
ApiTypingIndicatorRequestFromJSON,
ApiTypingIndicatorRequestToJSON,
} from '../models/index';
ApiErrorFromJSON,
ApiErrorToJSON,
ApiSendMessageErrorFromJSON,
ApiSendMessageErrorToJSON,
ApiSendMessageResponseFromJSON,
ApiSendMessageResponseToJSON,
ApiSendMessageV1FromJSON,
ApiSendMessageV1ToJSON,
ApiSendMessageV2FromJSON,
ApiSendMessageV2ToJSON,
ApiTypingIndicatorRequestFromJSON,
ApiTypingIndicatorRequestToJSON,
} from "../models/index.js";
export interface V1ReceiveNumberGetRequest {
number: string;
timeout?: string;
ignoreAttachments?: string;
ignoreStories?: string;
maxMessages?: string;
sendReadReceipts?: string;
number: string;
timeout?: string;
ignoreAttachments?: string;
ignoreStories?: string;
maxMessages?: string;
sendReadReceipts?: string;
}
export interface V1SendPostRequest {
data: ApiSendMessageV1;
data: ApiSendMessageV1;
}
export interface V1TypingIndicatorNumberDeleteRequest {
number: string;
data: ApiTypingIndicatorRequest;
number: string;
data: ApiTypingIndicatorRequest;
}
export interface V1TypingIndicatorNumberPutRequest {
number: string;
data: ApiTypingIndicatorRequest;
number: string;
data: ApiTypingIndicatorRequest;
}
export interface V2SendPostRequest {
data: ApiSendMessageV2;
data: ApiSendMessageV2;
}
/**
*
*
*/
export class MessagesApi extends runtime.BaseAPI {
/**
* Receives Signal Messages from the Signal Network. If you are running the docker container in normal/native mode, this is a GET endpoint. In json-rpc mode this is a websocket endpoint.
* Receive Signal Messages.
*/
async v1ReceiveNumberGetRaw(requestParameters: V1ReceiveNumberGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<string>>> {
if (requestParameters['number'] == null) {
throw new runtime.RequiredError(
'number',
'Required parameter "number" was null or undefined when calling v1ReceiveNumberGet().'
);
}
const queryParameters: any = {};
if (requestParameters['timeout'] != null) {
queryParameters['timeout'] = requestParameters['timeout'];
}
if (requestParameters['ignoreAttachments'] != null) {
queryParameters['ignore_attachments'] = requestParameters['ignoreAttachments'];
}
if (requestParameters['ignoreStories'] != null) {
queryParameters['ignore_stories'] = requestParameters['ignoreStories'];
}
if (requestParameters['maxMessages'] != null) {
queryParameters['max_messages'] = requestParameters['maxMessages'];
}
if (requestParameters['sendReadReceipts'] != null) {
queryParameters['send_read_receipts'] = requestParameters['sendReadReceipts'];
}
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request({
path: `/v1/receive/{number}`.replace(`{${"number"}}`, encodeURIComponent(String(requestParameters['number']))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse<any>(response);
/**
* Receives Signal Messages from the Signal Network. If you are running the docker container in normal/native mode, this is a GET endpoint. In json-rpc mode this is a websocket endpoint.
* Receive Signal Messages.
*/
async v1ReceiveNumberGetRaw(
requestParameters: V1ReceiveNumberGetRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<Array<string>>> {
if (requestParameters["number"] == null) {
throw new runtime.RequiredError(
"number",
'Required parameter "number" was null or undefined when calling v1ReceiveNumberGet().',
);
}
/**
* Receives Signal Messages from the Signal Network. If you are running the docker container in normal/native mode, this is a GET endpoint. In json-rpc mode this is a websocket endpoint.
* Receive Signal Messages.
*/
async v1ReceiveNumberGet(requestParameters: V1ReceiveNumberGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<string>> {
const response = await this.v1ReceiveNumberGetRaw(requestParameters, initOverrides);
return await response.value();
const queryParameters: any = {};
if (requestParameters["timeout"] != null) {
queryParameters["timeout"] = requestParameters["timeout"];
}
/**
* Send a signal message
* Send a signal message.
* @deprecated
*/
async v1SendPostRaw(requestParameters: V1SendPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
if (requestParameters['data'] == null) {
throw new runtime.RequiredError(
'data',
'Required parameter "data" was null or undefined when calling v1SendPost().'
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
const response = await this.request({
path: `/v1/send`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: ApiSendMessageV1ToJSON(requestParameters['data']),
}, initOverrides);
if (this.isJsonMime(response.headers.get('content-type'))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
if (requestParameters["ignoreAttachments"] != null) {
queryParameters["ignore_attachments"] =
requestParameters["ignoreAttachments"];
}
/**
* Send a signal message
* Send a signal message.
* @deprecated
*/
async v1SendPost(requestParameters: V1SendPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
const response = await this.v1SendPostRaw(requestParameters, initOverrides);
return await response.value();
if (requestParameters["ignoreStories"] != null) {
queryParameters["ignore_stories"] = requestParameters["ignoreStories"];
}
/**
* Hide Typing Indicator.
* Hide Typing Indicator.
*/
async v1TypingIndicatorNumberDeleteRaw(requestParameters: V1TypingIndicatorNumberDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
if (requestParameters['number'] == null) {
throw new runtime.RequiredError(
'number',
'Required parameter "number" was null or undefined when calling v1TypingIndicatorNumberDelete().'
);
}
if (requestParameters['data'] == null) {
throw new runtime.RequiredError(
'data',
'Required parameter "data" was null or undefined when calling v1TypingIndicatorNumberDelete().'
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
const response = await this.request({
path: `/v1/typing-indicator/{number}`.replace(`{${"number"}}`, encodeURIComponent(String(requestParameters['number']))),
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
body: ApiTypingIndicatorRequestToJSON(requestParameters['data']),
}, initOverrides);
if (this.isJsonMime(response.headers.get('content-type'))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
if (requestParameters["maxMessages"] != null) {
queryParameters["max_messages"] = requestParameters["maxMessages"];
}
/**
* Hide Typing Indicator.
* Hide Typing Indicator.
*/
async v1TypingIndicatorNumberDelete(requestParameters: V1TypingIndicatorNumberDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
const response = await this.v1TypingIndicatorNumberDeleteRaw(requestParameters, initOverrides);
return await response.value();
if (requestParameters["sendReadReceipts"] != null) {
queryParameters["send_read_receipts"] =
requestParameters["sendReadReceipts"];
}
/**
* Show Typing Indicator.
* Show Typing Indicator.
*/
async v1TypingIndicatorNumberPutRaw(requestParameters: V1TypingIndicatorNumberPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
if (requestParameters['number'] == null) {
throw new runtime.RequiredError(
'number',
'Required parameter "number" was null or undefined when calling v1TypingIndicatorNumberPut().'
);
}
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters['data'] == null) {
throw new runtime.RequiredError(
'data',
'Required parameter "data" was null or undefined when calling v1TypingIndicatorNumberPut().'
);
}
const response = await this.request(
{
path: `/v1/receive/{number}`.replace(
`{${"number"}}`,
encodeURIComponent(String(requestParameters["number"])),
),
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
const queryParameters: any = {};
return new runtime.JSONApiResponse<any>(response);
}
const headerParameters: runtime.HTTPHeaders = {};
/**
* Receives Signal Messages from the Signal Network. If you are running the docker container in normal/native mode, this is a GET endpoint. In json-rpc mode this is a websocket endpoint.
* Receive Signal Messages.
*/
async v1ReceiveNumberGet(
requestParameters: V1ReceiveNumberGetRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<Array<string>> {
const response = await this.v1ReceiveNumberGetRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
headerParameters['Content-Type'] = 'application/json';
const response = await this.request({
path: `/v1/typing-indicator/{number}`.replace(`{${"number"}}`, encodeURIComponent(String(requestParameters['number']))),
method: 'PUT',
headers: headerParameters,
query: queryParameters,
body: ApiTypingIndicatorRequestToJSON(requestParameters['data']),
}, initOverrides);
if (this.isJsonMime(response.headers.get('content-type'))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
/**
* Send a signal message
* Send a signal message.
* @deprecated
*/
async v1SendPostRaw(
requestParameters: V1SendPostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<string>> {
if (requestParameters["data"] == null) {
throw new runtime.RequiredError(
"data",
'Required parameter "data" was null or undefined when calling v1SendPost().',
);
}
/**
* Show Typing Indicator.
* Show Typing Indicator.
*/
async v1TypingIndicatorNumberPut(requestParameters: V1TypingIndicatorNumberPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
const response = await this.v1TypingIndicatorNumberPutRaw(requestParameters, initOverrides);
return await response.value();
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
const response = await this.request(
{
path: `/v1/send`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: ApiSendMessageV1ToJSON(requestParameters["data"]),
},
initOverrides,
);
if (this.isJsonMime(response.headers.get("content-type"))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
}
/**
* Send a signal message
* Send a signal message.
* @deprecated
*/
async v1SendPost(
requestParameters: V1SendPostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<string> {
const response = await this.v1SendPostRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Hide Typing Indicator.
* Hide Typing Indicator.
*/
async v1TypingIndicatorNumberDeleteRaw(
requestParameters: V1TypingIndicatorNumberDeleteRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<string>> {
if (requestParameters["number"] == null) {
throw new runtime.RequiredError(
"number",
'Required parameter "number" was null or undefined when calling v1TypingIndicatorNumberDelete().',
);
}
/**
* Send a signal message. Set the text_mode to \'styled\' in case you want to add formatting to your text message. Styling Options: *italic text*, **bold text**, ~strikethrough text~.
* Send a signal message.
*/
async v2SendPostRaw(requestParameters: V2SendPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ApiSendMessageResponse>> {
if (requestParameters['data'] == null) {
throw new runtime.RequiredError(
'data',
'Required parameter "data" was null or undefined when calling v2SendPost().'
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
const response = await this.request({
path: `/v2/send`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: ApiSendMessageV2ToJSON(requestParameters['data']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => ApiSendMessageResponseFromJSON(jsonValue));
if (requestParameters["data"] == null) {
throw new runtime.RequiredError(
"data",
'Required parameter "data" was null or undefined when calling v1TypingIndicatorNumberDelete().',
);
}
/**
* Send a signal message. Set the text_mode to \'styled\' in case you want to add formatting to your text message. Styling Options: *italic text*, **bold text**, ~strikethrough text~.
* Send a signal message.
*/
async v2SendPost(requestParameters: V2SendPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiSendMessageResponse> {
const response = await this.v2SendPostRaw(requestParameters, initOverrides);
return await response.value();
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
const response = await this.request(
{
path: `/v1/typing-indicator/{number}`.replace(
`{${"number"}}`,
encodeURIComponent(String(requestParameters["number"])),
),
method: "DELETE",
headers: headerParameters,
query: queryParameters,
body: ApiTypingIndicatorRequestToJSON(requestParameters["data"]),
},
initOverrides,
);
if (this.isJsonMime(response.headers.get("content-type"))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
}
/**
* Hide Typing Indicator.
* Hide Typing Indicator.
*/
async v1TypingIndicatorNumberDelete(
requestParameters: V1TypingIndicatorNumberDeleteRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<string> {
const response = await this.v1TypingIndicatorNumberDeleteRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Show Typing Indicator.
* Show Typing Indicator.
*/
async v1TypingIndicatorNumberPutRaw(
requestParameters: V1TypingIndicatorNumberPutRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<string>> {
if (requestParameters["number"] == null) {
throw new runtime.RequiredError(
"number",
'Required parameter "number" was null or undefined when calling v1TypingIndicatorNumberPut().',
);
}
if (requestParameters["data"] == null) {
throw new runtime.RequiredError(
"data",
'Required parameter "data" was null or undefined when calling v1TypingIndicatorNumberPut().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
const response = await this.request(
{
path: `/v1/typing-indicator/{number}`.replace(
`{${"number"}}`,
encodeURIComponent(String(requestParameters["number"])),
),
method: "PUT",
headers: headerParameters,
query: queryParameters,
body: ApiTypingIndicatorRequestToJSON(requestParameters["data"]),
},
initOverrides,
);
if (this.isJsonMime(response.headers.get("content-type"))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
}
/**
* Show Typing Indicator.
* Show Typing Indicator.
*/
async v1TypingIndicatorNumberPut(
requestParameters: V1TypingIndicatorNumberPutRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<string> {
const response = await this.v1TypingIndicatorNumberPutRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Send a signal message. Set the text_mode to \'styled\' in case you want to add formatting to your text message. Styling Options: *italic text*, **bold text**, ~strikethrough text~.
* Send a signal message.
*/
async v2SendPostRaw(
requestParameters: V2SendPostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<ApiSendMessageResponse>> {
if (requestParameters["data"] == null) {
throw new runtime.RequiredError(
"data",
'Required parameter "data" was null or undefined when calling v2SendPost().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
const response = await this.request(
{
path: `/v2/send`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: ApiSendMessageV2ToJSON(requestParameters["data"]),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
ApiSendMessageResponseFromJSON(jsonValue),
);
}
/**
* Send a signal message. Set the text_mode to \'styled\' in case you want to add formatting to your text message. Styling Options: *italic text*, **bold text**, ~strikethrough text~.
* Send a signal message.
*/
async v2SendPost(
requestParameters: V2SendPostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<ApiSendMessageResponse> {
const response = await this.v2SendPostRaw(requestParameters, initOverrides);
return await response.value();
}
}

View file

@ -5,83 +5,92 @@
* This is the Signal Cli REST API documentation.
*
* The version of the OpenAPI document: 1.0
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import type {
ApiError,
ApiUpdateProfileRequest,
} from '../models/index';
import * as runtime from "../runtime.js";
import type { ApiError, ApiUpdateProfileRequest } from "../models/index.js";
import {
ApiErrorFromJSON,
ApiErrorToJSON,
ApiUpdateProfileRequestFromJSON,
ApiUpdateProfileRequestToJSON,
} from '../models/index';
ApiErrorFromJSON,
ApiErrorToJSON,
ApiUpdateProfileRequestFromJSON,
ApiUpdateProfileRequestToJSON,
} from "../models/index.js";
export interface V1ProfilesNumberPutRequest {
number: string;
data: ApiUpdateProfileRequest;
number: string;
data: ApiUpdateProfileRequest;
}
/**
*
*
*/
export class ProfilesApi extends runtime.BaseAPI {
/**
* Set your name and optional an avatar.
* Update Profile.
*/
async v1ProfilesNumberPutRaw(requestParameters: V1ProfilesNumberPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
if (requestParameters['number'] == null) {
throw new runtime.RequiredError(
'number',
'Required parameter "number" was null or undefined when calling v1ProfilesNumberPut().'
);
}
if (requestParameters['data'] == null) {
throw new runtime.RequiredError(
'data',
'Required parameter "data" was null or undefined when calling v1ProfilesNumberPut().'
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
const response = await this.request({
path: `/v1/profiles/{number}`.replace(`{${"number"}}`, encodeURIComponent(String(requestParameters['number']))),
method: 'PUT',
headers: headerParameters,
query: queryParameters,
body: ApiUpdateProfileRequestToJSON(requestParameters['data']),
}, initOverrides);
if (this.isJsonMime(response.headers.get('content-type'))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
/**
* Set your name and optional an avatar.
* Update Profile.
*/
async v1ProfilesNumberPutRaw(
requestParameters: V1ProfilesNumberPutRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<string>> {
if (requestParameters["number"] == null) {
throw new runtime.RequiredError(
"number",
'Required parameter "number" was null or undefined when calling v1ProfilesNumberPut().',
);
}
/**
* Set your name and optional an avatar.
* Update Profile.
*/
async v1ProfilesNumberPut(requestParameters: V1ProfilesNumberPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
const response = await this.v1ProfilesNumberPutRaw(requestParameters, initOverrides);
return await response.value();
if (requestParameters["data"] == null) {
throw new runtime.RequiredError(
"data",
'Required parameter "data" was null or undefined when calling v1ProfilesNumberPut().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
const response = await this.request(
{
path: `/v1/profiles/{number}`.replace(
`{${"number"}}`,
encodeURIComponent(String(requestParameters["number"])),
),
method: "PUT",
headers: headerParameters,
query: queryParameters,
body: ApiUpdateProfileRequestToJSON(requestParameters["data"]),
},
initOverrides,
);
if (this.isJsonMime(response.headers.get("content-type"))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
}
/**
* Set your name and optional an avatar.
* Update Profile.
*/
async v1ProfilesNumberPut(
requestParameters: V1ProfilesNumberPutRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<string> {
const response = await this.v1ProfilesNumberPutRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
}

View file

@ -5,121 +5,139 @@
* This is the Signal Cli REST API documentation.
*
* The version of the OpenAPI document: 1.0
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import type {
ApiError,
ApiReaction,
} from '../models/index';
import * as runtime from "../runtime.js";
import type { ApiError, ApiReaction } from "../models/index.js";
import {
ApiErrorFromJSON,
ApiErrorToJSON,
ApiReactionFromJSON,
ApiReactionToJSON,
} from '../models/index';
ApiErrorFromJSON,
ApiErrorToJSON,
ApiReactionFromJSON,
ApiReactionToJSON,
} from "../models/index.js";
export interface V1ReactionsNumberDeleteRequest {
data: ApiReaction;
data: ApiReaction;
}
export interface V1ReactionsNumberPostRequest {
data: ApiReaction;
data: ApiReaction;
}
/**
*
*
*/
export class ReactionsApi extends runtime.BaseAPI {
/**
* Remove a reaction
* Remove a reaction.
*/
async v1ReactionsNumberDeleteRaw(requestParameters: V1ReactionsNumberDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
if (requestParameters['data'] == null) {
throw new runtime.RequiredError(
'data',
'Required parameter "data" was null or undefined when calling v1ReactionsNumberDelete().'
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
const response = await this.request({
path: `/v1/reactions/{number}`,
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
body: ApiReactionToJSON(requestParameters['data']),
}, initOverrides);
if (this.isJsonMime(response.headers.get('content-type'))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
/**
* Remove a reaction
* Remove a reaction.
*/
async v1ReactionsNumberDeleteRaw(
requestParameters: V1ReactionsNumberDeleteRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<string>> {
if (requestParameters["data"] == null) {
throw new runtime.RequiredError(
"data",
'Required parameter "data" was null or undefined when calling v1ReactionsNumberDelete().',
);
}
/**
* Remove a reaction
* Remove a reaction.
*/
async v1ReactionsNumberDelete(requestParameters: V1ReactionsNumberDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
const response = await this.v1ReactionsNumberDeleteRaw(requestParameters, initOverrides);
return await response.value();
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
const response = await this.request(
{
path: `/v1/reactions/{number}`,
method: "DELETE",
headers: headerParameters,
query: queryParameters,
body: ApiReactionToJSON(requestParameters["data"]),
},
initOverrides,
);
if (this.isJsonMime(response.headers.get("content-type"))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
}
/**
* Remove a reaction
* Remove a reaction.
*/
async v1ReactionsNumberDelete(
requestParameters: V1ReactionsNumberDeleteRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<string> {
const response = await this.v1ReactionsNumberDeleteRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* React to a message
* Send a reaction.
*/
async v1ReactionsNumberPostRaw(
requestParameters: V1ReactionsNumberPostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<string>> {
if (requestParameters["data"] == null) {
throw new runtime.RequiredError(
"data",
'Required parameter "data" was null or undefined when calling v1ReactionsNumberPost().',
);
}
/**
* React to a message
* Send a reaction.
*/
async v1ReactionsNumberPostRaw(requestParameters: V1ReactionsNumberPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
if (requestParameters['data'] == null) {
throw new runtime.RequiredError(
'data',
'Required parameter "data" was null or undefined when calling v1ReactionsNumberPost().'
);
}
const queryParameters: any = {};
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
headerParameters['Content-Type'] = 'application/json';
const response = await this.request(
{
path: `/v1/reactions/{number}`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: ApiReactionToJSON(requestParameters["data"]),
},
initOverrides,
);
const response = await this.request({
path: `/v1/reactions/{number}`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: ApiReactionToJSON(requestParameters['data']),
}, initOverrides);
if (this.isJsonMime(response.headers.get('content-type'))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
}
/**
* React to a message
* Send a reaction.
*/
async v1ReactionsNumberPost(requestParameters: V1ReactionsNumberPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
const response = await this.v1ReactionsNumberPostRaw(requestParameters, initOverrides);
return await response.value();
if (this.isJsonMime(response.headers.get("content-type"))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
}
/**
* React to a message
* Send a reaction.
*/
async v1ReactionsNumberPost(
requestParameters: V1ReactionsNumberPostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<string> {
const response = await this.v1ReactionsNumberPostRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
}

View file

@ -5,75 +5,81 @@
* This is the Signal Cli REST API documentation.
*
* The version of the OpenAPI document: 1.0
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import type {
ApiError,
ApiReceipt,
} from '../models/index';
import * as runtime from "../runtime.js";
import type { ApiError, ApiReceipt } from "../models/index.js";
import {
ApiErrorFromJSON,
ApiErrorToJSON,
ApiReceiptFromJSON,
ApiReceiptToJSON,
} from '../models/index';
ApiErrorFromJSON,
ApiErrorToJSON,
ApiReceiptFromJSON,
ApiReceiptToJSON,
} from "../models/index.js";
export interface V1ReceiptsNumberPostRequest {
data: ApiReceipt;
data: ApiReceipt;
}
/**
*
*
*/
export class ReceiptsApi extends runtime.BaseAPI {
/**
* Send a read or viewed receipt
* Send a receipt.
*/
async v1ReceiptsNumberPostRaw(requestParameters: V1ReceiptsNumberPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
if (requestParameters['data'] == null) {
throw new runtime.RequiredError(
'data',
'Required parameter "data" was null or undefined when calling v1ReceiptsNumberPost().'
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
const response = await this.request({
path: `/v1/receipts/{number}`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: ApiReceiptToJSON(requestParameters['data']),
}, initOverrides);
if (this.isJsonMime(response.headers.get('content-type'))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
/**
* Send a read or viewed receipt
* Send a receipt.
*/
async v1ReceiptsNumberPostRaw(
requestParameters: V1ReceiptsNumberPostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<string>> {
if (requestParameters["data"] == null) {
throw new runtime.RequiredError(
"data",
'Required parameter "data" was null or undefined when calling v1ReceiptsNumberPost().',
);
}
/**
* Send a read or viewed receipt
* Send a receipt.
*/
async v1ReceiptsNumberPost(requestParameters: V1ReceiptsNumberPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
const response = await this.v1ReceiptsNumberPostRaw(requestParameters, initOverrides);
return await response.value();
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
const response = await this.request(
{
path: `/v1/receipts/{number}`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: ApiReceiptToJSON(requestParameters["data"]),
},
initOverrides,
);
if (this.isJsonMime(response.headers.get("content-type"))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
}
/**
* Send a read or viewed receipt
* Send a receipt.
*/
async v1ReceiptsNumberPost(
requestParameters: V1ReceiptsNumberPostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<string> {
const response = await this.v1ReceiptsNumberPostRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
}

View file

@ -5,80 +5,91 @@
* This is the Signal Cli REST API documentation.
*
* The version of the OpenAPI document: 1.0
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import type {
ApiError,
ApiSearchResponse,
} from '../models/index';
import * as runtime from "../runtime.js";
import type { ApiError, ApiSearchResponse } from "../models/index.js";
import {
ApiErrorFromJSON,
ApiErrorToJSON,
ApiSearchResponseFromJSON,
ApiSearchResponseToJSON,
} from '../models/index';
ApiErrorFromJSON,
ApiErrorToJSON,
ApiSearchResponseFromJSON,
ApiSearchResponseToJSON,
} from "../models/index.js";
export interface V1SearchGetRequest {
number: string;
numbers: Array<string>;
number: string;
numbers: Array<string>;
}
/**
*
*
*/
export class SearchApi extends runtime.BaseAPI {
/**
* Check if one or more phone numbers are registered with the Signal Service.
* Check if one or more phone numbers are registered with the Signal Service.
*/
async v1SearchGetRaw(requestParameters: V1SearchGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ApiSearchResponse>>> {
if (requestParameters['number'] == null) {
throw new runtime.RequiredError(
'number',
'Required parameter "number" was null or undefined when calling v1SearchGet().'
);
}
if (requestParameters['numbers'] == null) {
throw new runtime.RequiredError(
'numbers',
'Required parameter "numbers" was null or undefined when calling v1SearchGet().'
);
}
const queryParameters: any = {};
if (requestParameters['numbers'] != null) {
queryParameters['numbers'] = requestParameters['numbers'];
}
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request({
path: `/v1/search`.replace(`{${"number"}}`, encodeURIComponent(String(requestParameters['number']))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(ApiSearchResponseFromJSON));
/**
* Check if one or more phone numbers are registered with the Signal Service.
* Check if one or more phone numbers are registered with the Signal Service.
*/
async v1SearchGetRaw(
requestParameters: V1SearchGetRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<Array<ApiSearchResponse>>> {
if (requestParameters["number"] == null) {
throw new runtime.RequiredError(
"number",
'Required parameter "number" was null or undefined when calling v1SearchGet().',
);
}
/**
* Check if one or more phone numbers are registered with the Signal Service.
* Check if one or more phone numbers are registered with the Signal Service.
*/
async v1SearchGet(requestParameters: V1SearchGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ApiSearchResponse>> {
const response = await this.v1SearchGetRaw(requestParameters, initOverrides);
return await response.value();
if (requestParameters["numbers"] == null) {
throw new runtime.RequiredError(
"numbers",
'Required parameter "numbers" was null or undefined when calling v1SearchGet().',
);
}
const queryParameters: any = {};
if (requestParameters["numbers"] != null) {
queryParameters["numbers"] = requestParameters["numbers"];
}
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request(
{
path: `/v1/search`.replace(
`{${"number"}}`,
encodeURIComponent(String(requestParameters["number"])),
),
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
jsonValue.map(ApiSearchResponseFromJSON),
);
}
/**
* Check if one or more phone numbers are registered with the Signal Service.
* Check if one or more phone numbers are registered with the Signal Service.
*/
async v1SearchGet(
requestParameters: V1SearchGetRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<Array<ApiSearchResponse>> {
const response = await this.v1SearchGetRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
}

View file

@ -5,127 +5,157 @@
* This is the Signal Cli REST API documentation.
*
* The version of the OpenAPI document: 1.0
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import * as runtime from "../runtime.js";
import type {
ApiAddStickerPackRequest,
ApiError,
ClientListInstalledStickerPacksResponse,
} from '../models/index';
} from "../models/index.js";
import {
ApiAddStickerPackRequestFromJSON,
ApiAddStickerPackRequestToJSON,
ApiErrorFromJSON,
ApiErrorToJSON,
ClientListInstalledStickerPacksResponseFromJSON,
ClientListInstalledStickerPacksResponseToJSON,
} from '../models/index';
ApiAddStickerPackRequestFromJSON,
ApiAddStickerPackRequestToJSON,
ApiErrorFromJSON,
ApiErrorToJSON,
ClientListInstalledStickerPacksResponseFromJSON,
ClientListInstalledStickerPacksResponseToJSON,
} from "../models/index.js";
export interface V1StickerPacksNumberGetRequest {
number: string;
number: string;
}
export interface V1StickerPacksNumberPostRequest {
number: string;
data: ApiAddStickerPackRequest;
number: string;
data: ApiAddStickerPackRequest;
}
/**
*
*
*/
export class StickerPacksApi extends runtime.BaseAPI {
/**
* List Installed Sticker Packs.
* List Installed Sticker Packs.
*/
async v1StickerPacksNumberGetRaw(requestParameters: V1StickerPacksNumberGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ClientListInstalledStickerPacksResponse>>> {
if (requestParameters['number'] == null) {
throw new runtime.RequiredError(
'number',
'Required parameter "number" was null or undefined when calling v1StickerPacksNumberGet().'
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request({
path: `/v1/sticker-packs/{number}`.replace(`{${"number"}}`, encodeURIComponent(String(requestParameters['number']))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(ClientListInstalledStickerPacksResponseFromJSON));
/**
* List Installed Sticker Packs.
* List Installed Sticker Packs.
*/
async v1StickerPacksNumberGetRaw(
requestParameters: V1StickerPacksNumberGetRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<
runtime.ApiResponse<Array<ClientListInstalledStickerPacksResponse>>
> {
if (requestParameters["number"] == null) {
throw new runtime.RequiredError(
"number",
'Required parameter "number" was null or undefined when calling v1StickerPacksNumberGet().',
);
}
/**
* List Installed Sticker Packs.
* List Installed Sticker Packs.
*/
async v1StickerPacksNumberGet(requestParameters: V1StickerPacksNumberGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ClientListInstalledStickerPacksResponse> | null | undefined > {
const response = await this.v1StickerPacksNumberGetRaw(requestParameters, initOverrides);
switch (response.raw.status) {
case 200:
return await response.value();
case 204:
return null;
default:
return await response.value();
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request(
{
path: `/v1/sticker-packs/{number}`.replace(
`{${"number"}}`,
encodeURIComponent(String(requestParameters["number"])),
),
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
jsonValue.map(ClientListInstalledStickerPacksResponseFromJSON),
);
}
/**
* List Installed Sticker Packs.
* List Installed Sticker Packs.
*/
async v1StickerPacksNumberGet(
requestParameters: V1StickerPacksNumberGetRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<
Array<ClientListInstalledStickerPacksResponse> | null | undefined
> {
const response = await this.v1StickerPacksNumberGetRaw(
requestParameters,
initOverrides,
);
switch (response.raw.status) {
case 200:
return await response.value();
case 204:
return null;
default:
return await response.value();
}
}
/**
* In order to add a sticker pack, browse to https://signalstickers.org/ and select the sticker pack you want to add. Then, press the \"Add to Signal\" button. If you look at the address bar in your browser you should see an URL in this format: https://signal.art/addstickers/#pack_id=XXX&pack_key=YYY, where XXX is the pack_id and YYY is the pack_key.
* Add Sticker Pack.
*/
async v1StickerPacksNumberPostRaw(
requestParameters: V1StickerPacksNumberPostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<void>> {
if (requestParameters["number"] == null) {
throw new runtime.RequiredError(
"number",
'Required parameter "number" was null or undefined when calling v1StickerPacksNumberPost().',
);
}
/**
* In order to add a sticker pack, browse to https://signalstickers.org/ and select the sticker pack you want to add. Then, press the \"Add to Signal\" button. If you look at the address bar in your browser you should see an URL in this format: https://signal.art/addstickers/#pack_id=XXX&pack_key=YYY, where XXX is the pack_id and YYY is the pack_key.
* Add Sticker Pack.
*/
async v1StickerPacksNumberPostRaw(requestParameters: V1StickerPacksNumberPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
if (requestParameters['number'] == null) {
throw new runtime.RequiredError(
'number',
'Required parameter "number" was null or undefined when calling v1StickerPacksNumberPost().'
);
}
if (requestParameters['data'] == null) {
throw new runtime.RequiredError(
'data',
'Required parameter "data" was null or undefined when calling v1StickerPacksNumberPost().'
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
const response = await this.request({
path: `/v1/sticker-packs/{number}`.replace(`{${"number"}}`, encodeURIComponent(String(requestParameters['number']))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: ApiAddStickerPackRequestToJSON(requestParameters['data']),
}, initOverrides);
return new runtime.VoidApiResponse(response);
if (requestParameters["data"] == null) {
throw new runtime.RequiredError(
"data",
'Required parameter "data" was null or undefined when calling v1StickerPacksNumberPost().',
);
}
/**
* In order to add a sticker pack, browse to https://signalstickers.org/ and select the sticker pack you want to add. Then, press the \"Add to Signal\" button. If you look at the address bar in your browser you should see an URL in this format: https://signal.art/addstickers/#pack_id=XXX&pack_key=YYY, where XXX is the pack_id and YYY is the pack_key.
* Add Sticker Pack.
*/
async v1StickerPacksNumberPost(requestParameters: V1StickerPacksNumberPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.v1StickerPacksNumberPostRaw(requestParameters, initOverrides);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
const response = await this.request(
{
path: `/v1/sticker-packs/{number}`.replace(
`{${"number"}}`,
encodeURIComponent(String(requestParameters["number"])),
),
method: "POST",
headers: headerParameters,
query: queryParameters,
body: ApiAddStickerPackRequestToJSON(requestParameters["data"]),
},
initOverrides,
);
return new runtime.VoidApiResponse(response);
}
/**
* In order to add a sticker pack, browse to https://signalstickers.org/ and select the sticker pack you want to add. Then, press the \"Add to Signal\" button. If you look at the address bar in your browser you should see an URL in this format: https://signal.art/addstickers/#pack_id=XXX&pack_key=YYY, where XXX is the pack_id and YYY is the pack_key.
* Add Sticker Pack.
*/
async v1StickerPacksNumberPost(
requestParameters: V1StickerPacksNumberPostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<void> {
await this.v1StickerPacksNumberPostRaw(requestParameters, initOverrides);
}
}

View file

@ -1,15 +1,15 @@
/* tslint:disable */
/* eslint-disable */
export * from './AccountsApi';
export * from './AttachmentsApi';
export * from './ContactsApi';
export * from './DevicesApi';
export * from './GeneralApi';
export * from './GroupsApi';
export * from './IdentitiesApi';
export * from './MessagesApi';
export * from './ProfilesApi';
export * from './ReactionsApi';
export * from './ReceiptsApi';
export * from './SearchApi';
export * from './StickerPacksApi';
export * from "./AccountsApi.js";
export * from "./AttachmentsApi.js";
export * from "./ContactsApi.js";
export * from "./DevicesApi.js";
export * from "./GeneralApi.js";
export * from "./GroupsApi.js";
export * from "./IdentitiesApi.js";
export * from "./MessagesApi.js";
export * from "./ProfilesApi.js";
export * from "./ReactionsApi.js";
export * from "./ReceiptsApi.js";
export * from "./SearchApi.js";
export * from "./StickerPacksApi.js";