DINT-1889: update ACDL version#204
Conversation
| integrity sha512-Ah0MoI+RF84G3QCjV8SF0kvPjGCkKhU/tWEe2TpTq/5nuxQy89215A6oOm4WuLv1tIV2kQ4PJooL+0LgcjUb9w== | ||
| "@adobe/adobe-client-data-layer@^3.0.1": | ||
| version "3.0.1" | ||
| resolved "https://artifactory.corp.adobe.com/artifactory/api/npm/npm-adobe-platform-release/@adobe/adobe-client-data-layer/-/adobe-client-data-layer-3.0.1.tgz#1dafc6b5a674028dafd0d21437d06c3f92045538" |
There was a problem hiding this comment.
This might be the reason its having cert issue...https://artifactory.corp.adobe.com is not accessible outside Adobe network.
Is it possible to get this package from https://registry.npmjs.org or https://artifactory-uw2.adobeitc.com/artifactory/api/npm/?
There was a problem hiding this comment.
I've approved but I think it's better if we define some types for adobeDataLayer instead of using any. I asked claude to come up with the types from the package and this is what it spat out. We could stick these somewhere for now:
// Type definitions for @adobe/adobe-client-data-layer
// Project: https://github.com/adobe/adobe-client-data-layer
// Definitions by: Graham Rogers <https://github.com/grahamcrackers>
export interface DataLayerConfig {
dataLayer?: AdobeDataLayer;
}
export type DataLayerEventType =
| "adobeDataLayer:change"
| "adobeDataLayer:event"
| "adobeDataLayer:reset"
| string; // custom events
export interface DataLayerEvent {
type: DataLayerEventType;
data?: Record<string, unknown>;
timestamp?: string;
id?: string;
}
export interface EventListenerOptions {
path?: string; // only fire when this path in state changes
scope?: "past" | "future" | "all"; // default: "future"
}
export type DataLayerEventHandler = (event: DataLayerEvent) => void;
export interface AdobeDataLayer extends Array<Record<string, unknown>> {
push(...items: Array<Record<string, unknown> | DataLayerEvent>): number;
getState(): Record<string, unknown>;
getState(key: string): unknown;
addEventListener(
type: DataLayerEventType,
handler: DataLayerEventHandler,
options?: EventListenerOptions
): void;
removeEventListener(
type: DataLayerEventType,
handler?: DataLayerEventHandler
): void;
}
declare global {
interface Window {
adobeDataLayer: AdobeDataLayer;
adobeDataLayerInPage?: AdobeDataLayer;
}
}| "source.fixAll.eslint": "explicit" | ||
| } | ||
| }, | ||
| "js/ts.tsdk.path": "node_modules/typescript/lib" |
There was a problem hiding this comment.
is this really needed? seems like this should be kept to the user settings level
| return JSON.parse(JSON.stringify(val)); | ||
| }); | ||
|
|
||
| (window as any).magentoStorefrontEvents = mse; |
There was a problem hiding this comment.
i thought we had some types for magentoStorefrontEvents, but i'd add
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Description
Update ACDL version, and add alias to appropriately map new export
Related Issue
https://jira.corp.adobe.com/browse/DINT-1889
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist