@payloadcms/plugin-redirects 3.0.0-canary.ee0375f → 3.0.0-canary.ef0a8d0

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/exports/types.ts"],"sourcesContent":["export type { RedirectsPluginConfig } from '../types.js'\n"],"names":[],"rangeMappings":"","mappings":"AAAA,WAAwD"}
1
+ {"version":3,"sources":["../../src/exports/types.ts"],"sourcesContent":["export type { RedirectsPluginConfig } from '../types.js'\n"],"names":[],"mappings":"AAAA,WAAwD"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { CollectionConfig, Config, Field } from 'payload'\n\nimport type { RedirectsPluginConfig } from './types.js'\n\nexport const redirectsPlugin =\n (pluginConfig: RedirectsPluginConfig) =>\n (incomingConfig: Config): Config => {\n const defaultFields: Field[] = [\n {\n name: 'from',\n type: 'text',\n index: true,\n label: 'From URL',\n required: true,\n },\n {\n name: 'to',\n type: 'group',\n fields: [\n {\n name: 'type',\n type: 'radio',\n admin: {\n layout: 'horizontal',\n },\n defaultValue: 'reference',\n label: 'To URL Type',\n options: [\n {\n label: 'Internal link',\n value: 'reference',\n },\n {\n label: 'Custom URL',\n value: 'custom',\n },\n ],\n },\n {\n name: 'reference',\n type: 'relationship',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'reference',\n },\n label: 'Document to redirect to',\n relationTo: pluginConfig?.collections || [],\n required: true,\n },\n {\n name: 'url',\n type: 'text',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'custom',\n },\n label: 'Custom URL',\n required: true,\n },\n ],\n label: false,\n },\n ]\n\n const redirectsCollection: CollectionConfig = {\n ...(pluginConfig?.overrides || {}),\n slug: pluginConfig?.overrides?.slug || 'redirects',\n access: {\n read: () => true,\n ...(pluginConfig?.overrides?.access || {}),\n },\n admin: {\n defaultColumns: ['from', 'to.type', 'createdAt'],\n ...(pluginConfig?.overrides?.admin || {}),\n },\n fields:\n pluginConfig?.overrides?.fields && typeof pluginConfig?.overrides?.fields === 'function'\n ? pluginConfig?.overrides.fields({ defaultFields })\n : defaultFields,\n }\n\n return {\n ...incomingConfig,\n collections: [...(incomingConfig?.collections || []), redirectsCollection],\n }\n }\n"],"names":["redirectsPlugin","pluginConfig","incomingConfig","defaultFields","name","type","index","label","required","fields","admin","layout","defaultValue","options","value","condition","_","siblingData","relationTo","collections","redirectsCollection","overrides","slug","access","read","defaultColumns"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAIA,OAAO,MAAMA,kBACX,CAACC,eACD,CAACC;QACC,MAAMC,gBAAyB;YAC7B;gBACEC,MAAM;gBACNC,MAAM;gBACNC,OAAO;gBACPC,OAAO;gBACPC,UAAU;YACZ;YACA;gBACEJ,MAAM;gBACNC,MAAM;gBACNI,QAAQ;oBACN;wBACEL,MAAM;wBACNC,MAAM;wBACNK,OAAO;4BACLC,QAAQ;wBACV;wBACAC,cAAc;wBACdL,OAAO;wBACPM,SAAS;4BACP;gCACEN,OAAO;gCACPO,OAAO;4BACT;4BACA;gCACEP,OAAO;gCACPO,OAAO;4BACT;yBACD;oBACH;oBACA;wBACEV,MAAM;wBACNC,MAAM;wBACNK,OAAO;4BACLK,WAAW,CAACC,GAAGC,cAAgBA,aAAaZ,SAAS;wBACvD;wBACAE,OAAO;wBACPW,YAAYjB,cAAckB,eAAe,EAAE;wBAC3CX,UAAU;oBACZ;oBACA;wBACEJ,MAAM;wBACNC,MAAM;wBACNK,OAAO;4BACLK,WAAW,CAACC,GAAGC,cAAgBA,aAAaZ,SAAS;wBACvD;wBACAE,OAAO;wBACPC,UAAU;oBACZ;iBACD;gBACDD,OAAO;YACT;SACD;QAED,MAAMa,sBAAwC;YAC5C,GAAInB,cAAcoB,aAAa,CAAC,CAAC;YACjCC,MAAMrB,cAAcoB,WAAWC,QAAQ;YACvCC,QAAQ;gBACNC,MAAM,IAAM;gBACZ,GAAIvB,cAAcoB,WAAWE,UAAU,CAAC,CAAC;YAC3C;YACAb,OAAO;gBACLe,gBAAgB;oBAAC;oBAAQ;oBAAW;iBAAY;gBAChD,GAAIxB,cAAcoB,WAAWX,SAAS,CAAC,CAAC;YAC1C;YACAD,QACER,cAAcoB,WAAWZ,UAAU,OAAOR,cAAcoB,WAAWZ,WAAW,aAC1ER,cAAcoB,UAAUZ,OAAO;gBAAEN;YAAc,KAC/CA;QACR;QAEA,OAAO;YACL,GAAGD,cAAc;YACjBiB,aAAa;mBAAKjB,gBAAgBiB,eAAe,EAAE;gBAAGC;aAAoB;QAC5E;IACF,EAAC"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { CollectionConfig, Config, Field } from 'payload'\n\nimport type { RedirectsPluginConfig } from './types.js'\n\nexport const redirectsPlugin =\n (pluginConfig: RedirectsPluginConfig) =>\n (incomingConfig: Config): Config => {\n const defaultFields: Field[] = [\n {\n name: 'from',\n type: 'text',\n index: true,\n label: 'From URL',\n required: true,\n },\n {\n name: 'to',\n type: 'group',\n fields: [\n {\n name: 'type',\n type: 'radio',\n admin: {\n layout: 'horizontal',\n },\n defaultValue: 'reference',\n label: 'To URL Type',\n options: [\n {\n label: 'Internal link',\n value: 'reference',\n },\n {\n label: 'Custom URL',\n value: 'custom',\n },\n ],\n },\n {\n name: 'reference',\n type: 'relationship',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'reference',\n },\n label: 'Document to redirect to',\n relationTo: pluginConfig?.collections || [],\n required: true,\n },\n {\n name: 'url',\n type: 'text',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'custom',\n },\n label: 'Custom URL',\n required: true,\n },\n ],\n label: false,\n },\n ]\n\n const redirectsCollection: CollectionConfig = {\n ...(pluginConfig?.overrides || {}),\n slug: pluginConfig?.overrides?.slug || 'redirects',\n access: {\n read: () => true,\n ...(pluginConfig?.overrides?.access || {}),\n },\n admin: {\n defaultColumns: ['from', 'to.type', 'createdAt'],\n ...(pluginConfig?.overrides?.admin || {}),\n },\n fields:\n pluginConfig?.overrides?.fields && typeof pluginConfig?.overrides?.fields === 'function'\n ? pluginConfig?.overrides.fields({ defaultFields })\n : defaultFields,\n }\n\n return {\n ...incomingConfig,\n collections: [...(incomingConfig?.collections || []), redirectsCollection],\n }\n }\n"],"names":["redirectsPlugin","pluginConfig","incomingConfig","defaultFields","name","type","index","label","required","fields","admin","layout","defaultValue","options","value","condition","_","siblingData","relationTo","collections","redirectsCollection","overrides","slug","access","read","defaultColumns"],"mappings":"AAIA,OAAO,MAAMA,kBACX,CAACC,eACD,CAACC;QACC,MAAMC,gBAAyB;YAC7B;gBACEC,MAAM;gBACNC,MAAM;gBACNC,OAAO;gBACPC,OAAO;gBACPC,UAAU;YACZ;YACA;gBACEJ,MAAM;gBACNC,MAAM;gBACNI,QAAQ;oBACN;wBACEL,MAAM;wBACNC,MAAM;wBACNK,OAAO;4BACLC,QAAQ;wBACV;wBACAC,cAAc;wBACdL,OAAO;wBACPM,SAAS;4BACP;gCACEN,OAAO;gCACPO,OAAO;4BACT;4BACA;gCACEP,OAAO;gCACPO,OAAO;4BACT;yBACD;oBACH;oBACA;wBACEV,MAAM;wBACNC,MAAM;wBACNK,OAAO;4BACLK,WAAW,CAACC,GAAGC,cAAgBA,aAAaZ,SAAS;wBACvD;wBACAE,OAAO;wBACPW,YAAYjB,cAAckB,eAAe,EAAE;wBAC3CX,UAAU;oBACZ;oBACA;wBACEJ,MAAM;wBACNC,MAAM;wBACNK,OAAO;4BACLK,WAAW,CAACC,GAAGC,cAAgBA,aAAaZ,SAAS;wBACvD;wBACAE,OAAO;wBACPC,UAAU;oBACZ;iBACD;gBACDD,OAAO;YACT;SACD;QAED,MAAMa,sBAAwC;YAC5C,GAAInB,cAAcoB,aAAa,CAAC,CAAC;YACjCC,MAAMrB,cAAcoB,WAAWC,QAAQ;YACvCC,QAAQ;gBACNC,MAAM,IAAM;gBACZ,GAAIvB,cAAcoB,WAAWE,UAAU,CAAC,CAAC;YAC3C;YACAb,OAAO;gBACLe,gBAAgB;oBAAC;oBAAQ;oBAAW;iBAAY;gBAChD,GAAIxB,cAAcoB,WAAWX,SAAS,CAAC,CAAC;YAC1C;YACAD,QACER,cAAcoB,WAAWZ,UAAU,OAAOR,cAAcoB,WAAWZ,WAAW,aAC1ER,cAAcoB,UAAUZ,OAAO;gBAAEN;YAAc,KAC/CA;QACR;QAEA,OAAO;YACL,GAAGD,cAAc;YACjBiB,aAAa;mBAAKjB,gBAAgBiB,eAAe,EAAE;gBAAGC;aAAoB;QAC5E;IACF,EAAC"}
package/dist/types.d.ts CHANGED
@@ -4,8 +4,8 @@ export type FieldsOverride = (args: {
4
4
  }) => Field[];
