mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-27 03:43:27 +01:00
Faster incremental builds
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -3,11 +3,8 @@
|
||||
|
||||
import lodash from 'lodash';
|
||||
import type { ReadonlyMessageAttributesType } from '../model-types.js';
|
||||
import {
|
||||
isVoiceMessage,
|
||||
type AttachmentForUIType,
|
||||
isDownloaded,
|
||||
} from './Attachment.js';
|
||||
import type { AttachmentForUIType } from './Attachment.js';
|
||||
import { isVoiceMessage, isDownloaded } from '../util/Attachment.js';
|
||||
import type { HydratedBodyRangesType } from './BodyRange.js';
|
||||
import type { LinkPreviewForUIType } from './message/LinkPreviews.js';
|
||||
|
||||
|
||||
9
ts/types/GiftBadgeStates.ts
Normal file
9
ts/types/GiftBadgeStates.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
// Copyright 2025 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
export enum GiftBadgeStates {
|
||||
Unopened = 'Unopened',
|
||||
Opened = 'Opened',
|
||||
Redeemed = 'Redeemed',
|
||||
Failed = 'Failed',
|
||||
}
|
||||
45
ts/types/HTTPError.ts
Normal file
45
ts/types/HTTPError.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
// Copyright 2025 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { Response } from 'node-fetch';
|
||||
|
||||
import type { HeaderListType } from './WebAPI.d.ts';
|
||||
|
||||
export class HTTPError extends Error {
|
||||
public override readonly name = 'HTTPError';
|
||||
|
||||
public readonly code: number;
|
||||
|
||||
public readonly responseHeaders: HeaderListType;
|
||||
|
||||
public readonly response: unknown;
|
||||
|
||||
static fromResponse(response: Response): HTTPError {
|
||||
return new HTTPError(response.statusText, {
|
||||
code: response.status,
|
||||
headers: Object.fromEntries(response.headers),
|
||||
response,
|
||||
});
|
||||
}
|
||||
|
||||
constructor(
|
||||
message: string,
|
||||
options: {
|
||||
code: number;
|
||||
headers: HeaderListType;
|
||||
response?: unknown;
|
||||
stack?: string;
|
||||
cause?: unknown;
|
||||
}
|
||||
) {
|
||||
super(`${message}; code: ${options.code}`, { cause: options.cause });
|
||||
|
||||
const { code: providedCode, headers, response, stack } = options;
|
||||
|
||||
this.code = providedCode > 999 || providedCode < 100 ? -1 : providedCode;
|
||||
this.responseHeaders = headers;
|
||||
|
||||
this.stack += `\nOriginal stack:\n${stack}`;
|
||||
this.response = response;
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
replaceUnicodeOrderOverrides,
|
||||
replaceUnicodeV2,
|
||||
shouldGenerateThumbnailForAttachmentType,
|
||||
} from './Attachment.js';
|
||||
} from '../util/Attachment.js';
|
||||
import type { MakeVideoScreenshotResultType } from './VisualAttachment.js';
|
||||
import * as Errors from './errors.js';
|
||||
import * as SchemaVersion from './SchemaVersion.js';
|
||||
|
||||
9
ts/types/SafetyNumberChangeSource.ts
Normal file
9
ts/types/SafetyNumberChangeSource.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
// Copyright 2025 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
export enum SafetyNumberChangeSource {
|
||||
InitiateCall = 'InitiateCall',
|
||||
JoinCall = 'JoinCall',
|
||||
MessageSend = 'MessageSend',
|
||||
Story = 'Story',
|
||||
}
|
||||
4
ts/types/WebAPI.d.ts
vendored
Normal file
4
ts/types/WebAPI.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
// Copyright 2025 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
export type HeaderListType = { [name: string]: string | ReadonlyArray<string> };
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2018 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { HTTPError } from '../textsecure/Errors.js';
|
||||
import { HTTPError } from './HTTPError.js';
|
||||
|
||||
export function toLogFormat(error: unknown): string {
|
||||
let result = '';
|
||||
|
||||
Reference in New Issue
Block a user