@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.
- package/activeRecord.cjs +1 -1
- package/activeRecord.d.cts +26 -0
- package/activeRecord.js +1 -1
- package/apiKey.d.cts +48 -0
- package/base64Url.d.cts +4 -0
- package/cache/cache.d.cts +17 -0
- package/cache/cookieCache.d.cts +22 -0
- package/cache/fallbackCache.d.cts +11 -0
- package/cache/inMemoryCache.d.cts +11 -0
- package/cache/index.cjs +5 -5
- package/cache/index.d.cts +4 -0
- package/cache/index.js +4 -4
- package/cache/localStorageCache.d.cts +19 -0
- package/channel/channel.cjs +1 -1
- package/channel/channel.d.cts +24 -0
- package/channel/channel.js +1 -1
- package/channel/encodedChannel.d.cts +12 -0
- package/channel/guaranteedChannel.cjs +2 -2
- package/channel/guaranteedChannel.d.cts +33 -0
- package/channel/guaranteedChannel.js +2 -2
- package/channel/httpBeaconChannel.cjs +5 -5
- package/channel/httpBeaconChannel.d.cts +26 -0
- package/channel/httpBeaconChannel.js +5 -5
- package/channel/index.cjs +8 -8
- package/channel/index.d.cts +12 -0
- package/channel/index.js +7 -7
- package/channel/queuedChannel.cjs +2 -2
- package/channel/queuedChannel.d.cts +21 -0
- package/channel/queuedChannel.js +2 -2
- package/channel/retryChannel.cjs +2 -2
- package/channel/retryChannel.d.cts +21 -0
- package/channel/retryChannel.js +2 -2
- package/channel/sandboxChannel.cjs +1 -1
- package/channel/sandboxChannel.d.cts +15 -0
- package/channel/sandboxChannel.js +1 -1
- package/cid/assigner.d.cts +5 -0
- package/cid/cachedAssigner.cjs +1 -1
- package/cid/cachedAssigner.d.cts +17 -0
- package/cid/cachedAssigner.js +1 -1
- package/cid/fixedAssigner.d.cts +9 -0
- package/cid/index.cjs +5 -5
- package/cid/index.d.cts +6 -0
- package/cid/index.js +4 -4
- package/cid/remoteAssigner.cjs +3 -3
- package/cid/remoteAssigner.d.cts +13 -0
- package/cid/remoteAssigner.js +3 -3
- package/constants.cjs +1 -1
- package/constants.d.cts +6 -0
- package/constants.d.ts +2 -2
- package/constants.js +1 -1
- package/container.cjs +18 -18
- package/container.d.cts +95 -0
- package/container.js +18 -18
- package/contentFetcher.cjs +4 -4
- package/contentFetcher.d.cts +69 -0
- package/contentFetcher.js +4 -4
- package/context.cjs +4 -4
- package/context.d.cts +36 -0
- package/context.js +4 -4
- package/error.d.cts +4 -0
- package/evaluator.cjs +5 -5
- package/evaluator.d.cts +86 -0
- package/evaluator.js +5 -5
- package/eventManager.d.cts +21 -0
- package/eventSubjectProcessor.d.cts +22 -0
- package/facade/contentFetcherFacade.cjs +2 -2
- package/facade/contentFetcherFacade.d.cts +36 -0
- package/facade/contentFetcherFacade.js +2 -2
- package/facade/evaluatorFacade.cjs +2 -2
- package/facade/evaluatorFacade.d.cts +41 -0
- package/facade/evaluatorFacade.js +2 -2
- package/facade/index.cjs +7 -9
- package/facade/index.d.cts +29 -0
- package/facade/index.js +7 -8
- package/facade/sdkFacade.cjs +10 -10
- package/facade/sdkFacade.d.cts +86 -0
- package/facade/sdkFacade.js +10 -10
- package/facade/sessionFacade.cjs +1 -1
- package/facade/sessionFacade.d.cts +22 -0
- package/facade/sessionFacade.js +1 -1
- package/facade/sessionPatch.cjs +1 -1
- package/facade/sessionPatch.d.cts +21 -0
- package/facade/sessionPatch.js +1 -1
- package/facade/trackerFacade.cjs +2 -2
- package/facade/trackerFacade.d.cts +25 -0
- package/facade/trackerFacade.js +2 -2
- package/facade/userFacade.cjs +1 -1
- package/facade/userFacade.d.cts +28 -0
- package/facade/userFacade.js +1 -1
- package/facade/userPatch.cjs +1 -1
- package/facade/userPatch.d.cts +21 -0
- package/facade/userPatch.js +1 -1
- package/help.d.cts +5 -0
- package/index.cjs +2 -4
- package/index.d.cts +25 -0
- package/index.js +2 -3
- package/logging/consoleLogger.d.cts +13 -0
- package/logging/filteredLogger.d.cts +22 -0
- package/logging/index.cjs +6 -6
- package/logging/index.d.cts +5 -0
- package/logging/index.js +5 -5
- package/logging/logger.d.cts +11 -0
- package/logging/namespacedLogger.d.cts +14 -0
- package/logging/nullLogger.d.cts +10 -0
- package/namespacedStorage.d.cts +16 -0
- package/package.json +4 -1
- package/patch.d.cts +46 -0
- package/queue/capacityRestrictedQueue.d.cts +16 -0
- package/queue/inMemoryQueue.d.cts +15 -0
- package/queue/index.cjs +6 -6
- package/queue/index.d.cts +6 -0
- package/queue/index.js +5 -5
- package/queue/monitoredQueue.cjs +1 -1
- package/queue/monitoredQueue.d.cts +28 -0
- package/queue/monitoredQueue.js +1 -1
- package/queue/persistentQueue.d.cts +18 -0
- package/queue/queue.d.cts +11 -0
- package/retry/arbitraryPolicy.d.cts +10 -0
- package/retry/backoffPolicy.d.cts +26 -0
- package/retry/index.cjs +6 -6
- package/retry/index.d.cts +5 -0
- package/retry/index.js +5 -5
- package/retry/maxAttemptsPolicy.d.cts +11 -0
- package/retry/neverPolicy.d.cts +8 -0
- package/retry/policy.d.cts +6 -0
- package/schema/attributeSchema.cjs +1 -1
- package/schema/attributeSchema.d.cts +6 -0
- package/schema/attributeSchema.js +1 -1
- package/schema/contentFetcherSchemas.cjs +1 -1
- package/schema/contentFetcherSchemas.d.cts +6 -0
- package/schema/contentFetcherSchemas.js +1 -1
- package/schema/contentSchemas.cjs +1 -1
- package/schema/contentSchemas.d.cts +6 -0
- package/schema/contentSchemas.js +1 -1
- package/schema/contextSchemas.cjs +1 -1
- package/schema/contextSchemas.d.cts +6 -0
- package/schema/contextSchemas.js +1 -1
- package/schema/ecommerceSchemas.cjs +1 -1
- package/schema/ecommerceSchemas.d.cts +10 -0
- package/schema/ecommerceSchemas.js +1 -1
- package/schema/evaluatorSchemas.cjs +1 -1
- package/schema/evaluatorSchemas.d.cts +6 -0
- package/schema/evaluatorSchemas.js +1 -1
- package/schema/eventSchemas.cjs +4 -4
- package/schema/eventSchemas.d.cts +16 -0
- package/schema/eventSchemas.js +4 -4
- package/schema/index.cjs +22 -22
- package/schema/index.d.cts +14 -0
- package/schema/index.js +11 -11
- package/schema/loggerSchema.cjs +1 -1
- package/schema/loggerSchema.d.cts +6 -0
- package/schema/loggerSchema.js +1 -1
- package/schema/operationSchemas.cjs +2 -2
- package/schema/operationSchemas.d.cts +14 -0
- package/schema/operationSchemas.js +2 -2
- package/schema/sdkFacadeSchemas.cjs +4 -4
- package/schema/sdkFacadeSchemas.d.cts +6 -0
- package/schema/sdkFacadeSchemas.js +4 -4
- package/schema/sdkSchemas.cjs +3 -3
- package/schema/sdkSchemas.d.cts +8 -0
- package/schema/sdkSchemas.js +3 -3
- package/schema/tokenSchema.cjs +1 -1
- package/schema/tokenSchema.d.cts +6 -0
- package/schema/tokenSchema.js +1 -1
- package/schema/userSchema.cjs +2 -2
- package/schema/userSchema.d.cts +6 -0
- package/schema/userSchema.js +2 -2
- package/sdk.cjs +4 -4
- package/sdk.d.cts +69 -0
- package/sdk.js +4 -4
- package/sdkEvents.d.cts +15 -0
- package/sourceLocation.d.cts +14 -0
- package/tab.cjs +1 -1
- package/tab.d.cts +40 -0
- package/tab.js +1 -1
- package/token/cachedTokenStore.cjs +1 -1
- package/token/cachedTokenStore.d.cts +13 -0
- package/token/cachedTokenStore.js +1 -1
- package/token/inMemoryTokenStore.d.cts +11 -0
- package/token/index.cjs +5 -5
- package/token/index.d.cts +7 -0
- package/token/index.js +4 -4
- package/token/replicatedTokenStore.d.cts +13 -0
- package/token/token.cjs +3 -3
- package/token/token.d.cts +70 -0
- package/token/token.js +3 -3
- package/tracker.cjs +3 -3
- package/tracker.d.cts +82 -0
- package/tracker.js +3 -3
- package/trackingEvents.d.cts +309 -0
- package/transformer.d.cts +6 -0
- package/utilityTypes.d.cts +4 -0
- package/uuid.d.cts +3 -0
- package/validation/arrayType.cjs +2 -2
- package/validation/arrayType.d.cts +16 -0
- package/validation/arrayType.js +2 -2
- package/validation/booleanType.cjs +2 -2
- package/validation/booleanType.d.cts +9 -0
- package/validation/booleanType.js +2 -2
- package/validation/functionType.cjs +2 -2
- package/validation/functionType.d.cts +9 -0
- package/validation/functionType.js +2 -2
- package/validation/index.cjs +14 -14
- package/validation/index.d.cts +12 -0
- package/validation/index.js +12 -12
- package/validation/jsonType.cjs +2 -2
- package/validation/jsonType.d.cts +35 -0
- package/validation/jsonType.js +2 -2
- package/validation/mixedSchema.d.cts +7 -0
- package/validation/nullType.cjs +2 -2
- package/validation/nullType.d.cts +9 -0
- package/validation/nullType.js +2 -2
- package/validation/numberType.cjs +2 -2
- package/validation/numberType.d.cts +16 -0
- package/validation/numberType.js +2 -2
- package/validation/objectType.cjs +3 -3
- package/validation/objectType.d.cts +30 -0
- package/validation/objectType.js +3 -3
- package/validation/schema.d.cts +18 -0
- package/validation/stringType.cjs +2 -2
- package/validation/stringType.d.cts +24 -0
- package/validation/stringType.js +2 -2
- package/validation/unionType.cjs +2 -2
- package/validation/unionType.d.cts +11 -0
- package/validation/unionType.js +2 -2
- package/validation/violation.d.cts +4 -0
package/schema/eventSchemas.cjs
CHANGED
|
@@ -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(
|
|
34
|
-
var import_ecommerceSchemas = require(
|
|
35
|
-
var import_userSchema = require(
|
|
36
|
-
var import_contentSchemas = require(
|
|
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 };
|
package/schema/eventSchemas.js
CHANGED
|
@@ -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(
|
|
18
|
-
__reExport(schema_exports, require(
|
|
19
|
-
__reExport(schema_exports, require(
|
|
20
|
-
__reExport(schema_exports, require(
|
|
21
|
-
__reExport(schema_exports, require(
|
|
22
|
-
__reExport(schema_exports, require(
|
|
23
|
-
__reExport(schema_exports, require(
|
|
24
|
-
__reExport(schema_exports, require(
|
|
25
|
-
__reExport(schema_exports, require(
|
|
26
|
-
__reExport(schema_exports, require(
|
|
27
|
-
__reExport(schema_exports, require(
|
|
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(
|
|
31
|
-
...require(
|
|
32
|
-
...require(
|
|
33
|
-
...require(
|
|
34
|
-
...require(
|
|
35
|
-
...require(
|
|
36
|
-
...require(
|
|
37
|
-
...require(
|
|
38
|
-
...require(
|
|
39
|
-
...require(
|
|
40
|
-
...require(
|
|
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";
|
package/schema/loggerSchema.cjs
CHANGED
|
@@ -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(
|
|
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,
|
package/schema/loggerSchema.js
CHANGED
|
@@ -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(
|
|
32
|
-
var import_attributeSchema = require(
|
|
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(
|
|
24
|
-
var import_contextSchemas = require(
|
|
25
|
-
var import_sdkSchemas = require(
|
|
26
|
-
var import_loggerSchema = require(
|
|
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: {
|
|
@@ -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: {
|
package/schema/sdkSchemas.cjs
CHANGED
|
@@ -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(
|
|
26
|
-
var import_contextSchemas = require(
|
|
27
|
-
var import_loggerSchema = require(
|
|
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 };
|
package/schema/sdkSchemas.js
CHANGED
|
@@ -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({
|
package/schema/tokenSchema.cjs
CHANGED
|
@@ -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(
|
|
23
|
+
var import_validation = require('../validation/index.cjs');
|
|
24
24
|
const tokenSchema = new import_validation.ObjectType({
|
|
25
25
|
required: ["headers", "payload"],
|
|
26
26
|
properties: {
|
package/schema/tokenSchema.js
CHANGED
|
@@ -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: {
|
package/schema/userSchema.cjs
CHANGED
|
@@ -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(
|
|
24
|
-
var import_attributeSchema = require(
|
|
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({
|
package/schema/userSchema.js
CHANGED
|
@@ -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(
|
|
24
|
-
var import_constants = require(
|
|
25
|
-
var import_schema = require(
|
|
26
|
-
var import_error = require(
|
|
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.");
|
package/sdkEvents.d.cts
ADDED
|
@@ -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(
|
|
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
|
@@ -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(
|
|
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 };
|
|
@@ -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(
|
|
27
|
-
var import_cachedTokenStore = require(
|
|
28
|
-
var import_inMemoryTokenStore = require(
|
|
29
|
-
var import_replicatedTokenStore = require(
|
|
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(
|
|
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 };
|