@unchainedshop/utils 3.0.0-alpha2 → 3.0.0-alpha4
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/calculation.d.ts +1 -1
- package/lib/calculation.d.ts.map +1 -1
- package/lib/director/BaseAdapter.d.ts +10 -1
- package/lib/director/BaseAdapter.d.ts.map +1 -1
- package/lib/director/BaseAdapter.js.map +1 -1
- package/lib/director/BaseDirector.d.ts +9 -1
- package/lib/director/BaseDirector.d.ts.map +1 -1
- package/lib/director/BaseDirector.js.map +1 -1
- package/lib/director/BaseDiscountAdapter.d.ts +36 -1
- package/lib/director/BaseDiscountAdapter.d.ts.map +1 -1
- package/lib/director/BaseDiscountAdapter.js.map +1 -1
- package/lib/director/BaseDiscountDirector.d.ts +11 -1
- package/lib/director/BaseDiscountDirector.d.ts.map +1 -1
- package/lib/director/BaseDiscountDirector.js.map +1 -1
- package/lib/director/BasePricingAdapter.d.ts +45 -2
- package/lib/director/BasePricingAdapter.d.ts.map +1 -1
- package/lib/director/BasePricingAdapter.js.map +1 -1
- package/lib/director/BasePricingDirector.d.ts +14 -1
- package/lib/director/BasePricingDirector.d.ts.map +1 -1
- package/lib/director/BasePricingDirector.js.map +1 -1
- package/lib/director/BasePricingSheet.d.ts +45 -1
- package/lib/director/BasePricingSheet.d.ts.map +1 -1
- package/lib/director/BasePricingSheet.js.map +1 -1
- package/lib/locale-helpers.d.ts +8 -6
- package/lib/locale-helpers.d.ts.map +1 -1
- package/lib/locale-helpers.js +8 -10
- package/lib/locale-helpers.js.map +1 -1
- package/lib/object-invert.d.ts +1 -1
- package/lib/object-invert.d.ts.map +1 -1
- package/lib/object-invert.js.map +1 -1
- package/lib/utils-index.d.ts +17 -8
- package/lib/utils-index.d.ts.map +1 -1
- package/lib/utils-index.js +12 -8
- package/lib/utils-index.js.map +1 -1
- package/package.json +5 -7
- package/src/calculation.test.ts +24 -32
- package/src/calculation.ts +1 -1
- package/src/director/BaseAdapter.ts +13 -1
- package/src/director/BaseDirector.ts +8 -1
- package/src/director/BaseDiscountAdapter.ts +32 -1
- package/src/director/BaseDiscountDirector.ts +15 -2
- package/src/director/BasePricingAdapter.ts +59 -11
- package/src/director/BasePricingDirector.ts +36 -9
- package/src/director/BasePricingSheet.ts +45 -5
- package/src/director/base-director.test.ts +55 -66
- package/src/director/base-discount-adapter.test.ts +22 -25
- package/src/director/base-price-sheet.test.ts +50 -56
- package/src/locale-helpers.ts +17 -16
- package/src/object-invert.ts +1 -1
- package/src/utils-index.test.ts +47 -57
- package/src/utils-index.ts +20 -8
- package/lib/schemas/AddressSchema.d.ts +0 -3
- package/lib/schemas/AddressSchema.d.ts.map +0 -1
- package/lib/schemas/AddressSchema.js +0 -13
- package/lib/schemas/AddressSchema.js.map +0 -1
- package/lib/schemas/ContactSchema.d.ts +0 -3
- package/lib/schemas/ContactSchema.d.ts.map +0 -1
- package/lib/schemas/ContactSchema.js +0 -6
- package/lib/schemas/ContactSchema.js.map +0 -1
- package/lib/schemas/UsersSchema.d.ts +0 -5
- package/lib/schemas/UsersSchema.d.ts.map +0 -1
- package/lib/schemas/UsersSchema.js +0 -52
- package/lib/schemas/UsersSchema.js.map +0 -1
- package/lib/schemas/commonSchemaFields.d.ts +0 -35
- package/lib/schemas/commonSchemaFields.d.ts.map +0 -1
- package/lib/schemas/commonSchemaFields.js +0 -28
- package/lib/schemas/commonSchemaFields.js.map +0 -1
- package/lib/schemas/index.d.ts +0 -43
- package/lib/schemas/index.d.ts.map +0 -1
- package/lib/schemas/index.js +0 -14
- package/lib/schemas/index.js.map +0 -1
- package/src/schemas/AddressSchema.ts +0 -16
- package/src/schemas/ContactSchema.ts +0 -9
- package/src/schemas/UsersSchema.ts +0 -67
- package/src/schemas/commonSchemaFields.ts +0 -29
- package/src/schemas/index.ts +0 -18
package/lib/schemas/index.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import SimpleSchema from 'simpl-schema';
|
|
2
|
-
declare const Schemas: {
|
|
3
|
-
timestampFields: {
|
|
4
|
-
created: {
|
|
5
|
-
type: DateConstructor;
|
|
6
|
-
required: boolean;
|
|
7
|
-
};
|
|
8
|
-
updated: {
|
|
9
|
-
type: DateConstructor;
|
|
10
|
-
};
|
|
11
|
-
deleted: {
|
|
12
|
-
type: DateConstructor;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
contextFields: {
|
|
16
|
-
context: {
|
|
17
|
-
type: ObjectConstructor;
|
|
18
|
-
blackbox: boolean;
|
|
19
|
-
required: boolean;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
logFields: {
|
|
23
|
-
log: ArrayConstructor;
|
|
24
|
-
'log.$': {
|
|
25
|
-
type: ObjectConstructor;
|
|
26
|
-
};
|
|
27
|
-
'log.$.date': {
|
|
28
|
-
type: DateConstructor;
|
|
29
|
-
};
|
|
30
|
-
'log.$.status': {
|
|
31
|
-
type: StringConstructor;
|
|
32
|
-
};
|
|
33
|
-
'log.$.info': {
|
|
34
|
-
type: StringConstructor;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
Address: SimpleSchema;
|
|
38
|
-
Contact: SimpleSchema;
|
|
39
|
-
User: SimpleSchema;
|
|
40
|
-
};
|
|
41
|
-
export { Schemas };
|
|
42
|
-
export type { SimpleSchema };
|
|
43
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,cAAc,CAAC;AAMxC,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOZ,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB,YAAY,EAAE,YAAY,EAAE,CAAC"}
|
package/lib/schemas/index.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { timestampFields, contextFields, logFields } from './commonSchemaFields.js';
|
|
2
|
-
import { AddressSchema } from './AddressSchema.js';
|
|
3
|
-
import { ContactSchema } from './ContactSchema.js';
|
|
4
|
-
import { UserSchema } from './UsersSchema.js';
|
|
5
|
-
const Schemas = {
|
|
6
|
-
timestampFields,
|
|
7
|
-
contextFields,
|
|
8
|
-
logFields,
|
|
9
|
-
Address: AddressSchema,
|
|
10
|
-
Contact: ContactSchema,
|
|
11
|
-
User: UserSchema,
|
|
12
|
-
};
|
|
13
|
-
export { Schemas };
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
package/lib/schemas/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,OAAO,GAAG;IACd,eAAe;IACf,aAAa;IACb,SAAS;IACT,OAAO,EAAE,aAAa;IACtB,OAAO,EAAE,aAAa;IACtB,IAAI,EAAE,UAAU;CACjB,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import SimpleSchema from 'simpl-schema';
|
|
2
|
-
|
|
3
|
-
export const AddressSchema = new SimpleSchema(
|
|
4
|
-
{
|
|
5
|
-
firstName: String,
|
|
6
|
-
lastName: String,
|
|
7
|
-
company: String,
|
|
8
|
-
addressLine: String,
|
|
9
|
-
addressLine2: String,
|
|
10
|
-
city: String,
|
|
11
|
-
postalCode: String,
|
|
12
|
-
regionCode: String,
|
|
13
|
-
countryCode: String,
|
|
14
|
-
},
|
|
15
|
-
{ requiredByDefault: false },
|
|
16
|
-
);
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import SimpleSchema from 'simpl-schema';
|
|
2
|
-
import { AddressSchema } from './AddressSchema.js';
|
|
3
|
-
import { timestampFields } from './commonSchemaFields.js';
|
|
4
|
-
|
|
5
|
-
const ProfileSchema = new SimpleSchema(
|
|
6
|
-
{
|
|
7
|
-
displayName: String,
|
|
8
|
-
birthday: Date,
|
|
9
|
-
phoneMobile: String,
|
|
10
|
-
gender: String,
|
|
11
|
-
address: AddressSchema,
|
|
12
|
-
},
|
|
13
|
-
{ requiredByDefault: false },
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
export const LastLoginSchema = new SimpleSchema(
|
|
17
|
-
{
|
|
18
|
-
timestamp: Date,
|
|
19
|
-
locale: String,
|
|
20
|
-
countryCode: String,
|
|
21
|
-
remoteAddress: String,
|
|
22
|
-
remotePort: String,
|
|
23
|
-
userAgent: String,
|
|
24
|
-
},
|
|
25
|
-
{ requiredByDefault: false },
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
export const LastContactSchema = new SimpleSchema(
|
|
29
|
-
{
|
|
30
|
-
telNumber: String,
|
|
31
|
-
emailAddress: String,
|
|
32
|
-
},
|
|
33
|
-
{ requiredByDefault: false },
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
export const UserSchema = new SimpleSchema(
|
|
37
|
-
{
|
|
38
|
-
emails: Array,
|
|
39
|
-
'emails.$': Object,
|
|
40
|
-
'emails.$.address': String,
|
|
41
|
-
'emails.$.verified': Boolean,
|
|
42
|
-
username: String,
|
|
43
|
-
lastLogin: LastLoginSchema,
|
|
44
|
-
profile: ProfileSchema,
|
|
45
|
-
lastBillingAddress: AddressSchema,
|
|
46
|
-
lastContact: LastContactSchema,
|
|
47
|
-
guest: Boolean,
|
|
48
|
-
initialPassword: Boolean,
|
|
49
|
-
tags: Array,
|
|
50
|
-
'tags.$': String,
|
|
51
|
-
avatarId: String,
|
|
52
|
-
meta: {
|
|
53
|
-
type: Object,
|
|
54
|
-
optional: true,
|
|
55
|
-
blackbox: true,
|
|
56
|
-
},
|
|
57
|
-
services: {
|
|
58
|
-
type: Object,
|
|
59
|
-
optional: true,
|
|
60
|
-
blackbox: true,
|
|
61
|
-
},
|
|
62
|
-
roles: Array,
|
|
63
|
-
'roles.$': String,
|
|
64
|
-
...timestampFields,
|
|
65
|
-
},
|
|
66
|
-
{ requiredByDefault: false },
|
|
67
|
-
);
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export const contextFields = {
|
|
2
|
-
context: {
|
|
3
|
-
type: Object,
|
|
4
|
-
blackbox: true,
|
|
5
|
-
required: false,
|
|
6
|
-
},
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export const logFields = {
|
|
10
|
-
log: Array,
|
|
11
|
-
'log.$': {
|
|
12
|
-
type: Object,
|
|
13
|
-
},
|
|
14
|
-
'log.$.date': {
|
|
15
|
-
type: Date,
|
|
16
|
-
},
|
|
17
|
-
'log.$.status': {
|
|
18
|
-
type: String,
|
|
19
|
-
},
|
|
20
|
-
'log.$.info': {
|
|
21
|
-
type: String,
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const timestampFields = {
|
|
26
|
-
created: { type: Date, required: true },
|
|
27
|
-
updated: { type: Date },
|
|
28
|
-
deleted: { type: Date },
|
|
29
|
-
};
|
package/src/schemas/index.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import SimpleSchema from 'simpl-schema';
|
|
2
|
-
import { timestampFields, contextFields, logFields } from './commonSchemaFields.js';
|
|
3
|
-
import { AddressSchema } from './AddressSchema.js';
|
|
4
|
-
import { ContactSchema } from './ContactSchema.js';
|
|
5
|
-
import { UserSchema } from './UsersSchema.js';
|
|
6
|
-
|
|
7
|
-
const Schemas = {
|
|
8
|
-
timestampFields,
|
|
9
|
-
contextFields,
|
|
10
|
-
logFields,
|
|
11
|
-
Address: AddressSchema,
|
|
12
|
-
Contact: ContactSchema,
|
|
13
|
-
User: UserSchema,
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export { Schemas };
|
|
17
|
-
|
|
18
|
-
export type { SimpleSchema };
|