@nocobase/plugin-multi-app-manager 2.1.0-alpha.1 → 2.1.0-beta.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.
- package/dist/client/{db3a142b120d6553.js → 00b71fff3c8c7167.js} +1 -1
- package/dist/client/Migrate.d.ts +10 -0
- package/dist/client/index.js +1 -1
- package/dist/externalVersion.js +7 -7
- package/dist/locale/en-US.json +3 -2
- package/dist/locale/zh-CN.json +3 -2
- package/dist/node_modules/p-queue/dist/index.d.ts +101 -0
- package/dist/node_modules/p-queue/dist/index.js +1 -0
- package/dist/node_modules/p-queue/dist/lower-bound.d.ts +1 -0
- package/dist/node_modules/p-queue/dist/lower-bound.js +21 -0
- package/dist/node_modules/p-queue/dist/options.d.ts +64 -0
- package/dist/node_modules/p-queue/dist/options.js +2 -0
- package/dist/node_modules/p-queue/dist/priority-queue.d.ts +12 -0
- package/dist/node_modules/p-queue/dist/priority-queue.js +32 -0
- package/dist/node_modules/p-queue/dist/queue.d.ts +7 -0
- package/dist/node_modules/p-queue/dist/queue.js +2 -0
- package/dist/node_modules/p-queue/license +9 -0
- package/dist/node_modules/p-queue/node_modules/eventemitter3/index.d.ts +134 -0
- package/dist/node_modules/p-queue/node_modules/eventemitter3/index.js +336 -0
- package/dist/node_modules/p-queue/node_modules/eventemitter3/package.json +56 -0
- package/dist/node_modules/p-queue/node_modules/eventemitter3/umd/eventemitter3.js +340 -0
- package/dist/node_modules/p-queue/node_modules/eventemitter3/umd/eventemitter3.min.js +1 -0
- package/dist/node_modules/p-queue/package.json +1 -0
- package/dist/server/adapters/legacy-adapter.d.ts +43 -0
- package/dist/server/adapters/legacy-adapter.js +207 -0
- package/dist/server/server.d.ts +4 -6
- package/dist/server/server.js +38 -191
- package/package.json +2 -2
- package/dist/node_modules/mariadb/LICENSE +0 -502
- package/dist/node_modules/mariadb/callback.js +0 -41
- package/dist/node_modules/mariadb/lib/cmd/batch-bulk.js +0 -278
- package/dist/node_modules/mariadb/lib/cmd/batch-rewrite.js +0 -372
- package/dist/node_modules/mariadb/lib/cmd/change-user.js +0 -149
- package/dist/node_modules/mariadb/lib/cmd/class/ok-packet.js +0 -17
- package/dist/node_modules/mariadb/lib/cmd/column-definition.js +0 -102
- package/dist/node_modules/mariadb/lib/cmd/command.js +0 -168
- package/dist/node_modules/mariadb/lib/cmd/common-binary-cmd.js +0 -327
- package/dist/node_modules/mariadb/lib/cmd/common-text-cmd.js +0 -427
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/caching-sha2-password-auth.js +0 -168
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/clear-password-auth.js +0 -23
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/ed25519-password-auth.js +0 -761
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/native-password-auth.js +0 -55
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/pam-password-auth.js +0 -58
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/plugin-auth.js +0 -19
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/sha256-password-auth.js +0 -142
- package/dist/node_modules/mariadb/lib/cmd/handshake/client-capabilities.js +0 -74
- package/dist/node_modules/mariadb/lib/cmd/handshake/client-handshake-response.js +0 -126
- package/dist/node_modules/mariadb/lib/cmd/handshake/handshake.js +0 -292
- package/dist/node_modules/mariadb/lib/cmd/handshake/initial-handshake.js +0 -74
- package/dist/node_modules/mariadb/lib/cmd/handshake/ssl-request.js +0 -29
- package/dist/node_modules/mariadb/lib/cmd/ping.js +0 -52
- package/dist/node_modules/mariadb/lib/cmd/query.js +0 -255
- package/dist/node_modules/mariadb/lib/cmd/quit.js +0 -28
- package/dist/node_modules/mariadb/lib/cmd/reset.js +0 -54
- package/dist/node_modules/mariadb/lib/cmd/resultset.js +0 -607
- package/dist/node_modules/mariadb/lib/cmd/stream.js +0 -45
- package/dist/node_modules/mariadb/lib/config/connection-options.js +0 -258
- package/dist/node_modules/mariadb/lib/config/pool-cluster-options.js +0 -19
- package/dist/node_modules/mariadb/lib/config/pool-options.js +0 -47
- package/dist/node_modules/mariadb/lib/connection-callback.js +0 -160
- package/dist/node_modules/mariadb/lib/connection.js +0 -1460
- package/dist/node_modules/mariadb/lib/const/capabilities.js +0 -64
- package/dist/node_modules/mariadb/lib/const/collations.js +0 -473
- package/dist/node_modules/mariadb/lib/const/connection_status.js +0 -13
- package/dist/node_modules/mariadb/lib/const/error-code.js +0 -1282
- package/dist/node_modules/mariadb/lib/const/field-detail.js +0 -35
- package/dist/node_modules/mariadb/lib/const/field-type.js +0 -71
- package/dist/node_modules/mariadb/lib/const/server-status.js +0 -30
- package/dist/node_modules/mariadb/lib/const/state-change.js +0 -12
- package/dist/node_modules/mariadb/lib/filtered-pool-cluster.js +0 -81
- package/dist/node_modules/mariadb/lib/io/bulk-packet.js +0 -590
- package/dist/node_modules/mariadb/lib/io/compression-input-stream.js +0 -141
- package/dist/node_modules/mariadb/lib/io/compression-output-stream.js +0 -171
- package/dist/node_modules/mariadb/lib/io/packet-input-stream.js +0 -193
- package/dist/node_modules/mariadb/lib/io/packet-node-encoded.js +0 -36
- package/dist/node_modules/mariadb/lib/io/packet-node-iconv.js +0 -37
- package/dist/node_modules/mariadb/lib/io/packet-output-stream.js +0 -502
- package/dist/node_modules/mariadb/lib/io/packet.js +0 -515
- package/dist/node_modules/mariadb/lib/io/rewrite-packet.js +0 -481
- package/dist/node_modules/mariadb/lib/misc/connection-information.js +0 -96
- package/dist/node_modules/mariadb/lib/misc/errors.js +0 -123
- package/dist/node_modules/mariadb/lib/misc/parse.js +0 -1033
- package/dist/node_modules/mariadb/lib/misc/utils.js +0 -298
- package/dist/node_modules/mariadb/lib/pool-base.js +0 -611
- package/dist/node_modules/mariadb/lib/pool-callback.js +0 -202
- package/dist/node_modules/mariadb/lib/pool-cluster-callback.js +0 -66
- package/dist/node_modules/mariadb/lib/pool-cluster.js +0 -407
- package/dist/node_modules/mariadb/lib/pool-promise.js +0 -108
- package/dist/node_modules/mariadb/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/dist/node_modules/mariadb/node_modules/@types/node/assert.d.ts +0 -912
- package/dist/node_modules/mariadb/node_modules/@types/node/async_hooks.d.ts +0 -501
- package/dist/node_modules/mariadb/node_modules/@types/node/buffer.d.ts +0 -2232
- package/dist/node_modules/mariadb/node_modules/@types/node/child_process.d.ts +0 -1366
- package/dist/node_modules/mariadb/node_modules/@types/node/cluster.d.ts +0 -414
- package/dist/node_modules/mariadb/node_modules/@types/node/console.d.ts +0 -412
- package/dist/node_modules/mariadb/node_modules/@types/node/constants.d.ts +0 -18
- package/dist/node_modules/mariadb/node_modules/@types/node/crypto.d.ts +0 -3338
- package/dist/node_modules/mariadb/node_modules/@types/node/dgram.d.ts +0 -545
- package/dist/node_modules/mariadb/node_modules/@types/node/diagnostics_channel.d.ts +0 -152
- package/dist/node_modules/mariadb/node_modules/@types/node/dns/promises.d.ts +0 -370
- package/dist/node_modules/mariadb/node_modules/@types/node/dns.d.ts +0 -659
- package/dist/node_modules/mariadb/node_modules/@types/node/domain.d.ts +0 -169
- package/dist/node_modules/mariadb/node_modules/@types/node/events.d.ts +0 -651
- package/dist/node_modules/mariadb/node_modules/@types/node/fs/promises.d.ts +0 -1091
- package/dist/node_modules/mariadb/node_modules/@types/node/fs.d.ts +0 -3869
- package/dist/node_modules/mariadb/node_modules/@types/node/globals.d.ts +0 -294
- package/dist/node_modules/mariadb/node_modules/@types/node/globals.global.d.ts +0 -1
- package/dist/node_modules/mariadb/node_modules/@types/node/http.d.ts +0 -1396
- package/dist/node_modules/mariadb/node_modules/@types/node/http2.d.ts +0 -2101
- package/dist/node_modules/mariadb/node_modules/@types/node/https.d.ts +0 -391
- package/dist/node_modules/mariadb/node_modules/@types/node/index.d.ts +0 -129
- package/dist/node_modules/mariadb/node_modules/@types/node/inspector.d.ts +0 -2744
- package/dist/node_modules/mariadb/node_modules/@types/node/module.d.ts +0 -114
- package/dist/node_modules/mariadb/node_modules/@types/node/net.d.ts +0 -791
- package/dist/node_modules/mariadb/node_modules/@types/node/os.d.ts +0 -455
- package/dist/node_modules/mariadb/node_modules/@types/node/package.json +0 -220
- package/dist/node_modules/mariadb/node_modules/@types/node/path.d.ts +0 -180
- package/dist/node_modules/mariadb/node_modules/@types/node/perf_hooks.d.ts +0 -557
- package/dist/node_modules/mariadb/node_modules/@types/node/process.d.ts +0 -1481
- package/dist/node_modules/mariadb/node_modules/@types/node/punycode.d.ts +0 -117
- package/dist/node_modules/mariadb/node_modules/@types/node/querystring.d.ts +0 -131
- package/dist/node_modules/mariadb/node_modules/@types/node/readline.d.ts +0 -650
- package/dist/node_modules/mariadb/node_modules/@types/node/repl.d.ts +0 -424
- package/dist/node_modules/mariadb/node_modules/@types/node/stream/consumers.d.ts +0 -24
- package/dist/node_modules/mariadb/node_modules/@types/node/stream/promises.d.ts +0 -42
- package/dist/node_modules/mariadb/node_modules/@types/node/stream/web.d.ts +0 -330
- package/dist/node_modules/mariadb/node_modules/@types/node/stream.d.ts +0 -1249
- package/dist/node_modules/mariadb/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/dist/node_modules/mariadb/node_modules/@types/node/timers/promises.d.ts +0 -68
- package/dist/node_modules/mariadb/node_modules/@types/node/timers.d.ts +0 -94
- package/dist/node_modules/mariadb/node_modules/@types/node/tls.d.ts +0 -1020
- package/dist/node_modules/mariadb/node_modules/@types/node/trace_events.d.ts +0 -161
- package/dist/node_modules/mariadb/node_modules/@types/node/tty.d.ts +0 -204
- package/dist/node_modules/mariadb/node_modules/@types/node/url.d.ts +0 -891
- package/dist/node_modules/mariadb/node_modules/@types/node/util.d.ts +0 -1594
- package/dist/node_modules/mariadb/node_modules/@types/node/v8.d.ts +0 -378
- package/dist/node_modules/mariadb/node_modules/@types/node/vm.d.ts +0 -507
- package/dist/node_modules/mariadb/node_modules/@types/node/wasi.d.ts +0 -158
- package/dist/node_modules/mariadb/node_modules/@types/node/worker_threads.d.ts +0 -649
- package/dist/node_modules/mariadb/node_modules/@types/node/zlib.d.ts +0 -517
- package/dist/node_modules/mariadb/package.json +0 -1
- package/dist/node_modules/mariadb/promise.js +0 -34
- package/dist/node_modules/mariadb/types/index.d.ts +0 -870
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";(self.webpackChunk_nocobase_plugin_multi_app_manager=self.webpackChunk_nocobase_plugin_multi_app_manager||[]).push([["959"],{7101:function(e,n,t){t.r(n),t.d(n,{AppManager:function(){return g}});var a=t(3772),c=t(2721),r=t(8156),o=t.n(r),u=t(
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_multi_app_manager=self.webpackChunk_nocobase_plugin_multi_app_manager||[]).push([["959"],{7101:function(e,n,t){t.r(n),t.d(n,{AppManager:function(){return g}});var a=t(3772),c=t(2721),r=t(8156),o=t.n(r),u=t(9479),i=t(2785),p=t(8875),l=function(e){var n=e.value,t=e.onChange,a=(0,i.g)().t;return o().createElement(c.Checkbox,{onChange:function(e){e.target.checked?t("".concat((0,p.uid)()).concat((0,p.uid)()).concat((0,p.uid)()).concat((0,p.uid)())):t("")},checked:!!n},a("Automatically generate a JWT secret"))},m=function(){var e=(0,a.useRecord)(),n=(0,a.useApp)();return e.cname?"//".concat(e.cname):n.getRouteUrl("/apps/".concat(e.name,"/admin/"))},s=function(){var e=(0,i.g)().t,n=m();return o().createElement("a",{href:n,target:"_blank",rel:"noreferrer"},e("View",{ns:"client"}))},g=function(){return o().createElement(c.Card,{bordered:!1},o().createElement(a.SchemaComponent,{schema:(0,u.J1)(),components:{AppVisitor:s,JwtSecretInput:l}}))}}}]);
|
|
@@ -0,0 +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
|
+
import React from 'react';
|
|
10
|
+
export declare const Migrate: React.FC;
|
package/dist/client/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react-i18next"),require("react-router-dom"),require("react"),require("@formily/react"),require("@nocobase/utils/client"),require("antd-style"),require("@formily/shared"),require("antd"),require("@nocobase/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-multi-app-manager",["react-i18next","react-router-dom","react","@formily/react","@nocobase/utils/client","antd-style","@formily/shared","antd","@nocobase/client"],e):"object"==typeof exports?exports["@nocobase/plugin-multi-app-manager"]=e(require("react-i18next"),require("react-router-dom"),require("react"),require("@formily/react"),require("@nocobase/utils/client"),require("antd-style"),require("@formily/shared"),require("antd"),require("@nocobase/client")):t["@nocobase/plugin-multi-app-manager"]=e(t["react-i18next"],t["react-router-dom"],t.react,t["@formily/react"],t["@nocobase/utils/client"],t["antd-style"],t["@formily/shared"],t.antd,t["@nocobase/client"])}(self,function(t,e,n,r,o,i,a,u,c){return function(){var s,p,l,f,d,m,y={9570:function(t,e,n){"use strict";n.d(e,{J1:function(){return w},kn:function(){return _},vh:function(){return A}});var r=n(8875),o=n(3772),i=n(7584),a=n(2721),u=n(8156),c=n.n(u),s=n(3784),p=n(2785);function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function f(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(t){n(t);return}u.done?e(c):Promise.resolve(c).then(r,o)}function d(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){f(i,r,o,a,u,"next",t)}function u(t){f(i,r,o,a,u,"throw",t)}a(void 0)})}}function m(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function y(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(e){m(t,e,n[e])})}return t}function v(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):(function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n.push.apply(n,r)}return n})(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}),t}function b(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=e.call(t,a)}catch(t){c=[6,t],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var h={name:"applications",targetKey:"name",fields:[{type:"uid",name:"name",primaryKey:!0,prefix:"a",interface:"input",uiSchema:{type:"string",title:(0,p.W)("App ID"),required:!0,"x-component":"Input","x-validator":"uid"}},{type:"string",name:"displayName",interface:"input",uiSchema:{type:"string",title:(0,p.W)("App display name"),required:!0,"x-component":"Input"}},{type:"string",name:"pinned",interface:"checkbox",uiSchema:{type:"boolean","x-content":(0,p.W)("Pin to menu"),"x-component":"Checkbox"}},{type:"string",name:"status",interface:"radioGroup",defaultValue:"pending",uiSchema:{type:"string",title:(0,p.W)("App status"),enum:[{label:"Preparing",value:"preparing"},{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"}}]},x=function(){var t=(0,o.useResourceActionContext)(),e=t.state,n=t.setState,r=t.refresh,i=(0,o.useResourceContext)().resource;return{run:function(){return d(function(){return b(this,function(t){switch(t.label){case 0:return[4,i.destroy({filterByTk:(null==e?void 0:e.selectedRowKeys)||[]})];case 1:return t.sent(),null==n||n({selectedRowKeys:[]}),r(),[2]}})})()}}},g=function(){(0,o.useResourceActionContext)().refresh,(0,o.useResourceContext)().resource,c().useRef();var t,e=(0,o.useAPIClient)(),n=(0,p.g)().t,r=(t=a.Form.useForm(),function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n,r,o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(t);!(a=(n=o.next()).done)&&(i.push(n.value),i.length!==e);a=!0);}catch(t){u=!0,r=t}finally{try{a||null==o.return||o.return()}finally{if(u)throw r}}return i}}(t,1)||function(t,e){if(t){if("string"==typeof t)return l(t,1);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(t,e)}}(t,1)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];return{run:function(){return d(function(){return b(this,function(t){switch(t.label){case 0:return r.resetFields(),[4,a.Modal.confirm({title:n("Migrate data"),content:c().createElement(a.Form,{form:r},c().createElement(a.Form.Item,{label:n("Port"),tooltip:n("When migrate data, the system automatically assigns an incrementing port number to each application based on this port number. You can also manually modify port number after the migrate."),rules:[{required:!0,message:n("Port is required")}],name:"port"},c().createElement(a.InputNumber,{style:{width:"100%"},min:1}))),onOk:d(function(){var t,o,i;return b(this,function(u){switch(u.label){case 0:return[4,e.resource("pm").get({filterByTk:"multi-app"})];case 1:if(!(null==(o=u.sent().data)||null==(t=o.data)?void 0:t.enabled))return a.message.error(n("Multi-app is not enabled, please enable it first")),[2];return[4,r.validateFields()];case 2:return i=u.sent(),[4,e.request({url:"multiApplications:importFromMultiappManager",method:"post",data:{port:i.port}})];case 3:return u.sent(),a.message.success(n("Migrate successfully")),[2]}})})})];case 1:return t.sent(),[2]}})})()}}},_={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:(0,i.tval)("Start mode",{ns:"@nocobase/plugin-multi-app-manager"}),"x-component":"Radio.Group","x-decorator":"FormItem",default:!1,enum:[{label:(0,i.tval)("Start on first visit",{ns:"@nocobase/plugin-multi-app-manager"}),value:!1},{label:(0,i.tval)("Start with main application",{ns:"@nocobase/plugin-multi-app-manager"}),value:!0}]},cname:{title:(0,p.W)("Custom domain"),"x-component":"Input","x-decorator":"FormItem"},pinned:{"x-component":"CollectionField","x-decorator":"FormItem"},"options.authManager":{type:"object","x-decorator":"FormItem","x-component":"Fieldset",title:'{{t("Authentication options", { ns: "'.concat(s.A,'" })}}'),properties:{"jwt.secret":{type:"string",title:'{{t("JWT secret", { ns: "'.concat(s.A,'" })}}'),description:'{{t("An independent JWT secret ensures data and session isolation from other applications.", { ns: "'.concat(s.A,'" })}}'),"x-decorator":"FormItem","x-component":"JwtSecretInput"}}}}},A={properties:{start:{type:"void",title:'{{ t("Start") }}',"x-component":"Action.Link","x-component-props":{useAction:function(){var t=(0,o.useResourceActionContext)().refresh,e=(0,o.useResourceContext)(),n=e.resource,r=e.targetKey,i=(0,o.useRecord)()[r];return{run:function(){return d(function(){return b(this,function(e){switch(e.label){case 0:return[4,n.start({filterByTk:i})];case 1:return e.sent(),t(),[2]}})})()}}}}},stop:{type:"void",title:'{{ t("Stop") }}',"x-component":"Action.Link","x-component-props":{confirm:{title:"{{t('Stop')}}",content:"{{t('Are you sure you want to stop it?')}}"},useAction:function(){var t=(0,o.useResourceActionContext)().refresh,e=(0,o.useResourceContext)(),n=e.resource,r=e.targetKey,i=(0,o.useRecord)()[r];return{run:function(){return d(function(){return b(this,function(e){switch(e.label){case 0:return[4,n.stop({filterByTk:i})];case 1:return e.sent(),t(),[2]}})})()}}}}},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:_,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}}"}}}},j=function(){var t,e,n=(0,o.useResourceContext)().collection,r=(0,o.useFilterFieldOptions)(n.fields),i=(0,o.useResourceActionContext)();return(0,o.useFilterFieldProps)({options:r,params:(null==(e=i.state)||null==(t=e.params)?void 0:t[0])||i.params,service:i})};function w(){return{type:"object",properties:m({},(0,r.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:{filter:{"x-component":"Filter.Action","x-use-component-props":j,default:{$and:[{displayName:{$includes:""}},{name:{$includes:""}}]},title:"{{t('Filter')}}","x-component-props":{icon:"FilterOutlined"},"x-align":"left"},migrateData:{type:"void",title:'{{ t("Migrate data to new multi-app", { ns: "'.concat(s.A,'" }) }}'),"x-component":"Action","x-component-props":{icon:"DeliveredProcedureOutlined",useAction:g}},delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action","x-component-props":{icon:"DeleteOutlined",useAction:x,confirm:{title:"{{t('Delete')}}",content:"{{t('Are you sure you want to delete it?')}}"}}},create:{type:"void",title:'{{t("Add new")}}',"x-decorator":function(t){return c().createElement(o.SchemaComponentOptions,v(y({},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:function(t){var e=(0,o.useActionContext)();return(0,o.useRequest)(function(){return Promise.resolve({data:{name:"a_".concat((0,r.uid)())}})},v(y({},t),{refreshDeps:[e.visible]}))}},title:'{{t("Add new")}}',properties:{formSchema:_,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:(0,p.W)("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:y({type:"void","x-component":"Space","x-component-props":{split:"|"}},A)}}}}}})}}},2785:function(t,e,n){"use strict";n.d(e,{W:function(){return i},g:function(){return o}});var r=n(3238),o=function(){return{t:(0,r.useTranslation)("multi-app-manager").t}},i=function(t){return'{{t("'.concat(t,"\", { ns: 'multi-app-manager' })}}")}},3784:function(t,e,n){"use strict";n.d(e,{A:function(){return r}});var r="multi-app-manager"},7973:function(t,e,n){var r=n(1783),o=n(1012),i=n(9900),a=n(6691),u=n(2018);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=u,t.exports=c},2768:function(t,e,n){var r=n(9896),o=n(2473),i=n(4678),a=n(1240),u=n(4296);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=u,t.exports=c},1725:function(t,e,n){t.exports=n(6369)(n(5031),"Map")},736:function(t,e,n){var r=n(6660),o=n(8472),i=n(5637),a=n(9389),u=n(9804);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=u,t.exports=c},5382:function(t,e,n){var r=n(2768),o=n(3533),i=n(7064),a=n(9955),u=n(6087),c=n(3990);function s(t){var e=this.__data__=new r(t);this.size=e.size}s.prototype.clear=o,s.prototype.delete=i,s.prototype.get=a,s.prototype.has=u,s.prototype.set=c,t.exports=s},5869:function(t,e,n){t.exports=n(5031).Symbol},8930:function(t,e,n){t.exports=n(5031).Uint8Array},7485:function(t){t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},4505:function(t,e,n){var r=n(1650),o=n(8497),i=n(6227),a=n(939),u=n(3501),c=n(2855),s=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=i(t),p=!n&&o(t),l=!n&&!p&&a(t),f=!n&&!p&&!l&&c(t),d=n||p||l||f,m=d?r(t.length,String):[],y=m.length;for(var v in t)(e||s.call(t,v))&&!(d&&("length"==v||l&&("offset"==v||"parent"==v)||f&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||u(v,y)))&&m.push(v);return m}},3153:function(t,e,n){var r=n(2544),o=n(3947);t.exports=function(t,e,n){(void 0===n||o(t[e],n))&&(void 0!==n||e in t)||r(t,e,n)}},5699:function(t,e,n){var r=n(2544),o=n(3947),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var a=t[e];i.call(t,e)&&o(a,n)&&(void 0!==n||e in t)||r(t,e,n)}},8746:function(t,e,n){var r=n(3947);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return -1}},2544:function(t,e,n){var r=n(6554);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},1315:function(t,e,n){var r=n(2917),o=Object.create;t.exports=function(){function t(){}return function(e){if(!r(e))return{};if(o)return o(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}()},3627:function(t,e,n){t.exports=n(3179)()},4365:function(t,e,n){var r=n(5869),o=n(7043),i=n(5283),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?o(t):i(t)}},8719:function(t,e,n){var r=n(4365),o=n(5620);t.exports=function(t){return o(t)&&"[object Arguments]"==r(t)}},9930:function(t,e,n){var r=n(3098),o=n(8754),i=n(2917),a=n(1304),u=/^\[object .+?Constructor\]$/,c=Object.prototype,s=Function.prototype.toString,p=c.hasOwnProperty,l=RegExp("^"+s.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||o(t))&&(r(t)?l:u).test(a(t))}},7707:function(t,e,n){var r=n(4365),o=n(6613),i=n(5620),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return i(t)&&o(t.length)&&!!a[r(t)]}},3352:function(t,e,n){var r=n(2917),o=n(2947),i=n(5753),a=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return i(t);var e=o(t),n=[];for(var u in t)"constructor"==u&&(e||!a.call(t,u))||n.push(u);return n}},5580:function(t,e,n){var r=n(5382),o=n(3153),i=n(3627),a=n(2669),u=n(2917),c=n(9403),s=n(9341);t.exports=function t(e,n,p,l,f){e!==n&&i(n,function(i,c){if(f||(f=new r),u(i))a(e,n,c,p,t,l,f);else{var d=l?l(s(e,c),i,c+"",e,n,f):void 0;void 0===d&&(d=i),o(e,c,d)}},c)}},2669:function(t,e,n){var r=n(3153),o=n(6550),i=n(7173),a=n(3096),u=n(1931),c=n(8497),s=n(6227),p=n(5559),l=n(939),f=n(3098),d=n(2917),m=n(4087),y=n(2855),v=n(9341),b=n(5079);t.exports=function(t,e,n,h,x,g,_){var A=v(t,n),j=v(e,n),w=_.get(j);if(w)return void r(t,n,w);var O=g?g(A,j,n+"",t,e,_):void 0,S=void 0===O;if(S){var P=s(j),C=!P&&l(j),k=!P&&!C&&y(j);O=j,P||C||k?s(A)?O=A:p(A)?O=a(A):C?(S=!1,O=o(j,!0)):k?(S=!1,O=i(j,!0)):O=[]:m(j)||c(j)?(O=A,c(A)?O=b(A):(!d(A)||f(A))&&(O=u(j))):S=!1}S&&(_.set(j,O),x(O,j,h,g,_),_.delete(j)),r(t,n,O)}},1229:function(t,e,n){var r=n(9974),o=n(2478),i=n(8286);t.exports=function(t,e){return i(o(t,e,r),t+"")}},1792:function(t,e,n){var r=n(6710),o=n(6554),i=n(9974);t.exports=o?function(t,e){return o(t,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:i},1650:function(t){t.exports=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}},8611:function(t){t.exports=function(t){return function(e){return t(e)}}},2658:function(t,e,n){var r=n(8930);t.exports=function(t){var e=new t.constructor(t.byteLength);return new r(e).set(new r(t)),e}},6550:function(t,e,n){t=n.nmd(t);var r=n(5031),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,a=i&&i.exports===o?r.Buffer:void 0,u=a?a.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=u?u(n):new t.constructor(n);return t.copy(r),r}},7173:function(t,e,n){var r=n(2658);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}},3096:function(t){t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}},6734:function(t,e,n){var r=n(5699),o=n(2544);t.exports=function(t,e,n,i){var a=!n;n||(n={});for(var u=-1,c=e.length;++u<c;){var s=e[u],p=i?i(n[s],t[s],s,n,t):void 0;void 0===p&&(p=t[s]),a?o(n,s,p):r(n,s,p)}return n}},3823:function(t,e,n){t.exports=n(5031)["__core-js_shared__"]},9354:function(t,e,n){var r=n(1229),o=n(9131);t.exports=function(t){return r(function(e,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,u=i>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(i--,a):void 0,u&&o(n[0],n[1],u)&&(a=i<3?void 0:a,i=1),e=Object(e);++r<i;){var c=n[r];c&&t(e,c,r,a)}return e})}},3179:function(t){t.exports=function(t){return function(e,n,r){for(var o=-1,i=Object(e),a=r(e),u=a.length;u--;){var c=a[t?u:++o];if(!1===n(i[c],c,i))break}return e}}},6554:function(t,e,n){var r=n(6369);t.exports=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}()},5274:function(t,e,n){t.exports="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g},9623:function(t,e,n){var r=n(9005);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},6369:function(t,e,n){var r=n(9930),o=n(4502);t.exports=function(t,e){var n=o(t,e);return r(n)?n:void 0}},5918:function(t,e,n){t.exports=n(6942)(Object.getPrototypeOf,Object)},7043:function(t,e,n){var r=n(5869),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,u=r?r.toStringTag:void 0;t.exports=function(t){var e=i.call(t,u),n=t[u];try{t[u]=void 0;var r=!0}catch(t){}var o=a.call(t);return r&&(e?t[u]=n:delete t[u]),o}},4502:function(t){t.exports=function(t,e){return null==t?void 0:t[e]}},1783:function(t,e,n){var r=n(8163);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},1012:function(t){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=+!!e,e}},9900:function(t,e,n){var r=n(8163),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(e,t)?e[t]:void 0}},6691:function(t,e,n){var r=n(8163),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:o.call(e,t)}},2018:function(t,e,n){var r=n(8163);t.exports=function(t,e){var n=this.__data__;return this.size+=+!this.has(t),n[t]=r&&void 0===e?"__lodash_hash_undefined__":e,this}},1931:function(t,e,n){var r=n(1315),o=n(5918),i=n(2947);t.exports=function(t){return"function"!=typeof t.constructor||i(t)?{}:r(o(t))}},3501:function(t){var e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,n){var r=typeof t;return!!(n=null==n?0x1fffffffffffff:n)&&("number"==r||"symbol"!=r&&e.test(t))&&t>-1&&t%1==0&&t<n}},9131:function(t,e,n){var r=n(3947),o=n(654),i=n(3501),a=n(2917);t.exports=function(t,e,n){if(!a(n))return!1;var u=typeof e;return("number"==u?!!(o(n)&&i(e,n.length)):"string"==u&&e in n)&&r(n[e],t)}},9005:function(t){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},8754:function(t,e,n){var r,o=n(3823),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!i&&i in t}},2947:function(t){var e=Object.prototype;t.exports=function(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||e)}},9896:function(t){t.exports=function(){this.__data__=[],this.size=0}},2473:function(t,e,n){var r=n(8746),o=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0)&&(n==e.length-1?e.pop():o.call(e,n,1),--this.size,!0)}},4678:function(t,e,n){var r=n(8746);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},1240:function(t,e,n){var r=n(8746);t.exports=function(t){return r(this.__data__,t)>-1}},4296:function(t,e,n){var r=n(8746);t.exports=function(t,e){var n=this.__data__,o=r(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}},6660:function(t,e,n){var r=n(7973),o=n(2768),i=n(1725);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},8472:function(t,e,n){var r=n(9623);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=+!!e,e}},5637:function(t,e,n){var r=n(9623);t.exports=function(t){return r(this,t).get(t)}},9389:function(t,e,n){var r=n(9623);t.exports=function(t){return r(this,t).has(t)}},9804:function(t,e,n){var r=n(9623);t.exports=function(t,e){var n=r(this,t),o=n.size;return n.set(t,e),this.size+=+(n.size!=o),this}},8163:function(t,e,n){t.exports=n(6369)(Object,"create")},5753:function(t){t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},1378:function(t,e,n){t=n.nmd(t);var r=n(5274),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,a=i&&i.exports===o&&r.process,u=function(){try{var t=i&&i.require&&i.require("util").types;if(t)return t;return a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=u},5283:function(t){var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},6942:function(t){t.exports=function(t,e){return function(n){return t(e(n))}}},2478:function(t,e,n){var r=n(7485),o=Math.max;t.exports=function(t,e,n){return e=o(void 0===e?t.length-1:e,0),function(){for(var i=arguments,a=-1,u=o(i.length-e,0),c=Array(u);++a<u;)c[a]=i[e+a];a=-1;for(var s=Array(e+1);++a<e;)s[a]=i[a];return s[e]=n(c),r(t,this,s)}}},5031:function(t,e,n){var r=n(5274),o="object"==typeof self&&self&&self.Object===Object&&self;t.exports=r||o||Function("return this")()},9341:function(t){t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},8286:function(t,e,n){var r=n(1792);t.exports=n(1358)(r)},1358:function(t){var e=Date.now;t.exports=function(t){var n=0,r=0;return function(){var o=e(),i=16-(o-r);if(r=o,i>0){if(++n>=800)return arguments[0]}else n=0;return t.apply(void 0,arguments)}}},3533:function(t,e,n){var r=n(2768);t.exports=function(){this.__data__=new r,this.size=0}},7064:function(t){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},9955:function(t){t.exports=function(t){return this.__data__.get(t)}},6087:function(t){t.exports=function(t){return this.__data__.has(t)}},3990:function(t,e,n){var r=n(2768),o=n(1725),i=n(736);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(t,e),this.size=n.size,this}},1304:function(t){var e=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return e.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},6710:function(t){t.exports=function(t){return function(){return t}}},3947:function(t){t.exports=function(t,e){return t===e||t!=t&&e!=e}},9974:function(t){t.exports=function(t){return t}},8497:function(t,e,n){var r=n(8719),o=n(5620),i=Object.prototype,a=i.hasOwnProperty,u=i.propertyIsEnumerable;t.exports=r(function(){return arguments}())?r:function(t){return o(t)&&a.call(t,"callee")&&!u.call(t,"callee")}},6227:function(t){t.exports=Array.isArray},654:function(t,e,n){var r=n(3098),o=n(6613);t.exports=function(t){return null!=t&&o(t.length)&&!r(t)}},5559:function(t,e,n){var r=n(654),o=n(5620);t.exports=function(t){return o(t)&&r(t)}},939:function(t,e,n){t=n.nmd(t);var r=n(5031),o=n(3863),i=e&&!e.nodeType&&e,a=i&&t&&!t.nodeType&&t,u=a&&a.exports===i?r.Buffer:void 0,c=u?u.isBuffer:void 0;t.exports=c||o},3098:function(t,e,n){var r=n(4365),o=n(2917);t.exports=function(t){if(!o(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},6613:function(t){t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=0x1fffffffffffff}},2917:function(t){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},5620:function(t){t.exports=function(t){return null!=t&&"object"==typeof t}},4087:function(t,e,n){var r=n(4365),o=n(5918),i=n(5620),a=Object.prototype,u=Function.prototype.toString,c=a.hasOwnProperty,s=u.call(Object);t.exports=function(t){if(!i(t)||"[object Object]"!=r(t))return!1;var e=o(t);if(null===e)return!0;var n=c.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==s}},2855:function(t,e,n){var r=n(7707),o=n(8611),i=n(1378),a=i&&i.isTypedArray;t.exports=a?o(a):r},9403:function(t,e,n){var r=n(4505),o=n(3352),i=n(654);t.exports=function(t){return i(t)?r(t,!0):o(t)}},9782:function(t,e,n){var r=n(5580);t.exports=n(9354)(function(t,e,n){r(t,e,n)})},3863:function(t){t.exports=function(){return!1}},5079:function(t,e,n){var r=n(6734),o=n(9403);t.exports=function(t){return r(t,o(t))}},3581:function(t){t.exports=function(t,e){return"undefined"!=typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(t,e),e}},3505:function(t){"use strict";t.exports=r},8875:function(t){"use strict";t.exports=a},3772:function(t){"use strict";t.exports=c},7584:function(t){"use strict";t.exports=o},2721:function(t){"use strict";t.exports=u},8202:function(t){"use strict";t.exports=i},8156:function(t){"use strict";t.exports=n},3238:function(e){"use strict";e.exports=t},6128:function(t){"use strict";t.exports=e}},v={};function b(t){var e=v[t];if(void 0!==e)return e.exports;var n=v[t]={id:t,loaded:!1,exports:{}};return y[t](n,n.exports,b),n.loaded=!0,n.exports}b.m=y,b.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return b.d(e,{a:e}),e},b.d=function(t,e){for(var n in e)b.o(e,n)&&!b.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},b.f={},b.e=function(t){return Promise.all(Object.keys(b.f).reduce(function(e,n){return b.f[n](t,e),e},[]))},b.u=function(t){return"db3a142b120d6553.js"},b.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}}(),b.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s={},p="@nocobase/plugin-multi-app-manager:",b.l=function(t,e,n,r){if(s[t])return void s[t].push(e);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var c=a[u];if(c.getAttribute("src")==t||c.getAttribute("data-webpack")==p+n){o=c;break}}o||(i=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,b.nc&&o.setAttribute("nonce",b.nc),o.setAttribute("data-webpack",p+n),o.src=t),s[t]=[e];var l=function(e,n){o.onerror=o.onload=null,clearTimeout(f);var r=s[t];if(delete s[t],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(t){return t(n)}),e)return e(n)},f=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),i&&document.head.appendChild(o)},b.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},b.nmd=function(t){return t.paths=[],t.children||(t.children=[]),t},(l=window.__nocobase_public_path__||"/").endsWith("/")||(l+="/"),b.p=l+"static/plugins/@nocobase/plugin-multi-app-manager/dist/client/",f={909:0},b.f.j=function(t,e){var n=b.o(f,t)?f[t]:void 0;if(0!==n)if(n)e.push(n[2]);else{var r=new Promise(function(e,r){n=f[t]=[e,r]});e.push(n[2]=r);var o=b.p+b.u(t),i=Error();b.l(o,function(e){if(b.o(f,t)&&(0!==(n=f[t])&&(f[t]=void 0),n)){var r=e&&("load"===e.type?"missing":e.type),o=e&&e.target&&e.target.src;i.message="Loading chunk "+t+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+t,t)}},d=function(t,e){var n,r,o=e[0],i=e[1],a=e[2],u=0;if(o.some(function(t){return 0!==f[t]})){for(n in i)b.o(i,n)&&(b.m[n]=i[n]);a&&a(b)}for(t&&t(e);u<o.length;u++)r=o[u],b.o(f,r)&&f[r]&&f[r][0](),f[r]=0},(m=self.webpackChunk_nocobase_plugin_multi_app_manager=self.webpackChunk_nocobase_plugin_multi_app_manager||[]).forEach(d.bind(null,0)),m.push=d.bind(null,m.push.bind(m));var h={};return!function(){"use strict";b.r(h),b.d(h,{PluginMultiAppManagerClient:function(){return S},formSchema:function(){return f.kn},default:function(){return P},tableActionColumnSchema:function(){return f.vh}});var t=b(3772),e=b(2721),n=b(8156),r=b.n(n),o=b(6128),i=b(3505),a=(0,i.connect)(e.Input,(0,i.mapReadPretty)(function(e){var n=(0,t.useApp)(),o=e.value&&r().createElement("a",{target:"_blank",href:n.getRouteUrl("/apps/".concat(e.value,"/admin")),rel:"noreferrer"},e.value);return r().createElement("div",{style:e.style},e.addonBefore,e.prefix,o,e.suffix,e.addonAfter)})),u=(0,b(8202).createStyles)(function(t){return{button:{color:t.token.colorTextHeaderMenu+" !important"}}}),c=b(2785);function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var p=function(){var n,i=u().styles,a=(0,t.useRequest)({resource:"applications",action:"listPinned"},{manual:!0}),p=a.data,l=a.run,f=(0,c.g)().t,d=(0,t.useApp)(),m=((function(t){if(Array.isArray(t))return s(t)})(n=((null==p?void 0:p.data)||[]).map(function(t){var e=d.getRouteUrl("/apps/".concat(t.name,"/admin/"));return t.cname&&(e="//".concat(t.cname)),{key:t.name,label:r().createElement("a",{href:e,target:"_blank",rel:"noopener noreferrer"},t.displayName||t.name)}}))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||function(t,e){if(t){if("string"==typeof t)return s(t,void 0);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(t,e)}}(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([{key:".manager",label:r().createElement(o.Link,{to:d.pluginSettingsManager.getRoutePath("multi-app-manager")},f("Manage applications"))}]);return r().createElement(e.Dropdown,{onOpenChange:function(t){l()},menu:{items:m}},r().createElement(e.Button,{className:i.button,title:"Apps",icon:r().createElement(t.Icon,{type:"AppstoreOutlined"})}))},l=function(e){return r().createElement(t.PinnedPluginListProvider,{items:{}},r().createElement(t.SchemaComponentOptions,{components:{MultiAppManager:p,AppNameInput:a}},e.children))},f=b(9570),d=b(9782),m=b.n(d),y=b(3784),v=b(3581);function x(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(t){n(t);return}u.done?e(c):Promise.resolve(c).then(r,o)}function g(t,e,n){return(g=w()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&A(o,n.prototype),o}).apply(null,arguments)}function _(t){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function A(t,e){return(A=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function j(t){var e="function"==typeof Map?new Map:void 0;return(j=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return g(t,arguments,_(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),A(n,t)})(t)}function w(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(w=function(){return!!t})()}var O=(0,t.lazy)(function(){return v("imported_-2qibu4_component",b.e("959").then(b.bind(b,7101)))},"AppManager").AppManager,S=function(t){var e;if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");function n(){var t,e;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,e=arguments,t=_(t),function(t,e){var n;if(e&&("object"==((n=e)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof e))return e;if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,w()?Reflect.construct(t,e||[],_(this).constructor):t.apply(this,e))}return n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),t&&A(n,t),e=[{key:"load",value:function(){var t,e=this;return(t=function(){return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=e.call(t,a)}catch(t){c=[6,t],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(t){return e.app.use(l),e.app.pluginSettingsManager.add(y.A,{title:'{{t("Multi-app manager (deprecated)", { ns: "'.concat(y.A,'" })}}'),icon:"AppstoreOutlined",Component:O,sort:1e3,aclSnippet:"pm.multi-app-manager.applications"}),[2]})},function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){x(i,r,o,a,u,"next",t)}function u(t){x(i,r,o,a,u,"throw",t)}a(void 0)})})()}},{key:"extendFormSchema",value:function(t){m()(f.kn,t)}}],function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(n.prototype,e),n}(j(t.Plugin)),P=S}(),h}()});
|
|
10
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react-router-dom"),require("@ant-design/icons"),require("react"),require("@formily/react"),require("@nocobase/utils/client"),require("antd-style"),require("@formily/shared"),require("antd"),require("@nocobase/client"),require("react-i18next")):"function"==typeof define&&define.amd?define("@nocobase/plugin-multi-app-manager",["react-router-dom","@ant-design/icons","react","@formily/react","@nocobase/utils/client","antd-style","@formily/shared","antd","@nocobase/client","react-i18next"],e):"object"==typeof exports?exports["@nocobase/plugin-multi-app-manager"]=e(require("react-router-dom"),require("@ant-design/icons"),require("react"),require("@formily/react"),require("@nocobase/utils/client"),require("antd-style"),require("@formily/shared"),require("antd"),require("@nocobase/client"),require("react-i18next")):t["@nocobase/plugin-multi-app-manager"]=e(t["react-router-dom"],t["@ant-design/icons"],t.react,t["@formily/react"],t["@nocobase/utils/client"],t["antd-style"],t["@formily/shared"],t.antd,t["@nocobase/client"],t["react-i18next"])}(self,function(t,e,n,r,o,i,u,a,c,s){return function(){var l,p,f,d,m,y,v={9479:function(t,e,n){"use strict";n.d(e,{vh:function(){return C},kn:function(){return P},J1:function(){return E}});var r=n(8875),o=n(3772),i=n(7584),u=n(2721),a=n(8156),c=n.n(a),s=n(3784),l=n(2785),p=n(482);function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function d(t,e,n,r,o,i,u){try{var a=t[i](u),c=a.value}catch(t){n(t);return}a.done?e(c):Promise.resolve(c).then(r,o)}function m(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function u(t){d(i,r,o,u,a,"next",t)}function a(t){d(i,r,o,u,a,"throw",t)}u(void 0)})}}function y(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n,r,o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=o){var i=[],u=!0,a=!1;try{for(o=o.call(t);!(u=(n=o.next()).done)&&(i.push(n.value),!e||i.length!==e);u=!0);}catch(t){a=!0,r=t}finally{try{u||null==o.return||o.return()}finally{if(a)throw r}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return f(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(t,e)}}(t,e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){var c=[i,a];if(n)throw TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return u.label++,{value:c[1],done:!1};case 5:u.label++,r=c[1],c=[0];continue;case 7:c=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){u=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){u.label=c[1];break}if(6===c[0]&&u.label<o[1]){u.label=o[1],o=c;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(c);break}o[2]&&u.ops.pop(),u.trys.pop();continue}c=e.call(t,u)}catch(t){c=[6,t],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var b=function(t){var e=t.open,n=t.setOpen,r=y(u.Form.useForm(),1)[0],i=(0,l.g)().t,s=(0,o.useAPIClient)(),p=(0,o.useResourceActionContext)(),f=p.state,d=p.setState,b=y((0,a.useState)([]),2),h=b[0],x=b[1],g=y((0,a.useState)(!1),2),_=g[0],w=g[1];return(0,o.useRequest)(function(){return s.request({url:"appEnvironments:list"}).then(function(t){var e;return(null==(e=t.data)?void 0:e.data)||[]})},{onSuccess:function(t){var e=t.filter(function(t){return t.available});e.length&&x(e.map(function(t){var e=t.name;return{value:e,label:e}}))}}),c().createElement(u.Modal,{title:i("Migrate to app supervisor"),closable:!0,open:e,footer:[c().createElement(u.Button,{key:"cancel",onClick:function(){n(!1)}},i("Cancel")),c().createElement(u.Button,{key:"submit",type:"primary",loading:_,onClick:m(function(){var t;return v(this,function(e){switch(e.label){case 0:if(!(null==f||null==(t=f.selectedRowKeys)?void 0:t.length))return[2,u.message.error(i("Please select the records you want to migrate"))];return w(!0),[4,r.validateFields()];case 1:e.sent(),e.label=2;case 2:return e.trys.push([2,,4,5]),[4,s.resource("apps").migrate({values:{appNames:null==f?void 0:f.selectedRowKeys,environments:r.getFieldValue("environments")}})];case 3:return e.sent(),[3,5];case 4:return null==d||d({selectedRowKeys:[]}),n(!1),w(!1),[7];case 5:return[2]}})})},i("Submit"))]},c().createElement(u.Form,{form:r,layout:"vertical",colon:!0},c().createElement(u.Form.Item,{label:i("Environments"),name:"environments",rules:[{required:!0}]},c().createElement(u.Select,{options:h,mode:"multiple"}))))},h=function(){var t=(0,l.g)().t,e=(0,o.useAPIClient)(),n=(0,o.useResourceActionContext)().state,r=y((0,a.useState)(!1),2),i=r[0],s=r[1],f=(0,o.useRequest)(function(){return e.silent().resource("pm").get({filterByTk:"app-supervisor"}).then(function(t){var e;return null==t||null==(e=t.data)?void 0:e.data})}),d=f.loading,h=f.data;return!d&&(null==h?void 0:h.enabled)?c().createElement(c().Fragment,null,c().createElement(u.Button,{icon:c().createElement(p.CloudSyncOutlined,null),onClick:m(function(){var e;return v(this,function(r){return(null==n||null==(e=n.selectedRowKeys)?void 0:e.length)?(s(!0),[2]):[2,u.message.error(t("Please select the records you want to migrate"))]})})},t("Migrate to app supervisor")),c().createElement(b,{open:i,setOpen:s})):null};function x(t,e,n,r,o,i,u){try{var a=t[i](u),c=a.value}catch(t){n(t);return}a.done?e(c):Promise.resolve(c).then(r,o)}function g(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function u(t){x(i,r,o,u,a,"next",t)}function a(t){x(i,r,o,u,a,"throw",t)}u(void 0)})}}function _(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function w(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(e){_(t,e,n[e])})}return t}function A(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):(function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n.push.apply(n,r)}return n})(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}),t}function j(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){var c=[i,a];if(n)throw TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return u.label++,{value:c[1],done:!1};case 5:u.label++,r=c[1],c=[0];continue;case 7:c=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){u=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){u.label=c[1];break}if(6===c[0]&&u.label<o[1]){u.label=o[1],o=c;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(c);break}o[2]&&u.ops.pop(),u.trys.pop();continue}c=e.call(t,u)}catch(t){c=[6,t],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var O={name:"applications",targetKey:"name",fields:[{type:"uid",name:"name",primaryKey:!0,prefix:"a",interface:"input",uiSchema:{type:"string",title:(0,l.W)("App ID"),required:!0,"x-component":"Input","x-validator":"uid"}},{type:"string",name:"displayName",interface:"input",uiSchema:{type:"string",title:(0,l.W)("App display name"),required:!0,"x-component":"Input"}},{type:"string",name:"pinned",interface:"checkbox",uiSchema:{type:"boolean","x-content":(0,l.W)("Pin to menu"),"x-component":"Checkbox"}},{type:"string",name:"status",interface:"radioGroup",defaultValue:"pending",uiSchema:{type:"string",title:(0,l.W)("App status"),enum:[{label:"Preparing",value:"preparing"},{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"}}]},S=function(){var t=(0,o.useResourceActionContext)(),e=t.state,n=t.setState,r=t.refresh,i=(0,o.useResourceContext)().resource;return{run:function(){return g(function(){return j(this,function(t){switch(t.label){case 0:return[4,i.destroy({filterByTk:(null==e?void 0:e.selectedRowKeys)||[]})];case 1:return t.sent(),null==n||n({selectedRowKeys:[]}),r(),[2]}})})()}}},P={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:(0,i.tval)("Start mode",{ns:"@nocobase/plugin-multi-app-manager"}),"x-component":"Radio.Group","x-decorator":"FormItem",default:!1,enum:[{label:(0,i.tval)("Start on first visit",{ns:"@nocobase/plugin-multi-app-manager"}),value:!1},{label:(0,i.tval)("Start with main application",{ns:"@nocobase/plugin-multi-app-manager"}),value:!0}]},cname:{title:(0,l.W)("Custom domain"),"x-component":"Input","x-decorator":"FormItem"},pinned:{"x-component":"CollectionField","x-decorator":"FormItem"},"options.authManager":{type:"object","x-decorator":"FormItem","x-component":"Fieldset",title:'{{t("Authentication options", { ns: "'.concat(s.A,'" })}}'),properties:{"jwt.secret":{type:"string",title:'{{t("JWT secret", { ns: "'.concat(s.A,'" })}}'),description:'{{t("An independent JWT secret ensures data and session isolation from other applications.", { ns: "'.concat(s.A,'" })}}'),"x-decorator":"FormItem","x-component":"JwtSecretInput"}}}}},C={properties:{start:{type:"void",title:'{{ t("Start") }}',"x-component":"Action.Link","x-component-props":{useAction:function(){var t=(0,o.useResourceActionContext)().refresh,e=(0,o.useResourceContext)(),n=e.resource,r=e.targetKey,i=(0,o.useRecord)()[r];return{run:function(){return g(function(){return j(this,function(e){switch(e.label){case 0:return[4,n.start({filterByTk:i})];case 1:return e.sent(),t(),[2]}})})()}}}}},stop:{type:"void",title:'{{ t("Stop") }}',"x-component":"Action.Link","x-component-props":{confirm:{title:"{{t('Stop')}}",content:"{{t('Are you sure you want to stop it?')}}"},useAction:function(){var t=(0,o.useResourceActionContext)().refresh,e=(0,o.useResourceContext)(),n=e.resource,r=e.targetKey,i=(0,o.useRecord)()[r];return{run:function(){return g(function(){return j(this,function(e){switch(e.label){case 0:return[4,n.stop({filterByTk:i})];case 1:return e.sent(),t(),[2]}})})()}}}}},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:P,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}}"}}}},k=function(){var t,e,n=(0,o.useResourceContext)().collection,r=(0,o.useFilterFieldOptions)(n.fields),i=(0,o.useResourceActionContext)();return(0,o.useFilterFieldProps)({options:r,params:(null==(e=i.state)||null==(t=e.params)?void 0:t[0])||i.params,service:i})};function E(){return{type:"object",properties:_({},(0,r.uid)(),{type:"void","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:O,resourceName:"applications",request:{resource:"applications",action:"list",params:{pageSize:50,sort:["-createdAt"],appends:[]}}},"x-component":"CollectionProvider_deprecated","x-component-props":{collection:O},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{filter:{"x-component":"Filter.Action","x-use-component-props":k,default:{$and:[{displayName:{$includes:""}},{name:{$includes:""}}]},title:"{{t('Filter')}}","x-component-props":{icon:"FilterOutlined"},"x-align":"left"},migrate:{type:"void","x-component":h},delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action","x-component-props":{icon:"DeleteOutlined",useAction:S,confirm:{title:"{{t('Delete')}}",content:"{{t('Are you sure you want to delete it?')}}"}}},create:{type:"void",title:'{{t("Add new")}}',"x-decorator":function(t){return c().createElement(o.SchemaComponentOptions,A(w({},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:function(t){var e=(0,o.useActionContext)();return(0,o.useRequest)(function(){return Promise.resolve({data:{name:"a_".concat((0,r.uid)())}})},A(w({},t),{refreshDeps:[e.visible]}))}},title:'{{t("Add new")}}',properties:{formSchema:P,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:(0,l.W)("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:w({type:"void","x-component":"Space","x-component-props":{split:"|"}},C)}}}}}})}}},2785:function(t,e,n){"use strict";n.d(e,{W:function(){return i},g:function(){return o}});var r=n(3238),o=function(){return{t:(0,r.useTranslation)("multi-app-manager").t}},i=function(t){return'{{t("'.concat(t,"\", { ns: 'multi-app-manager' })}}")}},3784:function(t,e,n){"use strict";n.d(e,{A:function(){return r}});var r="multi-app-manager"},7973:function(t,e,n){var r=n(1783),o=n(1012),i=n(9900),u=n(6691),a=n(2018);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=u,c.prototype.set=a,t.exports=c},2768:function(t,e,n){var r=n(9896),o=n(2473),i=n(4678),u=n(1240),a=n(4296);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=u,c.prototype.set=a,t.exports=c},1725:function(t,e,n){t.exports=n(6369)(n(5031),"Map")},736:function(t,e,n){var r=n(6660),o=n(8472),i=n(5637),u=n(9389),a=n(9804);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=u,c.prototype.set=a,t.exports=c},5382:function(t,e,n){var r=n(2768),o=n(3533),i=n(7064),u=n(9955),a=n(6087),c=n(3990);function s(t){var e=this.__data__=new r(t);this.size=e.size}s.prototype.clear=o,s.prototype.delete=i,s.prototype.get=u,s.prototype.has=a,s.prototype.set=c,t.exports=s},5869:function(t,e,n){t.exports=n(5031).Symbol},8930:function(t,e,n){t.exports=n(5031).Uint8Array},7485:function(t){t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},4505:function(t,e,n){var r=n(1650),o=n(8497),i=n(6227),u=n(939),a=n(3501),c=n(2855),s=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=i(t),l=!n&&o(t),p=!n&&!l&&u(t),f=!n&&!l&&!p&&c(t),d=n||l||p||f,m=d?r(t.length,String):[],y=m.length;for(var v in t)(e||s.call(t,v))&&!(d&&("length"==v||p&&("offset"==v||"parent"==v)||f&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||a(v,y)))&&m.push(v);return m}},3153:function(t,e,n){var r=n(2544),o=n(3947);t.exports=function(t,e,n){(void 0===n||o(t[e],n))&&(void 0!==n||e in t)||r(t,e,n)}},5699:function(t,e,n){var r=n(2544),o=n(3947),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var u=t[e];i.call(t,e)&&o(u,n)&&(void 0!==n||e in t)||r(t,e,n)}},8746:function(t,e,n){var r=n(3947);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return -1}},2544:function(t,e,n){var r=n(6554);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},1315:function(t,e,n){var r=n(2917),o=Object.create;t.exports=function(){function t(){}return function(e){if(!r(e))return{};if(o)return o(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}()},3627:function(t,e,n){t.exports=n(3179)()},4365:function(t,e,n){var r=n(5869),o=n(7043),i=n(5283),u=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":u&&u in Object(t)?o(t):i(t)}},8719:function(t,e,n){var r=n(4365),o=n(5620);t.exports=function(t){return o(t)&&"[object Arguments]"==r(t)}},9930:function(t,e,n){var r=n(3098),o=n(8754),i=n(2917),u=n(1304),a=/^\[object .+?Constructor\]$/,c=Object.prototype,s=Function.prototype.toString,l=c.hasOwnProperty,p=RegExp("^"+s.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||o(t))&&(r(t)?p:a).test(u(t))}},7707:function(t,e,n){var r=n(4365),o=n(6613),i=n(5620),u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u["[object Arguments]"]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u["[object Function]"]=u["[object Map]"]=u["[object Number]"]=u["[object Object]"]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1,t.exports=function(t){return i(t)&&o(t.length)&&!!u[r(t)]}},3352:function(t,e,n){var r=n(2917),o=n(2947),i=n(5753),u=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return i(t);var e=o(t),n=[];for(var a in t)"constructor"==a&&(e||!u.call(t,a))||n.push(a);return n}},5580:function(t,e,n){var r=n(5382),o=n(3153),i=n(3627),u=n(2669),a=n(2917),c=n(9403),s=n(9341);t.exports=function t(e,n,l,p,f){e!==n&&i(n,function(i,c){if(f||(f=new r),a(i))u(e,n,c,l,t,p,f);else{var d=p?p(s(e,c),i,c+"",e,n,f):void 0;void 0===d&&(d=i),o(e,c,d)}},c)}},2669:function(t,e,n){var r=n(3153),o=n(6550),i=n(7173),u=n(3096),a=n(1931),c=n(8497),s=n(6227),l=n(5559),p=n(939),f=n(3098),d=n(2917),m=n(4087),y=n(2855),v=n(9341),b=n(5079);t.exports=function(t,e,n,h,x,g,_){var w=v(t,n),A=v(e,n),j=_.get(A);if(j)return void r(t,n,j);var O=g?g(w,A,n+"",t,e,_):void 0,S=void 0===O;if(S){var P=s(A),C=!P&&p(A),k=!P&&!C&&y(A);O=A,P||C||k?s(w)?O=w:l(w)?O=u(w):C?(S=!1,O=o(A,!0)):k?(S=!1,O=i(A,!0)):O=[]:m(A)||c(A)?(O=w,c(w)?O=b(w):(!d(w)||f(w))&&(O=a(A))):S=!1}S&&(_.set(A,O),x(O,A,h,g,_),_.delete(A)),r(t,n,O)}},1229:function(t,e,n){var r=n(9974),o=n(2478),i=n(8286);t.exports=function(t,e){return i(o(t,e,r),t+"")}},1792:function(t,e,n){var r=n(6710),o=n(6554),i=n(9974);t.exports=o?function(t,e){return o(t,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:i},1650:function(t){t.exports=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}},8611:function(t){t.exports=function(t){return function(e){return t(e)}}},2658:function(t,e,n){var r=n(8930);t.exports=function(t){var e=new t.constructor(t.byteLength);return new r(e).set(new r(t)),e}},6550:function(t,e,n){t=n.nmd(t);var r=n(5031),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,u=i&&i.exports===o?r.Buffer:void 0,a=u?u.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=a?a(n):new t.constructor(n);return t.copy(r),r}},7173:function(t,e,n){var r=n(2658);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}},3096:function(t){t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}},6734:function(t,e,n){var r=n(5699),o=n(2544);t.exports=function(t,e,n,i){var u=!n;n||(n={});for(var a=-1,c=e.length;++a<c;){var s=e[a],l=i?i(n[s],t[s],s,n,t):void 0;void 0===l&&(l=t[s]),u?o(n,s,l):r(n,s,l)}return n}},3823:function(t,e,n){t.exports=n(5031)["__core-js_shared__"]},9354:function(t,e,n){var r=n(1229),o=n(9131);t.exports=function(t){return r(function(e,n){var r=-1,i=n.length,u=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(u=t.length>3&&"function"==typeof u?(i--,u):void 0,a&&o(n[0],n[1],a)&&(u=i<3?void 0:u,i=1),e=Object(e);++r<i;){var c=n[r];c&&t(e,c,r,u)}return e})}},3179:function(t){t.exports=function(t){return function(e,n,r){for(var o=-1,i=Object(e),u=r(e),a=u.length;a--;){var c=u[t?a:++o];if(!1===n(i[c],c,i))break}return e}}},6554:function(t,e,n){var r=n(6369);t.exports=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}()},5274:function(t,e,n){t.exports="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g},9623:function(t,e,n){var r=n(9005);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},6369:function(t,e,n){var r=n(9930),o=n(4502);t.exports=function(t,e){var n=o(t,e);return r(n)?n:void 0}},5918:function(t,e,n){t.exports=n(6942)(Object.getPrototypeOf,Object)},7043:function(t,e,n){var r=n(5869),o=Object.prototype,i=o.hasOwnProperty,u=o.toString,a=r?r.toStringTag:void 0;t.exports=function(t){var e=i.call(t,a),n=t[a];try{t[a]=void 0;var r=!0}catch(t){}var o=u.call(t);return r&&(e?t[a]=n:delete t[a]),o}},4502:function(t){t.exports=function(t,e){return null==t?void 0:t[e]}},1783:function(t,e,n){var r=n(8163);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},1012:function(t){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=+!!e,e}},9900:function(t,e,n){var r=n(8163),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(e,t)?e[t]:void 0}},6691:function(t,e,n){var r=n(8163),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:o.call(e,t)}},2018:function(t,e,n){var r=n(8163);t.exports=function(t,e){var n=this.__data__;return this.size+=+!this.has(t),n[t]=r&&void 0===e?"__lodash_hash_undefined__":e,this}},1931:function(t,e,n){var r=n(1315),o=n(5918),i=n(2947);t.exports=function(t){return"function"!=typeof t.constructor||i(t)?{}:r(o(t))}},3501:function(t){var e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,n){var r=typeof t;return!!(n=null==n?0x1fffffffffffff:n)&&("number"==r||"symbol"!=r&&e.test(t))&&t>-1&&t%1==0&&t<n}},9131:function(t,e,n){var r=n(3947),o=n(654),i=n(3501),u=n(2917);t.exports=function(t,e,n){if(!u(n))return!1;var a=typeof e;return("number"==a?!!(o(n)&&i(e,n.length)):"string"==a&&e in n)&&r(n[e],t)}},9005:function(t){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},8754:function(t,e,n){var r,o=n(3823),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!i&&i in t}},2947:function(t){var e=Object.prototype;t.exports=function(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||e)}},9896:function(t){t.exports=function(){this.__data__=[],this.size=0}},2473:function(t,e,n){var r=n(8746),o=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0)&&(n==e.length-1?e.pop():o.call(e,n,1),--this.size,!0)}},4678:function(t,e,n){var r=n(8746);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},1240:function(t,e,n){var r=n(8746);t.exports=function(t){return r(this.__data__,t)>-1}},4296:function(t,e,n){var r=n(8746);t.exports=function(t,e){var n=this.__data__,o=r(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}},6660:function(t,e,n){var r=n(7973),o=n(2768),i=n(1725);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},8472:function(t,e,n){var r=n(9623);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=+!!e,e}},5637:function(t,e,n){var r=n(9623);t.exports=function(t){return r(this,t).get(t)}},9389:function(t,e,n){var r=n(9623);t.exports=function(t){return r(this,t).has(t)}},9804:function(t,e,n){var r=n(9623);t.exports=function(t,e){var n=r(this,t),o=n.size;return n.set(t,e),this.size+=+(n.size!=o),this}},8163:function(t,e,n){t.exports=n(6369)(Object,"create")},5753:function(t){t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},1378:function(t,e,n){t=n.nmd(t);var r=n(5274),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,u=i&&i.exports===o&&r.process,a=function(){try{var t=i&&i.require&&i.require("util").types;if(t)return t;return u&&u.binding&&u.binding("util")}catch(t){}}();t.exports=a},5283:function(t){var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},6942:function(t){t.exports=function(t,e){return function(n){return t(e(n))}}},2478:function(t,e,n){var r=n(7485),o=Math.max;t.exports=function(t,e,n){return e=o(void 0===e?t.length-1:e,0),function(){for(var i=arguments,u=-1,a=o(i.length-e,0),c=Array(a);++u<a;)c[u]=i[e+u];u=-1;for(var s=Array(e+1);++u<e;)s[u]=i[u];return s[e]=n(c),r(t,this,s)}}},5031:function(t,e,n){var r=n(5274),o="object"==typeof self&&self&&self.Object===Object&&self;t.exports=r||o||Function("return this")()},9341:function(t){t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},8286:function(t,e,n){var r=n(1792);t.exports=n(1358)(r)},1358:function(t){var e=Date.now;t.exports=function(t){var n=0,r=0;return function(){var o=e(),i=16-(o-r);if(r=o,i>0){if(++n>=800)return arguments[0]}else n=0;return t.apply(void 0,arguments)}}},3533:function(t,e,n){var r=n(2768);t.exports=function(){this.__data__=new r,this.size=0}},7064:function(t){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},9955:function(t){t.exports=function(t){return this.__data__.get(t)}},6087:function(t){t.exports=function(t){return this.__data__.has(t)}},3990:function(t,e,n){var r=n(2768),o=n(1725),i=n(736);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var u=n.__data__;if(!o||u.length<199)return u.push([t,e]),this.size=++n.size,this;n=this.__data__=new i(u)}return n.set(t,e),this.size=n.size,this}},1304:function(t){var e=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return e.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},6710:function(t){t.exports=function(t){return function(){return t}}},3947:function(t){t.exports=function(t,e){return t===e||t!=t&&e!=e}},9974:function(t){t.exports=function(t){return t}},8497:function(t,e,n){var r=n(8719),o=n(5620),i=Object.prototype,u=i.hasOwnProperty,a=i.propertyIsEnumerable;t.exports=r(function(){return arguments}())?r:function(t){return o(t)&&u.call(t,"callee")&&!a.call(t,"callee")}},6227:function(t){t.exports=Array.isArray},654:function(t,e,n){var r=n(3098),o=n(6613);t.exports=function(t){return null!=t&&o(t.length)&&!r(t)}},5559:function(t,e,n){var r=n(654),o=n(5620);t.exports=function(t){return o(t)&&r(t)}},939:function(t,e,n){t=n.nmd(t);var r=n(5031),o=n(3863),i=e&&!e.nodeType&&e,u=i&&t&&!t.nodeType&&t,a=u&&u.exports===i?r.Buffer:void 0,c=a?a.isBuffer:void 0;t.exports=c||o},3098:function(t,e,n){var r=n(4365),o=n(2917);t.exports=function(t){if(!o(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},6613:function(t){t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=0x1fffffffffffff}},2917:function(t){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},5620:function(t){t.exports=function(t){return null!=t&&"object"==typeof t}},4087:function(t,e,n){var r=n(4365),o=n(5918),i=n(5620),u=Object.prototype,a=Function.prototype.toString,c=u.hasOwnProperty,s=a.call(Object);t.exports=function(t){if(!i(t)||"[object Object]"!=r(t))return!1;var e=o(t);if(null===e)return!0;var n=c.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&a.call(n)==s}},2855:function(t,e,n){var r=n(7707),o=n(8611),i=n(1378),u=i&&i.isTypedArray;t.exports=u?o(u):r},9403:function(t,e,n){var r=n(4505),o=n(3352),i=n(654);t.exports=function(t){return i(t)?r(t,!0):o(t)}},9782:function(t,e,n){var r=n(5580);t.exports=n(9354)(function(t,e,n){r(t,e,n)})},3863:function(t){t.exports=function(){return!1}},5079:function(t,e,n){var r=n(6734),o=n(9403);t.exports=function(t){return r(t,o(t))}},3581:function(t){t.exports=function(t,e){return"undefined"!=typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(t,e),e}},482:function(t){"use strict";t.exports=e},3505:function(t){"use strict";t.exports=r},8875:function(t){"use strict";t.exports=u},3772:function(t){"use strict";t.exports=c},7584:function(t){"use strict";t.exports=o},2721:function(t){"use strict";t.exports=a},8202:function(t){"use strict";t.exports=i},8156:function(t){"use strict";t.exports=n},3238:function(t){"use strict";t.exports=s},6128:function(e){"use strict";e.exports=t}},b={};function h(t){var e=b[t];if(void 0!==e)return e.exports;var n=b[t]={id:t,loaded:!1,exports:{}};return v[t](n,n.exports,h),n.loaded=!0,n.exports}h.m=v,h.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return h.d(e,{a:e}),e},h.d=function(t,e){for(var n in e)h.o(e,n)&&!h.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},h.f={},h.e=function(t){return Promise.all(Object.keys(h.f).reduce(function(e,n){return h.f[n](t,e),e},[]))},h.u=function(t){return"00b71fff3c8c7167.js"},h.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}}(),h.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},l={},p="@nocobase/plugin-multi-app-manager:",h.l=function(t,e,n,r){if(l[t])return void l[t].push(e);if(void 0!==n)for(var o,i,u=document.getElementsByTagName("script"),a=0;a<u.length;a++){var c=u[a];if(c.getAttribute("src")==t||c.getAttribute("data-webpack")==p+n){o=c;break}}o||(i=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,h.nc&&o.setAttribute("nonce",h.nc),o.setAttribute("data-webpack",p+n),o.src=t),l[t]=[e];var s=function(e,n){o.onerror=o.onload=null,clearTimeout(f);var r=l[t];if(delete l[t],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(t){return t(n)}),e)return e(n)},f=setTimeout(s.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=s.bind(null,o.onerror),o.onload=s.bind(null,o.onload),i&&document.head.appendChild(o)},h.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},h.nmd=function(t){return t.paths=[],t.children||(t.children=[]),t},(f=window.__webpack_public_path__||"/").endsWith("/")||(f+="/"),h.p=f+"static/plugins/@nocobase/plugin-multi-app-manager/dist/client/",d={909:0},h.f.j=function(t,e){var n=h.o(d,t)?d[t]:void 0;if(0!==n)if(n)e.push(n[2]);else{var r=new Promise(function(e,r){n=d[t]=[e,r]});e.push(n[2]=r);var o=h.p+h.u(t),i=Error();h.l(o,function(e){if(h.o(d,t)&&(0!==(n=d[t])&&(d[t]=void 0),n)){var r=e&&("load"===e.type?"missing":e.type),o=e&&e.target&&e.target.src;i.message="Loading chunk "+t+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+t,t)}},m=function(t,e){var n,r,o=e[0],i=e[1],u=e[2],a=0;if(o.some(function(t){return 0!==d[t]})){for(n in i)h.o(i,n)&&(h.m[n]=i[n]);u&&u(h)}for(t&&t(e);a<o.length;a++)r=o[a],h.o(d,r)&&d[r]&&d[r][0](),d[r]=0},(y=self.webpackChunk_nocobase_plugin_multi_app_manager=self.webpackChunk_nocobase_plugin_multi_app_manager||[]).forEach(m.bind(null,0)),y.push=m.bind(null,y.push.bind(y));var x={};return!function(){"use strict";h.r(x),h.d(x,{PluginMultiAppManagerClient:function(){return S},formSchema:function(){return f.kn},default:function(){return P},tableActionColumnSchema:function(){return f.vh}});var t=h(3772),e=h(2721),n=h(8156),r=h.n(n),o=h(6128),i=h(3505),u=(0,i.connect)(e.Input,(0,i.mapReadPretty)(function(e){var n=(0,t.useApp)(),o=e.value&&r().createElement("a",{target:"_blank",href:n.getRouteUrl("/apps/".concat(e.value,"/admin")),rel:"noreferrer"},e.value);return r().createElement("div",{style:e.style},e.addonBefore,e.prefix,o,e.suffix,e.addonAfter)})),a=(0,h(8202).createStyles)(function(t){return{button:{color:t.token.colorTextHeaderMenu+" !important"}}}),c=h(2785);function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var l=function(){var n,i=a().styles,u=(0,t.useRequest)({resource:"applications",action:"listPinned"},{manual:!0}),l=u.data,p=u.run,f=(0,c.g)().t,d=(0,t.useApp)(),m=((function(t){if(Array.isArray(t))return s(t)})(n=((null==l?void 0:l.data)||[]).map(function(t){var e=d.getRouteUrl("/apps/".concat(t.name,"/admin/"));return t.cname&&(e="//".concat(t.cname)),{key:t.name,label:r().createElement("a",{href:e,target:"_blank",rel:"noopener noreferrer"},t.displayName||t.name)}}))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||function(t,e){if(t){if("string"==typeof t)return s(t,void 0);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(t,e)}}(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([{key:".manager",label:r().createElement(o.Link,{to:d.pluginSettingsManager.getRoutePath("multi-app-manager")},f("Manage applications"))}]);return r().createElement(e.Dropdown,{onOpenChange:function(t){p()},menu:{items:m}},r().createElement(e.Button,{className:i.button,title:"Apps",icon:r().createElement(t.Icon,{type:"AppstoreOutlined"})}))},p=function(e){return r().createElement(t.PinnedPluginListProvider,{items:{}},r().createElement(t.SchemaComponentOptions,{components:{MultiAppManager:l,AppNameInput:u}},e.children))},f=h(9479),d=h(9782),m=h.n(d),y=h(3784),v=h(3581);function b(t,e,n,r,o,i,u){try{var a=t[i](u),c=a.value}catch(t){n(t);return}a.done?e(c):Promise.resolve(c).then(r,o)}function g(t,e,n){return(g=j()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&w(o,n.prototype),o}).apply(null,arguments)}function _(t){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function w(t,e){return(w=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function A(t){var e="function"==typeof Map?new Map:void 0;return(A=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return g(t,arguments,_(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),w(n,t)})(t)}function j(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(j=function(){return!!t})()}var O=(0,t.lazy)(function(){return v("imported_-2qibu4_component",h.e("959").then(h.bind(h,7101)))},"AppManager").AppManager,S=function(t){var e;if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");function n(){var t,e;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,e=arguments,t=_(t),function(t,e){var n;if(e&&("object"==((n=e)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof e))return e;if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,j()?Reflect.construct(t,e||[],_(this).constructor):t.apply(this,e))}return n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),t&&w(n,t),e=[{key:"load",value:function(){var t,e=this;return(t=function(){return function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){var c=[i,a];if(n)throw TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return u.label++,{value:c[1],done:!1};case 5:u.label++,r=c[1],c=[0];continue;case 7:c=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){u=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){u.label=c[1];break}if(6===c[0]&&u.label<o[1]){u.label=o[1],o=c;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(c);break}o[2]&&u.ops.pop(),u.trys.pop();continue}c=e.call(t,u)}catch(t){c=[6,t],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(t){return e.app.use(p),e.app.pluginSettingsManager.add(y.A,{title:'{{t("Multi-app manager (deprecated)", { ns: "'.concat(y.A,'" })}}'),icon:"AppstoreOutlined",Component:O,sort:1e3,aclSnippet:"pm.multi-app-manager.applications"}),[2]})},function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function u(t){b(i,r,o,u,a,"next",t)}function a(t){b(i,r,o,u,a,"throw",t)}u(void 0)})})()}},{key:"extendFormSchema",value:function(t){m()(f.kn,t)}}],function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(n.prototype,e),n}(A(t.Plugin)),P=S}(),x}()});
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,19 +8,19 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "2.1.0-
|
|
11
|
+
"@nocobase/client": "2.1.0-beta.1",
|
|
12
12
|
"antd": "5.24.2",
|
|
13
13
|
"react": "18.2.0",
|
|
14
14
|
"@formily/react": "2.3.7",
|
|
15
15
|
"@formily/shared": "2.3.7",
|
|
16
|
+
"@ant-design/icons": "5.6.1",
|
|
16
17
|
"antd-style": "3.7.1",
|
|
17
18
|
"react-router-dom": "6.30.1",
|
|
18
19
|
"lodash": "4.17.21",
|
|
19
20
|
"react-i18next": "11.18.6",
|
|
20
|
-
"@nocobase/database": "2.1.0-
|
|
21
|
-
"@nocobase/server": "2.1.0-
|
|
22
|
-
"@nocobase/telemetry": "2.1.0-
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"@nocobase/utils": "2.1.0-alpha.1"
|
|
21
|
+
"@nocobase/database": "2.1.0-beta.1",
|
|
22
|
+
"@nocobase/server": "2.1.0-beta.1",
|
|
23
|
+
"@nocobase/telemetry": "2.1.0-beta.1",
|
|
24
|
+
"async-mutex": "0.5.0",
|
|
25
|
+
"@nocobase/utils": "2.1.0-beta.1"
|
|
26
26
|
};
|
package/dist/locale/en-US.json
CHANGED
|
@@ -22,5 +22,6 @@
|
|
|
22
22
|
"Start mode": "Start mode",
|
|
23
23
|
"Start on first visit": "Start on first visit",
|
|
24
24
|
"Start with main application": "Start with main application",
|
|
25
|
-
"When migrate data, the system automatically assigns an incrementing port number to each application based on this port number. You can also manually modify port number after the migrate.": "When migrate data, the system automatically assigns an incrementing port number to each application based on this port number. You can also manually modify port number after the migrate."
|
|
26
|
-
|
|
25
|
+
"When migrate data, the system automatically assigns an incrementing port number to each application based on this port number. You can also manually modify port number after the migrate.": "When migrate data, the system automatically assigns an incrementing port number to each application based on this port number. You can also manually modify port number after the migrate.",
|
|
26
|
+
"Migrate to app supervisor": "Migrate to app supervisor"
|
|
27
|
+
}
|
package/dist/locale/zh-CN.json
CHANGED
|
@@ -22,5 +22,6 @@
|
|
|
22
22
|
"Start mode": "启动方式",
|
|
23
23
|
"Start on first visit": "首次访问时启动",
|
|
24
24
|
"Start with main application": "随主应用一同启动",
|
|
25
|
-
"When migrate data, the system automatically assigns an incrementing port number to each application based on this port number. You can also manually modify port number after the migrate.": "迁移数据时,系统会基于该端口号自动为每个应用分配一个递增的端口号,您也可以在迁移后手动修改。"
|
|
26
|
-
|
|
25
|
+
"When migrate data, the system automatically assigns an incrementing port number to each application based on this port number. You can also manually modify port number after the migrate.": "迁移数据时,系统会基于该端口号自动为每个应用分配一个递增的端口号,您也可以在迁移后手动修改。",
|
|
26
|
+
"Migrate to app supervisor": "迁移到应用监管器"
|
|
27
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import EventEmitter = require('eventemitter3');
|
|
2
|
+
import { Queue, RunFunction } from './queue';
|
|
3
|
+
import PriorityQueue from './priority-queue';
|
|
4
|
+
import { QueueAddOptions, DefaultAddOptions, Options } from './options';
|
|
5
|
+
declare type Task<TaskResultType> = (() => PromiseLike<TaskResultType>) | (() => TaskResultType);
|
|
6
|
+
/**
|
|
7
|
+
Promise queue with concurrency control.
|
|
8
|
+
*/
|
|
9
|
+
export default class PQueue<QueueType extends Queue<RunFunction, EnqueueOptionsType> = PriorityQueue, EnqueueOptionsType extends QueueAddOptions = DefaultAddOptions> extends EventEmitter<'active' | 'idle' | 'add' | 'next'> {
|
|
10
|
+
private readonly _carryoverConcurrencyCount;
|
|
11
|
+
private readonly _isIntervalIgnored;
|
|
12
|
+
private _intervalCount;
|
|
13
|
+
private readonly _intervalCap;
|
|
14
|
+
private readonly _interval;
|
|
15
|
+
private _intervalEnd;
|
|
16
|
+
private _intervalId?;
|
|
17
|
+
private _timeoutId?;
|
|
18
|
+
private _queue;
|
|
19
|
+
private readonly _queueClass;
|
|
20
|
+
private _pendingCount;
|
|
21
|
+
private _concurrency;
|
|
22
|
+
private _isPaused;
|
|
23
|
+
private _resolveEmpty;
|
|
24
|
+
private _resolveIdle;
|
|
25
|
+
private _timeout?;
|
|
26
|
+
private readonly _throwOnTimeout;
|
|
27
|
+
constructor(options?: Options<QueueType, EnqueueOptionsType>);
|
|
28
|
+
private get _doesIntervalAllowAnother();
|
|
29
|
+
private get _doesConcurrentAllowAnother();
|
|
30
|
+
private _next;
|
|
31
|
+
private _resolvePromises;
|
|
32
|
+
private _onResumeInterval;
|
|
33
|
+
private _isIntervalPaused;
|
|
34
|
+
private _tryToStartAnother;
|
|
35
|
+
private _initializeIntervalIfNeeded;
|
|
36
|
+
private _onInterval;
|
|
37
|
+
/**
|
|
38
|
+
Executes all queued functions until it reaches the limit.
|
|
39
|
+
*/
|
|
40
|
+
private _processQueue;
|
|
41
|
+
get concurrency(): number;
|
|
42
|
+
set concurrency(newConcurrency: number);
|
|
43
|
+
/**
|
|
44
|
+
Adds a sync or async task to the queue. Always returns a promise.
|
|
45
|
+
*/
|
|
46
|
+
add<TaskResultType>(fn: Task<TaskResultType>, options?: Partial<EnqueueOptionsType>): Promise<TaskResultType>;
|
|
47
|
+
/**
|
|
48
|
+
Same as `.add()`, but accepts an array of sync or async functions.
|
|
49
|
+
|
|
50
|
+
@returns A promise that resolves when all functions are resolved.
|
|
51
|
+
*/
|
|
52
|
+
addAll<TaskResultsType>(functions: ReadonlyArray<Task<TaskResultsType>>, options?: EnqueueOptionsType): Promise<TaskResultsType[]>;
|
|
53
|
+
/**
|
|
54
|
+
Start (or resume) executing enqueued tasks within concurrency limit. No need to call this if queue is not paused (via `options.autoStart = false` or by `.pause()` method.)
|
|
55
|
+
*/
|
|
56
|
+
start(): this;
|
|
57
|
+
/**
|
|
58
|
+
Put queue execution on hold.
|
|
59
|
+
*/
|
|
60
|
+
pause(): void;
|
|
61
|
+
/**
|
|
62
|
+
Clear the queue.
|
|
63
|
+
*/
|
|
64
|
+
clear(): void;
|
|
65
|
+
/**
|
|
66
|
+
Can be called multiple times. Useful if you for example add additional items at a later time.
|
|
67
|
+
|
|
68
|
+
@returns A promise that settles when the queue becomes empty.
|
|
69
|
+
*/
|
|
70
|
+
onEmpty(): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
The difference with `.onEmpty` is that `.onIdle` guarantees that all work from the queue has finished. `.onEmpty` merely signals that the queue is empty, but it could mean that some promises haven't completed yet.
|
|
73
|
+
|
|
74
|
+
@returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`.
|
|
75
|
+
*/
|
|
76
|
+
onIdle(): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
Size of the queue.
|
|
79
|
+
*/
|
|
80
|
+
get size(): number;
|
|
81
|
+
/**
|
|
82
|
+
Size of the queue, filtered by the given options.
|
|
83
|
+
|
|
84
|
+
For example, this can be used to find the number of items remaining in the queue with a specific priority level.
|
|
85
|
+
*/
|
|
86
|
+
sizeBy(options: Readonly<Partial<EnqueueOptionsType>>): number;
|
|
87
|
+
/**
|
|
88
|
+
Number of pending promises.
|
|
89
|
+
*/
|
|
90
|
+
get pending(): number;
|
|
91
|
+
/**
|
|
92
|
+
Whether the queue is currently paused.
|
|
93
|
+
*/
|
|
94
|
+
get isPaused(): boolean;
|
|
95
|
+
get timeout(): number | undefined;
|
|
96
|
+
/**
|
|
97
|
+
Set the timeout for future operations.
|
|
98
|
+
*/
|
|
99
|
+
set timeout(milliseconds: number | undefined);
|
|
100
|
+
}
|
|
101
|
+
export { Queue, QueueAddOptions, DefaultAddOptions, Options };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(){"use strict";var e={330:function(e){e.exports=(e,t)=>{t=t||(()=>{});return e.then((e=>new Promise((e=>{e(t())})).then((()=>e))),(e=>new Promise((e=>{e(t())})).then((()=>{throw e}))))}},291:function(e,t){Object.defineProperty(t,"__esModule",{value:true});function lowerBound(e,t,n){let r=0;let i=e.length;while(i>0){const s=i/2|0;let o=r+s;if(n(e[o],t)<=0){r=++o;i-=s+1}else{i=s}}return r}t["default"]=lowerBound},492:function(e,t,n){Object.defineProperty(t,"__esModule",{value:true});const r=n(291);class PriorityQueue{constructor(){this._queue=[]}enqueue(e,t){t=Object.assign({priority:0},t);const n={priority:t.priority,run:e};if(this.size&&this._queue[this.size-1].priority>=t.priority){this._queue.push(n);return}const i=r.default(this._queue,n,((e,t)=>t.priority-e.priority));this._queue.splice(i,0,n)}dequeue(){const e=this._queue.shift();return e===null||e===void 0?void 0:e.run}filter(e){return this._queue.filter((t=>t.priority===e.priority)).map((e=>e.run))}get size(){return this._queue.length}}t["default"]=PriorityQueue},924:function(e){var t=Object.prototype.hasOwnProperty,n="~";function Events(){}if(Object.create){Events.prototype=Object.create(null);if(!(new Events).__proto__)n=false}function EE(e,t,n){this.fn=e;this.context=t;this.once=n||false}function addListener(e,t,r,i,s){if(typeof r!=="function"){throw new TypeError("The listener must be a function")}var o=new EE(r,i||e,s),u=n?n+t:t;if(!e._events[u])e._events[u]=o,e._eventsCount++;else if(!e._events[u].fn)e._events[u].push(o);else e._events[u]=[e._events[u],o];return e}function clearEvent(e,t){if(--e._eventsCount===0)e._events=new Events;else delete e._events[t]}function EventEmitter(){this._events=new Events;this._eventsCount=0}EventEmitter.prototype.eventNames=function eventNames(){var e=[],r,i;if(this._eventsCount===0)return e;for(i in r=this._events){if(t.call(r,i))e.push(n?i.slice(1):i)}if(Object.getOwnPropertySymbols){return e.concat(Object.getOwnPropertySymbols(r))}return e};EventEmitter.prototype.listeners=function listeners(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,s=r.length,o=new Array(s);i<s;i++){o[i]=r[i].fn}return o};EventEmitter.prototype.listenerCount=function listenerCount(e){var t=n?n+e:e,r=this._events[t];if(!r)return 0;if(r.fn)return 1;return r.length};EventEmitter.prototype.emit=function emit(e,t,r,i,s,o){var u=n?n+e:e;if(!this._events[u])return false;var a=this._events[u],l=arguments.length,c,h;if(a.fn){if(a.once)this.removeListener(e,a.fn,undefined,true);switch(l){case 1:return a.fn.call(a.context),true;case 2:return a.fn.call(a.context,t),true;case 3:return a.fn.call(a.context,t,r),true;case 4:return a.fn.call(a.context,t,r,i),true;case 5:return a.fn.call(a.context,t,r,i,s),true;case 6:return a.fn.call(a.context,t,r,i,s,o),true}for(h=1,c=new Array(l-1);h<l;h++){c[h-1]=arguments[h]}a.fn.apply(a.context,c)}else{var _=a.length,f;for(h=0;h<_;h++){if(a[h].once)this.removeListener(e,a[h].fn,undefined,true);switch(l){case 1:a[h].fn.call(a[h].context);break;case 2:a[h].fn.call(a[h].context,t);break;case 3:a[h].fn.call(a[h].context,t,r);break;case 4:a[h].fn.call(a[h].context,t,r,i);break;default:if(!c)for(f=1,c=new Array(l-1);f<l;f++){c[f-1]=arguments[f]}a[h].fn.apply(a[h].context,c)}}}return true};EventEmitter.prototype.on=function on(e,t,n){return addListener(this,e,t,n,false)};EventEmitter.prototype.once=function once(e,t,n){return addListener(this,e,t,n,true)};EventEmitter.prototype.removeListener=function removeListener(e,t,r,i){var s=n?n+e:e;if(!this._events[s])return this;if(!t){clearEvent(this,s);return this}var o=this._events[s];if(o.fn){if(o.fn===t&&(!i||o.once)&&(!r||o.context===r)){clearEvent(this,s)}}else{for(var u=0,a=[],l=o.length;u<l;u++){if(o[u].fn!==t||i&&!o[u].once||r&&o[u].context!==r){a.push(o[u])}}if(a.length)this._events[s]=a.length===1?a[0]:a;else clearEvent(this,s)}return this};EventEmitter.prototype.removeAllListeners=function removeAllListeners(e){var t;if(e){t=n?n+e:e;if(this._events[t])clearEvent(this,t)}else{this._events=new Events;this._eventsCount=0}return this};EventEmitter.prototype.off=EventEmitter.prototype.removeListener;EventEmitter.prototype.addListener=EventEmitter.prototype.on;EventEmitter.prefixed=n;EventEmitter.EventEmitter=EventEmitter;if(true){e.exports=EventEmitter}},424:function(e,t,n){const r=n(330);class TimeoutError extends Error{constructor(e){super(e);this.name="TimeoutError"}}const pTimeout=(e,t,n)=>new Promise(((i,s)=>{if(typeof t!=="number"||t<0){throw new TypeError("Expected `milliseconds` to be a positive number")}if(t===Infinity){i(e);return}const o=setTimeout((()=>{if(typeof n==="function"){try{i(n())}catch(e){s(e)}return}const r=typeof n==="string"?n:`Promise timed out after ${t} milliseconds`;const o=n instanceof Error?n:new TimeoutError(r);if(typeof e.cancel==="function"){e.cancel()}s(o)}),t);r(e.then(i,s),(()=>{clearTimeout(o)}))}));e.exports=pTimeout;e.exports["default"]=pTimeout;e.exports.TimeoutError=TimeoutError}};var t={};function __nccwpck_require__(n){var r=t[n];if(r!==undefined){return r.exports}var i=t[n]={exports:{}};var s=true;try{e[n](i,i.exports,__nccwpck_require__);s=false}finally{if(s)delete t[n]}return i.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var n={};!function(){var e=n;Object.defineProperty(e,"__esModule",{value:true});const t=__nccwpck_require__(924);const r=__nccwpck_require__(424);const i=__nccwpck_require__(492);const empty=()=>{};const s=new r.TimeoutError;class PQueue extends t{constructor(e){var t,n,r,s;super();this._intervalCount=0;this._intervalEnd=0;this._pendingCount=0;this._resolveEmpty=empty;this._resolveIdle=empty;e=Object.assign({carryoverConcurrencyCount:false,intervalCap:Infinity,interval:0,concurrency:Infinity,autoStart:true,queueClass:i.default},e);if(!(typeof e.intervalCap==="number"&&e.intervalCap>=1)){throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(n=(t=e.intervalCap)===null||t===void 0?void 0:t.toString())!==null&&n!==void 0?n:""}\` (${typeof e.intervalCap})`)}if(e.interval===undefined||!(Number.isFinite(e.interval)&&e.interval>=0)){throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(s=(r=e.interval)===null||r===void 0?void 0:r.toString())!==null&&s!==void 0?s:""}\` (${typeof e.interval})`)}this._carryoverConcurrencyCount=e.carryoverConcurrencyCount;this._isIntervalIgnored=e.intervalCap===Infinity||e.interval===0;this._intervalCap=e.intervalCap;this._interval=e.interval;this._queue=new e.queueClass;this._queueClass=e.queueClass;this.concurrency=e.concurrency;this._timeout=e.timeout;this._throwOnTimeout=e.throwOnTimeout===true;this._isPaused=e.autoStart===false}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--;this._tryToStartAnother();this.emit("next")}_resolvePromises(){this._resolveEmpty();this._resolveEmpty=empty;if(this._pendingCount===0){this._resolveIdle();this._resolveIdle=empty;this.emit("idle")}}_onResumeInterval(){this._onInterval();this._initializeIntervalIfNeeded();this._timeoutId=undefined}_isIntervalPaused(){const e=Date.now();if(this._intervalId===undefined){const t=this._intervalEnd-e;if(t<0){this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0}else{if(this._timeoutId===undefined){this._timeoutId=setTimeout((()=>{this._onResumeInterval()}),t)}return true}}return false}_tryToStartAnother(){if(this._queue.size===0){if(this._intervalId){clearInterval(this._intervalId)}this._intervalId=undefined;this._resolvePromises();return false}if(!this._isPaused){const e=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){const t=this._queue.dequeue();if(!t){return false}this.emit("active");t();if(e){this._initializeIntervalIfNeeded()}return true}}return false}_initializeIntervalIfNeeded(){if(this._isIntervalIgnored||this._intervalId!==undefined){return}this._intervalId=setInterval((()=>{this._onInterval()}),this._interval);this._intervalEnd=Date.now()+this._interval}_onInterval(){if(this._intervalCount===0&&this._pendingCount===0&&this._intervalId){clearInterval(this._intervalId);this._intervalId=undefined}this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0;this._processQueue()}_processQueue(){while(this._tryToStartAnother()){}}get concurrency(){return this._concurrency}set concurrency(e){if(!(typeof e==="number"&&e>=1)){throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`)}this._concurrency=e;this._processQueue()}async add(e,t={}){return new Promise(((n,i)=>{const run=async()=>{this._pendingCount++;this._intervalCount++;try{const o=this._timeout===undefined&&t.timeout===undefined?e():r.default(Promise.resolve(e()),t.timeout===undefined?this._timeout:t.timeout,(()=>{if(t.throwOnTimeout===undefined?this._throwOnTimeout:t.throwOnTimeout){i(s)}return undefined}));n(await o)}catch(e){i(e)}this._next()};this._queue.enqueue(run,t);this._tryToStartAnother();this.emit("add")}))}async addAll(e,t){return Promise.all(e.map((async e=>this.add(e,t))))}start(){if(!this._isPaused){return this}this._isPaused=false;this._processQueue();return this}pause(){this._isPaused=true}clear(){this._queue=new this._queueClass}async onEmpty(){if(this._queue.size===0){return}return new Promise((e=>{const t=this._resolveEmpty;this._resolveEmpty=()=>{t();e()}}))}async onIdle(){if(this._pendingCount===0&&this._queue.size===0){return}return new Promise((e=>{const t=this._resolveIdle;this._resolveIdle=()=>{t();e()}}))}get size(){return this._queue.size}sizeBy(e){return this._queue.filter(e).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(e){this._timeout=e}}e["default"]=PQueue}();module.exports=n})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function lowerBound<T>(array: readonly T[], value: T, comparator: (a: T, b: T) => number): number;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// Port of lower_bound from https://en.cppreference.com/w/cpp/algorithm/lower_bound
|
|
4
|
+
// Used to compute insertion index to keep queue sorted after insertion
|
|
5
|
+
function lowerBound(array, value, comparator) {
|
|
6
|
+
let first = 0;
|
|
7
|
+
let count = array.length;
|
|
8
|
+
while (count > 0) {
|
|
9
|
+
const step = (count / 2) | 0;
|
|
10
|
+
let it = first + step;
|
|
11
|
+
if (comparator(array[it], value) <= 0) {
|
|
12
|
+
first = ++it;
|
|
13
|
+
count -= step + 1;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
count = step;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return first;
|
|
20
|
+
}
|
|
21
|
+
exports.default = lowerBound;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Queue, RunFunction } from './queue';
|
|
2
|
+
export interface QueueAddOptions {
|
|
3
|
+
readonly [key: string]: unknown;
|
|
4
|
+
}
|
|
5
|
+
export interface Options<QueueType extends Queue<RunFunction, QueueOptions>, QueueOptions extends QueueAddOptions> {
|
|
6
|
+
/**
|
|
7
|
+
Concurrency limit.
|
|
8
|
+
|
|
9
|
+
Minimum: `1`.
|
|
10
|
+
|
|
11
|
+
@default Infinity
|
|
12
|
+
*/
|
|
13
|
+
readonly concurrency?: number;
|
|
14
|
+
/**
|
|
15
|
+
Whether queue tasks within concurrency limit, are auto-executed as soon as they're added.
|
|
16
|
+
|
|
17
|
+
@default true
|
|
18
|
+
*/
|
|
19
|
+
readonly autoStart?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
Class with a `enqueue` and `dequeue` method, and a `size` getter. See the [Custom QueueClass](https://github.com/sindresorhus/p-queue#custom-queueclass) section.
|
|
22
|
+
*/
|
|
23
|
+
readonly queueClass?: new () => QueueType;
|
|
24
|
+
/**
|
|
25
|
+
The max number of runs in the given interval of time.
|
|
26
|
+
|
|
27
|
+
Minimum: `1`.
|
|
28
|
+
|
|
29
|
+
@default Infinity
|
|
30
|
+
*/
|
|
31
|
+
readonly intervalCap?: number;
|
|
32
|
+
/**
|
|
33
|
+
The length of time in milliseconds before the interval count resets. Must be finite.
|
|
34
|
+
|
|
35
|
+
Minimum: `0`.
|
|
36
|
+
|
|
37
|
+
@default 0
|
|
38
|
+
*/
|
|
39
|
+
readonly interval?: number;
|
|
40
|
+
/**
|
|
41
|
+
Whether the task must finish in the given interval or will be carried over into the next interval count.
|
|
42
|
+
|
|
43
|
+
@default false
|
|
44
|
+
*/
|
|
45
|
+
readonly carryoverConcurrencyCount?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
Per-operation timeout in milliseconds. Operations fulfill once `timeout` elapses if they haven't already.
|
|
48
|
+
*/
|
|
49
|
+
timeout?: number;
|
|
50
|
+
/**
|
|
51
|
+
Whether or not a timeout is considered an exception.
|
|
52
|
+
|
|
53
|
+
@default false
|
|
54
|
+
*/
|
|
55
|
+
throwOnTimeout?: boolean;
|
|
56
|
+
}
|
|
57
|
+
export interface DefaultAddOptions extends QueueAddOptions {
|
|
58
|
+
/**
|
|
59
|
+
Priority of operation. Operations with greater priority will be scheduled first.
|
|
60
|
+
|
|
61
|
+
@default 0
|
|
62
|
+
*/
|
|
63
|
+
readonly priority?: number;
|
|
64
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Queue, RunFunction } from './queue';
|
|
2
|
+
import { QueueAddOptions } from './options';
|
|
3
|
+
export interface PriorityQueueOptions extends QueueAddOptions {
|
|
4
|
+
priority?: number;
|
|
5
|
+
}
|
|
6
|
+
export default class PriorityQueue implements Queue<RunFunction, PriorityQueueOptions> {
|
|
7
|
+
private readonly _queue;
|
|
8
|
+
enqueue(run: RunFunction, options?: Partial<PriorityQueueOptions>): void;
|
|
9
|
+
dequeue(): RunFunction | undefined;
|
|
10
|
+
filter(options: Readonly<Partial<PriorityQueueOptions>>): RunFunction[];
|
|
11
|
+
get size(): number;
|
|
12
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const lower_bound_1 = require("./lower-bound");
|
|
4
|
+
class PriorityQueue {
|
|
5
|
+
constructor() {
|
|
6
|
+
this._queue = [];
|
|
7
|
+
}
|
|
8
|
+
enqueue(run, options) {
|
|
9
|
+
options = Object.assign({ priority: 0 }, options);
|
|
10
|
+
const element = {
|
|
11
|
+
priority: options.priority,
|
|
12
|
+
run
|
|
13
|
+
};
|
|
14
|
+
if (this.size && this._queue[this.size - 1].priority >= options.priority) {
|
|
15
|
+
this._queue.push(element);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const index = lower_bound_1.default(this._queue, element, (a, b) => b.priority - a.priority);
|
|
19
|
+
this._queue.splice(index, 0, element);
|
|
20
|
+
}
|
|
21
|
+
dequeue() {
|
|
22
|
+
const item = this._queue.shift();
|
|
23
|
+
return item === null || item === void 0 ? void 0 : item.run;
|
|
24
|
+
}
|
|
25
|
+
filter(options) {
|
|
26
|
+
return this._queue.filter((element) => element.priority === options.priority).map((element) => element.run);
|
|
27
|
+
}
|
|
28
|
+
get size() {
|
|
29
|
+
return this._queue.length;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.default = PriorityQueue;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare type RunFunction = () => Promise<unknown>;
|
|
2
|
+
export interface Queue<Element, Options> {
|
|
3
|
+
size: number;
|
|
4
|
+
filter: (options: Partial<Options>) => Element[];
|
|
5
|
+
dequeue: () => Element | undefined;
|
|
6
|
+
enqueue: (run: Element, options?: Partial<Options>) => void;
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|