@nocobase/plugin-multi-portal 2.2.0-alpha.11 → 2.4.0-alpha.1

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.
Files changed (38) hide show
  1. package/README.md +14 -6
  2. package/dist/client-v2/354.87f18462949b5c23.js +10 -0
  3. package/dist/client-v2/499.245037eea4cc7266.js +10 -0
  4. package/dist/client-v2/556.443e73c9ca4c18b9.js +10 -0
  5. package/dist/client-v2/778.affaa69b23857ef2.js +10 -0
  6. package/dist/client-v2/993.7a1cc7aa6cec0160.js +10 -0
  7. package/dist/client-v2/PortalAccessBoundary.d.ts +49 -0
  8. package/dist/client-v2/RootLanding.d.ts +18 -0
  9. package/dist/client-v2/index.js +1 -1
  10. package/dist/client-v2/interceptor.d.ts +13 -0
  11. package/dist/client-v2/layoutRegistration.d.ts +5 -7
  12. package/dist/client-v2/models/MultiPortalLayoutModels.d.ts +14 -0
  13. package/dist/client-v2/models/MultiPortalMobilePageModels.d.ts +5 -11
  14. package/dist/client-v2/pages/MultiPortalsPage.d.ts +13 -6
  15. package/dist/client-v2/pages/PortalRoutesDrawer.d.ts +13 -0
  16. package/dist/client-v2/permissions/MultiPortalPermissionsTab.d.ts +1 -0
  17. package/dist/client-v2/portalAccess.d.ts +73 -0
  18. package/dist/client-v2/routeRepositoryScope.d.ts +5 -2
  19. package/dist/client-v2/routeUrl.d.ts +1 -0
  20. package/dist/constants.d.ts +19 -0
  21. package/dist/constants.js +76 -0
  22. package/dist/externalVersion.js +11 -9
  23. package/dist/locale/en-US.json +93 -11
  24. package/dist/locale/zh-CN.json +113 -31
  25. package/dist/node_modules/tar/package.json +1 -1
  26. package/dist/server/collections/desktopRoutes.js +1 -0
  27. package/dist/server/collections/multiPortals.js +12 -11
  28. package/dist/server/migrations/20260730120000-fix-fixed-layout-portal-type.d.ts +13 -0
  29. package/dist/server/migrations/20260730120000-fix-fixed-layout-portal-type.js +73 -0
  30. package/dist/server/plugin.d.ts +7 -5
  31. package/dist/server/plugin.js +1415 -502
  32. package/dist/swagger/index.d.ts +152 -0
  33. package/dist/swagger/index.js +142 -0
  34. package/package.json +6 -7
  35. package/dist/client-v2/354.ead3e96143164cd5.js +0 -10
  36. package/dist/client-v2/499.ef2ff0c022687485.js +0 -10
  37. package/dist/client-v2/778.23ba409a924ee34a.js +0 -10
  38. package/dist/client-v2/845.f2b0ce44ae4be707.js +0 -10
@@ -0,0 +1,73 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var fix_fixed_layout_portal_type_exports = {};
28
+ __export(fix_fixed_layout_portal_type_exports, {
29
+ default: () => fix_fixed_layout_portal_type_default
30
+ });
31
+ module.exports = __toCommonJS(fix_fixed_layout_portal_type_exports);
32
+ var import_server = require("@nocobase/server");
33
+ const FIXED_LAYOUT_PORTALS = [
34
+ {
35
+ uid: "__default_admin__",
36
+ portalType: "no-code",
37
+ portalName: "admin",
38
+ routePath: "/admin",
39
+ uiLayoutUid: "admin-layout-model"
40
+ },
41
+ {
42
+ uid: "__default_mobile__",
43
+ portalType: "no-code",
44
+ portalName: "mobile",
45
+ routePath: "/mobile",
46
+ uiLayoutUid: "mobile-layout-model"
47
+ }
48
+ ];
49
+ class fix_fixed_layout_portal_type_default extends import_server.Migration {
50
+ on = "afterLoad";
51
+ async up() {
52
+ const collection = this.db.getCollection("multiPortals");
53
+ if (!collection) {
54
+ return;
55
+ }
56
+ const repository = this.db.getRepository("multiPortals");
57
+ for (const portal of FIXED_LAYOUT_PORTALS) {
58
+ const existing = await repository.findOne({
59
+ filterByTk: portal.uid,
60
+ fields: ["uid", "portalType", "portalName", "routePath", "uiLayoutUid"]
61
+ });
62
+ if ((existing == null ? void 0 : existing.get("portalName")) !== portal.portalName || existing.get("routePath") !== portal.routePath || existing.get("uiLayoutUid") !== portal.uiLayoutUid || existing.get("portalType") === portal.portalType) {
63
+ continue;
64
+ }
65
+ await repository.update({
66
+ filterByTk: portal.uid,
67
+ values: {
68
+ portalType: portal.portalType
69
+ }
70
+ });
71
+ }
72
+ }
73
+ }
@@ -8,7 +8,8 @@
8
8
  */
9
9
  import { Plugin } from '@nocobase/server';
10
10
  import type { ResourcerContext } from '@nocobase/resourcer';
11
- import type { Transaction } from '@nocobase/database';
11
+ import { type Transaction } from '@nocobase/database';
12
+ import { type MultiPortalLayoutType } from '../constants';
12
13
  type DatabaseHookOptions = {
13
14
  transaction?: Transaction;
14
15
  context?: ResourcerContext;
@@ -19,18 +20,21 @@ type AppPortalManifestItem = {
19
20
  icon?: string | null;
20
21
  portalType?: string | null;
21
22
  routePath: string;
22
- layout: string | null;
23
+ layout: MultiPortalLayoutType;
23
24
  };
24
25
  export declare class PluginMultiPortalServer extends Plugin {
25
26
  private portalStorageTaskKeys;
26
27
  private portalStorageTasks;
28
+ private deprecatedInitPortalEnvWarningEmitted;
27
29
  afterAdd(): Promise<void>;
28
30
  private getAppName;
31
+ private getCurrentStorageAppName;
29
32
  private getMultiPortalStorageItem;
30
33
  private warnPortalStorageSyncFailed;
34
+ private logPortalBuildHtml;
31
35
  private getPortalStorageTaskKey;
32
36
  private runPortalStorageTask;
33
- private removePortalStorageDist;
37
+ private removePortalStorageIndexHtml;
34
38
  private waitForPortalStorageTasks;
35
39
  private schedulePortalTemplateCopyAndBuild;
36
40
  private ensurePortalStorageItem;
@@ -41,12 +45,10 @@ export declare class PluginMultiPortalServer extends Plugin {
41
45
  private pullPortalSource;
42
46
  private pushPortalSource;
43
47
  listAppPortalManifest(options?: DatabaseHookOptions): Promise<AppPortalManifestItem[]>;
44
- private getUiLayout;
45
48
  private toAppPortalManifestItem;
46
49
  private setAppManifestItem;
47
50
  private removeAppManifestItem;
48
51
  private publishAppManifestItem;
49
- private publishUiLayoutManifestItems;
50
52
  private reconcilePortalStorage;
51
53
  private reconcileAppManifest;
52
54
  private removeAppManifest;