chore: replace .d.ts type imports with .js imports, as .d.ts imports break usage checks in the IDE

This commit is contained in:
Alessio Gravili
2024-03-07 16:08:49 -05:00
parent b4434a369b
commit 50c7269315
562 changed files with 916 additions and 924 deletions

View File

@@ -4,7 +4,7 @@ import type { Connect } from 'payload/database'
import mongoose from 'mongoose'
import type { MongooseAdapter } from './index.d.ts'
import type { MongooseAdapter } from './index.js'
export const connect: Connect = async function connect(
this: MongooseAdapter,

View File

@@ -1,7 +1,7 @@
import type { Create } from 'payload/database'
import type { Document, PayloadRequest } from 'payload/types'
import type { MongooseAdapter } from './index.d.ts'
import type { MongooseAdapter } from './index.js'
import handleError from './utilities/handleError.js'
import { withSession } from './withSession.js'

View File

@@ -1,14 +1,14 @@
import type { CreateGlobal } from 'payload/database'
import type { PayloadRequest } from 'payload/types'
import type { MongooseAdapter } from './index.d.ts'
import type { MongooseAdapter } from './index.js'
import sanitizeInternalFields from './utilities/sanitizeInternalFields.js'
import { withSession } from './withSession.js'
export const createGlobal: CreateGlobal = async function createGlobal(
this: MongooseAdapter,
{ data, req = {} as PayloadRequest, slug },
{ slug, data, req = {} as PayloadRequest },
) {
const Model = this.globals
const global = {
@@ -17,7 +17,7 @@ export const createGlobal: CreateGlobal = async function createGlobal(
}
const options = withSession(this, req.transactionID)
let [result] = (await Model.create([global], options)) as any
let [result] = await Model.create([global], options)
result = JSON.parse(JSON.stringify(result))

View File

@@ -2,7 +2,7 @@ import type { CreateGlobalVersion } from 'payload/database'
import type { PayloadRequest } from 'payload/types'
import type { Document } from 'payload/types'
import type { MongooseAdapter } from './index.d.ts'
import type { MongooseAdapter } from './index.js'
import { withSession } from './withSession.js'

View File

@@ -2,7 +2,7 @@ import type { CreateVersion } from 'payload/database'
import type { PayloadRequest } from 'payload/types'
import type { Document } from 'payload/types'
import type { MongooseAdapter } from './index.d.ts'
import type { MongooseAdapter } from './index.js'
import { withSession } from './withSession.js'

View File

@@ -1,7 +1,7 @@
import type { DeleteMany } from 'payload/database'
import type { PayloadRequest } from 'payload/types'
import type { MongooseAdapter } from './index.d.ts'
import type { MongooseAdapter } from './index.js'
import { withSession } from './withSession.js'

View File

@@ -2,7 +2,7 @@ import type { DeleteOne } from 'payload/database'
import type { PayloadRequest } from 'payload/types'
import type { Document } from 'payload/types'
import type { MongooseAdapter } from './index.d.ts'
import type { MongooseAdapter } from './index.js'
import sanitizeInternalFields from './utilities/sanitizeInternalFields.js'
import { withSession } from './withSession.js'

View File

@@ -1,7 +1,7 @@
import type { DeleteVersions } from 'payload/database'
import type { PayloadRequest } from 'payload/types'
import type { MongooseAdapter } from './index.d.ts'
import type { MongooseAdapter } from './index.js'
import { withSession } from './withSession.js'

View File

@@ -2,7 +2,7 @@ import type { Destroy } from 'payload/database'
import mongoose from 'mongoose'
import type { MongooseAdapter } from './index.d.ts'
import type { MongooseAdapter } from './index.js'
export const destroy: Destroy = async function destroy(this: MongooseAdapter) {
if (this.mongoMemoryServer) {

View File

@@ -4,7 +4,7 @@ import type { PayloadRequest } from 'payload/types'
import { flattenWhereToOperators } from 'payload/database'
import type { MongooseAdapter } from './index.d.ts'
import type { MongooseAdapter } from './index.js'
import { buildSortParam } from './queries/buildSortParam.js'
import sanitizeInternalFields from './utilities/sanitizeInternalFields.js'

View File

@@ -3,7 +3,7 @@ import type { PayloadRequest } from 'payload/types'
import { combineQueries } from 'payload/database'
import type { MongooseAdapter } from './index.d.ts'
import type { MongooseAdapter } from './index.js'
import sanitizeInternalFields from './utilities/sanitizeInternalFields.js'
import { withSession } from './withSession.js'

View File

@@ -5,7 +5,7 @@ import type { PayloadRequest } from 'payload/types'
import { flattenWhereToOperators } from 'payload/database'
import { buildVersionGlobalFields } from 'payload/versions'
import type { MongooseAdapter } from './index.d.ts'
import type { MongooseAdapter } from './index.js'
import { buildSortParam } from './queries/buildSortParam.js'
import sanitizeInternalFields from './utilities/sanitizeInternalFields.js'

View File

@@ -3,7 +3,7 @@ import type { FindOne } from 'payload/database'
import type { PayloadRequest } from 'payload/types'
import type { Document } from 'payload/types'
import type { MongooseAdapter } from './index.d.ts'
import type { MongooseAdapter } from './index.js'
import sanitizeInternalFields from './utilities/sanitizeInternalFields.js'
import { withSession } from './withSession.js'

View File

@@ -4,7 +4,7 @@ import type { PayloadRequest } from 'payload/types'
import { flattenWhereToOperators } from 'payload/database'
import type { MongooseAdapter } from './index.d.ts'
import type { MongooseAdapter } from './index.js'
import { buildSortParam } from './queries/buildSortParam.js'
import sanitizeInternalFields from './utilities/sanitizeInternalFields.js'

View File

@@ -8,7 +8,7 @@ import mongoose from 'mongoose'
import path from 'path'
import { createDatabaseAdapter } from 'payload/database'
import type { CollectionModel, GlobalModel } from './types.d.ts'
import type { CollectionModel, GlobalModel } from './types.js'
import { connect } from './connect.js'
import { create } from './create.js'
@@ -36,7 +36,7 @@ import { updateGlobalVersion } from './updateGlobalVersion.js'
import { updateOne } from './updateOne.js'
import { updateVersion } from './updateVersion.js'
export type { MigrateDownArgs, MigrateUpArgs } from './types.d.ts'
export type { MigrateDownArgs, MigrateUpArgs } from './types.js'
import type { DatabaseAdapterObj } from 'payload/database'
export interface Args {

View File

@@ -11,8 +11,8 @@ import {
getVersionsModelName,
} from 'payload/versions'
import type { MongooseAdapter } from './index.d.ts'
import type { CollectionModel } from './types.d.ts'
import type { MongooseAdapter } from './index.js'
import type { CollectionModel } from './types.js'
import buildCollectionSchema from './models/buildCollectionSchema.js'
import { buildGlobalModel } from './models/buildGlobalModel.js'

View File

@@ -8,7 +8,7 @@ import {
} from 'payload/database'
import prompts from 'prompts'
import type { MongooseAdapter } from './index.d.ts'
import type { MongooseAdapter } from './index.js'
/**
* Drop the current database and run all migrate up functions

View File

@@ -2,7 +2,7 @@ import type { SanitizedConfig } from 'payload/config'
import mongoose from 'mongoose'
import type { GlobalModel } from '../types.d.ts'
import type { GlobalModel } from '../types.js'
import getBuildQueryPlugin from '../queries/buildQuery.js'
import buildSchema from './buildSchema.js'

View File

@@ -9,7 +9,7 @@ import { getLocalizedPaths } from 'payload/database'
import { fieldAffectsData } from 'payload/types'
import { validOperators } from 'payload/types'
import type { MongooseAdapter } from '../index.d.ts'
import type { MongooseAdapter } from '../index.js'
import { operatorMap } from './operatorMap.js'
import { sanitizeQueryValue } from './sanitizeQueryValue.js'

View File

@@ -4,7 +4,7 @@ import type { PayloadRequest } from 'payload/types'
import { combineQueries, flattenWhereToOperators } from 'payload/database'
import type { MongooseAdapter } from './index.d.ts'
import type { MongooseAdapter } from './index.js'
import { buildSortParam } from './queries/buildSortParam.js'
import sanitizeInternalFields from './utilities/sanitizeInternalFields.js'

View File

@@ -4,7 +4,7 @@ import type { BeginTransaction } from 'payload/database'
import { APIError } from 'payload/errors'
import { v4 as uuid } from 'uuid'
import type { MongooseAdapter } from '../index.d.ts'
import type { MongooseAdapter } from '../index.js'
export const beginTransaction: BeginTransaction = async function beginTransaction(
this: MongooseAdapter,

View File

@@ -25,7 +25,7 @@ import type {
UploadField,
} from 'payload/types'
import type { BuildQueryArgs } from './queries/buildQuery.d.ts'
import type { BuildQueryArgs } from './queries/buildQuery.js'
export interface CollectionModel extends Model<any>, PaginateModel<any> {
/** buildQuery is used to transform payload's where operator into what can be used by mongoose (e.g. id => _id) */

View File

@@ -1,7 +1,7 @@
import type { UpdateGlobal } from 'payload/database'
import type { PayloadRequest } from 'payload/types'
import type { MongooseAdapter } from './index.d.ts'
import type { MongooseAdapter } from './index.js'
import sanitizeInternalFields from './utilities/sanitizeInternalFields.js'
import { withSession } from './withSession.js'

View File

@@ -1,7 +1,7 @@
import type { UpdateGlobalVersionArgs } from 'payload/database'
import type { PayloadRequest, TypeWithID } from 'payload/types'
import type { MongooseAdapter } from './index.d.ts'
import type { MongooseAdapter } from './index.js'
import { withSession } from './withSession.js'

View File

@@ -1,7 +1,7 @@
import type { UpdateOne } from 'payload/database'
import type { PayloadRequest } from 'payload/types'
import type { MongooseAdapter } from './index.d.ts'
import type { MongooseAdapter } from './index.js'
import handleError from './utilities/handleError.js'
import sanitizeInternalFields from './utilities/sanitizeInternalFields.js'

View File

@@ -1,7 +1,7 @@
import type { UpdateVersion } from 'payload/database'
import type { PayloadRequest } from 'payload/types'
import type { MongooseAdapter } from './index.d.ts'
import type { MongooseAdapter } from './index.js'
import { withSession } from './withSession.js'

View File

@@ -1,6 +1,6 @@
import type { ClientSession } from 'mongoose'
import type { MongooseAdapter } from './index.d.ts'
import type { MongooseAdapter } from './index.js'
/**
* returns the session belonging to the transaction of the req.session if exists

View File

@@ -7,7 +7,7 @@ import { numeric, timestamp, varchar } from 'drizzle-orm/pg-core'
import { Pool } from 'pg'
import prompts from 'prompts'
import type { PostgresAdapter } from './types.d.ts'
import type { PostgresAdapter } from './types.js'
const connectWithReconnect = async function ({
adapter,

View File

@@ -2,7 +2,7 @@ import type { Create } from 'payload/database'
import toSnakeCase from 'to-snake-case'
import type { PostgresAdapter } from './types.d.ts'
import type { PostgresAdapter } from './types.js'
import { upsertRow } from './upsertRow/index.js'

View File

@@ -3,7 +3,7 @@ import type { PayloadRequest, TypeWithID } from 'payload/types'
import toSnakeCase from 'to-snake-case'
import type { PostgresAdapter } from './types.d.ts'
import type { PostgresAdapter } from './types.js'
import { upsertRow } from './upsertRow/index.js'

View File

@@ -6,7 +6,7 @@ import { sql } from 'drizzle-orm'
import { buildVersionGlobalFields } from 'payload/versions'
import toSnakeCase from 'to-snake-case'
import type { PostgresAdapter } from './types.d.ts'
import type { PostgresAdapter } from './types.js'
import { upsertRow } from './upsertRow/index.js'

View File

@@ -5,7 +5,7 @@ import type { CreateMigration } from 'payload/database'
import fs from 'fs'
import prompts from 'prompts'
import type { PostgresAdapter } from './types.d.ts'
import type { PostgresAdapter } from './types.js'
const migrationTemplate = (
upSQL?: string,

View File

@@ -5,7 +5,7 @@ import { sql } from 'drizzle-orm'
import { buildVersionCollectionFields } from 'payload/versions'
import toSnakeCase from 'to-snake-case'
import type { PostgresAdapter } from './types.d.ts'
import type { PostgresAdapter } from './types.js'
import { upsertRow } from './upsertRow/index.js'

View File

@@ -4,7 +4,7 @@ import type { PayloadRequest } from 'payload/types'
import { inArray } from 'drizzle-orm'
import toSnakeCase from 'to-snake-case'
import type { PostgresAdapter } from './types.d.ts'
import type { PostgresAdapter } from './types.js'
import { findMany } from './find/findMany.js'

View File

@@ -3,7 +3,7 @@ import type { PayloadRequest } from 'payload/types'
import toSnakeCase from 'to-snake-case'
import type { PostgresAdapter } from './types.d.ts'
import type { PostgresAdapter } from './types.js'
import { buildFindManyArgs } from './find/buildFindManyArgs.js'
import buildQuery from './queries/buildQuery.js'

View File

@@ -5,7 +5,7 @@ import { inArray } from 'drizzle-orm'
import { buildVersionCollectionFields } from 'payload/versions'
import toSnakeCase from 'to-snake-case'
import type { PostgresAdapter } from './types.d.ts'
import type { PostgresAdapter } from './types.js'
import { findMany } from './find/findMany.js'

View File

@@ -1,6 +1,6 @@
import type { Destroy } from 'payload/database'
import type { PostgresAdapter } from './types.d.ts'
import type { PostgresAdapter } from './types.js'
export const destroy: Destroy = async function destroy(this: PostgresAdapter) {
// TODO: this hangs test suite for some reason

View File

@@ -3,7 +3,7 @@ import type { PayloadRequest, SanitizedCollectionConfig } from 'payload/types'
import toSnakeCase from 'to-snake-case'
import type { PostgresAdapter } from './types.d.ts'
import type { PostgresAdapter } from './types.js'
import { findMany } from './find/findMany.js'

View File

@@ -1,7 +1,7 @@
import type { DBQueryConfig } from 'drizzle-orm'
import type { Field } from 'payload/types'
import type { PostgresAdapter } from '../types.d.ts'
import type { PostgresAdapter } from '../types.js'
import { traverseFields } from './traverseFields.js'

View File

@@ -3,8 +3,8 @@ import type { Field, PayloadRequest, TypeWithID } from 'payload/types'
import { inArray, sql } from 'drizzle-orm'
import type { PostgresAdapter } from '../types.d.ts'
import type { ChainedMethods } from './chainMethods.d.ts'
import type { PostgresAdapter } from '../types.js'
import type { ChainedMethods } from './chainMethods.js'
import buildQuery from '../queries/buildQuery.js'
import { transform } from '../transform/read/index.js'

View File

@@ -4,8 +4,8 @@ import type { Field } from 'payload/types'
import { fieldAffectsData, tabHasName } from 'payload/types'
import toSnakeCase from 'to-snake-case'
import type { PostgresAdapter } from '../types.d.ts'
import type { Result } from './buildFindManyArgs.d.ts'
import type { PostgresAdapter } from '../types.js'
import type { Result } from './buildFindManyArgs.js'
type TraverseFieldArgs = {
_locales: Record<string, unknown>

View File

@@ -2,7 +2,7 @@ import type { FindGlobal } from 'payload/database'
import toSnakeCase from 'to-snake-case'
import type { PostgresAdapter } from './types.d.ts'
import type { PostgresAdapter } from './types.js'
import { findMany } from './find/findMany.js'

View File

@@ -4,7 +4,7 @@ import type { PayloadRequest, SanitizedGlobalConfig } from 'payload/types'
import { buildVersionGlobalFields } from 'payload/versions'
import toSnakeCase from 'to-snake-case'
import type { PostgresAdapter } from './types.d.ts'
import type { PostgresAdapter } from './types.js'
import { findMany } from './find/findMany.js'

View File

@@ -3,7 +3,7 @@ import type { PayloadRequest, SanitizedCollectionConfig, TypeWithID } from 'payl
import toSnakeCase from 'to-snake-case'
import type { PostgresAdapter } from './types.d.ts'
import type { PostgresAdapter } from './types.js'
import { findMany } from './find/findMany.js'

View File

@@ -4,7 +4,7 @@ import type { PayloadRequest, SanitizedCollectionConfig } from 'payload/types'
import { buildVersionCollectionFields } from 'payload/versions'
import toSnakeCase from 'to-snake-case'
import type { PostgresAdapter } from './types.d.ts'
import type { PostgresAdapter } from './types.js'
import { findMany } from './find/findMany.js'

View File

@@ -5,7 +5,7 @@ import fs from 'fs'
import path from 'path'
import { createDatabaseAdapter } from 'payload/database'
import type { Args, PostgresAdapter } from './types.d.ts'
import type { Args, PostgresAdapter } from './types.js'
import { connect } from './connect.js'
import { create } from './create.js'
@@ -38,7 +38,7 @@ import { updateGlobal } from './updateGlobal.js'
import { updateGlobalVersion } from './updateGlobalVersion.js'
import { updateVersion } from './updateVersion.js'
export type { MigrateDownArgs, MigrateUpArgs } from './types.d.ts'
export type { MigrateDownArgs, MigrateUpArgs } from './types.js'
export function postgresAdapter(args: Args): DatabaseAdapterObj<PostgresAdapter> {
function adapter({ payload }: { payload: Payload }) {

View File

@@ -6,7 +6,7 @@ import { pgEnum, pgSchema, pgTable } from 'drizzle-orm/pg-core'
import { buildVersionCollectionFields, buildVersionGlobalFields } from 'payload/versions'
import toSnakeCase from 'to-snake-case'
import type { PostgresAdapter } from './types.d.ts'
import type { PostgresAdapter } from './types.js'
import { buildTable } from './schema/build.js'

View File

@@ -11,7 +11,7 @@ import {
} from 'payload/database'
import prompts from 'prompts'
import type { PostgresAdapter } from './types.d.ts'
import type { PostgresAdapter } from './types.js'
import { createMigrationTable } from './utilities/createMigrationTable.js'
import { migrationTableExists } from './utilities/migrationTableExists.js'

View File

@@ -9,7 +9,7 @@ import {
readMigrationFiles,
} from 'payload/database'
import type { PostgresAdapter } from './types.d.ts'
import type { PostgresAdapter } from './types.js'
import { migrationTableExists } from './utilities/migrationTableExists.js'
import { parseError } from './utilities/parseError.js'

View File

@@ -9,7 +9,7 @@ import {
} from 'payload/database'
import prompts from 'prompts'
import type { PostgresAdapter } from './types.d.ts'
import type { PostgresAdapter } from './types.js'
import { parseError } from './utilities/parseError.js'

View File

@@ -9,7 +9,7 @@ import {
readMigrationFiles,
} from 'payload/database'
import type { PostgresAdapter } from './types.d.ts'
import type { PostgresAdapter } from './types.js'
import { migrationTableExists } from './utilities/migrationTableExists.js'
import { parseError } from './utilities/parseError.js'

View File

@@ -9,7 +9,7 @@ import {
readMigrationFiles,
} from 'payload/database'
import type { PostgresAdapter } from './types.d.ts'
import type { PostgresAdapter } from './types.js'
import { migrationTableExists } from './utilities/migrationTableExists.js'

View File

@@ -1,7 +1,7 @@
import { Table } from 'console-table-printer'
import { getMigrations, readMigrationFiles } from 'payload/database'
import type { PostgresAdapter } from './types.d.ts'
import type { PostgresAdapter } from './types.js'
import { migrationTableExists } from './utilities/migrationTableExists.js'

View File

@@ -1,8 +1,8 @@
import type { SQL } from 'drizzle-orm'
import type { Field, Where } from 'payload/types'
import type { GenericColumn, PostgresAdapter } from '../types.d.ts'
import type { BuildQueryJoinAliases, BuildQueryJoins } from './buildQuery.d.ts'
import type { GenericColumn, PostgresAdapter } from '../types.js'
import type { BuildQueryJoinAliases, BuildQueryJoins } from './buildQuery.js'
import { parseParams } from './parseParams.js'

View File

@@ -4,7 +4,7 @@ import type { Field, Where } from 'payload/types'
import { asc, desc } from 'drizzle-orm'
import type { GenericColumn, GenericTable, PostgresAdapter } from '../types.d.ts'
import type { GenericColumn, GenericTable, PostgresAdapter } from '../types.js'
import { getTableColumnFromPath } from './getTableColumnFromPath.js'
import { parseParams } from './parseParams.js'

View File

@@ -11,8 +11,8 @@ import { flattenTopLevelFields } from 'payload/utilities'
import toSnakeCase from 'to-snake-case'
import { v4 as uuid } from 'uuid'
import type { GenericColumn, GenericTable, PostgresAdapter } from '../types.d.ts'
import type { BuildQueryJoinAliases, BuildQueryJoins } from './buildQuery.d.ts'
import type { GenericColumn, GenericTable, PostgresAdapter } from '../types.js'
import type { BuildQueryJoinAliases, BuildQueryJoins } from './buildQuery.js'
type Constraint = {
columnName: string

View File

@@ -6,8 +6,8 @@ import { and, ilike, isNotNull, isNull, ne, notInArray, or, sql } from 'drizzle-
import { QueryError } from 'payload/errors'
import { validOperators } from 'payload/types'
import type { GenericColumn, PostgresAdapter } from '../types.d.ts'
import type { BuildQueryJoinAliases, BuildQueryJoins } from './buildQuery.d.ts'
import type { GenericColumn, PostgresAdapter } from '../types.js'
import type { BuildQueryJoinAliases, BuildQueryJoins } from './buildQuery.js'
import { buildAndOrConditions } from './buildAndOrConditions.js'
import { createJSONQuery } from './createJSONQuery/index.js'

View File

@@ -2,7 +2,7 @@ import { APIError } from 'payload/errors'
import { type Field, type TabAsField, fieldAffectsData } from 'payload/types'
import { createArrayFromCommaDelineated } from 'payload/utilities'
import type { PostgresAdapter } from '../types.d.ts'
import type { PostgresAdapter } from '../types.js'
type SanitizeQueryValueArgs = {
adapter: PostgresAdapter

View File

@@ -13,7 +13,7 @@ import { index, integer, numeric, serial, timestamp, unique, varchar } from 'dri
import { fieldAffectsData } from 'payload/types'
import toSnakeCase from 'to-snake-case'
import type { GenericColumns, GenericTable, IDType, PostgresAdapter } from '../types.d.ts'
import type { GenericColumns, GenericTable, IDType, PostgresAdapter } from '../types.js'
import { parentIDColumnMap } from './parentIDColumnMap.js'
import { setColumnID } from './setColumnID.js'

View File

@@ -1,7 +1,7 @@
/* eslint-disable no-param-reassign */
import { index, uniqueIndex } from 'drizzle-orm/pg-core'
import type { GenericColumn } from '../types.d.ts'
import type { GenericColumn } from '../types.js'
type CreateIndexArgs = {
columnName: string

View File

@@ -1,6 +1,6 @@
import { integer, numeric, uuid, varchar } from 'drizzle-orm/pg-core'
import type { IDType } from '../types.d.ts'
import type { IDType } from '../types.js'
export const parentIDColumnMap: Record<
IDType,

View File

@@ -4,7 +4,7 @@ import { numeric, serial, uuid, varchar } from 'drizzle-orm/pg-core'
import { type Field, fieldAffectsData } from 'payload/types'
import { flattenTopLevelFields } from 'payload/utilities'
import type { IDType, PostgresAdapter } from '../types.d.ts'
import type { IDType, PostgresAdapter } from '../types.js'
type Args = { adapter: PostgresAdapter; columns: Record<string, PgColumnBuilder>; fields: Field[] }
export const setColumnID = ({ adapter, columns, fields }: Args): IDType => {

View File

@@ -22,7 +22,7 @@ import { InvalidConfiguration } from 'payload/errors'
import { fieldAffectsData, optionIsObject } from 'payload/types'
import toSnakeCase from 'to-snake-case'
import type { GenericColumns, IDType, PostgresAdapter } from '../types.d.ts'
import type { GenericColumns, IDType, PostgresAdapter } from '../types.js'
import { hasLocalesTable } from '../utilities/hasLocalesTable.js'
import { buildTable } from './build.js'

View File

@@ -3,7 +3,7 @@ import type { Block, Field } from 'payload/types'
import { InvalidConfiguration } from 'payload/errors'
import { fieldAffectsData, fieldHasSubFields, tabHasName } from 'payload/types'
import type { GenericTable } from '../types.d.ts'
import type { GenericTable } from '../types.js'
type Args = {
block: Block

View File

@@ -2,7 +2,7 @@ import type { BeginTransaction } from 'payload/database'
import { v4 as uuid } from 'uuid'
import type { DrizzleTransaction, PostgresAdapter } from '../types.d.ts'
import type { DrizzleTransaction, PostgresAdapter } from '../types.js'
export const beginTransaction: BeginTransaction = async function beginTransaction(
this: PostgresAdapter,

View File

@@ -4,7 +4,7 @@ import type { Field, TabAsField } from 'payload/types'
import { fieldAffectsData } from 'payload/types'
import type { BlocksMap } from '../../utilities/createBlocksMap.d.ts'
import type { BlocksMap } from '../../utilities/createBlocksMap.js'
import { transformHasManyNumber } from './hasManyNumber.js'
import { transformHasManyText } from './hasManyText.js'

View File

@@ -1,8 +1,8 @@
/* eslint-disable no-param-reassign */
import type { ArrayField } from 'payload/types'
import type { PostgresAdapter } from '../../types.d.ts'
import type { ArrayRowToInsert, BlockRowToInsert, RelationshipToDelete } from './types.d.ts'
import type { PostgresAdapter } from '../../types.js'
import type { ArrayRowToInsert, BlockRowToInsert, RelationshipToDelete } from './types.js'
import { isArrayOfRows } from '../../utilities/isArrayOfRows.js'
import { traverseFields } from './traverseFields.js'

View File

@@ -3,8 +3,8 @@ import type { BlockField } from 'payload/types'
import toSnakeCase from 'to-snake-case'
import type { PostgresAdapter } from '../../types.d.ts'
import type { BlockRowToInsert, RelationshipToDelete } from './types.d.ts'
import type { PostgresAdapter } from '../../types.js'
import type { BlockRowToInsert, RelationshipToDelete } from './types.js'
import { traverseFields } from './traverseFields.js'

View File

@@ -1,8 +1,8 @@
/* eslint-disable no-param-reassign */
import type { Field } from 'payload/types'
import type { PostgresAdapter } from '../../types.d.ts'
import type { RowToInsert } from './types.d.ts'
import type { PostgresAdapter } from '../../types.js'
import type { RowToInsert } from './types.js'
import { traverseFields } from './traverseFields.js'

View File

@@ -4,8 +4,8 @@ import type { Field } from 'payload/types'
import { fieldAffectsData } from 'payload/types'
import toSnakeCase from 'to-snake-case'
import type { PostgresAdapter } from '../../types.d.ts'
import type { ArrayRowToInsert, BlockRowToInsert, RelationshipToDelete } from './types.d.ts'
import type { PostgresAdapter } from '../../types.js'
import type { ArrayRowToInsert, BlockRowToInsert, RelationshipToDelete } from './types.js'
import { isArrayOfRows } from '../../utilities/isArrayOfRows.js'
import { transformArray } from './array.js'

View File

@@ -2,8 +2,8 @@ import type { UpdateOne } from 'payload/database'
import toSnakeCase from 'to-snake-case'
import type { ChainedMethods } from './find/chainMethods.d.ts'
import type { PostgresAdapter } from './types.d.ts'
import type { ChainedMethods } from './find/chainMethods.js'
import type { PostgresAdapter } from './types.js'
import { chainMethods } from './find/chainMethods.js'
import buildQuery from './queries/buildQuery.js'
import { upsertRow } from './upsertRow/index.js'

View File

@@ -3,7 +3,7 @@ import type { PayloadRequest, TypeWithID } from 'payload/types'
import toSnakeCase from 'to-snake-case'
import type { PostgresAdapter } from './types.d.ts'
import type { PostgresAdapter } from './types.js'
import { upsertRow } from './upsertRow/index.js'

View File

@@ -4,7 +4,7 @@ import type { PayloadRequest, SanitizedGlobalConfig, TypeWithID } from 'payload/
import { buildVersionGlobalFields } from 'payload/versions'
import toSnakeCase from 'to-snake-case'
import type { PostgresAdapter } from './types.d.ts'
import type { PostgresAdapter } from './types.js'
import buildQuery from './queries/buildQuery.js'
import { upsertRow } from './upsertRow/index.js'

View File

@@ -4,7 +4,7 @@ import type { PayloadRequest, SanitizedCollectionConfig, TypeWithID } from 'payl
import { buildVersionCollectionFields } from 'payload/versions'
import toSnakeCase from 'to-snake-case'
import type { PostgresAdapter } from './types.d.ts'
import type { PostgresAdapter } from './types.js'
import buildQuery from './queries/buildQuery.js'
import { upsertRow } from './upsertRow/index.js'

View File

@@ -1,6 +1,6 @@
import { and, eq } from 'drizzle-orm'
import type { DrizzleDB, PostgresAdapter } from '../types.d.ts'
import type { DrizzleDB, PostgresAdapter } from '../types.js'
type Args = {
adapter: PostgresAdapter

View File

@@ -1,6 +1,6 @@
import { and, eq, inArray } from 'drizzle-orm'
import type { DrizzleDB, PostgresAdapter } from '../types.d.ts'
import type { DrizzleDB, PostgresAdapter } from '../types.js'
type Args = {
adapter: PostgresAdapter

View File

@@ -4,8 +4,8 @@ import type { TypeWithID } from 'payload/types'
import { eq } from 'drizzle-orm'
import { ValidationError } from 'payload/errors'
import type { BlockRowToInsert } from '../transform/write/types.d.ts'
import type { Args } from './types.d.ts'
import type { BlockRowToInsert } from '../transform/write/types.js'
import type { Args } from './types.js'
import { buildFindManyArgs } from '../find/buildFindManyArgs.js'
import { transform } from '../transform/read/index.js'

View File

@@ -1,6 +1,6 @@
/* eslint-disable no-param-reassign */
import type { ArrayRowToInsert } from '../transform/write/types.d.ts'
import type { DrizzleDB, PostgresAdapter } from '../types.d.ts'
import type { ArrayRowToInsert } from '../transform/write/types.js'
import type { DrizzleDB, PostgresAdapter } from '../types.js'
type Args = {
adapter: PostgresAdapter

View File

@@ -1,7 +1,7 @@
import type { SQL } from 'drizzle-orm'
import type { Field, PayloadRequest } from 'payload/types'
import type { DrizzleDB, GenericColumn, PostgresAdapter } from '../types.d.ts'
import type { DrizzleDB, GenericColumn, PostgresAdapter } from '../types.js'
type BaseArgs = {
adapter: PostgresAdapter

View File

@@ -1,6 +1,6 @@
import { sql } from 'drizzle-orm'
import type { PostgresAdapter } from '../types.d.ts'
import type { PostgresAdapter } from '../types.js'
export const createMigrationTable = async (adapter: PostgresAdapter): Promise<void> => {
const prependSchema = adapter.schemaName ? `"${adapter.schemaName}".` : ''

View File

@@ -1,6 +1,6 @@
import { sql } from 'drizzle-orm'
import type { DrizzleDB } from '../types.d.ts'
import type { DrizzleDB } from '../types.js'
export const migrationTableExists = async (db: DrizzleDB): Promise<boolean> => {
const queryRes = await db.execute(sql`SELECT to_regclass('public.payload_migrations');`)

View File

@@ -2,7 +2,7 @@ import { forgotPasswordOperation } from 'payload/operations'
import type { Collection } from 'payload/types'
import { isolateObjectProperty } from 'payload/utilities'
import type { Context } from '../types.d.ts'
import type { Context } from '../types.js'
function forgotPasswordResolver(collection: Collection): any {
async function resolver(_, args, context: Context) {

View File

@@ -1,6 +1,6 @@
import { initOperation } from 'payload/operations'
import { isolateObjectProperty } from 'payload/utilities'
import type { Context } from '../types.d.ts'
import type { Context } from '../types.js'
function initResolver(collection: string) {
async function resolver(_, args, context: Context) {

View File

@@ -3,7 +3,7 @@ import { generatePayloadCookie } from 'payload/auth'
import type { Collection } from 'payload/types'
import { isolateObjectProperty } from 'payload/utilities'
import type { Context } from '../types.d.ts'
import type { Context } from '../types.js'
function loginResolver(collection: Collection): any {
async function resolver(_, args, context: Context) {

View File

@@ -3,7 +3,7 @@ import { generateExpiredPayloadCookie } from 'payload/auth'
import type { Collection } from 'payload/types'
import { isolateObjectProperty } from 'payload/utilities'
import type { Context } from '../types.d.ts'
import type { Context } from '../types.js'
function logoutResolver(collection: Collection): any {
async function resolver(_, args, context: Context) {

View File

@@ -2,7 +2,7 @@ import { meOperation } from 'payload/operations'
import type { Collection } from 'payload/types'
import { isolateObjectProperty } from 'payload/utilities'
import type { Context } from '../types.d.ts'
import type { Context } from '../types.js'
function meResolver(collection: Collection): any {
async function resolver(_, args, context: Context) {

View File

@@ -3,7 +3,7 @@ import { generatePayloadCookie, extractJWT } from 'payload/auth'
import type { Collection } from 'payload/types'
import { isolateObjectProperty } from 'payload/utilities'
import type { Context } from '../types.d.ts'
import type { Context } from '../types.js'
function refreshResolver(collection: Collection): any {
async function resolver(_, args, context: Context) {

View File

@@ -3,7 +3,7 @@ import { generatePayloadCookie } from 'payload/auth'
import type { Collection } from 'payload/types'
import { isolateObjectProperty } from 'payload/utilities'
import type { Context } from '../types.d.ts'
import type { Context } from '../types.js'
function resetPasswordResolver(collection: Collection): any {
async function resolver(_, args, context: Context) {

View File

@@ -2,7 +2,7 @@ import { unlockOperation } from 'payload/operations'
import type { Collection } from 'payload/types'
import { isolateObjectProperty } from 'payload/utilities'
import type { Context } from '../types.d.ts'
import type { Context } from '../types.js'
function unlockResolver(collection: Collection) {
async function resolver(_, args, context: Context) {

View File

@@ -2,7 +2,7 @@ import { verifyEmailOperation } from 'payload/operations'
import type { Collection } from 'payload/types'
import { isolateObjectProperty } from 'payload/utilities'
import type { Context } from '../types.d.ts'
import type { Context } from '../types.js'
function verifyEmailResolver(collection: Collection) {
async function resolver(_, args, context: Context) {

View File

@@ -5,7 +5,7 @@ import type { PayloadRequest } from 'payload/types'
import type { Collection } from 'payload/types'
import { isolateObjectProperty } from 'payload/utilities'
import type { Context } from '../types.d.ts'
import type { Context } from '../types.js'
export type Resolver<TSlug extends keyof GeneratedTypes['collections']> = (
_: unknown,

View File

@@ -4,7 +4,7 @@ import type { PayloadRequest } from 'payload/types'
import type { Collection } from 'payload/types'
import { isolateObjectProperty } from 'payload/utilities'
import type { Context } from '../types.d.ts'
import type { Context } from '../types.js'
export type Resolver<TSlug extends keyof GeneratedTypes['collections']> = (
_: unknown,

View File

@@ -3,7 +3,7 @@ import type { Collection, PayloadRequest } from 'payload/types'
import type { CollectionPermission, GlobalPermission } from 'payload/auth'
import { isolateObjectProperty } from 'payload/utilities'
import type { Context } from '../types.d.ts'
import type { Context } from '../types.js'
export type Resolver = (
_: unknown,

View File

@@ -4,7 +4,7 @@ import type { PayloadRequest, Where } from 'payload/types'
import type { Collection } from 'payload/types'
import { isolateObjectProperty } from 'payload/utilities'
import type { Context } from '../types.d.ts'
import type { Context } from '../types.js'
export type Resolver = (
_: unknown,

View File

@@ -4,7 +4,7 @@ import type { PayloadRequest } from 'payload/types'
import type { Collection } from 'payload/types'
import { isolateObjectProperty } from 'payload/utilities'
import type { Context } from '../types.d.ts'
import type { Context } from '../types.js'
export type Resolver<T> = (
_: unknown,

View File

@@ -4,7 +4,7 @@ import type { TypeWithVersion } from 'payload/versions'
import type { Collection, TypeWithID } from 'payload/types'
import { isolateObjectProperty } from 'payload/utilities'
import type { Context } from '../types.d.ts'
import type { Context } from '../types.js'
export type Resolver<T extends TypeWithID = any> = (
_: unknown,

View File

@@ -4,7 +4,7 @@ import type { PaginatedDocs } from 'payload/database'
import type { Collection } from 'payload/types'
import { isolateObjectProperty } from 'payload/utilities'
import type { Context } from '../types.d.ts'
import type { Context } from '../types.js'
export type Resolver = (
_: unknown,

View File

@@ -3,7 +3,7 @@ import type { PayloadRequest } from 'payload/types'
import type { Collection } from 'payload/types'
import { isolateObjectProperty } from 'payload/utilities'
import type { Context } from '../types.d.ts'
import type { Context } from '../types.js'
export type Resolver = (
_: unknown,

View File

@@ -4,7 +4,7 @@ import type { PayloadRequest } from 'payload/types'
import type { Collection } from 'payload/types'
import { isolateObjectProperty } from 'payload/utilities'
import type { Context } from '../types.d.ts'
import type { Context } from '../types.js'
export type Resolver<TSlug extends keyof GeneratedTypes['collections']> = (
_: unknown,

View File

@@ -3,7 +3,7 @@ import type { PayloadRequest, SanitizedGlobalConfig } from 'payload/types'
import type { CollectionPermission, GlobalPermission } from 'payload/auth'
import { isolateObjectProperty } from 'payload/utilities'
import type { Context } from '../types.d.ts'
import type { Context } from '../types.js'
export type Resolver = (
_: unknown,

Some files were not shown because too many files have changed in this diff Show More