@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.
Files changed (187) hide show
  1. package/activeRecord.d.ts +1 -1
  2. package/activeRecord.js +15 -12
  3. package/base64Url.js +7 -2
  4. package/cache/cache.d.ts +12 -0
  5. package/cache/cache.js +2 -0
  6. package/cache/fallbackCache.d.ts +2 -2
  7. package/cache/fallbackCache.js +6 -3
  8. package/cache/inMemoryCache.d.ts +2 -2
  9. package/cache/inMemoryCache.js +5 -2
  10. package/cache/index.d.ts +4 -12
  11. package/cache/index.js +11 -0
  12. package/cache/localStorageCache.d.ts +2 -2
  13. package/cache/localStorageCache.js +4 -1
  14. package/channel/beaconSocketChannel.d.ts +3 -3
  15. package/channel/beaconSocketChannel.js +12 -9
  16. package/channel/channel.d.ts +15 -0
  17. package/channel/channel.js +2 -0
  18. package/channel/encodedChannel.d.ts +2 -2
  19. package/channel/encodedChannel.js +4 -1
  20. package/channel/guaranteedChannel.d.ts +1 -1
  21. package/channel/guaranteedChannel.js +10 -7
  22. package/channel/index.d.ts +8 -15
  23. package/channel/index.js +19 -0
  24. package/channel/queuedChannel.d.ts +2 -2
  25. package/channel/queuedChannel.js +10 -7
  26. package/channel/retryChannel.d.ts +3 -3
  27. package/channel/retryChannel.js +18 -15
  28. package/channel/sandboxChannel.d.ts +2 -2
  29. package/channel/sandboxChannel.js +4 -1
  30. package/channel/socketChannel.d.ts +1 -1
  31. package/channel/socketChannel.js +12 -9
  32. package/cid/assigner.d.ts +3 -0
  33. package/cid/assigner.js +2 -0
  34. package/cid/cachedAssigner.d.ts +5 -5
  35. package/cid/cachedAssigner.js +9 -6
  36. package/cid/fixedAssigner.d.ts +6 -0
  37. package/cid/fixedAssigner.js +13 -0
  38. package/cid/index.d.ts +4 -3
  39. package/cid/index.js +11 -0
  40. package/cid/remoteAssigner.d.ts +3 -3
  41. package/cid/remoteAssigner.js +11 -8
  42. package/constants.js +8 -5
  43. package/container.d.ts +5 -5
  44. package/container.js +49 -55
  45. package/context.d.ts +4 -4
  46. package/context.js +14 -13
  47. package/error.d.ts +1 -1
  48. package/error.js +7 -2
  49. package/evaluator.d.ts +2 -2
  50. package/evaluator.js +26 -23
  51. package/eventManager.d.ts +1 -1
  52. package/eventManager.js +5 -2
  53. package/facade/evaluatorFacade.d.ts +3 -3
  54. package/facade/evaluatorFacade.js +13 -10
  55. package/facade/index.d.ts +7 -0
  56. package/facade/index.js +19 -0
  57. package/facade/sdkFacade.d.ts +9 -9
  58. package/facade/sdkFacade.js +35 -32
  59. package/facade/sessionFacade.d.ts +3 -3
  60. package/facade/sessionFacade.js +6 -3
  61. package/facade/sessionPatch.d.ts +3 -3
  62. package/facade/sessionPatch.js +8 -5
  63. package/facade/trackerFacade.d.ts +2 -2
  64. package/facade/trackerFacade.js +21 -17
  65. package/facade/userFacade.d.ts +4 -4
  66. package/facade/userFacade.js +6 -3
  67. package/facade/userPatch.d.ts +3 -3
  68. package/facade/userPatch.js +8 -5
  69. package/index.d.ts +2 -2
  70. package/index.js +7 -3
  71. package/json.js +2 -0
  72. package/logging/consoleLogger.d.ts +2 -2
  73. package/logging/consoleLogger.js +8 -5
  74. package/logging/index.d.ts +4 -9
  75. package/logging/index.js +11 -0
  76. package/logging/logger.d.ts +9 -0
  77. package/logging/logger.js +2 -0
  78. package/logging/namespacedLogger.d.ts +2 -2
  79. package/logging/namespacedLogger.js +4 -1
  80. package/logging/nullLogger.d.ts +2 -2
  81. package/logging/nullLogger.js +4 -1
  82. package/namespacedStorage.d.ts +1 -1
  83. package/namespacedStorage.js +7 -4
  84. package/package.json +21 -18
  85. package/patch.js +2 -0
  86. package/queue/capacityRestrictedQueue.d.ts +2 -2
  87. package/queue/capacityRestrictedQueue.js +4 -1
  88. package/queue/inMemoryQueue.d.ts +2 -2
  89. package/queue/inMemoryQueue.js +6 -3
  90. package/queue/index.d.ts +5 -9
  91. package/queue/index.js +13 -0
  92. package/queue/monitoredQueue.d.ts +6 -6
  93. package/queue/monitoredQueue.js +6 -3
  94. package/queue/persistentQueue.d.ts +2 -2
  95. package/queue/persistentQueue.js +5 -2
  96. package/queue/queue.d.ts +9 -0
  97. package/queue/queue.js +2 -0
  98. package/retry/arbitraryPolicy.d.ts +2 -2
  99. package/retry/arbitraryPolicy.js +6 -3
  100. package/retry/backoffPolicy.d.ts +2 -2
  101. package/retry/backoffPolicy.js +4 -1
  102. package/retry/index.d.ts +5 -4
  103. package/retry/index.js +13 -0
  104. package/retry/maxAttemptsPolicy.d.ts +2 -2
  105. package/retry/maxAttemptsPolicy.js +4 -1
  106. package/retry/neverPolicy.d.ts +2 -2
  107. package/retry/neverPolicy.js +4 -1
  108. package/retry/policy.d.ts +4 -0
  109. package/retry/policy.js +2 -0
  110. package/schema/attributeSchema.d.ts +2 -0
  111. package/schema/attributeSchema.js +8 -0
  112. package/schema/contentSchemas.d.ts +2 -0
  113. package/schema/contentSchemas.js +46 -0
  114. package/schema/contextSchemas.d.ts +1 -1
  115. package/schema/contextSchemas.js +5 -2
  116. package/schema/ecommerceSchemas.d.ts +1 -1
  117. package/schema/ecommerceSchemas.js +60 -60
  118. package/schema/evaluationSchemas.d.ts +1 -1
  119. package/schema/evaluationSchemas.js +7 -6
  120. package/schema/eventSchemas.d.ts +3 -2
  121. package/schema/eventSchemas.js +53 -48
  122. package/schema/index.d.ts +10 -0
  123. package/schema/index.js +13 -0
  124. package/schema/loggerSchema.d.ts +1 -1
  125. package/schema/loggerSchema.js +9 -7
  126. package/schema/operationSchemas.d.ts +1 -1
  127. package/schema/operationSchemas.js +26 -24
  128. package/schema/sdkFacadeSchemas.d.ts +2 -2
  129. package/schema/sdkFacadeSchemas.js +22 -24
  130. package/schema/sdkSchemas.d.ts +2 -2
  131. package/schema/sdkSchemas.js +21 -22
  132. package/schema/tokenSchema.d.ts +2 -3
  133. package/schema/tokenSchema.js +18 -17
  134. package/schema/userSchema.d.ts +1 -1
  135. package/schema/userSchema.js +47 -61
  136. package/sdk.d.ts +5 -5
  137. package/sdk.js +27 -24
  138. package/sdkEvents.d.ts +2 -2
  139. package/sdkEvents.js +2 -0
  140. package/sourceLocation.js +12 -6
  141. package/tab.d.ts +2 -2
  142. package/tab.js +12 -9
  143. package/token/cachedTokenStore.d.ts +3 -3
  144. package/token/cachedTokenStore.js +6 -3
  145. package/token/inMemoryTokenStore.d.ts +2 -2
  146. package/token/inMemoryTokenStore.js +4 -1
  147. package/token/index.d.ts +4 -41
  148. package/token/index.js +11 -96
  149. package/token/replicatedTokenStore.d.ts +2 -2
  150. package/token/replicatedTokenStore.js +4 -1
  151. package/token/token.d.ts +41 -0
  152. package/token/token.js +99 -0
  153. package/tracker.d.ts +3 -3
  154. package/tracker.js +29 -26
  155. package/trackingEvents.d.ts +29 -14
  156. package/trackingEvents.js +20 -14
  157. package/transformer.js +5 -1
  158. package/utilityTypes.js +2 -0
  159. package/uuid.js +5 -1
  160. package/validation/arrayType.d.ts +2 -2
  161. package/validation/arrayType.js +13 -9
  162. package/validation/booleanType.d.ts +2 -2
  163. package/validation/booleanType.js +7 -3
  164. package/validation/functionType.d.ts +2 -2
  165. package/validation/functionType.js +7 -3
  166. package/validation/index.d.ts +12 -18
  167. package/validation/index.js +29 -30
  168. package/validation/jsonType.d.ts +2 -1
  169. package/validation/jsonType.js +25 -14
  170. package/validation/mixedSchema.d.ts +2 -2
  171. package/validation/mixedSchema.js +4 -1
  172. package/validation/nullType.d.ts +2 -2
  173. package/validation/nullType.js +7 -3
  174. package/validation/numberType.d.ts +2 -2
  175. package/validation/numberType.js +13 -9
  176. package/validation/objectType.d.ts +2 -2
  177. package/validation/objectType.js +23 -18
  178. package/validation/schema.d.ts +16 -0
  179. package/validation/schema.js +15 -0
  180. package/validation/stringType.d.ts +2 -2
  181. package/validation/stringType.js +16 -12
  182. package/validation/unionType.d.ts +2 -2
  183. package/validation/unionType.js +14 -10
  184. package/validation/violation.d.ts +2 -0
  185. package/validation/violation.js +24 -0
  186. package/cid/fixedCidAssigner.d.ts +0 -6
  187. package/cid/fixedCidAssigner.js +0 -10
