@payloadcms/plugin-redirects 3.0.0-alpha.63 → 3.0.0-alpha.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/index.ts +0 -82
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/plugin-redirects",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.64",
|
|
4
4
|
"homepage:": "https://payloadcms.com",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
"author": "dev@payloadcms.com",
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"payload": "3.0.0-alpha.
|
|
26
|
+
"payload": "3.0.0-alpha.64"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/express": "^4.17.9",
|
|
30
30
|
"@types/react": "18.2.74",
|
|
31
31
|
"react": "^18.0.0",
|
|
32
|
-
"
|
|
33
|
-
"
|
|
32
|
+
"@payloadcms/eslint-config": "1.1.1",
|
|
33
|
+
"payload": "3.0.0-alpha.64"
|
|
34
34
|
},
|
|
35
35
|
"exports": {
|
|
36
36
|
".": {
|
package/src/index.ts
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import type { Config } from 'payload/config'
|
|
2
|
-
|
|
3
|
-
import type { PluginConfig } from './types.js'
|
|
4
|
-
|
|
5
|
-
import deepMerge from './deepMerge.js'
|
|
6
|
-
|
|
7
|
-
const redirects =
|
|
8
|
-
(pluginConfig: PluginConfig) =>
|
|
9
|
-
(incomingConfig: Config): Config => ({
|
|
10
|
-
...incomingConfig,
|
|
11
|
-
collections: [
|
|
12
|
-
...(incomingConfig?.collections || []),
|
|
13
|
-
deepMerge(
|
|
14
|
-
{
|
|
15
|
-
slug: 'redirects',
|
|
16
|
-
access: {
|
|
17
|
-
read: (): boolean => true,
|
|
18
|
-
},
|
|
19
|
-
admin: {
|
|
20
|
-
defaultColumns: ['from', 'to.type', 'createdAt'],
|
|
21
|
-
},
|
|
22
|
-
fields: [
|
|
23
|
-
{
|
|
24
|
-
name: 'from',
|
|
25
|
-
type: 'text',
|
|
26
|
-
index: true,
|
|
27
|
-
label: 'From URL',
|
|
28
|
-
required: true,
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
name: 'to',
|
|
32
|
-
type: 'group',
|
|
33
|
-
fields: [
|
|
34
|
-
{
|
|
35
|
-
name: 'type',
|
|
36
|
-
type: 'radio',
|
|
37
|
-
admin: {
|
|
38
|
-
layout: 'horizontal',
|
|
39
|
-
},
|
|
40
|
-
defaultValue: 'reference',
|
|
41
|
-
label: 'To URL Type',
|
|
42
|
-
options: [
|
|
43
|
-
{
|
|
44
|
-
label: 'Internal link',
|
|
45
|
-
value: 'reference',
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
label: 'Custom URL',
|
|
49
|
-
value: 'custom',
|
|
50
|
-
},
|
|
51
|
-
],
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
name: 'reference',
|
|
55
|
-
type: 'relationship',
|
|
56
|
-
admin: {
|
|
57
|
-
condition: (_, siblingData) => siblingData?.type === 'reference',
|
|
58
|
-
},
|
|
59
|
-
label: 'Document to redirect to',
|
|
60
|
-
relationTo: pluginConfig?.collections || [],
|
|
61
|
-
required: true,
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
name: 'url',
|
|
65
|
-
type: 'text',
|
|
66
|
-
admin: {
|
|
67
|
-
condition: (_, siblingData) => siblingData?.type === 'custom',
|
|
68
|
-
},
|
|
69
|
-
label: 'Custom URL',
|
|
70
|
-
required: true,
|
|
71
|
-
},
|
|
72
|
-
],
|
|
73
|
-
label: false,
|
|
74
|
-
},
|
|
75
|
-
],
|
|
76
|
-
},
|
|
77
|
-
pluginConfig?.overrides || {},
|
|
78
|
-
),
|
|
79
|
-
],
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
export { redirects }
|