@orangelogic/orange-dam-content-browser-sdk 2.4.11 → 2.4.12

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.
@@ -37,7 +37,7 @@ export declare function resolveAssetExtraFilters(selectedFacets?: Record<string,
37
37
  SubtypeCriteria?: string[];
38
38
  FacetFilters?: Record<string, string[]>;
39
39
  };
40
- export declare function apiGetAssetLinks({ assets, extension, extraFields, parameters, permanentLink, proxyPreference, transformations, useSession, }: GetAssetLinksRequest): Promise<GetAssetLinksResponse>;
40
+ export declare function apiGetAssetLinks({ assets, extension, extraFields, parameters, permanentLink, proxyPreference, skipLinkGeneration, transformations, useSession, }: GetAssetLinksRequest): Promise<GetAssetLinksResponse>;
41
41
  export declare function apiGetAssetsByIDs({ extraFields, recordIds, }: GetAssetsByIDsRequest): Promise<GetAssetsByIDsResponse>;
42
42
  export declare const ASSET_LIST_FIELDS: string[];
43
43
  export declare function apiGetAssets({ fields, folderId, isSeeThrough, limitedToDocTypes, pageSize, searchText, selectedFacets, sortOrder, start, titleFallback, useSession, }: GetAssetsRequest): Promise<GetAssetsResponse>;