@@ -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
- export default NeverPolicy;
15
+ exports.NeverPolicy = NeverPolicy;
@@ -0,0 +1,4 @@
1
+ export interface RetryPolicy<T> {
2
+ shouldRetry(attempt: number, subject?: T, failure?: any): boolean;
3
+ getDelay(attempt: number): number;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ import { StringType } from '../validation';
2
+ export declare const attributeNameSchema: StringType;
@@ -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,2 @@
1
+ import { ObjectType } from '../validation';
2
+ export declare const postDetails: ObjectType;
@@ -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/stringType';
1
+ import { StringType } from '../validation';
2
2
  export declare const tokenScopeSchema: StringType;
@@ -1,4 +1,7 @@
1
- import StringType from '../validation/stringType';
2
- export var tokenScopeSchema = new StringType({
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,4 +1,4 @@
1
- import ObjectType from '../validation/objectType';
1
+ import { ObjectType } from '../validation';
2
2
  export declare const productDetails: ObjectType;
3
3
  export declare const cartItem: ObjectType;
4
4
  export declare const cart: ObjectType;
@@ -1,176 +1,176 @@
1
- import ObjectType from '../validation/objectType';
2
- import StringType from '../validation/stringType';
3
- import NumberType from '../validation/numberType';
4
- import ArrayType from '../validation/arrayType';
5
- export var productDetails = new ObjectType({
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
- export var cartItem = new ObjectType({
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
- export var cart = new ObjectType({
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
- export var orderItem = new ObjectType({
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
- export var order = new ObjectType({
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/objectType';
1
+ import { ObjectType } from '../validation';
2
2
  export declare const optionsSchema: ObjectType;
@@ -1,12 +1,13 @@
1
- import ObjectType from '../validation/objectType';
2
- import NumberType from '../validation/numberType';
3
- import { JsonObjectType } from '../validation/jsonType';
4
- export var optionsSchema = new ObjectType({
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
  });
@@ -1,10 +1,11 @@
1
- import ObjectType from '../validation/objectType';
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;
@@ -1,112 +1,117 @@
1
- import ObjectType from '../validation/objectType';
2
- import StringType from '../validation/stringType';
3
- import { cart, order, productDetails } from './ecommerceSchemas';
4
- import { userProfileSchema } from './userSchema';
5
- import NumberType from '../validation/numberType';
6
- import UnionType from '../validation/unionType';
7
- import NullType from '../validation/nullType';
8
- import BooleanType from '../validation/booleanType';
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
- export var cartViewed = new ObjectType({
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
- export var checkoutStarted = new ObjectType({
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
- export var orderPlaced = new ObjectType({
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
- export var productViewed = new ObjectType({
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
- export var userSignedUp = new ObjectType({
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
- export var testGroupAssigned = new ObjectType({
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
- export var eventOccurred = new ObjectType({
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';
@@ -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);
@@ -1,2 +1,2 @@
1
- import ObjectType from '../validation/objectType';
1
+ import { ObjectType } from '../validation';
2
2
  export declare const loggerSchema: ObjectType;
@@ -1,12 +1,14 @@
1
- import ObjectType from '../validation/objectType';
2
- import FunctionType from '../validation/functionType';
3
- export var loggerSchema = new ObjectType({
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
  });
@@ -1,4 +1,4 @@
1
- import ObjectType from '../validation/objectType';
1
+ import { ObjectType } from '../validation';
2
2
  export declare const addOperation: ObjectType;
3
3
  export declare const setOperation: ObjectType;
4
4
  export declare const combineOperation: ObjectType;