@croct/sdk 0.17.8 → 0.17.10
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 +135 -0
- package/apiKey.cjs +178 -0
- package/base64Url.cjs +41 -0
- package/cache/cache.cjs +34 -0
- package/cache/cookieCache.cjs +85 -0
- package/cache/fallbackCache.cjs +47 -0
- package/cache/inMemoryCache.cjs +41 -0
- package/cache/index.cjs +37 -0
- package/cache/localStorageCache.cjs +81 -0
- package/channel/channel.cjs +48 -0
- package/channel/encodedChannel.cjs +39 -0
- package/channel/guaranteedChannel.cjs +105 -0
- package/channel/httpBeaconChannel.cjs +111 -0
- package/channel/index.cjs +46 -0
- package/channel/queuedChannel.cjs +122 -0
- package/channel/retryChannel.cjs +87 -0
- package/channel/sandboxChannel.cjs +63 -0
- package/cid/assigner.cjs +16 -0
- package/cid/cachedAssigner.cjs +66 -0
- package/cid/fixedAssigner.cjs +35 -0
- package/cid/index.cjs +37 -0
- package/cid/remoteAssigner.cjs +65 -0
- package/constants.cjs +37 -0
- package/constants.cjs.map +1 -1
- package/constants.d.ts +2 -2
- package/constants.js +1 -1
- package/constants.js.map +1 -1
- package/container.cjs +305 -0
- package/contentFetcher.cjs +193 -0
- package/context.cjs +114 -0
- package/error.cjs +52 -0
- package/evaluator.cjs +219 -0
- package/eventManager.cjs +53 -0
- package/eventSubjectProcessor.cjs +84 -0
- package/facade/contentFetcherFacade.cjs +61 -0
- package/facade/evaluatorFacade.cjs +94 -0
- package/facade/index.cjs +52 -0
- package/facade/sdkFacade.cjs +229 -0
- package/facade/sessionFacade.cjs +36 -0
- package/facade/sessionPatch.cjs +48 -0
- package/facade/trackerFacade.cjs +87 -0
- package/facade/userFacade.cjs +43 -0
- package/facade/userPatch.cjs +48 -0
- package/help.cjs +45 -0
- package/index.cjs +33 -0
- package/logging/consoleLogger.cjs +50 -0
- package/logging/filteredLogger.cjs +62 -0
- package/logging/index.cjs +40 -0
- package/logging/logger.cjs +16 -0
- package/logging/namespacedLogger.cjs +48 -0
- package/logging/nullLogger.cjs +37 -0
- package/namespacedStorage.cjs +77 -0
- package/package.json +29 -28
- package/patch.cjs +16 -0
- package/queue/capacityRestrictedQueue.cjs +57 -0
- package/queue/inMemoryQueue.cjs +58 -0
- package/queue/index.cjs +40 -0
- package/queue/monitoredQueue.cjs +141 -0
- package/queue/persistentQueue.cjs +78 -0
- package/queue/queue.cjs +16 -0
- package/retry/arbitraryPolicy.cjs +41 -0
- package/retry/backoffPolicy.cjs +81 -0
- package/retry/index.cjs +40 -0
- package/retry/maxAttemptsPolicy.cjs +45 -0
- package/retry/neverPolicy.cjs +35 -0
- package/retry/policy.cjs +16 -0
- package/schema/attributeSchema.cjs +32 -0
- package/schema/contentFetcherSchemas.cjs +49 -0
- package/schema/contentSchemas.cjs +70 -0
- package/schema/contextSchemas.cjs +31 -0
- package/schema/ecommerceSchemas.cjs +209 -0
- package/schema/evaluatorSchemas.cjs +64 -0
- package/schema/eventSchemas.cjs +162 -0
- package/schema/index.cjs +42 -0
- package/schema/loggerSchema.cjs +38 -0
- package/schema/operationSchemas.cjs +122 -0
- package/schema/sdkFacadeSchemas.cjs +82 -0
- package/schema/sdkSchemas.cjs +110 -0
- package/schema/tokenSchema.cjs +68 -0
- package/schema/userSchema.cjs +202 -0
- package/sdk.cjs +134 -0
- package/sdkEvents.cjs +16 -0
- package/sourceLocation.cjs +92 -0
- package/tab.cjs +122 -0
- package/token/cachedTokenStore.cjs +51 -0
- package/token/inMemoryTokenStore.cjs +38 -0
- package/token/index.cjs +37 -0
- package/token/replicatedTokenStore.cjs +40 -0
- package/token/token.cjs +239 -0
- package/tracker.cjs +358 -0
- package/trackingEvents.cjs +94 -0
- package/transformer.cjs +30 -0
- package/utilityTypes.cjs +16 -0
- package/uuid.cjs +55 -0
- package/validation/arrayType.cjs +75 -0
- package/validation/booleanType.cjs +46 -0
- package/validation/functionType.cjs +46 -0
- package/validation/index.cjs +66 -0
- package/validation/jsonType.cjs +142 -0
- package/validation/mixedSchema.cjs +31 -0
- package/validation/nullType.cjs +46 -0
- package/validation/numberType.cjs +69 -0
- package/validation/objectType.cjs +114 -0
- package/validation/schema.cjs +34 -0
- package/validation/stringType.cjs +106 -0
- package/validation/unionType.cjs +67 -0
- package/validation/violation.cjs +47 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var contentFetcherSchemas_exports = {};
|
|
19
|
+
__export(contentFetcherSchemas_exports, {
|
|
20
|
+
fetchOptionsSchema: () => fetchOptionsSchema
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(contentFetcherSchemas_exports);
|
|
23
|
+
var import_validation = require("../validation");
|
|
24
|
+
const fetchOptionsSchema = new import_validation.ObjectType({
|
|
25
|
+
properties: {
|
|
26
|
+
timeout: new import_validation.NumberType({
|
|
27
|
+
integer: true,
|
|
28
|
+
minimum: 0
|
|
29
|
+
}),
|
|
30
|
+
version: new import_validation.UnionType(
|
|
31
|
+
new import_validation.StringType({
|
|
32
|
+
pattern: /^\d+$/
|
|
33
|
+
}),
|
|
34
|
+
new import_validation.NumberType({
|
|
35
|
+
integer: true,
|
|
36
|
+
minimum: 1
|
|
37
|
+
})
|
|
38
|
+
),
|
|
39
|
+
preferredLocale: new import_validation.StringType({
|
|
40
|
+
pattern: /^[a-z]{2,3}([-_][a-z]{2,3})?$/i
|
|
41
|
+
}),
|
|
42
|
+
attributes: new import_validation.JsonObjectType()
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
+
0 && (module.exports = {
|
|
47
|
+
fetchOptionsSchema
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=contentFetcherSchemas.cjs.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var contentSchemas_exports = {};
|
|
19
|
+
__export(contentSchemas_exports, {
|
|
20
|
+
postDetails: () => postDetails
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(contentSchemas_exports);
|
|
23
|
+
var import_validation = require("../validation");
|
|
24
|
+
const postDetails = new import_validation.ObjectType({
|
|
25
|
+
required: ["postId", "title", "publishTime"],
|
|
26
|
+
properties: {
|
|
27
|
+
postId: new import_validation.StringType({
|
|
28
|
+
minLength: 1,
|
|
29
|
+
maxLength: 200
|
|
30
|
+
}),
|
|
31
|
+
url: new import_validation.StringType({
|
|
32
|
+
format: "url"
|
|
33
|
+
}),
|
|
34
|
+
title: new import_validation.StringType({
|
|
35
|
+
minLength: 1,
|
|
36
|
+
maxLength: 200
|
|
37
|
+
}),
|
|
38
|
+
tags: new import_validation.ArrayType({
|
|
39
|
+
items: new import_validation.StringType({
|
|
40
|
+
minLength: 1,
|
|
41
|
+
maxLength: 50
|
|
42
|
+
}),
|
|
43
|
+
minItems: 1,
|
|
44
|
+
maxItems: 10
|
|
45
|
+
}),
|
|
46
|
+
categories: new import_validation.ArrayType({
|
|
47
|
+
items: new import_validation.StringType({
|
|
48
|
+
minLength: 1,
|
|
49
|
+
maxLength: 50
|
|
50
|
+
}),
|
|
51
|
+
minItems: 1,
|
|
52
|
+
maxItems: 10
|
|
53
|
+
}),
|
|
54
|
+
authors: new import_validation.ArrayType({
|
|
55
|
+
items: new import_validation.StringType({
|
|
56
|
+
minLength: 1,
|
|
57
|
+
maxLength: 50
|
|
58
|
+
}),
|
|
59
|
+
minItems: 1,
|
|
60
|
+
maxItems: 10
|
|
61
|
+
}),
|
|
62
|
+
publishTime: new import_validation.NumberType(),
|
|
63
|
+
updateTime: new import_validation.NumberType()
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
+
0 && (module.exports = {
|
|
68
|
+
postDetails
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=contentSchemas.cjs.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var contextSchemas_exports = {};
|
|
19
|
+
__export(contextSchemas_exports, {
|
|
20
|
+
tokenScopeSchema: () => tokenScopeSchema
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(contextSchemas_exports);
|
|
23
|
+
var import_validation = require("../validation");
|
|
24
|
+
const tokenScopeSchema = new import_validation.StringType({
|
|
25
|
+
enumeration: ["global", "contextual", "isolated"]
|
|
26
|
+
});
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
tokenScopeSchema
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=contextSchemas.cjs.map
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var ecommerceSchemas_exports = {};
|
|
19
|
+
__export(ecommerceSchemas_exports, {
|
|
20
|
+
cart: () => cart,
|
|
21
|
+
cartItem: () => cartItem,
|
|
22
|
+
order: () => order,
|
|
23
|
+
orderItem: () => orderItem,
|
|
24
|
+
productDetails: () => productDetails
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(ecommerceSchemas_exports);
|
|
27
|
+
var import_validation = require("../validation");
|
|
28
|
+
const productDetails = new import_validation.ObjectType({
|
|
29
|
+
required: ["productId", "name", "displayPrice"],
|
|
30
|
+
properties: {
|
|
31
|
+
productId: new import_validation.StringType({
|
|
32
|
+
minLength: 1,
|
|
33
|
+
maxLength: 50
|
|
34
|
+
}),
|
|
35
|
+
sku: new import_validation.StringType({
|
|
36
|
+
minLength: 1,
|
|
37
|
+
maxLength: 50
|
|
38
|
+
}),
|
|
39
|
+
name: new import_validation.StringType({
|
|
40
|
+
minLength: 1,
|
|
41
|
+
maxLength: 200
|
|
42
|
+
}),
|
|
43
|
+
category: new import_validation.StringType({
|
|
44
|
+
minLength: 1,
|
|
45
|
+
maxLength: 100
|
|
46
|
+
}),
|
|
47
|
+
brand: new import_validation.StringType({
|
|
48
|
+
minLength: 1,
|
|
49
|
+
maxLength: 100
|
|
50
|
+
}),
|
|
51
|
+
variant: new import_validation.StringType({
|
|
52
|
+
minLength: 1,
|
|
53
|
+
maxLength: 50
|
|
54
|
+
}),
|
|
55
|
+
displayPrice: new import_validation.NumberType({
|
|
56
|
+
minimum: 0
|
|
57
|
+
}),
|
|
58
|
+
originalPrice: new import_validation.NumberType({
|
|
59
|
+
minimum: 0
|
|
60
|
+
}),
|
|
61
|
+
url: new import_validation.StringType({
|
|
62
|
+
format: "url"
|
|
63
|
+
}),
|
|
64
|
+
imageUrl: new import_validation.StringType({
|
|
65
|
+
format: "url"
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
const cartItem = new import_validation.ObjectType({
|
|
70
|
+
required: ["index", "product", "quantity", "total"],
|
|
71
|
+
properties: {
|
|
72
|
+
index: new import_validation.NumberType({
|
|
73
|
+
minimum: 0
|
|
74
|
+
}),
|
|
75
|
+
product: productDetails,
|
|
76
|
+
quantity: new import_validation.NumberType({
|
|
77
|
+
minimum: 1
|
|
78
|
+
}),
|
|
79
|
+
total: new import_validation.NumberType({
|
|
80
|
+
minimum: 0
|
|
81
|
+
}),
|
|
82
|
+
discount: new import_validation.NumberType({
|
|
83
|
+
minimum: 0
|
|
84
|
+
}),
|
|
85
|
+
coupon: new import_validation.StringType({
|
|
86
|
+
minLength: 1,
|
|
87
|
+
maxLength: 50
|
|
88
|
+
})
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
const cart = new import_validation.ObjectType({
|
|
92
|
+
required: ["currency", "items", "total"],
|
|
93
|
+
properties: {
|
|
94
|
+
currency: new import_validation.StringType({
|
|
95
|
+
maxLength: 10,
|
|
96
|
+
minLength: 1
|
|
97
|
+
}),
|
|
98
|
+
items: new import_validation.ArrayType({
|
|
99
|
+
items: cartItem
|
|
100
|
+
}),
|
|
101
|
+
subtotal: new import_validation.NumberType({
|
|
102
|
+
minimum: 0
|
|
103
|
+
}),
|
|
104
|
+
shippingPrice: new import_validation.NumberType({
|
|
105
|
+
minimum: 0
|
|
106
|
+
}),
|
|
107
|
+
taxes: new import_validation.ObjectType({
|
|
108
|
+
additionalProperties: new import_validation.NumberType(),
|
|
109
|
+
minProperties: 1
|
|
110
|
+
}),
|
|
111
|
+
costs: new import_validation.ObjectType({
|
|
112
|
+
additionalProperties: new import_validation.NumberType(),
|
|
113
|
+
minProperties: 1
|
|
114
|
+
}),
|
|
115
|
+
discount: new import_validation.NumberType({
|
|
116
|
+
minimum: 0
|
|
117
|
+
}),
|
|
118
|
+
total: new import_validation.NumberType({
|
|
119
|
+
minimum: 0
|
|
120
|
+
}),
|
|
121
|
+
coupon: new import_validation.StringType({
|
|
122
|
+
minLength: 1,
|
|
123
|
+
maxLength: 50
|
|
124
|
+
}),
|
|
125
|
+
lastUpdateTime: new import_validation.NumberType()
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
const orderItem = new import_validation.ObjectType({
|
|
129
|
+
required: ["index", "product", "quantity", "total"],
|
|
130
|
+
properties: {
|
|
131
|
+
index: new import_validation.NumberType({
|
|
132
|
+
minimum: 0
|
|
133
|
+
}),
|
|
134
|
+
product: productDetails,
|
|
135
|
+
quantity: new import_validation.NumberType({
|
|
136
|
+
minimum: 1
|
|
137
|
+
}),
|
|
138
|
+
total: new import_validation.NumberType({
|
|
139
|
+
minimum: 0
|
|
140
|
+
}),
|
|
141
|
+
discount: new import_validation.NumberType({
|
|
142
|
+
minimum: 0
|
|
143
|
+
}),
|
|
144
|
+
coupon: new import_validation.StringType({
|
|
145
|
+
minLength: 1,
|
|
146
|
+
maxLength: 50
|
|
147
|
+
})
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
const order = new import_validation.ObjectType({
|
|
151
|
+
required: ["orderId", "currency", "items", "total"],
|
|
152
|
+
properties: {
|
|
153
|
+
orderId: new import_validation.StringType({
|
|
154
|
+
minLength: 1,
|
|
155
|
+
maxLength: 50
|
|
156
|
+
}),
|
|
157
|
+
currency: new import_validation.StringType({
|
|
158
|
+
maxLength: 10,
|
|
159
|
+
minLength: 1
|
|
160
|
+
}),
|
|
161
|
+
items: new import_validation.ArrayType({
|
|
162
|
+
items: orderItem,
|
|
163
|
+
minItems: 1
|
|
164
|
+
}),
|
|
165
|
+
subtotal: new import_validation.NumberType({
|
|
166
|
+
minimum: 0
|
|
167
|
+
}),
|
|
168
|
+
shippingPrice: new import_validation.NumberType({
|
|
169
|
+
minimum: 0
|
|
170
|
+
}),
|
|
171
|
+
taxes: new import_validation.ObjectType({
|
|
172
|
+
additionalProperties: new import_validation.NumberType(),
|
|
173
|
+
minProperties: 1
|
|
174
|
+
}),
|
|
175
|
+
costs: new import_validation.ObjectType({
|
|
176
|
+
additionalProperties: new import_validation.NumberType(),
|
|
177
|
+
minProperties: 1
|
|
178
|
+
}),
|
|
179
|
+
discount: new import_validation.NumberType({
|
|
180
|
+
minimum: 0
|
|
181
|
+
}),
|
|
182
|
+
total: new import_validation.NumberType({
|
|
183
|
+
minimum: 0
|
|
184
|
+
}),
|
|
185
|
+
coupon: new import_validation.StringType({
|
|
186
|
+
minLength: 1,
|
|
187
|
+
maxLength: 50
|
|
188
|
+
}),
|
|
189
|
+
paymentMethod: new import_validation.StringType({
|
|
190
|
+
minLength: 1,
|
|
191
|
+
maxLength: 50
|
|
192
|
+
}),
|
|
193
|
+
installments: new import_validation.NumberType({
|
|
194
|
+
minimum: 1
|
|
195
|
+
}),
|
|
196
|
+
status: new import_validation.StringType({
|
|
197
|
+
enumeration: ["placed", "paid", "complete"]
|
|
198
|
+
})
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
202
|
+
0 && (module.exports = {
|
|
203
|
+
cart,
|
|
204
|
+
cartItem,
|
|
205
|
+
order,
|
|
206
|
+
orderItem,
|
|
207
|
+
productDetails
|
|
208
|
+
});
|
|
209
|
+
//# sourceMappingURL=ecommerceSchemas.cjs.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var evaluatorSchemas_exports = {};
|
|
19
|
+
__export(evaluatorSchemas_exports, {
|
|
20
|
+
evaluationOptionsSchema: () => evaluationOptionsSchema
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(evaluatorSchemas_exports);
|
|
23
|
+
var import_validation = require("../validation");
|
|
24
|
+
function createJsonSchema(maximumDepth) {
|
|
25
|
+
return new import_validation.UnionType(
|
|
26
|
+
new import_validation.NullType(),
|
|
27
|
+
new import_validation.NumberType(),
|
|
28
|
+
new import_validation.BooleanType(),
|
|
29
|
+
new import_validation.StringType({ maxLength: 255 }),
|
|
30
|
+
...maximumDepth > 1 ? [
|
|
31
|
+
new import_validation.JsonObjectType({
|
|
32
|
+
propertyNames: new import_validation.UnionType(
|
|
33
|
+
new import_validation.NumberType(),
|
|
34
|
+
new import_validation.StringType({
|
|
35
|
+
minLength: 1,
|
|
36
|
+
maxLength: 50
|
|
37
|
+
})
|
|
38
|
+
),
|
|
39
|
+
properties: createJsonSchema(maximumDepth - 1)
|
|
40
|
+
}),
|
|
41
|
+
new import_validation.ArrayType({ items: createJsonSchema(maximumDepth - 1) })
|
|
42
|
+
] : []
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
const evaluationOptionsSchema = new import_validation.ObjectType({
|
|
46
|
+
properties: {
|
|
47
|
+
timeout: new import_validation.NumberType({
|
|
48
|
+
integer: true,
|
|
49
|
+
minimum: 0
|
|
50
|
+
}),
|
|
51
|
+
attributes: new import_validation.JsonObjectType({
|
|
52
|
+
propertyNames: new import_validation.StringType({
|
|
53
|
+
minLength: 1,
|
|
54
|
+
maxLength: 50
|
|
55
|
+
}),
|
|
56
|
+
properties: createJsonSchema(5)
|
|
57
|
+
})
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
61
|
+
0 && (module.exports = {
|
|
62
|
+
evaluationOptionsSchema
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=evaluatorSchemas.cjs.map
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var eventSchemas_exports = {};
|
|
19
|
+
__export(eventSchemas_exports, {
|
|
20
|
+
cartModified: () => cartModified,
|
|
21
|
+
cartViewed: () => cartViewed,
|
|
22
|
+
checkoutStarted: () => checkoutStarted,
|
|
23
|
+
eventOccurred: () => eventOccurred,
|
|
24
|
+
goalCompleted: () => goalCompleted,
|
|
25
|
+
interestShown: () => interestShown,
|
|
26
|
+
linkOpened: () => linkOpened,
|
|
27
|
+
orderPlaced: () => orderPlaced,
|
|
28
|
+
postViewed: () => postViewed,
|
|
29
|
+
productViewed: () => productViewed,
|
|
30
|
+
userSignedUp: () => userSignedUp
|
|
31
|
+
});
|
|
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");
|
|
37
|
+
const cartModified = new import_validation.ObjectType({
|
|
38
|
+
required: ["cart"],
|
|
39
|
+
properties: {
|
|
40
|
+
cart: import_ecommerceSchemas.cart
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const cartViewed = new import_validation.ObjectType({
|
|
44
|
+
required: ["cart"],
|
|
45
|
+
properties: {
|
|
46
|
+
cart: import_ecommerceSchemas.cart
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
const checkoutStarted = new import_validation.ObjectType({
|
|
50
|
+
required: ["cart"],
|
|
51
|
+
properties: {
|
|
52
|
+
cart: import_ecommerceSchemas.cart,
|
|
53
|
+
orderId: new import_validation.StringType({
|
|
54
|
+
minLength: 1,
|
|
55
|
+
maxLength: 50
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
const orderPlaced = new import_validation.ObjectType({
|
|
60
|
+
required: ["order"],
|
|
61
|
+
properties: {
|
|
62
|
+
order: import_ecommerceSchemas.order
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
const productViewed = new import_validation.ObjectType({
|
|
66
|
+
required: ["product"],
|
|
67
|
+
properties: {
|
|
68
|
+
product: import_ecommerceSchemas.productDetails
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
const userSignedUp = new import_validation.ObjectType({
|
|
72
|
+
required: ["userId"],
|
|
73
|
+
properties: {
|
|
74
|
+
userId: new import_validation.StringType({
|
|
75
|
+
minLength: 1,
|
|
76
|
+
maxLength: 254
|
|
77
|
+
}),
|
|
78
|
+
profile: import_userSchema.userProfileSchema
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
const goalCompleted = new import_validation.ObjectType({
|
|
82
|
+
required: ["goalId"],
|
|
83
|
+
properties: {
|
|
84
|
+
goalId: new import_validation.StringType({
|
|
85
|
+
minLength: 3,
|
|
86
|
+
maxLength: 100,
|
|
87
|
+
pattern: /^[a-z0-9][a-z0-9:_-]+[a-z0-9]$/i
|
|
88
|
+
}),
|
|
89
|
+
value: new import_validation.NumberType({
|
|
90
|
+
minimum: 0
|
|
91
|
+
}),
|
|
92
|
+
currency: new import_validation.StringType({
|
|
93
|
+
minLength: 1,
|
|
94
|
+
maxLength: 10
|
|
95
|
+
})
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
const interestShown = new import_validation.ObjectType({
|
|
99
|
+
required: ["interests"],
|
|
100
|
+
properties: {
|
|
101
|
+
interests: new import_validation.ArrayType({
|
|
102
|
+
items: new import_validation.StringType({
|
|
103
|
+
minLength: 1,
|
|
104
|
+
maxLength: 50
|
|
105
|
+
}),
|
|
106
|
+
minItems: 1,
|
|
107
|
+
maxItems: 10
|
|
108
|
+
})
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
const postViewed = new import_validation.ObjectType({
|
|
112
|
+
required: ["post"],
|
|
113
|
+
properties: {
|
|
114
|
+
post: import_contentSchemas.postDetails
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
const linkOpened = new import_validation.ObjectType({
|
|
118
|
+
required: ["link"],
|
|
119
|
+
properties: {
|
|
120
|
+
link: new import_validation.StringType()
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
const eventOccurred = new import_validation.ObjectType({
|
|
124
|
+
required: ["name"],
|
|
125
|
+
properties: {
|
|
126
|
+
name: new import_validation.StringType({
|
|
127
|
+
minLength: 1,
|
|
128
|
+
maxLength: 50
|
|
129
|
+
}),
|
|
130
|
+
details: new import_validation.ObjectType({
|
|
131
|
+
additionalProperties: new import_validation.UnionType(
|
|
132
|
+
new import_validation.NullType(),
|
|
133
|
+
new import_validation.BooleanType(),
|
|
134
|
+
new import_validation.NumberType(),
|
|
135
|
+
new import_validation.StringType({
|
|
136
|
+
maxLength: 300
|
|
137
|
+
})
|
|
138
|
+
),
|
|
139
|
+
propertyNames: new import_validation.StringType({
|
|
140
|
+
minLength: 1,
|
|
141
|
+
maxLength: 20,
|
|
142
|
+
format: "identifier"
|
|
143
|
+
}),
|
|
144
|
+
maxProperties: 10
|
|
145
|
+
})
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
149
|
+
0 && (module.exports = {
|
|
150
|
+
cartModified,
|
|
151
|
+
cartViewed,
|
|
152
|
+
checkoutStarted,
|
|
153
|
+
eventOccurred,
|
|
154
|
+
goalCompleted,
|
|
155
|
+
interestShown,
|
|
156
|
+
linkOpened,
|
|
157
|
+
orderPlaced,
|
|
158
|
+
postViewed,
|
|
159
|
+
productViewed,
|
|
160
|
+
userSignedUp
|
|
161
|
+
});
|
|
162
|
+
//# sourceMappingURL=eventSchemas.cjs.map
|
package/schema/index.cjs
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var schema_exports = {};
|
|
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);
|
|
28
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
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")
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var loggerSchema_exports = {};
|
|
19
|
+
__export(loggerSchema_exports, {
|
|
20
|
+
loggerSchema: () => loggerSchema
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(loggerSchema_exports);
|
|
23
|
+
var import_validation = require("../validation");
|
|
24
|
+
const loggerSchema = new import_validation.ObjectType({
|
|
25
|
+
required: ["debug", "info", "warn", "error"],
|
|
26
|
+
additionalProperties: true,
|
|
27
|
+
properties: {
|
|
28
|
+
debug: new import_validation.FunctionType(),
|
|
29
|
+
info: new import_validation.FunctionType(),
|
|
30
|
+
warn: new import_validation.FunctionType(),
|
|
31
|
+
error: new import_validation.FunctionType()
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {
|
|
36
|
+
loggerSchema
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=loggerSchema.cjs.map
|