Enforce node: schema for builtins, import extensions

This commit is contained in:
Fedor Indutny
2025-09-16 17:39:03 -07:00
committed by GitHub
parent cc6b8795b8
commit c02565eaa8
2096 changed files with 14955 additions and 14023 deletions

View File

@@ -2,31 +2,34 @@
// SPDX-License-Identifier: AGPL-3.0-only
import { CallLinkRootKey } from '@signalapp/ringrtc';
import * as Bytes from '../../Bytes';
import * as Bytes from '../../Bytes.js';
import type {
CallLinkRecord,
CallLinkStateType,
CallLinkType,
DefunctCallLinkType,
} from '../../types/CallLink';
} from '../../types/CallLink.js';
import {
callLinkRestrictionsSchema,
callLinkRecordSchema,
defunctCallLinkRecordSchema,
} from '../../types/CallLink';
import { toAdminKeyBytes } from '../../util/callLinks';
} from '../../types/CallLink.js';
import { toAdminKeyBytes } from '../../util/callLinks.js';
import {
callLinkToRecord,
callLinkFromRecord,
defunctCallLinkToRecord,
defunctCallLinkFromRecord,
toEpochBytes,
} from '../../util/callLinksRingrtc';
import type { ReadableDB, WritableDB } from '../Interface';
import { sql } from '../util';
import { strictAssert } from '../../util/assert';
import { CallStatusValue, DirectCallStatus } from '../../types/CallDisposition';
import { parseStrict, parseUnknown } from '../../util/schemas';
} from '../../util/callLinksRingrtc.js';
import type { ReadableDB, WritableDB } from '../Interface.js';
import { sql } from '../util.js';
import { strictAssert } from '../../util/assert.js';
import {
CallStatusValue,
DirectCallStatus,
} from '../../types/CallDisposition.js';
import { parseStrict, parseUnknown } from '../../util/schemas.js';
export function callLinkExists(db: ReadableDB, roomId: string): boolean {
const [query, params] = sql`

View File

@@ -4,9 +4,9 @@ import {
type ChatFolderId,
type ChatFolder,
CHAT_FOLDER_DELETED_POSITION,
} from '../../types/ChatFolder';
import type { ReadableDB, WritableDB } from '../Interface';
import { sql } from '../util';
} from '../../types/ChatFolder.js';
import type { ReadableDB, WritableDB } from '../Interface.js';
import { sql } from '../util.js';
export type ChatFolderRow = Readonly<
Omit<

View File

@@ -1,10 +1,10 @@
// Copyright 2025 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { sql } from '../util';
import { sql } from '../util.js';
import type { DonationReceipt } from '../../types/Donations';
import type { ReadableDB, WritableDB } from '../Interface';
import type { DonationReceipt } from '../../types/Donations.js';
import type { ReadableDB, WritableDB } from '../Interface.js';
export function getAllDonationReceipts(db: ReadableDB): Array<DonationReceipt> {
const donationReceipts = db

View File

@@ -5,17 +5,17 @@ import type {
GroupSendCombinedEndorsementRecord,
GroupSendEndorsementsData,
GroupSendMemberEndorsementRecord,
} from '../../types/GroupSendEndorsements';
} from '../../types/GroupSendEndorsements.js';
import {
groupSendEndorsementExpirationSchema,
groupSendMemberEndorsementSchema,
groupSendEndorsementsDataSchema,
} from '../../types/GroupSendEndorsements';
import type { ReadableDB, WritableDB } from '../Interface';
import { sql } from '../util';
import type { AciString } from '../../types/ServiceId';
import { strictAssert } from '../../util/assert';
import { parseLoose, parseUnknown } from '../../util/schemas';
} from '../../types/GroupSendEndorsements.js';
import type { ReadableDB, WritableDB } from '../Interface.js';
import { sql } from '../util.js';
import type { AciString } from '../../types/ServiceId.js';
import { strictAssert } from '../../util/assert.js';
import { parseLoose, parseUnknown } from '../../util/schemas.js';
/**
* We don't need to store more than one endorsement per group or per member.

View File

@@ -2,10 +2,10 @@
// SPDX-License-Identifier: AGPL-3.0-only
import { z } from 'zod';
import { convertUndefinedToNull } from '../../util/dropNull';
import { attachmentDownloadTypeSchema } from '../../types/AttachmentDownload';
import { APPLICATION_OCTET_STREAM } from '../../types/MIME';
import type { MessageAttachmentDBType } from '../Interface';
import { convertUndefinedToNull } from '../../util/dropNull.js';
import { attachmentDownloadTypeSchema } from '../../types/AttachmentDownload.js';
import { APPLICATION_OCTET_STREAM } from '../../types/MIME.js';
import type { MessageAttachmentDBType } from '../Interface.js';
const permissiveStringOrNull = z
.string()