@adobe/alloy 2.33.1 → 2.34.0-beta.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 (89) hide show
  1. package/dist/alloy.js +10 -14
  2. package/dist/alloy.min.js +1 -1
  3. package/dist/alloyServiceWorker.js +16 -18
  4. package/dist/alloyServiceWorker.min.js +1 -1
  5. package/dist/types/browser/src/components/ActivityCollector/configValidators.d.ts +1 -1
  6. package/dist/types/browser/src/components/ActivityCollector/createClickedElementProperties.d.ts +1 -1
  7. package/dist/types/browser/src/components/ActivityCollector/createGetClickedElementProperties.d.ts +1 -1
  8. package/dist/types/browser/src/components/Advertising/configValidators.d.ts +1 -1
  9. package/dist/types/browser/src/components/Advertising/handlers/clickThroughHandler.d.ts +5 -5
  10. package/dist/types/browser/src/components/Advertising/handlers/createOnBeforeSendEventHandler.d.ts +6 -6
  11. package/dist/types/browser/src/components/Advertising/identities/collectAllIdentities.d.ts +1 -1
  12. package/dist/types/browser/src/components/Advertising/identities/collectRampId.d.ts +2 -2
  13. package/dist/types/browser/src/components/Advertising/identities/collectSurferId.d.ts +1 -1
  14. package/dist/types/browser/src/components/Advertising/identities/createHashedIpHandler.d.ts +1 -1
  15. package/dist/types/browser/src/components/Advertising/identities/initiateAdvertisingIdentityCall.d.ts +3 -3
  16. package/dist/types/browser/src/components/Advertising/utils/helpers.d.ts +4 -4
  17. package/dist/types/browser/src/components/Context/index.d.ts +1 -1
  18. package/dist/types/browser/src/components/Personalization/createApplyPropositions.d.ts +2 -2
  19. package/dist/types/browser/src/components/Personalization/createComponent.d.ts +4 -4
  20. package/dist/types/browser/src/components/Personalization/createOnDecisionHandler.d.ts +1 -1
  21. package/dist/types/browser/src/components/Personalization/dom-actions/clicks/collectClicks.d.ts +1 -1
  22. package/dist/types/browser/src/components/Personalization/dom-actions/dom/getChildNodes.d.ts +1 -1
  23. package/dist/types/browser/src/components/Personalization/dom-actions/dom/getChildren.d.ts +1 -1
  24. package/dist/types/browser/src/components/Personalization/handlers/injectCreateProposition.d.ts +2 -2
  25. package/dist/types/browser/src/components/Personalization/in-app-message-actions/actions/displayIframeContent.d.ts +1 -1
  26. package/dist/types/browser/src/components/Personalization/index.d.ts +5 -5
  27. package/dist/types/browser/src/components/Personalization/utils/surfaceUtils.d.ts +1 -1
  28. package/dist/types/browser/src/components/Personalization/validateApplyPropositionsOptions.d.ts +1 -1
  29. package/dist/types/browser/src/components/PushNotifications/helpers/readFromIndexedDb.d.ts +1 -1
  30. package/dist/types/browser/src/components/PushNotifications/helpers/saveToIndexedDb.d.ts +1 -1
  31. package/dist/types/browser/src/components/PushNotifications/helpers/serviceWorkerNotificationClickListener.d.ts +1 -1
  32. package/dist/types/browser/src/components/PushNotifications/index.d.ts +1 -1
  33. package/dist/types/browser/src/components/PushNotifications/request/makeSendServiceWorkerTrackingData.d.ts +2 -2
  34. package/dist/types/browser/src/components/PushNotifications/types.d.ts +7 -7
  35. package/dist/types/browser/src/createEventListeners.d.ts +1 -1
  36. package/dist/types/browser/src/index.d.ts +3 -3
  37. package/dist/types/core/src/components/BrandConcierge/configValidators.d.ts +1 -1
  38. package/dist/types/core/src/components/BrandConcierge/createBuildEndpointUrl.d.ts +2 -1
  39. package/dist/types/core/src/components/BrandConcierge/createConversationServiceRequest.d.ts +2 -2
  40. package/dist/types/core/src/components/BrandConcierge/createSendConversationServiceRequest.d.ts +1 -1
  41. package/dist/types/core/src/components/BrandConcierge/createTimeoutWrapper.d.ts +1 -1
  42. package/dist/types/core/src/components/Consent/configValidators.d.ts +1 -1
  43. package/dist/types/core/src/components/Consent/parseConsentCookie.d.ts +1 -1
  44. package/dist/types/core/src/components/Identity/configValidators.d.ts +1 -1
  45. package/dist/types/core/src/components/MediaAnalyticsBridge/createMediaAnalyticsBridgeComponent.d.ts +1 -1
  46. package/dist/types/core/src/components/MediaAnalyticsBridge/index.d.ts +1 -1
  47. package/dist/types/core/src/components/RulesEngine/createApplyResponse.d.ts +2 -2
  48. package/dist/types/core/src/components/RulesEngine/createEventRegistry.d.ts +3 -3
  49. package/dist/types/core/src/components/RulesEngine/index.d.ts +4 -4
  50. package/dist/types/core/src/components/RulesEngine/types.d.ts +1 -1
  51. package/dist/types/core/src/components/RulesEngine/utils/generateEventHash.d.ts +1 -1
  52. package/dist/types/core/src/components/StreamingMedia/configValidators.d.ts +1 -1
  53. package/dist/types/core/src/components/StreamingMedia/createStreamingMediaComponent.d.ts +1 -1
  54. package/dist/types/core/src/components/StreamingMedia/createTrackMediaSession.d.ts +1 -1
  55. package/dist/types/core/src/components/StreamingMedia/index.d.ts +1 -1
  56. package/dist/types/core/src/core/consent/types.d.ts +2 -2
  57. package/dist/types/core/src/core/createEvent.d.ts +1 -1
  58. package/dist/types/core/src/core/createEventManager.d.ts +2 -2
  59. package/dist/types/core/src/core/createLogger.d.ts +3 -3
  60. package/dist/types/core/src/core/edgeNetwork/injectApplyResponse.d.ts +2 -2
  61. package/dist/types/core/src/core/edgeNetwork/injectSendEdgeNetworkRequest.d.ts +1 -1
  62. package/dist/types/core/src/core/edgeNetwork/types.d.ts +1 -1
  63. package/dist/types/core/src/core/injectCreateResponse.d.ts +1 -1
  64. package/dist/types/core/src/core/injectShouldTransferCookie.d.ts +1 -1
  65. package/dist/types/core/src/core/types.d.ts +27 -27
  66. package/dist/types/core/src/index.d.ts +7 -8
  67. package/dist/types/core/src/utils/bytes.d.ts +1 -1
  68. package/dist/types/core/src/utils/createCollect.d.ts +4 -4
  69. package/dist/types/core/src/utils/createSubscription.d.ts +1 -1
  70. package/dist/types/core/src/utils/deepAssign.d.ts +1 -1
  71. package/dist/types/core/src/utils/dom/loadScript.d.ts +1 -1
  72. package/dist/types/core/src/utils/dom/querySelectorAll.d.ts +1 -1
  73. package/dist/types/core/src/utils/dom/selectNodesWithShadow.d.ts +1 -1
  74. package/dist/types/core/src/utils/getApexDomain.d.ts +1 -1
  75. package/dist/types/core/src/utils/groupBy.d.ts +1 -1
  76. package/dist/types/core/src/utils/injectFireReferrerHideableImage.d.ts +4 -4
  77. package/dist/types/core/src/utils/injectStorage.d.ts +1 -1
  78. package/dist/types/core/src/utils/request/createRequest.d.ts +2 -2
  79. package/dist/types/core/src/utils/request/createRequestParams.d.ts +1 -1
  80. package/dist/types/core/src/utils/request/createRequestPayload.d.ts +1 -1
  81. package/dist/types/core/src/utils/sortObjectKeysRecursively.d.ts +1 -1
  82. package/dist/types/core/src/utils/surfaceUtils.d.ts +1 -1
  83. package/dist/types/core/src/utils/toArray.d.ts +1 -1
  84. package/dist/types/core/src/utils/types.d.ts +7 -7
  85. package/dist/types/core/src/utils/validateConfigOverride.d.ts +1 -1
  86. package/dist/types/core/src/utils/validateIdentityMap.d.ts +1 -1
  87. package/dist/types/core/src/utils/validation/index.d.ts +11 -11
  88. package/package.json +10 -10
  89. package/src/components/PushNotifications/helpers/serviceWorkerPushListener.js +16 -18
