@adobe/alloy 2.34.1 → 2.34.2-beta.1

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 (47) hide show
  1. package/dist/alloy.js +329 -436
  2. package/dist/alloy.min.js +2 -2
  3. package/dist/types/browser/src/components/Advertising/index.d.ts +2 -1
  4. package/dist/types/browser/src/components/Advertising/utils/advertisingCookieManager.d.ts +2 -1
  5. package/dist/types/browser/src/components/PushNotifications/index.d.ts +4 -4
  6. package/dist/types/browser/src/index.d.ts +2 -1
  7. package/dist/types/browser/src/services/createBrowserGlobalsService.d.ts +0 -1
  8. package/dist/types/browser/src/services/createBrowserNetworkService.d.ts +1 -1
  9. package/dist/types/browser/src/services/createBrowserPlatformServices.d.ts +1 -4
  10. package/dist/types/core/src/components/Audiences/index.d.ts +2 -1
  11. package/dist/types/core/src/components/BrandConcierge/createSendConversationEvent.d.ts +2 -1
  12. package/dist/types/core/src/components/BrandConcierge/index.d.ts +2 -1
  13. package/dist/types/core/src/components/BrandConcierge/utils.d.ts +1 -1
  14. package/dist/types/core/src/components/Consent/createConsentHashStore.d.ts +2 -2
  15. package/dist/types/core/src/components/Consent/index.d.ts +2 -2
  16. package/dist/types/core/src/components/Identity/index.d.ts +2 -1
  17. package/dist/types/core/src/components/RulesEngine/createContextProvider.d.ts +2 -2
  18. package/dist/types/core/src/components/RulesEngine/index.d.ts +2 -2
  19. package/dist/types/core/src/components/RulesEngine/utils/storage.d.ts +1 -1
  20. package/dist/types/core/src/core/createLogController.d.ts +4 -4
  21. package/dist/types/core/src/core/index.d.ts +1 -3
  22. package/dist/types/core/src/index.d.ts +1 -4
  23. package/dist/types/core/src/services/types.d.ts +23 -3
  24. package/dist/types/core/src/utils/index.d.ts +2 -3
  25. package/dist/types/core/src/utils/injectDoesIdentityCookieExist.d.ts +2 -1
  26. package/dist/types/core/src/utils/request/createGetAssuranceValidationTokenParams.d.ts +2 -2
  27. package/package.json +3 -2
  28. package/src/components/Advertising/index.js +2 -0
  29. package/src/components/Advertising/utils/advertisingCookieManager.js +2 -2
  30. package/src/components/PushNotifications/index.js +4 -4
  31. package/src/components/PushNotifications/request/makeSendPushSubscriptionRequest.js +2 -1
  32. package/src/index.js +6 -1
  33. package/src/services/createBrowserCookieService.js +3 -2
  34. package/src/services/createBrowserGlobalsService.js +14 -0
  35. package/src/services/createBrowserNetworkService.js +3 -4
  36. package/src/services/createBrowserPlatformServices.js +2 -3
  37. package/src/services/injectSendBeaconRequest.js +32 -0
  38. package/src/services/injectSendFetchRequest.js +37 -0
  39. package/dist/types/core/src/components/Identity/visitorService/awaitVisitorOptIn.d.ts +0 -4
  40. package/dist/types/core/src/components/Identity/visitorService/getVisitor.d.ts +0 -2
  41. package/dist/types/core/src/components/Identity/visitorService/injectGetEcidFromVisitor.d.ts +0 -6
  42. package/dist/types/core/src/core/getMonitors.d.ts +0 -3
  43. package/dist/types/core/src/utils/cookieJar.d.ts +0 -7
  44. /package/dist/types/{core/src/core/network/requestMethods → browser/src/services}/injectSendBeaconRequest.d.ts +0 -0
  45. /package/dist/types/{core/src/core/network/requestMethods → browser/src/services}/injectSendFetchRequest.d.ts +0 -0
  46. /package/dist/types/core/src/utils/{fireImage.d.ts → dom/fireImage.d.ts} +0 -0
  47. /package/dist/types/core/src/utils/{injectFireReferrerHideableImage.d.ts → dom/injectFireReferrerHideableImage.d.ts} +0 -0
@@ -0,0 +1,37 @@
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
+ export default ({ fetch }) => {
14
+ return (url, body) => {
15
+ return fetch(url, {
16
+ method: "POST",
17
+ cache: "no-cache",
18
+ credentials: "include", // To set the cookie header in the request.
19
+ headers: {
20
+ "Content-Type": "text/plain; charset=UTF-8",
21
+ },
22
+ referrerPolicy: "no-referrer-when-downgrade",
23
+ body,
24
+ }).then((response) => {
25
+ return response.text().then((responseBody) => ({
26
+ statusCode: response.status,
27
+ // We expose headers through a function instead of creating an object
28
+ // with all the headers up front largely because the native
29
+ // request.getResponseHeader method is case-insensitive.
30
+ getHeader(name) {
31
+ return response.headers.get(name);
32
+ },
33
+ body: responseBody,
34
+ }));
35
+ });
36
+ };
37
+ };
@@ -1,4 +0,0 @@
1
- declare function _default({ logger }: {
2
- logger: any;
3
- }): Promise<any>;
4
- export default _default;
@@ -1,2 +0,0 @@
1
- declare function _default(window: any): any;
2
- export default _default;
@@ -1,6 +0,0 @@
1
- declare function _default({ logger, orgId, awaitVisitorOptIn }: {
2
- logger: any;
3
- orgId: any;
4
- awaitVisitorOptIn: any;
5
- }): () => any;
6
- export default _default;
@@ -1,3 +0,0 @@
1
- declare function _default(monitors?: Array<AlloyMonitor>): Function;
2
- export default _default;
3
- import type { AlloyMonitor } from './types.js';
@@ -1,7 +0,0 @@
1
- declare namespace _default {
2
- let get: any;
3
- let set: any;
4
- let remove: any;
5
- let withConverter: any;
6
- }
7
- export default _default;