@croct/sdk 0.17.12 → 0.18.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 (226) hide show
  1. package/activeRecord.cjs +1 -1
  2. package/activeRecord.d.cts +26 -0
  3. package/activeRecord.js +1 -1
  4. package/apiKey.d.cts +48 -0
  5. package/base64Url.d.cts +4 -0
  6. package/cache/cache.d.cts +17 -0
  7. package/cache/cookieCache.d.cts +22 -0
  8. package/cache/fallbackCache.d.cts +11 -0
  9. package/cache/inMemoryCache.d.cts +11 -0
  10. package/cache/index.cjs +5 -5
  11. package/cache/index.d.cts +4 -0
  12. package/cache/index.js +4 -4
  13. package/cache/localStorageCache.d.cts +19 -0
  14. package/channel/channel.cjs +1 -1
  15. package/channel/channel.d.cts +24 -0
  16. package/channel/channel.js +1 -1
  17. package/channel/encodedChannel.d.cts +12 -0
  18. package/channel/guaranteedChannel.cjs +2 -2
  19. package/channel/guaranteedChannel.d.cts +33 -0
  20. package/channel/guaranteedChannel.js +2 -2
  21. package/channel/httpBeaconChannel.cjs +5 -5
  22. package/channel/httpBeaconChannel.d.cts +26 -0
  23. package/channel/httpBeaconChannel.js +5 -5
  24. package/channel/index.cjs +8 -8
  25. package/channel/index.d.cts +12 -0
  26. package/channel/index.js +7 -7
  27. package/channel/queuedChannel.cjs +2 -2
  28. package/channel/queuedChannel.d.cts +21 -0
  29. package/channel/queuedChannel.js +2 -2
  30. package/channel/retryChannel.cjs +2 -2
  31. package/channel/retryChannel.d.cts +21 -0
  32. package/channel/retryChannel.js +2 -2
  33. package/channel/sandboxChannel.cjs +1 -1
  34. package/channel/sandboxChannel.d.cts +15 -0
  35. package/channel/sandboxChannel.js +1 -1
  36. package/cid/assigner.d.cts +5 -0
  37. package/cid/cachedAssigner.cjs +1 -1
  38. package/cid/cachedAssigner.d.cts +17 -0
  39. package/cid/cachedAssigner.js +1 -1
  40. package/cid/fixedAssigner.d.cts +9 -0
  41. package/cid/index.cjs +5 -5
  42. package/cid/index.d.cts +6 -0
  43. package/cid/index.js +4 -4
  44. package/cid/remoteAssigner.cjs +3 -3
  45. package/cid/remoteAssigner.d.cts +13 -0
  46. package/cid/remoteAssigner.js +3 -3
  47. package/constants.cjs +1 -1
  48. package/constants.d.cts +6 -0
  49. package/constants.d.ts +2 -2
  50. package/constants.js +1 -1
  51. package/container.cjs +18 -18
  52. package/container.d.cts +95 -0
  53. package/container.js +18 -18
  54. package/contentFetcher.cjs +4 -4
  55. package/contentFetcher.d.cts +69 -0
  56. package/contentFetcher.js +4 -4
  57. package/context.cjs +4 -4
  58. package/context.d.cts +36 -0
  59. package/context.js +4 -4
  60. package/error.d.cts +4 -0
  61. package/evaluator.cjs +5 -5
  62. package/evaluator.d.cts +86 -0
  63. package/evaluator.js +5 -5
  64. package/eventManager.d.cts +21 -0
  65. package/eventSubjectProcessor.d.cts +22 -0
  66. package/facade/contentFetcherFacade.cjs +2 -2
  67. package/facade/contentFetcherFacade.d.cts +36 -0
  68. package/facade/contentFetcherFacade.js +2 -2
  69. package/facade/evaluatorFacade.cjs +2 -2
  70. package/facade/evaluatorFacade.d.cts +41 -0
  71. package/facade/evaluatorFacade.js +2 -2
  72. package/facade/index.cjs +7 -9
  73. package/facade/index.d.cts +29 -0
  74. package/facade/index.js +7 -8
  75. package/facade/sdkFacade.cjs +10 -10
  76. package/facade/sdkFacade.d.cts +86 -0
  77. package/facade/sdkFacade.js +10 -10
  78. package/facade/sessionFacade.cjs +1 -1
  79. package/facade/sessionFacade.d.cts +22 -0
  80. package/facade/sessionFacade.js +1 -1
  81. package/facade/sessionPatch.cjs +1 -1
  82. package/facade/sessionPatch.d.cts +21 -0
  83. package/facade/sessionPatch.js +1 -1
  84. package/facade/trackerFacade.cjs +2 -2
  85. package/facade/trackerFacade.d.cts +25 -0
  86. package/facade/trackerFacade.js +2 -2
  87. package/facade/userFacade.cjs +1 -1
  88. package/facade/userFacade.d.cts +28 -0
  89. package/facade/userFacade.js +1 -1
  90. package/facade/userPatch.cjs +1 -1
  91. package/facade/userPatch.d.cts +21 -0
  92. package/facade/userPatch.js +1 -1
  93. package/help.d.cts +5 -0
  94. package/index.cjs +2 -4
  95. package/index.d.cts +25 -0
  96. package/index.js +2 -3
  97. package/logging/consoleLogger.d.cts +13 -0
  98. package/logging/filteredLogger.d.cts +22 -0
  99. package/logging/index.cjs +6 -6
  100. package/logging/index.d.cts +5 -0
  101. package/logging/index.js +5 -5
  102. package/logging/logger.d.cts +11 -0
  103. package/logging/namespacedLogger.d.cts +14 -0
  104. package/logging/nullLogger.d.cts +10 -0
  105. package/namespacedStorage.d.cts +16 -0
  106. package/package.json +4 -1
  107. package/patch.d.cts +46 -0
  108. package/queue/capacityRestrictedQueue.d.cts +16 -0
  109. package/queue/inMemoryQueue.d.cts +15 -0
  110. package/queue/index.cjs +6 -6
  111. package/queue/index.d.cts +6 -0
  112. package/queue/index.js +5 -5
  113. package/queue/monitoredQueue.cjs +1 -1
  114. package/queue/monitoredQueue.d.cts +28 -0
  115. package/queue/monitoredQueue.js +1 -1
  116. package/queue/persistentQueue.d.cts +18 -0
  117. package/queue/queue.d.cts +11 -0
  118. package/retry/arbitraryPolicy.d.cts +10 -0
  119. package/retry/backoffPolicy.d.cts +26 -0
  120. package/retry/index.cjs +6 -6
  121. package/retry/index.d.cts +5 -0
  122. package/retry/index.js +5 -5
  123. package/retry/maxAttemptsPolicy.d.cts +11 -0
  124. package/retry/neverPolicy.d.cts +8 -0
  125. package/retry/policy.d.cts +6 -0
  126. package/schema/attributeSchema.cjs +1 -1
  127. package/schema/attributeSchema.d.cts +6 -0
  128. package/schema/attributeSchema.js +1 -1
  129. package/schema/contentFetcherSchemas.cjs +1 -1
  130. package/schema/contentFetcherSchemas.d.cts +6 -0
  131. package/schema/contentFetcherSchemas.js +1 -1
  132. package/schema/contentSchemas.cjs +1 -1
  133. package/schema/contentSchemas.d.cts +6 -0
  134. package/schema/contentSchemas.js +1 -1
  135. package/schema/contextSchemas.cjs +1 -1
  136. package/schema/contextSchemas.d.cts +6 -0
  137. package/schema/contextSchemas.js +1 -1
  138. package/schema/ecommerceSchemas.cjs +1 -1
  139. package/schema/ecommerceSchemas.d.cts +10 -0
  140. package/schema/ecommerceSchemas.js +1 -1
  141. package/schema/evaluatorSchemas.cjs +1 -1
  142. package/schema/evaluatorSchemas.d.cts +6 -0
  143. package/schema/evaluatorSchemas.js +1 -1
  144. package/schema/eventSchemas.cjs +4 -4
  145. package/schema/eventSchemas.d.cts +16 -0
  146. package/schema/eventSchemas.js +4 -4
  147. package/schema/index.cjs +22 -22
  148. package/schema/index.d.cts +14 -0
  149. package/schema/index.js +11 -11
  150. package/schema/loggerSchema.cjs +1 -1
  151. package/schema/loggerSchema.d.cts +6 -0
  152. package/schema/loggerSchema.js +1 -1
  153. package/schema/operationSchemas.cjs +2 -2
  154. package/schema/operationSchemas.d.cts +14 -0
  155. package/schema/operationSchemas.js +2 -2
  156. package/schema/sdkFacadeSchemas.cjs +4 -4
  157. package/schema/sdkFacadeSchemas.d.cts +6 -0
  158. package/schema/sdkFacadeSchemas.js +4 -4
  159. package/schema/sdkSchemas.cjs +3 -3
  160. package/schema/sdkSchemas.d.cts +8 -0
  161. package/schema/sdkSchemas.js +3 -3
  162. package/schema/tokenSchema.cjs +1 -1
  163. package/schema/tokenSchema.d.cts +6 -0
  164. package/schema/tokenSchema.js +1 -1
  165. package/schema/userSchema.cjs +2 -2
  166. package/schema/userSchema.d.cts +6 -0
  167. package/schema/userSchema.js +2 -2
  168. package/sdk.cjs +4 -4
  169. package/sdk.d.cts +69 -0
  170. package/sdk.js +4 -4
  171. package/sdkEvents.d.cts +15 -0
  172. package/sourceLocation.d.cts +14 -0
  173. package/tab.cjs +1 -1
  174. package/tab.d.cts +40 -0
  175. package/tab.js +1 -1
  176. package/token/cachedTokenStore.cjs +1 -1
  177. package/token/cachedTokenStore.d.cts +13 -0
  178. package/token/cachedTokenStore.js +1 -1
  179. package/token/inMemoryTokenStore.d.cts +11 -0
  180. package/token/index.cjs +5 -5
  181. package/token/index.d.cts +7 -0
  182. package/token/index.js +4 -4
  183. package/token/replicatedTokenStore.d.cts +13 -0
  184. package/token/token.cjs +3 -3
  185. package/token/token.d.cts +70 -0
  186. package/token/token.js +3 -3
  187. package/tracker.cjs +3 -3
  188. package/tracker.d.cts +82 -0
  189. package/tracker.js +3 -3
  190. package/trackingEvents.d.cts +309 -0
  191. package/transformer.d.cts +6 -0
  192. package/utilityTypes.d.cts +4 -0
  193. package/uuid.d.cts +3 -0
  194. package/validation/arrayType.cjs +2 -2
  195. package/validation/arrayType.d.cts +16 -0
  196. package/validation/arrayType.js +2 -2
  197. package/validation/booleanType.cjs +2 -2
  198. package/validation/booleanType.d.cts +9 -0
  199. package/validation/booleanType.js +2 -2
  200. package/validation/functionType.cjs +2 -2
  201. package/validation/functionType.d.cts +9 -0
  202. package/validation/functionType.js +2 -2
  203. package/validation/index.cjs +14 -14
  204. package/validation/index.d.cts +12 -0
  205. package/validation/index.js +12 -12
  206. package/validation/jsonType.cjs +2 -2
  207. package/validation/jsonType.d.cts +35 -0
  208. package/validation/jsonType.js +2 -2
  209. package/validation/mixedSchema.d.cts +7 -0
  210. package/validation/nullType.cjs +2 -2
  211. package/validation/nullType.d.cts +9 -0
  212. package/validation/nullType.js +2 -2
  213. package/validation/numberType.cjs +2 -2
  214. package/validation/numberType.d.cts +16 -0
  215. package/validation/numberType.js +2 -2
  216. package/validation/objectType.cjs +3 -3
  217. package/validation/objectType.d.cts +30 -0
  218. package/validation/objectType.js +3 -3
  219. package/validation/schema.d.cts +18 -0
  220. package/validation/stringType.cjs +2 -2
  221. package/validation/stringType.d.cts +24 -0
  222. package/validation/stringType.js +2 -2
  223. package/validation/unionType.cjs +2 -2
  224. package/validation/unionType.d.cts +11 -0
  225. package/validation/unionType.js +2 -2
  226. package/validation/violation.d.cts +4 -0
