plugin-migration-manager 2.0.0
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/INSTALL.md +100 -0
- package/LICENSE +201 -0
- package/Migration_Manager_Documentation_1.0.pdf +0 -0
- package/README.md +30 -0
- package/client.d.ts +2 -0
- package/client.js +1 -0
- package/dist/client/bf902aacdcc9b8b8.js +10 -0
- package/dist/client/index.js +10 -0
- package/dist/externalVersion.js +18 -0
- package/dist/index.js +48 -0
- package/dist/locale/en-US.json +8 -0
- package/dist/locale/id-ID.json +8 -0
- package/dist/server/controllers/migration.js +1161 -0
- package/dist/server/index.js +70 -0
- package/package.json +23 -0
- package/plugin-migration-manager-2.0.0.tgz +0 -0
- package/server.d.ts +2 -0
- package/server.js +1 -0
- package/src/client/index.tsx +18 -0
- package/src/client/pages/MigrationPage.tsx +565 -0
- package/src/index.ts +2 -0
- package/src/locale/en-US.json +8 -0
- package/src/locale/id-ID.json +8 -0
- package/src/server/controllers/migration.ts +1217 -0
- package/src/server/index.ts +34 -0
package/INSTALL.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Installation Guide - Migration Manager Plugin
|
|
2
|
+
|
|
3
|
+
## Prerequisites
|
|
4
|
+
|
|
5
|
+
- Nocobase installed (Git source or create-nocobase-app)
|
|
6
|
+
- Node.js >= 18
|
|
7
|
+
- Yarn package manager
|
|
8
|
+
- Admin access to Nocobase
|
|
9
|
+
|
|
10
|
+
## Installation Steps
|
|
11
|
+
|
|
12
|
+
### Step 1: Extract ZIP
|
|
13
|
+
```bash
|
|
14
|
+
unzip plugin-migration-manager.zip
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Step 2: Copy to Nocobase
|
|
18
|
+
```bash
|
|
19
|
+
# Copy plugin to Nocobase plugins directory
|
|
20
|
+
cp -r plugin-migration-manager /path/to/your/nocobase/packages/plugins/@nocobase/
|
|
21
|
+
|
|
22
|
+
# Example:
|
|
23
|
+
# cp -r plugin-migration-manager D:/work/diawan/nocobase-new/packages/plugins/@nocobase/
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Step 3: Install Dependencies
|
|
27
|
+
```bash
|
|
28
|
+
cd /path/to/your/nocobase
|
|
29
|
+
yarn install
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Step 4: Build Plugin
|
|
33
|
+
```bash
|
|
34
|
+
# Build specific plugin
|
|
35
|
+
yarn build packages/plugins/@nocobase/plugin-migration-manager
|
|
36
|
+
|
|
37
|
+
# Or build all
|
|
38
|
+
yarn build
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Step 5: Enable Plugin
|
|
42
|
+
|
|
43
|
+
**Option A: Via UI**
|
|
44
|
+
1. Start server: `yarn dev`
|
|
45
|
+
2. Login as admin
|
|
46
|
+
3. Open **Plugin Manager**
|
|
47
|
+
4. Find "Migration Manager"
|
|
48
|
+
5. Click **Enable**
|
|
49
|
+
|
|
50
|
+
**Option B: Via CLI**
|
|
51
|
+
```bash
|
|
52
|
+
yarn pm enable @nocobase/plugin-migration-manager
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Step 6: Restart Server
|
|
56
|
+
```bash
|
|
57
|
+
# Stop server (Ctrl+C)
|
|
58
|
+
# Start again
|
|
59
|
+
yarn dev
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Step 7: Verify Installation
|
|
63
|
+
1. Login to Nocobase
|
|
64
|
+
2. Click **Settings** (gear icon)
|
|
65
|
+
3. You should see **Migration Manager** menu
|
|
66
|
+
4. Click to open the plugin
|
|
67
|
+
|
|
68
|
+
## Troubleshooting
|
|
69
|
+
|
|
70
|
+
### Plugin not showing
|
|
71
|
+
```bash
|
|
72
|
+
yarn clean
|
|
73
|
+
yarn build
|
|
74
|
+
yarn pm enable @nocobase/plugin-migration-manager
|
|
75
|
+
yarn dev
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Build errors
|
|
79
|
+
```bash
|
|
80
|
+
rm -rf packages/plugins/@nocobase/plugin-migration-manager/{lib,es,dist}
|
|
81
|
+
yarn build packages/plugins/@nocobase/plugin-migration-manager
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Permission denied
|
|
85
|
+
- Ensure you're logged in as admin
|
|
86
|
+
- Check ACL settings
|
|
87
|
+
|
|
88
|
+
## Uninstall
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
yarn pm disable @nocobase/plugin-migration-manager
|
|
92
|
+
rm -rf packages/plugins/@nocobase/plugin-migration-manager
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Support
|
|
96
|
+
|
|
97
|
+
For issues and questions, check:
|
|
98
|
+
- Server logs
|
|
99
|
+
- Browser console
|
|
100
|
+
- README.md for usage guide
|
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
Binary file
|
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Migration Manager Plugin
|
|
2
|
+
|
|
3
|
+
Migrate **collections**, **workflows**, **UI schemas**, and **desktop routes** between NocoBase instances.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Export** collection structures, workflow definitions, UI schema trees, and menu/navigation routes
|
|
8
|
+
- **Import** with preview validation before applying changes
|
|
9
|
+
- **Merge** mode for collections (add new fields without deleting existing ones)
|
|
10
|
+
- **Overwrite** mode for workflows and UI schemas (full replacement)
|
|
11
|
+
- **Admin-only** access control
|
|
12
|
+
|
|
13
|
+
## What Gets Migrated
|
|
14
|
+
|
|
15
|
+
| Component | Export Content | Import Mode |
|
|
16
|
+
|-----------|---------------|-------------|
|
|
17
|
+
| Collections | Schema & fields (no data) | Merge |
|
|
18
|
+
| Workflows | Definition + all nodes | Overwrite |
|
|
19
|
+
| UI Schemas | Complete schema tree | Overwrite |
|
|
20
|
+
| Desktop Routes | Menu/navigation tree | Create (skip duplicates) |
|
|
21
|
+
|
|
22
|
+
## API Endpoints
|
|
23
|
+
|
|
24
|
+
| Endpoint | Method | Description |
|
|
25
|
+
|----------|--------|-------------|
|
|
26
|
+
| `migration:list` | GET | List exportable items |
|
|
27
|
+
| `migration:export` | POST | Export selected items to JSON |
|
|
28
|
+
| `migration:validate` | POST | Pre-import validation |
|
|
29
|
+
| `migration:import` | POST | Import from JSON |
|
|
30
|
+
| `migration:apply` | POST | Sync DB schema after import |
|
package/client.d.ts
ADDED
package/client.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/client/index.js');
|
|
@@ -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
|
+
|
|
10
|
+
"use strict";(self.webpackChunkplugin_migration_manager=self.webpackChunkplugin_migration_manager||[]).push([["545"],{797:function(e,t,n){n.r(t),n.d(t,{MigrationPage:function(){return k}});var l=n(156),r=n.n(l),o=n(721),a=n(482),i=n(772);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,l=Array(t);n<t;n++)l[n]=e[n];return l}function u(e,t,n,l,r,o,a){try{var i=e[o](a),c=i.value}catch(e){n(e);return}i.done?t(c):Promise.resolve(c).then(l,r)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(l,r){var o=e.apply(t,n);function a(e){u(o,l,r,a,i,"next",e)}function i(e){u(o,l,r,a,i,"throw",e)}a(void 0)})}}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},l=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(l=l.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),l.forEach(function(t){var l;l=n[t],t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l})}return e}function m(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);n.push.apply(n,l)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,l,r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],a=!0,i=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){i=!0,l=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw l}}return o}}(e,t)||g(e,t)||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 f(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||g(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}}function h(e,t){var n,l,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function i(o){return function(i){var c=[o,i];if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,l&&(r=2&c[0]?l.return:c[0]?l.throw||((r=l.return)&&r.call(l),0):l.next)&&!(r=r.call(l,c[1])).done)return r;switch(l=0,r&&(c=[2&c[0],r.value]),c[0]){case 0:case 1:r=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,l=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!r||c[1]>r[0]&&c[1]<r[3])){a.label=c[1];break}if(6===c[0]&&a.label<r[1]){a.label=r[1],r=c;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(c);break}r[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],l=0}finally{n=r=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var y=o.Typography.Title,v=o.Typography.Text,w=o.Input.Search;function E(e){var t,n,l;return null!=(l=null!=(n=null==e||null==(t=e.data)?void 0:t.data)?n:null==e?void 0:e.data)?l:e}function S(e){return e?e.replace(/\{\{t\("(.+?)"\)\}\}/g,"$1").replace(/_/g," ").replace(/\b\w/g,function(e){return e.toUpperCase()}):""}var b=function(e){return new Promise(function(t){return setTimeout(t,e)})},k=function(){var e,t,n,c=(0,i.useAPIClient)(),u=p((0,l.useState)("export"),2),g=u[0],k=u[1],C=p((0,l.useState)({collections:[],workflows:[],uiSchemas:[]}),2),x=C[0],O=C[1],I=p((0,l.useState)([]),2),T=I[0],z=I[1],j=p((0,l.useState)([]),2),U=j[0],A=j[1],P=p((0,l.useState)([]),2),M=P[0],R=P[1],D=p((0,l.useState)(!1),2),L=D[0],N=D[1],W=p((0,l.useState)(!1),2),K=W[0],q=W[1],B=p((0,l.useState)(null),2),F=B[0],_=B[1],J=p((0,l.useState)(!1),2),G=J[0],V=J[1],$=p((0,l.useState)(""),2),H=$[0],Y=$[1],Q=p((0,l.useState)(""),2),X=Q[0],Z=Q[1],ee=p((0,l.useState)(""),2),et=ee[0],en=ee[1],el=p((0,l.useState)({current:1,pageSize:10}),2),er=el[0],eo=el[1],ea=p((0,l.useState)({current:1,pageSize:10}),2),ei=ea[0],ec=ea[1],eu=p((0,l.useState)({current:1,pageSize:10}),2),es=eu[0],ed=eu[1];(0,l.useEffect)(function(){var e=function(e){(L||K)&&(e.preventDefault(),e.returnValue="")};return window.addEventListener("beforeunload",e),function(){return window.removeEventListener("beforeunload",e)}},[L,K]);var em=(0,i.useRequest)({url:"migration:list",method:"get"},{manual:!1,onSuccess:function(e){var t,n,l,r=E(e);O({collections:null!=(t=null==r?void 0:r.collections)?t:[],workflows:null!=(n=null==r?void 0:r.workflows)?n:[],uiSchemas:null!=(l=null==r?void 0:r.uiSchemas)?l:[]})},onError:function(){return O({collections:[],workflows:[],uiSchemas:[]})}}),ep=em.run,ef=em.loading,eg=(0,i.useRequest)({url:"migration:export",method:"post"},{manual:!0,onSuccess:function(e){var t,n,l,r,a,i,c,u,s=E(e);if(!((null==s||null==(t=s.collections)?void 0:t.length)>0||(null==s||null==(n=s.workflows)?void 0:n.length)>0||(null==s||null==(l=s.uiSchemas)?void 0:l.length)>0||(null==s||null==(r=s.desktopRoutes)?void 0:r.length)>0))return void o.message.warning("Export succeeded but no data.");var d=new Blob([JSON.stringify(s,null,2)],{type:"application/json"}),m=URL.createObjectURL(d),p=document.createElement("a");p.href=m,p.download="nocobase-migration-".concat(Date.now(),".json"),p.click(),URL.revokeObjectURL(m),o.message.success("Export successful! ".concat((null==(a=s.collections)?void 0:a.length)||0," collections, ").concat((null==(i=s.workflows)?void 0:i.length)||0," workflows, ").concat((null==(c=s.uiSchemas)?void 0:c.length)||0," UI schemas, ").concat((null==(u=s.desktopRoutes)?void 0:u.length)||0," routes"))},onError:function(e){return o.message.error("Export failed: ".concat(e.message))}}),eh=eg.run,ey=eg.loading,ev=(e=s(function(){var e,t,n=arguments;return h(this,function(l){switch(l.label){case 0:e=n.length>0&&void 0!==n[0]?n[0]:1e4,t=n.length>1&&void 0!==n[1]?n[1]:2e3,N(!0),l.label=1;case 1:return l.trys.push([1,,5,6]),[4,c.request({url:"app:restart",method:"post",timeout:6e4})];case 2:return l.sent(),[4,b(e)];case 3:return l.sent(),[4,b(t)];case 4:return l.sent(),[3,6];case 5:return N(!1),[7];case 6:return[2]}})}),function(){return e.apply(this,arguments)}),ew=(t=s(function(e){var t,n,l,r,o,a,i=arguments;return h(this,function(u){switch(u.label){case 0:t=i.length>1&&void 0!==i[1]?i[1]:15,n=i.length>2&&void 0!==i[2]?i[2]:1500,l=null,r=0,u.label=1;case 1:if(!(r<t))return[3,8];u.label=2;case 2:return u.trys.push([2,4,,7]),[4,c.request({url:"migration:apply",method:"post",data:{data:{collections:e}},headers:{"Content-Type":"application/json"},timeout:6e5})];case 3:return[2,E(u.sent())];case 4:if(l=o=u.sent(),!((null==o||null==(a=o.response)?void 0:a.status)===503||String((null==o?void 0:o.message)||"").includes("APP_COMMANDING")))return[3,6];return[4,b(n)];case 5:return u.sent(),[3,7];case 6:throw o;case 7:return r++,[3,1];case 8:throw l||Error("Apply failed after several attempts.")}})}),function(e){return t.apply(this,arguments)}),eE=(0,i.useRequest)(function(e){return c.request({url:"migration:import",method:"post",data:{data:e},headers:{"Content-Type":"application/json"},timeout:6e5})},{manual:!0,onSuccess:(n=s(function(e){var t,n,l,i,c,u,p,g,y,v,w,S,b,k,C,x,O,I,T,z,j;return h(this,function(U){return(O=(x=E(e)||{}).needsConfirmation,I=x.results,O)?(z=(null==I||null==(T=I.collections)?void 0:T.conflicts)||[],o.Modal.confirm({title:"Confirm Potentially Data-Altering Changes",icon:r().createElement(a.ExclamationCircleOutlined,null),width:760,okText:"Proceed & Override",cancelText:"Cancel",content:r().createElement("div",null,r().createElement(o.Alert,{type:"warning",showIcon:!0,message:"Conflicts were found on existing fields.",style:{marginBottom:12}}),r().createElement("div",{style:{maxHeight:360,overflow:"auto"}},r().createElement(o.Table,{size:"small",pagination:!1,rowKey:function(e){return"".concat(e.collection,".").concat(e.field)},dataSource:z,columns:[{title:"Collection",dataIndex:"collection"},{title:"Field",dataIndex:"field"},{title:"Current",render:function(e,t){return"type=".concat(t.current.type,", interface=").concat(t.current.interface,", unique=").concat(String(t.current.unique),", allowNull=").concat(String(t.current.allowNull),", pk=").concat(String(t.current.primaryKey))}},{title:"Incoming",render:function(e,t){return"type=".concat(t.incoming.type,", interface=").concat(t.incoming.interface,", unique=").concat(String(t.incoming.unique),", allowNull=").concat(String(t.incoming.allowNull),", pk=").concat(String(t.incoming.primaryKey))}}]}))),onOk:function(){F&&(V(!1),eS(m(d({},F),{options:{forceOverride:!0}})))}})):G&&F?(V(!1),eS(F)):(j=I||{},o.Modal.success({title:"Import Successful",content:r().createElement("div",null,r().createElement("p",null,"Collections: ",(null==(t=j.collections)?void 0:t.success)||0," succeeded, ",(null==(n=j.collections)?void 0:n.failed)||0," failed"),r().createElement("p",null,"Workflows: ",(null==(l=j.workflows)?void 0:l.success)||0," succeeded, ",(null==(i=j.workflows)?void 0:i.failed)||0," failed"),r().createElement("p",null,"UI Schemas: ",(null==(c=j.uiSchemas)?void 0:c.success)||0," succeeded, ",(null==(u=j.uiSchemas)?void 0:u.failed)||0," failed"),((null==(g=j.collections)||null==(p=g.errors)?void 0:p.length)>0||(null==(v=j.workflows)||null==(y=v.errors)?void 0:y.length)>0||(null==(S=j.uiSchemas)||null==(w=S.errors)?void 0:w.length)>0)&&r().createElement(o.Alert,{message:"Some errors occurred",description:r().createElement("ul",null,f((null==(b=j.collections)?void 0:b.errors)||[]).concat(f((null==(k=j.workflows)?void 0:k.errors)||[]),f((null==(C=j.uiSchemas)?void 0:C.errors)||[])).map(function(e,t){return r().createElement("li",{key:t},e.error||String(e))})),type:"warning",style:{marginTop:10}})),okText:"Continue",onOk:s(function(){var e,t,n,l,a;return h(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,4,5]),q(!0),[4,ev(12e3,2e3)];case 1:return i.sent(),[4,ew(((null==F?void 0:F.collections)||[]).map(function(e){return"string"==typeof e?{name:e}:e}),15,1500)];case 2:return l=i.sent(),o.Modal.success({title:"Apply Complete",content:r().createElement("div",null,r().createElement("p",null,"The changes have been successfully applied. Click ",r().createElement("strong",null,"Continue")," to refresh the page for the changes to take effect."),(null==l||null==(t=l.results)||null==(e=t.errors)?void 0:e.length)>0&&r().createElement(o.Alert,{type:"warning",message:"Errors occurred during apply",description:r().createElement("ul",{style:{marginBottom:0}},((null==l||null==(n=l.results)?void 0:n.errors)||[]).map(function(e,t){return r().createElement("li",{key:t},e.collection||e.route||e.schema||"item",": ",e.error)}))})),okText:"Continue",onOk:function(){window.location.reload()}}),[3,5];case 3:return a=i.sent(),o.message.error((null==a?void 0:a.message)||"Apply failed"),[3,5];case 4:return q(!1),_(null),ep(),[7];case 5:return[2]}})})}),ep()),[2]})}),function(e){return n.apply(this,arguments)}),onError:function(e){return o.message.error("Import failed: ".concat(e.message))}}),eS=eE.run,eb=eE.loading,ek=(0,l.useMemo)(function(){var e=H.trim().toLowerCase(),t=(x.collections||[]).filter(function(t){return(t.title||t.name||"").toLowerCase().includes(e)});return{total:t.length,data:t}},[x.collections,H]),eC=(0,l.useMemo)(function(){var e=(er.current-1)*er.pageSize;return ek.data.slice(e,e+er.pageSize)},[ek,er]),ex=(0,l.useMemo)(function(){var e=X.trim().toLowerCase(),t=(x.workflows||[]).filter(function(t){return(t.title||"").toLowerCase().includes(e)});return{total:t.length,data:t}},[x.workflows,X]),eO=(0,l.useMemo)(function(){var e=(ei.current-1)*ei.pageSize;return ex.data.slice(e,e+ei.pageSize)},[ex,ei]),eI=(0,l.useMemo)(function(){var e=et.trim().toLowerCase(),t=(x.uiSchemas||[]).filter(function(t){return(t.displayTitle||t.title||t.name||"").toLowerCase().includes(e)});return{total:t.length,data:t}},[x.uiSchemas,et]),eT=(0,l.useMemo)(function(){var e=(es.current-1)*es.pageSize;return eI.data.slice(e,e+es.pageSize)},[eI,es]);return r().createElement("div",{style:{padding:24,position:"relative"}},r().createElement(o.Card,null,r().createElement(y,{level:2},"Migration Manager"),r().createElement(v,{type:"secondary"},"Export and import collections, workflows, and UI schemas across NocoBase instances"),r().createElement(o.Tabs,{activeKey:g,onChange:k,items:[{label:"Export",key:"export",children:r().createElement(o.Space,{direction:"vertical",size:"large",style:{width:"100%"}},r().createElement(o.Card,{title:r().createElement(o.Space,null,r().createElement(a.DatabaseOutlined,null),"Collections"),size:"small"},r().createElement("div",{style:{marginBottom:12}},r().createElement(w,{allowClear:!0,placeholder:"Filter by Title",onSearch:function(e){Y(e),eo(m(d({},er),{current:1}))},onChange:function(e){Y(e.target.value),eo(m(d({},er),{current:1}))},value:H,style:{maxWidth:320}})),r().createElement(o.Table,{rowSelection:{selectedRowKeys:T,onChange:function(e){return z(e)}},columns:[{title:"Name",dataIndex:"name",key:"name"},{title:"Title",dataIndex:"title",key:"title",render:S},{title:"Fields",dataIndex:"fields",key:"fields"}],dataSource:eC,rowKey:"name",loading:ef,pagination:{current:er.current,pageSize:er.pageSize,total:ek.total,showSizeChanger:!0,onChange:function(e,t){return eo({current:e,pageSize:t})}},size:"small"})),r().createElement(o.Card,{title:r().createElement(o.Space,null,r().createElement(a.BranchesOutlined,null),"Workflows"),size:"small"},r().createElement("div",{style:{marginBottom:12}},r().createElement(w,{allowClear:!0,placeholder:"Filter by Title",onSearch:function(e){Z(e),ec(m(d({},ei),{current:1}))},onChange:function(e){Z(e.target.value),ec(m(d({},ei),{current:1}))},value:X,style:{maxWidth:320}})),r().createElement(o.Table,{rowSelection:{selectedRowKeys:U,onChange:function(e){return A(e)}},columns:[{title:"Title",dataIndex:"title",key:"title"},{title:"Key",dataIndex:"key",key:"key"},{title:"Status",dataIndex:"enabled",key:"enabled",render:function(e){return e?"Enabled":"Disabled"}}],dataSource:eO,rowKey:"id",loading:ef,pagination:{current:ei.current,pageSize:ei.pageSize,total:ex.total,showSizeChanger:!0,onChange:function(e,t){return ec({current:e,pageSize:t})}},size:"small"})),r().createElement(o.Card,{title:r().createElement(o.Space,null,r().createElement(a.LayoutOutlined,null),"UI Schemas"),size:"small"},r().createElement("div",{style:{marginBottom:12}},r().createElement(w,{allowClear:!0,placeholder:"Filter by Title",onSearch:function(e){en(e),ed(m(d({},es),{current:1}))},onChange:function(e){en(e.target.value),ed(m(d({},es),{current:1}))},value:et,style:{maxWidth:320}})),r().createElement(o.Table,{rowSelection:{selectedRowKeys:M,onChange:function(e){return R(e)}},columns:[{title:"Menu / Page",dataIndex:"displayTitle",key:"displayTitle",render:function(e,t){return r().createElement(o.Space,null,r().createElement(v,null,(null==t?void 0:t.displayTitle)||(null==t?void 0:t.title)||(null==t?void 0:t.name)||"Untitled"),r().createElement(o.Tag,null,null==t?void 0:t.type))}},{title:"UID",dataIndex:"schemaUid",key:"schemaUid"}],dataSource:eT,rowKey:"schemaUid",loading:ef,pagination:{current:es.current,pageSize:es.pageSize,total:eI.total,showSizeChanger:!0,onChange:function(e,t){return ed({current:e,pageSize:t})}},size:"small"})),r().createElement(o.Button,{type:"primary",icon:r().createElement(a.DownloadOutlined,null),onClick:function(){if(!T.length&&!U.length&&!M.length)return void o.message.warning("Select at least one item to export");o.Modal.confirm({title:"Export Confirmation",icon:r().createElement(a.ExclamationCircleOutlined,null),content:r().createElement("div",null,r().createElement("p",null,"You will export:"),r().createElement("ul",null,r().createElement("li",null,T.length," Collections"),r().createElement("li",null,U.length," Workflows"),r().createElement("li",null,M.length," UI Schemas/Routes")),r().createElement(o.Alert,{message:"Note",description:"Export includes collection structure, workflow config, UI schema subtree, and desktop routes.",type:"info",style:{marginTop:10}})),onOk:function(){eh({data:{collections:T,workflows:U,uiSchemas:[],desktopRoutes:M}})}})},loading:ey,size:"large",disabled:L||K},"Export Selected Items"))},{label:"Import",key:"import",children:r().createElement(o.Space,{direction:"vertical",size:"large",style:{width:"100%"}},r().createElement(o.Alert,{message:"Import from Development to Production",description:r().createElement("div",null,r().createElement("p",null,"Upload the exported JSON file from the development server."),r().createElement("p",null,r().createElement("strong",null,"What will be imported:")),r().createElement("ul",null,r().createElement("li",null,"Collection structure (without data)"),r().createElement("li",null,"Workflow configuration"),r().createElement("li",null,"UI Schema/Page design")),r().createElement("p",null,r().createElement("strong",null,"What will NOT be affected:")),r().createElement("ul",null,r().createElement("li",null,"Data within collections"),r().createElement("li",null,"Collections not present in the import file"))),type:"info"}),r().createElement(o.Upload,{accept:".json",beforeUpload:function(e){var t=new FileReader;return t.onload=function(e){try{var t,n,l,i,c=JSON.parse(null==(t=e.target)?void 0:t.result);_(c),V(!0),o.Modal.confirm({title:"Import Confirmation",icon:r().createElement(a.ExclamationCircleOutlined,null),content:r().createElement("div",null,r().createElement("p",null,"The file will import:"),r().createElement("ul",null,r().createElement("li",null,(null==(n=c.collections)?void 0:n.length)||0," Collections"),r().createElement("li",null,(null==(l=c.workflows)?void 0:l.length)||0," Workflows"),r().createElement("li",null,(null==(i=c.uiSchemas)?void 0:i.length)||0," UI Schemas")),r().createElement(o.Alert,{message:"Warning",description:"The first step will run a PREVIEW. If safe, the process will proceed automatically.",type:"warning",style:{marginTop:10}})),onOk:function(){return eS(m(d({},c),{options:{preview:!0}}))}})}catch(e){o.message.error("Invalid or corrupt file")}},t.readAsText(e),!1},showUploadList:!1,disabled:L||K},r().createElement(o.Button,{type:"primary",icon:r().createElement(a.UploadOutlined,null),loading:eb,size:"large",disabled:L||K},"Upload Migration File (.json)")))}]})),(L||K)&&r().createElement("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(255,255,255,0.8)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999}},r().createElement(o.Spin,{size:"large",tip:L?"Restarting...":"Applying..."})))}}}]);
|
|
@@ -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
|
+
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client"),require("react"),require("@nocobase/utils/client"),require("@ant-design/icons"),require("antd")):"function"==typeof define&&define.amd?define("plugin-migration-manager",["@nocobase/client","react","@nocobase/utils/client","@ant-design/icons","antd"],t):"object"==typeof exports?exports["plugin-migration-manager"]=t(require("@nocobase/client"),require("react"),require("@nocobase/utils/client"),require("@ant-design/icons"),require("antd")):e["plugin-migration-manager"]=t(e["@nocobase/client"],e.react,e["@nocobase/utils/client"],e["@ant-design/icons"],e.antd)}(self,function(e,t,n,r,o){return function(){var i,u,a,c,l,f,s={581:function(e){e.exports=function(e,t){return"undefined"!=typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(e,t),t}},482:function(e){"use strict";e.exports=r},772:function(t){"use strict";t.exports=e},584:function(e){"use strict";e.exports=n},721:function(e){"use strict";e.exports=o},156:function(e){"use strict";e.exports=t}},p={};function d(e){var t=p[e];if(void 0!==t)return t.exports;var n=p[e]={exports:{}};return s[e](n,n.exports,d),n.exports}d.m=s,d.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return d.d(t,{a:t}),t},d.d=function(e,t){for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},d.f={},d.e=function(e){return Promise.all(Object.keys(d.f).reduce(function(t,n){return d.f[n](e,t),t},[]))},d.u=function(e){return"bf902aacdcc9b8b8.js"},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i={},u="plugin-migration-manager:",d.l=function(e,t,n,r){if(i[e])return void i[e].push(t);if(void 0!==n)for(var o,a,c=document.getElementsByTagName("script"),l=0;l<c.length;l++){var f=c[l];if(f.getAttribute("src")==e||f.getAttribute("data-webpack")==u+n){o=f;break}}o||(a=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,d.nc&&o.setAttribute("nonce",d.nc),o.setAttribute("data-webpack",u+n),o.src=e),i[e]=[t];var s=function(t,n){o.onerror=o.onload=null,clearTimeout(p);var r=i[e];if(delete i[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},p=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),a&&document.head.appendChild(o)},d.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(a=window.__webpack_public_path__||"/").endsWith("/")||(a+="/"),d.p=a+"static/plugins/plugin-migration-manager/dist/client/",c={909:0},d.f.j=function(e,t){var n=d.o(c,e)?c[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=c[e]=[t,r]});t.push(n[2]=r);var o=d.p+d.u(e),i=Error();d.l(o,function(t){if(d.o(c,e)&&(0!==(n=c[e])&&(c[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},l=function(e,t){var n,r,o=t[0],i=t[1],u=t[2],a=0;if(o.some(function(e){return 0!==c[e]})){for(n in i)d.o(i,n)&&(d.m[n]=i[n]);u&&u(d)}for(e&&e(t);a<o.length;a++)r=o[a],d.o(c,r)&&c[r]&&c[r][0](),c[r]=0},(f=self.webpackChunkplugin_migration_manager=self.webpackChunkplugin_migration_manager||[]).forEach(l.bind(null,0)),f.push=l.bind(null,f.push.bind(f));var b={};return!function(){"use strict";d.r(b),d.d(b,{PluginMigrationManagerClient:function(){return f}});var e=d(772),t=d(584),n=d(581);function r(e,t,n,r,o,i,u){try{var a=e[i](u),c=a.value}catch(e){n(e);return}a.done?t(c):Promise.resolve(c).then(r,o)}function o(e,t,n){return(o=c()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&u(o,n.prototype),o}).apply(null,arguments)}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e){var t="function"==typeof Map?new Map:void 0;return(a=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return o(e,arguments,i(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),u(n,e)})(e)}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(c=function(){return!!e})()}var l=(0,e.lazy)(function(){return n("imported_1rtsqtf_component",d.e("545").then(d.bind(d,797)))},"MigrationPage").MigrationPage,f=function(e){var n;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function o(){var e,t;if(!(this instanceof o))throw TypeError("Cannot call a class as a function");return e=o,t=arguments,e=i(e),function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,c()?Reflect.construct(e,t||[],i(this).constructor):e.apply(this,t))}return o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),e&&u(o,e),n=[{key:"load",value:function(){var e,n=this;return(e=function(){return function(e,t){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=t.call(e,u)}catch(e){c=[6,e],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(e){return n.app.pluginSettingsManager.add("migration-manager",{title:(0,t.tval)("Migration Manager"),icon:"SwapOutlined",Component:l,aclSnippet:"pm.migration.manager"}),[2]})},function(){var t=this,n=arguments;return new Promise(function(o,i){var u=e.apply(t,n);function a(e){r(u,o,i,a,c,"next",e)}function c(e){r(u,o,i,a,c,"throw",e)}a(void 0)})})()}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(o.prototype,n),o}(a(e.Plugin));b.default=f}(),b}()});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
module.exports = {
|
|
11
|
+
"@nocobase/client": "2.0.11",
|
|
12
|
+
"@nocobase/utils": "2.0.11",
|
|
13
|
+
"@nocobase/server": "2.0.11",
|
|
14
|
+
"react": "18.2.0",
|
|
15
|
+
"antd": "5.24.2",
|
|
16
|
+
"@ant-design/icons": "5.6.1",
|
|
17
|
+
"@nocobase/actions": "2.0.11"
|
|
18
|
+
};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __create = Object.create;
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
+
var __export = (target, all) => {
|
|
17
|
+
for (var name in all)
|
|
18
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
+
};
|
|
20
|
+
var __copyProps = (to, from, except, desc) => {
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(from))
|
|
23
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
+
}
|
|
26
|
+
return to;
|
|
27
|
+
};
|
|
28
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
29
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
30
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
31
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
32
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
33
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
34
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
35
|
+
mod
|
|
36
|
+
));
|
|
37
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
38
|
+
var src_exports = {};
|
|
39
|
+
__export(src_exports, {
|
|
40
|
+
default: () => import_server.default
|
|
41
|
+
});
|
|
42
|
+
module.exports = __toCommonJS(src_exports);
|
|
43
|
+
__reExport(src_exports, require("./server"), module.exports);
|
|
44
|
+
var import_server = __toESM(require("./server"));
|
|
45
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
+
0 && (module.exports = {
|
|
47
|
+
...require("./server")
|
|
48
|
+
});
|