@@ -120,6 +120,11 @@ export type GetAssetLinksRequest = {
120
120
  parameters?: TrackingParameter[];
121
121
  permanentLink?: string;
122
122
  proxyPreference?: string;
123
+ /**
124
+ * Ask Cortex for the asset metadata and ExtraFields only (GenerateAssetUrl=false), so no asset link is
125
+ * created. Each item's imageUrl is then the grid preview URL the asset already carries.
126
+ */
127
+ skipLinkGeneration?: boolean;
123
128
  token?: string;
124
129
  transformations?: Transformation[];
125
130
  useRepresentative?: boolean;
@@ -74,6 +74,12 @@ export default class CxContentBrowser extends CortexElement {
74
74
  * Implies `can-use-proxies=false`.
75
75
  */
76
76
  simplePick: boolean;
77
+ /**
78
+ * Confirm asks GetAssetLink for the asset metadata and extra fields only, so Cortex creates no asset link.
79
+ * For a host that needs fields such as `Document.RecordID`, not a URL: a link can be refused for a user
80
+ * who can still read the asset.
81
+ */
82
+ skipLinkGeneration: boolean;
77
83
  canViewVersions: boolean;
78
84
  canTrack: boolean;
79
85
  canLogout: boolean;
@@ -14657,6 +14657,7 @@ function apiGetAssetLinks(_0) {
14657
14657
  parameters,
14658
14658
  permanentLink,
14659
14659
  proxyPreference,
14660
+ skipLinkGeneration,
14660
14661
  transformations,
14661
14662
  useSession
14662
14663
  }) {
@@ -14667,8 +14668,9 @@ function apiGetAssetLinks(_0) {
14667
14668
  const origin2 = (_a2 = http.defaults.baseURL) != null ? _a2 : window.location.origin;
14668
14669
  try {
14669
14670
  const settled = yield Promise.allSettled(assets.map((asset) => __async(null, null, function* () {
14671
+ var _a3;
14670
14672
  const requestBody = {
14671
- GenerateAssetUrl: !permanentLink,
14673
+ GenerateAssetUrl: !permanentLink && !skipLinkGeneration,
14672
14674
  Parameters: parameters,
14673
14675
  Proxy: proxyPreference,
14674
14676
  RecordId: asset.recordId
@@ -14722,6 +14724,11 @@ function apiGetAssetLinks(_0) {
14722
14724
  imageUrl: asset.imageUrl
14723
14725
  };
14724
14726
  }
14727
+ if (skipLinkGeneration) {
14728
+ return __spreadProps(__spreadValues({}, rawResponse), {
14729
+ imageUrl: (_a3 = asset.imageUrl) != null ? _a3 : ""
14730
+ });
14731
+ }
14725
14732
  const imageUrl = buildAssetLinkImageUrl({
14726
14733
  asset,
14727
14734
  extension,
@@ -16422,6 +16429,7 @@ let CxContentBrowser = class extends CortexElement {
16422
16429
  this.canUseProxies = false;
16423
16430
  this.autoSelectFormat = false;
16424
16431
  this.simplePick = false;
16432
+ this.skipLinkGeneration = false;
16425
16433
  this.canViewVersions = false;
16426
16434
  this.canTrack = false;
16427
16435
  this.canLogout = false;
@@ -16926,7 +16934,8 @@ let CxContentBrowser = class extends CortexElement {
16926
16934
  try {
16927
16935
  const response = yield this.fetchAndMergeAssetsController.getAssetLink(__spreadProps(__spreadValues({}, event.detail), {
16928
16936
  assets: [event.detail.asset],
16929
- extraFields: this.extraFields
16937
+ extraFields: this.extraFields,
16938
+ skipLinkGeneration: this.skipLinkGeneration
16930
16939
  }));
16931
16940
  if (response.isError) {
16932
16941
  this.reportProxyConfirmFailure();
@@ -17333,6 +17342,9 @@ __decorateClass([
17333
17342
  __decorateClass([
17334
17343
  n$6({ attribute: "simple-pick", reflect: true, type: Boolean })
17335
17344
  ], CxContentBrowser.prototype, "simplePick", 2);
17345
+ __decorateClass([
17346
+ n$6({ attribute: "skip-link-generation", reflect: true, type: Boolean })
17347
+ ], CxContentBrowser.prototype, "skipLinkGeneration", 2);
17336
17348
  __decorateClass([
17337
17349
  n$6({ attribute: "can-view-versions", reflect: true, type: Boolean })
17338
17350
  ], CxContentBrowser.prototype, "canViewVersions", 2);
package/build/index.d.ts CHANGED
@@ -188,6 +188,13 @@ type OrangeDAMContentBrowser = {
188
188
  * (`ScrubUrl`, `AllowATSLink`) can be returned in this mode.
189
189
  */
190
190
  simplePick?: boolean;
191
+ /**
192
+ * Confirm returns the asset metadata and the requested `extraFields` without creating an asset link.
193
+ * Use it when the host needs fields such as `Document.RecordID`, not a URL: Cortex can refuse a link
194
+ * (for example a CDN permanent link) to a user who can still read the asset. Each selected item's
195
+ * `imageUrl` is then the preview URL of the grid. Default `false`.
196
+ */
197
+ skipLinkGeneration?: boolean;
191
198
  /**
192
199
  * The flag to allow the user to select favorites
193
200
  */
package/build/index.mjs CHANGED
@@ -14723,6 +14723,7 @@ function apiGetAssetLinks(_0) {
14723
14723
  parameters,
14724
14724
  permanentLink,
14725
14725
  proxyPreference,
14726
+ skipLinkGeneration,
14726
14727
  transformations,
14727
14728
  useSession
14728
14729
  }) {
@@ -14733,8 +14734,9 @@ function apiGetAssetLinks(_0) {
14733
14734
  const origin2 = (_a2 = http.defaults.baseURL) != null ? _a2 : window.location.origin;
14734
14735
  try {
14735
14736
  const settled = yield Promise.allSettled(assets.map((asset) => __async(null, null, function* () {
14737
+ var _a3;
14736
14738
  const requestBody = {
14737
- GenerateAssetUrl: !permanentLink,
14739
+ GenerateAssetUrl: !permanentLink && !skipLinkGeneration,
14738
14740
  Parameters: parameters,
14739
14741
  Proxy: proxyPreference,
14740
14742
  RecordId: asset.recordId
@@ -14788,6 +14790,11 @@ function apiGetAssetLinks(_0) {
14788
14790
  imageUrl: asset.imageUrl
14789
14791
  };
14790
14792
  }
14793
+ if (skipLinkGeneration) {
14794
+ return __spreadProps(__spreadValues({}, rawResponse), {
14795
+ imageUrl: (_a3 = asset.imageUrl) != null ? _a3 : ""
14796
+ });
14797
+ }
14791
14798
  const imageUrl = buildAssetLinkImageUrl({
14792
14799
  asset,
14793
14800
  extension,
@@ -16498,6 +16505,7 @@ let CxContentBrowser = class extends CortexElement {
16498
16505
  this.canUseProxies = false;
16499
16506
  this.autoSelectFormat = false;
16500
16507
  this.simplePick = false;
16508
+ this.skipLinkGeneration = false;
16501
16509
  this.canViewVersions = false;
16502
16510
  this.canTrack = false;
16503
16511
  this.canLogout = false;
@@ -17002,7 +17010,8 @@ let CxContentBrowser = class extends CortexElement {
17002
17010
  try {
17003
17011
  const response = yield this.fetchAndMergeAssetsController.getAssetLink(__spreadProps(__spreadValues({}, event.detail), {
17004
17012
  assets: [event.detail.asset],
17005
- extraFields: this.extraFields
17013
+ extraFields: this.extraFields,
17014
+ skipLinkGeneration: this.skipLinkGeneration
17006
17015
  }));
17007
17016
  if (response.isError) {
17008
17017
  this.reportProxyConfirmFailure();
@@ -17409,6 +17418,9 @@ __decorateClass([
17409
17418
  __decorateClass([
17410
17419
  n$6({ attribute: "simple-pick", reflect: true, type: Boolean })
17411
17420
  ], CxContentBrowser.prototype, "simplePick", 2);
17421
+ __decorateClass([
17422
+ n$6({ attribute: "skip-link-generation", reflect: true, type: Boolean })
17423
+ ], CxContentBrowser.prototype, "skipLinkGeneration", 2);
17412
17424
  __decorateClass([
17413
17425
  n$6({ attribute: "can-view-versions", reflect: true, type: Boolean })
17414
17426
  ], CxContentBrowser.prototype, "canViewVersions", 2);
@@ -31729,6 +31741,7 @@ const GlobalConfigContext = reactExports.createContext({
31729
31741
  allowTracking: true,
31730
31742
  allowProxy: false,
31731
31743
  simplePick: false,
31744
+ skipLinkGeneration: false,
31732
31745
  allowFavorites: false,
31733
31746
  allowPin: false,
31734
31747
  allowFormatDialogPin: false,
@@ -34505,6 +34518,7 @@ const AssetsPicker = reactExports.forwardRef(function AssetsPicker2({ accessToke
34505
34518
  allowProxy,
34506
34519
  allowTracking,
34507
34520
  simplePick,
34521
+ skipLinkGeneration,
34508
34522
  allowedExtensions,
34509
34523
  // list of allowed extensions from runtime properties. e.g. ['.jpg', '.png', '.mp4']
34510
34524
  allowedFolders,
@@ -34786,6 +34800,7 @@ const AssetsPicker = reactExports.forwardRef(function AssetsPicker2({ accessToke
34786
34800
  "can-logout": allowLogout,
34787
34801
  "can-use-proxies": allowProxy,
34788
34802
  "simple-pick": simplePick,
34803
+ "skip-link-generation": skipLinkGeneration,
34789
34804
  "can-track": allowTracking,
34790
34805
  "can-view-versions": showVersions,
34791
34806
  "cta-text": ctaText,
@@ -35487,6 +35502,7 @@ const ContentBrowser = {
35487
35502
  allowProxy,
35488
35503
  allowTracking,
35489
35504
  simplePick,
35505
+ skipLinkGeneration,
35490
35506
  availableDocTypes,
35491
35507
  availableRepresentativeSubtypes,
35492
35508
  baseUrl,
@@ -35622,6 +35638,7 @@ const ContentBrowser = {
35622
35638
  allowTracking: allowTracking !== void 0 ? !!allowTracking : true,
35623
35639
  allowProxy: simplePick ? false : allowProxy !== void 0 ? !!allowProxy : true,
35624
35640
  simplePick: !!simplePick,
35641
+ skipLinkGeneration: !!skipLinkGeneration,
35625
35642
  allowFavorites: !!allowFavorites,
35626
35643
  defaultGridView: defaultGridView != null ? defaultGridView : "",
35627
35644
  autoSelectFormat: autoSelectFormat != null ? autoSelectFormat : false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orangelogic/orange-dam-content-browser-sdk",
3
- "version": "2.4.11",
3
+ "version": "2.4.12",
4
4
  "description": "OrangeDAM Content Browser SDK source code",
5
5
  "main": "./build/OrangeDAMContentBrowserSDK.min.js",
6
6
  "module": "./build/index.mjs",