@@ -30,10 +30,10 @@ __export(eventSchemas_exports, {
30
30
  userSignedUp: () => userSignedUp
31
31
  });
32
32
  module.exports = __toCommonJS(eventSchemas_exports);
33
- var import_validation = require("../validation");
34
- var import_ecommerceSchemas = require("./ecommerceSchemas");
35
- var import_userSchema = require("./userSchema");
36
- var import_contentSchemas = require("./contentSchemas");
33
+ var import_validation = require('../validation/index.cjs');
34
+ var import_ecommerceSchemas = require('./ecommerceSchemas.cjs');
35
+ var import_userSchema = require('./userSchema.cjs');
36
+ var import_contentSchemas = require('./contentSchemas.cjs');
37
37
  const cartModified = new import_validation.ObjectType({
38
38
  required: ["cart"],
39
39
  properties: {
@@ -0,0 +1,16 @@
1
+ import { ObjectType } from '../validation/objectType.cjs';
2
+ import '../validation/schema.cjs';
3
+
4
+ declare const cartModified: ObjectType;
5
+ declare const cartViewed: ObjectType;
6
+ declare const checkoutStarted: ObjectType;
7
+ declare const orderPlaced: ObjectType;
8
+ declare const productViewed: ObjectType;
9
+ declare const userSignedUp: ObjectType;
10
+ declare const goalCompleted: ObjectType;
11
+ declare const interestShown: ObjectType;
12
+ declare const postViewed: ObjectType;
13
+ declare const linkOpened: ObjectType;
14
+ declare const eventOccurred: ObjectType;
15
+
16
+ export { cartModified, cartViewed, checkoutStarted, eventOccurred, goalCompleted, interestShown, linkOpened, orderPlaced, postViewed, productViewed, userSignedUp };
@@ -6,10 +6,10 @@ import {
6
6
  NullType,
7
7
  BooleanType,
8
8
  ArrayType
9
- } from "../validation";
10
- import { cart, order, productDetails } from "./ecommerceSchemas";
11
- import { userProfileSchema } from "./userSchema";
12
- import { postDetails } from "./contentSchemas";
9
+ } from "../validation/index.js";
10
+ import { cart, order, productDetails } from "./ecommerceSchemas.js";
11
+ import { userProfileSchema } from "./userSchema.js";
12
+ import { postDetails } from "./contentSchemas.js";
13
13
  const cartModified = new ObjectType({
14
14
  required: ["cart"],
15
15
  properties: {
package/schema/index.cjs CHANGED
@@ -14,28 +14,28 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
15
  var schema_exports = {};
16
16
  module.exports = __toCommonJS(schema_exports);
17
- __reExport(schema_exports, require("./contextSchemas"), module.exports);
18
- __reExport(schema_exports, require("./ecommerceSchemas"), module.exports);
19
- __reExport(schema_exports, require("./evaluatorSchemas"), module.exports);
20
- __reExport(schema_exports, require("./contentFetcherSchemas"), module.exports);
21
- __reExport(schema_exports, require("./eventSchemas"), module.exports);
22
- __reExport(schema_exports, require("./loggerSchema"), module.exports);
23
- __reExport(schema_exports, require("./operationSchemas"), module.exports);
24
- __reExport(schema_exports, require("./sdkFacadeSchemas"), module.exports);
25
- __reExport(schema_exports, require("./sdkSchemas"), module.exports);
26
- __reExport(schema_exports, require("./tokenSchema"), module.exports);
27
- __reExport(schema_exports, require("./userSchema"), module.exports);
17
+ __reExport(schema_exports, require('./contextSchemas.cjs'), module.exports);
18
+ __reExport(schema_exports, require('./ecommerceSchemas.cjs'), module.exports);
19
+ __reExport(schema_exports, require('./evaluatorSchemas.cjs'), module.exports);
20
+ __reExport(schema_exports, require('./contentFetcherSchemas.cjs'), module.exports);
21
+ __reExport(schema_exports, require('./eventSchemas.cjs'), module.exports);
22
+ __reExport(schema_exports, require('./loggerSchema.cjs'), module.exports);
23
+ __reExport(schema_exports, require('./operationSchemas.cjs'), module.exports);
24
+ __reExport(schema_exports, require('./sdkFacadeSchemas.cjs'), module.exports);
25
+ __reExport(schema_exports, require('./sdkSchemas.cjs'), module.exports);
26
+ __reExport(schema_exports, require('./tokenSchema.cjs'), module.exports);
27
+ __reExport(schema_exports, require('./userSchema.cjs'), module.exports);
28
28
  // Annotate the CommonJS export names for ESM import in node:
29
29
  0 && (module.exports = {
30
- ...require("./contextSchemas"),
31
- ...require("./ecommerceSchemas"),
32
- ...require("./evaluatorSchemas"),
33
- ...require("./contentFetcherSchemas"),
34
- ...require("./eventSchemas"),
35
- ...require("./loggerSchema"),
36
- ...require("./operationSchemas"),
37
- ...require("./sdkFacadeSchemas"),
38
- ...require("./sdkSchemas"),
39
- ...require("./tokenSchema"),
40
- ...require("./userSchema")
30
+ ...require('./contextSchemas.cjs'),
31
+ ...require('./ecommerceSchemas.cjs'),
32
+ ...require('./evaluatorSchemas.cjs'),
33
+ ...require('./contentFetcherSchemas.cjs'),
34
+ ...require('./eventSchemas.cjs'),
35
+ ...require('./loggerSchema.cjs'),
36
+ ...require('./operationSchemas.cjs'),
37
+ ...require('./sdkFacadeSchemas.cjs'),
38
+ ...require('./sdkSchemas.cjs'),
39
+ ...require('./tokenSchema.cjs'),
40
+ ...require('./userSchema.cjs')
41
41
  });
@@ -0,0 +1,14 @@
1
+ export { tokenScopeSchema } from './contextSchemas.cjs';
2
+ export { cart, cartItem, order, orderItem, productDetails } from './ecommerceSchemas.cjs';
3
+ export { evaluationOptionsSchema } from './evaluatorSchemas.cjs';
4
+ export { fetchOptionsSchema } from './contentFetcherSchemas.cjs';
5
+ export { cartModified, cartViewed, checkoutStarted, eventOccurred, goalCompleted, interestShown, linkOpened, orderPlaced, postViewed, productViewed, userSignedUp } from './eventSchemas.cjs';
6
+ export { loggerSchema } from './loggerSchema.cjs';
7
+ export { addOperation, clearOperation, combineOperation, decrementOperation, incrementOperation, mergeOperation, removeOperation, setOperation, unsetOperation } from './operationSchemas.cjs';
8
+ export { sdkFacadeConfigurationSchema } from './sdkFacadeSchemas.cjs';
9
+ export { cookieOptionsSchema, eventMetadataSchema, sdkConfigurationSchema } from './sdkSchemas.cjs';
10
+ export { tokenSchema } from './tokenSchema.cjs';
11
+ export { userProfileSchema } from './userSchema.cjs';
12
+ import '../validation/stringType.cjs';
13
+ import '../validation/schema.cjs';
14
+ import '../validation/objectType.cjs';
package/schema/index.js CHANGED
@@ -1,11 +1,11 @@
1
- export * from "./contextSchemas";
2
- export * from "./ecommerceSchemas";
3
- export * from "./evaluatorSchemas";
4
- export * from "./contentFetcherSchemas";
5
- export * from "./eventSchemas";
6
- export * from "./loggerSchema";
7
- export * from "./operationSchemas";
8
- export * from "./sdkFacadeSchemas";
9
- export * from "./sdkSchemas";
10
- export * from "./tokenSchema";
11
- export * from "./userSchema";
1
+ export * from "./contextSchemas.js";
2
+ export * from "./ecommerceSchemas.js";
3
+ export * from "./evaluatorSchemas.js";
4
+ export * from "./contentFetcherSchemas.js";
5
+ export * from "./eventSchemas.js";
6
+ export * from "./loggerSchema.js";
7
+ export * from "./operationSchemas.js";
8
+ export * from "./sdkFacadeSchemas.js";
9
+ export * from "./sdkSchemas.js";
10
+ export * from "./tokenSchema.js";
11
+ export * from "./userSchema.js";
@@ -20,7 +20,7 @@ __export(loggerSchema_exports, {
20
20
  loggerSchema: () => loggerSchema
21
21
  });
22
22
  module.exports = __toCommonJS(loggerSchema_exports);
23
- var import_validation = require("../validation");
23
+ var import_validation = require('../validation/index.cjs');
24
24
  const loggerSchema = new import_validation.ObjectType({
25
25
  required: ["debug", "info", "warn", "error"],
26
26
  additionalProperties: true,
@@ -0,0 +1,6 @@
1
+ import { ObjectType } from '../validation/objectType.cjs';
2
+ import '../validation/schema.cjs';
3
+
4
+ declare const loggerSchema: ObjectType;
5
+
6
+ export { loggerSchema };
@@ -1,4 +1,4 @@
1
- import { ObjectType, FunctionType } from "../validation";
1
+ import { ObjectType, FunctionType } from "../validation/index.js";
2
2
  const loggerSchema = new ObjectType({
3
3
  required: ["debug", "info", "warn", "error"],
4
4
  additionalProperties: true,
@@ -28,8 +28,8 @@ __export(operationSchemas_exports, {
28
28
  unsetOperation: () => unsetOperation
29
29
  });
30
30
  module.exports = __toCommonJS(operationSchemas_exports);
31
- var import_validation = require("../validation");
32
- var import_attributeSchema = require("./attributeSchema");
31
+ var import_validation = require('../validation/index.cjs');
32
+ var import_attributeSchema = require('./attributeSchema.cjs');
33
33
  const pointer = new import_validation.StringType({
34
34
  format: "pointer"
35
35
  });
@@ -0,0 +1,14 @@
1
+ import { ObjectType } from '../validation/objectType.cjs';
2
+ import '../validation/schema.cjs';
3
+
4
+ declare const addOperation: ObjectType;
5
+ declare const setOperation: ObjectType;
6
+ declare const combineOperation: ObjectType;
7
+ declare const mergeOperation: ObjectType;
8
+ declare const decrementOperation: ObjectType;
9
+ declare const incrementOperation: ObjectType;
10
+ declare const clearOperation: ObjectType;
11
+ declare const unsetOperation: ObjectType;
12
+ declare const removeOperation: ObjectType;
13
+
14
+ export { addOperation, clearOperation, combineOperation, decrementOperation, incrementOperation, mergeOperation, removeOperation, setOperation, unsetOperation };
@@ -6,8 +6,8 @@ import {
6
6
  JsonObjectType,
7
7
  JsonPrimitiveType,
8
8
  UnionType
9
- } from "../validation";
10
- import { attributeNameSchema } from "./attributeSchema";
9
+ } from "../validation/index.js";
10
+ import { attributeNameSchema } from "./attributeSchema.js";
11
11
  const pointer = new StringType({
12
12
  format: "pointer"
13
13
  });
@@ -20,10 +20,10 @@ __export(sdkFacadeSchemas_exports, {
20
20
  sdkFacadeConfigurationSchema: () => sdkFacadeConfigurationSchema
21
21
  });
22
22
  module.exports = __toCommonJS(sdkFacadeSchemas_exports);
23
- var import_validation = require("../validation");
24
- var import_contextSchemas = require("./contextSchemas");
25
- var import_sdkSchemas = require("./sdkSchemas");
26
- var import_loggerSchema = require("./loggerSchema");
23
+ var import_validation = require('../validation/index.cjs');
24
+ var import_contextSchemas = require('./contextSchemas.cjs');
25
+ var import_sdkSchemas = require('./sdkSchemas.cjs');
26
+ var import_loggerSchema = require('./loggerSchema.cjs');
27
27
  const sdkFacadeConfigurationSchema = new import_validation.ObjectType({
28
28
  required: ["appId"],
29
29
  properties: {
@@ -0,0 +1,6 @@
1
+ import { ObjectType } from '../validation/objectType.cjs';
2
+ import '../validation/schema.cjs';
3
+
4
+ declare const sdkFacadeConfigurationSchema: ObjectType;
5
+
6
+ export { sdkFacadeConfigurationSchema };
@@ -6,10 +6,10 @@ import {
6
6
  NullType,
7
7
  FunctionType,
8
8
  NumberType
9
- } from "../validation";
10
- import { tokenScopeSchema } from "./contextSchemas";
11
- import { cookieOptionsSchema, eventMetadataSchema } from "./sdkSchemas";
12
- import { loggerSchema } from "./loggerSchema";
9
+ } from "../validation/index.js";
10
+ import { tokenScopeSchema } from "./contextSchemas.js";
11
+ import { cookieOptionsSchema, eventMetadataSchema } from "./sdkSchemas.js";
12
+ import { loggerSchema } from "./loggerSchema.js";
13
13
  const sdkFacadeConfigurationSchema = new ObjectType({
14
14
  required: ["appId"],
15
15
  properties: {
@@ -22,9 +22,9 @@ __export(sdkSchemas_exports, {
22
22
  sdkConfigurationSchema: () => sdkConfigurationSchema
23
23
  });
24
24
  module.exports = __toCommonJS(sdkSchemas_exports);
25
- var import_validation = require("../validation");
26
- var import_contextSchemas = require("./contextSchemas");
27
- var import_loggerSchema = require("./loggerSchema");
25
+ var import_validation = require('../validation/index.cjs');
26
+ var import_contextSchemas = require('./contextSchemas.cjs');
27
+ var import_loggerSchema = require('./loggerSchema.cjs');
28
28
  const eventMetadataSchema = new import_validation.ObjectType({
29
29
  maxProperties: 5,
30
30
  propertyNames: new import_validation.StringType({
@@ -0,0 +1,8 @@
1
+ import { ObjectType } from '../validation/objectType.cjs';
2
+ import '../validation/schema.cjs';
3
+
4
+ declare const eventMetadataSchema: ObjectType;
5
+ declare const cookieOptionsSchema: ObjectType;
6
+ declare const sdkConfigurationSchema: ObjectType;
7
+
8
+ export { cookieOptionsSchema, eventMetadataSchema, sdkConfigurationSchema };
@@ -1,6 +1,6 @@
1
- import { ObjectType, StringType, BooleanType, NumberType, FunctionType } from "../validation";
2
- import { tokenScopeSchema } from "./contextSchemas";
3
- import { loggerSchema } from "./loggerSchema";
1
+ import { ObjectType, StringType, BooleanType, NumberType, FunctionType } from "../validation/index.js";
2
+ import { tokenScopeSchema } from "./contextSchemas.js";
3
+ import { loggerSchema } from "./loggerSchema.js";
4
4
  const eventMetadataSchema = new ObjectType({
5
5
  maxProperties: 5,
6
6
  propertyNames: new StringType({
@@ -20,7 +20,7 @@ __export(tokenSchema_exports, {
20
20
  tokenSchema: () => tokenSchema
21
21
  });
22
22
  module.exports = __toCommonJS(tokenSchema_exports);
23
- var import_validation = require("../validation");
23
+ var import_validation = require('../validation/index.cjs');
24
24
  const tokenSchema = new import_validation.ObjectType({
25
25
  required: ["headers", "payload"],
26
26
  properties: {
@@ -0,0 +1,6 @@
1
+ import { ObjectType } from '../validation/objectType.cjs';
2
+ import '../validation/schema.cjs';
3
+
4
+ declare const tokenSchema: ObjectType;
5
+
6
+ export { tokenSchema };
@@ -1,4 +1,4 @@
1
- import { ObjectType, StringType, NumberType, UnionType, ArrayType } from "../validation";
1
+ import { ObjectType, StringType, NumberType, UnionType, ArrayType } from "../validation/index.js";
2
2
  const tokenSchema = new ObjectType({
3
3
  required: ["headers", "payload"],
4
4
  properties: {
@@ -20,8 +20,8 @@ __export(userSchema_exports, {
20
20
  userProfileSchema: () => userProfileSchema
21
21
  });
22
22
  module.exports = __toCommonJS(userSchema_exports);
23
- var import_validation = require("../validation");
24
- var import_attributeSchema = require("./attributeSchema");
23
+ var import_validation = require('../validation/index.cjs');
24
+ var import_attributeSchema = require('./attributeSchema.cjs');
25
25
  const userProfileSchema = new import_validation.ObjectType({
26
26
  properties: {
27
27
  firstName: new import_validation.StringType({
@@ -0,0 +1,6 @@
1
+ import { ObjectType } from '../validation/objectType.cjs';
2
+ import '../validation/schema.cjs';
3
+
4
+ declare const userProfileSchema: ObjectType;
5
+
6
+ export { userProfileSchema };
@@ -6,8 +6,8 @@ import {
6
6
  NullType,
7
7
  NumberType,
8
8
  ArrayType
9
- } from "../validation";
10
- import { attributeNameSchema } from "./attributeSchema";
9
+ } from "../validation/index.js";
10
+ import { attributeNameSchema } from "./attributeSchema.js";
11
11
  const userProfileSchema = new ObjectType({
12
12
  properties: {
13
13
  firstName: new StringType({
package/sdk.cjs CHANGED
@@ -20,10 +20,10 @@ __export(sdk_exports, {
20
20
  Sdk: () => Sdk
21
21
  });
22
22
  module.exports = __toCommonJS(sdk_exports);
23
- var import_container = require("./container");
24
- var import_constants = require("./constants");
25
- var import_schema = require("./schema");
26
- var import_error = require("./error");
23
+ var import_container = require('./container.cjs');
24
+ var import_constants = require('./constants.cjs');
25
+ var import_schema = require('./schema/index.cjs');
26
+ var import_error = require('./error.cjs');
27
27
  function validateConfiguration(configuration) {
28
28
  if (typeof configuration !== "object" || configuration === null) {
29
29
  throw new Error("The configuration must be a key-value map.");
package/sdk.d.cts ADDED
@@ -0,0 +1,69 @@
1
+ import { DependencyResolver } from './container.cjs';
2
+ import { TokenScope, Context } from './context.cjs';
3
+ import { Logger } from './logging/logger.cjs';
4
+ import { TrackingEventProcessor, Tracker } from './tracker.cjs';
5
+ import { Evaluator } from './evaluator.cjs';
6
+ import { SdkEventMap } from './sdkEvents.cjs';
7
+ import { EventManager } from './eventManager.cjs';
8
+ import { CidAssigner } from './cid/assigner.cjs';
9
+ import { UrlSanitizer } from './tab.cjs';
10
+ import { ContentFetcher } from './contentFetcher.cjs';
11
+ import { TokenStore } from './token/token.cjs';
12
+ import { CookieCacheConfiguration } from './cache/cookieCache.cjs';
13
+ import './queue/monitoredQueue.cjs';
14
+ import './queue/queue.cjs';
15
+ import './cache/cache.cjs';
16
+ import './channel/channel.cjs';
17
+ import './retry/policy.cjs';
18
+ import './trackingEvents.cjs';
19
+ import './patch.cjs';
20
+ import '@croct/json';
21
+ import './utilityTypes.cjs';
22
+ import './sourceLocation.cjs';
23
+ import './apiKey.cjs';
24
+
25
+ type Configuration = {
26
+ appId: string;
27
+ tokenScope: TokenScope;
28
+ debug: boolean;
29
+ test: boolean;
30
+ clientId?: string;
31
+ baseEndpointUrl?: string;
32
+ disableCidMirroring: boolean;
33
+ cidAssignerEndpointUrl?: string;
34
+ beaconQueueSize?: number;
35
+ urlSanitizer?: UrlSanitizer;
36
+ logger?: Logger;
37
+ eventMetadata?: {
38
+ [key: string]: string;
39
+ };
40
+ cookie?: {
41
+ clientId?: CookieCacheConfiguration;
42
+ userToken?: CookieCacheConfiguration;
43
+ previewToken?: CookieCacheConfiguration;
44
+ };
45
+ eventProcessor?: DependencyResolver<TrackingEventProcessor>;
46
+ defaultFetchTimeout?: number;
47
+ defaultPreferredLocale?: string;
48
+ };
49
+ declare class Sdk {
50
+ private container;
51
+ private closed;
52
+ private constructor();
53
+ static init(configuration: Configuration): Sdk;
54
+ get appId(): string;
55
+ get cidAssigner(): CidAssigner;
56
+ get previewTokenStore(): TokenStore;
57
+ get userTokenStore(): TokenStore;
58
+ get context(): Context;
59
+ get tracker(): Tracker;
60
+ get evaluator(): Evaluator;
61
+ get contentFetcher(): ContentFetcher;
62
+ get eventManager(): EventManager<SdkEventMap>;
63
+ getLogger(...namespace: string[]): Logger;
64
+ getTabStorage(namespace: string, ...subnamespace: string[]): Storage;
65
+ getBrowserStorage(namespace: string, ...subnamespace: string[]): Storage;
66
+ close(): Promise<void>;
67
+ }
68
+
69
+ export { type Configuration, Sdk };
package/sdk.js CHANGED
@@ -1,7 +1,7 @@
1
- import { Container } from "./container";
2
- import { BASE_ENDPOINT_URL, VERSION } from "./constants";
3
- import { sdkConfigurationSchema } from "./schema";
4
- import { formatCause } from "./error";
1
+ import { Container } from "./container.js";
2
+ import { BASE_ENDPOINT_URL, VERSION } from "./constants.js";
3
+ import { sdkConfigurationSchema } from "./schema/index.js";
4
+ import { formatCause } from "./error.js";
5
5
  function validateConfiguration(configuration) {
6
6
  if (typeof configuration !== "object" || configuration === null) {
7
7
  throw new Error("The configuration must be a key-value map.");
@@ -0,0 +1,15 @@
1
+ import { Token } from './token/token.cjs';
2
+ import '@croct/json';
3
+ import './apiKey.cjs';
4
+
5
+ interface TokenChanged {
6
+ oldToken: Token | null;
7
+ newToken: Token | null;
8
+ }
9
+ type SdkEventMap = Record<string, Record<string, unknown>> & {
10
+ tokenChanged: TokenChanged;
11
+ };
12
+ type SdkEventType = keyof SdkEventMap;
13
+ type SdkEvent<T extends SdkEventType = SdkEventType> = T extends SdkEventType ? SdkEventMap[T] : SdkEventMap[SdkEventType];
14
+
15
+ export type { SdkEvent, SdkEventMap, SdkEventType, TokenChanged };
@@ -0,0 +1,14 @@
1
+ type Position = {
2
+ line: number;
3
+ column: number;
4
+ index: number;
5
+ };
6
+ type Location = {
7
+ start: Position;
8
+ end: Position;
9
+ };
10
+ declare function getLength(input: string): number;
11
+ declare function getLocation(input: string, startIndex: number, endIndex: number): Location;
12
+ declare function getPosition(input: string, index: number): Position;
13
+
14
+ export { type Location, type Position, getLength, getLocation, getPosition };
package/tab.cjs CHANGED
@@ -20,7 +20,7 @@ __export(tab_exports, {
20
20
  Tab: () => Tab
21
21
  });
22
22
  module.exports = __toCommonJS(tab_exports);
23
- var import_eventManager = require("./eventManager");
23
+ var import_eventManager = require('./eventManager.cjs');
24
24
  const EventMap = {
25
25
  focus: "focus",
26
26
  blur: "blur",
package/tab.d.cts ADDED
@@ -0,0 +1,40 @@
1
+ import { EventListener } from './eventManager.cjs';
2
+
3
+ type TabEvent<T = Record<string, unknown>> = CustomEvent<{
4
+ tab: Tab;
5
+ } & T>;
6
+ type TabVisibilityChangeEvent = TabEvent<{
7
+ visible: boolean;
8
+ }>;
9
+ type TabUrlChangeEvent = TabEvent<{
10
+ url: string;
11
+ }>;
12
+ type UrlSanitizer = (url: string) => URL;
13
+ type TabEventMap = {
14
+ focus: TabEvent;
15
+ blur: TabEvent;
16
+ load: TabEvent;
17
+ unload: TabEvent;
18
+ visibilityChange: TabVisibilityChangeEvent;
19
+ urlChange: TabUrlChangeEvent;
20
+ };
21
+ declare class Tab {
22
+ readonly id: string;
23
+ readonly isNew: boolean;
24
+ readonly urlSanitizer?: UrlSanitizer;
25
+ private readonly eventManager;
26
+ constructor(id: string, isNew: boolean, urlSanitizer?: UrlSanitizer);
27
+ private initialize;
28
+ get url(): string;
29
+ get title(): string;
30
+ get referrer(): string;
31
+ get isVisible(): boolean;
32
+ get document(): Document;
33
+ addListener<T extends keyof TabEventMap>(type: T, listener: EventListener<TabEventMap[T]>): void;
34
+ removeListener<T extends keyof TabEventMap>(type: T, listener: EventListener<TabEventMap[T]>): void;
35
+ private sanitizeUrl;
36
+ private emit;
37
+ private static addUrlChangeListener;
38
+ }
39
+
40
+ export { Tab, type TabEvent, type TabUrlChangeEvent, type TabVisibilityChangeEvent, type UrlSanitizer };
package/tab.js CHANGED
@@ -1,4 +1,4 @@
1
- import { SynchronousEventManager } from "./eventManager";
1
+ import { SynchronousEventManager } from "./eventManager.js";
2
2
  const EventMap = {
3
3
  focus: "focus",
4
4
  blur: "blur",
@@ -20,7 +20,7 @@ __export(cachedTokenStore_exports, {
20
20
  CachedTokenStore: () => CachedTokenStore
21
21
  });
22
22
  module.exports = __toCommonJS(cachedTokenStore_exports);
23
- var import_token = require("./token");
23
+ var import_token = require('./token.cjs');
24
24
  class CachedTokenStore {
25
25
  constructor(cache) {
26
26
  this.cache = cache;
@@ -0,0 +1,13 @@
1
+ import { TokenStore, Token } from './token.cjs';
2
+ import { Cache } from '../cache/cache.cjs';
3
+ import '@croct/json';
4
+ import '../apiKey.cjs';
5
+
6
+ declare class CachedTokenStore implements TokenStore {
7
+ private readonly cache;
8
+ constructor(cache: Cache);
9
+ getToken(): Token | null;
10
+ setToken(token: Token | null): void;
11
+ }
12
+
13
+ export { CachedTokenStore };
@@ -1,4 +1,4 @@
1
- import { Token } from "./token";
1
+ import { Token } from "./token.js";
2
2
  class CachedTokenStore {
3
3
  constructor(cache) {
4
4
  this.cache = cache;
@@ -0,0 +1,11 @@
1
+ import { TokenStore, Token } from './token.cjs';
2
+ import '@croct/json';
3
+ import '../apiKey.cjs';
4
+
5
+ declare class InMemoryTokenStore implements TokenStore {
6
+ private token;
7
+ getToken(): Token | null;
8
+ setToken(token: Token | null): void;
9
+ }
10
+
11
+ export { InMemoryTokenStore };
package/token/index.cjs CHANGED
@@ -23,14 +23,14 @@ __export(token_exports, {
23
23
  ReplicatedTokenStore: () => import_replicatedTokenStore.ReplicatedTokenStore
24
24
  });
25
25
  module.exports = __toCommonJS(token_exports);
26
- __reExport(token_exports, require("./token"), module.exports);
27
- var import_cachedTokenStore = require("./cachedTokenStore");
28
- var import_inMemoryTokenStore = require("./inMemoryTokenStore");
29
- var import_replicatedTokenStore = require("./replicatedTokenStore");
26
+ __reExport(token_exports, require('./token.cjs'), module.exports);
27
+ var import_cachedTokenStore = require('./cachedTokenStore.cjs');
28
+ var import_inMemoryTokenStore = require('./inMemoryTokenStore.cjs');
29
+ var import_replicatedTokenStore = require('./replicatedTokenStore.cjs');
30
30
  // Annotate the CommonJS export names for ESM import in node:
31
31
  0 && (module.exports = {
32
32
  CachedTokenStore,
33
33
  InMemoryTokenStore,
34
34
  ReplicatedTokenStore,
35
- ...require("./token")
35
+ ...require('./token.cjs')
36
36
  });
@@ -0,0 +1,7 @@
1
+ export { FixedTokenProvider, Token, TokenClaims, TokenHeaders, TokenPayload, TokenProvider, TokenStore } from './token.cjs';
2
+ export { CachedTokenStore } from './cachedTokenStore.cjs';
3
+ export { InMemoryTokenStore } from './inMemoryTokenStore.cjs';
4
+ export { ReplicatedTokenStore } from './replicatedTokenStore.cjs';
5
+ import '@croct/json';
6
+ import '../apiKey.cjs';
7
+ import '../cache/cache.cjs';
package/token/index.js CHANGED
@@ -1,7 +1,7 @@
1
- export * from "./token";
2
- import { CachedTokenStore } from "./cachedTokenStore";
3
- import { InMemoryTokenStore } from "./inMemoryTokenStore";
4
- import { ReplicatedTokenStore } from "./replicatedTokenStore";
1
+ export * from "./token.js";
2
+ import { CachedTokenStore } from "./cachedTokenStore.js";
3
+ import { InMemoryTokenStore } from "./inMemoryTokenStore.js";
4
+ import { ReplicatedTokenStore } from "./replicatedTokenStore.js";
5
5
  export {
6
6
  CachedTokenStore,
7
7
  InMemoryTokenStore,
@@ -0,0 +1,13 @@
1
+ import { TokenStore, Token } from './token.cjs';
2
+ import '@croct/json';
3
+ import '../apiKey.cjs';
4
+
5
+ declare class ReplicatedTokenStore implements TokenStore {
6
+ private primary;
7
+ private secondary;
8
+ constructor(primary: TokenStore, secondary: TokenStore);
9
+ getToken(): Token | null;
10
+ setToken(token: Token | null): void;
11
+ }
12
+
13
+ export { ReplicatedTokenStore };