@croct/sdk 0.5.0 → 0.7.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/activeRecord.d.ts +1 -1
- package/activeRecord.js +15 -12
- package/base64Url.js +7 -2
- package/cache/cache.d.ts +12 -0
- package/cache/cache.js +2 -0
- package/cache/fallbackCache.d.ts +2 -2
- package/cache/fallbackCache.js +6 -3
- package/cache/inMemoryCache.d.ts +2 -2
- package/cache/inMemoryCache.js +5 -2
- package/cache/index.d.ts +4 -12
- package/cache/index.js +11 -0
- package/cache/localStorageCache.d.ts +2 -2
- package/cache/localStorageCache.js +4 -1
- package/channel/beaconSocketChannel.d.ts +3 -3
- package/channel/beaconSocketChannel.js +12 -9
- package/channel/channel.d.ts +15 -0
- package/channel/channel.js +2 -0
- package/channel/encodedChannel.d.ts +2 -2
- package/channel/encodedChannel.js +4 -1
- package/channel/guaranteedChannel.d.ts +1 -1
- package/channel/guaranteedChannel.js +10 -7
- package/channel/index.d.ts +8 -15
- package/channel/index.js +19 -0
- package/channel/queuedChannel.d.ts +2 -2
- package/channel/queuedChannel.js +10 -7
- package/channel/retryChannel.d.ts +3 -3
- package/channel/retryChannel.js +18 -15
- package/channel/sandboxChannel.d.ts +2 -2
- package/channel/sandboxChannel.js +4 -1
- package/channel/socketChannel.d.ts +1 -1
- package/channel/socketChannel.js +12 -9
- package/cid/assigner.d.ts +3 -0
- package/cid/assigner.js +2 -0
- package/cid/cachedAssigner.d.ts +5 -5
- package/cid/cachedAssigner.js +9 -6
- package/cid/fixedAssigner.d.ts +6 -0
- package/cid/fixedAssigner.js +13 -0
- package/cid/index.d.ts +4 -3
- package/cid/index.js +11 -0
- package/cid/remoteAssigner.d.ts +3 -3
- package/cid/remoteAssigner.js +11 -8
- package/constants.js +8 -5
- package/container.d.ts +5 -5
- package/container.js +49 -55
- package/context.d.ts +4 -4
- package/context.js +14 -13
- package/error.d.ts +1 -1
- package/error.js +7 -2
- package/evaluator.d.ts +2 -2
- package/evaluator.js +26 -23
- package/eventManager.d.ts +1 -1
- package/eventManager.js +5 -2
- package/facade/evaluatorFacade.d.ts +3 -3
- package/facade/evaluatorFacade.js +13 -10
- package/facade/index.d.ts +7 -0
- package/facade/index.js +19 -0
- package/facade/sdkFacade.d.ts +9 -9
- package/facade/sdkFacade.js +35 -32
- package/facade/sessionFacade.d.ts +3 -3
- package/facade/sessionFacade.js +6 -3
- package/facade/sessionPatch.d.ts +3 -3
- package/facade/sessionPatch.js +8 -5
- package/facade/trackerFacade.d.ts +2 -2
- package/facade/trackerFacade.js +21 -17
- package/facade/userFacade.d.ts +4 -4
- package/facade/userFacade.js +6 -3
- package/facade/userPatch.d.ts +3 -3
- package/facade/userPatch.js +8 -5
- package/index.d.ts +2 -2
- package/index.js +7 -3
- package/json.js +2 -0
- package/logging/consoleLogger.d.ts +2 -2
- package/logging/consoleLogger.js +8 -5
- package/logging/index.d.ts +4 -9
- package/logging/index.js +11 -0
- package/logging/logger.d.ts +9 -0
- package/logging/logger.js +2 -0
- package/logging/namespacedLogger.d.ts +2 -2
- package/logging/namespacedLogger.js +4 -1
- package/logging/nullLogger.d.ts +2 -2
- package/logging/nullLogger.js +4 -1
- package/namespacedStorage.d.ts +1 -1
- package/namespacedStorage.js +7 -4
- package/package.json +21 -18
- package/patch.js +2 -0
- package/queue/capacityRestrictedQueue.d.ts +2 -2
- package/queue/capacityRestrictedQueue.js +4 -1
- package/queue/inMemoryQueue.d.ts +2 -2
- package/queue/inMemoryQueue.js +6 -3
- package/queue/index.d.ts +5 -9
- package/queue/index.js +13 -0
- package/queue/monitoredQueue.d.ts +6 -6
- package/queue/monitoredQueue.js +6 -3
- package/queue/persistentQueue.d.ts +2 -2
- package/queue/persistentQueue.js +5 -2
- package/queue/queue.d.ts +9 -0
- package/queue/queue.js +2 -0
- package/retry/arbitraryPolicy.d.ts +2 -2
- package/retry/arbitraryPolicy.js +6 -3
- package/retry/backoffPolicy.d.ts +2 -2
- package/retry/backoffPolicy.js +4 -1
- package/retry/index.d.ts +5 -4
- package/retry/index.js +13 -0
- package/retry/maxAttemptsPolicy.d.ts +2 -2
- package/retry/maxAttemptsPolicy.js +4 -1
- package/retry/neverPolicy.d.ts +2 -2
- package/retry/neverPolicy.js +4 -1
- package/retry/policy.d.ts +4 -0
- package/retry/policy.js +2 -0
- package/schema/attributeSchema.d.ts +2 -0
- package/schema/attributeSchema.js +8 -0
- package/schema/contentSchemas.d.ts +2 -0
- package/schema/contentSchemas.js +46 -0
- package/schema/contextSchemas.d.ts +1 -1
- package/schema/contextSchemas.js +5 -2
- package/schema/ecommerceSchemas.d.ts +1 -1
- package/schema/ecommerceSchemas.js +60 -60
- package/schema/evaluationSchemas.d.ts +1 -1
- package/schema/evaluationSchemas.js +7 -6
- package/schema/eventSchemas.d.ts +3 -2
- package/schema/eventSchemas.js +53 -48
- package/schema/index.d.ts +10 -0
- package/schema/index.js +13 -0
- package/schema/loggerSchema.d.ts +1 -1
- package/schema/loggerSchema.js +9 -7
- package/schema/operationSchemas.d.ts +1 -1
- package/schema/operationSchemas.js +26 -24
- package/schema/sdkFacadeSchemas.d.ts +2 -2
- package/schema/sdkFacadeSchemas.js +22 -24
- package/schema/sdkSchemas.d.ts +2 -2
- package/schema/sdkSchemas.js +21 -22
- package/schema/tokenSchema.d.ts +2 -3
- package/schema/tokenSchema.js +18 -17
- package/schema/userSchema.d.ts +1 -1
- package/schema/userSchema.js +47 -61
- package/sdk.d.ts +5 -5
- package/sdk.js +27 -24
- package/sdkEvents.d.ts +2 -2
- package/sdkEvents.js +2 -0
- package/sourceLocation.js +12 -6
- package/tab.d.ts +2 -2
- package/tab.js +12 -9
- package/token/cachedTokenStore.d.ts +3 -3
- package/token/cachedTokenStore.js +6 -3
- package/token/inMemoryTokenStore.d.ts +2 -2
- package/token/inMemoryTokenStore.js +4 -1
- package/token/index.d.ts +4 -41
- package/token/index.js +11 -96
- package/token/replicatedTokenStore.d.ts +2 -2
- package/token/replicatedTokenStore.js +4 -1
- package/token/token.d.ts +41 -0
- package/token/token.js +99 -0
- package/tracker.d.ts +3 -3
- package/tracker.js +29 -26
- package/trackingEvents.d.ts +29 -14
- package/trackingEvents.js +20 -14
- package/transformer.js +5 -1
- package/utilityTypes.js +2 -0
- package/uuid.js +5 -1
- package/validation/arrayType.d.ts +2 -2
- package/validation/arrayType.js +13 -9
- package/validation/booleanType.d.ts +2 -2
- package/validation/booleanType.js +7 -3
- package/validation/functionType.d.ts +2 -2
- package/validation/functionType.js +7 -3
- package/validation/index.d.ts +12 -18
- package/validation/index.js +29 -30
- package/validation/jsonType.d.ts +2 -1
- package/validation/jsonType.js +25 -14
- package/validation/mixedSchema.d.ts +2 -2
- package/validation/mixedSchema.js +4 -1
- package/validation/nullType.d.ts +2 -2
- package/validation/nullType.js +7 -3
- package/validation/numberType.d.ts +2 -2
- package/validation/numberType.js +13 -9
- package/validation/objectType.d.ts +2 -2
- package/validation/objectType.js +23 -18
- package/validation/schema.d.ts +16 -0
- package/validation/schema.js +15 -0
- package/validation/stringType.d.ts +2 -2
- package/validation/stringType.js +16 -12
- package/validation/unionType.d.ts +2 -2
- package/validation/unionType.js +14 -10
- package/validation/violation.d.ts +2 -0
- package/validation/violation.js +24 -0
- package/cid/fixedCidAssigner.d.ts +0 -6
- package/cid/fixedCidAssigner.js +0 -10
package/retry/neverPolicy.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NeverPolicy = void 0;
|
|
1
4
|
var NeverPolicy = /** @class */ (function () {
|
|
2
5
|
function NeverPolicy() {
|
|
3
6
|
}
|
|
@@ -9,4 +12,4 @@ var NeverPolicy = /** @class */ (function () {
|
|
|
9
12
|
};
|
|
10
13
|
return NeverPolicy;
|
|
11
14
|
}());
|
|
12
|
-
|
|
15
|
+
exports.NeverPolicy = NeverPolicy;
|
package/retry/policy.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.attributeNameSchema = void 0;
|
|
4
|
+
var validation_1 = require("../validation");
|
|
5
|
+
exports.attributeNameSchema = new validation_1.StringType({
|
|
6
|
+
maxLength: 50,
|
|
7
|
+
format: 'identifier',
|
|
8
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.postDetails = void 0;
|
|
4
|
+
var validation_1 = require("../validation");
|
|
5
|
+
exports.postDetails = new validation_1.ObjectType({
|
|
6
|
+
required: ['postId', 'title', 'publishTime'],
|
|
7
|
+
properties: {
|
|
8
|
+
postId: new validation_1.StringType({
|
|
9
|
+
minLength: 1,
|
|
10
|
+
maxLength: 100,
|
|
11
|
+
}),
|
|
12
|
+
url: new validation_1.StringType({
|
|
13
|
+
format: 'url',
|
|
14
|
+
}),
|
|
15
|
+
title: new validation_1.StringType({
|
|
16
|
+
minLength: 1,
|
|
17
|
+
maxLength: 100,
|
|
18
|
+
}),
|
|
19
|
+
tags: new validation_1.ArrayType({
|
|
20
|
+
items: new validation_1.StringType({
|
|
21
|
+
minLength: 1,
|
|
22
|
+
maxLength: 50,
|
|
23
|
+
}),
|
|
24
|
+
minItems: 1,
|
|
25
|
+
maxItems: 10,
|
|
26
|
+
}),
|
|
27
|
+
categories: new validation_1.ArrayType({
|
|
28
|
+
items: new validation_1.StringType({
|
|
29
|
+
minLength: 1,
|
|
30
|
+
maxLength: 50,
|
|
31
|
+
}),
|
|
32
|
+
minItems: 1,
|
|
33
|
+
maxItems: 10,
|
|
34
|
+
}),
|
|
35
|
+
authors: new validation_1.ArrayType({
|
|
36
|
+
items: new validation_1.StringType({
|
|
37
|
+
minLength: 1,
|
|
38
|
+
maxLength: 50,
|
|
39
|
+
}),
|
|
40
|
+
minItems: 1,
|
|
41
|
+
maxItems: 10,
|
|
42
|
+
}),
|
|
43
|
+
publishTime: new validation_1.NumberType(),
|
|
44
|
+
updateTime: new validation_1.NumberType(),
|
|
45
|
+
},
|
|
46
|
+
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import StringType from '../validation
|
|
1
|
+
import { StringType } from '../validation';
|
|
2
2
|
export declare const tokenScopeSchema: StringType;
|
package/schema/contextSchemas.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tokenScopeSchema = void 0;
|
|
4
|
+
var validation_1 = require("../validation");
|
|
5
|
+
exports.tokenScopeSchema = new validation_1.StringType({
|
|
3
6
|
enumeration: ['global', 'contextual', 'isolated'],
|
|
4
7
|
});
|
|
@@ -1,176 +1,176 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.order = exports.orderItem = exports.cart = exports.cartItem = exports.productDetails = void 0;
|
|
4
|
+
var validation_1 = require("../validation");
|
|
5
|
+
exports.productDetails = new validation_1.ObjectType({
|
|
6
6
|
required: ['productId', 'name', 'displayPrice'],
|
|
7
7
|
properties: {
|
|
8
|
-
productId: new StringType({
|
|
8
|
+
productId: new validation_1.StringType({
|
|
9
9
|
minLength: 1,
|
|
10
10
|
maxLength: 50,
|
|
11
11
|
}),
|
|
12
|
-
sku: new StringType({
|
|
12
|
+
sku: new validation_1.StringType({
|
|
13
13
|
minLength: 1,
|
|
14
14
|
maxLength: 50,
|
|
15
15
|
}),
|
|
16
|
-
name: new StringType({
|
|
16
|
+
name: new validation_1.StringType({
|
|
17
17
|
minLength: 1,
|
|
18
18
|
maxLength: 200,
|
|
19
19
|
}),
|
|
20
|
-
category: new StringType({
|
|
20
|
+
category: new validation_1.StringType({
|
|
21
21
|
minLength: 1,
|
|
22
22
|
maxLength: 100,
|
|
23
23
|
}),
|
|
24
|
-
brand: new StringType({
|
|
24
|
+
brand: new validation_1.StringType({
|
|
25
25
|
minLength: 1,
|
|
26
26
|
maxLength: 100,
|
|
27
27
|
}),
|
|
28
|
-
variant: new StringType({
|
|
28
|
+
variant: new validation_1.StringType({
|
|
29
29
|
minLength: 1,
|
|
30
30
|
maxLength: 50,
|
|
31
31
|
}),
|
|
32
|
-
displayPrice: new NumberType({
|
|
32
|
+
displayPrice: new validation_1.NumberType({
|
|
33
33
|
minimum: 0,
|
|
34
34
|
}),
|
|
35
|
-
originalPrice: new NumberType({
|
|
35
|
+
originalPrice: new validation_1.NumberType({
|
|
36
36
|
minimum: 0,
|
|
37
37
|
}),
|
|
38
|
-
url: new StringType({
|
|
38
|
+
url: new validation_1.StringType({
|
|
39
39
|
format: 'url',
|
|
40
40
|
}),
|
|
41
|
-
imageUrl: new StringType({
|
|
41
|
+
imageUrl: new validation_1.StringType({
|
|
42
42
|
format: 'url',
|
|
43
43
|
}),
|
|
44
44
|
},
|
|
45
45
|
});
|
|
46
|
-
|
|
46
|
+
exports.cartItem = new validation_1.ObjectType({
|
|
47
47
|
required: ['index', 'product', 'quantity', 'total'],
|
|
48
48
|
properties: {
|
|
49
|
-
index: new NumberType({
|
|
49
|
+
index: new validation_1.NumberType({
|
|
50
50
|
minimum: 0,
|
|
51
51
|
}),
|
|
52
|
-
product: productDetails,
|
|
53
|
-
quantity: new NumberType({
|
|
52
|
+
product: exports.productDetails,
|
|
53
|
+
quantity: new validation_1.NumberType({
|
|
54
54
|
minimum: 1,
|
|
55
55
|
}),
|
|
56
|
-
total: new NumberType({
|
|
56
|
+
total: new validation_1.NumberType({
|
|
57
57
|
minimum: 0,
|
|
58
58
|
}),
|
|
59
|
-
discount: new NumberType({
|
|
59
|
+
discount: new validation_1.NumberType({
|
|
60
60
|
minimum: 0,
|
|
61
61
|
}),
|
|
62
|
-
coupon: new StringType({
|
|
62
|
+
coupon: new validation_1.StringType({
|
|
63
63
|
minLength: 1,
|
|
64
64
|
maxLength: 50,
|
|
65
65
|
}),
|
|
66
66
|
},
|
|
67
67
|
});
|
|
68
|
-
|
|
68
|
+
exports.cart = new validation_1.ObjectType({
|
|
69
69
|
required: ['currency', 'items', 'total'],
|
|
70
70
|
properties: {
|
|
71
|
-
currency: new StringType({
|
|
71
|
+
currency: new validation_1.StringType({
|
|
72
72
|
maxLength: 10,
|
|
73
73
|
minLength: 1,
|
|
74
74
|
}),
|
|
75
|
-
items: new ArrayType({
|
|
76
|
-
items: cartItem,
|
|
75
|
+
items: new validation_1.ArrayType({
|
|
76
|
+
items: exports.cartItem,
|
|
77
77
|
}),
|
|
78
|
-
subtotal: new NumberType({
|
|
78
|
+
subtotal: new validation_1.NumberType({
|
|
79
79
|
minimum: 0,
|
|
80
80
|
}),
|
|
81
|
-
shippingPrice: new NumberType({
|
|
81
|
+
shippingPrice: new validation_1.NumberType({
|
|
82
82
|
minimum: 0,
|
|
83
83
|
}),
|
|
84
|
-
taxes: new ObjectType({
|
|
85
|
-
additionalProperties: new NumberType(),
|
|
84
|
+
taxes: new validation_1.ObjectType({
|
|
85
|
+
additionalProperties: new validation_1.NumberType(),
|
|
86
86
|
minProperties: 1,
|
|
87
87
|
}),
|
|
88
|
-
costs: new ObjectType({
|
|
89
|
-
additionalProperties: new NumberType(),
|
|
88
|
+
costs: new validation_1.ObjectType({
|
|
89
|
+
additionalProperties: new validation_1.NumberType(),
|
|
90
90
|
minProperties: 1,
|
|
91
91
|
}),
|
|
92
|
-
discount: new NumberType({
|
|
92
|
+
discount: new validation_1.NumberType({
|
|
93
93
|
minimum: 0,
|
|
94
94
|
}),
|
|
95
|
-
total: new NumberType({
|
|
95
|
+
total: new validation_1.NumberType({
|
|
96
96
|
minimum: 0,
|
|
97
97
|
}),
|
|
98
|
-
coupon: new StringType({
|
|
98
|
+
coupon: new validation_1.StringType({
|
|
99
99
|
minLength: 1,
|
|
100
100
|
maxLength: 50,
|
|
101
101
|
}),
|
|
102
|
-
lastUpdateTime: new NumberType(),
|
|
102
|
+
lastUpdateTime: new validation_1.NumberType(),
|
|
103
103
|
},
|
|
104
104
|
});
|
|
105
|
-
|
|
105
|
+
exports.orderItem = new validation_1.ObjectType({
|
|
106
106
|
required: ['index', 'product', 'quantity', 'total'],
|
|
107
107
|
properties: {
|
|
108
|
-
index: new NumberType({
|
|
108
|
+
index: new validation_1.NumberType({
|
|
109
109
|
minimum: 0,
|
|
110
110
|
}),
|
|
111
|
-
product: productDetails,
|
|
112
|
-
quantity: new NumberType({
|
|
111
|
+
product: exports.productDetails,
|
|
112
|
+
quantity: new validation_1.NumberType({
|
|
113
113
|
minimum: 1,
|
|
114
114
|
}),
|
|
115
|
-
total: new NumberType({
|
|
115
|
+
total: new validation_1.NumberType({
|
|
116
116
|
minimum: 0,
|
|
117
117
|
}),
|
|
118
|
-
discount: new NumberType({
|
|
118
|
+
discount: new validation_1.NumberType({
|
|
119
119
|
minimum: 0,
|
|
120
120
|
}),
|
|
121
|
-
coupon: new StringType({
|
|
121
|
+
coupon: new validation_1.StringType({
|
|
122
122
|
minLength: 1,
|
|
123
123
|
maxLength: 50,
|
|
124
124
|
}),
|
|
125
125
|
},
|
|
126
126
|
});
|
|
127
|
-
|
|
127
|
+
exports.order = new validation_1.ObjectType({
|
|
128
128
|
required: ['orderId', 'currency', 'items', 'total'],
|
|
129
129
|
properties: {
|
|
130
|
-
orderId: new StringType({
|
|
130
|
+
orderId: new validation_1.StringType({
|
|
131
131
|
minLength: 1,
|
|
132
132
|
maxLength: 50,
|
|
133
133
|
}),
|
|
134
|
-
currency: new StringType({
|
|
134
|
+
currency: new validation_1.StringType({
|
|
135
135
|
maxLength: 10,
|
|
136
136
|
minLength: 1,
|
|
137
137
|
}),
|
|
138
|
-
items: new ArrayType({
|
|
139
|
-
items: orderItem,
|
|
138
|
+
items: new validation_1.ArrayType({
|
|
139
|
+
items: exports.orderItem,
|
|
140
140
|
minItems: 1,
|
|
141
141
|
}),
|
|
142
|
-
subtotal: new NumberType({
|
|
142
|
+
subtotal: new validation_1.NumberType({
|
|
143
143
|
minimum: 0,
|
|
144
144
|
}),
|
|
145
|
-
shippingPrice: new NumberType({
|
|
145
|
+
shippingPrice: new validation_1.NumberType({
|
|
146
146
|
minimum: 0,
|
|
147
147
|
}),
|
|
148
|
-
taxes: new ObjectType({
|
|
149
|
-
additionalProperties: new NumberType(),
|
|
148
|
+
taxes: new validation_1.ObjectType({
|
|
149
|
+
additionalProperties: new validation_1.NumberType(),
|
|
150
150
|
minProperties: 1,
|
|
151
151
|
}),
|
|
152
|
-
costs: new ObjectType({
|
|
153
|
-
additionalProperties: new NumberType(),
|
|
152
|
+
costs: new validation_1.ObjectType({
|
|
153
|
+
additionalProperties: new validation_1.NumberType(),
|
|
154
154
|
minProperties: 1,
|
|
155
155
|
}),
|
|
156
|
-
discount: new NumberType({
|
|
156
|
+
discount: new validation_1.NumberType({
|
|
157
157
|
minimum: 0,
|
|
158
158
|
}),
|
|
159
|
-
total: new NumberType({
|
|
159
|
+
total: new validation_1.NumberType({
|
|
160
160
|
minimum: 0,
|
|
161
161
|
}),
|
|
162
|
-
coupon: new StringType({
|
|
162
|
+
coupon: new validation_1.StringType({
|
|
163
163
|
minLength: 1,
|
|
164
164
|
maxLength: 50,
|
|
165
165
|
}),
|
|
166
|
-
paymentMethod: new StringType({
|
|
166
|
+
paymentMethod: new validation_1.StringType({
|
|
167
167
|
minLength: 1,
|
|
168
168
|
maxLength: 50,
|
|
169
169
|
}),
|
|
170
|
-
installments: new NumberType({
|
|
170
|
+
installments: new validation_1.NumberType({
|
|
171
171
|
minimum: 1,
|
|
172
172
|
}),
|
|
173
|
-
status: new StringType({
|
|
173
|
+
status: new validation_1.StringType({
|
|
174
174
|
enumeration: ['placed', 'paid', 'complete'],
|
|
175
175
|
}),
|
|
176
176
|
},
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import ObjectType from '../validation
|
|
1
|
+
import { ObjectType } from '../validation';
|
|
2
2
|
export declare const optionsSchema: ObjectType;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.optionsSchema = void 0;
|
|
4
|
+
var validation_1 = require("../validation");
|
|
5
|
+
exports.optionsSchema = new validation_1.ObjectType({
|
|
5
6
|
properties: {
|
|
6
|
-
timeout: new NumberType({
|
|
7
|
+
timeout: new validation_1.NumberType({
|
|
7
8
|
integer: true,
|
|
8
9
|
minimum: 0,
|
|
9
10
|
}),
|
|
10
|
-
attributes: new JsonObjectType(),
|
|
11
|
+
attributes: new validation_1.JsonObjectType(),
|
|
11
12
|
},
|
|
12
13
|
});
|
package/schema/eventSchemas.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import ObjectType from '../validation
|
|
1
|
+
import { ObjectType } from '../validation';
|
|
2
2
|
export declare const cartModified: ObjectType;
|
|
3
3
|
export declare const cartViewed: ObjectType;
|
|
4
4
|
export declare const checkoutStarted: ObjectType;
|
|
5
5
|
export declare const orderPlaced: ObjectType;
|
|
6
6
|
export declare const productViewed: ObjectType;
|
|
7
7
|
export declare const userSignedUp: ObjectType;
|
|
8
|
-
export declare const testGroupAssigned: ObjectType;
|
|
9
8
|
export declare const goalCompleted: ObjectType;
|
|
9
|
+
export declare const interestShown: ObjectType;
|
|
10
|
+
export declare const postViewed: ObjectType;
|
|
10
11
|
export declare const eventOccurred: ObjectType;
|
package/schema/eventSchemas.js
CHANGED
|
@@ -1,112 +1,117 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export var cartModified = new ObjectType({
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.eventOccurred = exports.postViewed = exports.interestShown = exports.goalCompleted = exports.userSignedUp = exports.productViewed = exports.orderPlaced = exports.checkoutStarted = exports.cartViewed = exports.cartModified = void 0;
|
|
4
|
+
var validation_1 = require("../validation");
|
|
5
|
+
var ecommerceSchemas_1 = require("./ecommerceSchemas");
|
|
6
|
+
var userSchema_1 = require("./userSchema");
|
|
7
|
+
var contentSchemas_1 = require("./contentSchemas");
|
|
8
|
+
exports.cartModified = new validation_1.ObjectType({
|
|
10
9
|
required: ['cart'],
|
|
11
10
|
properties: {
|
|
12
|
-
cart: cart,
|
|
11
|
+
cart: ecommerceSchemas_1.cart,
|
|
13
12
|
},
|
|
14
13
|
});
|
|
15
|
-
|
|
14
|
+
exports.cartViewed = new validation_1.ObjectType({
|
|
16
15
|
required: ['cart'],
|
|
17
16
|
properties: {
|
|
18
|
-
cart: cart,
|
|
17
|
+
cart: ecommerceSchemas_1.cart,
|
|
19
18
|
},
|
|
20
19
|
});
|
|
21
|
-
|
|
20
|
+
exports.checkoutStarted = new validation_1.ObjectType({
|
|
22
21
|
required: ['cart'],
|
|
23
22
|
properties: {
|
|
24
|
-
cart: cart,
|
|
25
|
-
orderId: new StringType({
|
|
23
|
+
cart: ecommerceSchemas_1.cart,
|
|
24
|
+
orderId: new validation_1.StringType({
|
|
26
25
|
minLength: 1,
|
|
27
26
|
maxLength: 50,
|
|
28
27
|
}),
|
|
29
28
|
},
|
|
30
29
|
});
|
|
31
|
-
|
|
30
|
+
exports.orderPlaced = new validation_1.ObjectType({
|
|
32
31
|
required: ['order'],
|
|
33
32
|
properties: {
|
|
34
|
-
order: order,
|
|
33
|
+
order: ecommerceSchemas_1.order,
|
|
35
34
|
},
|
|
36
35
|
});
|
|
37
|
-
|
|
36
|
+
exports.productViewed = new validation_1.ObjectType({
|
|
38
37
|
required: ['product'],
|
|
39
38
|
properties: {
|
|
40
|
-
product: productDetails,
|
|
39
|
+
product: ecommerceSchemas_1.productDetails,
|
|
41
40
|
},
|
|
42
41
|
});
|
|
43
|
-
|
|
42
|
+
exports.userSignedUp = new validation_1.ObjectType({
|
|
44
43
|
required: ['userId'],
|
|
45
44
|
properties: {
|
|
46
|
-
userId: new StringType({
|
|
45
|
+
userId: new validation_1.StringType({
|
|
47
46
|
minLength: 1,
|
|
48
47
|
maxLength: 254,
|
|
49
48
|
}),
|
|
50
|
-
profile: userProfileSchema,
|
|
49
|
+
profile: userSchema_1.userProfileSchema,
|
|
51
50
|
},
|
|
52
51
|
});
|
|
53
|
-
|
|
54
|
-
required: ['testId', 'groupId'],
|
|
55
|
-
properties: {
|
|
56
|
-
testId: new StringType({
|
|
57
|
-
minLength: 1,
|
|
58
|
-
maxLength: 50,
|
|
59
|
-
}),
|
|
60
|
-
groupId: new StringType({
|
|
61
|
-
minLength: 1,
|
|
62
|
-
maxLength: 50,
|
|
63
|
-
}),
|
|
64
|
-
},
|
|
65
|
-
});
|
|
66
|
-
export var goalCompleted = new ObjectType({
|
|
52
|
+
exports.goalCompleted = new validation_1.ObjectType({
|
|
67
53
|
required: ['goalId'],
|
|
68
54
|
properties: {
|
|
69
|
-
goalId: new StringType({
|
|
55
|
+
goalId: new validation_1.StringType({
|
|
70
56
|
minLength: 1,
|
|
71
57
|
maxLength: 50,
|
|
72
58
|
}),
|
|
73
|
-
value: new NumberType({
|
|
59
|
+
value: new validation_1.NumberType({
|
|
74
60
|
minimum: 0,
|
|
75
61
|
}),
|
|
76
|
-
currency: new StringType({
|
|
62
|
+
currency: new validation_1.StringType({
|
|
77
63
|
minLength: 1,
|
|
78
64
|
maxLength: 10,
|
|
79
65
|
}),
|
|
80
66
|
},
|
|
81
67
|
});
|
|
82
|
-
|
|
68
|
+
exports.interestShown = new validation_1.ObjectType({
|
|
69
|
+
required: ['interests'],
|
|
70
|
+
properties: {
|
|
71
|
+
interests: new validation_1.ArrayType({
|
|
72
|
+
items: new validation_1.StringType({
|
|
73
|
+
minLength: 1,
|
|
74
|
+
maxLength: 50,
|
|
75
|
+
}),
|
|
76
|
+
minItems: 1,
|
|
77
|
+
maxItems: 10,
|
|
78
|
+
}),
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
exports.postViewed = new validation_1.ObjectType({
|
|
82
|
+
required: ['post'],
|
|
83
|
+
properties: {
|
|
84
|
+
post: contentSchemas_1.postDetails,
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
exports.eventOccurred = new validation_1.ObjectType({
|
|
83
88
|
required: ['name'],
|
|
84
89
|
properties: {
|
|
85
|
-
name: new StringType({
|
|
90
|
+
name: new validation_1.StringType({
|
|
86
91
|
minLength: 1,
|
|
87
92
|
maxLength: 50,
|
|
88
93
|
}),
|
|
89
|
-
testId: new StringType({
|
|
94
|
+
testId: new validation_1.StringType({
|
|
90
95
|
minLength: 1,
|
|
91
96
|
maxLength: 50,
|
|
92
97
|
}),
|
|
93
|
-
groupId: new StringType({
|
|
98
|
+
groupId: new validation_1.StringType({
|
|
94
99
|
minLength: 1,
|
|
95
100
|
maxLength: 50,
|
|
96
101
|
}),
|
|
97
|
-
personalizationId: new StringType({
|
|
102
|
+
personalizationId: new validation_1.StringType({
|
|
98
103
|
minLength: 1,
|
|
99
104
|
maxLength: 50,
|
|
100
105
|
}),
|
|
101
|
-
audience: new StringType({
|
|
106
|
+
audience: new validation_1.StringType({
|
|
102
107
|
minLength: 1,
|
|
103
108
|
maxLength: 50,
|
|
104
109
|
}),
|
|
105
|
-
details: new ObjectType({
|
|
106
|
-
additionalProperties: new UnionType(new NullType(), new BooleanType(), new NumberType(), new StringType({
|
|
110
|
+
details: new validation_1.ObjectType({
|
|
111
|
+
additionalProperties: new validation_1.UnionType(new validation_1.NullType(), new validation_1.BooleanType(), new validation_1.NumberType(), new validation_1.StringType({
|
|
107
112
|
maxLength: 300,
|
|
108
113
|
})),
|
|
109
|
-
propertyNames: new StringType({
|
|
114
|
+
propertyNames: new validation_1.StringType({
|
|
110
115
|
minLength: 1,
|
|
111
116
|
maxLength: 20,
|
|
112
117
|
format: 'identifier',
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './contextSchemas';
|
|
2
|
+
export * from './ecommerceSchemas';
|
|
3
|
+
export * from './evaluationSchemas';
|
|
4
|
+
export * from './eventSchemas';
|
|
5
|
+
export * from './loggerSchema';
|
|
6
|
+
export * from './operationSchemas';
|
|
7
|
+
export * from './sdkFacadeSchemas';
|
|
8
|
+
export * from './sdkSchemas';
|
|
9
|
+
export * from './tokenSchema';
|
|
10
|
+
export * from './userSchema';
|
package/schema/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./contextSchemas"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./ecommerceSchemas"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./evaluationSchemas"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./eventSchemas"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./loggerSchema"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./operationSchemas"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./sdkFacadeSchemas"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./sdkSchemas"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./tokenSchema"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./userSchema"), exports);
|
package/schema/loggerSchema.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import ObjectType from '../validation
|
|
1
|
+
import { ObjectType } from '../validation';
|
|
2
2
|
export declare const loggerSchema: ObjectType;
|
package/schema/loggerSchema.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loggerSchema = void 0;
|
|
4
|
+
var validation_1 = require("../validation");
|
|
5
|
+
exports.loggerSchema = new validation_1.ObjectType({
|
|
4
6
|
required: ['debug', 'info', 'warn', 'error'],
|
|
5
7
|
additionalProperties: true,
|
|
6
8
|
properties: {
|
|
7
|
-
debug: new FunctionType(),
|
|
8
|
-
info: new FunctionType(),
|
|
9
|
-
warn: new FunctionType(),
|
|
10
|
-
error: new FunctionType(),
|
|
9
|
+
debug: new validation_1.FunctionType(),
|
|
10
|
+
info: new validation_1.FunctionType(),
|
|
11
|
+
warn: new validation_1.FunctionType(),
|
|
12
|
+
error: new validation_1.FunctionType(),
|
|
11
13
|
},
|
|
12
14
|
});
|