@@ -9,7 +9,7 @@ declare function createStreamingMedia({ config, logger, eventManager, sendEdgeNe
9
9
  lifecycle: {
10
10
  onBeforeEvent({ mediaOptions, onResponse }: {
11
11
  mediaOptions: any;
12
- onResponse?: () => void;
12
+ onResponse?: (() => void) | undefined;
13
13
  }): void;
14
14
  };
15
15
  commands: {
@@ -29,8 +29,8 @@ export type ConsentStateMachine = {
29
29
  };
30
30
  };
31
31
  export type ConsentManager = {
32
- initializeConsent: (arg0: any, arg1: any) => void;
33
- setConsent: (arg0: any) => void;
32
+ initializeConsent: (arg0: Object, arg1: Object) => void;
33
+ setConsent: (arg0: Object) => void;
34
34
  suspend: () => void;
35
35
  awaitConsent: () => Promise<void>;
36
36
  withConsent: () => Promise<void>;
@@ -1,5 +1,5 @@
1
1
  declare function _default(): {
2
- hasQuery(): any;
2
+ hasQuery(): boolean;
3
3
  getContent(): any;
4
4
  setUserXdm(value: any): void;
5
5
  setUserData(value: any): void;
@@ -23,8 +23,8 @@ declare function _default({ config, logger, lifecycle, consent, createEvent, cre
23
23
  * datastream to use.
24
24
  * @returns {*}
25
25
  */
26
- sendEvent(event: any, options?: {
27
- edgeConfigOverrides?: any;
26
+ sendEvent(event: Object, options?: {
27
+ edgeConfigOverrides?: Object | undefined;
28
28
  }): any;
29
29
  applyResponse(event: any, options?: {}): any;
30
30
  };
@@ -21,16 +21,16 @@ declare function _default({ getDebugEnabled, console, getMonitors, context }: {
21
21
  * in the web console's log.
22
22
  * @param {...*} arg Any argument to be logged.
23
23
  */
24
- info: any;
24
+ info: (...args: any[]) => void;
25
25
  /**
26
26
  * Outputs a warning message to the web console.
27
27
  * @param {...*} arg Any argument to be logged.
28
28
  */
29
- warn: any;
29
+ warn: (...args: any[]) => void;
30
30
  /**
31
31
  * Outputs an error message to the web console.
32
32
  * @param {...*} arg Any argument to be logged.
33
33
  */
34
- error: any;
34
+ error: (...args: any[]) => void;
35
35
  };
36
36
  export default _default;
@@ -7,7 +7,7 @@ declare function _default({ cookieTransfer, lifecycle, createResponse, processWa
7
7
  request: any;
8
8
  responseHeaders: any;
9
9
  responseBody: any;
10
- runOnResponseCallbacks?: () => void;
11
- runOnRequestFailureCallbacks?: () => void;
10
+ runOnResponseCallbacks?: (() => void) | undefined;
11
+ runOnRequestFailureCallbacks?: (() => void) | undefined;
12
12
  }) => any;
13
13
  export default _default;
@@ -6,7 +6,7 @@ declare function _default({ config, lifecycle, cookieTransfer, sendNetworkReques
6
6
  };
7
7
  lifecycle: object;
8
8
  cookieTransfer: object;
9
- sendNetworkRequest: (arg0: object) => Promise<any>;
9
+ sendNetworkRequest: (arg0: object) => Promise<Object>;
10
10
  createResponse: ResponseCreator;
11
11
  processWarningsAndErrors: (arg0: object) => void;
12
12
  getLocationHint: () => string | undefined;
@@ -7,5 +7,5 @@ export type EdgeRequestExecutor = (arg0: {
7
7
  request: Request;
8
8
  runOnResponseCallbacks?: () => void;
9
9
  runOnRequestFailureCallbacks?: () => void;
10
- }) => Promise<any>;
10
+ }) => Promise<Object>;
11
11
  import type { Request } from '../../utils/request/types.js';
@@ -1,5 +1,5 @@
1
1
  declare function _default({ extractEdgeInfo }: {
2
- extractEdgeInfo: (arg0: string) => any;
2
+ extractEdgeInfo: (arg0: string) => Object;
3
3
  }): ResponseCreator;
4
4
  export default _default;
5
5
  import type { ResponseCreator } from './types.js';
@@ -1,5 +1,5 @@
1
1
  declare function _default({ orgId, targetMigrationEnabled }: {
2
2
  orgId: any;
3
3
  targetMigrationEnabled: any;
4
- }): (name: any) => boolean;
4
+ }): (name: any) => any;
5
5
  export default _default;
@@ -95,17 +95,17 @@ configuration
95
95
  */
96
96
  export const Types: {};
97
97
  export type AlloyMonitor = {
98
- onBeforeLog?: (arg0: any) => void;
99
- onInstanceCreated?: (arg0: any) => void;
100
- onInstanceConfigured?: (arg0: any) => void;
101
- onBeforeCommand?: (arg0: any) => void;
102
- onCommandResolved?: (arg0: any) => void;
103
- onCommandRejected?: (arg0: any) => void;
104
- onBeforeNetworkRequest?: (arg0: any) => void;
105
- onNetworkResponse?: (arg0: any) => void;
106
- onNetworkError?: (arg0: any) => void;
107
- onContentHiding?: (arg0: any) => void;
108
- onContentRendering?: (arg0: any) => void;
98
+ onBeforeLog?: ((arg0: any) => void) | undefined;
99
+ onInstanceCreated?: ((arg0: any) => void) | undefined;
100
+ onInstanceConfigured?: ((arg0: any) => void) | undefined;
101
+ onBeforeCommand?: ((arg0: any) => void) | undefined;
102
+ onCommandResolved?: ((arg0: any) => void) | undefined;
103
+ onCommandRejected?: ((arg0: any) => void) | undefined;
104
+ onBeforeNetworkRequest?: ((arg0: any) => void) | undefined;
105
+ onNetworkResponse?: ((arg0: any) => void) | undefined;
106
+ onNetworkError?: ((arg0: any) => void) | undefined;
107
+ onContentHiding?: ((arg0: any) => void) | undefined;
108
+ onContentRendering?: ((arg0: any) => void) | undefined;
109
109
  };
110
110
  export type Logger = {
111
111
  enabled: boolean;
@@ -144,19 +144,19 @@ export type SendEventOptions = {
144
144
  /**
145
145
  * configuration
146
146
  */
147
- edgeConfigOverrides?: object;
148
- renderDecisions?: boolean;
149
- decisionScopes?: string[];
150
- decisionContext?: object;
151
- personalization?: object;
152
- mediaOptions?: object;
147
+ edgeConfigOverrides?: object | undefined;
148
+ renderDecisions?: boolean | undefined;
149
+ decisionScopes?: string[] | undefined;
150
+ decisionContext?: object | undefined;
151
+ personalization?: object | undefined;
152
+ mediaOptions?: object | undefined;
153
153
  };
154
154
  export type ApplyResponseOptions = {
155
- renderDecisions?: boolean;
156
- decisionContext?: object;
157
- responseHeaders?: object;
158
- responseBody?: object;
159
- personalization?: object;
155
+ renderDecisions?: boolean | undefined;
156
+ decisionContext?: object | undefined;
157
+ responseHeaders?: object | undefined;
158
+ responseBody?: object | undefined;
159
+ personalization?: object | undefined;
160
160
  };
161
161
  export type EventManager = {
162
162
  createEvent: () => Event;
@@ -167,18 +167,18 @@ export type ResponseContent = {
167
167
  /**
168
168
  * - Array of response fragments with type and payload
169
169
  */
170
- handle?: Array<{
170
+ handle?: {
171
171
  type: string;
172
- payload: Array<any>;
173
- }>;
172
+ payload: Array<Object>;
173
+ }[] | undefined;
174
174
  /**
175
175
  * - Array of error objects
176
176
  */
177
- errors?: Array<object>;
177
+ errors?: object[] | undefined;
178
178
  /**
179
179
  * - Array of warning objects
180
180
  */
181
- warnings?: Array<object>;
181
+ warnings?: object[] | undefined;
182
182
  };
183
183
  export type ResponseFragment = {
184
184
  /**
@@ -1,10 +1,9 @@
1
1
  export function createCustomInstance(options?: {
2
- name?: string;
3
- monitors?: Array<AlloyMonitor>;
4
- components?: Array<Function>;
5
- }): (commandName: string, options?: any) => Promise<any>;
2
+ name?: string | undefined;
3
+ monitors?: import("./core/types.js").AlloyMonitor[] | undefined;
4
+ components?: Function[] | undefined;
5
+ }): (commandName: string, options?: Object) => Promise<any>;
6
6
  export function createInstance(options?: {
7
- name?: string;
8
- monitors?: Array<AlloyMonitor>;
9
- }): (commandName: string, options?: any) => Promise<any>;
10
- import type { AlloyMonitor } from './types.js';
7
+ name?: string | undefined;
8
+ monitors?: import("./core/types.js").AlloyMonitor[] | undefined;
9
+ }): (commandName: string, options?: Object) => Promise<any>;
@@ -1,4 +1,4 @@
1
1
  export function base64ToBytes(base64String: string): Uint8Array;
2
2
  export function bytesToBase64(bytes: Uint8Array, options?: {
3
- urlSafe?: boolean;
3
+ urlSafe?: boolean | undefined;
4
4
  }): string;
@@ -2,11 +2,11 @@ declare function _default({ eventManager, mergeDecisionsMeta }: {
2
2
  eventManager: any;
3
3
  mergeDecisionsMeta: any;
4
4
  }): ({ decisionsMeta, propositionAction, documentMayUnload, eventType, propositionEventTypes, viewName, identityMap, }: {
5
- decisionsMeta?: any[];
5
+ decisionsMeta?: never[] | undefined;
6
6
  propositionAction: any;
7
- documentMayUnload?: boolean;
8
- eventType?: string;
9
- propositionEventTypes?: any[];
7
+ documentMayUnload?: boolean | undefined;
8
+ eventType?: string | undefined;
9
+ propositionEventTypes?: any[] | undefined;
10
10
  viewName: any;
11
11
  identityMap: any;
12
12
  }) => any;
@@ -1,6 +1,6 @@
1
1
  export default createSubscription;
2
2
  declare function createSubscription(): {
3
- add: (callback: any, params?: any) => (() => any) | {
3
+ add: (callback: any, params?: undefined) => (() => undefined) | {
4
4
  id: number;
5
5
  unsubscribe: () => void;
6
6
  };
@@ -1,2 +1,2 @@
1
- declare function _default(target: any, ...sources: any[]): any;
1
+ declare function _default(target: Object, ...sources: any[]): any;
2
2
  export default _default;
@@ -10,7 +10,7 @@ export default loadScript;
10
10
  * @returns {Promise<void>} A promise that resolves when the script is loaded or rejects on error.
11
11
  */
12
12
  declare function loadScript(url: string, options?: {
13
- attributes: any;
13
+ attributes: Object;
14
14
  onLoad: Function;
15
15
  onError: Function;
16
16
  }): Promise<void>;
@@ -1,2 +1,2 @@
1
- declare function _default(context: any, selector: any): any;
1
+ declare function _default(context: any, selector: any): any[];
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare function _default(context: any, selector: any): any;
1
+ declare function _default(context: any, selector: any): any[] | undefined;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare function _default(window: any, cookieJar: any): string;
1
+ declare function _default(window: Object, cookieJar: Object): string;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare function _default(arr: any[], keyGetter: Function): any;
1
+ declare function _default(arr: any[], keyGetter: Function): Object;
2
2
  export default _default;
@@ -1,7 +1,7 @@
1
1
  declare function _default({ appendNode, awaitSelector, createNode, fireImage, }?: {
2
- appendNode?: (parent: any, node: any) => any;
3
- awaitSelector?: (selector: any, selectFunc?: (selector: string, context?: Node) => any[], timeout?: number, win?: Window & typeof globalThis, doc?: Document) => Promise<any>;
4
- createNode?: (tag: any, attrs?: {}, props?: {}, children?: any[], doc?: Document) => any;
5
- fireImage?: ({ src, currentDocument }: object) => Promise<any>;
2
+ appendNode?: ((parent: any, node: any) => any) | undefined;
3
+ awaitSelector?: ((selector: any, selectFunc?: (selector: string, context?: Node) => any[], timeout?: number, win?: Window & typeof globalThis, doc?: Document) => Promise<any>) | undefined;
4
+ createNode?: ((tag: any, attrs?: {}, props?: {}, children?: any[], doc?: Document) => any) | undefined;
5
+ fireImage?: (({ src, currentDocument }: object) => Promise<any>) | undefined;
6
6
  }): (request: any) => Promise<any>;
7
7
  export default _default;
@@ -1,3 +1,3 @@
1
- declare function _default(context: any): StorageCreator;
1
+ declare function _default(context: Object): StorageCreator;
2
2
  export default _default;
3
3
  import type { StorageCreator } from './types.js';
@@ -6,8 +6,8 @@ declare function _default(options: {
6
6
  getUseSendBeacon: (arg0: {
7
7
  isIdentityEstablished: boolean;
8
8
  }) => boolean;
9
- datastreamIdOverride?: string;
10
- edgeSubPath?: string;
9
+ datastreamIdOverride?: string | undefined;
10
+ edgeSubPath?: string | undefined;
11
11
  }): Request;
12
12
  export default _default;
13
13
  import type { RequestPayload } from './types.js';
@@ -9,7 +9,7 @@ declare function _default({ localConfigOverrides, globalConfigOverrides, payload
9
9
  export default _default;
10
10
  export type Override = {
11
11
  datastreamId: string;
12
- [k: string]: any;
12
+ [k: string]: Object;
13
13
  };
14
14
  export type RequestPayload = {
15
15
  mergeConfigOverride: (arg0: Override) => void;
@@ -1,5 +1,5 @@
1
1
  declare function _default(options: {
2
- content: any;
2
+ content: Object;
3
3
  addIdentity: (arg0: string, arg1: Identity) => void;
4
4
  hasIdentity: (arg0: string) => boolean;
5
5
  }): RequestPayload;
@@ -1,2 +1,2 @@
1
- declare function _default(data: any | any[]): any | any[];
1
+ declare function _default(data: Object | any[]): Object | any[];
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  export function buildPageSurface(getPageLocation: any): string;
2
2
  export function isPageWideSurface(scope: any): boolean;
3
- export function normalizeSurfaces(surfaces: any[], getPageLocation: any, logger: any): string[];
3
+ export function normalizeSurfaces(surfaces: any[] | undefined, getPageLocation: any, logger: any): string[];
@@ -1,2 +1,2 @@
1
- declare function _default(value: any): any;
1
+ declare function _default(value: any): any[];
2
2
  export default _default;
@@ -38,33 +38,33 @@ export type CookieAttributes = {
38
38
  /**
39
39
  * - Cookie expiration (number of days or Date object)
40
40
  */
41
- expires?: number | Date;
41
+ expires?: number | Date | undefined;
42
42
  /**
43
43
  * - Cookie path (default: "/")
44
44
  */
45
- path?: string;
45
+ path?: string | undefined;
46
46
  /**
47
47
  * - Cookie domain
48
48
  */
49
- domain?: string;
49
+ domain?: string | undefined;
50
50
  /**
51
51
  * - Requires HTTPS transmission
52
52
  */
53
- secure?: boolean;
53
+ secure?: boolean | undefined;
54
54
  /**
55
55
  * - SameSite attribute
56
56
  */
57
- sameSite?: "strict" | "lax" | "none";
57
+ sameSite?: "strict" | "lax" | "none" | undefined;
58
58
  };
59
59
  export type CookieConverter = {
60
60
  /**
61
61
  * - Custom decoder function
62
62
  */
63
- read?: (arg0: string, arg1: string) => string;
63
+ read?: ((arg0: string, arg1: string) => string) | undefined;
64
64
  /**
65
65
  * - Custom encoder function
66
66
  */
67
- write?: (arg0: string, arg1: string) => string;
67
+ write?: ((arg0: string, arg1: string) => string) | undefined;
68
68
  };
69
69
  export type CookieJar = {
70
70
  /**
@@ -1,2 +1,2 @@
1
- declare const _default: any;
1
+ declare const _default: Function;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: any;
1
+ declare const _default: Function;
2
2
  export default _default;
@@ -1,12 +1,12 @@
1
- declare const boundAnyOf: any;
2
- declare const boundAnything: any;
3
- declare const boundArrayOf: any;
4
- declare const boundBoolean: any;
5
- declare const boundCallback: any;
6
- declare const boundLiteral: any;
7
- declare const boundNumber: any;
8
- declare const boundMapOfValues: any;
9
- declare const boundObjectOf: any;
10
- declare const boundString: any;
11
- declare function boundEnumOf(...values: any[]): any;
1
+ declare function boundAnyOf(validators: any, message: any): Function;
2
+ declare function boundAnything(): any;
3
+ declare function boundArrayOf(elementValidator: any): Function;
4
+ declare function boundBoolean(): Function;
5
+ declare function boundCallback(): Function;
6
+ declare function boundLiteral(literalValue: any): Function;
7
+ declare function boundNumber(): Function;
8
+ declare function boundMapOfValues(valuesValidator: any): Function;
9
+ declare function boundObjectOf(schema: any): Function;
10
+ declare function boundString(): Function;
11
+ declare function boundEnumOf(...values: any[]): Function;
12
12
  export { boundAnyOf as anyOf, boundAnything as anything, boundArrayOf as arrayOf, boundBoolean as boolean, boundCallback as callback, boundLiteral as literal, boundNumber as number, boundMapOfValues as mapOfValues, boundObjectOf as objectOf, boundString as string, boundEnumOf as enumOf };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/alloy",
3
- "version": "2.33.1",
3
+ "version": "2.34.0-beta.0",
4
4
  "description": "Adobe Experience Platform Web SDK",
5
5
  "type": "module",
6
6
  "repository": {
@@ -61,24 +61,24 @@
61
61
  },
62
62
  "dependencies": {
63
63
  "@inquirer/prompts": "^7.9.0",
64
- "@rollup/plugin-commonjs": "^29.0.0",
64
+ "@rollup/plugin-commonjs": "^29.0.2",
65
65
  "@rollup/plugin-node-resolve": "^16.0.3",
66
66
  "@rollup/plugin-replace": "^6.0.0",
67
- "@rollup/plugin-terser": "^0.4.4",
67
+ "@rollup/plugin-terser": "^1.0.0",
68
68
  "commander": "^14.0.2",
69
- "rollup": "^4.52.5",
70
- "rollup-plugin-license": "^3.6.0",
71
- "@adobe/alloy-core": "^1.1.2"
69
+ "rollup": "^4.60.3",
70
+ "rollup-plugin-license": "^3.7.1",
71
+ "@adobe/alloy-core": "^1.2.0-beta.0"
72
72
  },
73
73
  "devDependencies": {
74
- "glob": "^11.0.3",
75
- "msw": "^2.11.6",
74
+ "glob": "^13.0.6",
75
+ "msw": "^2.14.3",
76
76
  "read-cache": "^1.0.0",
77
77
  "rimraf": "^6.1.0",
78
- "testcafe": "^3.7.2",
78
+ "testcafe": "^3.7.4",
79
79
  "testcafe-browser-provider-playwright": "^1.1.0",
80
80
  "uuid": "^14.0.0",
81
- "vitest": "^4.0.6"
81
+ "vitest": "^4.1.5"
82
82
  },
83
83
  "scripts": {
84
84
  "clean": "rimraf dist distTest",
@@ -45,28 +45,26 @@ export default async ({ sw, event, logger }) => {
45
45
  return;
46
46
  }
47
47
 
48
+ /** @type {Record<string, unknown>} */
48
49
  const notificationOptions = {
49
- body: webData.body,
50
- icon: webData.media,
51
- image: webData.media,
52
50
  data: webData,
53
- actions: [],
54
- };
55
-
56
- Object.keys(notificationOptions).forEach((k) => {
57
- if (notificationOptions[k] == null) {
58
- delete notificationOptions[k];
59
- }
60
- });
61
-
62
- if (webData.actions && webData.actions.buttons) {
63
- notificationOptions.actions = webData.actions.buttons.map(
64
- (button, index) => ({
51
+ actions:
52
+ webData.actions?.buttons?.map((button, index) => ({
65
53
  action: `action_${index}`,
66
54
  title: button.label,
67
- }),
68
- );
55
+ })) ?? [],
56
+ };
57
+
58
+ if (webData.body != null) {
59
+ notificationOptions.body = webData.body;
60
+ }
61
+ if (webData.media != null) {
62
+ notificationOptions.icon = webData.media;
63
+ notificationOptions.image = webData.media;
69
64
  }
70
65
 
71
- return sw.registration.showNotification(webData.title, notificationOptions);
66
+ return sw.registration.showNotification(
67
+ webData.title,
68
+ /** @type {NotificationOptions} */ (notificationOptions),
69
+ );
72
70
  };