@adobe/alloy 2.29.0-beta.4 → 2.29.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 (141) hide show
  1. package/libEs5/components/ActivityCollector/utils/dom/findClickableElement.js +4 -0
  2. package/libEs5/components/Advertising/handlers/clickThroughHandler.js +2 -1
  3. package/libEs5/components/Advertising/handlers/onBeforeSendEventHandler.js +8 -3
  4. package/libEs5/components/Advertising/handlers/viewThroughHandler.js +2 -1
  5. package/libEs5/components/Advertising/identities/collectID5Id.js +1 -1
  6. package/libEs5/components/Advertising/identities/collectRampId.js +1 -1
  7. package/libEs5/components/Consent/createConsentRequestPayload.js +14 -3
  8. package/libEs5/components/Consent/types.js +18 -0
  9. package/libEs5/components/Personalization/dom-actions/action.js +7 -4
  10. package/libEs5/components/Personalization/dom-actions/initDomActionsModules.js +10 -10
  11. package/libEs5/components/PushNotifications/helpers/getPushSubscriptionDetails.js +116 -0
  12. package/libEs5/components/PushNotifications/index.js +96 -0
  13. package/libEs5/components/PushNotifications/request/createSendPushSubscriptionPayload.js +62 -0
  14. package/libEs5/components/PushNotifications/request/createSendPushSubscriptionRequest.js +35 -0
  15. package/libEs5/components/PushNotifications/request/makeSendPushSubscriptionRequest.js +88 -0
  16. package/libEs5/components/PushNotifications/types.js +14 -0
  17. package/libEs5/constants/libraryVersion.js +1 -1
  18. package/libEs5/core/componentCreators.js +8 -1
  19. package/libEs5/core/consent/createConsent.js +10 -0
  20. package/libEs5/core/consent/createConsentStateMachine.js +36 -0
  21. package/libEs5/core/consent/types.js +24 -0
  22. package/libEs5/core/edgeNetwork/injectSendEdgeNetworkRequest.js +20 -0
  23. package/libEs5/core/edgeNetwork/types.js +10 -0
  24. package/libEs5/core/identity/createIdentity.js +36 -0
  25. package/libEs5/core/identity/types.js +15 -0
  26. package/libEs5/core/injectCreateResponse.js +9 -7
  27. package/libEs5/core/types.js +101 -11
  28. package/libEs5/utils/bytes.js +12 -1
  29. package/libEs5/utils/createLoggingCookieJar.js +14 -1
  30. package/libEs5/utils/createMerger.js +5 -4
  31. package/libEs5/utils/injectStorage.js +19 -0
  32. package/libEs5/utils/request/createDataCollectionRequestPayload.js +16 -8
  33. package/libEs5/utils/request/createRequest.js +28 -1
  34. package/libEs5/utils/request/createRequestPayload.js +68 -4
  35. package/libEs5/utils/request/types.js +52 -0
  36. package/libEs5/utils/types.js +39 -0
  37. package/libEs6/components/ActivityCollector/utils/dom/findClickableElement.js +4 -0
  38. package/libEs6/components/Advertising/handlers/clickThroughHandler.js +2 -1
  39. package/libEs6/components/Advertising/handlers/onBeforeSendEventHandler.js +8 -3
  40. package/libEs6/components/Advertising/handlers/viewThroughHandler.js +2 -1
  41. package/libEs6/components/Advertising/identities/collectID5Id.js +1 -1
  42. package/libEs6/components/Advertising/identities/collectRampId.js +1 -1
  43. package/libEs6/components/Consent/createConsentRequestPayload.js +16 -3
  44. package/libEs6/components/Consent/types.js +15 -0
  45. package/libEs6/components/Personalization/dom-actions/action.js +7 -4
  46. package/libEs6/components/Personalization/dom-actions/initDomActionsModules.js +10 -10
  47. package/libEs6/components/PushNotifications/helpers/getPushSubscriptionDetails.js +114 -0
  48. package/libEs6/components/PushNotifications/index.js +93 -0
  49. package/libEs6/components/PushNotifications/request/createSendPushSubscriptionPayload.js +61 -0
  50. package/libEs6/components/PushNotifications/request/createSendPushSubscriptionRequest.js +34 -0
  51. package/libEs6/components/PushNotifications/request/makeSendPushSubscriptionRequest.js +84 -0
  52. package/libEs6/components/PushNotifications/types.js +11 -0
  53. package/libEs6/constants/libraryVersion.js +1 -1
  54. package/libEs6/core/componentCreators.js +2 -1
  55. package/libEs6/core/consent/createConsent.js +12 -0
  56. package/libEs6/core/consent/createConsentStateMachine.js +36 -0
  57. package/libEs6/core/consent/types.js +21 -0
  58. package/libEs6/core/edgeNetwork/injectSendEdgeNetworkRequest.js +20 -0
  59. package/libEs6/core/edgeNetwork/types.js +7 -0
  60. package/libEs6/core/identity/createIdentity.js +38 -0
  61. package/libEs6/core/identity/types.js +12 -0
  62. package/libEs6/core/injectCreateResponse.js +11 -7
  63. package/libEs6/core/types.js +101 -11
  64. package/libEs6/utils/bytes.js +12 -1
  65. package/libEs6/utils/createLoggingCookieJar.js +15 -1
  66. package/libEs6/utils/createMerger.js +5 -4
  67. package/libEs6/utils/injectStorage.js +20 -0
  68. package/libEs6/utils/request/createDataCollectionRequestPayload.js +19 -8
  69. package/libEs6/utils/request/createRequest.js +29 -1
  70. package/libEs6/utils/request/createRequestPayload.js +67 -4
  71. package/libEs6/utils/request/types.js +49 -0
  72. package/libEs6/utils/types.js +36 -0
  73. package/package.json +30 -30
  74. package/types/components/ActivityCollector/utils/dom/findClickableElement.d.ts.map +1 -1
  75. package/types/components/Advertising/handlers/onBeforeSendEventHandler.d.ts.map +1 -1
  76. package/types/components/Advertising/handlers/viewThroughHandler.d.ts.map +1 -1
  77. package/types/components/Consent/createConsentRequest.d.ts +1 -11
  78. package/types/components/Consent/createConsentRequest.d.ts.map +1 -1
  79. package/types/components/Consent/createConsentRequestPayload.d.ts +2 -9
  80. package/types/components/Consent/createConsentRequestPayload.d.ts.map +1 -1
  81. package/types/components/Consent/types.d.ts +28 -0
  82. package/types/components/Consent/types.d.ts.map +1 -0
  83. package/types/components/Identity/getIdentity/createIdentityRequest.d.ts +1 -11
  84. package/types/components/Identity/getIdentity/createIdentityRequest.d.ts.map +1 -1
  85. package/types/components/Identity/getIdentity/createIdentityRequestPayload.d.ts +1 -9
  86. package/types/components/Identity/getIdentity/createIdentityRequestPayload.d.ts.map +1 -1
  87. package/types/components/Personalization/dom-actions/action.d.ts +1 -1
  88. package/types/components/Personalization/dom-actions/action.d.ts.map +1 -1
  89. package/types/components/PushNotifications/helpers/getPushSubscriptionDetails.d.ts +30 -0
  90. package/types/components/PushNotifications/helpers/getPushSubscriptionDetails.d.ts.map +1 -0
  91. package/types/components/PushNotifications/index.d.ts +43 -0
  92. package/types/components/PushNotifications/index.d.ts.map +1 -0
  93. package/types/components/PushNotifications/request/createSendPushSubscriptionPayload.d.ts +10 -0
  94. package/types/components/PushNotifications/request/createSendPushSubscriptionPayload.d.ts.map +1 -0
  95. package/types/components/PushNotifications/request/createSendPushSubscriptionRequest.d.ts +7 -0
  96. package/types/components/PushNotifications/request/createSendPushSubscriptionRequest.d.ts.map +1 -0
  97. package/types/components/PushNotifications/request/makeSendPushSubscriptionRequest.d.ts +20 -0
  98. package/types/components/PushNotifications/request/makeSendPushSubscriptionRequest.d.ts.map +1 -0
  99. package/types/components/PushNotifications/types.d.ts +23 -0
  100. package/types/components/PushNotifications/types.d.ts.map +1 -0
  101. package/types/components/StreamingMedia/createMediaRequest.d.ts +1 -11
  102. package/types/components/StreamingMedia/createMediaRequest.d.ts.map +1 -1
  103. package/types/core/componentCreators.d.ts +1 -0
  104. package/types/core/consent/createConsent.d.ts +4 -10
  105. package/types/core/consent/createConsent.d.ts.map +1 -1
  106. package/types/core/consent/createConsentStateMachine.d.ts +4 -12
  107. package/types/core/consent/createConsentStateMachine.d.ts.map +1 -1
  108. package/types/core/consent/types.d.ts +42 -0
  109. package/types/core/consent/types.d.ts.map +1 -0
  110. package/types/core/edgeNetwork/injectSendEdgeNetworkRequest.d.ts +15 -13
  111. package/types/core/edgeNetwork/injectSendEdgeNetworkRequest.d.ts.map +1 -1
  112. package/types/core/edgeNetwork/types.d.ts +12 -0
  113. package/types/core/edgeNetwork/types.d.ts.map +1 -0
  114. package/types/core/identity/createIdentity.d.ts +9 -9
  115. package/types/core/identity/createIdentity.d.ts.map +1 -1
  116. package/types/core/identity/types.d.ts +23 -0
  117. package/types/core/identity/types.d.ts.map +1 -0
  118. package/types/core/injectCreateResponse.d.ts +3 -27
  119. package/types/core/injectCreateResponse.d.ts.map +1 -1
  120. package/types/core/types.d.ts +209 -22
  121. package/types/core/types.d.ts.map +1 -1
  122. package/types/utils/bytes.d.ts +3 -1
  123. package/types/utils/bytes.d.ts.map +1 -1
  124. package/types/utils/createLoggingCookieJar.d.ts +5 -3
  125. package/types/utils/createLoggingCookieJar.d.ts.map +1 -1
  126. package/types/utils/createMerger.d.ts +1 -1
  127. package/types/utils/createMerger.d.ts.map +1 -1
  128. package/types/utils/injectStorage.d.ts +2 -40
  129. package/types/utils/injectStorage.d.ts.map +1 -1
  130. package/types/utils/request/createDataCollectionRequest.d.ts +1 -11
  131. package/types/utils/request/createDataCollectionRequest.d.ts.map +1 -1
  132. package/types/utils/request/createDataCollectionRequestPayload.d.ts +2 -9
  133. package/types/utils/request/createDataCollectionRequestPayload.d.ts.map +1 -1
  134. package/types/utils/request/createRequest.d.ts +13 -11
  135. package/types/utils/request/createRequest.d.ts.map +1 -1
  136. package/types/utils/request/createRequestPayload.d.ts +7 -9
  137. package/types/utils/request/createRequestPayload.d.ts.map +1 -1
  138. package/types/utils/request/types.d.ts +91 -0
  139. package/types/utils/request/types.d.ts.map +1 -0
  140. package/types/utils/types.d.ts +91 -0
  141. package/types/utils/types.d.ts.map +1 -0
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Request object with methods to access and modify request properties.
3
+ *
4
+ * @typedef {Object} Request
5
+ * @property {function(): string} getId
6
+ * @property {function(): RequestPayload} getPayload
7
+ * @property {function({isIdentityEstablished: boolean}): string} getAction
8
+ * @property {function(): string|undefined} getDatastreamIdOverride
9
+ * @property {Function} getUseSendBeacon
10
+ * @property {function(): string|undefined} getEdgeSubPath
11
+ * @property {Function} getUseIdThirdPartyDomain
12
+ * @property {Function} setUseIdThirdPartyDomain
13
+ * @property {Function} setIsIdentityEstablished
14
+ */
15
+ /**
16
+ * Request payload object with methods for merging different types of data.
17
+ *
18
+ * @typedef {Object} RequestPayload
19
+ * @property {function(object): void} mergeMeta
20
+ * @property {function(object): void} mergeState
21
+ * @property {function(object): void} mergeQuery
22
+ * @property {function(object): void} mergeConfigOverride
23
+ * @property {function(string, Identity): void} options.addIdentity
24
+ * @property {function(string): boolean} options.hasIdentity
25
+ * @property {function(): object} toJSON
26
+ */
27
+ /**
28
+ * Request payload object with methods for merging different types of data.
29
+ *
30
+ * @typedef {Object} DataCollectionRequestPayload
31
+ * @property {function(object): void} mergeMeta
32
+ * @property {function(object): void} mergeState
33
+ * @property {function(object): void} mergeQuery
34
+ * @property {function(object): void} mergeConfigOverride
35
+ * @property {function(string, Identity): void} options.addIdentity
36
+ * @property {function(string): boolean} options.hasIdentity
37
+ * @property {function(object): void} addEvent
38
+ * @property {function(): boolean} getDocumentMayUnload
39
+ * @property {function(): object} toJSON
40
+ */
41
+ /**
42
+ * @typedef {Object} Identity
43
+ * @property {string} id
44
+ */
45
+ export const Types: {};
46
+ /**
47
+ * Request object with methods to access and modify request properties.
48
+ */
49
+ export type Request = {
50
+ getId: () => string;
51
+ getPayload: () => RequestPayload;
52
+ getAction: (arg0: {
53
+ isIdentityEstablished: boolean;
54
+ }) => string;
55
+ getDatastreamIdOverride: () => string | undefined;
56
+ getUseSendBeacon: Function;
57
+ getEdgeSubPath: () => string | undefined;
58
+ getUseIdThirdPartyDomain: Function;
59
+ setUseIdThirdPartyDomain: Function;
60
+ setIsIdentityEstablished: Function;
61
+ };
62
+ /**
63
+ * Request payload object with methods for merging different types of data.
64
+ */
65
+ export type RequestPayload = {
66
+ mergeMeta: (arg0: object) => void;
67
+ mergeState: (arg0: object) => void;
68
+ mergeQuery: (arg0: object) => void;
69
+ mergeConfigOverride: (arg0: object) => void;
70
+ addIdentity: (arg0: string, arg1: Identity) => void;
71
+ hasIdentity: (arg0: string) => boolean;
72
+ toJSON: () => object;
73
+ };
74
+ /**
75
+ * Request payload object with methods for merging different types of data.
76
+ */
77
+ export type DataCollectionRequestPayload = {
78
+ mergeMeta: (arg0: object) => void;
79
+ mergeState: (arg0: object) => void;
80
+ mergeQuery: (arg0: object) => void;
81
+ mergeConfigOverride: (arg0: object) => void;
82
+ addIdentity: (arg0: string, arg1: Identity) => void;
83
+ hasIdentity: (arg0: string) => boolean;
84
+ addEvent: (arg0: object) => void;
85
+ getDocumentMayUnload: () => boolean;
86
+ toJSON: () => object;
87
+ };
88
+ export type Identity = {
89
+ id: string;
90
+ };
91
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/utils/request/types.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;GAWG;AAEH;;;;;;;;;;;;;GAaG;AAEH;;;GAGG;AAEH,uBAAwB;;;;;WA5CV,MAAY,MAAM;gBAClB,MAAY,cAAc;eAC1B,CAAS,IAAgC,EAAhC;QAAC,qBAAqB,EAAE,OAAO,CAAA;KAAC,KAAG,MAAM;6BAClD,MAAY,MAAM,GAAC,SAAS;;oBAE5B,MAAY,MAAM,GAAC,SAAS;;;;;;;;;eAU5B,CAAS,IAAM,EAAN,MAAM,KAAG,IAAI;gBACtB,CAAS,IAAM,EAAN,MAAM,KAAG,IAAI;gBACtB,CAAS,IAAM,EAAN,MAAM,KAAG,IAAI;yBACtB,CAAS,IAAM,EAAN,MAAM,KAAG,IAAI;iBACtB,CAAS,IAAM,EAAN,MAAM,EAAE,IAAQ,EAAR,QAAQ,KAAG,IAAI;iBAChC,CAAS,IAAM,EAAN,MAAM,KAAG,OAAO;YACzB,MAAY,MAAM;;;;;;eAOlB,CAAS,IAAM,EAAN,MAAM,KAAG,IAAI;gBACtB,CAAS,IAAM,EAAN,MAAM,KAAG,IAAI;gBACtB,CAAS,IAAM,EAAN,MAAM,KAAG,IAAI;yBACtB,CAAS,IAAM,EAAN,MAAM,KAAG,IAAI;iBACtB,CAAS,IAAM,EAAN,MAAM,EAAE,IAAQ,EAAR,QAAQ,KAAG,IAAI;iBAChC,CAAS,IAAM,EAAN,MAAM,KAAG,OAAO;cACzB,CAAS,IAAM,EAAN,MAAM,KAAG,IAAI;0BACtB,MAAY,OAAO;YACnB,MAAY,MAAM;;;QAKlB,MAAM"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * @typedef {Object} Storage
3
+ * @property {function(string): string|null} getItem
4
+ * @property {function(string, string): void} setItem
5
+ * @property {function(): void} clear
6
+ */
7
+ /**
8
+ * @typedef {Object} CookieAttributes
9
+ * @property {number|Date} [expires] - Cookie expiration (number of days or Date object)
10
+ * @property {string} [path] - Cookie path (default: "/")
11
+ * @property {string} [domain] - Cookie domain
12
+ * @property {boolean} [secure] - Requires HTTPS transmission
13
+ * @property {"strict"|"lax"|"none"} [sameSite] - SameSite attribute
14
+ */
15
+ /**
16
+ * @typedef {Object} CookieConverter
17
+ * @property {function(string, string): string} [read] - Custom decoder function
18
+ * @property {function(string, string): string} [write] - Custom encoder function
19
+ */
20
+ /**
21
+ * @typedef {Object} CookieJar
22
+ * @property {function(string): string|undefined} get - Get cookie value by name, or get all cookies as object if no name provided
23
+ * @property {function(): Object<string, string>} get - Get all cookies as key-value object when called with no arguments
24
+ * @property {function(string, string, CookieAttributes=): string|undefined} set - Set cookie with optional attributes
25
+ * @property {function(string, CookieAttributes=): void} remove - Remove cookie with optional attributes (must match set attributes)
26
+ * @property {function(CookieConverter): CookieJar} withConverter - Create new instance with custom encoding/decoding
27
+ */
28
+ /**
29
+ * @typedef {function(string): { session: Storage, persistent: Storage }} StorageCreator
30
+ */
31
+ export const Types: {};
32
+ export type Storage = {
33
+ getItem: (arg0: string) => string | null;
34
+ setItem: (arg0: string, arg1: string) => void;
35
+ clear: () => void;
36
+ };
37
+ export type CookieAttributes = {
38
+ /**
39
+ * - Cookie expiration (number of days or Date object)
40
+ */
41
+ expires?: number | Date;
42
+ /**
43
+ * - Cookie path (default: "/")
44
+ */
45
+ path?: string;
46
+ /**
47
+ * - Cookie domain
48
+ */
49
+ domain?: string;
50
+ /**
51
+ * - Requires HTTPS transmission
52
+ */
53
+ secure?: boolean;
54
+ /**
55
+ * - SameSite attribute
56
+ */
57
+ sameSite?: "strict" | "lax" | "none";
58
+ };
59
+ export type CookieConverter = {
60
+ /**
61
+ * - Custom decoder function
62
+ */
63
+ read?: (arg0: string, arg1: string) => string;
64
+ /**
65
+ * - Custom encoder function
66
+ */
67
+ write?: (arg0: string, arg1: string) => string;
68
+ };
69
+ export type CookieJar = {
70
+ /**
71
+ * - Get cookie value by name, or get all cookies as object if no name provided
72
+ */
73
+ get: (arg0: string) => string | undefined;
74
+ /**
75
+ * - Set cookie with optional attributes
76
+ */
77
+ set: (arg0: string, arg1: string, arg2: CookieAttributes | undefined) => string | undefined;
78
+ /**
79
+ * - Remove cookie with optional attributes (must match set attributes)
80
+ */
81
+ remove: (arg0: string, arg1: CookieAttributes | undefined) => void;
82
+ /**
83
+ * - Create new instance with custom encoding/decoding
84
+ */
85
+ withConverter: (arg0: CookieConverter) => CookieJar;
86
+ };
87
+ export type StorageCreator = (arg0: string) => {
88
+ session: Storage;
89
+ persistent: Storage;
90
+ };
91
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;GAOG;AAEH;;;;GAIG;AAEH;;;;;;;GAOG;AAEH;;GAEG;AAEH,uBAAwB;;aAjCV,CAAS,IAAM,EAAN,MAAM,KAAG,MAAM,GAAC,IAAI;aAC7B,CAAS,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,KAAG,IAAI;WAC9B,MAAY,IAAI;;;;;;cAKhB,MAAM,GAAC,IAAI;;;;WACX,MAAM;;;;aACN,MAAM;;;;aACN,OAAO;;;;eACP,QAAQ,GAAC,KAAK,GAAC,MAAM;;;;;;WAKrB,CAAS,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,KAAG,MAAM;;;;YAChC,CAAS,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,KAAG,MAAM;;;;;;SAKhC,CAAS,IAAM,EAAN,MAAM,KAAG,MAAM,GAAC,SAAS;;;;SAElC,CAAS,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,EAAE,IAAiB,EAAjB,gBAAgB,YAAC,KAAG,MAAM,GAAC,SAAS;;;;YAC7D,CAAS,IAAM,EAAN,MAAM,EAAE,IAAiB,EAAjB,gBAAgB,YAAC,KAAG,IAAI;;;;mBACzC,CAAS,IAAe,EAAf,eAAe,KAAG,SAAS;;6BAIrC,CAAS,IAAM,EAAN,MAAM,KAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE"}