Enforce node:
schema for builtins, import extensions
This commit is contained in:
parent
cc6b8795b8
commit
c02565eaa8
2096 changed files with 14955 additions and 14023 deletions
|
@ -4,7 +4,7 @@
|
|||
import { assert } from 'chai';
|
||||
import { noop } from 'lodash';
|
||||
|
||||
import { cleanDataForIpc } from '../../sql/cleanDataForIpc';
|
||||
import { cleanDataForIpc } from '../../sql/cleanDataForIpc.js';
|
||||
|
||||
describe('cleanDataForIpc', () => {
|
||||
it('does nothing to JSON primitives', () => {
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { _cleanMessageData } from '../../sql/Client';
|
||||
import { IMAGE_GIF } from '../../types/MIME';
|
||||
import { _cleanMessageData } from '../../sql/Client.js';
|
||||
import { IMAGE_GIF } from '../../types/MIME.js';
|
||||
|
||||
describe('_cleanMessageData', () => {
|
||||
it('throws if message is missing received_at', () => {
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
import { noop } from 'lodash';
|
||||
import SQL from '@signalapp/sqlcipher';
|
||||
|
||||
import type { ReadableDB, WritableDB } from '../../sql/Interface';
|
||||
import type { QueryTemplate } from '../../sql/util';
|
||||
import { SCHEMA_VERSIONS } from '../../sql/migrations';
|
||||
import { consoleLogger } from '../../util/consoleLogger';
|
||||
import type { ReadableDB, WritableDB } from '../../sql/Interface.js';
|
||||
import type { QueryTemplate } from '../../sql/util.js';
|
||||
import { SCHEMA_VERSIONS } from '../../sql/migrations/index.js';
|
||||
import { consoleLogger } from '../../util/consoleLogger.js';
|
||||
|
||||
export function createDB(): WritableDB {
|
||||
const db = new SQL(':memory:') as WritableDB;
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import type { WritableDB } from '../../sql/Interface';
|
||||
import type { WritableDB } from '../../sql/Interface.js';
|
||||
import {
|
||||
incrementMessagesMigrationAttempts,
|
||||
setupTests,
|
||||
} from '../../sql/Server';
|
||||
import { createDB, insertData, getTableData } from './helpers';
|
||||
} from '../../sql/Server.js';
|
||||
import { createDB, insertData, getTableData } from './helpers.js';
|
||||
|
||||
describe('SQL/incrementMessagesMigrationAttempts', () => {
|
||||
let db: WritableDB;
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import type { WritableDB } from '../../sql/Interface';
|
||||
import { migrateConversationMessages, setupTests } from '../../sql/Server';
|
||||
import { createDB, insertData, getTableData } from './helpers';
|
||||
import type { WritableDB } from '../../sql/Interface.js';
|
||||
import { migrateConversationMessages, setupTests } from '../../sql/Server.js';
|
||||
import { createDB, insertData, getTableData } from './helpers.js';
|
||||
|
||||
describe('SQL/migrateConversationMessages', () => {
|
||||
let db: WritableDB;
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
import { assert } from 'chai';
|
||||
import { v4 as generateGuid } from 'uuid';
|
||||
|
||||
import { jsonToObject, sql } from '../../sql/util';
|
||||
import { createDB, updateToVersion } from './helpers';
|
||||
import type { WritableDB, MessageType } from '../../sql/Interface';
|
||||
import { ReadStatus } from '../../messages/MessageReadStatus';
|
||||
import { SeenStatus } from '../../MessageSeenStatus';
|
||||
import { jsonToObject, sql } from '../../sql/util.js';
|
||||
import { createDB, updateToVersion } from './helpers.js';
|
||||
import type { WritableDB, MessageType } from '../../sql/Interface.js';
|
||||
import { ReadStatus } from '../../messages/MessageReadStatus.js';
|
||||
import { SeenStatus } from '../../MessageSeenStatus.js';
|
||||
|
||||
describe('SQL/updateToSchemaVersion1000', () => {
|
||||
let db: WritableDB;
|
||||
|
|
|
@ -4,9 +4,14 @@
|
|||
import { assert } from 'chai';
|
||||
import { v4 as generateGuid } from 'uuid';
|
||||
|
||||
import { normalizeAci } from '../../util/normalizeAci';
|
||||
import type { WritableDB } from '../../sql/Interface';
|
||||
import { createDB, insertData, getTableData, updateToVersion } from './helpers';
|
||||
import { normalizeAci } from '../../util/normalizeAci.js';
|
||||
import type { WritableDB } from '../../sql/Interface.js';
|
||||
import {
|
||||
createDB,
|
||||
insertData,
|
||||
getTableData,
|
||||
updateToVersion,
|
||||
} from './helpers.js';
|
||||
|
||||
describe('SQL/updateToSchemaVersion1020', () => {
|
||||
let db: WritableDB;
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
|
||||
import { assert } from 'chai';
|
||||
import { v4 as generateGuid } from 'uuid';
|
||||
import { sql } from '../../sql/util';
|
||||
import { createDB, updateToVersion } from './helpers';
|
||||
import type { WritableDB, MessageType } from '../../sql/Interface';
|
||||
import { MessageRequestResponseEvent } from '../../types/MessageRequestResponseEvent';
|
||||
import { sql } from '../../sql/util.js';
|
||||
import { createDB, updateToVersion } from './helpers.js';
|
||||
import type { WritableDB, MessageType } from '../../sql/Interface.js';
|
||||
import { MessageRequestResponseEvent } from '../../types/MessageRequestResponseEvent.js';
|
||||
|
||||
describe('SQL/updateToSchemaVersion1030', () => {
|
||||
let db: WritableDB;
|
||||
|
|
|
@ -3,15 +3,15 @@
|
|||
import { omit } from 'lodash';
|
||||
import { assert } from 'chai';
|
||||
|
||||
import type { ReadableDB, WritableDB } from '../../sql/Interface';
|
||||
import { jsonToObject, objectToJSON, sql, sqlJoin } from '../../sql/util';
|
||||
import { createDB, updateToVersion, explain } from './helpers';
|
||||
import type { ReadableDB, WritableDB } from '../../sql/Interface.js';
|
||||
import { jsonToObject, objectToJSON, sql, sqlJoin } from '../../sql/util.js';
|
||||
import { createDB, updateToVersion, explain } from './helpers.js';
|
||||
import type {
|
||||
_AttachmentDownloadJobTypeV1030,
|
||||
_AttachmentDownloadJobTypeV1040,
|
||||
} from '../../sql/migrations/1040-undownloaded-backed-up-media';
|
||||
import type { AttachmentType } from '../../types/Attachment';
|
||||
import { IMAGE_JPEG } from '../../types/MIME';
|
||||
} from '../../sql/migrations/1040-undownloaded-backed-up-media.js';
|
||||
import type { AttachmentType } from '../../types/Attachment.js';
|
||||
import { IMAGE_JPEG } from '../../types/MIME.js';
|
||||
|
||||
function getAttachmentDownloadJobs(
|
||||
db: ReadableDB
|
||||
|
|
|
@ -8,15 +8,19 @@ import {
|
|||
dequeueOldestSyncTasks,
|
||||
removeSyncTaskById,
|
||||
saveSyncTasks,
|
||||
} from '../../sql/Server';
|
||||
import type { WritableDB, ReadableDB, MessageType } from '../../sql/Interface';
|
||||
import { sql, jsonToObject } from '../../sql/util';
|
||||
import { insertData, updateToVersion, createDB, explain } from './helpers';
|
||||
import { MAX_SYNC_TASK_ATTEMPTS } from '../../util/syncTasks.types';
|
||||
import { WEEK } from '../../util/durations';
|
||||
} from '../../sql/Server.js';
|
||||
import type {
|
||||
WritableDB,
|
||||
ReadableDB,
|
||||
MessageType,
|
||||
} from '../../sql/Interface.js';
|
||||
import { sql, jsonToObject } from '../../sql/util.js';
|
||||
import { insertData, updateToVersion, createDB, explain } from './helpers.js';
|
||||
import { MAX_SYNC_TASK_ATTEMPTS } from '../../util/syncTasks.types.js';
|
||||
import { WEEK } from '../../util/durations/index.js';
|
||||
|
||||
import type { MessageAttributesType } from '../../model-types';
|
||||
import type { SyncTaskType } from '../../util/syncTasks';
|
||||
import type { MessageAttributesType } from '../../model-types.js';
|
||||
import type { SyncTaskType } from '../../util/syncTasks.js';
|
||||
|
||||
/* eslint-disable camelcase */
|
||||
|
||||
|
|
|
@ -4,12 +4,16 @@
|
|||
import { assert } from 'chai';
|
||||
import { v4 as generateGuid } from 'uuid';
|
||||
|
||||
import type { WritableDB, ReadableDB, MessageType } from '../../sql/Interface';
|
||||
import { sql, jsonToObject } from '../../sql/util';
|
||||
import { createDB, insertData, updateToVersion, explain } from './helpers';
|
||||
import type {
|
||||
WritableDB,
|
||||
ReadableDB,
|
||||
MessageType,
|
||||
} from '../../sql/Interface.js';
|
||||
import { sql, jsonToObject } from '../../sql/util.js';
|
||||
import { createDB, insertData, updateToVersion, explain } from './helpers.js';
|
||||
|
||||
import type { MessageAttributesType } from '../../model-types';
|
||||
import { DurationInSeconds } from '../../util/durations/duration-in-seconds';
|
||||
import type { MessageAttributesType } from '../../model-types.js';
|
||||
import { DurationInSeconds } from '../../util/durations/duration-in-seconds.js';
|
||||
|
||||
/* eslint-disable camelcase */
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
import type { WritableDB } from '../../sql/Interface';
|
||||
import { sql } from '../../sql/util';
|
||||
import { createDB, updateToVersion, explain } from './helpers';
|
||||
import type { WritableDB } from '../../sql/Interface.js';
|
||||
import { sql } from '../../sql/util.js';
|
||||
import { createDB, updateToVersion, explain } from './helpers.js';
|
||||
|
||||
describe('SQL/updateToSchemaVersion1090', () => {
|
||||
let db: WritableDB;
|
||||
|
|
|
@ -3,17 +3,17 @@
|
|||
|
||||
import { assert } from 'chai';
|
||||
import { findLast } from 'lodash';
|
||||
import type { WritableDB } from '../../sql/Interface';
|
||||
import { markAllCallHistoryRead } from '../../sql/Server';
|
||||
import { SeenStatus } from '../../MessageSeenStatus';
|
||||
import type { WritableDB } from '../../sql/Interface.js';
|
||||
import { markAllCallHistoryRead } from '../../sql/Server.js';
|
||||
import { SeenStatus } from '../../MessageSeenStatus.js';
|
||||
import {
|
||||
CallMode,
|
||||
CallDirection,
|
||||
CallType,
|
||||
DirectCallStatus,
|
||||
} from '../../types/CallDisposition';
|
||||
import { strictAssert } from '../../util/assert';
|
||||
import { createDB, insertData, updateToVersion } from './helpers';
|
||||
} from '../../types/CallDisposition.js';
|
||||
import { strictAssert } from '../../util/assert.js';
|
||||
import { createDB, insertData, updateToVersion } from './helpers.js';
|
||||
|
||||
describe('SQL/updateToSchemaVersion1100', () => {
|
||||
let db: WritableDB;
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
import type { WritableDB } from '../../sql/Interface';
|
||||
import { sql } from '../../sql/util';
|
||||
import { createDB, updateToVersion, explain } from './helpers';
|
||||
import type { WritableDB } from '../../sql/Interface.js';
|
||||
import { sql } from '../../sql/util.js';
|
||||
import { createDB, updateToVersion, explain } from './helpers.js';
|
||||
|
||||
describe('SQL/updateToSchemaVersion1120', () => {
|
||||
let db: WritableDB;
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
import type { WritableDB } from '../../sql/Interface';
|
||||
import { sql } from '../../sql/util';
|
||||
import { createDB, updateToVersion, explain } from './helpers';
|
||||
import type { WritableDB } from '../../sql/Interface.js';
|
||||
import { sql } from '../../sql/util.js';
|
||||
import { createDB, updateToVersion, explain } from './helpers.js';
|
||||
|
||||
describe('SQL/updateToSchemaVersion1130', () => {
|
||||
let db: WritableDB;
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
|
||||
import { assert } from 'chai';
|
||||
import { omit } from 'lodash';
|
||||
import type { WritableDB } from '../../sql/Interface';
|
||||
import { createDB, updateToVersion, explain } from './helpers';
|
||||
import { jsonToObject, objectToJSON, sql } from '../../sql/util';
|
||||
import { IMAGE_BMP } from '../../types/MIME';
|
||||
import type { _AttachmentDownloadJobTypeV1040 } from '../../sql/migrations/1040-undownloaded-backed-up-media';
|
||||
import type { WritableDB } from '../../sql/Interface.js';
|
||||
import { createDB, updateToVersion, explain } from './helpers.js';
|
||||
import { jsonToObject, objectToJSON, sql } from '../../sql/util.js';
|
||||
import { IMAGE_BMP } from '../../types/MIME.js';
|
||||
import type { _AttachmentDownloadJobTypeV1040 } from '../../sql/migrations/1040-undownloaded-backed-up-media.js';
|
||||
|
||||
function insertOldJob(
|
||||
db: WritableDB,
|
||||
|
|
|
@ -3,11 +3,14 @@
|
|||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { AttachmentDownloadSource, type WritableDB } from '../../sql/Interface';
|
||||
import { objectToJSON, sql } from '../../sql/util';
|
||||
import { createDB, updateToVersion, explain } from './helpers';
|
||||
import { IMAGE_JPEG } from '../../types/MIME';
|
||||
import type { _AttachmentDownloadJobTypeV1040 } from '../../sql/migrations/1040-undownloaded-backed-up-media';
|
||||
import {
|
||||
AttachmentDownloadSource,
|
||||
type WritableDB,
|
||||
} from '../../sql/Interface.js';
|
||||
import { objectToJSON, sql } from '../../sql/util.js';
|
||||
import { createDB, updateToVersion, explain } from './helpers.js';
|
||||
import { IMAGE_JPEG } from '../../types/MIME.js';
|
||||
import type { _AttachmentDownloadJobTypeV1040 } from '../../sql/migrations/1040-undownloaded-backed-up-media.js';
|
||||
|
||||
type UnflattenedAttachmentDownloadJobType = Omit<
|
||||
_AttachmentDownloadJobTypeV1040,
|
||||
|
|
|
@ -3,13 +3,18 @@
|
|||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { type WritableDB } from '../../sql/Interface';
|
||||
import { type WritableDB } from '../../sql/Interface.js';
|
||||
import {
|
||||
sessionRecordToProtobuf,
|
||||
sessionStructureToBytes,
|
||||
} from '../../util/sessionTranslation';
|
||||
import { createDB, updateToVersion, insertData, getTableData } from './helpers';
|
||||
import { SESSION_V1_RECORD } from '../util/sessionTranslation_test';
|
||||
} from '../../util/sessionTranslation.js';
|
||||
import {
|
||||
createDB,
|
||||
updateToVersion,
|
||||
insertData,
|
||||
getTableData,
|
||||
} from './helpers.js';
|
||||
import { SESSION_V1_RECORD } from '../util/sessionTranslation_test.js';
|
||||
|
||||
const MAPS = [
|
||||
{
|
||||
|
|
|
@ -3,10 +3,15 @@
|
|||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { type WritableDB } from '../../sql/Interface';
|
||||
import { Migrations as Proto } from '../../protobuf';
|
||||
import { generateAci } from '../../types/ServiceId';
|
||||
import { createDB, updateToVersion, insertData, getTableData } from './helpers';
|
||||
import { type WritableDB } from '../../sql/Interface.js';
|
||||
import { Migrations as Proto } from '../../protobuf/index.js';
|
||||
import { generateAci } from '../../types/ServiceId.js';
|
||||
import {
|
||||
createDB,
|
||||
updateToVersion,
|
||||
insertData,
|
||||
getTableData,
|
||||
} from './helpers.js';
|
||||
|
||||
describe('SQL/updateToSchemaVersion1280', () => {
|
||||
let db: WritableDB;
|
||||
|
|
|
@ -3,8 +3,13 @@
|
|||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { type WritableDB } from '../../sql/Interface';
|
||||
import { createDB, updateToVersion, insertData, getTableData } from './helpers';
|
||||
import { type WritableDB } from '../../sql/Interface.js';
|
||||
import {
|
||||
createDB,
|
||||
updateToVersion,
|
||||
insertData,
|
||||
getTableData,
|
||||
} from './helpers.js';
|
||||
|
||||
const DEFAULTS = {
|
||||
id: 'id',
|
||||
|
|
|
@ -3,8 +3,13 @@
|
|||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { type WritableDB } from '../../sql/Interface';
|
||||
import { createDB, updateToVersion, insertData, getTableData } from './helpers';
|
||||
import { type WritableDB } from '../../sql/Interface.js';
|
||||
import {
|
||||
createDB,
|
||||
updateToVersion,
|
||||
insertData,
|
||||
getTableData,
|
||||
} from './helpers.js';
|
||||
|
||||
describe('SQL/updateToSchemaVersion1310', () => {
|
||||
let db: WritableDB;
|
||||
|
|
|
@ -8,12 +8,12 @@ import {
|
|||
dequeueOldestSyncTasks,
|
||||
saveSyncTasks,
|
||||
incrementAllSyncTaskAttempts,
|
||||
} from '../../sql/Server';
|
||||
import { sql } from '../../sql/util';
|
||||
import type { WritableDB } from '../../sql/Interface';
|
||||
import { updateToVersion, createDB, explain } from './helpers';
|
||||
} from '../../sql/Server.js';
|
||||
import { sql } from '../../sql/util.js';
|
||||
import type { WritableDB } from '../../sql/Interface.js';
|
||||
import { updateToVersion, createDB, explain } from './helpers.js';
|
||||
|
||||
import type { SyncTaskType } from '../../util/syncTasks';
|
||||
import type { SyncTaskType } from '../../util/syncTasks.js';
|
||||
|
||||
describe('SQL/updateToSchemaVersion1330', () => {
|
||||
let db: WritableDB;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// Copyright 2025 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { sql } from '../../sql/util';
|
||||
import type { WritableDB } from '../../sql/Interface';
|
||||
import { updateToVersion, createDB } from './helpers';
|
||||
import { sql } from '../../sql/util.js';
|
||||
import type { WritableDB } from '../../sql/Interface.js';
|
||||
import { updateToVersion, createDB } from './helpers.js';
|
||||
|
||||
describe('SQL/updateToSchemaVersion1350', () => {
|
||||
let db: WritableDB;
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { sql } from '../../sql/util';
|
||||
import { createDB, explain, updateToVersion } from './helpers';
|
||||
import type { WritableDB } from '../../sql/Interface';
|
||||
import { sql } from '../../sql/util.js';
|
||||
import { createDB, explain, updateToVersion } from './helpers.js';
|
||||
import type { WritableDB } from '../../sql/Interface.js';
|
||||
|
||||
describe('SQL/updateToSchemaVersion1360', () => {
|
||||
let db: WritableDB;
|
||||
|
|
|
@ -4,16 +4,16 @@
|
|||
import { assert } from 'chai';
|
||||
import { v1 as getGuid } from 'uuid';
|
||||
|
||||
import { sql } from '../../sql/util';
|
||||
import { sql } from '../../sql/util.js';
|
||||
import {
|
||||
updateToVersion,
|
||||
createDB,
|
||||
explain,
|
||||
insertData,
|
||||
getTableData,
|
||||
} from './helpers';
|
||||
} from './helpers.js';
|
||||
|
||||
import type { WritableDB } from '../../sql/Interface';
|
||||
import type { WritableDB } from '../../sql/Interface.js';
|
||||
|
||||
describe('SQL/updateToSchemaVersion1380', () => {
|
||||
let db: WritableDB;
|
||||
|
|
|
@ -3,9 +3,14 @@
|
|||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { type WritableDB } from '../../sql/Interface';
|
||||
import { createDB, updateToVersion, insertData, getTableData } from './helpers';
|
||||
import { createOrUpdate, getById } from '../../sql/util';
|
||||
import { type WritableDB } from '../../sql/Interface.js';
|
||||
import {
|
||||
createDB,
|
||||
updateToVersion,
|
||||
insertData,
|
||||
getTableData,
|
||||
} from './helpers.js';
|
||||
import { createOrUpdate, getById } from '../../sql/util.js';
|
||||
|
||||
describe('SQL/updateToSchemaVersion1410', () => {
|
||||
let db: WritableDB;
|
||||
|
|
|
@ -3,11 +3,14 @@
|
|||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { AttachmentDownloadSource, type WritableDB } from '../../sql/Interface';
|
||||
import { objectToJSON, sql } from '../../sql/util';
|
||||
import { createDB, updateToVersion } from './helpers';
|
||||
import type { AttachmentDownloadJobType } from '../../types/AttachmentDownload';
|
||||
import { createAttachmentDownloadJob } from '../../test-helpers/attachmentDownloads';
|
||||
import {
|
||||
AttachmentDownloadSource,
|
||||
type WritableDB,
|
||||
} from '../../sql/Interface.js';
|
||||
import { objectToJSON, sql } from '../../sql/util.js';
|
||||
import { createDB, updateToVersion } from './helpers.js';
|
||||
import type { AttachmentDownloadJobType } from '../../types/AttachmentDownload.js';
|
||||
import { createAttachmentDownloadJob } from '../../test-helpers/attachmentDownloads.js';
|
||||
|
||||
function createJobAndEnsureMessage(
|
||||
db: WritableDB,
|
||||
|
|
|
@ -5,20 +5,20 @@ import { assert } from 'chai';
|
|||
import { v4 as generateGuid } from 'uuid';
|
||||
import { range } from 'lodash';
|
||||
|
||||
import { createDB, insertData, updateToVersion } from './helpers';
|
||||
import { createDB, insertData, updateToVersion } from './helpers.js';
|
||||
import type {
|
||||
AciString,
|
||||
PniString,
|
||||
ServiceIdString,
|
||||
} from '../../types/ServiceId';
|
||||
import { normalizePni } from '../../types/ServiceId';
|
||||
import { normalizeAci } from '../../util/normalizeAci';
|
||||
} from '../../types/ServiceId.js';
|
||||
import { normalizePni } from '../../types/ServiceId.js';
|
||||
import { normalizeAci } from '../../util/normalizeAci.js';
|
||||
import type {
|
||||
WritableDB,
|
||||
KyberPreKeyType,
|
||||
PreKeyType,
|
||||
SignedPreKeyType,
|
||||
} from '../../sql/Interface';
|
||||
} from '../../sql/Interface.js';
|
||||
|
||||
type TestingKyberKey = Omit<
|
||||
KyberPreKeyType,
|
||||
|
|
|
@ -4,8 +4,13 @@
|
|||
import { assert } from 'chai';
|
||||
import { v4 as generateGuid } from 'uuid';
|
||||
|
||||
import type { WritableDB } from '../../sql/Interface';
|
||||
import { createDB, updateToVersion, insertData, getTableData } from './helpers';
|
||||
import type { WritableDB } from '../../sql/Interface.js';
|
||||
import {
|
||||
createDB,
|
||||
updateToVersion,
|
||||
insertData,
|
||||
getTableData,
|
||||
} from './helpers.js';
|
||||
|
||||
const CONVO_ID = generateGuid();
|
||||
const GROUP_ID = generateGuid();
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
import { assert } from 'chai';
|
||||
import { v4 as generateGuid } from 'uuid';
|
||||
|
||||
import { jsonToObject, sql } from '../../sql/util';
|
||||
import { jsonToObject, sql } from '../../sql/util.js';
|
||||
import {
|
||||
CallMode,
|
||||
CallDirection,
|
||||
|
@ -12,17 +12,17 @@ import {
|
|||
DirectCallStatus,
|
||||
GroupCallStatus,
|
||||
callHistoryDetailsSchema,
|
||||
} from '../../types/CallDisposition';
|
||||
import type { CallHistoryDetails } from '../../types/CallDisposition';
|
||||
} from '../../types/CallDisposition.js';
|
||||
import type { CallHistoryDetails } from '../../types/CallDisposition.js';
|
||||
import type {
|
||||
CallHistoryDetailsFromDiskType,
|
||||
MessageWithCallHistoryDetails,
|
||||
} from '../../sql/migrations/89-call-history';
|
||||
import { getCallIdFromEra } from '../../util/callDisposition';
|
||||
import { isValidUuid } from '../../util/isValidUuid';
|
||||
import { createDB, updateToVersion } from './helpers';
|
||||
import type { WritableDB, MessageType } from '../../sql/Interface';
|
||||
import { parsePartial } from '../../util/schemas';
|
||||
} from '../../sql/migrations/89-call-history.js';
|
||||
import { getCallIdFromEra } from '../../util/callDisposition.js';
|
||||
import { isValidUuid } from '../../util/isValidUuid.js';
|
||||
import { createDB, updateToVersion } from './helpers.js';
|
||||
import type { WritableDB, MessageType } from '../../sql/Interface.js';
|
||||
import { parsePartial } from '../../util/schemas.js';
|
||||
|
||||
describe('SQL/updateToSchemaVersion89', () => {
|
||||
let db: WritableDB;
|
||||
|
|
|
@ -3,15 +3,15 @@
|
|||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import type { WritableDB } from '../../sql/Interface';
|
||||
import { sql } from '../../sql/util';
|
||||
import type { WritableDB } from '../../sql/Interface.js';
|
||||
import { sql } from '../../sql/util.js';
|
||||
import {
|
||||
createDB,
|
||||
updateToVersion,
|
||||
insertData,
|
||||
getTableData,
|
||||
explain,
|
||||
} from './helpers';
|
||||
} from './helpers.js';
|
||||
|
||||
describe('SQL/updateToSchemaVersion90', () => {
|
||||
let db: WritableDB;
|
||||
|
|
|
@ -5,11 +5,16 @@ import { assert } from 'chai';
|
|||
import { v4 as generateGuid } from 'uuid';
|
||||
import { range } from 'lodash';
|
||||
|
||||
import { createDB, getTableData, insertData, updateToVersion } from './helpers';
|
||||
import type { ServiceIdString } from '../../types/ServiceId';
|
||||
import { normalizePni } from '../../types/ServiceId';
|
||||
import { normalizeAci } from '../../util/normalizeAci';
|
||||
import type { WritableDB, PreKeyType } from '../../sql/Interface';
|
||||
import {
|
||||
createDB,
|
||||
getTableData,
|
||||
insertData,
|
||||
updateToVersion,
|
||||
} from './helpers.js';
|
||||
import type { ServiceIdString } from '../../types/ServiceId.js';
|
||||
import { normalizePni } from '../../types/ServiceId.js';
|
||||
import { normalizeAci } from '../../util/normalizeAci.js';
|
||||
import type { WritableDB, PreKeyType } from '../../sql/Interface.js';
|
||||
|
||||
type TestingPreKey = Omit<
|
||||
PreKeyType,
|
||||
|
|
|
@ -5,15 +5,15 @@ import { assert } from 'chai';
|
|||
import { v4 as generateGuid } from 'uuid';
|
||||
import { range } from 'lodash';
|
||||
|
||||
import { createDB, insertData, updateToVersion } from './helpers';
|
||||
import type { ServiceIdString } from '../../types/ServiceId';
|
||||
import { normalizePni } from '../../types/ServiceId';
|
||||
import { normalizeAci } from '../../util/normalizeAci';
|
||||
import { createDB, insertData, updateToVersion } from './helpers.js';
|
||||
import type { ServiceIdString } from '../../types/ServiceId.js';
|
||||
import { normalizePni } from '../../types/ServiceId.js';
|
||||
import { normalizeAci } from '../../util/normalizeAci.js';
|
||||
import type {
|
||||
WritableDB,
|
||||
KyberPreKeyType,
|
||||
SignedPreKeyType,
|
||||
} from '../../sql/Interface';
|
||||
} from '../../sql/Interface.js';
|
||||
|
||||
type TestingKyberKey = Omit<
|
||||
KyberPreKeyType,
|
||||
|
|
|
@ -4,8 +4,13 @@
|
|||
import { assert } from 'chai';
|
||||
import { v4 as generateGuid } from 'uuid';
|
||||
|
||||
import type { WritableDB } from '../../sql/Interface';
|
||||
import { createDB, updateToVersion, insertData, getTableData } from './helpers';
|
||||
import type { WritableDB } from '../../sql/Interface.js';
|
||||
import {
|
||||
createDB,
|
||||
updateToVersion,
|
||||
insertData,
|
||||
getTableData,
|
||||
} from './helpers.js';
|
||||
|
||||
const CONVO_ID = generateGuid();
|
||||
const OUR_ACI = generateGuid();
|
||||
|
|
|
@ -3,8 +3,13 @@
|
|||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import type { WritableDB } from '../../sql/Interface';
|
||||
import { createDB, updateToVersion, insertData, getTableData } from './helpers';
|
||||
import type { WritableDB } from '../../sql/Interface.js';
|
||||
import {
|
||||
createDB,
|
||||
updateToVersion,
|
||||
insertData,
|
||||
getTableData,
|
||||
} from './helpers.js';
|
||||
|
||||
describe('SQL/updateToSchemaVersion990', () => {
|
||||
let db: WritableDB;
|
||||
|
|
|
@ -4,15 +4,19 @@
|
|||
import { assert } from 'chai';
|
||||
import { v4 as generateGuid } from 'uuid';
|
||||
|
||||
import { _storyIdPredicate, getJobsInQueue, insertJob } from '../../sql/Server';
|
||||
import type { WritableDB } from '../../sql/Interface';
|
||||
import { ReadStatus } from '../../messages/MessageReadStatus';
|
||||
import { SeenStatus } from '../../MessageSeenStatus';
|
||||
import { objectToJSON, sql, sqlJoin } from '../../sql/util';
|
||||
import { BodyRange } from '../../types/BodyRange';
|
||||
import type { AciString } from '../../types/ServiceId';
|
||||
import { generateAci } from '../../types/ServiceId';
|
||||
import { createDB, updateToVersion, explain } from './helpers';
|
||||
import {
|
||||
_storyIdPredicate,
|
||||
getJobsInQueue,
|
||||
insertJob,
|
||||
} from '../../sql/Server.js';
|
||||
import type { WritableDB } from '../../sql/Interface.js';
|
||||
import { ReadStatus } from '../../messages/MessageReadStatus.js';
|
||||
import { SeenStatus } from '../../MessageSeenStatus.js';
|
||||
import { objectToJSON, sql, sqlJoin } from '../../sql/util.js';
|
||||
import { BodyRange } from '../../types/BodyRange.js';
|
||||
import type { AciString } from '../../types/ServiceId.js';
|
||||
import { generateAci } from '../../types/ServiceId.js';
|
||||
import { createDB, updateToVersion, explain } from './helpers.js';
|
||||
|
||||
const OUR_UUID = generateGuid();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue