@amplifyup/sdk 0.1.44 → 0.1.45

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/index.d.mts CHANGED
@@ -1,8 +1,8 @@
1
- import { P as PageConfig, C as ContentSource, A as AmplifyContentMeta, E as EventTrackingConfig$1, a as PageDataSnapshot, b as CDPAdapter, c as AmplifyUpConfig, d as EventProperties, e as AmplifyPageContextInput, f as AttachedPageEventContext, I as IdentifyInput, g as IdentifyTraits, h as ProfileFieldsInput, i as AmplifyUpTarget } from './types-BjlTE_cW.mjs';
2
- export { Z as ZoneConfig, k as isAmplifyUpTarget, n as normalizeAmplifyUpTarget, r as resolveAmplifyUpTarget, j as resolveAmplifyUpUrls } from './types-BjlTE_cW.mjs';
1
+ import { P as PageConfig, C as ContentSource, A as AmplifyContentMeta, E as EventTrackingConfig$1, a as PageDataSnapshot, b as CDPAdapter, c as AmplifyUpConfig, d as EventProperties, e as AmplifyPageContextInput, f as AttachedPageEventContext, I as IdentifyInput, g as IdentifyTraits, h as ProfileFieldsInput, i as AmplifyUpTarget } from './types-NdLzHxZo.mjs';
2
+ export { Z as ZoneConfig, k as isAmplifyUpTarget, n as normalizeAmplifyUpTarget, r as resolveAmplifyUpTarget, j as resolveAmplifyUpUrls } from './types-NdLzHxZo.mjs';
3
3
  export { i as isComposerPreview, a as isPreviewRequest, b as isWorkingContentRequest } from './preview-_vHmzRen.mjs';
4
4
  export { A as AMPLIFYUP_EDITOR_ROUTE, i as isAmplifyUpEditorRoute } from './reservedRoutes-aGgViBDM.mjs';
5
- export { g as FetchEdgeQueryOptions, F as FetchEdgeSelectOptions, Q as QueryContentError, e as QueryContentOptions, k as QueryFilter, l as QueryFilterOp, i as QueryPagination, h as QueryResult, m as QuerySort, j as QuerySpec, S as SelectVariantsError, a as SelectVariantsOptions, b as SelectVariantsResult, c as fetchEdgeQuery, f as fetchEdgeSelect, n as nextPageSpec, q as queryContent, d as searchSpec, s as selectVariants } from './query-DhyG93JN.mjs';
5
+ export { g as FetchEdgeQueryOptions, F as FetchEdgeSelectOptions, Q as QueryContentError, e as QueryContentOptions, k as QueryFilter, l as QueryFilterOp, i as QueryPagination, h as QueryResult, m as QuerySort, j as QuerySpec, S as SelectVariantsError, a as SelectVariantsOptions, b as SelectVariantsResult, c as fetchEdgeQuery, f as fetchEdgeSelect, n as nextPageSpec, q as queryContent, d as searchSpec, s as selectVariants } from './query-2-zPPrMI.mjs';
6
6
 
