@unchainedshop/core-assortments 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.npm/package/README +7 -0
- package/.npm/package/npm-shrinkwrap.json +200 -0
- package/.versions +53 -0
- package/README.md +3 -0
- package/package.js +36 -0
- package/package.json +46 -0
- package/src/assortments-index.ts +3 -0
- package/src/assortments-settings.ts +27 -0
- package/src/db/AssortmentMediasCollection.ts +26 -0
- package/src/db/AssortmentMediasSchema.js +31 -0
- package/src/db/AssortmentsCollection.ts +84 -0
- package/src/db/AssortmentsSchema.js +75 -0
- package/src/migrations/addMigrations.ts +41 -0
- package/src/module/configureAssortmentFiltersModule.ts +153 -0
- package/src/module/configureAssortmentLinksModule.ts +212 -0
- package/src/module/configureAssortmentMediaModule.ts +259 -0
- package/src/module/configureAssortmentProductsModule.ts +234 -0
- package/src/module/configureAssortmentTextsModule.ts +179 -0
- package/src/module/configureAssortmentsModule.ts +438 -0
- package/src/product-cache/mongodb.ts +40 -0
- package/src/utils/breadcrumbs/build-paths.ts +58 -0
- package/src/utils/breadcrumbs/makeAssortmentBreadcrumbsBuilder.ts +20 -0
- package/src/utils/breadcrumbs/resolveAssortmentLinkFromDatabase.ts +25 -0
- package/src/utils/breadcrumbs/resolveAssortmentProductFromDatabase.ts +19 -0
- package/src/utils/tree-zipper/zipTreeByDeepness.ts +60 -0
- package/src/utils/tree-zipper/zipTreeBySimplyFlattening.ts +7 -0
- package/tests/assortments-index.test.ts +39 -0
- package/tsconfig.build.json +26 -0
- package/tsconfig.json +8 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { assert } from 'chai';
|
|
2
|
+
import { initDb } from 'meteor/unchained:mongodb';
|
|
3
|
+
import { configureAssortmentsModule } from 'meteor/unchained:core-assortments';
|
|
4
|
+
import { AssortmentsModule } from '@unchainedshop/types/assortments';
|
|
5
|
+
|
|
6
|
+
describe('Test exports', () => {
|
|
7
|
+
let module: AssortmentsModule;
|
|
8
|
+
|
|
9
|
+
before(async () => {
|
|
10
|
+
const db = await initDb();
|
|
11
|
+
module = await configureAssortmentsModule({ db });
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it('Insert assortment', async () => {
|
|
15
|
+
const assortmentId = await module.create(
|
|
16
|
+
{
|
|
17
|
+
authorId: 'Test-User-1',
|
|
18
|
+
isActive: true,
|
|
19
|
+
isBase: true,
|
|
20
|
+
isRoot: true,
|
|
21
|
+
sequence: 13,
|
|
22
|
+
slugs: ['Test'],
|
|
23
|
+
tags: [],
|
|
24
|
+
title: 'Test',
|
|
25
|
+
locale: 'de',
|
|
26
|
+
},
|
|
27
|
+
'Test-User-1'
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
assert.ok(assortmentId);
|
|
31
|
+
|
|
32
|
+
const assortment = await module.findAssortment({ assortmentId });
|
|
33
|
+
|
|
34
|
+
assert.ok(assortment);
|
|
35
|
+
|
|
36
|
+
const deletedCount = await module.delete(assortmentId);
|
|
37
|
+
assert.equal(deletedCount, 1);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"allowJs": true,
|
|
4
|
+
"allowSyntheticDefaultImports": true,
|
|
5
|
+
"declaration": true,
|
|
6
|
+
"esModuleInterop": true,
|
|
7
|
+
"experimentalDecorators": true,
|
|
8
|
+
"forceConsistentCasingInFileNames": true,
|
|
9
|
+
"lib": ["esnext"],
|
|
10
|
+
"module": "esnext",
|
|
11
|
+
"moduleResolution": "node",
|
|
12
|
+
"noImplicitReturns": true,
|
|
13
|
+
"noUnusedLocals": false,
|
|
14
|
+
"outDir": "lib",
|
|
15
|
+
"preserveWatchOutput": true,
|
|
16
|
+
"skipLibCheck": true,
|
|
17
|
+
"sourceMap": true,
|
|
18
|
+
"target": "esnext",
|
|
19
|
+
"types": ["node"],
|
|
20
|
+
"baseUrl": ".", // This must be specified if "paths" is.
|
|
21
|
+
"paths": {
|
|
22
|
+
"meteor/unchained:*": ["node_modules/@unchainedshop/types/index.d.ts"]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"include": ["src"]
|
|
26
|
+
}
|