@adobe/alloy 2.31.2-beta.0 → 2.31.2-beta.2
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/dist/alloy.js +36 -18
- package/dist/alloy.min.js +1 -1
- package/dist/types/browser/src/utils/createEventMergeId.d.ts +1 -0
- package/dist/types/browser/src/utils/deepAssign.d.ts +1 -0
- package/dist/types/core/src/components/BrandConcierge/constants.d.ts +1 -0
- package/dist/types/core/src/components/BrandConcierge/createConversationServiceRequest.d.ts +2 -1
- package/dist/utils/createEventMergeId.js +73 -0
- package/dist/utils/deepAssign.js +97 -0
- package/package.json +20 -4
- package/rollup.config.js +37 -1
- package/src/utils/createEventMergeId.js +13 -0
- package/src/utils/deepAssign.js +13 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "@adobe/alloy-core/components/EventMerge/createEventMergeId.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "@adobe/alloy-core/utils/deepAssign.js";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
declare function _default({ payload, action, sessionId }: {
|
|
1
|
+
declare function _default({ payload, action, sessionId, voiceEnabled, }: {
|
|
2
2
|
payload: any;
|
|
3
3
|
action?: string;
|
|
4
4
|
sessionId: any;
|
|
5
|
+
voiceEnabled?: boolean;
|
|
5
6
|
}): import("../../utils/request/types.js").Request;
|
|
6
7
|
export default _default;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2019 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const byteToHex = [];
|
|
14
|
+
for (let i = 0; i < 256; ++i) {
|
|
15
|
+
byteToHex.push((i + 0x100).toString(16).slice(1));
|
|
16
|
+
}
|
|
17
|
+
function unsafeStringify(arr, offset = 0) {
|
|
18
|
+
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
let getRandomValues;
|
|
22
|
+
const rnds8 = new Uint8Array(16);
|
|
23
|
+
function rng() {
|
|
24
|
+
if (!getRandomValues) {
|
|
25
|
+
if (typeof crypto === 'undefined' || !crypto.getRandomValues) {
|
|
26
|
+
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
27
|
+
}
|
|
28
|
+
getRandomValues = crypto.getRandomValues.bind(crypto);
|
|
29
|
+
}
|
|
30
|
+
return getRandomValues(rnds8);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
34
|
+
var native = {
|
|
35
|
+
randomUUID
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
function _v4(options, buf, offset) {
|
|
39
|
+
options = options || {};
|
|
40
|
+
const rnds = options.random ?? options.rng?.() ?? rng();
|
|
41
|
+
if (rnds.length < 16) {
|
|
42
|
+
throw new Error('Random bytes length must be >= 16');
|
|
43
|
+
}
|
|
44
|
+
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
45
|
+
rnds[8] = rnds[8] & 0x3f | 0x80;
|
|
46
|
+
return unsafeStringify(rnds);
|
|
47
|
+
}
|
|
48
|
+
function v4(options, buf, offset) {
|
|
49
|
+
if (native.randomUUID && true && !options) {
|
|
50
|
+
return native.randomUUID();
|
|
51
|
+
}
|
|
52
|
+
return _v4(options);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/*
|
|
56
|
+
Copyright 2025 Adobe. All rights reserved.
|
|
57
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
58
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
59
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
60
|
+
|
|
61
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
62
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
63
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
64
|
+
governing permissions and limitations under the License.
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
var createEventMergeId = () => {
|
|
68
|
+
return {
|
|
69
|
+
eventMergeId: v4()
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export { createEventMergeId as default };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2019 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/*
|
|
14
|
+
Copyright 2019 Adobe. All rights reserved.
|
|
15
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
16
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
17
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
+
|
|
19
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
20
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
21
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
22
|
+
governing permissions and limitations under the License.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Returns true when the value is null.
|
|
27
|
+
* @param {*} value
|
|
28
|
+
* @returns {boolean}
|
|
29
|
+
*/
|
|
30
|
+
var isNil = value => value == null;
|
|
31
|
+
|
|
32
|
+
/*
|
|
33
|
+
Copyright 2019 Adobe. All rights reserved.
|
|
34
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
35
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
36
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
37
|
+
|
|
38
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
39
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
40
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
41
|
+
governing permissions and limitations under the License.
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Returns whether the value is an object.
|
|
47
|
+
* @param {*} value
|
|
48
|
+
* @returns {boolean}
|
|
49
|
+
*/
|
|
50
|
+
var isObject = value => !isNil(value) && !Array.isArray(value) && typeof value === "object";
|
|
51
|
+
|
|
52
|
+
/*
|
|
53
|
+
Copyright 2019 Adobe. All rights reserved.
|
|
54
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
55
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
56
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
57
|
+
|
|
58
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
59
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
60
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
61
|
+
governing permissions and limitations under the License.
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
// Keys that should never be copied to prevent prototype pollution.
|
|
66
|
+
const DANGEROUS_KEYS = ["__proto__", "constructor", "prototype"];
|
|
67
|
+
const deepAssignObject = (target, source) => {
|
|
68
|
+
Object.keys(source).forEach(key => {
|
|
69
|
+
if (DANGEROUS_KEYS.includes(key)) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (isObject(target[key]) && isObject(source[key])) {
|
|
73
|
+
deepAssignObject(target[key], source[key]);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
target[key] = source[key];
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Recursively copy the values of all enumerable own properties from a source item to a target item if the both items are objects
|
|
82
|
+
* @param {Object} target - a target object
|
|
83
|
+
* @param {...Object} source - an array of source objects
|
|
84
|
+
* @example
|
|
85
|
+
* deepAssign({ a: 'a', b: 'b' }, { b: 'B', c: 'c' });
|
|
86
|
+
* // { a: 'a', b: 'B', c: 'c' }
|
|
87
|
+
*/
|
|
88
|
+
var deepAssign = (target, ...sources) => {
|
|
89
|
+
if (isNil(target)) {
|
|
90
|
+
throw new TypeError('deepAssign "target" cannot be null or undefined');
|
|
91
|
+
}
|
|
92
|
+
const result = Object(target);
|
|
93
|
+
sources.forEach(source => deepAssignObject(result, Object(source)));
|
|
94
|
+
return result;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export { deepAssign as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/alloy",
|
|
3
|
-
"version": "2.31.2-beta.
|
|
3
|
+
"version": "2.31.2-beta.2",
|
|
4
4
|
"description": "Adobe Experience Platform Web SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -40,6 +40,22 @@
|
|
|
40
40
|
"./serviceWorker.js": {
|
|
41
41
|
"types": "./dist/types/browser/src/serviceWorker.d.ts",
|
|
42
42
|
"default": "./src/serviceWorker.js"
|
|
43
|
+
},
|
|
44
|
+
"./utils/deepAssign.js": {
|
|
45
|
+
"types": "./dist/types/browser/src/utils/deepAssign.d.ts",
|
|
46
|
+
"default": "./dist/utils/deepAssign.js"
|
|
47
|
+
},
|
|
48
|
+
"./libEs6/utils/deepAssign": {
|
|
49
|
+
"types": "./dist/types/browser/src/utils/deepAssign.d.ts",
|
|
50
|
+
"default": "./dist/utils/deepAssign.js"
|
|
51
|
+
},
|
|
52
|
+
"./utils/createEventMergeId.js": {
|
|
53
|
+
"types": "./dist/types/browser/src/utils/createEventMergeId.d.ts",
|
|
54
|
+
"default": "./dist/utils/createEventMergeId.js"
|
|
55
|
+
},
|
|
56
|
+
"./libEs6/components/EventMerge/createEventMergeId": {
|
|
57
|
+
"types": "./dist/types/browser/src/utils/createEventMergeId.d.ts",
|
|
58
|
+
"default": "./dist/utils/createEventMergeId.js"
|
|
43
59
|
}
|
|
44
60
|
},
|
|
45
61
|
"dependencies": {
|
|
@@ -69,10 +85,10 @@
|
|
|
69
85
|
"vitest": "^4.0.6"
|
|
70
86
|
},
|
|
71
87
|
"scripts": {
|
|
72
|
-
"
|
|
88
|
+
"clean": "rimraf dist distTest",
|
|
73
89
|
"build:types": "tsc -p jsconfig.json --declaration --emitDeclarationOnly --outDir dist/types --checkJs false --noEmit false",
|
|
74
|
-
"build": "pnpm run
|
|
75
|
-
"build:watch": "pnpm run
|
|
90
|
+
"build": "pnpm run clean && rollup -c --environment BASE_CODE_MIN,STANDALONE,STANDALONE_MIN,SERVICE_WORKER,SERVICE_WORKER_MIN,UTILITY_EXPORTS,BUNDLESIZE && pnpm run build:types",
|
|
91
|
+
"build:watch": "pnpm run clean && rollup -c --watch --environment BASE_CODE_MIN,STANDALONE,UTILITY_EXPORTS",
|
|
76
92
|
"build:custom": "node scripts/alloyBuilder.js",
|
|
77
93
|
"test:functional": "pnpm exec playwright install chromium && EDGE_BASE_PATH=\"ee-pre-prd\" ALLOY_ENV=\"int\" testcafe playwright:chromium",
|
|
78
94
|
"test:functional:custom": "node ./scripts/runFunctionalTests.js",
|
package/rollup.config.js
CHANGED
|
@@ -131,10 +131,23 @@ const FUNCTIONAL_TEST_PROD = "FUNCTIONAL_TEST_PROD";
|
|
|
131
131
|
const CUSTOM_BUILD = "CUSTOM_BUILD";
|
|
132
132
|
// build the service worker (used for push notifications feature).
|
|
133
133
|
const SERVICE_WORKER = "SERVICE_WORKER";
|
|
134
|
+
// build bundled utility entrypoints for npm consumers.
|
|
135
|
+
export const UTILITY_EXPORTS = "UTILITY_EXPORTS";
|
|
134
136
|
// Add "_MIN" to the end of the option name to build the minified version
|
|
135
137
|
|
|
136
138
|
const dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
137
139
|
|
|
140
|
+
export const utilityExportBuilds = [
|
|
141
|
+
{
|
|
142
|
+
input: `${dirname}/src/utils/deepAssign.js`,
|
|
143
|
+
file: `${dirname}/dist/utils/deepAssign.js`,
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
input: `${dirname}/src/utils/createEventMergeId.js`,
|
|
147
|
+
file: `${dirname}/dist/utils/createEventMergeId.js`,
|
|
148
|
+
},
|
|
149
|
+
];
|
|
150
|
+
|
|
138
151
|
const buildPlugins = ({ variant, minify, babelPlugins }) => {
|
|
139
152
|
const plugins = [
|
|
140
153
|
resolve({
|
|
@@ -186,7 +199,8 @@ const buildPlugins = ({ variant, minify, babelPlugins }) => {
|
|
|
186
199
|
if (
|
|
187
200
|
variant === STANDALONE ||
|
|
188
201
|
variant === CUSTOM_BUILD ||
|
|
189
|
-
variant === SERVICE_WORKER
|
|
202
|
+
variant === SERVICE_WORKER ||
|
|
203
|
+
variant === UTILITY_EXPORTS
|
|
190
204
|
) {
|
|
191
205
|
plugins.push(
|
|
192
206
|
license({
|
|
@@ -254,6 +268,19 @@ export const buildConfig = ({
|
|
|
254
268
|
};
|
|
255
269
|
}
|
|
256
270
|
|
|
271
|
+
if (variant === UTILITY_EXPORTS) {
|
|
272
|
+
return {
|
|
273
|
+
input,
|
|
274
|
+
output: [
|
|
275
|
+
{
|
|
276
|
+
file,
|
|
277
|
+
format: "es",
|
|
278
|
+
},
|
|
279
|
+
],
|
|
280
|
+
plugins,
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
|
|
257
284
|
// FUNCTIONAL_TEST_LOCAL or FUNCTIONAL_TEST_PROD
|
|
258
285
|
const filename =
|
|
259
286
|
variant === FUNCTIONAL_TEST_LOCAL
|
|
@@ -283,10 +310,19 @@ const addConfig = (variant) => {
|
|
|
283
310
|
}
|
|
284
311
|
};
|
|
285
312
|
|
|
313
|
+
const addUtilityExportConfigs = () => {
|
|
314
|
+
if (process.env[UTILITY_EXPORTS]) {
|
|
315
|
+
utilityExportBuilds.forEach(({ input, file }) => {
|
|
316
|
+
config.push(buildConfig({ variant: UTILITY_EXPORTS, input, file }));
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
|
|
286
321
|
addConfig(BASE_CODE);
|
|
287
322
|
addConfig(STANDALONE);
|
|
288
323
|
addConfig(FUNCTIONAL_TEST_LOCAL);
|
|
289
324
|
addConfig(FUNCTIONAL_TEST_PROD);
|
|
290
325
|
addConfig(SERVICE_WORKER);
|
|
326
|
+
addUtilityExportConfigs();
|
|
291
327
|
|
|
292
328
|
export default config;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2026 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export { default } from "@adobe/alloy-core/components/EventMerge/createEventMergeId.js";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2026 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export { default } from "@adobe/alloy-core/utils/deepAssign.js";
|