@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 CHANGED
@@ -6377,6 +6377,10 @@
6377
6377
  if (localTimezoneOffset === undefined || Math.abs(localTimezoneOffset) < 6000) {
6378
6378
  placeContext.localTime = toISOStringLocal(date);
6379
6379
  }
6380
+ const ianaTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
6381
+ if (ianaTimezone) {
6382
+ placeContext.ianaTimezone = ianaTimezone;
6383
+ }
6380
6384
  event.mergeXdm({
6381
6385
  placeContext
6382
6386
  });
@@ -6433,7 +6437,7 @@
6433
6437
  // The __VERSION__ keyword will be replace at alloy build time with the package.json version.
6434
6438
  // see babel-plugin-version
6435
6439
 
6436
- var libraryVersion = "2.31.2-beta.0";
6440
+ var libraryVersion = "2.31.2-beta.2";
6437
6441
 
6438
6442
  /*
6439
6443
  Copyright 2019 Adobe. All rights reserved.
@@ -19248,7 +19252,8 @@
19248
19252
  }) => {
19249
19253
  const brandConciergeEventValidator = boundAnyOf([boundObjectOf({
19250
19254
  message: boundString().required(),
19251
- onStreamResponse: boundCallback().default(noop)
19255
+ onStreamResponse: boundCallback().default(noop),
19256
+ voiceEnabled: boundBoolean().default(false)
19252
19257
  }), boundObjectOf({
19253
19258
  xdm: boundObjectOf({
19254
19259
  interactionId: boundString(),
@@ -19260,13 +19265,15 @@
19260
19265
  reasons: boundArrayOf(boundString())
19261
19266
  })
19262
19267
  })
19263
- })
19268
+ }),
19269
+ voiceEnabled: boundBoolean().default(false)
19264
19270
  }).required(), boundObjectOf({
19265
19271
  data: boundObjectOf({
19266
19272
  type: boundString().required(),
19267
19273
  payload: boundObjectOf({})
19268
19274
  }).required(),
19269
- onStreamResponse: boundCallback().default(noop)
19275
+ onStreamResponse: boundCallback().default(noop),
19276
+ voiceEnabled: boundBoolean().default(false)
19270
19277
  })]);
19271
19278
  return brandConciergeEventValidator(options);
19272
19279
  };
@@ -19282,14 +19289,18 @@
19282
19289
  OF ANY KIND, either express or implied. See the License for the specific language
19283
19290
  governing permissions and limitations under the License.
19284
19291
  */
19292
+ const BRAND_CONCIERGE_PATH = "/brand-concierge";
19293
+ const VOICE_BRAND_CONCIERGE_PATH = "/brand-concierge-voice";
19285
19294
  var createConversationServiceRequest = ({
19286
19295
  payload,
19287
19296
  action = "conversations",
19288
- sessionId
19297
+ sessionId,
19298
+ voiceEnabled = false
19289
19299
  }) => {
19300
+ const edgeSubPath = voiceEnabled ? VOICE_BRAND_CONCIERGE_PATH : BRAND_CONCIERGE_PATH;
19290
19301
  return createRequest({
19291
19302
  payload: payload,
19292
- edgeSubPath: "/brand-concierge",
19303
+ edgeSubPath,
19293
19304
  requestParams: {
19294
19305
  sessionId
19295
19306
  },
@@ -19315,6 +19326,7 @@
19315
19326
  */
19316
19327
  const BC_SESSION_COOKIE_NAME = "bc_session_id";
19317
19328
  const STREAM_START_TIMEOUT_MS = 10000;
19329
+ const SOURCES_QUERY_PARAM = "adobe_brand_concierge_source";
19318
19330
 
19319
19331
  /*
19320
19332
  Copyright 2025 Adobe. All rights reserved.
@@ -19601,12 +19613,14 @@
19601
19613
  message,
19602
19614
  onStreamResponse,
19603
19615
  xdm,
19604
- data
19616
+ data,
19617
+ voiceEnabled = false
19605
19618
  } = options;
19606
19619
  const payload = createDataCollectionRequestPayload();
19607
19620
  const request = createConversationServiceRequest({
19608
19621
  payload,
19609
- sessionId: session.id
19622
+ sessionId: session.id,
19623
+ voiceEnabled
19610
19624
  });
19611
19625
  const event = eventManager.createEvent();
19612
19626
  if (message || data) {
@@ -19827,10 +19841,12 @@
19827
19841
  var configValidators = boundObjectOf({
19828
19842
  conversation: boundObjectOf({
19829
19843
  stickyConversationSession: boundBoolean().default(false),
19830
- streamTimeout: boundNumber().integer().minimum(STREAM_START_TIMEOUT_MS).default(STREAM_START_TIMEOUT_MS)
19844
+ streamTimeout: boundNumber().integer().minimum(STREAM_START_TIMEOUT_MS).default(STREAM_START_TIMEOUT_MS),
19845
+ collectSources: boundBoolean().default(false)
19831
19846
  }).default({
19832
19847
  stickyConversationSession: false,
19833
- streamTimeout: STREAM_START_TIMEOUT_MS
19848
+ streamTimeout: STREAM_START_TIMEOUT_MS,
19849
+ collectSources: false
19834
19850
  })
19835
19851
  });
19836
19852
 
@@ -19897,14 +19913,16 @@
19897
19913
  onBeforeEvent({
19898
19914
  event
19899
19915
  }) {
19900
- const parsedParams = queryString.parse(window.location.search);
19901
- if (parsedParams.source) {
19902
- const source = parsedParams.source;
19903
- event.mergeXdm({
19904
- channel: {
19905
- referringSource: source
19906
- }
19907
- });
19916
+ if (config.conversation.collectSources) {
19917
+ const parsedParams = queryString.parse(window.location.search);
19918
+ const source = parsedParams[SOURCES_QUERY_PARAM];
19919
+ if (source) {
19920
+ event.mergeXdm({
19921
+ channel: {
19922
+ referringSource: source
19923
+ }
19924
+ });
19925
+ }
19908
19926
  }
19909
19927
  }
19910
19928
  },