@nocobase/plugin-multi-app-share-collection 0.9.4-alpha.2 → 0.10.0-alpha.2
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/lib/client/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-multi-app-share-collection",
|
|
3
|
-
"
|
|
3
|
+
"displayName": "multi app share collection",
|
|
4
|
+
"displayName.zh-CN": "多应用数据共享",
|
|
5
|
+
"description": "multi app share collection",
|
|
6
|
+
"description.zh-CN": "多应用数据共享",
|
|
7
|
+
"version": "0.10.0-alpha.2",
|
|
4
8
|
"main": "lib/server/index.js",
|
|
5
9
|
"devDependencies": {
|
|
6
|
-
"@nocobase/client": "0.
|
|
7
|
-
"@nocobase/plugin-multi-app-manager": "0.
|
|
8
|
-
"@nocobase/server": "0.
|
|
9
|
-
"@nocobase/test": "0.
|
|
10
|
+
"@nocobase/client": "0.10.0-alpha.2",
|
|
11
|
+
"@nocobase/plugin-multi-app-manager": "0.10.0-alpha.2",
|
|
12
|
+
"@nocobase/server": "0.10.0-alpha.2",
|
|
13
|
+
"@nocobase/test": "0.10.0-alpha.2"
|
|
10
14
|
},
|
|
11
|
-
"gitHead": "
|
|
15
|
+
"gitHead": "85028ae1733fcbd46ecd5d291dacbdc175f7f073"
|
|
12
16
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BelongsToManyRepository, Database } from '@nocobase/database';
|
|
2
2
|
import { MockServer, mockServer, pgOnly } from '@nocobase/test';
|
|
3
|
+
import * as process from 'process';
|
|
3
4
|
|
|
4
5
|
pgOnly()('enable plugin', () => {
|
|
5
6
|
let mainDb: Database;
|
|
@@ -255,6 +256,30 @@ pgOnly()('collection sync', () => {
|
|
|
255
256
|
expect(user).toBeTruthy();
|
|
256
257
|
});
|
|
257
258
|
|
|
259
|
+
it('should sync custom collections', async () => {
|
|
260
|
+
const subApp1Record = await mainDb.getRepository('applications').create({
|
|
261
|
+
values: {
|
|
262
|
+
name: 'sub1',
|
|
263
|
+
},
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
const subApp1 = await mainApp.appManager.getApplication(subApp1Record.name);
|
|
267
|
+
|
|
268
|
+
await mainApp.db.getRepository('collections').create({
|
|
269
|
+
values: {
|
|
270
|
+
name: 'posts',
|
|
271
|
+
fields: [{ type: 'string', title: 'title' }],
|
|
272
|
+
},
|
|
273
|
+
context: {},
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
const postCollection = subApp1.db.getCollection('posts');
|
|
277
|
+
|
|
278
|
+
expect(postCollection.options.schema).toBe(
|
|
279
|
+
process.env.COLLECTION_MANAGER_SCHEMA || mainDb.options.schema || 'public',
|
|
280
|
+
);
|
|
281
|
+
});
|
|
282
|
+
|
|
258
283
|
it('should support syncToApps with wildcard value', async () => {
|
|
259
284
|
const subApp1Record = await mainDb.getRepository('applications').create({
|
|
260
285
|
values: {
|