Repo cleanup
This commit is contained in:
parent
59872f579a
commit
e941353b64
444 changed files with 1485 additions and 21978 deletions
|
|
@ -1,20 +0,0 @@
|
|||
export { db } from "./lib/database.js";
|
||||
export type {
|
||||
Database,
|
||||
FacebookBot,
|
||||
SignalBot,
|
||||
WhatsappBot,
|
||||
VoiceLine,
|
||||
Webhook,
|
||||
User,
|
||||
} from "./lib/database.js";
|
||||
export { getWorkerUtils } from "./lib/utils.js";
|
||||
export {
|
||||
getMaxAttachmentSize,
|
||||
getMaxTotalAttachmentSize,
|
||||
MAX_ATTACHMENTS,
|
||||
} from "./lib/config/attachments.js";
|
||||
export {
|
||||
getSignalAutoGroupNameTemplate,
|
||||
buildSignalGroupName,
|
||||
} from "./lib/config/signal.js";
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
/**
|
||||
* Attachment size configuration for messaging channels
|
||||
*
|
||||
* Environment variables:
|
||||
* - BRIDGE_MAX_ATTACHMENT_SIZE_MB: Maximum size for a single attachment in MB (default: 50)
|
||||
*/
|
||||
|
||||
/**
|
||||
* Get the maximum attachment size in bytes from environment variable
|
||||
* Defaults to 50MB if not set
|
||||
*/
|
||||
export function getMaxAttachmentSize(): number {
|
||||
const envValue = process.env.BRIDGE_MAX_ATTACHMENT_SIZE_MB;
|
||||
const sizeInMB = envValue ? parseInt(envValue, 10) : 50;
|
||||
|
||||
// Validate the value
|
||||
if (isNaN(sizeInMB) || sizeInMB <= 0) {
|
||||
console.warn(`Invalid BRIDGE_MAX_ATTACHMENT_SIZE_MB value: ${envValue}, using default 50MB`);
|
||||
return 50 * 1024 * 1024;
|
||||
}
|
||||
|
||||
return sizeInMB * 1024 * 1024;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the maximum total size for all attachments in a message
|
||||
* This is 4x the single attachment size
|
||||
*/
|
||||
export function getMaxTotalAttachmentSize(): number {
|
||||
return getMaxAttachmentSize() * 4;
|
||||
}
|
||||
|
||||
/**
|
||||
* Maximum number of attachments per message
|
||||
*/
|
||||
export const MAX_ATTACHMENTS = 10;
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
/**
|
||||
* Signal configuration
|
||||
*
|
||||
* Environment variables:
|
||||
* - SIGNAL_AUTO_GROUP_NAME_TEMPLATE: Template for auto-created group names (default: "Support Request: {conversationId}")
|
||||
* Available placeholders: {conversationId}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Get the Signal auto-group name template from environment variable
|
||||
* Defaults to "Support Request: {conversationId}" if not set
|
||||
*/
|
||||
export function getSignalAutoGroupNameTemplate(): string {
|
||||
const template = process.env.SIGNAL_AUTO_GROUP_NAME_TEMPLATE;
|
||||
|
||||
if (!template) {
|
||||
return "Support Request: {conversationId}";
|
||||
}
|
||||
|
||||
return template;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a Signal group name from the template and conversation ID
|
||||
*/
|
||||
export function buildSignalGroupName(conversationId: string): string {
|
||||
const template = getSignalAutoGroupNameTemplate();
|
||||
return template.replace('{conversationId}', conversationId);
|
||||
}
|
||||
|
|
@ -1,197 +0,0 @@
|
|||
import { PostgresDialect, CamelCasePlugin } from "kysely";
|
||||
import type { GeneratedAlways, Generated, ColumnType, Selectable } from "kysely";
|
||||
import pg from "pg";
|
||||
import { KyselyAuth } from "@auth/kysely-adapter";
|
||||
const { Pool, types } = pg;
|
||||
|
||||
type Timestamp = ColumnType<Date, Date | string>;
|
||||
|
||||
types.setTypeParser(types.builtins.TIMESTAMPTZ, (val) => new Date(val).toISOString());
|
||||
|
||||
type GraphileJob = {
|
||||
taskIdentifier: string;
|
||||
payload: Record<string, any>;
|
||||
priority: number;
|
||||
maxAttempts: number;
|
||||
key: string;
|
||||
queueName: string;
|
||||
};
|
||||
|
||||
export const addGraphileJob = async (jobInfo: GraphileJob) => {
|
||||
// await db.insertInto("graphile_worker.jobs").values(jobInfo).execute();
|
||||
};
|
||||
|
||||
export interface Database {
|
||||
User: {
|
||||
id: string;
|
||||
name: string | null;
|
||||
email: string;
|
||||
emailVerified: Date | null;
|
||||
image: string | null;
|
||||
};
|
||||
|
||||
Account: {
|
||||
id: GeneratedAlways<string>;
|
||||
userId: string;
|
||||
type: "oidc" | "oauth" | "email" | "webauthn";
|
||||
provider: string;
|
||||
providerAccountId: string;
|
||||
refresh_token: string | undefined;
|
||||
access_token: string | undefined;
|
||||
expires_at: number | undefined;
|
||||
token_type: Lowercase<string> | undefined;
|
||||
scope: string | undefined;
|
||||
id_token: string | undefined;
|
||||
session_state: string | undefined;
|
||||
};
|
||||
|
||||
Session: {
|
||||
id: GeneratedAlways<string>;
|
||||
userId: string;
|
||||
sessionToken: string;
|
||||
expires: Date;
|
||||
};
|
||||
|
||||
VerificationToken: {
|
||||
identifier: string;
|
||||
token: string;
|
||||
expires: Date;
|
||||
};
|
||||
|
||||
WhatsappBot: {
|
||||
id: GeneratedAlways<string>;
|
||||
name: string;
|
||||
description: string;
|
||||
phoneNumber: string;
|
||||
token: string;
|
||||
qrCode: string;
|
||||
verified: boolean;
|
||||
userId: string;
|
||||
createdBy: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
};
|
||||
|
||||
FacebookBot: {
|
||||
id: GeneratedAlways<string>;
|
||||
name: string | null;
|
||||
description: string | null;
|
||||
token: string | null;
|
||||
pageAccessToken: string | null;
|
||||
appSecret: string | null;
|
||||
verifyToken: string | null;
|
||||
pageId: string | null;
|
||||
appId: string | null;
|
||||
userId: string | null;
|
||||
verified: Generated<boolean>;
|
||||
createdAt: GeneratedAlways<Timestamp>;
|
||||
updatedAt: GeneratedAlways<Timestamp>;
|
||||
};
|
||||
|
||||
VoiceLine: {
|
||||
id: GeneratedAlways<string>;
|
||||
name: string;
|
||||
description: string;
|
||||
createdBy: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
};
|
||||
|
||||
SignalBot: {
|
||||
id: GeneratedAlways<string>;
|
||||
name: string;
|
||||
description: string;
|
||||
phoneNumber: string;
|
||||
qrCode: string;
|
||||
token: string;
|
||||
verified: boolean;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
};
|
||||
|
||||
Webhook: {
|
||||
id: GeneratedAlways<string>;
|
||||
name: string;
|
||||
description: string;
|
||||
backendType: string;
|
||||
backendId: string;
|
||||
endpointUrl: string;
|
||||
httpMethod: "post" | "put";
|
||||
headers: Record<string, any>;
|
||||
createdBy: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
};
|
||||
}
|
||||
|
||||
export type FacebookBot = Selectable<Database["FacebookBot"]>;
|
||||
export type SignalBot = Selectable<Database["SignalBot"]>;
|
||||
export type WhatsappBot = Selectable<Database["WhatsappBot"]>;
|
||||
export type VoiceLine = Selectable<Database["VoiceLine"]>;
|
||||
export type Webhook = Selectable<Database["Webhook"]>;
|
||||
export type User = Selectable<Database["User"]>;
|
||||
|
||||
// Lazy database initialization to avoid errors during build time
|
||||
let _db: KyselyAuth<Database> | undefined;
|
||||
|
||||
function getDb(): KyselyAuth<Database> {
|
||||
if (_db) {
|
||||
return _db;
|
||||
}
|
||||
|
||||
// Validate environment variables
|
||||
const DATABASE_HOST = process.env.DATABASE_HOST;
|
||||
const DATABASE_NAME = process.env.DATABASE_NAME;
|
||||
const DATABASE_PORT = process.env.DATABASE_PORT;
|
||||
const DATABASE_USER = process.env.DATABASE_USER;
|
||||
const DATABASE_PASSWORD = process.env.DATABASE_PASSWORD;
|
||||
|
||||
if (
|
||||
!DATABASE_HOST ||
|
||||
!DATABASE_NAME ||
|
||||
!DATABASE_PORT ||
|
||||
!DATABASE_USER ||
|
||||
!DATABASE_PASSWORD
|
||||
) {
|
||||
throw new Error(
|
||||
"Missing required database environment variables: DATABASE_HOST, DATABASE_NAME, DATABASE_PORT, DATABASE_USER, DATABASE_PASSWORD",
|
||||
);
|
||||
}
|
||||
|
||||
const port = parseInt(DATABASE_PORT, 10);
|
||||
if (isNaN(port) || port < 1 || port > 65535) {
|
||||
throw new Error(
|
||||
`Invalid DATABASE_PORT: ${DATABASE_PORT}. Must be a number between 1 and 65535.`,
|
||||
);
|
||||
}
|
||||
|
||||
_db = new KyselyAuth<Database>({
|
||||
dialect: new PostgresDialect({
|
||||
pool: new Pool({
|
||||
host: DATABASE_HOST,
|
||||
database: DATABASE_NAME,
|
||||
port,
|
||||
user: DATABASE_USER,
|
||||
password: DATABASE_PASSWORD,
|
||||
}),
|
||||
}) as any,
|
||||
plugins: [new CamelCasePlugin() as any],
|
||||
});
|
||||
|
||||
return _db;
|
||||
}
|
||||
|
||||
// Export db as a getter that lazily initializes the database
|
||||
export const db = new Proxy({} as KyselyAuth<Database>, {
|
||||
get(_target, prop) {
|
||||
const instance = getDb();
|
||||
const value = (instance as any)[prop];
|
||||
|
||||
// If it's a function, bind it to the actual instance to preserve 'this' context
|
||||
if (typeof value === "function") {
|
||||
return value.bind(instance);
|
||||
}
|
||||
|
||||
return value;
|
||||
},
|
||||
});
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
import { makeWorkerUtils, WorkerUtils } from "graphile-worker";
|
||||
|
||||
let workerUtils: WorkerUtils;
|
||||
|
||||
export const getWorkerUtils = async () => {
|
||||
if (!workerUtils) {
|
||||
workerUtils = await makeWorkerUtils({
|
||||
connectionString: process.env.DATABASE_URL,
|
||||
});
|
||||
}
|
||||
|
||||
return workerUtils;
|
||||
};
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
{
|
||||
"name": "@link-stack/bridge-common",
|
||||
"version": "3.5.0-beta.1",
|
||||
"main": "build/main/index.js",
|
||||
"type": "module",
|
||||
"author": "Darren Clarke <darren@redaranj.com>",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"scripts": {
|
||||
"build": "tsc -p tsconfig.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@auth/kysely-adapter": "^1.10.0",
|
||||
"graphile-worker": "^0.16.6",
|
||||
"kysely": "0.27.5",
|
||||
"pg": "^8.16.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@link-stack/eslint-config": "workspace:*",
|
||||
"@link-stack/typescript-config": "workspace:*",
|
||||
"@types/pg": "^8.15.5",
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"extends": "@link-stack/typescript-config",
|
||||
"compilerOptions": {
|
||||
"outDir": "build/main",
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"include": ["**/*.ts", "**/.*.ts"],
|
||||
"exclude": ["node_modules", "build", "database"]
|
||||
}
|
||||
|
|
@ -1,127 +0,0 @@
|
|||
"use server";
|
||||
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { db, Database } from "@link-stack/bridge-common";
|
||||
import { FieldDescription, Entity } from "../lib/service";
|
||||
import crypto from "crypto";
|
||||
|
||||
const generateToken = () => {
|
||||
const length = 20;
|
||||
const randomBytes = crypto.randomBytes(length);
|
||||
const randomString = randomBytes.toString("hex").slice(0, length);
|
||||
|
||||
return randomString;
|
||||
};
|
||||
|
||||
type CreateActionArgs = {
|
||||
entity: Entity;
|
||||
table: keyof Database;
|
||||
fields: FieldDescription[];
|
||||
currentState: any;
|
||||
formData: FormData;
|
||||
};
|
||||
|
||||
export const createAction = async ({
|
||||
entity,
|
||||
table,
|
||||
fields,
|
||||
currentState,
|
||||
formData,
|
||||
}: CreateActionArgs) => {
|
||||
const newRecord = fields.reduce(
|
||||
(acc: Record<string, any>, field: FieldDescription) => {
|
||||
if (field.autogenerated === "token") {
|
||||
acc[field.name] = generateToken();
|
||||
return acc;
|
||||
}
|
||||
|
||||
acc[field.name] = formData.get(field.name)?.toString() ?? null;
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
);
|
||||
|
||||
const record = await db
|
||||
.insertInto(table)
|
||||
.values(newRecord)
|
||||
.returning(["id"])
|
||||
.executeTakeFirstOrThrow();
|
||||
|
||||
revalidatePath(`/${entity}`);
|
||||
|
||||
return {
|
||||
...currentState,
|
||||
values: { ...newRecord, id: record.id },
|
||||
success: true,
|
||||
};
|
||||
};
|
||||
|
||||
type UpdateActionArgs = {
|
||||
entity: Entity;
|
||||
table: keyof Database;
|
||||
fields: FieldDescription[];
|
||||
currentState: any;
|
||||
formData: FormData;
|
||||
};
|
||||
|
||||
export const updateAction = async ({
|
||||
entity,
|
||||
table,
|
||||
fields,
|
||||
currentState,
|
||||
formData,
|
||||
}: UpdateActionArgs) => {
|
||||
const id = currentState.values.id;
|
||||
const updatedRecord = fields.reduce(
|
||||
(acc: Record<string, any>, field: FieldDescription) => {
|
||||
acc[field.name] = formData.get(field.name)?.toString() ?? null;
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
);
|
||||
|
||||
await db
|
||||
.updateTable(table)
|
||||
.set(updatedRecord)
|
||||
.where("id", "=", id)
|
||||
.executeTakeFirst();
|
||||
|
||||
revalidatePath(`/${entity}/${id}`);
|
||||
|
||||
return {
|
||||
...currentState,
|
||||
values: updatedRecord,
|
||||
success: true,
|
||||
};
|
||||
};
|
||||
|
||||
type DeleteActionArgs = {
|
||||
entity: Entity;
|
||||
table: keyof Database;
|
||||
id: string;
|
||||
};
|
||||
|
||||
export const deleteAction = async ({ entity, table, id }: DeleteActionArgs) => {
|
||||
await db.deleteFrom(table).where("id", "=", id).execute();
|
||||
|
||||
revalidatePath(`/${entity}`);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
export const selectAllAction = async (table: keyof Database) => {
|
||||
return db.selectFrom(table).selectAll().execute();
|
||||
};
|
||||
|
||||
type SelectOneArgs = {
|
||||
table: keyof Database;
|
||||
id: string;
|
||||
};
|
||||
|
||||
export const selectOneAction = async ({ table, id }: SelectOneArgs) => {
|
||||
return db
|
||||
.selectFrom(table)
|
||||
.selectAll()
|
||||
.where("id", "=", id)
|
||||
.executeTakeFirst();
|
||||
};
|
||||
|
|
@ -1,125 +0,0 @@
|
|||
"use client";
|
||||
|
||||
import { FC, useEffect, useState } from "react";
|
||||
import { useFormState } from "react-dom";
|
||||
import { Grid } from "@mui/material";
|
||||
import { useRouter } from "next/navigation";
|
||||
import {
|
||||
Button,
|
||||
Dialog,
|
||||
TextField,
|
||||
Select,
|
||||
MultiValueField,
|
||||
} from "@link-stack/ui";
|
||||
import { generateCreateAction } from "../lib/actions";
|
||||
import { FieldDescription } from "../lib/service";
|
||||
import { serviceConfig } from "../config/config";
|
||||
import { getBasePath } from "../lib/frontendUtils";
|
||||
|
||||
type CreateProps = {
|
||||
service: string;
|
||||
};
|
||||
|
||||
export const Create: FC<CreateProps> = ({ service }) => {
|
||||
const {
|
||||
[service]: { entity, table, displayName, createFields },
|
||||
} = serviceConfig;
|
||||
const fields = createFields.map((field: any) => {
|
||||
const copy = { ...field };
|
||||
Object.keys(copy).forEach((key: any) => {
|
||||
if (typeof copy[key] === "function") {
|
||||
delete copy[key];
|
||||
}
|
||||
});
|
||||
return copy;
|
||||
});
|
||||
|
||||
const createAction = generateCreateAction({ entity, table, fields });
|
||||
const initialState = {
|
||||
message: null,
|
||||
errors: {},
|
||||
values: fields.reduce(
|
||||
(acc: Record<string, any>, field: FieldDescription) => {
|
||||
acc[field.name] = field.defaultValue;
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
),
|
||||
};
|
||||
const [formState, formAction] = useFormState(createAction, initialState);
|
||||
const [liveFormState, setLiveFormState] = useState(formState);
|
||||
const updateFormState = (field: string, value: any) => {
|
||||
const newState = { ...liveFormState };
|
||||
newState.values[field] = value;
|
||||
setLiveFormState(newState);
|
||||
};
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
if (formState.success) {
|
||||
router.push(`${getBasePath()}${entity}/${formState.values.id}`);
|
||||
}
|
||||
}, [formState.success, router, entity, formState.values.id]);
|
||||
|
||||
return (
|
||||
<Dialog
|
||||
open
|
||||
title={`Create ${displayName}`}
|
||||
formAction={formAction}
|
||||
onClose={() => router.push(`${getBasePath()}${entity}`)}
|
||||
buttons={
|
||||
<Grid container justifyContent="space-between">
|
||||
<Grid item>
|
||||
<Button
|
||||
text="Cancel"
|
||||
kind="secondary"
|
||||
onClick={() => router.push(`${getBasePath()}${entity}`)}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<Button text="Save" kind="primary" type="submit" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
}
|
||||
>
|
||||
<Grid container direction="row" rowSpacing={3} columnSpacing={2}>
|
||||
{createFields.map(
|
||||
(field: FieldDescription) =>
|
||||
!field.hidden && (
|
||||
<Grid key={field.name} item xs={field.size ?? 6}>
|
||||
{field.kind === "select" && (
|
||||
<Select
|
||||
name={field.name}
|
||||
label={field.label}
|
||||
required={field.required ?? false}
|
||||
formState={liveFormState}
|
||||
getOptions={field.getOptions}
|
||||
updateFormState={updateFormState}
|
||||
/>
|
||||
)}
|
||||
{field.kind === "multi" && (
|
||||
<MultiValueField
|
||||
name={field.name}
|
||||
label={field.label}
|
||||
formState={formState}
|
||||
helperText={field.helperText}
|
||||
/>
|
||||
)}
|
||||
{(!field.kind || field.kind === "text") && (
|
||||
<TextField
|
||||
name={field.name}
|
||||
label={field.label}
|
||||
lines={field.lines ?? 1}
|
||||
required={field.required ?? false}
|
||||
formState={formState}
|
||||
helperText={field.helperText}
|
||||
/>
|
||||
)}
|
||||
</Grid>
|
||||
),
|
||||
)}
|
||||
</Grid>
|
||||
</Dialog>
|
||||
);
|
||||
};
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
"use client";
|
||||
|
||||
import { FC } from "react";
|
||||
import { Grid, Box } from "@mui/material";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { typography } from "@/styles/theme";
|
||||
|
||||
interface DeleteDialogProps {
|
||||
title: string;
|
||||
entity: string;
|
||||
children: any;
|
||||
}
|
||||
|
||||
export const DeleteDialog: FC<DeleteDialogProps> = ({
|
||||
title,
|
||||
entity,
|
||||
children,
|
||||
}) => {
|
||||
const router = useRouter();
|
||||
|
||||
const { h3 } = typography;
|
||||
|
||||
return (
|
||||
<Box sx={{ height: "100vh", backgroundColor: "#ddd", p: 3 }}>
|
||||
<Grid container direction="column">
|
||||
<Grid item>
|
||||
<Box sx={h3}>{title}</Box>
|
||||
</Grid>
|
||||
<Grid item>{children}</Grid>
|
||||
</Grid>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
|
@ -1,191 +0,0 @@
|
|||
"use client";
|
||||
|
||||
import { FC, useState } from "react";
|
||||
import { Grid, Box } from "@mui/material";
|
||||
import { useRouter } from "next/navigation";
|
||||
import {
|
||||
DisplayTextField,
|
||||
Button,
|
||||
Dialog,
|
||||
colors,
|
||||
typography,
|
||||
} from "@link-stack/ui";
|
||||
import { Selectable } from "kysely";
|
||||
import { type Database } from "@link-stack/bridge-common";
|
||||
import { QRCode } from "./QRCode";
|
||||
import { generateDeleteAction } from "../lib/actions";
|
||||
import { serviceConfig } from "../config/config";
|
||||
import { FieldDescription } from "../lib/service";
|
||||
import { getBasePath } from "../lib/frontendUtils";
|
||||
|
||||
type DetailProps = {
|
||||
service: string;
|
||||
row: Selectable<keyof Database>;
|
||||
};
|
||||
|
||||
export const Detail: FC<DetailProps> = ({ service, row }) => {
|
||||
const {
|
||||
[service]: { entity, table, displayName, displayFields: fields },
|
||||
} = serviceConfig;
|
||||
const id = row.id as string;
|
||||
const token = row.token as string;
|
||||
const deleteAction = generateDeleteAction({ entity, table });
|
||||
const router = useRouter();
|
||||
const { almostBlack } = colors;
|
||||
const { bodyLarge } = typography;
|
||||
const [showDeleteConfirmation, setShowDeleteConfirmation] = useState(false);
|
||||
const [showRelinkConfirmation, setShowRelinkConfirmation] = useState(false);
|
||||
const [isRelinking, setIsRelinking] = useState(false);
|
||||
|
||||
const continueDeleteAction = async () => {
|
||||
await deleteAction?.(id);
|
||||
setShowDeleteConfirmation(false);
|
||||
router.push(`${getBasePath()}${entity}`);
|
||||
};
|
||||
|
||||
const continueRelinkAction = async () => {
|
||||
setIsRelinking(true);
|
||||
try {
|
||||
const response = await fetch(`/link/api/${entity}/bots/${token}/relink`, {
|
||||
method: "POST",
|
||||
});
|
||||
if (response.ok) {
|
||||
setShowRelinkConfirmation(false);
|
||||
router.refresh();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Relink failed:", error);
|
||||
} finally {
|
||||
setIsRelinking(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Dialog
|
||||
open
|
||||
title={`${displayName} Detail`}
|
||||
onClose={() => router.push(`${getBasePath()}${entity}`)}
|
||||
buttons={
|
||||
<Grid container justifyContent="space-between">
|
||||
<Grid item container xs="auto" spacing={2}>
|
||||
<Grid item>
|
||||
<Button
|
||||
text="Delete"
|
||||
kind="destructive"
|
||||
onClick={() => setShowDeleteConfirmation(true)}
|
||||
/>
|
||||
</Grid>
|
||||
{service === "whatsapp" && (
|
||||
<Grid item>
|
||||
<Button
|
||||
text="Relink"
|
||||
kind="secondary"
|
||||
onClick={() => setShowRelinkConfirmation(true)}
|
||||
/>
|
||||
</Grid>
|
||||
)}
|
||||
<Grid item>
|
||||
<Button
|
||||
text="Edit"
|
||||
kind="secondary"
|
||||
href={`${getBasePath()}${entity}/${id}/edit`}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<Button
|
||||
text="Done"
|
||||
kind="primary"
|
||||
href={`${getBasePath()}${entity}`}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
}
|
||||
>
|
||||
<Grid container direction="row" rowSpacing={3} columnSpacing={2}>
|
||||
{fields.map((field: FieldDescription) => (
|
||||
<Grid item xs={field.size ?? 6} key={field.name}>
|
||||
{field.kind === "qrcode" && (
|
||||
<QRCode
|
||||
name={field.name}
|
||||
label={field.label}
|
||||
getValue={field.getQRCode}
|
||||
refreshInterval={field.refreshInterval}
|
||||
token={token}
|
||||
verified={row.verified as boolean}
|
||||
helperText={field.helperText}
|
||||
/>
|
||||
)}
|
||||
{(!field.kind || field.kind === "text") && (
|
||||
<DisplayTextField
|
||||
name={field.name}
|
||||
label={field.label}
|
||||
lines={field.lines ?? 1}
|
||||
value={row[field.name] as string}
|
||||
copyable={field.copyable ?? false}
|
||||
/>
|
||||
)}
|
||||
</Grid>
|
||||
))}
|
||||
</Grid>
|
||||
</Dialog>
|
||||
<Dialog
|
||||
open={showDeleteConfirmation}
|
||||
size="xs"
|
||||
title="Really delete?"
|
||||
buttons={
|
||||
<Grid container justifyContent="space-between">
|
||||
<Grid item>
|
||||
<Button
|
||||
text="Cancel"
|
||||
kind="secondary"
|
||||
onClick={() => setShowDeleteConfirmation(false)}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<Button
|
||||
text="Delete"
|
||||
kind="destructive"
|
||||
onClick={continueDeleteAction}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
}
|
||||
>
|
||||
<Box sx={{ ...bodyLarge, color: almostBlack }}>
|
||||
Are you sure you want to delete this record?
|
||||
</Box>
|
||||
</Dialog>
|
||||
<Dialog
|
||||
open={showRelinkConfirmation}
|
||||
size="xs"
|
||||
title="Relink WhatsApp Connection?"
|
||||
buttons={
|
||||
<Grid container justifyContent="space-between">
|
||||
<Grid item>
|
||||
<Button
|
||||
text="Cancel"
|
||||
kind="secondary"
|
||||
onClick={() => setShowRelinkConfirmation(false)}
|
||||
disabled={isRelinking}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<Button
|
||||
text={isRelinking ? "Relinking..." : "Relink"}
|
||||
kind="primary"
|
||||
onClick={continueRelinkAction}
|
||||
disabled={isRelinking}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
}
|
||||
>
|
||||
<Box sx={{ ...bodyLarge, color: almostBlack }}>
|
||||
This will disconnect the current WhatsApp link and generate a new QR code. You will need to scan the new QR code to reconnect. Continue?
|
||||
</Box>
|
||||
</Dialog>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
|
@ -1,122 +0,0 @@
|
|||
"use client";
|
||||
|
||||
import { FC, useEffect, useState } from "react";
|
||||
import { useFormState } from "react-dom";
|
||||
import { Grid } from "@mui/material";
|
||||
import { useRouter } from "next/navigation";
|
||||
import {
|
||||
TextField,
|
||||
Dialog,
|
||||
Button,
|
||||
Select,
|
||||
MultiValueField,
|
||||
} from "@link-stack/ui";
|
||||
import { Selectable } from "kysely";
|
||||
import { type Database } from "@link-stack/bridge-common";
|
||||
import { generateUpdateAction } from "../lib/actions";
|
||||
import { serviceConfig } from "../config/config";
|
||||
import { FieldDescription } from "../lib/service";
|
||||
import { getBasePath } from "../lib/frontendUtils";
|
||||
|
||||
type EditProps = {
|
||||
service: string;
|
||||
row: Selectable<keyof Database>;
|
||||
};
|
||||
|
||||
export const Edit: FC<EditProps> = ({ service, row }) => {
|
||||
const {
|
||||
[service]: { entity, table, displayName, updateFields },
|
||||
} = serviceConfig;
|
||||
const fields = updateFields.map((field: any) => {
|
||||
const copy = { ...field };
|
||||
Object.keys(copy).forEach((key: any) => {
|
||||
if (typeof copy[key] === "function") {
|
||||
delete copy[key];
|
||||
}
|
||||
});
|
||||
return copy;
|
||||
});
|
||||
const updateFieldNames = fields.map((val: FieldDescription) => val.name);
|
||||
const updateAction = generateUpdateAction({ entity, table, fields });
|
||||
const updateValues = Object.fromEntries(
|
||||
Object.entries(row).filter(([key]) => updateFieldNames.includes(key)),
|
||||
);
|
||||
updateValues.id = row.id;
|
||||
const initialState = {
|
||||
message: null,
|
||||
errors: {},
|
||||
values: updateValues,
|
||||
};
|
||||
const [formState, formAction] = useFormState(updateAction, initialState);
|
||||
const router = useRouter();
|
||||
const [liveFormState, setLiveFormState] = useState(formState);
|
||||
const updateFormState = (field: string, value: any) => {
|
||||
const newState = { ...liveFormState };
|
||||
newState.values[field] = value;
|
||||
setLiveFormState(newState);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (formState.success) {
|
||||
router.push(`${getBasePath()}${entity}`);
|
||||
}
|
||||
}, [formState.success, router, entity]);
|
||||
|
||||
return (
|
||||
<Dialog
|
||||
open
|
||||
title={`Edit ${displayName}`}
|
||||
formAction={formAction}
|
||||
onClose={() => router.push(`${getBasePath()}${entity}`)}
|
||||
buttons={
|
||||
<Grid container justifyContent="space-between">
|
||||
<Grid item>
|
||||
<Button
|
||||
text="Cancel"
|
||||
kind="secondary"
|
||||
onClick={() => router.push(`${getBasePath()}${entity}`)}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<Button text="Save" kind="primary" type="submit" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
}
|
||||
>
|
||||
<Grid container direction="row" rowSpacing={3} columnSpacing={2}>
|
||||
{updateFields.map((field: FieldDescription) => (
|
||||
<Grid key={field.name} item xs={field.size ?? 6}>
|
||||
{field.kind === "select" && (
|
||||
<Select
|
||||
name={field.name}
|
||||
label={field.label}
|
||||
required={field.required ?? false}
|
||||
formState={liveFormState}
|
||||
getOptions={field.getOptions}
|
||||
updateFormState={updateFormState}
|
||||
/>
|
||||
)}
|
||||
{field.kind === "multi" && (
|
||||
<MultiValueField
|
||||
name={field.name}
|
||||
label={field.label}
|
||||
formState={formState}
|
||||
helperText={field.helperText}
|
||||
/>
|
||||
)}
|
||||
{(!field.kind || field.kind === "text") && (
|
||||
<TextField
|
||||
name={field.name}
|
||||
label={field.label}
|
||||
lines={field.lines ?? 1}
|
||||
required={field.required ?? false}
|
||||
formState={formState}
|
||||
helperText={field.helperText}
|
||||
/>
|
||||
)}
|
||||
</Grid>
|
||||
))}
|
||||
</Grid>
|
||||
</Dialog>
|
||||
);
|
||||
};
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
import { FC } from "react";
|
||||
import { Box } from "@mui/material";
|
||||
|
||||
export const Home: FC = () => {
|
||||
return (
|
||||
<Box sx={{ p: 3, fontSize: 30, fontWeight: "bold", textAlign: "center" }}>
|
||||
Overview
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
"use client";
|
||||
|
||||
import { FC } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { List as InternalList, Button } from "@link-stack/ui";
|
||||
import { type Selectable } from "kysely";
|
||||
import { type Database } from "@link-stack/bridge-common";
|
||||
import { serviceConfig } from "../config/config";
|
||||
import { getBasePath } from "../lib/frontendUtils";
|
||||
|
||||
type ListProps = {
|
||||
service: string;
|
||||
rows: Selectable<keyof Database>[];
|
||||
};
|
||||
|
||||
export const List: FC<ListProps> = ({ service, rows }) => {
|
||||
const { displayName, entity, listColumns } = serviceConfig[service];
|
||||
const title = `${displayName}s`;
|
||||
const router = useRouter();
|
||||
|
||||
const onRowClick = (id: string) => {
|
||||
router.push(`${getBasePath()}${entity}/${id}`);
|
||||
};
|
||||
|
||||
return (
|
||||
<InternalList
|
||||
title={title}
|
||||
rows={rows}
|
||||
columns={listColumns}
|
||||
onRowClick={onRowClick}
|
||||
buttons={
|
||||
<Button
|
||||
text="Create"
|
||||
kind="primary"
|
||||
href={`${getBasePath()}${entity}/create`}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
import { FC, useEffect, useState } from "react";
|
||||
// @ts-ignore - react-qr-code doesn't have React 19 compatible types yet
|
||||
import QRCodeInternal from "react-qr-code";
|
||||
import { Box } from "@mui/material";
|
||||
import { colors } from "../styles/theme";
|
||||
|
||||
type QRCodeProps = {
|
||||
name: string;
|
||||
label: string;
|
||||
token: string;
|
||||
verified: boolean;
|
||||
helperText?: string;
|
||||
getValue?: (id: string) => Promise<Record<string, string>>;
|
||||
refreshInterval?: number;
|
||||
};
|
||||
|
||||
export const QRCode: FC<QRCodeProps> = ({
|
||||
name,
|
||||
label,
|
||||
token,
|
||||
verified,
|
||||
helperText,
|
||||
getValue,
|
||||
refreshInterval,
|
||||
}) => {
|
||||
const [value, setValue] = useState("");
|
||||
const [kind, setKind] = useState("data");
|
||||
const { white } = colors;
|
||||
|
||||
useEffect(() => {
|
||||
if (!verified && getValue && refreshInterval) {
|
||||
// Fetch immediately on mount
|
||||
const fetchQR = async () => {
|
||||
const { qr, kind } = await getValue(token);
|
||||
setValue(qr);
|
||||
setKind(kind);
|
||||
};
|
||||
fetchQR();
|
||||
|
||||
// Then set up interval for refreshes
|
||||
const interval = setInterval(fetchQR, refreshInterval * 1000);
|
||||
return () => clearInterval(interval);
|
||||
}
|
||||
}, [getValue, refreshInterval, token, verified]);
|
||||
|
||||
return !verified ? (
|
||||
<Box sx={{ backgroundColor: white, m: 2 }}>
|
||||
{value ? (
|
||||
kind === "data" ? (
|
||||
<QRCodeInternal value={value} />
|
||||
) : (
|
||||
<img src={value} alt={name} />
|
||||
)
|
||||
) : (
|
||||
<Box>Loading QR code...</Box>
|
||||
)}
|
||||
<Box>{helperText}</Box>
|
||||
</Box>
|
||||
) : null;
|
||||
};
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
type ServiceLayoutProps = {
|
||||
children: any;
|
||||
detail: any;
|
||||
edit: any;
|
||||
create: any;
|
||||
params: Promise<{
|
||||
segment: string[];
|
||||
}>;
|
||||
};
|
||||
|
||||
export const ServiceLayout = async ({
|
||||
children,
|
||||
detail,
|
||||
edit,
|
||||
create,
|
||||
params,
|
||||
}: ServiceLayoutProps) => {
|
||||
const { segment } = await params;
|
||||
const length = segment?.length ?? 0;
|
||||
const isCreate = length === 2 && segment[1] === "create";
|
||||
const isEdit = length === 3 && segment[2] === "edit";
|
||||
const id = length > 0 && !isCreate ? segment[1] : null;
|
||||
const isDetail = length === 2 && !!id && !isCreate && !isEdit;
|
||||
|
||||
return (
|
||||
<>
|
||||
{children}
|
||||
{isDetail && detail}
|
||||
{isEdit && edit}
|
||||
{isCreate && create}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
import { type Database } from "@link-stack/bridge-common";
|
||||
import type { ServiceConfig } from "../lib/service";
|
||||
import { facebookConfig as facebook } from "./facebook";
|
||||
import { signalConfig as signal } from "./signal";
|
||||
import { whatsappConfig as whatsapp } from "./whatsapp";
|
||||
import { voiceConfig as voice } from "./voice";
|
||||
import { webhooksConfig as webhooks } from "./webhooks";
|
||||
import { usersConfig as users } from "./users";
|
||||
|
||||
export const serviceConfig: Record<string, ServiceConfig> = {
|
||||
facebook,
|
||||
signal,
|
||||
whatsapp,
|
||||
voice,
|
||||
webhooks,
|
||||
users,
|
||||
};
|
||||
|
||||
export const getServiceTable = (service: string): keyof Database => {
|
||||
const tableLookup: Record<string, keyof Database> = {
|
||||
facebook: "FacebookBot",
|
||||
signal: "SignalBot",
|
||||
whatsapp: "WhatsappBot",
|
||||
};
|
||||
|
||||
const table = tableLookup[service];
|
||||
|
||||
if (!table) {
|
||||
throw new Error("Table not found");
|
||||
}
|
||||
|
||||
return table;
|
||||
};
|
||||
|
|
@ -1,122 +0,0 @@
|
|||
import { ServiceConfig } from "../lib/service";
|
||||
|
||||
export const facebookConfig: ServiceConfig = {
|
||||
entity: "facebook",
|
||||
table: "FacebookBot",
|
||||
displayName: "Facebook Connection",
|
||||
createFields: [
|
||||
{
|
||||
name: "name",
|
||||
label: "Name",
|
||||
required: true,
|
||||
size: 12,
|
||||
},
|
||||
{
|
||||
name: "description",
|
||||
label: "Description",
|
||||
size: 12,
|
||||
lines: 3,
|
||||
},
|
||||
{ name: "appId", label: "App ID", required: true },
|
||||
{ name: "appSecret", label: "App Secret", required: true },
|
||||
{ name: "pageId", label: "Page ID", required: true },
|
||||
{
|
||||
name: "pageAccessToken",
|
||||
label: "Page Access Token",
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "token",
|
||||
label: "Token",
|
||||
hidden: true,
|
||||
required: true,
|
||||
autogenerated: "token",
|
||||
},
|
||||
{
|
||||
name: "verifyToken",
|
||||
label: "Verify Token",
|
||||
hidden: true,
|
||||
required: true,
|
||||
autogenerated: "token",
|
||||
},
|
||||
],
|
||||
updateFields: [
|
||||
{ name: "name", label: "Name", required: true, size: 12 },
|
||||
{
|
||||
name: "description",
|
||||
label: "Description",
|
||||
size: 12,
|
||||
lines: 3,
|
||||
},
|
||||
{
|
||||
name: "token",
|
||||
label: "Token",
|
||||
disabled: true,
|
||||
refreshable: true,
|
||||
},
|
||||
{
|
||||
name: "verifyToken",
|
||||
label: "Verify Token",
|
||||
disabled: true,
|
||||
refreshable: true,
|
||||
},
|
||||
{ name: "appId", label: "App ID", required: true },
|
||||
{ name: "appSecret", label: "App Secret", required: true },
|
||||
{ name: "pageId", label: "Page ID", required: true },
|
||||
{
|
||||
name: "pageAccessToken",
|
||||
label: "Page Access Token",
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
displayFields: [
|
||||
{ name: "name", label: "Name", required: true, size: 12 },
|
||||
{
|
||||
name: "description",
|
||||
label: "Description",
|
||||
required: true,
|
||||
size: 12,
|
||||
},
|
||||
{
|
||||
name: "token",
|
||||
label: "Token",
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
name: "verifyToken",
|
||||
label: "Verify Token",
|
||||
copyable: true,
|
||||
},
|
||||
|
||||
{ name: "appId", label: "App ID", required: true },
|
||||
{ name: "appSecret", label: "App Secret", required: true },
|
||||
{
|
||||
name: "pageId",
|
||||
label: "Page ID",
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "pageAccessToken",
|
||||
label: "Page Access Token",
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
listColumns: [
|
||||
{
|
||||
field: "name",
|
||||
headerName: "Name",
|
||||
flex: 1,
|
||||
},
|
||||
{
|
||||
field: "description",
|
||||
headerName: "Description",
|
||||
flex: 2,
|
||||
},
|
||||
{
|
||||
field: "updatedAt",
|
||||
headerName: "Updated At",
|
||||
valueGetter: (value: any) => new Date(value).toLocaleString(),
|
||||
flex: 1,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
@ -1,106 +0,0 @@
|
|||
import { ServiceConfig } from "../lib/service";
|
||||
|
||||
const getQRCode = async (token: string): Promise<Record<string, string>> => {
|
||||
const basePath = window?.location?.pathname?.startsWith("/link")
|
||||
? "/link"
|
||||
: "";
|
||||
const url = `${basePath}/api/signal/bots/${token}`;
|
||||
const result = await fetch(url, { cache: "no-store" });
|
||||
const { qr } = await result.json();
|
||||
|
||||
return { qr, kind: "image" };
|
||||
};
|
||||
|
||||
export const signalConfig: ServiceConfig = {
|
||||
entity: "signal",
|
||||
table: "SignalBot",
|
||||
displayName: "Signal Connection",
|
||||
createFields: [
|
||||
{
|
||||
name: "name",
|
||||
label: "Name",
|
||||
required: true,
|
||||
size: 12,
|
||||
},
|
||||
{
|
||||
name: "description",
|
||||
label: "Description",
|
||||
size: 12,
|
||||
lines: 3,
|
||||
},
|
||||
{
|
||||
name: "phoneNumber",
|
||||
label: "phoneNumber",
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "token",
|
||||
label: "Token",
|
||||
hidden: true,
|
||||
required: true,
|
||||
autogenerated: "token",
|
||||
},
|
||||
],
|
||||
updateFields: [
|
||||
{ name: "name", label: "Name", required: true, size: 12 },
|
||||
{
|
||||
name: "description",
|
||||
label: "Description",
|
||||
size: 12,
|
||||
},
|
||||
{
|
||||
name: "phoneNumber",
|
||||
label: "phoneNumber",
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
displayFields: [
|
||||
{ name: "name", label: "Name", required: true, size: 12 },
|
||||
{
|
||||
name: "description",
|
||||
label: "Description",
|
||||
size: 12,
|
||||
},
|
||||
{
|
||||
name: "phoneNumber",
|
||||
label: "phoneNumber",
|
||||
},
|
||||
{
|
||||
name: "token",
|
||||
label: "Token",
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
name: "qrcode",
|
||||
label: "QR Code",
|
||||
kind: "qrcode",
|
||||
size: 4,
|
||||
getQRCode,
|
||||
helperText: "Go to link devices in the app, then scan the code",
|
||||
refreshInterval: 15,
|
||||
},
|
||||
],
|
||||
listColumns: [
|
||||
{
|
||||
field: "name",
|
||||
headerName: "Name",
|
||||
flex: 1,
|
||||
},
|
||||
{
|
||||
field: "phoneNumber",
|
||||
headerName: "Phone Number",
|
||||
flex: 1,
|
||||
},
|
||||
{
|
||||
field: "description",
|
||||
headerName: "Description",
|
||||
flex: 2,
|
||||
},
|
||||
{
|
||||
field: "updatedAt",
|
||||
headerName: "Updated At",
|
||||
valueGetter: (value: any) => new Date(value).toLocaleString(),
|
||||
flex: 1,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
import { ServiceConfig } from "../lib/service";
|
||||
|
||||
const getRoles = async () => [
|
||||
{ value: "admin", label: "Admin" },
|
||||
{ value: "user", label: "User" },
|
||||
{ value: "none", label: "None" },
|
||||
];
|
||||
|
||||
export const usersConfig: ServiceConfig = {
|
||||
entity: "users",
|
||||
table: "User",
|
||||
displayName: "User",
|
||||
createFields: [
|
||||
{
|
||||
name: "name",
|
||||
label: "Name",
|
||||
required: true,
|
||||
size: 12,
|
||||
},
|
||||
{
|
||||
name: "email",
|
||||
label: "Email",
|
||||
required: true,
|
||||
size: 12,
|
||||
},
|
||||
{
|
||||
name: "role",
|
||||
label: "Role",
|
||||
required: true,
|
||||
getOptions: getRoles,
|
||||
size: 12,
|
||||
},
|
||||
],
|
||||
updateFields: [
|
||||
{ name: "name", label: "Name", required: true, size: 12 },
|
||||
{
|
||||
name: "email",
|
||||
label: "Email",
|
||||
required: true,
|
||||
size: 12,
|
||||
},
|
||||
],
|
||||
displayFields: [
|
||||
{ name: "name", label: "Name", required: true, size: 12 },
|
||||
{
|
||||
name: "email",
|
||||
label: "Email",
|
||||
size: 12,
|
||||
},
|
||||
],
|
||||
listColumns: [
|
||||
{
|
||||
field: "name",
|
||||
headerName: "Name",
|
||||
flex: 1,
|
||||
},
|
||||
{
|
||||
field: "email",
|
||||
headerName: "Email",
|
||||
flex: 2,
|
||||
},
|
||||
{
|
||||
field: "role",
|
||||
headerName: "Role",
|
||||
flex: 1,
|
||||
},
|
||||
{
|
||||
field: "createdAt",
|
||||
headerName: "Created At",
|
||||
valueGetter: (value: any) => new Date(value).toLocaleString(),
|
||||
flex: 1,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
import { ServiceConfig } from "../lib/service";
|
||||
|
||||
export const voiceConfig: ServiceConfig = {
|
||||
entity: "voice",
|
||||
table: "VoiceLine",
|
||||
displayName: "Voice Line",
|
||||
createFields: [
|
||||
{
|
||||
name: "name",
|
||||
label: "Name",
|
||||
required: true,
|
||||
size: 12,
|
||||
},
|
||||
{
|
||||
name: "description",
|
||||
label: "Description",
|
||||
size: 12,
|
||||
lines: 3,
|
||||
},
|
||||
{
|
||||
name: "phoneNumber",
|
||||
label: "phoneNumber",
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
updateFields: [
|
||||
{ name: "name", label: "Name", required: true, size: 12 },
|
||||
{
|
||||
name: "description",
|
||||
label: "Description",
|
||||
required: true,
|
||||
size: 12,
|
||||
},
|
||||
{
|
||||
name: "phoneNumber",
|
||||
label: "Phone Number",
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
displayFields: [
|
||||
{ name: "name", label: "Name", required: true, size: 12 },
|
||||
{
|
||||
name: "description",
|
||||
label: "Description",
|
||||
required: true,
|
||||
size: 12,
|
||||
},
|
||||
{
|
||||
name: "phoneNumber",
|
||||
label: "Phone Number",
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
listColumns: [
|
||||
{
|
||||
field: "name",
|
||||
headerName: "Name",
|
||||
flex: 1,
|
||||
},
|
||||
{
|
||||
field: "phoneNumber",
|
||||
headerName: "Phone Number",
|
||||
flex: 1,
|
||||
},
|
||||
{
|
||||
field: "description",
|
||||
headerName: "Description",
|
||||
flex: 2,
|
||||
},
|
||||
{
|
||||
field: "updatedAt",
|
||||
headerName: "Updated At",
|
||||
valueGetter: (value: any) => new Date(value).toLocaleString(),
|
||||
flex: 1,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
@ -1,168 +0,0 @@
|
|||
import { selectAllAction } from "../actions/service";
|
||||
import { ServiceConfig } from "../lib/service";
|
||||
import { getServiceTable } from "../config/config";
|
||||
|
||||
const getHTTPMethodOptions = async () => [
|
||||
{ value: "post", label: "POST" },
|
||||
{ value: "put", label: "PUT" },
|
||||
];
|
||||
|
||||
const getBackendTypeOptions = async (_formState: any) => [
|
||||
{ value: "whatsapp", label: "WhatsApp" },
|
||||
{ value: "facebook", label: "Facebook" },
|
||||
{ value: "signal", label: "Signal" },
|
||||
];
|
||||
|
||||
const getBackendIDOptions = async (formState: any) => {
|
||||
if (!formState || !formState.values.backendType) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const table = getServiceTable(formState.values.backendType);
|
||||
const result = await selectAllAction(table);
|
||||
|
||||
return result.map((item: any) => ({
|
||||
value: item.id,
|
||||
label: item.name,
|
||||
}));
|
||||
};
|
||||
|
||||
export const webhooksConfig: ServiceConfig = {
|
||||
entity: "webhooks",
|
||||
table: "Webhook",
|
||||
displayName: "Webhook",
|
||||
createFields: [
|
||||
{
|
||||
name: "name",
|
||||
label: "Name",
|
||||
required: true,
|
||||
size: 12,
|
||||
},
|
||||
{
|
||||
name: "description",
|
||||
label: "Description",
|
||||
size: 12,
|
||||
lines: 3,
|
||||
},
|
||||
{
|
||||
name: "httpMethod",
|
||||
label: "HTTP Method",
|
||||
kind: "select",
|
||||
getOptions: getHTTPMethodOptions,
|
||||
defaultValue: "post",
|
||||
required: true,
|
||||
size: 2,
|
||||
},
|
||||
{
|
||||
name: "endpointUrl",
|
||||
label: "Endpoint",
|
||||
required: true,
|
||||
size: 10,
|
||||
},
|
||||
{
|
||||
name: "backendType",
|
||||
label: "Backend Type",
|
||||
kind: "select",
|
||||
getOptions: getBackendTypeOptions,
|
||||
defaultValue: "facebook",
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "backendId",
|
||||
label: "Backend ID",
|
||||
kind: "select",
|
||||
getOptions: getBackendIDOptions,
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "headers",
|
||||
label: "HTTP Headers",
|
||||
kind: "multi",
|
||||
size: 12,
|
||||
helperText: "Useful for authentication, etc.",
|
||||
},
|
||||
],
|
||||
updateFields: [
|
||||
{
|
||||
name: "name",
|
||||
label: "Name",
|
||||
required: true,
|
||||
size: 12,
|
||||
},
|
||||
{
|
||||
name: "description",
|
||||
label: "Description",
|
||||
size: 12,
|
||||
lines: 3,
|
||||
},
|
||||
{
|
||||
name: "httpMethod",
|
||||
label: "HTTP Method",
|
||||
kind: "select",
|
||||
getOptions: getHTTPMethodOptions,
|
||||
defaultValue: "post",
|
||||
required: true,
|
||||
size: 2,
|
||||
},
|
||||
{
|
||||
name: "endpointUrl",
|
||||
label: "Endpoint",
|
||||
required: true,
|
||||
size: 10,
|
||||
},
|
||||
{
|
||||
name: "backendType",
|
||||
label: "Backend Type",
|
||||
kind: "select",
|
||||
getOptions: getBackendTypeOptions,
|
||||
defaultValue: "facebook",
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "backendId",
|
||||
label: "Backend ID",
|
||||
kind: "select",
|
||||
getOptions: getBackendIDOptions,
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "headers",
|
||||
label: "HTTP Headers",
|
||||
kind: "multi",
|
||||
size: 12,
|
||||
helperText: "Useful for authentication, etc.",
|
||||
},
|
||||
],
|
||||
displayFields: [
|
||||
{ name: "name", label: "Name", required: true, size: 12 },
|
||||
{
|
||||
name: "description",
|
||||
label: "Description",
|
||||
required: true,
|
||||
size: 12,
|
||||
},
|
||||
],
|
||||
listColumns: [
|
||||
{
|
||||
field: "name",
|
||||
headerName: "Name",
|
||||
flex: 1,
|
||||
},
|
||||
{
|
||||
field: "backendType",
|
||||
headerName: "Type",
|
||||
flex: 1,
|
||||
},
|
||||
{
|
||||
field: "endpointUrl",
|
||||
headerName: "Endpoint",
|
||||
flex: 1,
|
||||
},
|
||||
{
|
||||
field: "updatedAt",
|
||||
headerName: "Updated At",
|
||||
valueGetter: (value: any) => new Date(value).toLocaleString(),
|
||||
flex: 1,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
@ -1,121 +0,0 @@
|
|||
import { ServiceConfig } from "../lib/service";
|
||||
// import { generateSelectOneAction } from "../lib/actions";
|
||||
|
||||
const getQRCode = async (token: string) => {
|
||||
try {
|
||||
const url = `/link/api/whatsapp/bots/${token}`;
|
||||
const result = await fetch(url, { cache: "no-store" });
|
||||
|
||||
if (!result.ok) {
|
||||
console.error(`Failed to fetch QR code: ${result.status} ${result.statusText}`);
|
||||
return { qr: "", kind: "data" };
|
||||
}
|
||||
|
||||
const data = await result.json();
|
||||
const { qr } = data;
|
||||
|
||||
if (!qr) {
|
||||
console.error("No QR code in response");
|
||||
return { qr: "", kind: "data" };
|
||||
}
|
||||
|
||||
return { qr, kind: "data" };
|
||||
} catch (error) {
|
||||
console.error("Error fetching QR code:", error);
|
||||
return { qr: "", kind: "data" };
|
||||
}
|
||||
};
|
||||
|
||||
export const whatsappConfig: ServiceConfig = {
|
||||
entity: "whatsapp",
|
||||
table: "WhatsappBot",
|
||||
displayName: "WhatsApp Connection",
|
||||
createFields: [
|
||||
{
|
||||
name: "name",
|
||||
label: "Name",
|
||||
required: true,
|
||||
size: 12,
|
||||
},
|
||||
{
|
||||
name: "description",
|
||||
label: "Description",
|
||||
size: 12,
|
||||
lines: 3,
|
||||
},
|
||||
{
|
||||
name: "phoneNumber",
|
||||
label: "Phone Number",
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "token",
|
||||
label: "Token",
|
||||
hidden: true,
|
||||
required: true,
|
||||
autogenerated: "token",
|
||||
},
|
||||
],
|
||||
updateFields: [
|
||||
{ name: "name", label: "Name", required: true, size: 12 },
|
||||
{
|
||||
name: "description",
|
||||
label: "Description",
|
||||
size: 12,
|
||||
},
|
||||
{
|
||||
name: "phoneNumber",
|
||||
label: "Phone Number",
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
displayFields: [
|
||||
{ name: "name", label: "Name", required: true, size: 12 },
|
||||
{
|
||||
name: "description",
|
||||
label: "Description",
|
||||
size: 12,
|
||||
},
|
||||
{
|
||||
name: "phoneNumber",
|
||||
label: "Phone Number",
|
||||
},
|
||||
{
|
||||
name: "token",
|
||||
label: "Token",
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
name: "qrcode",
|
||||
label: "QR Code",
|
||||
kind: "qrcode",
|
||||
size: 4,
|
||||
getQRCode,
|
||||
helperText: "Go to link devices in the app, then scan the code",
|
||||
refreshInterval: 15,
|
||||
},
|
||||
],
|
||||
listColumns: [
|
||||
{
|
||||
field: "name",
|
||||
headerName: "Name",
|
||||
flex: 1,
|
||||
},
|
||||
{
|
||||
field: "phoneNumber",
|
||||
headerName: "Phone Number",
|
||||
flex: 1,
|
||||
},
|
||||
{
|
||||
field: "description",
|
||||
headerName: "Description",
|
||||
flex: 2,
|
||||
},
|
||||
{
|
||||
field: "updatedAt",
|
||||
headerName: "Updated At",
|
||||
valueGetter: (value: any) => new Date(value).toLocaleString(),
|
||||
flex: 1,
|
||||
},
|
||||
],
|
||||
};
|
||||
16
packages/bridge-ui/images.d.ts
vendored
16
packages/bridge-ui/images.d.ts
vendored
|
|
@ -1,16 +0,0 @@
|
|||
declare module "*.jpg" {
|
||||
const value: any;
|
||||
export default value;
|
||||
}
|
||||
declare module "*.jpeg" {
|
||||
const value: any;
|
||||
export default value;
|
||||
}
|
||||
declare module "*.svg" {
|
||||
const value: any;
|
||||
export default value;
|
||||
}
|
||||
declare module "*.png" {
|
||||
const value: any;
|
||||
export default value;
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
export { Home } from "./components/Home";
|
||||
export { List } from "./components/List";
|
||||
export { Create } from "./components/Create";
|
||||
export { Edit } from "./components/Edit";
|
||||
export { Detail } from "./components/Detail";
|
||||
export { ServiceLayout } from "./components/ServiceLayout";
|
||||
export { serviceConfig, getServiceTable } from "./config/config";
|
||||
export {
|
||||
getBot,
|
||||
sendMessage,
|
||||
receiveMessage,
|
||||
handleWebhook,
|
||||
relinkBot,
|
||||
} from "./lib/routing";
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
import { Database } from "@link-stack/bridge-common";
|
||||
import {
|
||||
createAction,
|
||||
updateAction,
|
||||
deleteAction,
|
||||
selectAllAction,
|
||||
selectOneAction,
|
||||
} from "../actions/service";
|
||||
import { FieldDescription, Entity } from "./service";
|
||||
|
||||
type GenerateCreateActionArgs = {
|
||||
entity: Entity;
|
||||
table: keyof Database;
|
||||
fields: FieldDescription[];
|
||||
};
|
||||
|
||||
export function generateCreateAction({
|
||||
entity,
|
||||
table,
|
||||
fields,
|
||||
}: GenerateCreateActionArgs) {
|
||||
return async (currentState: any, formData: FormData) => {
|
||||
return createAction({
|
||||
entity,
|
||||
table,
|
||||
fields,
|
||||
currentState,
|
||||
formData,
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
type GenerateUpdateActionArgs = {
|
||||
entity: Entity;
|
||||
table: keyof Database;
|
||||
fields: FieldDescription[];
|
||||
};
|
||||
|
||||
export function generateUpdateAction({
|
||||
entity,
|
||||
table,
|
||||
fields,
|
||||
}: GenerateUpdateActionArgs) {
|
||||
return async (currentState: any, formData: FormData) => {
|
||||
return updateAction({
|
||||
entity,
|
||||
table,
|
||||
fields,
|
||||
currentState,
|
||||
formData,
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
type GenerateDeleteActionArgs = {
|
||||
entity: Entity;
|
||||
table: keyof Database;
|
||||
};
|
||||
|
||||
export function generateDeleteAction({
|
||||
entity,
|
||||
table,
|
||||
}: GenerateDeleteActionArgs) {
|
||||
return async (id: string) => {
|
||||
return deleteAction({ entity, table, id });
|
||||
};
|
||||
}
|
||||
|
||||
export function generateSelectAllAction(table: keyof Database) {
|
||||
return async () => {
|
||||
return selectAllAction(table);
|
||||
};
|
||||
}
|
||||
|
||||
type GenerateSelectOneArgs = {
|
||||
table: keyof Database;
|
||||
id: string;
|
||||
};
|
||||
|
||||
export function generateSelectOneAction({ table, id }: GenerateSelectOneArgs) {
|
||||
return async () => {
|
||||
return selectOneAction({ table, id });
|
||||
};
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { Service } from "./service";
|
||||
import { db, getWorkerUtils } from "@link-stack/bridge-common";
|
||||
|
||||
export class Facebook extends Service {
|
||||
async handleWebhook(req: NextRequest) {
|
||||
const { searchParams } = req.nextUrl;
|
||||
const submittedToken = searchParams.get("hub.verify_token");
|
||||
|
||||
if (submittedToken) {
|
||||
await db
|
||||
.selectFrom("FacebookBot")
|
||||
.selectAll()
|
||||
.where("verifyToken", "=", submittedToken)
|
||||
.executeTakeFirstOrThrow();
|
||||
|
||||
if (searchParams.get("hub.mode") === "subscribe") {
|
||||
const challenge = searchParams.get("hub.challenge");
|
||||
const response = new Response(challenge, { status: 200 });
|
||||
|
||||
return response as any;
|
||||
} else {
|
||||
return NextResponse.error();
|
||||
}
|
||||
} else {
|
||||
const message = await req.json();
|
||||
const worker = await getWorkerUtils();
|
||||
await worker.addJob("facebook/receive-facebook-message", { message });
|
||||
|
||||
return NextResponse.json({ response: "ok" });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
export const getBasePath = (): string => {
|
||||
if (
|
||||
typeof window !== "undefined" &&
|
||||
window?.location?.pathname?.includes("/admin/bridge")
|
||||
) {
|
||||
return "/admin/bridge/";
|
||||
}
|
||||
|
||||
return "/";
|
||||
};
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { ServiceParams } from "./service";
|
||||
import { getService } from "./utils";
|
||||
|
||||
export const getBot = async (
|
||||
_req: NextRequest,
|
||||
params: ServiceParams,
|
||||
): Promise<NextResponse> => (await getService(params))?.getBot(params);
|
||||
|
||||
export const sendMessage = async (
|
||||
req: NextRequest,
|
||||
params: ServiceParams,
|
||||
): Promise<NextResponse> =>
|
||||
(await getService(params))?.sendMessage(req, params);
|
||||
|
||||
export const receiveMessage = async (
|
||||
req: NextRequest,
|
||||
params: ServiceParams,
|
||||
): Promise<NextResponse> =>
|
||||
(await getService(params))?.receiveMessage(req, params);
|
||||
|
||||
export const handleWebhook = async (
|
||||
req: NextRequest,
|
||||
params: ServiceParams,
|
||||
): Promise<NextResponse> => (await getService(params))?.handleWebhook(req);
|
||||
|
||||
export const relinkBot = async (
|
||||
_req: NextRequest,
|
||||
params: ServiceParams,
|
||||
): Promise<NextResponse> => (await getService(params))?.relink(params);
|
||||
|
|
@ -1,129 +0,0 @@
|
|||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { GridColDef } from "@mui/x-data-grid-pro";
|
||||
import { Database, db, getWorkerUtils } from "@link-stack/bridge-common";
|
||||
import { getServiceTable } from "../config/config";
|
||||
|
||||
const entities = [
|
||||
"facebook",
|
||||
"whatsapp",
|
||||
"signal",
|
||||
"voice",
|
||||
"webhooks",
|
||||
"users",
|
||||
] as const;
|
||||
|
||||
export type Entity = (typeof entities)[number];
|
||||
|
||||
export type SelectOption = {
|
||||
value: string;
|
||||
label: string;
|
||||
};
|
||||
|
||||
export type FieldDescription = {
|
||||
name: string;
|
||||
label: string;
|
||||
kind?: "text" | "phone" | "select" | "multi" | "qrcode";
|
||||
getValue?: (token: string) => Promise<string>;
|
||||
getQRCode?: (token: string) => Promise<Record<string, string>>;
|
||||
refreshInterval?: number;
|
||||
getOptions?: (formState: any) => Promise<SelectOption[]>;
|
||||
autogenerated?: "token";
|
||||
hidden?: boolean;
|
||||
type?: string;
|
||||
lines?: number;
|
||||
copyable?: boolean;
|
||||
refreshable?: boolean;
|
||||
defaultValue?: string;
|
||||
required?: boolean;
|
||||
disabled?: boolean;
|
||||
size?: number;
|
||||
helperText?: string;
|
||||
};
|
||||
|
||||
export type ServiceConfig = {
|
||||
entity: Entity;
|
||||
table: keyof Database;
|
||||
displayName: string;
|
||||
createFields: FieldDescription[];
|
||||
updateFields: FieldDescription[];
|
||||
displayFields: FieldDescription[];
|
||||
listColumns: GridColDef[];
|
||||
};
|
||||
|
||||
export type ServiceParams = {
|
||||
params: Promise<{
|
||||
service: string;
|
||||
token?: string;
|
||||
}>;
|
||||
};
|
||||
|
||||
export class Service {
|
||||
async getBot({ params }: ServiceParams): Promise<NextResponse> {
|
||||
const { service, token } = await params;
|
||||
const table = getServiceTable(service);
|
||||
const row = await db
|
||||
.selectFrom(table)
|
||||
.selectAll()
|
||||
.where("token", "=", token ?? "NEVER_MATCH")
|
||||
.executeTakeFirstOrThrow();
|
||||
|
||||
return NextResponse.json(row);
|
||||
}
|
||||
|
||||
async registerBot({ params: _params }: ServiceParams): Promise<NextResponse> {
|
||||
return NextResponse.error() as any;
|
||||
}
|
||||
|
||||
async sendMessage(
|
||||
req: NextRequest,
|
||||
{ params }: ServiceParams,
|
||||
): Promise<NextResponse> {
|
||||
const { service, token } = await params;
|
||||
const table = getServiceTable(service);
|
||||
const row = await db
|
||||
.selectFrom(table)
|
||||
.selectAll()
|
||||
.where("token", "=", token ?? "NEVER_MATCH")
|
||||
.executeTakeFirstOrThrow();
|
||||
const json = await req.json();
|
||||
const worker = await getWorkerUtils();
|
||||
await worker.addJob(`${service}/send-${service}-message`, {
|
||||
token,
|
||||
...json,
|
||||
});
|
||||
|
||||
const response = {
|
||||
response: "ok",
|
||||
result: {
|
||||
to: json.to,
|
||||
from: row?.phoneNumber ?? null,
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
};
|
||||
|
||||
return NextResponse.json(response);
|
||||
}
|
||||
|
||||
async receiveMessage(
|
||||
req: NextRequest,
|
||||
{ params }: ServiceParams,
|
||||
): Promise<NextResponse> {
|
||||
const { service, token } = await params;
|
||||
const json = await req.json();
|
||||
const worker = await getWorkerUtils();
|
||||
await worker.addJob(`${service}/receive-${service}-message`, {
|
||||
token,
|
||||
...json,
|
||||
});
|
||||
|
||||
return NextResponse.json({ response: "ok" });
|
||||
}
|
||||
|
||||
async handleWebhook(_req: NextRequest): Promise<NextResponse> {
|
||||
return NextResponse.error() as any;
|
||||
}
|
||||
|
||||
async relink({ params: _params }: ServiceParams): Promise<NextResponse> {
|
||||
return NextResponse.error() as any;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
import { NextResponse } from "next/server";
|
||||
import { db } from "@link-stack/bridge-common";
|
||||
import { Configuration, DevicesApi } from "@link-stack/signal-api";
|
||||
// import { revalidatePath } from "next/cache";
|
||||
import { Service, ServiceParams } from "./service";
|
||||
|
||||
const fetchNoCache = async (url: string, options = {}) => {
|
||||
// @ts-ignore
|
||||
options.cache = options.cache || "no-store";
|
||||
return fetch(url, options);
|
||||
};
|
||||
|
||||
export class Signal extends Service {
|
||||
async getBot({ params }: ServiceParams) {
|
||||
const { token } = await params;
|
||||
const row = await db
|
||||
.selectFrom("SignalBot")
|
||||
.selectAll()
|
||||
.where("token", "=", token as string)
|
||||
.executeTakeFirstOrThrow();
|
||||
const { name } = row;
|
||||
if (!row.verified) {
|
||||
const config = new Configuration({
|
||||
basePath: process.env.BRIDGE_SIGNAL_URL,
|
||||
fetchApi: fetchNoCache,
|
||||
});
|
||||
|
||||
const devicesClient = new DevicesApi(config);
|
||||
const blob: Blob = await devicesClient.v1QrcodelinkGet({
|
||||
deviceName: name.replaceAll(" ", "_"),
|
||||
});
|
||||
const arrayBuffer = await blob.arrayBuffer();
|
||||
const buffer = Buffer.from(arrayBuffer);
|
||||
const qrString = buffer.toString("base64");
|
||||
const qr = `data:${blob.type};base64,${qrString}`;
|
||||
const finalRow = {
|
||||
...row,
|
||||
qr,
|
||||
};
|
||||
|
||||
return NextResponse.json(finalRow);
|
||||
} else {
|
||||
return NextResponse.json(row);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
import { Service, ServiceParams } from "./service";
|
||||
import { Facebook } from "./facebook";
|
||||
import { Signal } from "./signal";
|
||||
import { Whatsapp } from "./whatsapp";
|
||||
|
||||
export const getService = async ({
|
||||
params,
|
||||
}: ServiceParams): Promise<Service> => {
|
||||
const { service } = await params;
|
||||
if (service === "facebook") {
|
||||
return new Facebook();
|
||||
} else if (service === "signal") {
|
||||
return new Signal();
|
||||
} else if (service === "whatsapp") {
|
||||
return new Whatsapp();
|
||||
}
|
||||
|
||||
throw new Error("Service not found");
|
||||
};
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
import { Service } from "./service";
|
||||
|
||||
export class Voice extends Service {}
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
import { NextResponse } from "next/server";
|
||||
import { db } from "@link-stack/bridge-common";
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { Service, ServiceParams } from "./service";
|
||||
|
||||
export class Whatsapp extends Service {
|
||||
async getBot({ params }: ServiceParams) {
|
||||
const { token } = await params;
|
||||
const row = await db
|
||||
.selectFrom("WhatsappBot")
|
||||
.selectAll()
|
||||
.where("token", "=", token as string)
|
||||
.executeTakeFirstOrThrow();
|
||||
const id = row.id;
|
||||
const url = `${process.env.BRIDGE_WHATSAPP_URL}/api/bots/${id}`;
|
||||
const result = await fetch(url, { cache: "no-store" });
|
||||
const json = await result.json();
|
||||
|
||||
await db
|
||||
.updateTable("WhatsappBot")
|
||||
.set({ verified: json.verified })
|
||||
.where("id", "=", id)
|
||||
.execute();
|
||||
|
||||
if (!json.verified) {
|
||||
const url = `${process.env.BRIDGE_WHATSAPP_URL}/api/bots/${id}/register`;
|
||||
const result = await fetch(url, { method: "POST" });
|
||||
}
|
||||
|
||||
revalidatePath(`/whatsapp/${id}`);
|
||||
|
||||
return NextResponse.json(json);
|
||||
}
|
||||
|
||||
async relink({ params }: ServiceParams) {
|
||||
const { token } = await params;
|
||||
const row = await db
|
||||
.selectFrom("WhatsappBot")
|
||||
.selectAll()
|
||||
.where("token", "=", token as string)
|
||||
.executeTakeFirstOrThrow();
|
||||
const id = row.id;
|
||||
|
||||
// Step 1: Call unverify to remove the bot directory and disconnect
|
||||
const unverifyUrl = `${process.env.BRIDGE_WHATSAPP_URL}/api/bots/${id}/unverify`;
|
||||
await fetch(unverifyUrl, { method: "POST" });
|
||||
|
||||
// Step 2: Reset verified flag in database
|
||||
await db
|
||||
.updateTable("WhatsappBot")
|
||||
.set({ verified: false })
|
||||
.where("id", "=", id)
|
||||
.execute();
|
||||
|
||||
// Step 3: Revalidate the path to refresh the UI
|
||||
revalidatePath(`/whatsapp/${id}`);
|
||||
|
||||
return NextResponse.json({ success: true, message: "WhatsApp connection reset. Please scan the new QR code." });
|
||||
}
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
{
|
||||
"name": "@link-stack/bridge-ui",
|
||||
"version": "3.5.0-beta.1",
|
||||
"scripts": {
|
||||
"build": "tsc -p tsconfig.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@link-stack/bridge-common": "workspace:*",
|
||||
"@link-stack/signal-api": "workspace:*",
|
||||
"@link-stack/ui": "workspace:*",
|
||||
"@mui/material": "^6",
|
||||
"@mui/x-data-grid-pro": "^7",
|
||||
"kysely": "0.27.5",
|
||||
"next": "15.5.9",
|
||||
"react": "19.2.0",
|
||||
"react-dom": "19.2.0",
|
||||
"react-qr-code": "^2.0.18"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^24.7.0",
|
||||
"@types/react": "19.2.2",
|
||||
"@types/react-dom": "^19.2.1",
|
||||
"typescript": "5.9.3"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,110 +0,0 @@
|
|||
import { Roboto, Playfair_Display, Poppins } from "next/font/google";
|
||||
|
||||
const roboto = Roboto({
|
||||
weight: ["400"],
|
||||
subsets: ["latin"],
|
||||
display: "swap",
|
||||
});
|
||||
|
||||
const playfair = Playfair_Display({
|
||||
weight: ["900"],
|
||||
subsets: ["latin"],
|
||||
display: "swap",
|
||||
});
|
||||
|
||||
const poppins = Poppins({
|
||||
weight: ["400", "700"],
|
||||
subsets: ["latin"],
|
||||
display: "swap",
|
||||
});
|
||||
|
||||
export const fonts = {
|
||||
roboto,
|
||||
playfair,
|
||||
poppins,
|
||||
};
|
||||
|
||||
export const colors: any = {
|
||||
lightGray: "#ededf0",
|
||||
mediumGray: "#e3e5e5",
|
||||
darkGray: "#33302f",
|
||||
mediumBlue: "#4285f4",
|
||||
green: "#349d7b",
|
||||
lavender: "#a5a6f6",
|
||||
darkLavender: "#5d5fef",
|
||||
pink: "#fcddec",
|
||||
cdrLinkOrange: "#ff7115",
|
||||
coreYellow: "#fac942",
|
||||
helpYellow: "#fff4d5",
|
||||
dwcDarkBlue: "#191847",
|
||||
hazyMint: "#ecf7f8",
|
||||
waterbearElectricPurple: "#332c83",
|
||||
waterbearLightSmokePurple: "#eff3f8",
|
||||
bumpedPurple: "#212058",
|
||||
mutedPurple: "#373669",
|
||||
warningPink: "#ef5da8",
|
||||
lightPink: "#fff0f7",
|
||||
lightGreen: "#f0fff3",
|
||||
lightOrange: "#fff5f0",
|
||||
beige: "#f6f2f1",
|
||||
almostBlack: "#33302f",
|
||||
white: "#ffffff",
|
||||
};
|
||||
|
||||
export const typography: any = {
|
||||
h1: {
|
||||
fontFamily: playfair.style.fontFamily,
|
||||
fontSize: 45,
|
||||
fontWeight: 700,
|
||||
lineHeight: 1.1,
|
||||
margin: 0,
|
||||
},
|
||||
h2: {
|
||||
fontFamily: poppins.style.fontFamily,
|
||||
fontSize: 35,
|
||||
fontWeight: 700,
|
||||
lineHeight: 1.1,
|
||||
margin: 0,
|
||||
},
|
||||
h3: {
|
||||
fontFamily: poppins.style.fontFamily,
|
||||
fontWeight: 400,
|
||||
fontSize: 27,
|
||||
lineHeight: 1.1,
|
||||
margin: 0,
|
||||
},
|
||||
h4: {
|
||||
fontFamily: poppins.style.fontFamily,
|
||||
fontWeight: 700,
|
||||
fontSize: 18,
|
||||
},
|
||||
h5: {
|
||||
fontFamily: roboto.style.fontFamily,
|
||||
fontWeight: 700,
|
||||
fontSize: 16,
|
||||
lineHeight: "24px",
|
||||
textTransform: "uppercase",
|
||||
textAlign: "center",
|
||||
margin: 1,
|
||||
},
|
||||
h6: {
|
||||
fontFamily: roboto.style.fontFamily,
|
||||
fontWeight: 400,
|
||||
fontSize: 14,
|
||||
textAlign: "center",
|
||||
},
|
||||
p: {
|
||||
fontFamily: roboto.style.fontFamily,
|
||||
fontSize: 17,
|
||||
lineHeight: "26.35px",
|
||||
fontWeight: 400,
|
||||
margin: 0,
|
||||
},
|
||||
small: {
|
||||
fontFamily: roboto.style.fontFamily,
|
||||
fontSize: 13,
|
||||
lineHeight: "18px",
|
||||
fontWeight: 400,
|
||||
margin: 0,
|
||||
},
|
||||
};
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"noEmit": false,
|
||||
"outDir": "./dist",
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "preserve",
|
||||
"incremental": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["./*", "../../node_modules/*"]
|
||||
},
|
||||
"plugins": [
|
||||
{
|
||||
"name": "next"
|
||||
}
|
||||
]
|
||||
},
|
||||
"include": ["**.d.ts", "**/*.ts", "**/*.tsx", "**/*.png, **/*.svg"],
|
||||
"exclude": ["node_modules", "babel__core", "dist"]
|
||||
}
|
||||
|
|
@ -1,90 +0,0 @@
|
|||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
### [0.3.10](https://gitlab.com/digiresilience.org/link/eslint-config-amigo/compare/0.3.9...0.3.10) (2021-10-11)
|
||||
|
||||
### [0.3.9](https://gitlab.com/digiresilience.org/link/eslint-config-amigo/compare/0.3.8...0.3.9) (2021-10-11)
|
||||
|
||||
### [0.3.8](https://gitlab.com/digiresilience.org/link/eslint-config-amigo/compare/0.3.7...0.3.8) (2021-10-11)
|
||||
|
||||
### [0.3.7](https://gitlab.com/digiresilience.org/link/eslint-config-amigo/compare/0.3.6...0.3.7) (2021-10-08)
|
||||
|
||||
### [0.3.6](https://gitlab.com/digiresilience.org/link/eslint-config-amigo/compare/0.3.4...0.3.6) (2021-05-27)
|
||||
|
||||
### [0.3.4](https://gitlab.com/digiresilience/link/eslint-config-amigo/compare/0.3.3...0.3.4) (2021-05-27)
|
||||
|
||||
### [0.3.3](https://gitlab.com/digiresilience.org/link/eslint-config-amigo/compare/0.3.2...0.3.3) (2021-05-27)
|
||||
|
||||
### [0.3.2](https://gitlab.com/digiresilience.org/link/eslint-config-amigo/compare/0.3.1...0.3.2) (2021-05-27)
|
||||
|
||||
### [0.3.1](https://gitlab.com/digiresilience.org/link/eslint-config-amigo/compare/0.3.0...0.3.1) (2021-05-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* tweak linter settings ([cf07f51](https://gitlab.com/digiresilience.org/link/eslint-config-amigo/commit/cf07f51c4547336a9bcf44b1e203437e76fe593e))
|
||||
|
||||
## [0.3.0](https://gitlab.com/digiresilience.org/link/eslint-config-amigo/compare/0.2.3...0.3.0) (2021-05-03)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* bump deps. new lint rules.
|
||||
|
||||
### Features
|
||||
|
||||
* bump deps. new lint rules. ([df884f9](https://gitlab.com/digiresilience.org/link/eslint-config-amigo/commit/df884f935fe3742fa8d908cb219193afb9a3017f))
|
||||
|
||||
### [0.2.3](https://gitlab.com/digiresilience.org/link/eslint-config-amigo/compare/0.2.2...0.2.3) (2020-12-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* disable unicorn/no-fn-reference-in-iterator as it breaks ramda and ([f719da8](https://gitlab.com/digiresilience.org/link/eslint-config-amigo/commit/f719da8ab9bf8ebc5cec0c243cf7727c4baebc62))
|
||||
|
||||
### [0.2.2](https://gitlab.com/digiresilience.org/link/eslint-config-amigo/compare/0.2.1...0.2.2) (2020-11-24)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add cypress profile ([8773fca](https://gitlab.com/digiresilience.org/link/eslint-config-amigo/commit/8773fca27bb88835e099a0d05c0cf5eae2744022))
|
||||
* make jest optional ([36b7128](https://gitlab.com/digiresilience.org/link/eslint-config-amigo/commit/36b71289b46660d5d0c7a79e93554a51158c5bfd))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add eslint-plugin-cypress dep ([16e4384](https://gitlab.com/digiresilience.org/link/eslint-config-amigo/commit/16e4384181593ce058f2cbc11b9e206af12ff76c))
|
||||
|
||||
### [0.2.1](https://gitlab.com/digiresilience.org/link/eslint-config-amigo/compare/0.2.0...0.2.1) (2020-11-21)
|
||||
|
||||
## [0.2.0](https://gitlab.com/digiresilience.org/link/eslint-config-amigo/compare/0.1.4...0.2.0) (2020-11-20)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* upgrade deps, inlcuding TS to 4.1
|
||||
|
||||
### Features
|
||||
|
||||
* upgrade deps, inlcuding TS to 4.1 ([f47332e](https://gitlab.com/digiresilience.org/link/eslint-config-amigo/commit/f47332ec0f9dd6fdd28211f561b0109c68e7d3e0))
|
||||
|
||||
### [0.1.4](https://gitlab.com/digiresilience.org/link/eslint-config-amigo/compare/0.1.3...0.1.4) (2020-11-20)
|
||||
|
||||
### [0.1.3](https://gitlab.com/digiresilience.org/link/eslint-config-amigo/compare/0.1.2...0.1.3) (2020-11-10)
|
||||
|
||||
### [0.1.2](https://gitlab.com/digiresilience.org/link/eslint-config-amigo/compare/0.1.1...0.1.2) (2020-11-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add no-unused-var _ prefix exception ([6d27d3a](https://gitlab.com/digiresilience.org/link/eslint-config-amigo/commit/6d27d3a482ca6a082c06f2034b72dda8b1f1d74d))
|
||||
|
||||
### [0.1.1](https://gitlab.com/digiresilience.org/link/eslint-config-amigo/compare/0.1.0...0.1.1) (2020-10-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix jest support ([ce49875](https://gitlab.com/digiresilience.org/link/eslint-config-amigo/commit/ce49875c4031db25f782dead55cb3ff1621673a2))
|
||||
|
||||
## 0.1.0 (2020-10-09)
|
||||
|
|
@ -1,616 +0,0 @@
|
|||
### GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
<https://fsf.org/>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this
|
||||
license document, but changing it is not allowed.
|
||||
|
||||
### Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains
|
||||
free software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing
|
||||
under this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
### TERMS AND CONDITIONS
|
||||
|
||||
#### 0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public
|
||||
License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds
|
||||
of works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of
|
||||
an exact copy. The resulting work is called a "modified version" of
|
||||
the earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user
|
||||
through a computer network, with no transfer of a copy, is not
|
||||
conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices" to
|
||||
the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
#### 1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work for
|
||||
making modifications to it. "Object code" means any non-source form of
|
||||
a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users can
|
||||
regenerate automatically from other parts of the Corresponding Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that same
|
||||
work.
|
||||
|
||||
#### 2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not convey,
|
||||
without conditions so long as your license otherwise remains in force.
|
||||
You may convey covered works to others for the sole purpose of having
|
||||
them make modifications exclusively for you, or provide you with
|
||||
facilities for running those works, provided that you comply with the
|
||||
terms of this License in conveying all material for which you do not
|
||||
control copyright. Those thus making or running the covered works for
|
||||
you must do so exclusively on your behalf, under your direction and
|
||||
control, on terms that prohibit them from making any copies of your
|
||||
copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under the
|
||||
conditions stated below. Sublicensing is not allowed; section 10 makes
|
||||
it unnecessary.
|
||||
|
||||
#### 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such
|
||||
circumvention is effected by exercising rights under this License with
|
||||
respect to the covered work, and you disclaim any intention to limit
|
||||
operation or modification of the work as a means of enforcing, against
|
||||
the work's users, your or third parties' legal rights to forbid
|
||||
circumvention of technological measures.
|
||||
|
||||
#### 4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
#### 5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these
|
||||
conditions:
|
||||
|
||||
- a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
- b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under
|
||||
section 7. This requirement modifies the requirement in section 4
|
||||
to "keep intact all notices".
|
||||
- c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
- d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
#### 6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms of
|
||||
sections 4 and 5, provided that you also convey the machine-readable
|
||||
Corresponding Source under the terms of this License, in one of these
|
||||
ways:
|
||||
|
||||
- a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
- b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the Corresponding
|
||||
Source from a network server at no charge.
|
||||
- c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
- d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
- e) Convey the object code using peer-to-peer transmission,
|
||||
provided you inform other peers where the object code and
|
||||
Corresponding Source of the work are being offered to the general
|
||||
public at no charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal,
|
||||
family, or household purposes, or (2) anything designed or sold for
|
||||
incorporation into a dwelling. In determining whether a product is a
|
||||
consumer product, doubtful cases shall be resolved in favor of
|
||||
coverage. For a particular product received by a particular user,
|
||||
"normally used" refers to a typical or common use of that class of
|
||||
product, regardless of the status of the particular user or of the way
|
||||
in which the particular user actually uses, or expects or is expected
|
||||
to use, the product. A product is a consumer product regardless of
|
||||
whether the product has substantial commercial, industrial or
|
||||
non-consumer uses, unless such uses represent the only significant
|
||||
mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to
|
||||
install and execute modified versions of a covered work in that User
|
||||
Product from a modified version of its Corresponding Source. The
|
||||
information must suffice to ensure that the continued functioning of
|
||||
the modified object code is in no case prevented or interfered with
|
||||
solely because modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or
|
||||
updates for a work that has been modified or installed by the
|
||||
recipient, or for the User Product in which it has been modified or
|
||||
installed. Access to a network may be denied when the modification
|
||||
itself materially and adversely affects the operation of the network
|
||||
or violates the rules and protocols for communication across the
|
||||
network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
#### 7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders
|
||||
of that material) supplement the terms of this License with terms:
|
||||
|
||||
- a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
- b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
- c) Prohibiting misrepresentation of the origin of that material,
|
||||
or requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
- d) Limiting the use for publicity purposes of names of licensors
|
||||
or authors of the material; or
|
||||
- e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
- f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions
|
||||
of it) with contractual assumptions of liability to the recipient,
|
||||
for any liability that these contractual assumptions directly
|
||||
impose on those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions; the
|
||||
above requirements apply either way.
|
||||
|
||||
#### 8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your license
|
||||
from a particular copyright holder is reinstated (a) provisionally,
|
||||
unless and until the copyright holder explicitly and finally
|
||||
terminates your license, and (b) permanently, if the copyright holder
|
||||
fails to notify you of the violation by some reasonable means prior to
|
||||
60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
#### 9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or run
|
||||
a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
#### 10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
#### 11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims owned
|
||||
or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within the
|
||||
scope of its coverage, prohibits the exercise of, or is conditioned on
|
||||
the non-exercise of one or more of the rights that are specifically
|
||||
granted under this License. You may not convey a covered work if you
|
||||
are a party to an arrangement with a third party that is in the
|
||||
business of distributing software, under which you make payment to the
|
||||
third party based on the extent of your activity of conveying the
|
||||
work, and under which the third party grants, to any of the parties
|
||||
who would receive the covered work from you, a discriminatory patent
|
||||
license (a) in connection with copies of the covered work conveyed by
|
||||
you (or copies made from those copies), or (b) primarily for and in
|
||||
connection with specific products or compilations that contain the
|
||||
covered work, unless you entered into that arrangement, or that patent
|
||||
license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
#### 12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under
|
||||
this License and any other pertinent obligations, then as a
|
||||
consequence you may not convey it at all. For example, if you agree to
|
||||
terms that obligate you to collect a royalty for further conveying
|
||||
from those to whom you convey the Program, the only way you could
|
||||
satisfy both those terms and this License would be to refrain entirely
|
||||
from conveying the Program.
|
||||
|
||||
#### 13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your
|
||||
version supports such interaction) an opportunity to receive the
|
||||
Corresponding Source of your version by providing access to the
|
||||
Corresponding Source from a network server at no charge, through some
|
||||
standard or customary means of facilitating copying of software. This
|
||||
Corresponding Source shall include the Corresponding Source for any
|
||||
work covered by version 3 of the GNU General Public License that is
|
||||
incorporated pursuant to the following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
#### 14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Affero General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever
|
||||
published by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future versions
|
||||
of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
#### 15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
|
||||
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
|
||||
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
|
||||
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
|
||||
CORRECTION.
|
||||
|
||||
#### 16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
|
||||
CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
|
||||
ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
|
||||
NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
|
||||
LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
|
||||
TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
|
||||
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
#### 17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
# eslint-config
|
||||
|
||||
A shared eslint config for [CDR Tech][cdrtech].
|
||||
|
||||
# Usage
|
||||
|
||||
**`.eslintrc.js`**
|
||||
|
||||
```js
|
||||
require("eslint-config-amigo/modern-module-resolution");
|
||||
module.exports = {
|
||||
extends: [
|
||||
// one of:
|
||||
"eslint-config/profile/browser", // if targeting the browser
|
||||
"eslint-config/profile/node", // if targeting node
|
||||
|
||||
// and optionally:
|
||||
"eslint-config/profile/typescript", // if using typescript (node or browser)
|
||||
"eslint-config/profile/cypress", // if using cypress
|
||||
"eslint-config/profile/jest", // if using jest
|
||||
],
|
||||
parserOptions: { tsconfigRootDir: __dirname },
|
||||
};
|
||||
```
|
||||
|
||||
# Credits
|
||||
|
||||
Copyright © 2020-present [Center for Digital Resilience][cdr]
|
||||
|
||||
### Contributors
|
||||
|
||||
| [![Abel Luck][abelxluck_avatar]][abelxluck_homepage]<br/>[Abel Luck][abelxluck_homepage] |
|
||||
| ---------------------------------------------------------------------------------------- |
|
||||
|
||||
[abelxluck_homepage]: https://gitlab.com/abelxluck
|
||||
[abelxluck_avatar]: https://secure.gravatar.com/avatar/0f605397e0ead93a68e1be26dc26481a?s=100&d=identicon
|
||||
|
||||
### License
|
||||
|
||||
[](https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
[cdrtech]: https://digiresilience.org/tech/
|
||||
[cdr]: https://digiresilience.org
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
// Placeholder entry point for eslint-config package
|
||||
module.exports = {};
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
{
|
||||
"name": "@link-stack/eslint-config",
|
||||
"version": "3.5.0-beta.1",
|
||||
"description": "amigo's eslint config",
|
||||
"main": "index.js",
|
||||
"author": "Abel Luck <abel@guardianproject.info>",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"fmt": "prettier \"profile/**/*.js\" --write"
|
||||
},
|
||||
"dependencies": {
|
||||
"@rushstack/eslint-patch": "^1.13.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.46.0",
|
||||
"@typescript-eslint/parser": "^8.46.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-config-xo-space": "^0.35.0",
|
||||
"eslint-plugin-eslint-comments": "^3.2.0",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-jest": "^29.0.1",
|
||||
"eslint-plugin-promise": "^7.2.1",
|
||||
"eslint-plugin-unicorn": "61.0.2",
|
||||
"@babel/eslint-parser": "7.28.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "^4.9.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^9",
|
||||
"jest": "^30.2.0",
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||
// See LICENSE at
|
||||
// https://github.com/microsoft/rushstack/tree/master/stack/eslint-config
|
||||
require('@rushstack/eslint-patch/modern-module-resolution');
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
const path = require("path");
|
||||
module.exports = {
|
||||
extends: ["xo-space/browser", path.join(__dirname, "common.js")],
|
||||
env: {},
|
||||
rules: {},
|
||||
};
|
||||
|
|
@ -1,113 +0,0 @@
|
|||
module.exports = {
|
||||
// root: true,
|
||||
ignorePatterns: ["node_modules", "build", "coverage"],
|
||||
plugins: [
|
||||
// Plugin documentation: https://www.npmjs.com/package/eslint-plugin-unicorn
|
||||
"unicorn",
|
||||
// Plugin documentation: https://github.com/dustinspecker/eslint-plugin-no-use-extend-native
|
||||
"no-use-extend-native",
|
||||
// Plugin documentation: https://github.com/xjamundx/eslint-plugin-promise
|
||||
"promise",
|
||||
// Plugin documentation: https://github.com/benmosher/eslint-plugin-import
|
||||
"import",
|
||||
// Plugin documentation: https://github.com/mysticatea/eslint-plugin-eslint-comments
|
||||
"eslint-comments",
|
||||
],
|
||||
extends: ["plugin:unicorn/recommended", "prettier"],
|
||||
env: {},
|
||||
rules: {
|
||||
// these are handled by prettier
|
||||
quotes: "off",
|
||||
"object-curly-spacing": "off",
|
||||
"comma-dangle": "off",
|
||||
|
||||
// reduce the tyranny
|
||||
"capitalized-comments": "off",
|
||||
"new-cap": "off",
|
||||
|
||||
// plugin rules
|
||||
"no-use-extend-native/no-use-extend-native": "error",
|
||||
// this one breaks libraries like Ramda and lodash
|
||||
"unicorn/no-array-callback-reference": "off",
|
||||
"unicorn/filename-case": "off",
|
||||
"unicorn/better-regex": [
|
||||
"error",
|
||||
{
|
||||
sortCharacterClasses: false,
|
||||
},
|
||||
],
|
||||
"unicorn/prevent-abbreviations": "off",
|
||||
"unicorn/consistent-function-scoping": "off",
|
||||
"unicorn/no-useless-undefined": "off",
|
||||
"unicorn/no-array-reduce": "off",
|
||||
"unicorn/no-array-for-each": "off",
|
||||
"unicorn/prefer-ternary": "off",
|
||||
"unicorn/text-encoding-identifier-case": "off",
|
||||
"unicorn/numeric-separators-style": "off",
|
||||
"function-call-argument-newline": "off",
|
||||
"promise/param-names": "error",
|
||||
"promise/no-return-wrap": [
|
||||
"error",
|
||||
{
|
||||
allowReject: true,
|
||||
},
|
||||
],
|
||||
"promise/no-new-statics": "error",
|
||||
"promise/no-return-in-finally": "error",
|
||||
"promise/valid-params": "error",
|
||||
"promise/prefer-await-to-then": "error",
|
||||
"import/default": "error",
|
||||
"import/export": "error",
|
||||
"import/extensions": [
|
||||
"error",
|
||||
{
|
||||
js: "never",
|
||||
jsx: "never",
|
||||
json: "always",
|
||||
svg: "always",
|
||||
css: "always",
|
||||
test: "ignorePackages",
|
||||
},
|
||||
],
|
||||
|
||||
"import/namespace": [
|
||||
"error",
|
||||
{
|
||||
allowComputed: true,
|
||||
},
|
||||
],
|
||||
"import/no-absolute-path": "error",
|
||||
"import/no-anonymous-default-export": "error",
|
||||
"import/no-named-default": "error",
|
||||
"import/no-webpack-loader-syntax": "error",
|
||||
"import/no-self-import": "error",
|
||||
|
||||
"import/no-useless-path-segments": [
|
||||
"error",
|
||||
{
|
||||
noUselessIndex: true,
|
||||
},
|
||||
],
|
||||
"import/no-amd": "error",
|
||||
"import/no-duplicates": "error",
|
||||
|
||||
// enable this when this is fixed
|
||||
// https://github.com/benmosher/eslint-plugin-import/pull/1696
|
||||
"import/no-extraneous-dependencies": "off",
|
||||
|
||||
"import/no-mutable-exports": "error",
|
||||
"import/no-named-as-default-member": "error",
|
||||
"import/no-named-as-default": "error",
|
||||
"eslint-comments/no-aggregating-enable": "error",
|
||||
"eslint-comments/no-duplicate-disable": "error",
|
||||
"eslint-comments/no-unused-disable": "error",
|
||||
"eslint-comments/no-unused-enable": "error",
|
||||
"no-prototype-builtins": "off",
|
||||
"no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
argsIgnorePattern: "^_",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
const path = require("path");
|
||||
module.exports = {
|
||||
extends: ["plugin:cypress/recommended"],
|
||||
plugins: ["cypress"],
|
||||
env: {
|
||||
"cypress/globals": true,
|
||||
},
|
||||
rules: {},
|
||||
};
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
const path = require("path");
|
||||
module.exports = {
|
||||
extends: ["plugin:jest/recommended"],
|
||||
plugins: [
|
||||
// Plugin documentation: https://www.npmjs.com/package/eslint-plugin-jest
|
||||
"jest",
|
||||
],
|
||||
env: {
|
||||
"jest/globals": true,
|
||||
},
|
||||
rules: {
|
||||
"jest/valid-expect": "off",
|
||||
},
|
||||
};
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
const path = require("path");
|
||||
module.exports = {
|
||||
extends: ["xo-space", path.join(__dirname, "common.js")],
|
||||
env: {
|
||||
es2021: true,
|
||||
node: true,
|
||||
},
|
||||
rules: {},
|
||||
};
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
module.exports = {
|
||||
parser: "@typescript-eslint/parser",
|
||||
parserOptions: { project: "./tsconfig*json" },
|
||||
plugins: [
|
||||
// Plugin documentation: https://www.npmjs.com/package/@typescript-eslint/eslint-plugin
|
||||
"@typescript-eslint/eslint-plugin",
|
||||
],
|
||||
extends: ["plugin:@typescript-eslint/recommended"],
|
||||
rules: {
|
||||
"no-useless-constructor": "off",
|
||||
"no-unused-vars": "off",
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
argsIgnorePattern: "^_",
|
||||
},
|
||||
],
|
||||
"no-extra-semi": "off",
|
||||
"@typescript-eslint/ban-ts-comment": "off",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-extra-semi": "error",
|
||||
},
|
||||
};
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
// Placeholder entry point for jest-config package
|
||||
module.exports = {};
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
module.exports = {
|
||||
testEnvironment: 'node',
|
||||
roots: ["<rootDir>", "<rootDir>/src"],
|
||||
passWithNoTests: true,
|
||||
testMatch: ["<rootDir>/src/**/*.spec.{ts,tsx}"],
|
||||
silent: false,
|
||||
verbose: true,
|
||||
collectCoverage: true,
|
||||
coverageDirectory: "coverage",
|
||||
testPathIgnorePatterns: [
|
||||
"/node_modules"
|
||||
],
|
||||
|
||||
/*
|
||||
The modulePathIgnorePatterns accepts these sorts of paths:
|
||||
<rootDir>/src
|
||||
<rootDir>/src/file.ts
|
||||
...and ignores anything else under <rootDir>
|
||||
*/
|
||||
modulePathIgnorePatterns: ["^<rootDir>/(?!(?:src/)|(?:src$))"]
|
||||
};
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
{
|
||||
"name": "@link-stack/jest-config",
|
||||
"version": "3.5.0-beta.1",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"author": "Abel Luck <abel@guardianproject.info>",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"private": true,
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/jest": "^30.0.0",
|
||||
"jest": "^30.2.0",
|
||||
"jest-junit": "^16.0.0"
|
||||
},
|
||||
"peerDependencies": {}
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
{
|
||||
"name": "@link-stack/logger",
|
||||
"version": "3.5.0-beta.1",
|
||||
"description": "Shared logging utility for Link Stack monorepo",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"require": "./dist/index.js",
|
||||
"import": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsup src/index.ts --format cjs,esm --dts --clean",
|
||||
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
|
||||
"lint": "eslint . --ext .ts",
|
||||
"type-check": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"pino": "^10.0.0",
|
||||
"pino-pretty": "^13.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@link-stack/eslint-config": "workspace:*",
|
||||
"@link-stack/typescript-config": "workspace:*",
|
||||
"@types/node": "^24.7.0",
|
||||
"eslint": "^9.37.0",
|
||||
"tsup": "^8.5.0",
|
||||
"typescript": "^5.9.3"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
import type { LoggerOptions } from 'pino';
|
||||
|
||||
export const getLogLevel = (): string => {
|
||||
return process.env.LOG_LEVEL || (process.env.NODE_ENV === 'production' ? 'info' : 'debug');
|
||||
};
|
||||
|
||||
export const getPinoConfig = (): LoggerOptions => {
|
||||
const isDevelopment = process.env.NODE_ENV !== 'production';
|
||||
|
||||
const baseConfig: LoggerOptions = {
|
||||
level: getLogLevel(),
|
||||
formatters: {
|
||||
level: (label) => {
|
||||
return { level: label.toUpperCase() };
|
||||
},
|
||||
},
|
||||
timestamp: () => `,"timestamp":"${new Date(Date.now()).toISOString()}"`,
|
||||
redact: {
|
||||
paths: [
|
||||
// Top-level sensitive fields
|
||||
'password',
|
||||
'token',
|
||||
'secret',
|
||||
'api_key',
|
||||
'apiKey',
|
||||
'authorization',
|
||||
'cookie',
|
||||
'HandshakeKey',
|
||||
'receivedSecret',
|
||||
'access_token',
|
||||
'refresh_token',
|
||||
'zammadCsrfToken',
|
||||
'clientSecret',
|
||||
// Nested sensitive fields (one level)
|
||||
'*.password',
|
||||
'*.token',
|
||||
'*.secret',
|
||||
'*.api_key',
|
||||
'*.apiKey',
|
||||
'*.authorization',
|
||||
'*.cookie',
|
||||
'*.access_token',
|
||||
'*.refresh_token',
|
||||
'*.zammadCsrfToken',
|
||||
'*.HandshakeKey',
|
||||
'*.receivedSecret',
|
||||
'*.clientSecret',
|
||||
// Common nested patterns
|
||||
'payload.HandshakeKey',
|
||||
'headers.authorization',
|
||||
'headers.cookie',
|
||||
'headers.Authorization',
|
||||
'headers.Cookie',
|
||||
'credentials.password',
|
||||
'credentials.secret',
|
||||
'credentials.token',
|
||||
],
|
||||
censor: '[REDACTED]',
|
||||
},
|
||||
};
|
||||
|
||||
if (isDevelopment) {
|
||||
// In development, use pretty printing for better readability
|
||||
return {
|
||||
...baseConfig,
|
||||
transport: {
|
||||
target: 'pino-pretty',
|
||||
options: {
|
||||
colorize: true,
|
||||
translateTime: 'SYS:standard',
|
||||
ignore: 'pid,hostname',
|
||||
singleLine: false,
|
||||
messageFormat: '{msg}',
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
// In production, use JSON for structured logging
|
||||
return baseConfig;
|
||||
};
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
import pino, { Logger as PinoLogger } from 'pino';
|
||||
import { getPinoConfig } from './config';
|
||||
|
||||
export type Logger = PinoLogger;
|
||||
|
||||
// Create the default logger instance
|
||||
export const logger: Logger = pino(getPinoConfig());
|
||||
|
||||
// Factory function to create child loggers with context
|
||||
export const createLogger = (name: string, context?: Record<string, any>): Logger => {
|
||||
return logger.child({ name, ...context });
|
||||
};
|
||||
|
||||
// Export log levels for consistency
|
||||
export const LogLevel = {
|
||||
TRACE: 'trace',
|
||||
DEBUG: 'debug',
|
||||
INFO: 'info',
|
||||
WARN: 'warn',
|
||||
ERROR: 'error',
|
||||
FATAL: 'fatal',
|
||||
} as const;
|
||||
|
||||
export type LogLevelType = typeof LogLevel[keyof typeof LogLevel];
|
||||
|
||||
// Utility to check if a log level is enabled
|
||||
export const isLogLevelEnabled = (level: LogLevelType): boolean => {
|
||||
return logger.isLevelEnabled(level);
|
||||
};
|
||||
|
||||
// Re-export pino types that might be useful
|
||||
export type { LoggerOptions, DestinationStream } from 'pino';
|
||||
|
||||
// Default export for convenience
|
||||
export default logger;
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2022",
|
||||
"lib": ["es2022"],
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true,
|
||||
"allowJs": false,
|
||||
"types": ["node"]
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
module.exports = {
|
||||
root: true,
|
||||
extends: ["@link-stack/eslint-config/eslint.node.config.js"],
|
||||
};
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
# OpenAPI Generator Ignore
|
||||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||
|
||||
# Use this file to prevent files from being overwritten by the generator.
|
||||
# The patterns follow closely to .gitignore or .dockerignore.
|
||||
|
||||
# As an example, the C# client generator defines ApiClient.cs.
|
||||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
||||
#ApiClient.cs
|
||||
|
||||
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||
#foo/*/qux
|
||||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||
|
||||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||
#foo/**/qux
|
||||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||
|
||||
# You can also negate patterns with an exclamation (!).
|
||||
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||
#docs/*.md
|
||||
# Then explicitly reverse the ignore rule for a single file:
|
||||
#!docs/README.md
|
||||
|
|
@ -1,326 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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.js";
|
||||
import type {
|
||||
ApiError,
|
||||
ApiRateLimitChallengeRequest,
|
||||
ApiSetUsernameRequest,
|
||||
ApiUpdateAccountSettingsRequest,
|
||||
ClientSetUsernameResponse,
|
||||
} from "../models/index.js";
|
||||
import {
|
||||
ApiErrorFromJSON,
|
||||
ApiErrorToJSON,
|
||||
ApiRateLimitChallengeRequestFromJSON,
|
||||
ApiRateLimitChallengeRequestToJSON,
|
||||
ApiSetUsernameRequestFromJSON,
|
||||
ApiSetUsernameRequestToJSON,
|
||||
ApiUpdateAccountSettingsRequestFromJSON,
|
||||
ApiUpdateAccountSettingsRequestToJSON,
|
||||
ClientSetUsernameResponseFromJSON,
|
||||
ClientSetUsernameResponseToJSON,
|
||||
} from "../models/index.js";
|
||||
|
||||
export interface V1AccountsNumberRateLimitChallengePostRequest {
|
||||
number: string;
|
||||
data: ApiRateLimitChallengeRequest;
|
||||
}
|
||||
|
||||
export interface V1AccountsNumberSettingsPutRequest {
|
||||
number: string;
|
||||
data: ApiUpdateAccountSettingsRequest;
|
||||
}
|
||||
|
||||
export interface V1AccountsNumberUsernameDeleteRequest {
|
||||
number: string;
|
||||
}
|
||||
|
||||
export interface V1AccountsNumberUsernamePostRequest {
|
||||
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 = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
const response = await this.request(
|
||||
{
|
||||
path: `/v1/accounts`,
|
||||
method: "GET",
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
},
|
||||
initOverrides,
|
||||
);
|
||||
|
||||
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().',
|
||||
);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,169 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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.js";
|
||||
import type { ApiError } from "../models/index.js";
|
||||
import { ApiErrorFromJSON, ApiErrorToJSON } from "../models/index.js";
|
||||
|
||||
export interface V1AttachmentsAttachmentDeleteRequest {
|
||||
attachment: string;
|
||||
}
|
||||
|
||||
export interface V1AttachmentsAttachmentGetRequest {
|
||||
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 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<Blob>> {
|
||||
if (requestParameters["attachment"] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
"attachment",
|
||||
'Required parameter "attachment" was null or undefined when calling v1AttachmentsAttachmentGet().',
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
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,
|
||||
);
|
||||
|
||||
return new runtime.BlobApiResponse(response) as any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Serve the attachment with the given id
|
||||
* Serve Attachment.
|
||||
*/
|
||||
async v1AttachmentsAttachmentGet(
|
||||
requestParameters: V1AttachmentsAttachmentGetRequest,
|
||||
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
||||
): Promise<Blob> {
|
||||
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 = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,138 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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.js";
|
||||
import type { ApiError, ApiUpdateContactRequest } from "../models/index.js";
|
||||
import {
|
||||
ApiErrorFromJSON,
|
||||
ApiErrorToJSON,
|
||||
ApiUpdateContactRequestFromJSON,
|
||||
ApiUpdateContactRequestToJSON,
|
||||
} from "../models/index.js";
|
||||
|
||||
export interface V1ContactsNumberPutRequest {
|
||||
number: string;
|
||||
data: ApiUpdateContactRequest;
|
||||
}
|
||||
|
||||
export interface V1ContactsNumberSyncPostRequest {
|
||||
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 doesn’t 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 doesn’t 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().',
|
||||
);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,343 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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.js";
|
||||
import type {
|
||||
ApiAddDeviceRequest,
|
||||
ApiError,
|
||||
ApiRegisterNumberRequest,
|
||||
ApiUnregisterNumberRequest,
|
||||
ApiVerifyNumberSettings,
|
||||
} from "../models/index.js";
|
||||
import {
|
||||
ApiAddDeviceRequestFromJSON,
|
||||
ApiAddDeviceRequestToJSON,
|
||||
ApiErrorFromJSON,
|
||||
ApiErrorToJSON,
|
||||
ApiRegisterNumberRequestFromJSON,
|
||||
ApiRegisterNumberRequestToJSON,
|
||||
ApiUnregisterNumberRequestFromJSON,
|
||||
ApiUnregisterNumberRequestToJSON,
|
||||
ApiVerifyNumberSettingsFromJSON,
|
||||
ApiVerifyNumberSettingsToJSON,
|
||||
} from "../models/index.js";
|
||||
|
||||
export interface V1DevicesNumberPostRequest {
|
||||
number: string;
|
||||
data: ApiAddDeviceRequest;
|
||||
}
|
||||
|
||||
export interface V1QrcodelinkGetRequest {
|
||||
deviceName: string;
|
||||
qrcodeVersion?: number;
|
||||
}
|
||||
|
||||
export interface V1RegisterNumberPostRequest {
|
||||
number: string;
|
||||
data?: ApiRegisterNumberRequest;
|
||||
}
|
||||
|
||||
export interface V1RegisterNumberVerifyTokenPostRequest {
|
||||
number: string;
|
||||
token: string;
|
||||
data?: ApiVerifyNumberSettings;
|
||||
}
|
||||
|
||||
export interface V1UnregisterNumberPostRequest {
|
||||
number: string;
|
||||
data?: ApiUnregisterNumberRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class DevicesApi extends runtime.BaseAPI {
|
||||
/**
|
||||
* Links another device to this device. Only works, if this is the master device.
|
||||
* Links another device to this device.
|
||||
*/
|
||||
async v1DevicesNumberPostRaw(
|
||||
requestParameters: V1DevicesNumberPostRequest,
|
||||
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 v1DevicesNumberPost().',
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters["data"] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
"data",
|
||||
'Required parameter "data" was null or undefined when calling v1DevicesNumberPost().',
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters["Content-Type"] = "application/json";
|
||||
|
||||
const response = await this.request(
|
||||
{
|
||||
path: `/v1/devices/{number}`.replace(
|
||||
`{${"number"}}`,
|
||||
encodeURIComponent(String(requestParameters["number"])),
|
||||
),
|
||||
method: "POST",
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ApiAddDeviceRequestToJSON(requestParameters["data"]),
|
||||
},
|
||||
initOverrides,
|
||||
);
|
||||
|
||||
return new runtime.VoidApiResponse(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Links another device to this device. Only works, if this is the master device.
|
||||
* Links another device to this device.
|
||||
*/
|
||||
async v1DevicesNumberPost(
|
||||
requestParameters: V1DevicesNumberPostRequest,
|
||||
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
||||
): Promise<void> {
|
||||
await this.v1DevicesNumberPostRaw(requestParameters, initOverrides);
|
||||
}
|
||||
|
||||
/**
|
||||
* Link device and generate QR code
|
||||
* Link device and generate QR code.
|
||||
*/
|
||||
async v1QrcodelinkGetRaw(
|
||||
requestParameters: V1QrcodelinkGetRequest,
|
||||
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
||||
): Promise<runtime.ApiResponse<Blob>> {
|
||||
if (requestParameters["deviceName"] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
"deviceName",
|
||||
'Required parameter "deviceName" was null or undefined when calling v1QrcodelinkGet().',
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters["deviceName"] != null) {
|
||||
queryParameters["device_name"] = requestParameters["deviceName"];
|
||||
}
|
||||
|
||||
if (requestParameters["qrcodeVersion"] != null) {
|
||||
queryParameters["qrcode_version"] = requestParameters["qrcodeVersion"];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
const response = await this.request(
|
||||
{
|
||||
path: `/v1/qrcodelink`,
|
||||
method: "GET",
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
},
|
||||
initOverrides,
|
||||
);
|
||||
|
||||
return new runtime.BlobApiResponse(response) as any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Link device and generate QR code
|
||||
* Link device and generate QR code.
|
||||
*/
|
||||
async v1QrcodelinkGet(
|
||||
requestParameters: V1QrcodelinkGetRequest,
|
||||
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
||||
): Promise<Blob> {
|
||||
const response = await this.v1QrcodelinkGetRaw(
|
||||
requestParameters,
|
||||
initOverrides,
|
||||
);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a phone number with the signal network.
|
||||
* Register a phone number.
|
||||
*/
|
||||
async v1RegisterNumberPostRaw(
|
||||
requestParameters: V1RegisterNumberPostRequest,
|
||||
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 v1RegisterNumberPost().',
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters["Content-Type"] = "application/json";
|
||||
|
||||
const response = await this.request(
|
||||
{
|
||||
path: `/v1/register/{number}`.replace(
|
||||
`{${"number"}}`,
|
||||
encodeURIComponent(String(requestParameters["number"])),
|
||||
),
|
||||
method: "POST",
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ApiRegisterNumberRequestToJSON(requestParameters["data"]),
|
||||
},
|
||||
initOverrides,
|
||||
);
|
||||
|
||||
return new runtime.VoidApiResponse(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a phone number with the signal network.
|
||||
* Register a phone number.
|
||||
*/
|
||||
async v1RegisterNumberPost(
|
||||
requestParameters: V1RegisterNumberPostRequest,
|
||||
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
||||
): Promise<void> {
|
||||
await this.v1RegisterNumberPostRaw(requestParameters, initOverrides);
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify a registered phone number with the signal network.
|
||||
* Verify a registered phone number.
|
||||
*/
|
||||
async v1RegisterNumberVerifyTokenPostRaw(
|
||||
requestParameters: V1RegisterNumberVerifyTokenPostRequest,
|
||||
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 v1RegisterNumberVerifyTokenPost().',
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters["token"] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
"token",
|
||||
'Required parameter "token" was null or undefined when calling v1RegisterNumberVerifyTokenPost().',
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters["Content-Type"] = "application/json";
|
||||
|
||||
const response = await this.request(
|
||||
{
|
||||
path: `/v1/register/{number}/verify/{token}`
|
||||
.replace(
|
||||
`{${"number"}}`,
|
||||
encodeURIComponent(String(requestParameters["number"])),
|
||||
)
|
||||
.replace(
|
||||
`{${"token"}}`,
|
||||
encodeURIComponent(String(requestParameters["token"])),
|
||||
),
|
||||
method: "POST",
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ApiVerifyNumberSettingsToJSON(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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify a registered phone number with the signal network.
|
||||
* Verify a registered phone number.
|
||||
*/
|
||||
async v1RegisterNumberVerifyTokenPost(
|
||||
requestParameters: V1RegisterNumberVerifyTokenPostRequest,
|
||||
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
||||
): Promise<string> {
|
||||
const response = await this.v1RegisterNumberVerifyTokenPostRaw(
|
||||
requestParameters,
|
||||
initOverrides,
|
||||
);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables push support for this device. **WARNING:** If *delete_account* is set to *true*, the account will be deleted from the Signal Server. This cannot be undone without loss.
|
||||
* Unregister a phone number.
|
||||
*/
|
||||
async v1UnregisterNumberPostRaw(
|
||||
requestParameters: V1UnregisterNumberPostRequest,
|
||||
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 v1UnregisterNumberPost().',
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters["Content-Type"] = "application/json";
|
||||
|
||||
const response = await this.request(
|
||||
{
|
||||
path: `/v1/unregister/{number}`.replace(
|
||||
`{${"number"}}`,
|
||||
encodeURIComponent(String(requestParameters["number"])),
|
||||
),
|
||||
method: "POST",
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ApiUnregisterNumberRequestToJSON(requestParameters["data"]),
|
||||
},
|
||||
initOverrides,
|
||||
);
|
||||
|
||||
return new runtime.VoidApiResponse(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables push support for this device. **WARNING:** If *delete_account* is set to *true*, the account will be deleted from the Signal Server. This cannot be undone without loss.
|
||||
* Unregister a phone number.
|
||||
*/
|
||||
async v1UnregisterNumberPost(
|
||||
requestParameters: V1UnregisterNumberPostRequest,
|
||||
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
||||
): Promise<void> {
|
||||
await this.v1UnregisterNumberPostRaw(requestParameters, initOverrides);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,338 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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.js";
|
||||
import type {
|
||||
ApiConfiguration,
|
||||
ApiError,
|
||||
ApiTrustModeRequest,
|
||||
ApiTrustModeResponse,
|
||||
ClientAbout,
|
||||
} from "../models/index.js";
|
||||
import {
|
||||
ApiConfigurationFromJSON,
|
||||
ApiConfigurationToJSON,
|
||||
ApiErrorFromJSON,
|
||||
ApiErrorToJSON,
|
||||
ApiTrustModeRequestFromJSON,
|
||||
ApiTrustModeRequestToJSON,
|
||||
ApiTrustModeResponseFromJSON,
|
||||
ApiTrustModeResponseToJSON,
|
||||
ClientAboutFromJSON,
|
||||
ClientAboutToJSON,
|
||||
} from "../models/index.js";
|
||||
|
||||
export interface V1ConfigurationNumberSettingsGetRequest {
|
||||
number: string;
|
||||
data: ApiTrustModeResponse;
|
||||
}
|
||||
|
||||
export interface V1ConfigurationNumberSettingsPostRequest {
|
||||
number: string;
|
||||
data: ApiTrustModeRequest;
|
||||
}
|
||||
|
||||
export interface V1ConfigurationPostRequest {
|
||||
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 = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
const response = await this.request(
|
||||
{
|
||||
path: `/v1/about`,
|
||||
method: "GET",
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
},
|
||||
initOverrides,
|
||||
);
|
||||
|
||||
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().',
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters["data"] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
"data",
|
||||
'Required parameter "data" was null or undefined when calling v1ConfigurationNumberSettingsGet().',
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters["Content-Type"] = "application/json";
|
||||
|
||||
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().',
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters["data"] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
"data",
|
||||
'Required parameter "data" was null or undefined when calling v1ConfigurationNumberSettingsPost().',
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,879 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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.js";
|
||||
import type {
|
||||
ApiChangeGroupAdminsRequest,
|
||||
ApiChangeGroupMembersRequest,
|
||||
ApiCreateGroupRequest,
|
||||
ApiCreateGroupResponse,
|
||||
ApiError,
|
||||
ApiUpdateGroupRequest,
|
||||
ClientGroupEntry,
|
||||
} from "../models/index.js";
|
||||
import {
|
||||
ApiChangeGroupAdminsRequestFromJSON,
|
||||
ApiChangeGroupAdminsRequestToJSON,
|
||||
ApiChangeGroupMembersRequestFromJSON,
|
||||
ApiChangeGroupMembersRequestToJSON,
|
||||
ApiCreateGroupRequestFromJSON,
|
||||
ApiCreateGroupRequestToJSON,
|
||||
ApiCreateGroupResponseFromJSON,
|
||||
ApiCreateGroupResponseToJSON,
|
||||
ApiErrorFromJSON,
|
||||
ApiErrorToJSON,
|
||||
ApiUpdateGroupRequestFromJSON,
|
||||
ApiUpdateGroupRequestToJSON,
|
||||
ClientGroupEntryFromJSON,
|
||||
ClientGroupEntryToJSON,
|
||||
} from "../models/index.js";
|
||||
|
||||
export interface V1GroupsNumberGetRequest {
|
||||
number: string;
|
||||
}
|
||||
|
||||
export interface V1GroupsNumberGroupidAdminsDeleteRequest {
|
||||
number: string;
|
||||
data: ApiChangeGroupAdminsRequest;
|
||||
}
|
||||
|
||||
export interface V1GroupsNumberGroupidAdminsPostRequest {
|
||||
number: string;
|
||||
data: ApiChangeGroupAdminsRequest;
|
||||
}
|
||||
|
||||
export interface V1GroupsNumberGroupidBlockPostRequest {
|
||||
number: string;
|
||||
groupid: string;
|
||||
}
|
||||
|
||||
export interface V1GroupsNumberGroupidDeleteRequest {
|
||||
number: string;
|
||||
groupid: string;
|
||||
}
|
||||
|
||||
export interface V1GroupsNumberGroupidGetRequest {
|
||||
number: string;
|
||||
groupid: string;
|
||||
}
|
||||
|
||||
export interface V1GroupsNumberGroupidJoinPostRequest {
|
||||
number: string;
|
||||
groupid: string;
|
||||
}
|
||||
|
||||
export interface V1GroupsNumberGroupidMembersDeleteRequest {
|
||||
number: string;
|
||||
data: ApiChangeGroupMembersRequest;
|
||||
}
|
||||
|
||||
export interface V1GroupsNumberGroupidMembersPostRequest {
|
||||
number: string;
|
||||
data: ApiChangeGroupMembersRequest;
|
||||
}
|
||||
|
||||
export interface V1GroupsNumberGroupidPutRequest {
|
||||
number: string;
|
||||
groupid: string;
|
||||
data: ApiUpdateGroupRequest;
|
||||
}
|
||||
|
||||
export interface V1GroupsNumberGroupidQuitPostRequest {
|
||||
number: string;
|
||||
groupid: string;
|
||||
}
|
||||
|
||||
export interface V1GroupsNumberPostRequest {
|
||||
number: string;
|
||||
data: ApiCreateGroupRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class GroupsApi extends runtime.BaseAPI {
|
||||
/**
|
||||
* List all Signal Groups.
|
||||
* List all Signal Groups.
|
||||
*/
|
||||
async v1GroupsNumberGetRaw(
|
||||
requestParameters: V1GroupsNumberGetRequest,
|
||||
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
||||
): Promise<runtime.ApiResponse<Array<ClientGroupEntry>>> {
|
||||
if (requestParameters["number"] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
"number",
|
||||
'Required parameter "number" was null or undefined when calling v1GroupsNumberGet().',
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
const response = await this.request(
|
||||
{
|
||||
path: `/v1/groups/{number}`.replace(
|
||||
`{${"number"}}`,
|
||||
encodeURIComponent(String(requestParameters["number"])),
|
||||
),
|
||||
method: "GET",
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
},
|
||||
initOverrides,
|
||||
);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) =>
|
||||
jsonValue.map(ClientGroupEntryFromJSON),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* List all Signal Groups.
|
||||
* List all Signal Groups.
|
||||
*/
|
||||
async v1GroupsNumberGet(
|
||||
requestParameters: V1GroupsNumberGetRequest,
|
||||
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
||||
): Promise<Array<ClientGroupEntry>> {
|
||||
const response = await this.v1GroupsNumberGetRaw(
|
||||
requestParameters,
|
||||
initOverrides,
|
||||
);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove one or more admins from an existing Signal Group.
|
||||
* Remove one or more admins from an existing Signal Group.
|
||||
*/
|
||||
async v1GroupsNumberGroupidAdminsDeleteRaw(
|
||||
requestParameters: V1GroupsNumberGroupidAdminsDeleteRequest,
|
||||
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 v1GroupsNumberGroupidAdminsDelete().',
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters["data"] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
"data",
|
||||
'Required parameter "data" was null or undefined when calling v1GroupsNumberGroupidAdminsDelete().',
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters["Content-Type"] = "application/json";
|
||||
|
||||
const response = await this.request(
|
||||
{
|
||||
path: `/v1/groups/{number}/{groupid}/admins`.replace(
|
||||
`{${"number"}}`,
|
||||
encodeURIComponent(String(requestParameters["number"])),
|
||||
),
|
||||
method: "DELETE",
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ApiChangeGroupAdminsRequestToJSON(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 one or more admins from an existing Signal Group.
|
||||
* Remove one or more admins from an existing Signal Group.
|
||||
*/
|
||||
async v1GroupsNumberGroupidAdminsDelete(
|
||||
requestParameters: V1GroupsNumberGroupidAdminsDeleteRequest,
|
||||
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
||||
): Promise<string> {
|
||||
const response = await this.v1GroupsNumberGroupidAdminsDeleteRaw(
|
||||
requestParameters,
|
||||
initOverrides,
|
||||
);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add one or more admins to an existing Signal Group.
|
||||
* Add one or more admins to an existing Signal Group.
|
||||
*/
|
||||
async v1GroupsNumberGroupidAdminsPostRaw(
|
||||
requestParameters: V1GroupsNumberGroupidAdminsPostRequest,
|
||||
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 v1GroupsNumberGroupidAdminsPost().',
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters["data"] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
"data",
|
||||
'Required parameter "data" was null or undefined when calling v1GroupsNumberGroupidAdminsPost().',
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters["Content-Type"] = "application/json";
|
||||
|
||||
const response = await this.request(
|
||||
{
|
||||
path: `/v1/groups/{number}/{groupid}/admins`.replace(
|
||||
`{${"number"}}`,
|
||||
encodeURIComponent(String(requestParameters["number"])),
|
||||
),
|
||||
method: "POST",
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ApiChangeGroupAdminsRequestToJSON(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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add one or more admins to an existing Signal Group.
|
||||
* Add one or more admins to an existing Signal Group.
|
||||
*/
|
||||
async v1GroupsNumberGroupidAdminsPost(
|
||||
requestParameters: V1GroupsNumberGroupidAdminsPostRequest,
|
||||
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
||||
): Promise<string> {
|
||||
const response = await this.v1GroupsNumberGroupidAdminsPostRaw(
|
||||
requestParameters,
|
||||
initOverrides,
|
||||
);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Block the specified Signal Group.
|
||||
* Block a Signal Group.
|
||||
*/
|
||||
async v1GroupsNumberGroupidBlockPostRaw(
|
||||
requestParameters: V1GroupsNumberGroupidBlockPostRequest,
|
||||
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 v1GroupsNumberGroupidBlockPost().',
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters["groupid"] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
"groupid",
|
||||
'Required parameter "groupid" was null or undefined when calling v1GroupsNumberGroupidBlockPost().',
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
const response = await this.request(
|
||||
{
|
||||
path: `/v1/groups/{number}/{groupid}/block`
|
||||
.replace(
|
||||
`{${"number"}}`,
|
||||
encodeURIComponent(String(requestParameters["number"])),
|
||||
)
|
||||
.replace(
|
||||
`{${"groupid"}}`,
|
||||
encodeURIComponent(String(requestParameters["groupid"])),
|
||||
),
|
||||
method: "POST",
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Block the specified Signal Group.
|
||||
* Block a Signal Group.
|
||||
*/
|
||||
async v1GroupsNumberGroupidBlockPost(
|
||||
requestParameters: V1GroupsNumberGroupidBlockPostRequest,
|
||||
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
||||
): Promise<string> {
|
||||
const response = await this.v1GroupsNumberGroupidBlockPostRaw(
|
||||
requestParameters,
|
||||
initOverrides,
|
||||
);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the specified Signal Group.
|
||||
* Delete a Signal Group.
|
||||
*/
|
||||
async v1GroupsNumberGroupidDeleteRaw(
|
||||
requestParameters: V1GroupsNumberGroupidDeleteRequest,
|
||||
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 v1GroupsNumberGroupidDelete().',
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters["groupid"] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
"groupid",
|
||||
'Required parameter "groupid" was null or undefined when calling v1GroupsNumberGroupidDelete().',
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
const response = await this.request(
|
||||
{
|
||||
path: `/v1/groups/{number}/{groupid}`
|
||||
.replace(
|
||||
`{${"number"}}`,
|
||||
encodeURIComponent(String(requestParameters["number"])),
|
||||
)
|
||||
.replace(
|
||||
`{${"groupid"}}`,
|
||||
encodeURIComponent(String(requestParameters["groupid"])),
|
||||
),
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the specified Signal Group.
|
||||
* Delete a Signal Group.
|
||||
*/
|
||||
async v1GroupsNumberGroupidDelete(
|
||||
requestParameters: V1GroupsNumberGroupidDeleteRequest,
|
||||
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
||||
): Promise<string> {
|
||||
const response = await this.v1GroupsNumberGroupidDeleteRaw(
|
||||
requestParameters,
|
||||
initOverrides,
|
||||
);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* List a specific Signal Group.
|
||||
* List a Signal Group.
|
||||
*/
|
||||
async v1GroupsNumberGroupidGetRaw(
|
||||
requestParameters: V1GroupsNumberGroupidGetRequest,
|
||||
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
||||
): Promise<runtime.ApiResponse<ClientGroupEntry>> {
|
||||
if (requestParameters["number"] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
"number",
|
||||
'Required parameter "number" was null or undefined when calling v1GroupsNumberGroupidGet().',
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters["groupid"] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
"groupid",
|
||||
'Required parameter "groupid" was null or undefined when calling v1GroupsNumberGroupidGet().',
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
const response = await this.request(
|
||||
{
|
||||
path: `/v1/groups/{number}/{groupid}`
|
||||
.replace(
|
||||
`{${"number"}}`,
|
||||
encodeURIComponent(String(requestParameters["number"])),
|
||||
)
|
||||
.replace(
|
||||
`{${"groupid"}}`,
|
||||
encodeURIComponent(String(requestParameters["groupid"])),
|
||||
),
|
||||
method: "GET",
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
},
|
||||
initOverrides,
|
||||
);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) =>
|
||||
ClientGroupEntryFromJSON(jsonValue),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* List a specific Signal Group.
|
||||
* List a Signal Group.
|
||||
*/
|
||||
async v1GroupsNumberGroupidGet(
|
||||
requestParameters: V1GroupsNumberGroupidGetRequest,
|
||||
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
||||
): Promise<ClientGroupEntry> {
|
||||
const response = await this.v1GroupsNumberGroupidGetRaw(
|
||||
requestParameters,
|
||||
initOverrides,
|
||||
);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Join the specified Signal Group.
|
||||
* Join a Signal Group.
|
||||
*/
|
||||
async v1GroupsNumberGroupidJoinPostRaw(
|
||||
requestParameters: V1GroupsNumberGroupidJoinPostRequest,
|
||||
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 v1GroupsNumberGroupidJoinPost().',
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters["groupid"] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
"groupid",
|
||||
'Required parameter "groupid" was null or undefined when calling v1GroupsNumberGroupidJoinPost().',
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
const response = await this.request(
|
||||
{
|
||||
path: `/v1/groups/{number}/{groupid}/join`
|
||||
.replace(
|
||||
`{${"number"}}`,
|
||||
encodeURIComponent(String(requestParameters["number"])),
|
||||
)
|
||||
.replace(
|
||||
`{${"groupid"}}`,
|
||||
encodeURIComponent(String(requestParameters["groupid"])),
|
||||
),
|
||||
method: "POST",
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Join the specified Signal Group.
|
||||
* Join a Signal Group.
|
||||
*/
|
||||
async v1GroupsNumberGroupidJoinPost(
|
||||
requestParameters: V1GroupsNumberGroupidJoinPostRequest,
|
||||
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
||||
): Promise<string> {
|
||||
const response = await this.v1GroupsNumberGroupidJoinPostRaw(
|
||||
requestParameters,
|
||||
initOverrides,
|
||||
);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove one or more members from an existing Signal Group.
|
||||
* Remove one or more members from an existing Signal Group.
|
||||
*/
|
||||
async v1GroupsNumberGroupidMembersDeleteRaw(
|
||||
requestParameters: V1GroupsNumberGroupidMembersDeleteRequest,
|
||||
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 v1GroupsNumberGroupidMembersDelete().',
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters["data"] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
"data",
|
||||
'Required parameter "data" was null or undefined when calling v1GroupsNumberGroupidMembersDelete().',
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters["Content-Type"] = "application/json";
|
||||
|
||||
const response = await this.request(
|
||||
{
|
||||
path: `/v1/groups/{number}/{groupid}/members`.replace(
|
||||
`{${"number"}}`,
|
||||
encodeURIComponent(String(requestParameters["number"])),
|
||||
),
|
||||
method: "DELETE",
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ApiChangeGroupMembersRequestToJSON(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 one or more members from an existing Signal Group.
|
||||
* Remove one or more members from an existing Signal Group.
|
||||
*/
|
||||
async v1GroupsNumberGroupidMembersDelete(
|
||||
requestParameters: V1GroupsNumberGroupidMembersDeleteRequest,
|
||||
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
||||
): Promise<string> {
|
||||
const response = await this.v1GroupsNumberGroupidMembersDeleteRaw(
|
||||
requestParameters,
|
||||
initOverrides,
|
||||
);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add one or more members to an existing Signal Group.
|
||||
* Add one or more members to an existing Signal Group.
|
||||
*/
|
||||
async v1GroupsNumberGroupidMembersPostRaw(
|
||||
requestParameters: V1GroupsNumberGroupidMembersPostRequest,
|
||||
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 v1GroupsNumberGroupidMembersPost().',
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters["data"] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
"data",
|
||||
'Required parameter "data" was null or undefined when calling v1GroupsNumberGroupidMembersPost().',
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters["Content-Type"] = "application/json";
|
||||
|
||||
const response = await this.request(
|
||||
{
|
||||
path: `/v1/groups/{number}/{groupid}/members`.replace(
|
||||
`{${"number"}}`,
|
||||
encodeURIComponent(String(requestParameters["number"])),
|
||||
),
|
||||
method: "POST",
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ApiChangeGroupMembersRequestToJSON(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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add one or more members to an existing Signal Group.
|
||||
* Add one or more members to an existing Signal Group.
|
||||
*/
|
||||
async v1GroupsNumberGroupidMembersPost(
|
||||
requestParameters: V1GroupsNumberGroupidMembersPostRequest,
|
||||
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
||||
): Promise<string> {
|
||||
const response = await this.v1GroupsNumberGroupidMembersPostRaw(
|
||||
requestParameters,
|
||||
initOverrides,
|
||||
);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the state of a Signal Group.
|
||||
* Update the state of a Signal Group.
|
||||
*/
|
||||
async v1GroupsNumberGroupidPutRaw(
|
||||
requestParameters: V1GroupsNumberGroupidPutRequest,
|
||||
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 v1GroupsNumberGroupidPut().',
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters["groupid"] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
"groupid",
|
||||
'Required parameter "groupid" was null or undefined when calling v1GroupsNumberGroupidPut().',
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters["data"] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
"data",
|
||||
'Required parameter "data" was null or undefined when calling v1GroupsNumberGroupidPut().',
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters["Content-Type"] = "application/json";
|
||||
|
||||
const response = await this.request(
|
||||
{
|
||||
path: `/v1/groups/{number}/{groupid}`
|
||||
.replace(
|
||||
`{${"number"}}`,
|
||||
encodeURIComponent(String(requestParameters["number"])),
|
||||
)
|
||||
.replace(
|
||||
`{${"groupid"}}`,
|
||||
encodeURIComponent(String(requestParameters["groupid"])),
|
||||
),
|
||||
method: "PUT",
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ApiUpdateGroupRequestToJSON(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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the state of a Signal Group.
|
||||
* Update the state of a Signal Group.
|
||||
*/
|
||||
async v1GroupsNumberGroupidPut(
|
||||
requestParameters: V1GroupsNumberGroupidPutRequest,
|
||||
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
||||
): Promise<string> {
|
||||
const response = await this.v1GroupsNumberGroupidPutRaw(
|
||||
requestParameters,
|
||||
initOverrides,
|
||||
);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Quit the specified Signal Group.
|
||||
* Quit a Signal Group.
|
||||
*/
|
||||
async v1GroupsNumberGroupidQuitPostRaw(
|
||||
requestParameters: V1GroupsNumberGroupidQuitPostRequest,
|
||||
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 v1GroupsNumberGroupidQuitPost().',
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters["groupid"] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
"groupid",
|
||||
'Required parameter "groupid" was null or undefined when calling v1GroupsNumberGroupidQuitPost().',
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
const response = await this.request(
|
||||
{
|
||||
path: `/v1/groups/{number}/{groupid}/quit`
|
||||
.replace(
|
||||
`{${"number"}}`,
|
||||
encodeURIComponent(String(requestParameters["number"])),
|
||||
)
|
||||
.replace(
|
||||
`{${"groupid"}}`,
|
||||
encodeURIComponent(String(requestParameters["groupid"])),
|
||||
),
|
||||
method: "POST",
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Quit the specified Signal Group.
|
||||
* Quit a Signal Group.
|
||||
*/
|
||||
async v1GroupsNumberGroupidQuitPost(
|
||||
requestParameters: V1GroupsNumberGroupidQuitPostRequest,
|
||||
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
||||
): Promise<string> {
|
||||
const response = await this.v1GroupsNumberGroupidQuitPostRaw(
|
||||
requestParameters,
|
||||
initOverrides,
|
||||
);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new Signal Group with the specified members.
|
||||
* Create a new Signal Group.
|
||||
*/
|
||||
async v1GroupsNumberPostRaw(
|
||||
requestParameters: V1GroupsNumberPostRequest,
|
||||
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
||||
): Promise<runtime.ApiResponse<ApiCreateGroupResponse>> {
|
||||
if (requestParameters["number"] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
"number",
|
||||
'Required parameter "number" was null or undefined when calling v1GroupsNumberPost().',
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters["data"] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
"data",
|
||||
'Required parameter "data" was null or undefined when calling v1GroupsNumberPost().',
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters["Content-Type"] = "application/json";
|
||||
|
||||
const response = await this.request(
|
||||
{
|
||||
path: `/v1/groups/{number}`.replace(
|
||||
`{${"number"}}`,
|
||||
encodeURIComponent(String(requestParameters["number"])),
|
||||
),
|
||||
method: "POST",
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ApiCreateGroupRequestToJSON(requestParameters["data"]),
|
||||
},
|
||||
initOverrides,
|
||||
);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) =>
|
||||
ApiCreateGroupResponseFromJSON(jsonValue),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new Signal Group with the specified members.
|
||||
* Create a new Signal Group.
|
||||
*/
|
||||
async v1GroupsNumberPost(
|
||||
requestParameters: V1GroupsNumberPostRequest,
|
||||
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
||||
): Promise<ApiCreateGroupResponse> {
|
||||
const response = await this.v1GroupsNumberPostRaw(
|
||||
requestParameters,
|
||||
initOverrides,
|
||||
);
|
||||
return await response.value();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,168 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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.js";
|
||||
import type {
|
||||
ApiTrustIdentityRequest,
|
||||
ClientIdentityEntry,
|
||||
} from "../models/index.js";
|
||||
import {
|
||||
ApiTrustIdentityRequestFromJSON,
|
||||
ApiTrustIdentityRequestToJSON,
|
||||
ClientIdentityEntryFromJSON,
|
||||
ClientIdentityEntryToJSON,
|
||||
} from "../models/index.js";
|
||||
|
||||
export interface V1IdentitiesNumberGetRequest {
|
||||
number: string;
|
||||
}
|
||||
|
||||
export interface V1IdentitiesNumberTrustNumberToTrustPutRequest {
|
||||
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 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().',
|
||||
);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,371 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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.js";
|
||||
import type {
|
||||
ApiError,
|
||||
ApiSendMessageError,
|
||||
ApiSendMessageResponse,
|
||||
ApiSendMessageV1,
|
||||
ApiSendMessageV2,
|
||||
ApiTypingIndicatorRequest,
|
||||
} from "../models/index.js";
|
||||
import {
|
||||
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;
|
||||
}
|
||||
|
||||
export interface V1SendPostRequest {
|
||||
data: ApiSendMessageV1;
|
||||
}
|
||||
|
||||
export interface V1TypingIndicatorNumberDeleteRequest {
|
||||
number: string;
|
||||
data: ApiTypingIndicatorRequest;
|
||||
}
|
||||
|
||||
export interface V1TypingIndicatorNumberPutRequest {
|
||||
number: string;
|
||||
data: ApiTypingIndicatorRequest;
|
||||
}
|
||||
|
||||
export interface V2SendPostRequest {
|
||||
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 v1ReceiveNumberGet(
|
||||
requestParameters: V1ReceiveNumberGetRequest,
|
||||
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
||||
): Promise<Array<string>> {
|
||||
const response = await this.v1ReceiveNumberGetRaw(
|
||||
requestParameters,
|
||||
initOverrides,
|
||||
);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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().',
|
||||
);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,96 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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.js";
|
||||
import type { ApiError, ApiUpdateProfileRequest } from "../models/index.js";
|
||||
import {
|
||||
ApiErrorFromJSON,
|
||||
ApiErrorToJSON,
|
||||
ApiUpdateProfileRequestFromJSON,
|
||||
ApiUpdateProfileRequestToJSON,
|
||||
} from "../models/index.js";
|
||||
|
||||
export interface V1ProfilesNumberPutRequest {
|
||||
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 v1ProfilesNumberPut(
|
||||
requestParameters: V1ProfilesNumberPutRequest,
|
||||
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
||||
): Promise<string> {
|
||||
const response = await this.v1ProfilesNumberPutRaw(
|
||||
requestParameters,
|
||||
initOverrides,
|
||||
);
|
||||
return await response.value();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,143 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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.js";
|
||||
import type { ApiError, ApiReaction } from "../models/index.js";
|
||||
import {
|
||||
ApiErrorFromJSON,
|
||||
ApiErrorToJSON,
|
||||
ApiReactionFromJSON,
|
||||
ApiReactionToJSON,
|
||||
} from "../models/index.js";
|
||||
|
||||
export interface V1ReactionsNumberDeleteRequest {
|
||||
data: ApiReaction;
|
||||
}
|
||||
|
||||
export interface V1ReactionsNumberPostRequest {
|
||||
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 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().',
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
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,
|
||||
);
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,85 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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.js";
|
||||
import type { ApiError, ApiReceipt } from "../models/index.js";
|
||||
import {
|
||||
ApiErrorFromJSON,
|
||||
ApiErrorToJSON,
|
||||
ApiReceiptFromJSON,
|
||||
ApiReceiptToJSON,
|
||||
} from "../models/index.js";
|
||||
|
||||
export interface V1ReceiptsNumberPostRequest {
|
||||
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 v1ReceiptsNumberPost(
|
||||
requestParameters: V1ReceiptsNumberPostRequest,
|
||||
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
||||
): Promise<string> {
|
||||
const response = await this.v1ReceiptsNumberPostRaw(
|
||||
requestParameters,
|
||||
initOverrides,
|
||||
);
|
||||
return await response.value();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,95 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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.js";
|
||||
import type { ApiError, ApiSearchResponse } from "../models/index.js";
|
||||
import {
|
||||
ApiErrorFromJSON,
|
||||
ApiErrorToJSON,
|
||||
ApiSearchResponseFromJSON,
|
||||
ApiSearchResponseToJSON,
|
||||
} from "../models/index.js";
|
||||
|
||||
export interface V1SearchGetRequest {
|
||||
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 v1SearchGet(
|
||||
requestParameters: V1SearchGetRequest,
|
||||
initOverrides?: RequestInit | runtime.InitOverrideFunction,
|
||||
): Promise<Array<ApiSearchResponse>> {
|
||||
const response = await this.v1SearchGetRaw(
|
||||
requestParameters,
|
||||
initOverrides,
|
||||
);
|
||||
return await response.value();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,161 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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.js";
|
||||
import type {
|
||||
ApiAddStickerPackRequest,
|
||||
ApiError,
|
||||
ClientListInstalledStickerPacksResponse,
|
||||
} from "../models/index.js";
|
||||
import {
|
||||
ApiAddStickerPackRequestFromJSON,
|
||||
ApiAddStickerPackRequestToJSON,
|
||||
ApiErrorFromJSON,
|
||||
ApiErrorToJSON,
|
||||
ClientListInstalledStickerPacksResponseFromJSON,
|
||||
ClientListInstalledStickerPacksResponseToJSON,
|
||||
} from "../models/index.js";
|
||||
|
||||
export interface V1StickerPacksNumberGetRequest {
|
||||
number: string;
|
||||
}
|
||||
|
||||
export interface V1StickerPacksNumberPostRequest {
|
||||
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 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().',
|
||||
);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
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";
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export * from "./runtime.js";
|
||||
export * from "./apis/index.js";
|
||||
export * from "./models/index.js";
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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 { mapValues } from "../runtime.js";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiAddDeviceRequest
|
||||
*/
|
||||
export interface ApiAddDeviceRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiAddDeviceRequest
|
||||
*/
|
||||
uri?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ApiAddDeviceRequest interface.
|
||||
*/
|
||||
export function instanceOfApiAddDeviceRequest(
|
||||
value: object,
|
||||
): value is ApiAddDeviceRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ApiAddDeviceRequestFromJSON(json: any): ApiAddDeviceRequest {
|
||||
return ApiAddDeviceRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ApiAddDeviceRequestFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ApiAddDeviceRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
uri: json["uri"] == null ? undefined : json["uri"],
|
||||
};
|
||||
}
|
||||
|
||||
export function ApiAddDeviceRequestToJSON(
|
||||
value?: ApiAddDeviceRequest | null,
|
||||
): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
uri: value["uri"],
|
||||
};
|
||||
}
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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 { mapValues } from "../runtime.js";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiAddStickerPackRequest
|
||||
*/
|
||||
export interface ApiAddStickerPackRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiAddStickerPackRequest
|
||||
*/
|
||||
packId?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiAddStickerPackRequest
|
||||
*/
|
||||
packKey?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ApiAddStickerPackRequest interface.
|
||||
*/
|
||||
export function instanceOfApiAddStickerPackRequest(
|
||||
value: object,
|
||||
): value is ApiAddStickerPackRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ApiAddStickerPackRequestFromJSON(
|
||||
json: any,
|
||||
): ApiAddStickerPackRequest {
|
||||
return ApiAddStickerPackRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ApiAddStickerPackRequestFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ApiAddStickerPackRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
packId: json["pack_id"] == null ? undefined : json["pack_id"],
|
||||
packKey: json["pack_key"] == null ? undefined : json["pack_key"],
|
||||
};
|
||||
}
|
||||
|
||||
export function ApiAddStickerPackRequestToJSON(
|
||||
value?: ApiAddStickerPackRequest | null,
|
||||
): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
pack_id: value["packId"],
|
||||
pack_key: value["packKey"],
|
||||
};
|
||||
}
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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 { mapValues } from "../runtime.js";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiChangeGroupAdminsRequest
|
||||
*/
|
||||
export interface ApiChangeGroupAdminsRequest {
|
||||
/**
|
||||
*
|
||||
* @type {Array<string>}
|
||||
* @memberof ApiChangeGroupAdminsRequest
|
||||
*/
|
||||
admins?: Array<string>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ApiChangeGroupAdminsRequest interface.
|
||||
*/
|
||||
export function instanceOfApiChangeGroupAdminsRequest(
|
||||
value: object,
|
||||
): value is ApiChangeGroupAdminsRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ApiChangeGroupAdminsRequestFromJSON(
|
||||
json: any,
|
||||
): ApiChangeGroupAdminsRequest {
|
||||
return ApiChangeGroupAdminsRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ApiChangeGroupAdminsRequestFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ApiChangeGroupAdminsRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
admins: json["admins"] == null ? undefined : json["admins"],
|
||||
};
|
||||
}
|
||||
|
||||
export function ApiChangeGroupAdminsRequestToJSON(
|
||||
value?: ApiChangeGroupAdminsRequest | null,
|
||||
): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
admins: value["admins"],
|
||||
};
|
||||
}
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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 { mapValues } from "../runtime.js";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiChangeGroupMembersRequest
|
||||
*/
|
||||
export interface ApiChangeGroupMembersRequest {
|
||||
/**
|
||||
*
|
||||
* @type {Array<string>}
|
||||
* @memberof ApiChangeGroupMembersRequest
|
||||
*/
|
||||
members?: Array<string>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ApiChangeGroupMembersRequest interface.
|
||||
*/
|
||||
export function instanceOfApiChangeGroupMembersRequest(
|
||||
value: object,
|
||||
): value is ApiChangeGroupMembersRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ApiChangeGroupMembersRequestFromJSON(
|
||||
json: any,
|
||||
): ApiChangeGroupMembersRequest {
|
||||
return ApiChangeGroupMembersRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ApiChangeGroupMembersRequestFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ApiChangeGroupMembersRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
members: json["members"] == null ? undefined : json["members"],
|
||||
};
|
||||
}
|
||||
|
||||
export function ApiChangeGroupMembersRequestToJSON(
|
||||
value?: ApiChangeGroupMembersRequest | null,
|
||||
): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
members: value["members"],
|
||||
};
|
||||
}
|
||||
|
|
@ -1,72 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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 { mapValues } from "../runtime.js";
|
||||
import type { ApiLoggingConfiguration } from "./ApiLoggingConfiguration.js";
|
||||
import {
|
||||
ApiLoggingConfigurationFromJSON,
|
||||
ApiLoggingConfigurationFromJSONTyped,
|
||||
ApiLoggingConfigurationToJSON,
|
||||
} from "./ApiLoggingConfiguration.js";
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiConfiguration
|
||||
*/
|
||||
export interface ApiConfiguration {
|
||||
/**
|
||||
*
|
||||
* @type {ApiLoggingConfiguration}
|
||||
* @memberof ApiConfiguration
|
||||
*/
|
||||
logging?: ApiLoggingConfiguration;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ApiConfiguration interface.
|
||||
*/
|
||||
export function instanceOfApiConfiguration(
|
||||
value: object,
|
||||
): value is ApiConfiguration {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ApiConfigurationFromJSON(json: any): ApiConfiguration {
|
||||
return ApiConfigurationFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ApiConfigurationFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ApiConfiguration {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
logging:
|
||||
json["logging"] == null
|
||||
? undefined
|
||||
: ApiLoggingConfigurationFromJSON(json["logging"]),
|
||||
};
|
||||
}
|
||||
|
||||
export function ApiConfigurationToJSON(value?: ApiConfiguration | null): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
logging: ApiLoggingConfigurationToJSON(value["logging"]),
|
||||
};
|
||||
}
|
||||
|
|
@ -1,119 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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 { mapValues } from "../runtime.js";
|
||||
import type { ApiGroupPermissions } from "./ApiGroupPermissions.js";
|
||||
import {
|
||||
ApiGroupPermissionsFromJSON,
|
||||
ApiGroupPermissionsFromJSONTyped,
|
||||
ApiGroupPermissionsToJSON,
|
||||
} from "./ApiGroupPermissions.js";
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiCreateGroupRequest
|
||||
*/
|
||||
export interface ApiCreateGroupRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiCreateGroupRequest
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiCreateGroupRequest
|
||||
*/
|
||||
groupLink?: ApiCreateGroupRequestGroupLinkEnum;
|
||||
/**
|
||||
*
|
||||
* @type {Array<string>}
|
||||
* @memberof ApiCreateGroupRequest
|
||||
*/
|
||||
members?: Array<string>;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiCreateGroupRequest
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
*
|
||||
* @type {ApiGroupPermissions}
|
||||
* @memberof ApiCreateGroupRequest
|
||||
*/
|
||||
permissions?: ApiGroupPermissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @export
|
||||
*/
|
||||
export const ApiCreateGroupRequestGroupLinkEnum = {
|
||||
Disabled: "disabled",
|
||||
Enabled: "enabled",
|
||||
EnabledWithApproval: "enabled-with-approval",
|
||||
} as const;
|
||||
export type ApiCreateGroupRequestGroupLinkEnum =
|
||||
(typeof ApiCreateGroupRequestGroupLinkEnum)[keyof typeof ApiCreateGroupRequestGroupLinkEnum];
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ApiCreateGroupRequest interface.
|
||||
*/
|
||||
export function instanceOfApiCreateGroupRequest(
|
||||
value: object,
|
||||
): value is ApiCreateGroupRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ApiCreateGroupRequestFromJSON(
|
||||
json: any,
|
||||
): ApiCreateGroupRequest {
|
||||
return ApiCreateGroupRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ApiCreateGroupRequestFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ApiCreateGroupRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
description: json["description"] == null ? undefined : json["description"],
|
||||
groupLink: json["group_link"] == null ? undefined : json["group_link"],
|
||||
members: json["members"] == null ? undefined : json["members"],
|
||||
name: json["name"] == null ? undefined : json["name"],
|
||||
permissions:
|
||||
json["permissions"] == null
|
||||
? undefined
|
||||
: ApiGroupPermissionsFromJSON(json["permissions"]),
|
||||
};
|
||||
}
|
||||
|
||||
export function ApiCreateGroupRequestToJSON(
|
||||
value?: ApiCreateGroupRequest | null,
|
||||
): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
description: value["description"],
|
||||
group_link: value["groupLink"],
|
||||
members: value["members"],
|
||||
name: value["name"],
|
||||
permissions: ApiGroupPermissionsToJSON(value["permissions"]),
|
||||
};
|
||||
}
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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 { mapValues } from "../runtime.js";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiCreateGroupResponse
|
||||
*/
|
||||
export interface ApiCreateGroupResponse {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiCreateGroupResponse
|
||||
*/
|
||||
id?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ApiCreateGroupResponse interface.
|
||||
*/
|
||||
export function instanceOfApiCreateGroupResponse(
|
||||
value: object,
|
||||
): value is ApiCreateGroupResponse {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ApiCreateGroupResponseFromJSON(
|
||||
json: any,
|
||||
): ApiCreateGroupResponse {
|
||||
return ApiCreateGroupResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ApiCreateGroupResponseFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ApiCreateGroupResponse {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
id: json["id"] == null ? undefined : json["id"],
|
||||
};
|
||||
}
|
||||
|
||||
export function ApiCreateGroupResponseToJSON(
|
||||
value?: ApiCreateGroupResponse | null,
|
||||
): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
id: value["id"],
|
||||
};
|
||||
}
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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 { mapValues } from "../runtime.js";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiError
|
||||
*/
|
||||
export interface ApiError {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiError
|
||||
*/
|
||||
error?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ApiError interface.
|
||||
*/
|
||||
export function instanceOfApiError(value: object): value is ApiError {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ApiErrorFromJSON(json: any): ApiError {
|
||||
return ApiErrorFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ApiErrorFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ApiError {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
error: json["error"] == null ? undefined : json["error"],
|
||||
};
|
||||
}
|
||||
|
||||
export function ApiErrorToJSON(value?: ApiError | null): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
error: value["error"],
|
||||
};
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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 { mapValues } from "../runtime.js";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiGroupPermissions
|
||||
*/
|
||||
export interface ApiGroupPermissions {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiGroupPermissions
|
||||
*/
|
||||
addMembers?: ApiGroupPermissionsAddMembersEnum;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiGroupPermissions
|
||||
*/
|
||||
editGroup?: ApiGroupPermissionsEditGroupEnum;
|
||||
}
|
||||
|
||||
/**
|
||||
* @export
|
||||
*/
|
||||
export const ApiGroupPermissionsAddMembersEnum = {
|
||||
OnlyAdmins: "only-admins",
|
||||
EveryMember: "every-member",
|
||||
} as const;
|
||||
export type ApiGroupPermissionsAddMembersEnum =
|
||||
(typeof ApiGroupPermissionsAddMembersEnum)[keyof typeof ApiGroupPermissionsAddMembersEnum];
|
||||
|
||||
/**
|
||||
* @export
|
||||
*/
|
||||
export const ApiGroupPermissionsEditGroupEnum = {
|
||||
OnlyAdmins: "only-admins",
|
||||
EveryMember: "every-member",
|
||||
} as const;
|
||||
export type ApiGroupPermissionsEditGroupEnum =
|
||||
(typeof ApiGroupPermissionsEditGroupEnum)[keyof typeof ApiGroupPermissionsEditGroupEnum];
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ApiGroupPermissions interface.
|
||||
*/
|
||||
export function instanceOfApiGroupPermissions(
|
||||
value: object,
|
||||
): value is ApiGroupPermissions {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ApiGroupPermissionsFromJSON(json: any): ApiGroupPermissions {
|
||||
return ApiGroupPermissionsFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ApiGroupPermissionsFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ApiGroupPermissions {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
addMembers: json["add_members"] == null ? undefined : json["add_members"],
|
||||
editGroup: json["edit_group"] == null ? undefined : json["edit_group"],
|
||||
};
|
||||
}
|
||||
|
||||
export function ApiGroupPermissionsToJSON(
|
||||
value?: ApiGroupPermissions | null,
|
||||
): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
add_members: value["addMembers"],
|
||||
edit_group: value["editGroup"],
|
||||
};
|
||||
}
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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 { mapValues } from "../runtime.js";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiLoggingConfiguration
|
||||
*/
|
||||
export interface ApiLoggingConfiguration {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiLoggingConfiguration
|
||||
*/
|
||||
level?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ApiLoggingConfiguration interface.
|
||||
*/
|
||||
export function instanceOfApiLoggingConfiguration(
|
||||
value: object,
|
||||
): value is ApiLoggingConfiguration {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ApiLoggingConfigurationFromJSON(
|
||||
json: any,
|
||||
): ApiLoggingConfiguration {
|
||||
return ApiLoggingConfigurationFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ApiLoggingConfigurationFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ApiLoggingConfiguration {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
level: json["Level"] == null ? undefined : json["Level"],
|
||||
};
|
||||
}
|
||||
|
||||
export function ApiLoggingConfigurationToJSON(
|
||||
value?: ApiLoggingConfiguration | null,
|
||||
): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
Level: value["level"],
|
||||
};
|
||||
}
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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 { mapValues } from "../runtime.js";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiRateLimitChallengeRequest
|
||||
*/
|
||||
export interface ApiRateLimitChallengeRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiRateLimitChallengeRequest
|
||||
*/
|
||||
captcha?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiRateLimitChallengeRequest
|
||||
*/
|
||||
challengeToken?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ApiRateLimitChallengeRequest interface.
|
||||
*/
|
||||
export function instanceOfApiRateLimitChallengeRequest(
|
||||
value: object,
|
||||
): value is ApiRateLimitChallengeRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ApiRateLimitChallengeRequestFromJSON(
|
||||
json: any,
|
||||
): ApiRateLimitChallengeRequest {
|
||||
return ApiRateLimitChallengeRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ApiRateLimitChallengeRequestFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ApiRateLimitChallengeRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
captcha: json["captcha"] == null ? undefined : json["captcha"],
|
||||
challengeToken:
|
||||
json["challenge_token"] == null ? undefined : json["challenge_token"],
|
||||
};
|
||||
}
|
||||
|
||||
export function ApiRateLimitChallengeRequestToJSON(
|
||||
value?: ApiRateLimitChallengeRequest | null,
|
||||
): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
captcha: value["captcha"],
|
||||
challenge_token: value["challengeToken"],
|
||||
};
|
||||
}
|
||||
|
|
@ -1,85 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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 { mapValues } from "../runtime.js";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiReaction
|
||||
*/
|
||||
export interface ApiReaction {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiReaction
|
||||
*/
|
||||
reaction?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiReaction
|
||||
*/
|
||||
recipient?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiReaction
|
||||
*/
|
||||
targetAuthor?: string;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof ApiReaction
|
||||
*/
|
||||
timestamp?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ApiReaction interface.
|
||||
*/
|
||||
export function instanceOfApiReaction(value: object): value is ApiReaction {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ApiReactionFromJSON(json: any): ApiReaction {
|
||||
return ApiReactionFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ApiReactionFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ApiReaction {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
reaction: json["reaction"] == null ? undefined : json["reaction"],
|
||||
recipient: json["recipient"] == null ? undefined : json["recipient"],
|
||||
targetAuthor:
|
||||
json["target_author"] == null ? undefined : json["target_author"],
|
||||
timestamp: json["timestamp"] == null ? undefined : json["timestamp"],
|
||||
};
|
||||
}
|
||||
|
||||
export function ApiReactionToJSON(value?: ApiReaction | null): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
reaction: value["reaction"],
|
||||
recipient: value["recipient"],
|
||||
target_author: value["targetAuthor"],
|
||||
timestamp: value["timestamp"],
|
||||
};
|
||||
}
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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 { mapValues } from "../runtime.js";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiReceipt
|
||||
*/
|
||||
export interface ApiReceipt {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiReceipt
|
||||
*/
|
||||
receiptType?: ApiReceiptReceiptTypeEnum;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiReceipt
|
||||
*/
|
||||
recipient?: string;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof ApiReceipt
|
||||
*/
|
||||
timestamp?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @export
|
||||
*/
|
||||
export const ApiReceiptReceiptTypeEnum = {
|
||||
Read: "read",
|
||||
Viewed: "viewed",
|
||||
} as const;
|
||||
export type ApiReceiptReceiptTypeEnum =
|
||||
(typeof ApiReceiptReceiptTypeEnum)[keyof typeof ApiReceiptReceiptTypeEnum];
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ApiReceipt interface.
|
||||
*/
|
||||
export function instanceOfApiReceipt(value: object): value is ApiReceipt {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ApiReceiptFromJSON(json: any): ApiReceipt {
|
||||
return ApiReceiptFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ApiReceiptFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ApiReceipt {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
receiptType:
|
||||
json["receipt_type"] == null ? undefined : json["receipt_type"],
|
||||
recipient: json["recipient"] == null ? undefined : json["recipient"],
|
||||
timestamp: json["timestamp"] == null ? undefined : json["timestamp"],
|
||||
};
|
||||
}
|
||||
|
||||
export function ApiReceiptToJSON(value?: ApiReceipt | null): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
receipt_type: value["receiptType"],
|
||||
recipient: value["recipient"],
|
||||
timestamp: value["timestamp"],
|
||||
};
|
||||
}
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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 { mapValues } from "../runtime.js";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiRegisterNumberRequest
|
||||
*/
|
||||
export interface ApiRegisterNumberRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiRegisterNumberRequest
|
||||
*/
|
||||
captcha?: string;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof ApiRegisterNumberRequest
|
||||
*/
|
||||
useVoice?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ApiRegisterNumberRequest interface.
|
||||
*/
|
||||
export function instanceOfApiRegisterNumberRequest(
|
||||
value: object,
|
||||
): value is ApiRegisterNumberRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ApiRegisterNumberRequestFromJSON(
|
||||
json: any,
|
||||
): ApiRegisterNumberRequest {
|
||||
return ApiRegisterNumberRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ApiRegisterNumberRequestFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ApiRegisterNumberRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
captcha: json["captcha"] == null ? undefined : json["captcha"],
|
||||
useVoice: json["use_voice"] == null ? undefined : json["use_voice"],
|
||||
};
|
||||
}
|
||||
|
||||
export function ApiRegisterNumberRequestToJSON(
|
||||
value?: ApiRegisterNumberRequest | null,
|
||||
): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
captcha: value["captcha"],
|
||||
use_voice: value["useVoice"],
|
||||
};
|
||||
}
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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 { mapValues } from "../runtime.js";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiSearchResponse
|
||||
*/
|
||||
export interface ApiSearchResponse {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiSearchResponse
|
||||
*/
|
||||
number?: string;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof ApiSearchResponse
|
||||
*/
|
||||
registered?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ApiSearchResponse interface.
|
||||
*/
|
||||
export function instanceOfApiSearchResponse(
|
||||
value: object,
|
||||
): value is ApiSearchResponse {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ApiSearchResponseFromJSON(json: any): ApiSearchResponse {
|
||||
return ApiSearchResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ApiSearchResponseFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ApiSearchResponse {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
number: json["number"] == null ? undefined : json["number"],
|
||||
registered: json["registered"] == null ? undefined : json["registered"],
|
||||
};
|
||||
}
|
||||
|
||||
export function ApiSearchResponseToJSON(value?: ApiSearchResponse | null): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
number: value["number"],
|
||||
registered: value["registered"],
|
||||
};
|
||||
}
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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 { mapValues } from "../runtime.js";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiSendMessageError
|
||||
*/
|
||||
export interface ApiSendMessageError {
|
||||
/**
|
||||
*
|
||||
* @type {Array<string>}
|
||||
* @memberof ApiSendMessageError
|
||||
*/
|
||||
challengeTokens?: Array<string>;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiSendMessageError
|
||||
*/
|
||||
error?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ApiSendMessageError interface.
|
||||
*/
|
||||
export function instanceOfApiSendMessageError(
|
||||
value: object,
|
||||
): value is ApiSendMessageError {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ApiSendMessageErrorFromJSON(json: any): ApiSendMessageError {
|
||||
return ApiSendMessageErrorFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ApiSendMessageErrorFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ApiSendMessageError {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
challengeTokens:
|
||||
json["challenge_tokens"] == null ? undefined : json["challenge_tokens"],
|
||||
error: json["error"] == null ? undefined : json["error"],
|
||||
};
|
||||
}
|
||||
|
||||
export function ApiSendMessageErrorToJSON(
|
||||
value?: ApiSendMessageError | null,
|
||||
): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
challenge_tokens: value["challengeTokens"],
|
||||
error: value["error"],
|
||||
};
|
||||
}
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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 { mapValues } from "../runtime.js";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiSendMessageResponse
|
||||
*/
|
||||
export interface ApiSendMessageResponse {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiSendMessageResponse
|
||||
*/
|
||||
timestamp?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ApiSendMessageResponse interface.
|
||||
*/
|
||||
export function instanceOfApiSendMessageResponse(
|
||||
value: object,
|
||||
): value is ApiSendMessageResponse {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ApiSendMessageResponseFromJSON(
|
||||
json: any,
|
||||
): ApiSendMessageResponse {
|
||||
return ApiSendMessageResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ApiSendMessageResponseFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ApiSendMessageResponse {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
timestamp: json["timestamp"] == null ? undefined : json["timestamp"],
|
||||
};
|
||||
}
|
||||
|
||||
export function ApiSendMessageResponseToJSON(
|
||||
value?: ApiSendMessageResponse | null,
|
||||
): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
timestamp: value["timestamp"],
|
||||
};
|
||||
}
|
||||
|
|
@ -1,95 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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 { mapValues } from "../runtime.js";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiSendMessageV1
|
||||
*/
|
||||
export interface ApiSendMessageV1 {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiSendMessageV1
|
||||
*/
|
||||
base64Attachment?: string;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof ApiSendMessageV1
|
||||
*/
|
||||
isGroup?: boolean;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiSendMessageV1
|
||||
*/
|
||||
message?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiSendMessageV1
|
||||
*/
|
||||
number?: string;
|
||||
/**
|
||||
*
|
||||
* @type {Array<string>}
|
||||
* @memberof ApiSendMessageV1
|
||||
*/
|
||||
recipients?: Array<string>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ApiSendMessageV1 interface.
|
||||
*/
|
||||
export function instanceOfApiSendMessageV1(
|
||||
value: object,
|
||||
): value is ApiSendMessageV1 {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ApiSendMessageV1FromJSON(json: any): ApiSendMessageV1 {
|
||||
return ApiSendMessageV1FromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ApiSendMessageV1FromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ApiSendMessageV1 {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
base64Attachment:
|
||||
json["base64_attachment"] == null ? undefined : json["base64_attachment"],
|
||||
isGroup: json["is_group"] == null ? undefined : json["is_group"],
|
||||
message: json["message"] == null ? undefined : json["message"],
|
||||
number: json["number"] == null ? undefined : json["number"],
|
||||
recipients: json["recipients"] == null ? undefined : json["recipients"],
|
||||
};
|
||||
}
|
||||
|
||||
export function ApiSendMessageV1ToJSON(value?: ApiSendMessageV1 | null): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
base64_attachment: value["base64Attachment"],
|
||||
is_group: value["isGroup"],
|
||||
message: value["message"],
|
||||
number: value["number"],
|
||||
recipients: value["recipients"],
|
||||
};
|
||||
}
|
||||
|
|
@ -1,168 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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 { mapValues } from "../runtime.js";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiSendMessageV2
|
||||
*/
|
||||
export interface ApiSendMessageV2 {
|
||||
/**
|
||||
*
|
||||
* @type {Array<string>}
|
||||
* @memberof ApiSendMessageV2
|
||||
*/
|
||||
base64Attachments?: Array<string>;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof ApiSendMessageV2
|
||||
*/
|
||||
editTimestamp?: number;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiSendMessageV2
|
||||
*/
|
||||
mentions?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiSendMessageV2
|
||||
*/
|
||||
message?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiSendMessageV2
|
||||
*/
|
||||
number?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiSendMessageV2
|
||||
*/
|
||||
quoteAuthor?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiSendMessageV2
|
||||
*/
|
||||
quoteMentions?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiSendMessageV2
|
||||
*/
|
||||
quoteMessage?: string;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof ApiSendMessageV2
|
||||
*/
|
||||
quoteTimestamp?: number;
|
||||
/**
|
||||
*
|
||||
* @type {Array<string>}
|
||||
* @memberof ApiSendMessageV2
|
||||
*/
|
||||
recipients?: Array<string>;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiSendMessageV2
|
||||
*/
|
||||
sticker?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiSendMessageV2
|
||||
*/
|
||||
textMode?: ApiSendMessageV2TextModeEnum;
|
||||
}
|
||||
|
||||
/**
|
||||
* @export
|
||||
*/
|
||||
export const ApiSendMessageV2TextModeEnum = {
|
||||
Normal: "normal",
|
||||
Styled: "styled",
|
||||
} as const;
|
||||
export type ApiSendMessageV2TextModeEnum =
|
||||
(typeof ApiSendMessageV2TextModeEnum)[keyof typeof ApiSendMessageV2TextModeEnum];
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ApiSendMessageV2 interface.
|
||||
*/
|
||||
export function instanceOfApiSendMessageV2(
|
||||
value: object,
|
||||
): value is ApiSendMessageV2 {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ApiSendMessageV2FromJSON(json: any): ApiSendMessageV2 {
|
||||
return ApiSendMessageV2FromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ApiSendMessageV2FromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ApiSendMessageV2 {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
base64Attachments:
|
||||
json["base64_attachments"] == null
|
||||
? undefined
|
||||
: json["base64_attachments"],
|
||||
editTimestamp:
|
||||
json["edit_timestamp"] == null ? undefined : json["edit_timestamp"],
|
||||
mentions: json["mentions"] == null ? undefined : json["mentions"],
|
||||
message: json["message"] == null ? undefined : json["message"],
|
||||
number: json["number"] == null ? undefined : json["number"],
|
||||
quoteAuthor:
|
||||
json["quote_author"] == null ? undefined : json["quote_author"],
|
||||
quoteMentions:
|
||||
json["quote_mentions"] == null ? undefined : json["quote_mentions"],
|
||||
quoteMessage:
|
||||
json["quote_message"] == null ? undefined : json["quote_message"],
|
||||
quoteTimestamp:
|
||||
json["quote_timestamp"] == null ? undefined : json["quote_timestamp"],
|
||||
recipients: json["recipients"] == null ? undefined : json["recipients"],
|
||||
sticker: json["sticker"] == null ? undefined : json["sticker"],
|
||||
textMode: json["text_mode"] == null ? undefined : json["text_mode"],
|
||||
};
|
||||
}
|
||||
|
||||
export function ApiSendMessageV2ToJSON(value?: ApiSendMessageV2 | null): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
base64_attachments: value["base64Attachments"],
|
||||
edit_timestamp: value["editTimestamp"],
|
||||
mentions: value["mentions"],
|
||||
message: value["message"],
|
||||
number: value["number"],
|
||||
quote_author: value["quoteAuthor"],
|
||||
quote_mentions: value["quoteMentions"],
|
||||
quote_message: value["quoteMessage"],
|
||||
quote_timestamp: value["quoteTimestamp"],
|
||||
recipients: value["recipients"],
|
||||
sticker: value["sticker"],
|
||||
text_mode: value["textMode"],
|
||||
};
|
||||
}
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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 { mapValues } from "../runtime.js";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiSetUsernameRequest
|
||||
*/
|
||||
export interface ApiSetUsernameRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiSetUsernameRequest
|
||||
*/
|
||||
username?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ApiSetUsernameRequest interface.
|
||||
*/
|
||||
export function instanceOfApiSetUsernameRequest(
|
||||
value: object,
|
||||
): value is ApiSetUsernameRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ApiSetUsernameRequestFromJSON(
|
||||
json: any,
|
||||
): ApiSetUsernameRequest {
|
||||
return ApiSetUsernameRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ApiSetUsernameRequestFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ApiSetUsernameRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
username: json["username"] == null ? undefined : json["username"],
|
||||
};
|
||||
}
|
||||
|
||||
export function ApiSetUsernameRequestToJSON(
|
||||
value?: ApiSetUsernameRequest | null,
|
||||
): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
username: value["username"],
|
||||
};
|
||||
}
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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 { mapValues } from "../runtime.js";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiTrustIdentityRequest
|
||||
*/
|
||||
export interface ApiTrustIdentityRequest {
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof ApiTrustIdentityRequest
|
||||
*/
|
||||
trustAllKnownKeys?: boolean;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiTrustIdentityRequest
|
||||
*/
|
||||
verifiedSafetyNumber?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ApiTrustIdentityRequest interface.
|
||||
*/
|
||||
export function instanceOfApiTrustIdentityRequest(
|
||||
value: object,
|
||||
): value is ApiTrustIdentityRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ApiTrustIdentityRequestFromJSON(
|
||||
json: any,
|
||||
): ApiTrustIdentityRequest {
|
||||
return ApiTrustIdentityRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ApiTrustIdentityRequestFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ApiTrustIdentityRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
trustAllKnownKeys:
|
||||
json["trust_all_known_keys"] == null
|
||||
? undefined
|
||||
: json["trust_all_known_keys"],
|
||||
verifiedSafetyNumber:
|
||||
json["verified_safety_number"] == null
|
||||
? undefined
|
||||
: json["verified_safety_number"],
|
||||
};
|
||||
}
|
||||
|
||||
export function ApiTrustIdentityRequestToJSON(
|
||||
value?: ApiTrustIdentityRequest | null,
|
||||
): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
trust_all_known_keys: value["trustAllKnownKeys"],
|
||||
verified_safety_number: value["verifiedSafetyNumber"],
|
||||
};
|
||||
}
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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 { mapValues } from "../runtime.js";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiTrustModeRequest
|
||||
*/
|
||||
export interface ApiTrustModeRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiTrustModeRequest
|
||||
*/
|
||||
trustMode?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ApiTrustModeRequest interface.
|
||||
*/
|
||||
export function instanceOfApiTrustModeRequest(
|
||||
value: object,
|
||||
): value is ApiTrustModeRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ApiTrustModeRequestFromJSON(json: any): ApiTrustModeRequest {
|
||||
return ApiTrustModeRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ApiTrustModeRequestFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ApiTrustModeRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
trustMode: json["trust_mode"] == null ? undefined : json["trust_mode"],
|
||||
};
|
||||
}
|
||||
|
||||
export function ApiTrustModeRequestToJSON(
|
||||
value?: ApiTrustModeRequest | null,
|
||||
): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
trust_mode: value["trustMode"],
|
||||
};
|
||||
}
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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 { mapValues } from "../runtime.js";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiTrustModeResponse
|
||||
*/
|
||||
export interface ApiTrustModeResponse {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiTrustModeResponse
|
||||
*/
|
||||
trustMode?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ApiTrustModeResponse interface.
|
||||
*/
|
||||
export function instanceOfApiTrustModeResponse(
|
||||
value: object,
|
||||
): value is ApiTrustModeResponse {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ApiTrustModeResponseFromJSON(json: any): ApiTrustModeResponse {
|
||||
return ApiTrustModeResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ApiTrustModeResponseFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ApiTrustModeResponse {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
trustMode: json["trust_mode"] == null ? undefined : json["trust_mode"],
|
||||
};
|
||||
}
|
||||
|
||||
export function ApiTrustModeResponseToJSON(
|
||||
value?: ApiTrustModeResponse | null,
|
||||
): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
trust_mode: value["trustMode"],
|
||||
};
|
||||
}
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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 { mapValues } from "../runtime.js";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiTypingIndicatorRequest
|
||||
*/
|
||||
export interface ApiTypingIndicatorRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiTypingIndicatorRequest
|
||||
*/
|
||||
recipient?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ApiTypingIndicatorRequest interface.
|
||||
*/
|
||||
export function instanceOfApiTypingIndicatorRequest(
|
||||
value: object,
|
||||
): value is ApiTypingIndicatorRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ApiTypingIndicatorRequestFromJSON(
|
||||
json: any,
|
||||
): ApiTypingIndicatorRequest {
|
||||
return ApiTypingIndicatorRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ApiTypingIndicatorRequestFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ApiTypingIndicatorRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
recipient: json["recipient"] == null ? undefined : json["recipient"],
|
||||
};
|
||||
}
|
||||
|
||||
export function ApiTypingIndicatorRequestToJSON(
|
||||
value?: ApiTypingIndicatorRequest | null,
|
||||
): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
recipient: value["recipient"],
|
||||
};
|
||||
}
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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 { mapValues } from "../runtime.js";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiUnregisterNumberRequest
|
||||
*/
|
||||
export interface ApiUnregisterNumberRequest {
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof ApiUnregisterNumberRequest
|
||||
*/
|
||||
deleteAccount?: boolean;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof ApiUnregisterNumberRequest
|
||||
*/
|
||||
deleteLocalData?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ApiUnregisterNumberRequest interface.
|
||||
*/
|
||||
export function instanceOfApiUnregisterNumberRequest(
|
||||
value: object,
|
||||
): value is ApiUnregisterNumberRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ApiUnregisterNumberRequestFromJSON(
|
||||
json: any,
|
||||
): ApiUnregisterNumberRequest {
|
||||
return ApiUnregisterNumberRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ApiUnregisterNumberRequestFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ApiUnregisterNumberRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
deleteAccount:
|
||||
json["delete_account"] == null ? undefined : json["delete_account"],
|
||||
deleteLocalData:
|
||||
json["delete_local_data"] == null ? undefined : json["delete_local_data"],
|
||||
};
|
||||
}
|
||||
|
||||
export function ApiUnregisterNumberRequestToJSON(
|
||||
value?: ApiUnregisterNumberRequest | null,
|
||||
): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
delete_account: value["deleteAccount"],
|
||||
delete_local_data: value["deleteLocalData"],
|
||||
};
|
||||
}
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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 { mapValues } from "../runtime.js";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiUpdateAccountSettingsRequest
|
||||
*/
|
||||
export interface ApiUpdateAccountSettingsRequest {
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof ApiUpdateAccountSettingsRequest
|
||||
*/
|
||||
discoverableByNumber?: boolean;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof ApiUpdateAccountSettingsRequest
|
||||
*/
|
||||
shareNumber?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ApiUpdateAccountSettingsRequest interface.
|
||||
*/
|
||||
export function instanceOfApiUpdateAccountSettingsRequest(
|
||||
value: object,
|
||||
): value is ApiUpdateAccountSettingsRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ApiUpdateAccountSettingsRequestFromJSON(
|
||||
json: any,
|
||||
): ApiUpdateAccountSettingsRequest {
|
||||
return ApiUpdateAccountSettingsRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ApiUpdateAccountSettingsRequestFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ApiUpdateAccountSettingsRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
discoverableByNumber:
|
||||
json["discoverable_by_number"] == null
|
||||
? undefined
|
||||
: json["discoverable_by_number"],
|
||||
shareNumber:
|
||||
json["share_number"] == null ? undefined : json["share_number"],
|
||||
};
|
||||
}
|
||||
|
||||
export function ApiUpdateAccountSettingsRequestToJSON(
|
||||
value?: ApiUpdateAccountSettingsRequest | null,
|
||||
): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
discoverable_by_number: value["discoverableByNumber"],
|
||||
share_number: value["shareNumber"],
|
||||
};
|
||||
}
|
||||
|
|
@ -1,85 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Signal Cli REST API
|
||||
* 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 { mapValues } from "../runtime.js";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiUpdateContactRequest
|
||||
*/
|
||||
export interface ApiUpdateContactRequest {
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof ApiUpdateContactRequest
|
||||
*/
|
||||
expirationInSeconds?: number;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiUpdateContactRequest
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiUpdateContactRequest
|
||||
*/
|
||||
recipient?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ApiUpdateContactRequest interface.
|
||||
*/
|
||||
export function instanceOfApiUpdateContactRequest(
|
||||
value: object,
|
||||
): value is ApiUpdateContactRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ApiUpdateContactRequestFromJSON(
|
||||
json: any,
|
||||
): ApiUpdateContactRequest {
|
||||
return ApiUpdateContactRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ApiUpdateContactRequestFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ApiUpdateContactRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
expirationInSeconds:
|
||||
json["expiration_in_seconds"] == null
|
||||
? undefined
|
||||
: json["expiration_in_seconds"],
|
||||
name: json["name"] == null ? undefined : json["name"],
|
||||
recipient: json["recipient"] == null ? undefined : json["recipient"],
|
||||
};
|
||||
}
|
||||
|
||||
export function ApiUpdateContactRequestToJSON(
|
||||
value?: ApiUpdateContactRequest | null,
|
||||
): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
expiration_in_seconds: value["expirationInSeconds"],
|
||||
name: value["name"],
|
||||
recipient: value["recipient"],
|
||||
};
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue