Compare commits

..

73 Commits

Author SHA1 Message Date
Dan Ribbens
7d0c72f92e chore(release): v3.0.0-alpha.34 [skip ci] 2024-03-07 21:56:31 -05:00
Dan Ribbens
27e0e12595 chore: fix type payload-cloud builds 2024-03-07 21:48:14 -05:00
Dan Ribbens
f6ae6b3658 Merge branch 'feat/next-poc' of github.com:payloadcms/payload into feat/next-poc 2024-03-07 21:46:10 -05:00
James
9e1d633244 chore: fix graphql json import 2024-03-07 21:42:24 -05:00
Dan Ribbens
dfd3a06600 chore(release): v3.0.0-alpha.33 [skip ci] 2024-03-07 18:54:35 -05:00
Alessio Gravili
2c35a6f0e1 Merge remote-tracking branch 'origin/feat/next-poc' into feat/next-poc 2024-03-07 18:48:14 -05:00
Alessio Gravili
f956558656 fix(richtext-lexical): error when loading lexical without custom config (so it uses the defaultSanitizedServerEditorConfig), due to error in the cloneDeep function which clones react components. Now, it doesn't clone them anymore. 2024-03-07 18:48:07 -05:00
Dan Ribbens
32fa7006ff chore(release): v3.0.0-alpha.32 [skip ci] 2024-03-07 18:37:20 -05:00
James
95acf71dbf chore: bumps next peer deps 2024-03-07 17:43:02 -05:00
James
5640c27cec chore: bumps bin to cjs 2024-03-07 17:37:18 -05:00
Alessio Gravili
a7c5e4f317 Merge remote-tracking branch 'origin/feat/next-poc' into feat/next-poc 2024-03-07 16:41:26 -05:00
Alessio Gravili
274682e736 chore(eslint-config-payload): disable no-restricted-exports rule for payload config files 2024-03-07 16:41:19 -05:00
Jarrod Flesch
b4b6ab2667 chore: fix version restoration 2024-03-07 16:37:16 -05:00
Jarrod Flesch
bbe9dd6760 chore: adds more translations 2024-03-07 16:37:16 -05:00
Alessio Gravili
2aa7adb3bd chore: get old ts-node scripts to work, replace ts-node with tsx, fix runE2E.ts 2024-03-07 16:35:44 -05:00
James
fb7e671c26 chore: begins work to get playwright working with esm 2024-03-07 16:26:46 -05:00
Alessio Gravili
7420dba0c9 chore: upgrade testing libraries, remove express devDependency 2024-03-07 16:21:14 -05:00
Alessio Gravili
9a059bdce4 chore: undo weird as any removal 2024-03-07 16:11:25 -05:00
Alessio Gravili
50c7269315 chore: replace .d.ts type imports with .js imports, as .d.ts imports break usage checks in the IDE 2024-03-07 16:08:49 -05:00
Alessio Gravili
b4434a369b chore: improve clean commands 2024-03-07 15:49:33 -05:00
Jarrod Flesch
1c945ebfbf chore: add missing translation 2024-03-07 15:45:48 -05:00
Jarrod Flesch
20d0915a03 chore: adjust rest endpoints to use new query property on req 2024-03-07 15:45:48 -05:00
James
21ee94739b chore: jest esm compat 2024-03-07 15:40:39 -05:00
Alessio Gravili
9ebb894694 chore: replace probe-image-size with image-size to reduce bundle size 2024-03-07 15:38:06 -05:00
Alessio Gravili
483db08057 chore: upgrade turborepo to 1.12.5 2024-03-07 15:11:27 -05:00
Jacob Fletcher
3a557998d0 fix(next): completely opts out of router cache 2024-03-07 15:08:54 -05:00
Alessio Gravili
c8322349a0 fix(richtext-lexical): Blocks: generated output schema is not fully correct (#5259) 2024-03-07 15:08:30 -05:00
Jacob Fletcher
75b993bc6b fix(next): account view isEditing prop 2024-03-07 14:17:24 -05:00
Jacob Fletcher
b9db83a741 fix(next): threads isEditing through document info context 2024-03-07 14:01:06 -05:00
Jarrod Flesch
5bbb65b569 chore: fixes DiffMethod imports 2024-03-07 13:55:47 -05:00
Jacob Fletcher
974eedc4dd fix(next): reports globals to events provider 2024-03-07 13:48:36 -05:00
Jacob Fletcher
c38c95dab5 fix(next): adds optional chaining for globals in getDataAndFile 2024-03-07 13:36:50 -05:00
Jacob Fletcher
c3a3446baa fix(next): global api url 2024-03-07 13:36:50 -05:00
Fabian Aggeler
443413c03e fix(richtext-lexical): Link: add open-in-new-tab to html converter 2024-03-07 13:33:31 -05:00
Dan Ribbens
0c56f420d5 chore(ecommerce-template): fix duplicate cart update calls (#5228) 2024-03-07 13:33:10 -05:00
Ed
f66bcb22c4 chore(next): updated auth API status codes for improved error handling (#5254) 2024-03-07 13:28:41 -05:00
James
b44d59a303 chore: adds script to analyze bundle 2024-03-07 13:01:53 -05:00
Jacob Fletcher
dbe382f91e fix(ui): document info types 2024-03-07 12:59:07 -05:00
Jacob Fletcher
1d4ec9cd71 chore(next): moves document info provider from root to page 2024-03-07 12:54:49 -05:00
Alessio Gravili
36f88b198c fix(ui): ID field Cell component not being displayed 2024-03-07 12:27:43 -05:00
James
e2ca80a33f chore: fixes usage of NextLink in nav 2024-03-07 12:12:21 -05:00
James
c08f981224 chore: simplifies logs 2024-03-07 12:10:11 -05:00
Dan Ribbens
846f59974c chore(release): v3.0.0-alpha.31 [skip ci] 2024-03-07 12:06:51 -05:00
Jarrod Flesch
5e368f486a chore: esm fixes in _community test dir 2024-03-07 12:03:02 -05:00
Jarrod Flesch
42eed07dfd chore: moves file handler into catch all GET rest handler 2024-03-07 12:02:44 -05:00
Dan Ribbens
fcd647832c chore(release): v3.0.0-alpha.30 [skip ci] 2024-03-07 11:43:53 -05:00
Dan Ribbens
06d30f0182 chore: dependency file lock 2024-03-07 11:36:13 -05:00
James
c6c5b2e682 chore: safely uses deepMerge 2024-03-07 11:33:46 -05:00
James
5431a84f37 chore: safely accesses more dependencies 2024-03-07 11:04:27 -05:00
Jacob Fletcher
764c6f0086 chore(ui): react-animate-height esm imports 2024-03-07 10:55:26 -05:00
Jarrod Flesch
7f48c5c0e5 chore: fixes esm next/link imports 2024-03-07 10:54:36 -05:00
James
bd66cda0ee chore: safely accesses bson-objectid within both ts and webpack 2024-03-07 10:54:27 -05:00
James
030ddbe12f chore: move to lexical for local testing 2024-03-07 10:37:48 -05:00
James
60e3b21596 chore: builds 2024-03-07 10:23:12 -05:00
James
647e0236bb chore: removes unused dependencies 2024-03-07 10:12:38 -05:00
James
83c0b8b96e chore: removes webpack build script from next package 2024-03-07 10:11:30 -05:00
James
4d2f1ca10e chore: fixes esm dependency imports 2024-03-07 10:10:44 -05:00
Jarrod Flesch
678a617b0b chore: esm fixes for GenerateViewMetadata 2024-03-07 10:07:12 -05:00
Jacob Fletcher
b88d78a7e5 chore(next): more esm imports 2024-03-07 10:03:18 -05:00
Jarrod Flesch
3d4092ee3e chore: esm createFirstUser 2024-03-07 10:00:28 -05:00
Kendell Joseph
0306a79a37 chore: updates imports for ESM 2024-03-07 09:56:19 -05:00
PatrikKozak
539503f766 chore: converts more files in ui package to esm 2024-03-07 09:55:51 -05:00
Jarrod Flesch
e06022e4d4 chore: partial esm conversion of next package 2024-03-07 09:54:18 -05:00
James
afb93eda2c chore: restores submit 2024-03-07 09:54:11 -05:00
James
6d2f5fcb60 chore: converts some files to esm 2024-03-07 09:54:11 -05:00
Alessio Gravili
1fb37aec25 providers 2024-03-07 09:53:34 -05:00
Alessio Gravili
5174662fe8 providers up to Locale 2024-03-07 09:46:53 -05:00
Alessio Gravili
e47bafce29 ui/src/elements -> H through S, ui/src/utilities 2024-03-07 09:43:17 -05:00
Jacob Fletcher
7cf68a4b68 chore(next): esm imports 2024-03-07 09:29:16 -05:00
James
694d5d92b7 chore: begins next / ui esm transform 2024-03-07 09:03:08 -05:00
Jacob Fletcher
83d9d98ba3 fix(next): clears document info id when creating new 2024-03-06 23:12:02 -05:00
Jacob Fletcher
cf3d0fe78d fix(next): redirect after create 2024-03-06 22:36:57 -05:00
Jacob Fletcher
56aaf52430 fix(next): field read permissions 2024-03-06 22:15:21 -05:00
875 changed files with 4003 additions and 5228 deletions

View File

@@ -1,6 +0,0 @@
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
/* DO NOT MODIFY it because it could be re-written at any time. */
import config from '@payload-config'
import { GET_STATIC_FILE } from '@payloadcms/next/routes/index.js'
export const GET = GET_STATIC_FILE(config)

View File

@@ -6,11 +6,13 @@
// })
const customJestConfig = {
extensionsToTreatAsEsm: ['.ts', '.tsx'],
globalSetup: './test/jest.setup.ts',
moduleNameMapper: {
'\\.(css|scss)$': '<rootDir>/packages/payload/src/bundlers/mocks/emptyModule.js',
'\\.(css|scss)$': '<rootDir>/test/helpers/mocks/emptyModule.js',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/packages/payload/src/bundlers/mocks/fileMock.js',
'<rootDir>/test/helpers/mocks/fileMock.js',
'^(\\.{1,2}/.*)\\.js$': '$1',
},
testEnvironment: 'node',
testMatch: ['<rootDir>/packages/payload/src/**/*.spec.ts', '<rootDir>/test/**/*int.spec.ts'],

View File

@@ -1,6 +1,6 @@
{
"name": "payload-monorepo",
"version": "3.0.0-alpha.29",
"version": "3.0.0-alpha.34",
"private": true,
"type": "module",
"workspaces:": [
@@ -12,6 +12,7 @@
"build:core": "turbo build --filter \"!@payloadcms/plugin-*\"",
"build:plugins": "turbo build --filter \"@payloadcms/plugin-*\" --filter \"!@payloadcms/plugin-search\" --filter \"!@payloadcms/plugin-redirects\" --filter \"!@payloadcms/plugin-nested-docs\"",
"build:app": "next build",
"build:app:analyze": "cross-env ANALYZE=true next build",
"build:create-payload-app": "turbo build --filter create-payload-app",
"build:db-mongodb": "turbo build --filter db-mongodb",
"build:db-postgres": "turbo build --filter db-postgres",
@@ -36,10 +37,11 @@
"build:ui": "turbo build --filter ui",
"clean": "turbo clean",
"clean:cache": "rimraf node_modules/.cache && rimraf packages/payload/node_modules/.cache && rimraf .next",
"clean:all": "find . \\( -type d \\( -name node_modules -o -name dist -o -name .cache \\) -o -type f -name tsconfig.tsbuildinfo \\) -exec rm -rf {} +",
"clean:build": "find . \\( -type d \\( -name dist -o -name .cache -o -name .next -o -name .turbo \\) -o -type f -name tsconfig.tsbuildinfo \\) -not -path '*/node_modules/*' -exec rm -rf {} +",
"clean:all": "find . \\( -type d \\( -name node_modules -o -name dist -o -name .cache -o -name .next -o -name .turbo \\) -o -type f -name tsconfig.tsbuildinfo \\) -exec rm -rf {} +",
"dev": "cross-env node --no-deprecation ./test/dev.js",
"dev:generate-graphql-schema": "NODE_OPTIONS=--no-deprecation ts-node -T ./test/generateGraphQLSchema.ts",
"dev:generate-types": "NODE_OPTIONS=--no-deprecation ts-node -T ./test/generateTypes.ts",
"dev:generate-graphql-schema": "NODE_OPTIONS=--no-deprecation tsx ./test/generateGraphQLSchema.ts",
"dev:generate-types": "NODE_OPTIONS=--no-deprecation tsx ./test/generateTypes.ts",
"dev:postgres": "pnpm --filter payload run dev:postgres",
"docker:restart": "pnpm docker:stop --remove-orphans && pnpm docker:start",
"docker:start": "docker-compose -f packages/plugin-cloud-storage/docker-compose.yml up -d",
@@ -55,7 +57,7 @@
"release:beta": "tsx ./scripts/release.ts --bump prerelease --tag beta",
"test": "pnpm test:int && pnpm test:components && pnpm test:e2e",
"test:components": "cross-env NODE_OPTIONS=--no-deprecation jest --config=jest.components.config.js",
"test:e2e": "NODE_OPTIONS=--no-deprecation npx playwright install --with-deps chromium && NODE_OPTIONS=--no-deprecation ts-node -T ./test/runE2E.ts",
"test:e2e": "NODE_OPTIONS=--no-deprecation npx playwright install --with-deps chromium && NODE_OPTIONS=--no-deprecation tsx ./test/runE2E.ts",
"test:e2e:debug": "cross-env NODE_OPTIONS=--no-deprecation PWDEBUG=1 DISABLE_LOGGING=true playwright test",
"test:e2e:headed": "cross-env NODE_OPTIONS=--no-deprecation DISABLE_LOGGING=true playwright test --headed",
"test:int:postgres": "cross-env NODE_OPTIONS=--no-deprecation PAYLOAD_DATABASE=postgres DISABLE_LOGGING=true jest --forceExit --detectOpenHandles",
@@ -67,19 +69,19 @@
"@next/bundle-analyzer": "^14.1.0",
"@octokit/core": "^5.1.0",
"@payloadcms/eslint-config": "workspace:*",
"@playwright/test": "1.40.1",
"@playwright/test": "1.42.1",
"@swc/cli": "^0.1.62",
"@swc/jest": "0.2.29",
"@swc/jest": "0.2.36",
"@swc/register": "0.1.10",
"@testing-library/jest-dom": "5.17.0",
"@testing-library/react": "13.4.0",
"@testing-library/jest-dom": "6.4.2",
"@testing-library/react": "14.2.1",
"@types/concat-stream": "^2.0.1",
"@types/conventional-changelog": "^3.1.4",
"@types/conventional-changelog-core": "^4.2.5",
"@types/conventional-changelog-preset-loader": "^2.3.4",
"@types/conventional-changelog-writer": "^4.0.10",
"@types/fs-extra": "^11.0.2",
"@types/jest": "29.5.7",
"@types/jest": "29.5.12",
"@types/minimist": "1.2.2",
"@types/node": "20.5.7",
"@types/prompts": "^2.4.5",
@@ -87,7 +89,6 @@
"@types/react": "18.2.15",
"@types/semver": "^7.5.3",
"@types/shelljs": "0.8.12",
"@types/testing-library__jest-dom": "5.14.8",
"add-stream": "^1.0.0",
"chalk": "^4.1.2",
"comment-json": "^4.2.3",
@@ -102,7 +103,6 @@
"dotenv": "8.6.0",
"drizzle-orm": "0.29.4",
"execa": "5.1.1",
"express": "4.18.2",
"form-data": "3.0.1",
"fs-extra": "10.1.0",
"get-port": "5.1.1",
@@ -136,9 +136,8 @@
"slash": "3.0.0",
"slate": "0.91.4",
"tempfile": "^3.0.0",
"ts-node": "10.9.2",
"tsx": "^4.7.1",
"turbo": "^1.12.4",
"turbo": "^1.12.5",
"typescript": "5.2.2",
"uuid": "^9.0.1",
"yocto-queue": "^1.0.0"
@@ -169,7 +168,6 @@
"graphql": "^16.8.1",
"react": "$react",
"react-dom": "$react-dom",
"ts-node": "$ts-node",
"typescript": "$typescript"
},
"allowedDeprecatedVersions": {

View File

@@ -1,6 +1,6 @@
{
"name": "@payloadcms/db-mongodb",
"version": "3.0.0-alpha.29",
"version": "3.0.0-alpha.34",
"description": "The officially supported MongoDB database adapter for Payload - Update 2",
"repository": "https://github.com/payloadcms/payload",
"license": "MIT",

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,
@@ -23,7 +23,6 @@ export const connect: Connect = async function connect(
}
const urlToConnect = this.url
const successfulConnectionMessage = 'Connected to MongoDB server successfully!'
const connectionOptions: ConnectOptions & { useFacet: undefined } = {
autoIndex: true,
@@ -49,8 +48,6 @@ export const connect: Connect = async function connect(
await mongoose.connection.dropDatabase()
this.payload.logger.info('---- DROPPED DATABASE ----')
}
this.payload.logger.info(successfulConnectionMessage)
}
} catch (err) {
this.payload.logger.error(`Error: cannot connect to MongoDB. Details: ${err.message}`, err)

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 = {

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

@@ -3,6 +3,7 @@ import type { CreateMigration } from 'payload/database'
import fs from 'fs'
import path from 'path'
import { fileURLToPath } from 'url'
const migrationTemplate = (upSQL?: string, downSQL?: string) => `import {
MigrateUpArgs,
@@ -23,6 +24,9 @@ export const createMigration: CreateMigration = async function createMigration({
migrationName,
payload,
}) {
const filename = fileURLToPath(import.meta.url)
const dirname = path.dirname(filename)
const dir = payload.db.migrationDir
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir)
@@ -37,7 +41,7 @@ export const createMigration: CreateMigration = async function createMigration({
const predefinedMigrationName = file.replace('@payloadcms/db-mongodb/', '')
migrationName = predefinedMigrationName
const cleanPath = path.join(__dirname, `../predefinedMigrations/${predefinedMigrationName}.js`)
const cleanPath = path.join(dirname, `../predefinedMigrations/${predefinedMigrationName}.js`)
// Check if predefined migration exists
if (fs.existsSync(cleanPath)) {

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

@@ -3,17 +3,20 @@ import type { PathToQuery } from 'payload/database'
import type { Field } from 'payload/types'
import type { Operator } from 'payload/types'
import ObjectId from 'bson-objectid'
import ObjectIdImport from 'bson-objectid'
import mongoose from 'mongoose'
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'
const ObjectId = (ObjectIdImport.default ||
ObjectIdImport) as unknown as typeof ObjectIdImport.default
type SearchParam = {
path?: string
rawQuery?: unknown
@@ -205,7 +208,7 @@ export async function buildSearchParam({
if (typeof formattedValue === 'string') {
if (mongoose.Types.ObjectId.isValid(formattedValue)) {
result.value.$or.push({
[path]: { [operatorKey]: new ObjectId.default(formattedValue) },
[path]: { [operatorKey]: new ObjectId(formattedValue) },
})
} else {
;(Array.isArray(field.relationTo) ? field.relationTo : [field.relationTo]).forEach(

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

@@ -1,6 +1,6 @@
{
"name": "@payloadcms/db-postgres",
"version": "3.0.0-alpha.29",
"version": "3.0.0-alpha.34",
"description": "The officially supported Postgres database adapter for Payload",
"repository": "https://github.com/payloadcms/payload",
"license": "MIT",

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,
@@ -93,7 +93,7 @@ export const connect: Connect = async function connect(
)
return
const { pushSchema } = require('drizzle-kit/payload')
const { pushSchema } = await import('drizzle-kit/payload')
// This will prompt if clarifications are needed for Drizzle to push new schema
const { apply, hasDataLoss, statementsToExecute, warnings } = await pushSchema(

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,
@@ -60,7 +60,7 @@ export const createMigration: CreateMigration = async function createMigration(
fs.mkdirSync(dir)
}
const { generateDrizzleJson, generateMigration } = require('drizzle-kit/payload')
const { generateDrizzleJson, generateMigration } = await import('drizzle-kit/payload')
const [yyymmdd, hhmmss] = new Date().toISOString().split('T')
const formattedDate = yyymmdd.replace(/\D/g, '')

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,11 +6,11 @@ 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'
export const init: Init = async function init(this: PostgresAdapter) {
export const init: Init = function init(this: PostgresAdapter) {
if (this.schemaName) {
this.pgSchema = pgSchema(this.schemaName)
} else {

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'
@@ -82,7 +82,7 @@ export async function migrate(this: PostgresAdapter): Promise<void> {
}
async function runMigrationFile(payload: Payload, migration: Migration, batch: number) {
const { generateDrizzleJson } = require('drizzle-kit/payload')
const { generateDrizzleJson } = await import('drizzle-kit/payload')
const start = Date.now()
const req = { payload } as PayloadRequest

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

@@ -30,6 +30,18 @@ module.exports = {
files: ['*.js', '*.cjs'],
extends: ['plugin:@typescript-eslint/disable-type-checked'],
},
{
files: ['*.config.ts'],
rules: {
'no-restricted-exports': 'off',
},
},
{
files: ['config.ts'],
rules: {
'no-restricted-exports': 'off',
},
},
],
rules: {
'@typescript-eslint/ban-ts-comment': 'off',

View File

@@ -1,6 +1,6 @@
{
"name": "@payloadcms/graphql",
"version": "3.0.0-alpha.29",
"version": "3.0.0-alpha.34",
"main": "./src/index.ts",
"types": "./src/index.d.ts",
"type": "module",

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,

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