5
5
  export type RedirectsPluginConfig = {
6
6
  collections?: string[];
7
- overrides?: Partial<Omit<CollectionConfig, 'fields'>> & {
8
- fields: FieldsOverride;
9
- };
7
+ overrides?: {
8
+ fields?: FieldsOverride;
9
+ } & Partial<Omit<CollectionConfig, 'fields'>>;
10
10
  };
11
11
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEtD,MAAM,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE;IAAE,aAAa,EAAE,KAAK,EAAE,CAAA;CAAE,KAAK,KAAK,EAAE,CAAA;AAE1E,MAAM,MAAM,qBAAqB,GAAG;IAClC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC,GAAG;QAAE,MAAM,EAAE,cAAc,CAAA;KAAE,CAAA;CACnF,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEtD,MAAM,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE;IAAE,aAAa,EAAE,KAAK,EAAE,CAAA;CAAE,KAAK,KAAK,EAAE,CAAA;AAE1E,MAAM,MAAM,qBAAqB,GAAG;IAClC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,SAAS,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,cAAc,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC,CAAA;CACpF,CAAA"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { CollectionConfig, Field } from 'payload'\n\nexport type FieldsOverride = (args: { defaultFields: Field[] }) => Field[]\n\nexport type RedirectsPluginConfig = {\n collections?: string[]\n overrides?: Partial<Omit<CollectionConfig, 'fields'>> & { fields: FieldsOverride }\n}\n"],"names":[],"rangeMappings":"","mappings":"AAIA,WAGC"}
1
+ {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { CollectionConfig, Field } from 'payload'\n\nexport type FieldsOverride = (args: { defaultFields: Field[] }) => Field[]\n\nexport type RedirectsPluginConfig = {\n collections?: string[]\n overrides?: { fields?: FieldsOverride } & Partial<Omit<CollectionConfig, 'fields'>>\n}\n"],"names":[],"mappings":"AAIA,WAGC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/plugin-redirects",
3
- "version": "3.0.0-canary.ee0375f",
3
+ "version": "3.0.0-canary.ef0a8d0",
4
4
  "description": "Redirects plugin for Payload",
5
5
  "keywords": [
6
6
  "payload",
@@ -40,18 +40,18 @@
40
40
  ],
41
41
  "devDependencies": {
42
42
  "@types/express": "^4.17.9",
43
- "@types/react": "npm:types-react@19.0.0-beta.2",
44
- "@types/react-dom": "npm:types-react-dom@19.0.0-beta.2",
45
- "@payloadcms/eslint-config": "1.1.1",
46
- "payload": "3.0.0-canary.ee0375f"
43
+ "@types/react": "npm:types-react@19.0.0-rc.0",
44
+ "@types/react-dom": "npm:types-react-dom@19.0.0-rc.0",
45
+ "payload": "3.0.0-canary.ef0a8d0",
46
+ "@payloadcms/eslint-config": "3.0.0-beta.59"
47
47
  },
48
48
  "peerDependencies": {
49
- "payload": "3.0.0-canary.ee0375f"
49
+ "payload": "3.0.0-canary.ef0a8d0"
50
50
  },
51
51
  "homepage:": "https://payloadcms.com",
52
52
  "overrides": {
53
- "@types/react": "npm:types-react@19.0.0-beta.2",
54
- "@types/react-dom": "npm:types-react-dom@19.0.0-beta.2"
53
+ "@types/react": "npm:types-react@19.0.0-rc.0",
54
+ "@types/react-dom": "npm:types-react-dom@19.0.0-rc.0"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "pnpm copyfiles && pnpm build:types && pnpm build:swc",