@unchainedshop/utils 1.1.3 → 1.1.9
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/db/build-db-indexes.d.ts +0 -1
- package/lib/db/generate-db-filter-by-id.d.ts +0 -1
- package/lib/db/generate-db-mutations.d.ts +3 -5
- package/lib/director/BaseDirector.d.ts +0 -1
- package/lib/director/BaseDiscountDirector.d.ts +0 -1
- package/lib/director/BasePricingAdapter.d.ts +0 -1
- package/lib/director/BasePricingDirector.d.ts +0 -1
- package/lib/director/BasePricingSheet.d.ts +0 -1
- package/lib/find-preserving-ids.d.ts +0 -1
- package/lib/generate-random-hash.d.ts +1 -1
- package/lib/generate-random-hash.js +1 -1
- package/lib/generate-random-hash.js.map +1 -1
- package/lib/locale-helpers.d.ts +3 -2
- package/lib/locale-helpers.js +2 -1
- package/lib/locale-helpers.js.map +1 -1
- package/license +274 -0
- package/package.json +7 -7
- package/src/buildSortOption.ts +16 -0
- package/src/db/build-db-indexes.ts +35 -0
- package/src/db/check-id.ts +5 -0
- package/src/db/generate-db-filter-by-id.ts +9 -0
- package/src/db/generate-db-mutations.ts +101 -0
- package/src/db/generate-db-object-id.ts +25 -0
- package/src/director/BaseAdapter.ts +8 -0
- package/src/director/BaseDirector.ts +36 -0
- package/src/director/BaseDiscountAdapter.ts +58 -0
- package/src/director/BaseDiscountDirector.ts +62 -0
- package/src/director/BasePricingAdapter.ts +41 -0
- package/src/director/BasePricingDirector.ts +106 -0
- package/src/director/BasePricingSheet.ts +78 -0
- package/src/find-localized-text.js +50 -0
- package/src/find-preserving-ids.ts +42 -0
- package/src/find-unused-slug.js +26 -0
- package/src/generate-random-hash.ts +8 -0
- package/src/locale-helpers.js +43 -0
- package/src/object-invert.js +8 -0
- package/src/pipe-promises.js +2 -0
- package/src/random-value-hex.ts +8 -0
- package/src/schemas/AddressSchema.js +16 -0
- package/src/schemas/ContactSchema.js +9 -0
- package/src/schemas/UsersSchema.js +67 -0
- package/src/schemas/commonSchemaFields.js +32 -0
- package/src/slugify.js +10 -0
- package/src/utils-index.js +52 -0
- package/tsconfig.build.json +12 -4
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { AddressSchema } from './schemas/AddressSchema';
|
|
2
|
+
import { ContactSchema } from './schemas/ContactSchema';
|
|
3
|
+
import { timestampFields, contextFields, logFields } from './schemas/commonSchemaFields';
|
|
4
|
+
import { UserSchema } from './schemas/UsersSchema';
|
|
5
|
+
|
|
6
|
+
export { default as findLocalizedText } from './find-localized-text';
|
|
7
|
+
export * from './locale-helpers';
|
|
8
|
+
export { default as objectInvert } from './object-invert';
|
|
9
|
+
export { default as findUnusedSlug } from './find-unused-slug';
|
|
10
|
+
export { default as slugify } from './slugify';
|
|
11
|
+
export { default as pipePromises } from './pipe-promises';
|
|
12
|
+
export { default as generateRandomHash } from './generate-random-hash';
|
|
13
|
+
export { default as randomValueHex } from './random-value-hex';
|
|
14
|
+
export { default as buildSortOptions } from './buildSortOption';
|
|
15
|
+
|
|
16
|
+
/*
|
|
17
|
+
* Db utils
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
export { checkId } from './db/check-id';
|
|
21
|
+
export { generateDbObjectId } from './db/generate-db-object-id';
|
|
22
|
+
export { generateDbFilterById } from './db/generate-db-filter-by-id';
|
|
23
|
+
export { generateDbMutations } from './db/generate-db-mutations';
|
|
24
|
+
export { buildDbIndexes } from './db/build-db-indexes';
|
|
25
|
+
export { findPreservingIds } from './find-preserving-ids';
|
|
26
|
+
|
|
27
|
+
/*
|
|
28
|
+
* Schemas
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
const Schemas = {
|
|
32
|
+
timestampFields,
|
|
33
|
+
contextFields,
|
|
34
|
+
logFields,
|
|
35
|
+
Address: AddressSchema,
|
|
36
|
+
Contact: ContactSchema,
|
|
37
|
+
User: UserSchema,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export { Schemas };
|
|
41
|
+
|
|
42
|
+
/*
|
|
43
|
+
* Director
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
export { BaseAdapter } from './director/BaseAdapter';
|
|
47
|
+
export { BaseDirector } from './director/BaseDirector';
|
|
48
|
+
export { BasePricingAdapter } from './director/BasePricingAdapter';
|
|
49
|
+
export { BasePricingDirector } from './director/BasePricingDirector';
|
|
50
|
+
export { BasePricingSheet } from './director/BasePricingSheet';
|
|
51
|
+
export { BaseDiscountAdapter } from './director/BaseDiscountAdapter';
|
|
52
|
+
export { BaseDiscountDirector } from './director/BaseDiscountDirector';
|
package/tsconfig.build.json
CHANGED
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
"esModuleInterop": true,
|
|
7
7
|
"experimentalDecorators": true,
|
|
8
8
|
"forceConsistentCasingInFileNames": true,
|
|
9
|
-
"lib": [
|
|
9
|
+
"lib": [
|
|
10
|
+
"esnext"
|
|
11
|
+
],
|
|
10
12
|
"module": "esnext",
|
|
11
13
|
"moduleResolution": "node",
|
|
12
14
|
"noImplicitReturns": true,
|
|
@@ -16,11 +18,17 @@
|
|
|
16
18
|
"skipLibCheck": true,
|
|
17
19
|
"sourceMap": true,
|
|
18
20
|
"target": "esnext",
|
|
19
|
-
"types": [
|
|
21
|
+
"types": [
|
|
22
|
+
"node"
|
|
23
|
+
],
|
|
20
24
|
"baseUrl": ".", // This must be specified if "paths" is.
|
|
21
25
|
"paths": {
|
|
22
|
-
"
|
|
26
|
+
"@unchainedshop/*": [
|
|
27
|
+
"node_modules/@unchainedshop/types/index.d.ts"
|
|
28
|
+
]
|
|
23
29
|
}
|
|
24
30
|
},
|
|
25
|
-
"include": [
|
|
31
|
+
"include": [
|
|
32
|
+
"src"
|
|
33
|
+
]
|
|
26
34
|
}
|