@payloadcms/plugin-multi-tenant 4.0.0-beta.7 → 4.0.0-beta.8

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.
@@ -4,9 +4,9 @@ type Args = {
4
4
  collectionSlug: CollectionSlug;
5
5
  docID?: number | string;
6
6
  globalSlugs: string[];
7
- tenantArrayFieldName: string;
8
- tenantArrayTenantFieldName: string;
9
7
  tenantFieldName: string;
8
+ tenantsArrayFieldName: string;
9
+ tenantsArrayTenantFieldName: string;
10
10
  tenantsCollectionSlug: string;
11
11
  useAsTitle: string;
12
12
  userHasAccessToAllTenants: Required<MultiTenantPluginConfig>['userHasAccessToAllTenants'];
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/GlobalViewRedirect/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAErE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AAI7D,KAAK,IAAI,GAAG;IACV,cAAc,EAAE,cAAc,CAAA;IAC9B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,oBAAoB,EAAE,MAAM,CAAA;IAC5B,0BAA0B,EAAE,MAAM,CAAA;IAClC,eAAe,EAAE,MAAM,CAAA;IACvB,qBAAqB,EAAE,MAAM,CAAA;IAC7B,UAAU,EAAE,MAAM,CAAA;IAClB,yBAAyB,EAAE,QAAQ,CAAC,uBAAuB,CAAC,CAAC,2BAA2B,CAAC,CAAA;IACzF,QAAQ,EAAE,SAAS,CAAA;CACpB,GAAG,WAAW,CAAA;AAEf,eAAO,MAAM,kBAAkB,SAAgB,IAAI,kBA6BlD,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/GlobalViewRedirect/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAErE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AAI7D,KAAK,IAAI,GAAG;IACV,cAAc,EAAE,cAAc,CAAA;IAC9B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,eAAe,EAAE,MAAM,CAAA;IACvB,qBAAqB,EAAE,MAAM,CAAA;IAC7B,2BAA2B,EAAE,MAAM,CAAA;IACnC,qBAAqB,EAAE,MAAM,CAAA;IAC7B,UAAU,EAAE,MAAM,CAAA;IAClB,yBAAyB,EAAE,QAAQ,CAAC,uBAAuB,CAAC,CAAC,2BAA2B,CAAC,CAAA;IACzF,QAAQ,EAAE,SAAS,CAAA;CACpB,GAAG,WAAW,CAAA;AAEf,eAAO,MAAM,kBAAkB,SAAgB,IAAI,kBA6BlD,CAAA"}
@@ -13,8 +13,8 @@ export const GlobalViewRedirect = async (args)=>{
13
13
  payload: args.payload,
14
14
  server: args.server,
15
15
  tenantFieldName: args.tenantFieldName,
16
- tenantsArrayFieldName: args.tenantArrayFieldName,
17
- tenantsArrayTenantFieldName: args.tenantArrayTenantFieldName,
16
+ tenantsArrayFieldName: args.tenantsArrayFieldName,
17
+ tenantsArrayTenantFieldName: args.tenantsArrayTenantFieldName,
18
18
  tenantsCollectionSlug: args.tenantsCollectionSlug,
19
19
  useAsTitle: args.useAsTitle,
20
20
  user: args.user,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/GlobalViewRedirect/index.ts"],"sourcesContent":["import type { CollectionSlug, ServerProps, ViewTypes } from 'payload'\n\nimport type { MultiTenantPluginConfig } from '../../types.js'\n\nimport { getGlobalViewRedirect } from '../../utilities/getGlobalViewRedirect.js'\n\ntype Args = {\n collectionSlug: CollectionSlug\n docID?: number | string\n globalSlugs: string[]\n tenantArrayFieldName: string\n tenantArrayTenantFieldName: string\n tenantFieldName: string\n tenantsCollectionSlug: string\n useAsTitle: string\n userHasAccessToAllTenants: Required<MultiTenantPluginConfig>['userHasAccessToAllTenants']\n viewType: ViewTypes\n} & ServerProps\n\nexport const GlobalViewRedirect = async (args: Args) => {\n const collectionSlug = args?.collectionSlug\n if (collectionSlug && args.globalSlugs?.includes(collectionSlug)) {\n if (!args.server) {\n throw new Error(\n 'GlobalViewRedirect requires `server` in ServerProps. Ensure your framework adapter (e.g. @payloadcms/next) populates ServerProps.server.',\n )\n }\n const headers = await args.server.getHeaders()\n const redirectRoute = await getGlobalViewRedirect({\n slug: collectionSlug,\n docID: args.docID,\n headers,\n payload: args.payload,\n server: args.server,\n tenantFieldName: args.tenantFieldName,\n tenantsArrayFieldName: args.tenantArrayFieldName,\n tenantsArrayTenantFieldName: args.tenantArrayTenantFieldName,\n tenantsCollectionSlug: args.tenantsCollectionSlug,\n useAsTitle: args.useAsTitle,\n user: args.user,\n userHasAccessToAllTenants: args.userHasAccessToAllTenants,\n view: args.viewType,\n })\n\n if (redirectRoute) {\n args.server.redirect(redirectRoute)\n }\n }\n}\n"],"names":["getGlobalViewRedirect","GlobalViewRedirect","args","collectionSlug","globalSlugs","includes","server","Error","headers","getHeaders","redirectRoute","slug","docID","payload","tenantFieldName","tenantsArrayFieldName","tenantArrayFieldName","tenantsArrayTenantFieldName","tenantArrayTenantFieldName","tenantsCollectionSlug","useAsTitle","user","userHasAccessToAllTenants","view","viewType","redirect"],"mappings":"AAIA,SAASA,qBAAqB,QAAQ,2CAA0C;AAehF,OAAO,MAAMC,qBAAqB,OAAOC;IACvC,MAAMC,iBAAiBD,MAAMC;IAC7B,IAAIA,kBAAkBD,KAAKE,WAAW,EAAEC,SAASF,iBAAiB;QAChE,IAAI,CAACD,KAAKI,MAAM,EAAE;YAChB,MAAM,IAAIC,MACR;QAEJ;QACA,MAAMC,UAAU,MAAMN,KAAKI,MAAM,CAACG,UAAU;QAC5C,MAAMC,gBAAgB,MAAMV,sBAAsB;YAChDW,MAAMR;YACNS,OAAOV,KAAKU,KAAK;YACjBJ;YACAK,SAASX,KAAKW,OAAO;YACrBP,QAAQJ,KAAKI,MAAM;YACnBQ,iBAAiBZ,KAAKY,eAAe;YACrCC,uBAAuBb,KAAKc,oBAAoB;YAChDC,6BAA6Bf,KAAKgB,0BAA0B;YAC5DC,uBAAuBjB,KAAKiB,qBAAqB;YACjDC,YAAYlB,KAAKkB,UAAU;YAC3BC,MAAMnB,KAAKmB,IAAI;YACfC,2BAA2BpB,KAAKoB,yBAAyB;YACzDC,MAAMrB,KAAKsB,QAAQ;QACrB;QAEA,IAAId,eAAe;YACjBR,KAAKI,MAAM,CAACmB,QAAQ,CAACf;QACvB;IACF;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../src/components/GlobalViewRedirect/index.ts"],"sourcesContent":["import type { CollectionSlug, ServerProps, ViewTypes } from 'payload'\n\nimport type { MultiTenantPluginConfig } from '../../types.js'\n\nimport { getGlobalViewRedirect } from '../../utilities/getGlobalViewRedirect.js'\n\ntype Args = {\n collectionSlug: CollectionSlug\n docID?: number | string\n globalSlugs: string[]\n tenantFieldName: string\n tenantsArrayFieldName: string\n tenantsArrayTenantFieldName: string\n tenantsCollectionSlug: string\n useAsTitle: string\n userHasAccessToAllTenants: Required<MultiTenantPluginConfig>['userHasAccessToAllTenants']\n viewType: ViewTypes\n} & ServerProps\n\nexport const GlobalViewRedirect = async (args: Args) => {\n const collectionSlug = args?.collectionSlug\n if (collectionSlug && args.globalSlugs?.includes(collectionSlug)) {\n if (!args.server) {\n throw new Error(\n 'GlobalViewRedirect requires `server` in ServerProps. Ensure your framework adapter (e.g. @payloadcms/next) populates ServerProps.server.',\n )\n }\n const headers = await args.server.getHeaders()\n const redirectRoute = await getGlobalViewRedirect({\n slug: collectionSlug,\n docID: args.docID,\n headers,\n payload: args.payload,\n server: args.server,\n tenantFieldName: args.tenantFieldName,\n tenantsArrayFieldName: args.tenantsArrayFieldName,\n tenantsArrayTenantFieldName: args.tenantsArrayTenantFieldName,\n tenantsCollectionSlug: args.tenantsCollectionSlug,\n useAsTitle: args.useAsTitle,\n user: args.user,\n userHasAccessToAllTenants: args.userHasAccessToAllTenants,\n view: args.viewType,\n })\n\n if (redirectRoute) {\n args.server.redirect(redirectRoute)\n }\n }\n}\n"],"names":["getGlobalViewRedirect","GlobalViewRedirect","args","collectionSlug","globalSlugs","includes","server","Error","headers","getHeaders","redirectRoute","slug","docID","payload","tenantFieldName","tenantsArrayFieldName","tenantsArrayTenantFieldName","tenantsCollectionSlug","useAsTitle","user","userHasAccessToAllTenants","view","viewType","redirect"],"mappings":"AAIA,SAASA,qBAAqB,QAAQ,2CAA0C;AAehF,OAAO,MAAMC,qBAAqB,OAAOC;IACvC,MAAMC,iBAAiBD,MAAMC;IAC7B,IAAIA,kBAAkBD,KAAKE,WAAW,EAAEC,SAASF,iBAAiB;QAChE,IAAI,CAACD,KAAKI,MAAM,EAAE;YAChB,MAAM,IAAIC,MACR;QAEJ;QACA,MAAMC,UAAU,MAAMN,KAAKI,MAAM,CAACG,UAAU;QAC5C,MAAMC,gBAAgB,MAAMV,sBAAsB;YAChDW,MAAMR;YACNS,OAAOV,KAAKU,KAAK;YACjBJ;YACAK,SAASX,KAAKW,OAAO;YACrBP,QAAQJ,KAAKI,MAAM;YACnBQ,iBAAiBZ,KAAKY,eAAe;YACrCC,uBAAuBb,KAAKa,qBAAqB;YACjDC,6BAA6Bd,KAAKc,2BAA2B;YAC7DC,uBAAuBf,KAAKe,qBAAqB;YACjDC,YAAYhB,KAAKgB,UAAU;YAC3BC,MAAMjB,KAAKiB,IAAI;YACfC,2BAA2BlB,KAAKkB,yBAAyB;YACzDC,MAAMnB,KAAKoB,QAAQ;QACrB;QAEA,IAAIZ,eAAe;YACjBR,KAAKI,MAAM,CAACiB,QAAQ,CAACb;QACvB;IACF;AACF,EAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/plugin-multi-tenant",
3
- "version": "4.0.0-beta.7",
3
+ "version": "4.0.0-beta.8",
4
4
  "description": "Multi Tenant plugin for Payload",
5
5
  "keywords": [
6
6
  "cms",
@@ -79,13 +79,13 @@
79
79
  }
80
80
  },
81
81
  "devDependencies": {
82
- "@payloadcms/translations": "4.0.0-beta.7",
83
- "@payloadcms/ui": "4.0.0-beta.7",
84
- "payload": "4.0.0-beta.7"
82
+ "@payloadcms/translations": "4.0.0-beta.8",
83
+ "@payloadcms/ui": "4.0.0-beta.8",
84
+ "payload": "4.0.0-beta.8"
85
85
  },
86
86
  "peerDependencies": {
87
- "@payloadcms/ui": "4.0.0-beta.7",
88
- "payload": "4.0.0-beta.7"
87
+ "@payloadcms/ui": "4.0.0-beta.8",
88
+ "payload": "4.0.0-beta.8"
89
89
  },
90
90
  "homepage:": "https://payloadcms.com",
91
91
  "scripts": {