@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,71 +1,73 @@
1
- import ObjectType from '../validation/objectType';
2
- import StringType from '../validation/stringType';
3
- import NumberType from '../validation/numberType';
4
- import { JsonArrayType, JsonObjectType, JsonPrimitiveType } from '../validation/jsonType';
5
- import UnionType from '../validation/unionType';
6
- var pointer = new StringType({
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.unsetOperation = exports.clearOperation = exports.incrementOperation = exports.decrementOperation = exports.mergeOperation = exports.combineOperation = exports.setOperation = exports.addOperation = void 0;
4
+ var validation_1 = require("../validation");
5
+ var attributeSchema_1 = require("./attributeSchema");
6
+ var pointer = new validation_1.StringType({
7
7
  format: 'pointer',
8
8
  });
9
- var simpleArray = new JsonArrayType({
10
- items: new JsonPrimitiveType(),
9
+ var simpleArray = new validation_1.JsonArrayType({
10
+ items: new validation_1.JsonPrimitiveType(),
11
11
  });
12
- var simpleMap = new JsonObjectType({
13
- properties: new JsonPrimitiveType(),
12
+ var simpleMap = new validation_1.JsonObjectType({
13
+ properties: new validation_1.JsonPrimitiveType(),
14
+ propertyNames: attributeSchema_1.attributeNameSchema,
14
15
  });
15
- var complexMap = new JsonObjectType({
16
- properties: new UnionType(new JsonPrimitiveType(), simpleArray, simpleMap),
16
+ var complexMap = new validation_1.JsonObjectType({
17
+ properties: new validation_1.UnionType(new validation_1.JsonPrimitiveType(), simpleArray, simpleMap),
18
+ propertyNames: attributeSchema_1.attributeNameSchema,
17
19
  });
18
- var collectionValue = new UnionType(simpleArray, complexMap);
19
- var mixedValue = new UnionType(new JsonPrimitiveType(), simpleArray, complexMap);
20
- export var addOperation = new ObjectType({
20
+ var collectionValue = new validation_1.UnionType(simpleArray, complexMap);
21
+ var mixedValue = new validation_1.UnionType(new validation_1.JsonPrimitiveType(), simpleArray, complexMap);
22
+ exports.addOperation = new validation_1.ObjectType({
21
23
  required: ['path', 'value'],
22
24
  properties: {
23
25
  path: pointer,
24
26
  value: mixedValue,
25
27
  },
26
28
  });
27
- export var setOperation = new ObjectType({
29
+ exports.setOperation = new validation_1.ObjectType({
28
30
  required: ['path', 'value'],
29
31
  properties: {
30
32
  path: pointer,
31
33
  value: mixedValue,
32
34
  },
33
35
  });
34
- export var combineOperation = new ObjectType({
36
+ exports.combineOperation = new validation_1.ObjectType({
35
37
  required: ['path', 'value'],
36
38
  properties: {
37
39
  path: pointer,
38
40
  value: mixedValue,
39
41
  },
40
42
  });
41
- export var mergeOperation = new ObjectType({
43
+ exports.mergeOperation = new validation_1.ObjectType({
42
44
  required: ['path', 'value'],
43
45
  properties: {
44
46
  path: pointer,
45
47
  value: collectionValue,
46
48
  },
47
49
  });
48
- export var decrementOperation = new ObjectType({
50
+ exports.decrementOperation = new validation_1.ObjectType({
49
51
  required: ['path', 'value'],
50
52
  properties: {
51
53
  path: pointer,
52
- value: new NumberType(),
54
+ value: new validation_1.NumberType(),
53
55
  },
54
56
  });
55
- export var incrementOperation = new ObjectType({
57
+ exports.incrementOperation = new validation_1.ObjectType({
56
58
  required: ['path', 'value'],
57
59
  properties: {
58
60
  path: pointer,
59
- value: new NumberType(),
61
+ value: new validation_1.NumberType(),
60
62
  },
61
63
  });
62
- export var clearOperation = new ObjectType({
64
+ exports.clearOperation = new validation_1.ObjectType({
63
65
  required: ['path'],
64
66
  properties: {
65
67
  path: pointer,
66
68
  },
67
69
  });
68
- export var unsetOperation = new ObjectType({
70
+ exports.unsetOperation = new validation_1.ObjectType({
69
71
  required: ['path'],
70
72
  properties: {
71
73
  path: pointer,
@@ -1,2 +1,2 @@
1
- import ObjectType from '../validation/objectType';
2
- export declare const configurationSchema: ObjectType;
1
+ import { ObjectType } from '../validation';
2
+ export declare const sdkFacadeConfigurationSchema: ObjectType;
@@ -1,40 +1,38 @@
1
- import ObjectType from '../validation/objectType';
2
- import StringType from '../validation/stringType';
3
- import BooleanType from '../validation/booleanType';
4
- import { tokenScopeSchema } from './contextSchemas';
5
- import { eventMetadataSchema } from './sdkSchemas';
6
- import { loggerSchema } from './loggerSchema';
7
- import UnionType from '../validation/unionType';
8
- import NullType from '../validation/nullType';
9
- import FunctionType from '../validation/functionType';
10
- export var configurationSchema = new ObjectType({
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sdkFacadeConfigurationSchema = void 0;
4
+ var validation_1 = require("../validation");
5
+ var contextSchemas_1 = require("./contextSchemas");
6
+ var sdkSchemas_1 = require("./sdkSchemas");
7
+ var loggerSchema_1 = require("./loggerSchema");
8
+ exports.sdkFacadeConfigurationSchema = new validation_1.ObjectType({
11
9
  required: ['appId'],
12
10
  properties: {
13
- appId: new StringType({
11
+ appId: new validation_1.StringType({
14
12
  format: 'uuid',
15
13
  }),
16
- cid: new StringType({
14
+ cid: new validation_1.StringType({
17
15
  pattern: /^[0-9a-f]{32}$/i,
18
16
  }),
19
- tokenScope: tokenScopeSchema,
20
- debug: new BooleanType(),
21
- track: new BooleanType(),
22
- logger: loggerSchema,
23
- urlSanitizer: new FunctionType(),
24
- eventMetadata: eventMetadataSchema,
25
- userId: new StringType({
17
+ tokenScope: contextSchemas_1.tokenScopeSchema,
18
+ debug: new validation_1.BooleanType(),
19
+ track: new validation_1.BooleanType(),
20
+ logger: loggerSchema_1.loggerSchema,
21
+ urlSanitizer: new validation_1.FunctionType(),
22
+ eventMetadata: sdkSchemas_1.eventMetadataSchema,
23
+ userId: new validation_1.StringType({
26
24
  minLength: 1,
27
25
  }),
28
- token: new UnionType(new StringType({
26
+ token: new validation_1.UnionType(new validation_1.StringType({
29
27
  pattern: /^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+/=]*$/,
30
- }), new NullType()),
31
- trackerEndpointUrl: new StringType({
28
+ }), new validation_1.NullType()),
29
+ trackerEndpointUrl: new validation_1.StringType({
32
30
  format: 'url',
33
31
  }),
34
- evaluationEndpointUrl: new StringType({
32
+ evaluationEndpointUrl: new validation_1.StringType({
35
33
  format: 'url',
36
34
  }),
37
- bootstrapEndpointUrl: new StringType({
35
+ bootstrapEndpointUrl: new validation_1.StringType({
38
36
  format: 'url',
39
37
  }),
40
38
  },
@@ -1,3 +1,3 @@
1
- import ObjectType from '../validation/objectType';
1
+ import { ObjectType } from '../validation';
2
2
  export declare const eventMetadataSchema: ObjectType;
3
- export declare const configurationSchema: ObjectType;
3
+ export declare const sdkConfigurationSchema: ObjectType;
@@ -1,47 +1,46 @@
1
- import ObjectType from '../validation/objectType';
2
- import StringType from '../validation/stringType';
3
- import BooleanType from '../validation/booleanType';
4
- import { tokenScopeSchema } from './contextSchemas';
5
- import NumberType from '../validation/numberType';
6
- import { loggerSchema } from './loggerSchema';
7
- import FunctionType from '../validation/functionType';
8
- export var eventMetadataSchema = new ObjectType({
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sdkConfigurationSchema = exports.eventMetadataSchema = void 0;
4
+ var validation_1 = require("../validation");
5
+ var contextSchemas_1 = require("./contextSchemas");
6
+ var loggerSchema_1 = require("./loggerSchema");
7
+ exports.eventMetadataSchema = new validation_1.ObjectType({
9
8
  maxProperties: 5,
10
- propertyNames: new StringType({
9
+ propertyNames: new validation_1.StringType({
11
10
  minLength: 1,
12
11
  maxLength: 20,
13
12
  format: 'identifier',
14
13
  }),
15
- additionalProperties: new StringType({
14
+ additionalProperties: new validation_1.StringType({
16
15
  maxLength: 300,
17
16
  }),
18
17
  });
19
- export var configurationSchema = new ObjectType({
18
+ exports.sdkConfigurationSchema = new validation_1.ObjectType({
20
19
  required: ['appId'],
21
20
  properties: {
22
- appId: new StringType({
21
+ appId: new validation_1.StringType({
23
22
  format: 'uuid',
24
23
  }),
25
- cid: new StringType({
24
+ cid: new validation_1.StringType({
26
25
  pattern: /^[0-9a-f]{32}$/i,
27
26
  }),
28
- tokenScope: tokenScopeSchema,
29
- trackerEndpointUrl: new StringType({
27
+ tokenScope: contextSchemas_1.tokenScopeSchema,
28
+ trackerEndpointUrl: new validation_1.StringType({
30
29
  format: 'url',
31
30
  }),
32
- evaluationEndpointUrl: new StringType({
31
+ evaluationEndpointUrl: new validation_1.StringType({
33
32
  format: 'url',
34
33
  }),
35
- bootstrapEndpointUrl: new StringType({
34
+ bootstrapEndpointUrl: new validation_1.StringType({
36
35
  format: 'url',
37
36
  }),
38
- beaconQueueSize: new NumberType({
37
+ beaconQueueSize: new validation_1.NumberType({
39
38
  minimum: 0,
40
39
  integer: true,
41
40
  }),
42
- debug: new BooleanType(),
43
- logger: loggerSchema,
44
- urlSanitizer: new FunctionType(),
45
- eventMetadata: eventMetadataSchema,
41
+ debug: new validation_1.BooleanType(),
42
+ logger: loggerSchema_1.loggerSchema,
43
+ urlSanitizer: new validation_1.FunctionType(),
44
+ eventMetadata: exports.eventMetadataSchema,
46
45
  },
47
46
  });
@@ -1,3 +1,2 @@
1
- import ObjectType from '../validation/objectType';
2
- declare const _default: ObjectType;
3
- export default _default;
1
+ import { ObjectType } from '../validation';
2
+ export declare const tokenSchema: ObjectType;
@@ -1,39 +1,40 @@
1
- import ObjectType from '../validation/objectType';
2
- import StringType from '../validation/stringType';
3
- import NumberType from '../validation/numberType';
4
- export default new ObjectType({
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tokenSchema = void 0;
4
+ var validation_1 = require("../validation");
5
+ exports.tokenSchema = new validation_1.ObjectType({
5
6
  required: ['headers', 'claims'],
6
7
  properties: {
7
- headers: new ObjectType({
8
+ headers: new validation_1.ObjectType({
8
9
  required: ['typ', 'alg', 'appId'],
9
10
  properties: {
10
- typ: new StringType(),
11
- alg: new StringType(),
12
- kid: new StringType(),
13
- appId: new StringType({
11
+ typ: new validation_1.StringType(),
12
+ alg: new validation_1.StringType(),
13
+ kid: new validation_1.StringType(),
14
+ appId: new validation_1.StringType({
14
15
  format: 'uuid',
15
16
  }),
16
17
  },
17
18
  }),
18
- claims: new ObjectType({
19
+ claims: new validation_1.ObjectType({
19
20
  required: ['iss', 'aud', 'iat'],
20
21
  properties: {
21
- iss: new StringType(),
22
- aud: new StringType(),
23
- iat: new NumberType({
22
+ iss: new validation_1.StringType(),
23
+ aud: new validation_1.StringType(),
24
+ iat: new validation_1.NumberType({
24
25
  minimum: 0,
25
26
  }),
26
- sub: new StringType({
27
+ sub: new validation_1.StringType({
27
28
  minLength: 1,
28
29
  }),
29
- exp: new NumberType({
30
+ exp: new validation_1.NumberType({
30
31
  minimum: 0,
31
32
  }),
32
- jti: new StringType({
33
+ jti: new validation_1.StringType({
33
34
  format: 'uuid',
34
35
  }),
35
36
  },
36
37
  }),
37
- signature: new StringType(),
38
+ signature: new validation_1.StringType(),
38
39
  },
39
40
  });
@@ -1,2 +1,2 @@
1
- import ObjectType from '../validation/objectType';
1
+ import { ObjectType } from '../validation';
2
2
  export declare const userProfileSchema: ObjectType;
@@ -1,147 +1,133 @@
1
- import StringType from '../validation/stringType';
2
- import ObjectType from '../validation/objectType';
3
- import UnionType from '../validation/unionType';
4
- import BooleanType from '../validation/booleanType';
5
- import NullType from '../validation/nullType';
6
- import NumberType from '../validation/numberType';
7
- import ArrayType from '../validation/arrayType';
8
- export var userProfileSchema = new ObjectType({
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.userProfileSchema = void 0;
4
+ var validation_1 = require("../validation");
5
+ var attributeSchema_1 = require("./attributeSchema");
6
+ exports.userProfileSchema = new validation_1.ObjectType({
9
7
  properties: {
10
- firstName: new StringType({
8
+ firstName: new validation_1.StringType({
11
9
  minLength: 1,
12
10
  maxLength: 50,
13
11
  }),
14
- lastName: new StringType({
12
+ lastName: new validation_1.StringType({
15
13
  minLength: 1,
16
14
  maxLength: 50,
17
15
  }),
18
- birthDate: new StringType({
16
+ birthDate: new validation_1.StringType({
19
17
  format: 'date',
20
18
  }),
21
- gender: new StringType({
19
+ gender: new validation_1.StringType({
22
20
  enumeration: ['male', 'female', 'neutral', 'unknown'],
23
21
  }),
24
- email: new StringType({
22
+ email: new validation_1.StringType({
25
23
  minLength: 1,
26
24
  maxLength: 254,
27
25
  }),
28
- alternateEmail: new StringType({
26
+ alternateEmail: new validation_1.StringType({
29
27
  minLength: 1,
30
28
  maxLength: 254,
31
29
  }),
32
- phone: new StringType({
30
+ phone: new validation_1.StringType({
33
31
  minLength: 1,
34
32
  maxLength: 30,
35
33
  }),
36
- alternatePhone: new StringType({
34
+ alternatePhone: new validation_1.StringType({
37
35
  minLength: 1,
38
36
  maxLength: 30,
39
37
  }),
40
- address: new ObjectType({
38
+ address: new validation_1.ObjectType({
41
39
  properties: {
42
- street: new StringType({
40
+ street: new validation_1.StringType({
43
41
  minLength: 1,
44
42
  maxLength: 100,
45
43
  }),
46
- district: new StringType({
44
+ district: new validation_1.StringType({
47
45
  minLength: 1,
48
46
  maxLength: 100,
49
47
  }),
50
- city: new StringType({
48
+ city: new validation_1.StringType({
51
49
  minLength: 1,
52
50
  maxLength: 100,
53
51
  }),
54
- region: new StringType({
52
+ region: new validation_1.StringType({
55
53
  minLength: 1,
56
54
  maxLength: 100,
57
55
  }),
58
- country: new StringType({
56
+ country: new validation_1.StringType({
59
57
  minLength: 1,
60
58
  maxLength: 100,
61
59
  }),
62
- postalCode: new StringType({
60
+ postalCode: new validation_1.StringType({
63
61
  minLength: 1,
64
62
  maxLength: 20,
65
63
  }),
66
64
  },
67
65
  }),
68
- avatar: new StringType({
66
+ avatar: new validation_1.StringType({
69
67
  maxLength: 500,
70
68
  format: 'url',
71
69
  }),
72
- company: new StringType({
70
+ company: new validation_1.StringType({
73
71
  minLength: 1,
74
72
  maxLength: 200,
75
73
  }),
76
- companyUrl: new StringType({
74
+ companyUrl: new validation_1.StringType({
77
75
  maxLength: 200,
78
76
  format: 'url',
79
77
  }),
80
- jobTitle: new StringType({
78
+ jobTitle: new validation_1.StringType({
81
79
  minLength: 1,
82
80
  maxLength: 50,
83
81
  }),
84
- interests: new ArrayType({
82
+ interests: new validation_1.ArrayType({
85
83
  maxItems: 30,
86
- items: new StringType({
84
+ items: new validation_1.StringType({
87
85
  minLength: 1,
88
86
  maxLength: 30,
89
87
  }),
90
88
  }),
91
- activities: new ArrayType({
89
+ activities: new validation_1.ArrayType({
92
90
  maxItems: 30,
93
- items: new StringType({
91
+ items: new validation_1.StringType({
94
92
  minLength: 1,
95
93
  maxLength: 30,
96
94
  }),
97
95
  }),
98
- custom: new ObjectType({
99
- propertyNames: new StringType({
100
- maxLength: 50,
101
- format: 'identifier',
102
- }),
96
+ custom: new validation_1.ObjectType({
97
+ propertyNames: attributeSchema_1.attributeNameSchema,
103
98
  maxProperties: 10,
104
- additionalProperties: new UnionType(new BooleanType(), new NullType(), new NumberType(), new StringType({
99
+ additionalProperties: new validation_1.UnionType(new validation_1.BooleanType(), new validation_1.NullType(), new validation_1.NumberType(), new validation_1.StringType({
105
100
  maxLength: 100,
106
- }), new ArrayType({
101
+ }), new validation_1.ArrayType({
107
102
  maxItems: 10,
108
- items: new UnionType(new BooleanType(), new NullType(), new NumberType(), new StringType({
103
+ items: new validation_1.UnionType(new validation_1.BooleanType(), new validation_1.NullType(), new validation_1.NumberType(), new validation_1.StringType({
109
104
  maxLength: 100,
110
- }), new ArrayType({
105
+ }), new validation_1.ArrayType({
111
106
  maxItems: 10,
112
- items: new UnionType(new BooleanType(), new NullType(), new NumberType(), new StringType({
107
+ items: new validation_1.UnionType(new validation_1.BooleanType(), new validation_1.NullType(), new validation_1.NumberType(), new validation_1.StringType({
113
108
  maxLength: 100,
114
109
  })),
115
- }), new ObjectType({
116
- propertyNames: new StringType({
117
- maxLength: 50,
118
- format: 'identifier',
119
- }),
110
+ }), new validation_1.ObjectType({
111
+ propertyNames: attributeSchema_1.attributeNameSchema,
120
112
  maxProperties: 10,
121
- additionalProperties: new UnionType(new BooleanType(), new NullType(), new NumberType(), new StringType({
113
+ additionalProperties: new validation_1.UnionType(new validation_1.BooleanType(), new validation_1.NullType(), new validation_1.NumberType(), new validation_1.StringType({
122
114
  maxLength: 100,
123
115
  })),
124
116
  })),
125
- }), new ObjectType({
126
- propertyNames: new StringType({
127
- maxLength: 50,
128
- format: 'identifier',
129
- }),
117
+ }), new validation_1.ObjectType({
118
+ propertyNames: attributeSchema_1.attributeNameSchema,
130
119
  maxProperties: 10,
131
- additionalProperties: new UnionType(new BooleanType(), new NullType(), new NumberType(), new StringType({
120
+ additionalProperties: new validation_1.UnionType(new validation_1.BooleanType(), new validation_1.NullType(), new validation_1.NumberType(), new validation_1.StringType({
132
121
  maxLength: 100,
133
- }), new ArrayType({
122
+ }), new validation_1.ArrayType({
134
123
  maxItems: 10,
135
- items: new UnionType(new BooleanType(), new NullType(), new NumberType(), new StringType({
124
+ items: new validation_1.UnionType(new validation_1.BooleanType(), new validation_1.NullType(), new validation_1.NumberType(), new validation_1.StringType({
136
125
  maxLength: 100,
137
126
  })),
138
- }), new ObjectType({
139
- propertyNames: new StringType({
140
- maxLength: 50,
141
- format: 'identifier',
142
- }),
127
+ }), new validation_1.ObjectType({
128
+ propertyNames: attributeSchema_1.attributeNameSchema,
143
129
  maxProperties: 10,
144
- additionalProperties: new UnionType(new BooleanType(), new NullType(), new NumberType(), new StringType({
130
+ additionalProperties: new validation_1.UnionType(new validation_1.BooleanType(), new validation_1.NullType(), new validation_1.NumberType(), new validation_1.StringType({
145
131
  maxLength: 100,
146
132
  })),
147
133
  })),
package/sdk.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import Context, { TokenScope } from './context';
1
+ import { Context, TokenScope } from './context';
2
2
  import { Logger } from './logging';
3
- import Tracker from './tracker';
4
- import Evaluator from './evaluator';
3
+ import { Tracker } from './tracker';
4
+ import { Evaluator } from './evaluator';
5
5
  import { SdkEventMap } from './sdkEvents';
6
6
  import { EventManager } from './eventManager';
7
- import CidAssigner from './cid/index';
7
+ import { CidAssigner } from './cid';
8
8
  import { UrlSanitizer } from './tab';
9
9
  export declare type Configuration = {
10
10
  appId: string;
@@ -21,7 +21,7 @@ export declare type Configuration = {
21
21
  [key: string]: string;
22
22
  };
23
23
  };
24
- export default class Sdk {
24
+ export declare class Sdk {
25
25
  private container;
26
26
  private closed;
27
27
  private constructor();