@nocobase/plugin-multi-app-manager 1.0.0-alpha.2 → 1.0.0-alpha.3

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,2 +1,10 @@
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
+ */
1
9
  import React from 'react';
2
10
  export declare const AppManager: () => React.JSX.Element;
@@ -1,2 +1,10 @@
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
+ */
1
9
  import React from 'react';
2
10
  export declare const AppNameInput: React.ForwardRefExoticComponent<Omit<Partial<import("antd").InputProps & React.RefAttributes<import("antd").InputRef>>, "ref"> & React.RefAttributes<unknown>>;
@@ -1,2 +1,10 @@
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
+ */
1
9
  import React from 'react';
2
10
  export declare const MultiAppManagerProvider: (props: any) => React.JSX.Element;
@@ -1,3 +1,11 @@
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
+ */
1
9
  export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
10
  button: {
3
11
  color: string;
@@ -1,2 +1,10 @@
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
+ */
1
9
  import React from 'react';
2
10
  export declare const Settings: () => React.JSX.Element;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { Plugin } from '@nocobase/client';
2
10
  export declare class PluginMultiAppManagerClient extends Plugin {
3
11
  load(): Promise<void>;
@@ -1 +1,10 @@
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
+
1
10
  (function(o,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("@nocobase/client"),require("react/jsx-runtime"),require("antd"),require("react-router-dom"),require("@formily/react"),require("antd-style"),require("react-i18next"),require("@formily/shared"),require("react")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","react/jsx-runtime","antd","react-router-dom","@formily/react","antd-style","react-i18next","@formily/shared","react"],e):(o=typeof globalThis!="undefined"?globalThis:o||self,e(o["@nocobase/plugin-multi-app-manager"]={},o["@nocobase/client"],o.jsxRuntime,o.antd,o["react-router-dom"],o["@formily/react"],o["antd-style"],o["react-i18next"],o["@formily/shared"],o.react))})(this,function(o,e,n,p,m,d,y,s,i,l){"use strict";var E=Object.defineProperty,z=Object.defineProperties;var B=Object.getOwnPropertyDescriptors;var M=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable;var F=(o,e,n)=>e in o?E(o,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[e]=n,x=(o,e)=>{for(var n in e||(e={}))K.call(e,n)&&F(o,n,e[n]);if(M)for(var n of M(e))L.call(e,n)&&F(o,n,e[n]);return o},g=(o,e)=>z(o,B(e));var v=(o,e,n)=>new Promise((p,m)=>{var d=i=>{try{s(n.next(i))}catch(l){m(l)}},y=i=>{try{s(n.throw(i))}catch(l){m(l)}},s=i=>i.done?p(i.value):Promise.resolve(i.value).then(d,y);s((n=n.apply(o,e)).next())});const T=t=>{const r=e.useApp(),u=t.value&&n.jsx("a",{target:"_blank",href:r.getRouteUrl(`/apps/${t.value}/admin`),rel:"noreferrer",children:t.value});return n.jsxs("div",{style:t.style,children:[t.addonBefore,t.prefix,u,t.suffix,t.addonAfter]})},k=d.connect(p.Input,d.mapReadPretty(T)),q=y.createStyles(({token:t})=>({button:{color:t.colorTextHeaderMenu+" !important"}})),b=()=>{const{t}=s.useTranslation("multi-app-manager");return{t}},c=t=>`{{t("${t}", { ns: 'multi-app-manager' })}}`,I=()=>{const{styles:t}=q(),{data:r,run:u}=e.useRequest({resource:"applications",action:"listPinned"},{manual:!0}),{t:f}=b(),P=e.useApp(),j=[...((r==null?void 0:r.data)||[]).map(a=>{let w=P.getRouteUrl(`/apps/${a.name}/admin/`);return a.cname&&(w=`//${a.cname}`),{key:a.name,label:n.jsx("a",{href:w,target:"_blank",rel:"noopener noreferrer",children:a.displayName||a.name})}}),{key:".manager",label:n.jsx(m.Link,{to:P.pluginSettingsManager.getRoutePath("multi-app-manager"),children:f("Manage applications")})}];return n.jsx(p.Dropdown,{onOpenChange:a=>{u()},menu:{items:j},children:n.jsx(p.Button,{className:t.button,title:"Apps",icon:n.jsx(e.Icon,{type:"AppstoreOutlined"})})})},N=t=>n.jsx(e.PinnedPluginListProvider,{items:{am:{order:201,component:"MultiAppManager",pin:!0}},children:n.jsx(e.SchemaComponentOptions,{components:{MultiAppManager:I,AppNameInput:k},children:t.children})}),h={name:"applications",targetKey:"name",fields:[{type:"uid",name:"name",primaryKey:!0,prefix:"a",interface:"input",uiSchema:{type:"string",title:c("App ID"),required:!0,"x-component":"Input","x-validator":"uid"}},{type:"string",name:"displayName",interface:"input",uiSchema:{type:"string",title:c("App display name"),required:!0,"x-component":"Input"}},{type:"string",name:"pinned",interface:"checkbox",uiSchema:{type:"boolean","x-content":c("Pin to menu"),"x-component":"Checkbox"}},{type:"string",name:"status",interface:"radioGroup",defaultValue:"pending",uiSchema:{type:"string",title:c("App status"),enum:[{label:"Initializing",value:"initializing"},{label:"Initialized",value:"initialized"},{label:"Running",value:"running"},{label:"Commanding",value:"commanding"},{label:"Stopped",value:"stopped"},{label:"Error",value:"error"},{label:"Not found",value:"not_found"}],"x-component":"Radio.Group"}}]},O=()=>{const{state:t,setState:r,refresh:u}=e.useResourceActionContext(),{resource:f}=e.useResourceContext();return{run(){return v(this,null,function*(){yield f.destroy({filterByTk:(t==null?void 0:t.selectedRowKeys)||[]}),r==null||r({selectedRowKeys:[]}),u()})}}},A={type:"void","x-component":"div",properties:{displayName:{"x-component":"CollectionField","x-decorator":"FormItem"},name:{"x-component":"CollectionField","x-decorator":"FormItem","x-disabled":"{{ !createOnly }}"},"options.autoStart":{title:e.tval("Start mode",{ns:"@nocobase/plugin-multi-app-manager"}),"x-component":"Radio.Group","x-decorator":"FormItem",default:!1,enum:[{label:e.tval("Start on first visit",{ns:"@nocobase/plugin-multi-app-manager"}),value:!1},{label:e.tval("Start with main application",{ns:"@nocobase/plugin-multi-app-manager"}),value:!0}]},cname:{title:c("Custom domain"),"x-component":"Input","x-decorator":"FormItem"},pinned:{"x-component":"CollectionField","x-decorator":"FormItem"}}},C={properties:{view:{type:"void","x-component":"AppVisitor","x-component-props":{}},update:{type:"void",title:'{{t("Edit")}}',"x-component":"Action.Link","x-component-props":{},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues:"{{ cm.useValuesFromRecord }}"},title:'{{t("Edit")}}',properties:{formSchema:A,footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useUpdateAction }}"}}}}}}}},delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action.Link","x-component-props":{confirm:{title:"{{t('Delete')}}",content:"{{t('Are you sure you want to delete it?')}}"},useAction:"{{cm.useDestroyAction}}"}}}},R={type:"object",properties:{[i.uid()]:{type:"void","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:h,resourceName:"applications",request:{resource:"applications",action:"list",params:{pageSize:50,sort:["-createdAt"],appends:[]}}},"x-component":"CollectionProvider_deprecated","x-component-props":{collection:h},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action","x-component-props":{icon:"DeleteOutlined",useAction:O,confirm:{title:"{{t('Delete')}}",content:"{{t('Are you sure you want to delete it?')}}"}}},create:{type:"void",title:'{{t("Add new")}}',"x-decorator":t=>l.createElement(e.SchemaComponentOptions,g(x({},t),{scope:{createOnly:!0}})),"x-component":"Action","x-component-props":{type:"primary",icon:"PlusOutlined"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues(t){const r=e.useActionContext();return e.useRequest(()=>Promise.resolve({data:{name:`a_${i.uid()}`}}),g(x({},t),{refreshDeps:[r.visible]}))}},title:'{{t("Add new")}}',properties:{formSchema:A,footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useCreateAction }}"}}}}}}}}}},table:{type:"void","x-uid":"input","x-component":"Table.Void","x-component-props":{rowKey:"name",rowSelection:{type:"checkbox"},useDataSource:"{{ cm.useDataSourceFromRAC }}"},properties:{displayName:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{displayName:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},name:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{name:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},pinned:{type:"void",title:c("Pin to menu"),"x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{pinned:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},status:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{status:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{t("Actions")}}',"x-component":"Table.Column",properties:{actions:x({type:"void","x-component":"Space","x-component-props":{split:"|"}},C)}}}}}}}},V=()=>{const t=e.useRecord(),r=e.useApp();return t.cname?`//${t.cname}`:r.getRouteUrl(`/apps/${t.name}/admin/`)},_=()=>{const{t}=b(),r=V();return n.jsx("a",{href:r,target:"_blank",rel:"noreferrer",children:t("View",{ns:"client"})})},$=()=>n.jsx(p.Card,{bordered:!1,children:n.jsx(e.SchemaComponent,{schema:R,components:{AppVisitor:_}})}),S="multi-app-manager";class D extends e.Plugin{load(){return v(this,null,function*(){this.app.use(N),this.app.pluginSettingsManager.add(S,{title:`{{t("Multi-app manager", { ns: "${S}" })}}`,icon:"AppstoreOutlined",Component:$,aclSnippet:"pm.multi-app-manager.applications"})})}}o.PluginMultiAppManagerClient=D,o.default=D,o.formSchema=A,o.tableActionColumnSchema=C,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { ISchema } from '@formily/react';
2
10
  export declare const useDestroy: () => {
3
11
  run(): Promise<void>;
@@ -1,3 +1,11 @@
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
+ */
1
9
  export declare const usePluginUtils: () => {
2
10
  t: import("react-i18next").TFunction<"multi-app-manager", undefined>;
3
11
  };
@@ -1,16 +1,25 @@
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
+
1
10
  module.exports = {
2
- "@nocobase/client": "1.0.0-alpha.2",
11
+ "@nocobase/client": "1.0.0-alpha.3",
3
12
  "antd": "5.12.8",
4
13
  "react": "18.2.0",
5
14
  "@formily/react": "2.3.0",
6
15
  "antd-style": "3.6.1",
7
16
  "react-router-dom": "6.21.0",
8
17
  "react-i18next": "11.18.6",
9
- "@nocobase/database": "1.0.0-alpha.2",
10
- "@nocobase/server": "1.0.0-alpha.2",
18
+ "@nocobase/database": "1.0.0-alpha.3",
19
+ "@nocobase/server": "1.0.0-alpha.3",
11
20
  "lodash": "4.17.21",
12
21
  "mysql2": "2.3.3",
13
22
  "pg": "8.11.3",
14
- "@nocobase/utils": "1.0.0-alpha.2",
23
+ "@nocobase/utils": "1.0.0-alpha.3",
15
24
  "@formily/shared": "2.3.0"
16
25
  };
package/dist/index.d.ts CHANGED
@@ -1,2 +1,10 @@
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
+ */
1
9
  export * from './server';
2
10
  export { default } from './server';
package/dist/index.js CHANGED
@@ -1,3 +1,12 @@
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
+
1
10
  var __create = Object.create;
2
11
  var __defProp = Object.defineProperty;
3
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1 +1,9 @@
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
+ */
1
9
  export declare const NAMESPACE = "multi-app-manager";
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1 +1 @@
1
- {"name":"mariadb","version":"2.5.6","description":"fast mariadb/mysql connector.","main":"promise.js","types":"types/index.d.ts","directories":{"lib":"lib","test":"test"},"private":false,"scripts":{"test":"npm run test:types-prettier && npm run test:prettier && npm run test:types && npm run test:lint && npm run test:base","test:base":"mocha --no-parallel --timeout 5000 \"test/**/*.js\" ","test:lint":"eslint \"{lib,test}/**/*.js\" ","test:types":"eslint \"types/*.ts\" ","test:types-prettier":"prettier --write \"types/*.ts\"","test:prettier":"prettier --write \"{tools,lib,test,benchmarks}/**/*.js\"","coverage":"npm run coverage:test && npm run coverage:report","coverage:test":"nyc mocha --no-parallel --timeout 5000 \"test/**/*.js\"","coverage:report":"nyc report --reporter=text-lcov > coverage.lcov && codecov","benchmark":"node ./benchmarks/benchmarks.js","generate":"node ./tools/generate-mariadb.js"},"repository":{"type":"git","url":"git+https://github.com/mariadb-corporation/mariadb-connector-nodejs.git"},"keywords":["mariadb","mysql","client","driver","connector"],"files":["lib","types/index.d.ts","promise.js","callback.js"],"engines":{"node":">= 10.13"},"author":"Diego Dupin <diego.dupin@mariadb.com>","license":"LGPL-2.1-or-later","dependencies":{"@types/geojson":"^7946.0.8","@types/node":"^17.0.10","denque":"^2.0.1","iconv-lite":"^0.6.3","long":"^5.2.0","moment-timezone":"^0.5.34","please-upgrade-node":"^3.2.0"},"devDependencies":{"@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","benchmark":"^2.1.4","chai":"^4.3.4","codecov":"^3.8.2","chalk":"^4.1.2","dom-parser":"^0.1.6","error-stack-parser":"^2.0.6","eslint":"^8.7.0","eslint-config-prettier":"^8.3.0","eslint-plugin-markdown":"^2.2.1","eslint-plugin-prettier":"^4.0.0","mocha":"^9.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^15.1.0","prettier":"^2.5.1","typescript":"^4.5.5"},"bugs":{"url":"https://jira.mariadb.org/projects/CONJS/"},"homepage":"https://github.com/mariadb-corporation/mariadb-connector-nodejs#readme","_lastModified":"2024-04-29T05:09:59.376Z"}
1
+ {"name":"mariadb","version":"2.5.6","description":"fast mariadb/mysql connector.","main":"promise.js","types":"types/index.d.ts","directories":{"lib":"lib","test":"test"},"private":false,"scripts":{"test":"npm run test:types-prettier && npm run test:prettier && npm run test:types && npm run test:lint && npm run test:base","test:base":"mocha --no-parallel --timeout 5000 \"test/**/*.js\" ","test:lint":"eslint \"{lib,test}/**/*.js\" ","test:types":"eslint \"types/*.ts\" ","test:types-prettier":"prettier --write \"types/*.ts\"","test:prettier":"prettier --write \"{tools,lib,test,benchmarks}/**/*.js\"","coverage":"npm run coverage:test && npm run coverage:report","coverage:test":"nyc mocha --no-parallel --timeout 5000 \"test/**/*.js\"","coverage:report":"nyc report --reporter=text-lcov > coverage.lcov && codecov","benchmark":"node ./benchmarks/benchmarks.js","generate":"node ./tools/generate-mariadb.js"},"repository":{"type":"git","url":"git+https://github.com/mariadb-corporation/mariadb-connector-nodejs.git"},"keywords":["mariadb","mysql","client","driver","connector"],"files":["lib","types/index.d.ts","promise.js","callback.js"],"engines":{"node":">= 10.13"},"author":"Diego Dupin <diego.dupin@mariadb.com>","license":"LGPL-2.1-or-later","dependencies":{"@types/geojson":"^7946.0.8","@types/node":"^17.0.10","denque":"^2.0.1","iconv-lite":"^0.6.3","long":"^5.2.0","moment-timezone":"^0.5.34","please-upgrade-node":"^3.2.0"},"devDependencies":{"@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","benchmark":"^2.1.4","chai":"^4.3.4","codecov":"^3.8.2","chalk":"^4.1.2","dom-parser":"^0.1.6","error-stack-parser":"^2.0.6","eslint":"^8.7.0","eslint-config-prettier":"^8.3.0","eslint-plugin-markdown":"^2.2.1","eslint-plugin-prettier":"^4.0.0","mocha":"^9.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^15.1.0","prettier":"^2.5.1","typescript":"^4.5.5"},"bugs":{"url":"https://jira.mariadb.org/projects/CONJS/"},"homepage":"https://github.com/mariadb-corporation/mariadb-connector-nodejs#readme","_lastModified":"2024-04-30T08:29:25.828Z"}
@@ -1,2 +1,10 @@
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
+ */
1
9
  declare const _default: import("@nocobase/database").CollectionOptions;
2
10
  export default _default;
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { ApplicationModel, registerAppOptions } from './models/application';
2
10
  export { PluginMultiAppManagerServer as default } from './server';
3
11
  export { ApplicationModel, registerAppOptions };
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { Model, Transactionable } from '@nocobase/database';
2
10
  import { Application } from '@nocobase/server';
3
11
  import { AppOptionsFactory } from '../server';
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { IDatabaseOptions, Transactionable } from '@nocobase/database';
2
10
  import Application, { Plugin } from '@nocobase/server';
3
11
  export type AppDbCreator = (app: Application, options?: Transactionable & {
@@ -1,3 +1,12 @@
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
+
1
10
  var __create = Object.create;
2
11
  var __defProp = Object.defineProperty;
3
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -54,10 +63,8 @@ const defaultSubAppUpgradeHandle = async (mainApp) => {
54
63
  const subApp = await appSupervisor.getApp(instance.name, {
55
64
  upgrading: true
56
65
  });
57
- console.log({ beforeSubAppStatus });
58
66
  try {
59
67
  mainApp.setMaintainingMessage(`upgrading sub app ${instance.name}...`);
60
- console.log(`${instance.name}: upgrading...`);
61
68
  await subApp.runAsCLI(["upgrade"], { from: "user" });
62
69
  if (!beforeSubAppStatus && import_server.AppSupervisor.getInstance().getAppStatus(instance.name) === "initialized") {
63
70
  await import_server.AppSupervisor.getInstance().removeApp(instance.name);
@@ -183,7 +190,8 @@ class PluginMultiAppManagerServer extends import_server.Plugin {
183
190
  if (appSupervisor.hasApp(name)) {
184
191
  return;
185
192
  }
186
- const applicationRecord = await self.app.db.getRepository("applications").findOne({
193
+ const mainApp = await appSupervisor.getApp("main");
194
+ const applicationRecord = await mainApp.db.getRepository("applications").findOne({
187
195
  filter: {
188
196
  name
189
197
  }
@@ -198,14 +206,14 @@ class PluginMultiAppManagerServer extends import_server.Plugin {
198
206
  if (!applicationRecord) {
199
207
  return;
200
208
  }
201
- const subApp = applicationRecord.registerToSupervisor(self.app, {
209
+ const subApp = applicationRecord.registerToSupervisor(mainApp, {
202
210
  appOptionsFactory: self.appOptionsFactory
203
211
  });
204
212
  if (!loadButNotStart) {
205
213
  await subApp.runCommand("start", "--quickstart");
206
214
  }
207
215
  }
208
- import_server.AppSupervisor.getInstance().setAppBootstrapper(LazyLoadApplication);
216
+ import_server.AppSupervisor.getInstance().setAppBootstrapper(LazyLoadApplication.bind(this));
209
217
  import_server.Gateway.getInstance().addAppSelectorMiddleware(async (ctx, next) => {
210
218
  const { req } = ctx;
211
219
  if (!ctx.resolvedAppName && req.headers["x-hostname"]) {
@@ -1,3 +1,11 @@
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
+ */
1
9
  declare const _default: {
2
10
  info: {
3
11
  title: string;
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "displayName.zh-CN": "多应用管理器",
5
5
  "description": "Dynamically create multiple apps without separate deployments.",
6
6
  "description.zh-CN": "无需单独部署即可动态创建多个应用。",
7
- "version": "1.0.0-alpha.2",
7
+ "version": "1.0.0-alpha.3",
8
8
  "license": "AGPL-3.0",
9
9
  "main": "./dist/server/index.js",
10
10
  "homepage": "https://docs.nocobase.com/handbook/multi-app-manager",
@@ -28,7 +28,7 @@
28
28
  "@nocobase/test": "1.x",
29
29
  "@nocobase/utils": "1.x"
30
30
  },
31
- "gitHead": "f89dbc9e67d58404a2e484a5e124f739f340dcf8",
31
+ "gitHead": "7ccb137c7616cba5d238f87368239640e1d9ace1",
32
32
  "keywords": [
33
33
  "system"
34
34
  ]