7
7
  /**
8
8
  * Storage utilities for instance ID and user ID
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { P as PageConfig, C as ContentSource, A as AmplifyContentMeta, E as EventTrackingConfig$1, a as PageDataSnapshot, b as CDPAdapter, c as AmplifyUpConfig, d as EventProperties, e as AmplifyPageContextInput, f as AttachedPageEventContext, I as IdentifyInput, g as IdentifyTraits, h as ProfileFieldsInput, i as AmplifyUpTarget } from './types-BjlTE_cW.js';
2
- export { Z as ZoneConfig, k as isAmplifyUpTarget, n as normalizeAmplifyUpTarget, r as resolveAmplifyUpTarget, j as resolveAmplifyUpUrls } from './types-BjlTE_cW.js';
1
+ import { P as PageConfig, C as ContentSource, A as AmplifyContentMeta, E as EventTrackingConfig$1, a as PageDataSnapshot, b as CDPAdapter, c as AmplifyUpConfig, d as EventProperties, e as AmplifyPageContextInput, f as AttachedPageEventContext, I as IdentifyInput, g as IdentifyTraits, h as ProfileFieldsInput, i as AmplifyUpTarget } from './types-NdLzHxZo.js';
2
+ export { Z as ZoneConfig, k as isAmplifyUpTarget, n as normalizeAmplifyUpTarget, r as resolveAmplifyUpTarget, j as resolveAmplifyUpUrls } from './types-NdLzHxZo.js';
3
3
  export { i as isComposerPreview, a as isPreviewRequest, b as isWorkingContentRequest } from './preview-_vHmzRen.js';
4
4
  export { A as AMPLIFYUP_EDITOR_ROUTE, i as isAmplifyUpEditorRoute } from './reservedRoutes-aGgViBDM.js';
5
- export { g as FetchEdgeQueryOptions, F as FetchEdgeSelectOptions, Q as QueryContentError, e as QueryContentOptions, k as QueryFilter, l as QueryFilterOp, i as QueryPagination, h as QueryResult, m as QuerySort, j as QuerySpec, S as SelectVariantsError, a as SelectVariantsOptions, b as SelectVariantsResult, c as fetchEdgeQuery, f as fetchEdgeSelect, n as nextPageSpec, q as queryContent, d as searchSpec, s as selectVariants } from './query-CMiGo_Kt.js';
5
+ export { g as FetchEdgeQueryOptions, F as FetchEdgeSelectOptions, Q as QueryContentError, e as QueryContentOptions, k as QueryFilter, l as QueryFilterOp, i as QueryPagination, h as QueryResult, m as QuerySort, j as QuerySpec, S as SelectVariantsError, a as SelectVariantsOptions, b as SelectVariantsResult, c as fetchEdgeQuery, f as fetchEdgeSelect, n as nextPageSpec, q as queryContent, d as searchSpec, s as selectVariants } from './query-CFpvzSZT.js';
6
6
 
7
7
  /**
8
8
  * Storage utilities for instance ID and user ID
package/dist/index.js CHANGED
@@ -455,14 +455,14 @@ function applyPageContext(input, opts) {
455
455
  log.warn("AmplifyUp: pageContext needs resourceType and key");
456
456
  return null;
457
457
  }
458
- const slot = opts.pageData?.slots?.[0];
459
- if (slot && slot.type && slot.type !== input.resourceType) {
458
+ const resource = opts.pageData?.resources?.[0];
459
+ if (resource && resource.type && resource.type !== input.resourceType) {
460
460
  log.warn(
461
- `AmplifyUp: pageContext resourceType "${input.resourceType}" does not match page slot "${slot.type}"`
461
+ `AmplifyUp: pageContext resourceType "${input.resourceType}" does not match page resource "${resource.type}"`
462
462
  );
463
463
  return null;
464
464
  }
465
- const fieldDefs = slot?.fields || [];
465
+ const fieldDefs = resource?.fields || [];
466
466
  const defByKey = new Map(fieldDefs.map((f) => [f.key, f]));
467
467
  const rawFields = input.fields && typeof input.fields === "object" ? input.fields : {};
468
468
  const fields = {};
@@ -480,7 +480,7 @@ function applyPageContext(input, opts) {
480
480
  }
481
481
  }
482
482
  const params = { ...opts.routeParams || {} };
483
- const mapping = slot?.urlParamMapping;
483
+ const mapping = resource?.urlParamMapping;
484
484
  let resourceKey = key;
485
485
  if (mapping) {
486
486
  const fromUrl = params[mapping.param];
@@ -498,7 +498,7 @@ function applyPageContext(input, opts) {
498
498
  if (pf.value !== void 0) pageFields[pf.key] = pf.value;
499
499
  continue;
500
500
  }
501
- if (pf.source === "mapped" && pf.slot && pf.field) {
501
+ if (pf.source === "mapped" && pf.resource && pf.field) {
502
502
  pageFields[pf.key] = fields[pf.field];
503
503
  }
504
504
  }
@@ -542,7 +542,7 @@ function mergeEventContext(properties, attached) {
542
542
  ...attached.pageRoute ? { pageRoute: attached.pageRoute } : {}
543
543
  };
544
544
  }
545
- function setPageSlotFields(fields) {
545
+ function setPageResourceFields(fields) {
546
546
  }
547
547
 
548
548
  // src/reservedRoutes.ts
@@ -1523,7 +1523,7 @@ var AmplifyUpSDK = class {
1523
1523
  routeParams: this.resolvedRouteParams,
1524
1524
  pageRoute: this.resolvedPageRoute
1525
1525
  });
1526
- setPageSlotFields(this.attachedPageContext?.resource?.fields || null);
1526
+ setPageResourceFields(this.attachedPageContext?.resource?.fields || null);
1527
1527
  }
1528
1528
  getAttachedPageContext() {
1529
1529
  return this.attachedPageContext;