Faster incremental builds

This commit is contained in:
Fedor Indutny
2025-10-06 12:23:41 -07:00
committed by GitHub
parent 7ab12f3d7a
commit 780f39c285
130 changed files with 1479 additions and 1450 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -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';

View 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
View 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;
}
}

View File

@@ -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';

View 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
View 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> };

View File

@@ -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 = '';