@orangelogic/orange-dam-content-browser-sdk 2.4.5 → 2.4.6
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/build/OrangeDAMContentBrowserSDK.min.js +20 -17
- package/build/components/content-browser/content-browser.d.ts +4 -0
- package/build/components/content-browser-browser/content-browser-browser.d.ts +1 -0
- package/build/content-browser.mjs +32 -11
- package/build/index.mjs +54 -12
- package/build/store/auth/auth.slice.d.ts +1 -0
- package/build/tools/fetch-and-merge-assets.d.ts +5 -3
- package/package.json +1 -1
|
@@ -44,6 +44,10 @@ export default class CxContentBrowser extends CortexElement {
|
|
|
44
44
|
allowedFolders: string[];
|
|
45
45
|
availableRepresentativeSubtypes: string[];
|
|
46
46
|
token: string;
|
|
47
|
+
/**
|
|
48
|
+
* Host OAuth token (`onRequestToken`), sent as a Bearer header.
|
|
49
|
+
*/
|
|
50
|
+
bearerToken: string;
|
|
47
51
|
showCollections: boolean;
|
|
48
52
|
showFavoriteFolder: boolean;
|
|
49
53
|
showCloseButton: boolean;
|
|
@@ -5868,6 +5868,7 @@ let CxContentBrowserBrowser = class extends CortexElement {
|
|
|
5868
5868
|
this.seeThru = false;
|
|
5869
5869
|
this.minQueryLength = 2;
|
|
5870
5870
|
this.token = "";
|
|
5871
|
+
this.bearerToken = "";
|
|
5871
5872
|
this.baseUrl = "";
|
|
5872
5873
|
this.useSiteSession = false;
|
|
5873
5874
|
this.searchTerm = "";
|
|
@@ -6065,6 +6066,7 @@ let CxContentBrowserBrowser = class extends CortexElement {
|
|
|
6065
6066
|
auto-page-size
|
|
6066
6067
|
reload-on-expand
|
|
6067
6068
|
.token=${this.token}
|
|
6069
|
+
.bearerToken=${this.bearerToken}
|
|
6068
6070
|
.api=${this.useSiteSession ? apiGetFolders : E}
|
|
6069
6071
|
.baseUrl=${this.baseUrl}
|
|
6070
6072
|
.form=${this.closest("form")}
|
|
@@ -6100,6 +6102,7 @@ let CxContentBrowserBrowser = class extends CortexElement {
|
|
|
6100
6102
|
selected-value=${o$4(this.folderId || void 0)}
|
|
6101
6103
|
.api=${this.collectionApi}
|
|
6102
6104
|
.token=${this.token}
|
|
6105
|
+
.bearerToken=${this.bearerToken}
|
|
6103
6106
|
.baseUrl=${this.baseUrl}
|
|
6104
6107
|
>
|
|
6105
6108
|
</cx-folder-select-tree>
|
|
@@ -6164,6 +6167,9 @@ __decorateClass$g([
|
|
|
6164
6167
|
__decorateClass$g([
|
|
6165
6168
|
n$6({ attribute: "token", type: String })
|
|
6166
6169
|
], CxContentBrowserBrowser.prototype, "token", 2);
|
|
6170
|
+
__decorateClass$g([
|
|
6171
|
+
n$6({ attribute: "bearer-token", type: String })
|
|
6172
|
+
], CxContentBrowserBrowser.prototype, "bearerToken", 2);
|
|
6167
6173
|
__decorateClass$g([
|
|
6168
6174
|
n$6({ attribute: "base-url", type: String })
|
|
6169
6175
|
], CxContentBrowserBrowser.prototype, "baseUrl", 2);
|
|
@@ -13749,6 +13755,7 @@ class FetchAndMergeAssetsController {
|
|
|
13749
13755
|
constructor(host, {
|
|
13750
13756
|
availableDocTypes,
|
|
13751
13757
|
baseUrl,
|
|
13758
|
+
bearerToken,
|
|
13752
13759
|
defaultFolderId,
|
|
13753
13760
|
defaultIsSeeThrough,
|
|
13754
13761
|
defaultSearchText,
|
|
@@ -13802,7 +13809,7 @@ class FetchAndMergeAssetsController {
|
|
|
13802
13809
|
this.defaultSelectedFacets = defaultSelectedFacets;
|
|
13803
13810
|
this.defaultSortOrderName = defaultSortOrderName;
|
|
13804
13811
|
this.defaultSortDirection = defaultSortDirection;
|
|
13805
|
-
this.applyTransportMode(useSiteSession, baseUrl, token, useSession);
|
|
13812
|
+
this.applyTransportMode(useSiteSession, baseUrl, token, useSession, bearerToken);
|
|
13806
13813
|
this.requestInterceptorId = http.interceptors.request.use((config) => {
|
|
13807
13814
|
var _a3;
|
|
13808
13815
|
if (this.useSiteSession) {
|
|
@@ -13840,6 +13847,11 @@ class FetchAndMergeAssetsController {
|
|
|
13840
13847
|
if (this.baseUrl) {
|
|
13841
13848
|
config.baseURL = this.baseUrl;
|
|
13842
13849
|
}
|
|
13850
|
+
if (this.bearerToken) {
|
|
13851
|
+
config.headers.set("Authorization", `Bearer ${this.bearerToken}`);
|
|
13852
|
+
} else {
|
|
13853
|
+
config.headers.delete("Authorization");
|
|
13854
|
+
}
|
|
13843
13855
|
config.params = __spreadProps(__spreadValues({}, config.params), {
|
|
13844
13856
|
Token: this.token || void 0,
|
|
13845
13857
|
UseSession: this.useSession || void 0
|
|
@@ -13897,22 +13909,23 @@ class FetchAndMergeAssetsController {
|
|
|
13897
13909
|
* Site-session mode decides the transport (cookies on the Cortex origin vs. Token/UseSession
|
|
13898
13910
|
* params), so it has to be applied to the interceptor state and base URL, not just captured once.
|
|
13899
13911
|
*/
|
|
13900
|
-
applyTransportMode(useSiteSession, baseUrl, token, useSession) {
|
|
13912
|
+
applyTransportMode(useSiteSession, baseUrl, token, useSession, bearerToken) {
|
|
13901
13913
|
this.useSiteSession = useSiteSession;
|
|
13902
13914
|
this.baseUrl = useSiteSession ? resolveSiteSessionUrl(baseUrl) : baseUrl;
|
|
13903
13915
|
this.token = useSiteSession ? "" : token;
|
|
13904
13916
|
this.useSession = useSiteSession ? "" : useSession;
|
|
13917
|
+
this.bearerToken = useSiteSession ? "" : bearerToken;
|
|
13905
13918
|
http.defaults.baseURL = this.baseUrl;
|
|
13906
13919
|
}
|
|
13907
13920
|
/**
|
|
13908
13921
|
* `setSiteSession(...)` can flip the mode while the host stays mounted, so keep the transport in
|
|
13909
13922
|
* step with the UI instead of serving requests through the mode the controller was built with.
|
|
13910
13923
|
*/
|
|
13911
|
-
updateSiteSession(useSiteSession, baseUrl, token, useSession) {
|
|
13924
|
+
updateSiteSession(useSiteSession, baseUrl, token, useSession, bearerToken) {
|
|
13912
13925
|
if (useSiteSession === this.useSiteSession) {
|
|
13913
13926
|
return;
|
|
13914
13927
|
}
|
|
13915
|
-
this.applyTransportMode(useSiteSession, baseUrl, token, useSession);
|
|
13928
|
+
this.applyTransportMode(useSiteSession, baseUrl, token, useSession, bearerToken);
|
|
13916
13929
|
if (this.resolvePendingTokenRefresh) {
|
|
13917
13930
|
this.resolvePendingTokenRefresh(null);
|
|
13918
13931
|
this.pendingTokenRefresh = null;
|
|
@@ -13926,20 +13939,21 @@ class FetchAndMergeAssetsController {
|
|
|
13926
13939
|
}
|
|
13927
13940
|
this.host.requestUpdate();
|
|
13928
13941
|
}
|
|
13929
|
-
updateAuth(token, useSession) {
|
|
13942
|
+
updateAuth(token, useSession, bearerToken) {
|
|
13930
13943
|
if (this.useSiteSession) {
|
|
13931
13944
|
return;
|
|
13932
13945
|
}
|
|
13933
|
-
const tokenChanged = this.token !== token;
|
|
13946
|
+
const tokenChanged = this.token !== token || this.bearerToken !== bearerToken;
|
|
13934
13947
|
const wasLoggedOut = !this.isLoggedIn;
|
|
13935
13948
|
this.token = token;
|
|
13936
13949
|
this.useSession = useSession;
|
|
13950
|
+
this.bearerToken = bearerToken;
|
|
13937
13951
|
if (tokenChanged && this.resolvePendingTokenRefresh) {
|
|
13938
|
-
this.resolvePendingTokenRefresh(token || null);
|
|
13952
|
+
this.resolvePendingTokenRefresh(bearerToken || token || null);
|
|
13939
13953
|
this.pendingTokenRefresh = null;
|
|
13940
13954
|
this.resolvePendingTokenRefresh = null;
|
|
13941
13955
|
}
|
|
13942
|
-
if (tokenChanged && wasLoggedOut && token) {
|
|
13956
|
+
if (tokenChanged && wasLoggedOut && (bearerToken || token)) {
|
|
13943
13957
|
this.isLoggedIn = true;
|
|
13944
13958
|
this.fetchInitialData();
|
|
13945
13959
|
if (this.lastRequest) {
|
|
@@ -14422,6 +14436,7 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
14422
14436
|
this.allowedFolders = [];
|
|
14423
14437
|
this.availableRepresentativeSubtypes = [];
|
|
14424
14438
|
this.token = "";
|
|
14439
|
+
this.bearerToken = "";
|
|
14425
14440
|
this.showCollections = false;
|
|
14426
14441
|
this.showFavoriteFolder = false;
|
|
14427
14442
|
this.showCloseButton = false;
|
|
@@ -14515,6 +14530,7 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
14515
14530
|
this.fetchAndMergeAssetsController = new FetchAndMergeAssetsController(this, {
|
|
14516
14531
|
availableDocTypes: this.availableDocTypes,
|
|
14517
14532
|
baseUrl: this.baseUrl,
|
|
14533
|
+
bearerToken: this.bearerToken,
|
|
14518
14534
|
defaultFolderId: this.defaultFolderId,
|
|
14519
14535
|
defaultIsSeeThrough: this.defaultIsSeeThrough,
|
|
14520
14536
|
defaultSearchText: this.defaultSearchText,
|
|
@@ -14598,7 +14614,7 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
14598
14614
|
}
|
|
14599
14615
|
handleAuthChange() {
|
|
14600
14616
|
var _a2;
|
|
14601
|
-
(_a2 = this.fetchAndMergeAssetsController) == null ? void 0 : _a2.updateAuth(this.token, this.useSession);
|
|
14617
|
+
(_a2 = this.fetchAndMergeAssetsController) == null ? void 0 : _a2.updateAuth(this.token, this.useSession, this.bearerToken);
|
|
14602
14618
|
}
|
|
14603
14619
|
handleSiteSessionChange() {
|
|
14604
14620
|
var _a2;
|
|
@@ -14609,7 +14625,8 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
14609
14625
|
this.useSiteSession,
|
|
14610
14626
|
this.baseUrl,
|
|
14611
14627
|
this.token,
|
|
14612
|
-
this.useSession
|
|
14628
|
+
this.useSession,
|
|
14629
|
+
this.bearerToken
|
|
14613
14630
|
);
|
|
14614
14631
|
}
|
|
14615
14632
|
handleSortOrderChange(event) {
|
|
@@ -14976,6 +14993,7 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
14976
14993
|
folder-id=${o$4(this.lastRequest.folderId || void 0)}
|
|
14977
14994
|
folder-title=${o$4(this.folderTitle || void 0)}
|
|
14978
14995
|
token=${this.useSiteSession ? "" : this.token}
|
|
14996
|
+
bearer-token=${this.useSiteSession ? "" : this.bearerToken}
|
|
14979
14997
|
base-url=${this.baseUrl}
|
|
14980
14998
|
use-session=${this.useSiteSession ? "" : this.useSession}
|
|
14981
14999
|
?use-site-session=${this.useSiteSession}
|
|
@@ -15143,6 +15161,9 @@ __decorateClass([
|
|
|
15143
15161
|
__decorateClass([
|
|
15144
15162
|
n$6({ attribute: "token", reflect: false, type: String })
|
|
15145
15163
|
], CxContentBrowser.prototype, "token", 2);
|
|
15164
|
+
__decorateClass([
|
|
15165
|
+
n$6({ attribute: "bearer-token", reflect: false, type: String })
|
|
15166
|
+
], CxContentBrowser.prototype, "bearerToken", 2);
|
|
15146
15167
|
__decorateClass([
|
|
15147
15168
|
n$6({ attribute: "show-collections", reflect: true, type: Boolean })
|
|
15148
15169
|
], CxContentBrowser.prototype, "showCollections", 2);
|
|
@@ -15272,7 +15293,7 @@ __decorateClass([
|
|
|
15272
15293
|
watch("lastRequest", { waitUntilFirstUpdate: true })
|
|
15273
15294
|
], CxContentBrowser.prototype, "handleLastRequestChange", 1);
|
|
15274
15295
|
__decorateClass([
|
|
15275
|
-
watch(["token", "useSession"], { waitUntilFirstUpdate: true })
|
|
15296
|
+
watch(["token", "useSession", "bearerToken"], { waitUntilFirstUpdate: true })
|
|
15276
15297
|
], CxContentBrowser.prototype, "handleAuthChange", 1);
|
|
15277
15298
|
__decorateClass([
|
|
15278
15299
|
watch("useSiteSession", { waitUntilFirstUpdate: true })
|
package/build/index.mjs
CHANGED
|
@@ -5934,6 +5934,7 @@ let CxContentBrowserBrowser = class extends CortexElement {
|
|
|
5934
5934
|
this.seeThru = false;
|
|
5935
5935
|
this.minQueryLength = 2;
|
|
5936
5936
|
this.token = "";
|
|
5937
|
+
this.bearerToken = "";
|
|
5937
5938
|
this.baseUrl = "";
|
|
5938
5939
|
this.useSiteSession = false;
|
|
5939
5940
|
this.searchTerm = "";
|
|
@@ -6131,6 +6132,7 @@ let CxContentBrowserBrowser = class extends CortexElement {
|
|
|
6131
6132
|
auto-page-size
|
|
6132
6133
|
reload-on-expand
|
|
6133
6134
|
.token=${this.token}
|
|
6135
|
+
.bearerToken=${this.bearerToken}
|
|
6134
6136
|
.api=${this.useSiteSession ? apiGetFolders : E}
|
|
6135
6137
|
.baseUrl=${this.baseUrl}
|
|
6136
6138
|
.form=${this.closest("form")}
|
|
@@ -6166,6 +6168,7 @@ let CxContentBrowserBrowser = class extends CortexElement {
|
|
|
6166
6168
|
selected-value=${o$5(this.folderId || void 0)}
|
|
6167
6169
|
.api=${this.collectionApi}
|
|
6168
6170
|
.token=${this.token}
|
|
6171
|
+
.bearerToken=${this.bearerToken}
|
|
6169
6172
|
.baseUrl=${this.baseUrl}
|
|
6170
6173
|
>
|
|
6171
6174
|
</cx-folder-select-tree>
|
|
@@ -6230,6 +6233,9 @@ __decorateClass$g([
|
|
|
6230
6233
|
__decorateClass$g([
|
|
6231
6234
|
n$6({ attribute: "token", type: String })
|
|
6232
6235
|
], CxContentBrowserBrowser.prototype, "token", 2);
|
|
6236
|
+
__decorateClass$g([
|
|
6237
|
+
n$6({ attribute: "bearer-token", type: String })
|
|
6238
|
+
], CxContentBrowserBrowser.prototype, "bearerToken", 2);
|
|
6233
6239
|
__decorateClass$g([
|
|
6234
6240
|
n$6({ attribute: "base-url", type: String })
|
|
6235
6241
|
], CxContentBrowserBrowser.prototype, "baseUrl", 2);
|
|
@@ -13815,6 +13821,7 @@ class FetchAndMergeAssetsController {
|
|
|
13815
13821
|
constructor(host, {
|
|
13816
13822
|
availableDocTypes,
|
|
13817
13823
|
baseUrl,
|
|
13824
|
+
bearerToken,
|
|
13818
13825
|
defaultFolderId,
|
|
13819
13826
|
defaultIsSeeThrough,
|
|
13820
13827
|
defaultSearchText,
|
|
@@ -13868,7 +13875,7 @@ class FetchAndMergeAssetsController {
|
|
|
13868
13875
|
this.defaultSelectedFacets = defaultSelectedFacets;
|
|
13869
13876
|
this.defaultSortOrderName = defaultSortOrderName;
|
|
13870
13877
|
this.defaultSortDirection = defaultSortDirection;
|
|
13871
|
-
this.applyTransportMode(useSiteSession, baseUrl, token2, useSession);
|
|
13878
|
+
this.applyTransportMode(useSiteSession, baseUrl, token2, useSession, bearerToken);
|
|
13872
13879
|
this.requestInterceptorId = http.interceptors.request.use((config) => {
|
|
13873
13880
|
var _a3;
|
|
13874
13881
|
if (this.useSiteSession) {
|
|
@@ -13906,6 +13913,11 @@ class FetchAndMergeAssetsController {
|
|
|
13906
13913
|
if (this.baseUrl) {
|
|
13907
13914
|
config.baseURL = this.baseUrl;
|
|
13908
13915
|
}
|
|
13916
|
+
if (this.bearerToken) {
|
|
13917
|
+
config.headers.set("Authorization", `Bearer ${this.bearerToken}`);
|
|
13918
|
+
} else {
|
|
13919
|
+
config.headers.delete("Authorization");
|
|
13920
|
+
}
|
|
13909
13921
|
config.params = __spreadProps(__spreadValues({}, config.params), {
|
|
13910
13922
|
Token: this.token || void 0,
|
|
13911
13923
|
UseSession: this.useSession || void 0
|
|
@@ -13963,22 +13975,23 @@ class FetchAndMergeAssetsController {
|
|
|
13963
13975
|
* Site-session mode decides the transport (cookies on the Cortex origin vs. Token/UseSession
|
|
13964
13976
|
* params), so it has to be applied to the interceptor state and base URL, not just captured once.
|
|
13965
13977
|
*/
|
|
13966
|
-
applyTransportMode(useSiteSession, baseUrl, token2, useSession) {
|
|
13978
|
+
applyTransportMode(useSiteSession, baseUrl, token2, useSession, bearerToken) {
|
|
13967
13979
|
this.useSiteSession = useSiteSession;
|
|
13968
13980
|
this.baseUrl = useSiteSession ? resolveSiteSessionUrl(baseUrl) : baseUrl;
|
|
13969
13981
|
this.token = useSiteSession ? "" : token2;
|
|
13970
13982
|
this.useSession = useSiteSession ? "" : useSession;
|
|
13983
|
+
this.bearerToken = useSiteSession ? "" : bearerToken;
|
|
13971
13984
|
http.defaults.baseURL = this.baseUrl;
|
|
13972
13985
|
}
|
|
13973
13986
|
/**
|
|
13974
13987
|
* `setSiteSession(...)` can flip the mode while the host stays mounted, so keep the transport in
|
|
13975
13988
|
* step with the UI instead of serving requests through the mode the controller was built with.
|
|
13976
13989
|
*/
|
|
13977
|
-
updateSiteSession(useSiteSession, baseUrl, token2, useSession) {
|
|
13990
|
+
updateSiteSession(useSiteSession, baseUrl, token2, useSession, bearerToken) {
|
|
13978
13991
|
if (useSiteSession === this.useSiteSession) {
|
|
13979
13992
|
return;
|
|
13980
13993
|
}
|
|
13981
|
-
this.applyTransportMode(useSiteSession, baseUrl, token2, useSession);
|
|
13994
|
+
this.applyTransportMode(useSiteSession, baseUrl, token2, useSession, bearerToken);
|
|
13982
13995
|
if (this.resolvePendingTokenRefresh) {
|
|
13983
13996
|
this.resolvePendingTokenRefresh(null);
|
|
13984
13997
|
this.pendingTokenRefresh = null;
|
|
@@ -13992,20 +14005,21 @@ class FetchAndMergeAssetsController {
|
|
|
13992
14005
|
}
|
|
13993
14006
|
this.host.requestUpdate();
|
|
13994
14007
|
}
|
|
13995
|
-
updateAuth(token2, useSession) {
|
|
14008
|
+
updateAuth(token2, useSession, bearerToken) {
|
|
13996
14009
|
if (this.useSiteSession) {
|
|
13997
14010
|
return;
|
|
13998
14011
|
}
|
|
13999
|
-
const tokenChanged = this.token !== token2;
|
|
14012
|
+
const tokenChanged = this.token !== token2 || this.bearerToken !== bearerToken;
|
|
14000
14013
|
const wasLoggedOut = !this.isLoggedIn;
|
|
14001
14014
|
this.token = token2;
|
|
14002
14015
|
this.useSession = useSession;
|
|
14016
|
+
this.bearerToken = bearerToken;
|
|
14003
14017
|
if (tokenChanged && this.resolvePendingTokenRefresh) {
|
|
14004
|
-
this.resolvePendingTokenRefresh(token2 || null);
|
|
14018
|
+
this.resolvePendingTokenRefresh(bearerToken || token2 || null);
|
|
14005
14019
|
this.pendingTokenRefresh = null;
|
|
14006
14020
|
this.resolvePendingTokenRefresh = null;
|
|
14007
14021
|
}
|
|
14008
|
-
if (tokenChanged && wasLoggedOut && token2) {
|
|
14022
|
+
if (tokenChanged && wasLoggedOut && (bearerToken || token2)) {
|
|
14009
14023
|
this.isLoggedIn = true;
|
|
14010
14024
|
this.fetchInitialData();
|
|
14011
14025
|
if (this.lastRequest) {
|
|
@@ -14488,6 +14502,7 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
14488
14502
|
this.allowedFolders = [];
|
|
14489
14503
|
this.availableRepresentativeSubtypes = [];
|
|
14490
14504
|
this.token = "";
|
|
14505
|
+
this.bearerToken = "";
|
|
14491
14506
|
this.showCollections = false;
|
|
14492
14507
|
this.showFavoriteFolder = false;
|
|
14493
14508
|
this.showCloseButton = false;
|
|
@@ -14581,6 +14596,7 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
14581
14596
|
this.fetchAndMergeAssetsController = new FetchAndMergeAssetsController(this, {
|
|
14582
14597
|
availableDocTypes: this.availableDocTypes,
|
|
14583
14598
|
baseUrl: this.baseUrl,
|
|
14599
|
+
bearerToken: this.bearerToken,
|
|
14584
14600
|
defaultFolderId: this.defaultFolderId,
|
|
14585
14601
|
defaultIsSeeThrough: this.defaultIsSeeThrough,
|
|
14586
14602
|
defaultSearchText: this.defaultSearchText,
|
|
@@ -14664,7 +14680,7 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
14664
14680
|
}
|
|
14665
14681
|
handleAuthChange() {
|
|
14666
14682
|
var _a2;
|
|
14667
|
-
(_a2 = this.fetchAndMergeAssetsController) == null ? void 0 : _a2.updateAuth(this.token, this.useSession);
|
|
14683
|
+
(_a2 = this.fetchAndMergeAssetsController) == null ? void 0 : _a2.updateAuth(this.token, this.useSession, this.bearerToken);
|
|
14668
14684
|
}
|
|
14669
14685
|
handleSiteSessionChange() {
|
|
14670
14686
|
var _a2;
|
|
@@ -14675,7 +14691,8 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
14675
14691
|
this.useSiteSession,
|
|
14676
14692
|
this.baseUrl,
|
|
14677
14693
|
this.token,
|
|
14678
|
-
this.useSession
|
|
14694
|
+
this.useSession,
|
|
14695
|
+
this.bearerToken
|
|
14679
14696
|
);
|
|
14680
14697
|
}
|
|
14681
14698
|
handleSortOrderChange(event) {
|
|
@@ -15042,6 +15059,7 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
15042
15059
|
folder-id=${o$5(this.lastRequest.folderId || void 0)}
|
|
15043
15060
|
folder-title=${o$5(this.folderTitle || void 0)}
|
|
15044
15061
|
token=${this.useSiteSession ? "" : this.token}
|
|
15062
|
+
bearer-token=${this.useSiteSession ? "" : this.bearerToken}
|
|
15045
15063
|
base-url=${this.baseUrl}
|
|
15046
15064
|
use-session=${this.useSiteSession ? "" : this.useSession}
|
|
15047
15065
|
?use-site-session=${this.useSiteSession}
|
|
@@ -15209,6 +15227,9 @@ __decorateClass([
|
|
|
15209
15227
|
__decorateClass([
|
|
15210
15228
|
n$6({ attribute: "token", reflect: false, type: String })
|
|
15211
15229
|
], CxContentBrowser.prototype, "token", 2);
|
|
15230
|
+
__decorateClass([
|
|
15231
|
+
n$6({ attribute: "bearer-token", reflect: false, type: String })
|
|
15232
|
+
], CxContentBrowser.prototype, "bearerToken", 2);
|
|
15212
15233
|
__decorateClass([
|
|
15213
15234
|
n$6({ attribute: "show-collections", reflect: true, type: Boolean })
|
|
15214
15235
|
], CxContentBrowser.prototype, "showCollections", 2);
|
|
@@ -15338,7 +15359,7 @@ __decorateClass([
|
|
|
15338
15359
|
watch("lastRequest", { waitUntilFirstUpdate: true })
|
|
15339
15360
|
], CxContentBrowser.prototype, "handleLastRequestChange", 1);
|
|
15340
15361
|
__decorateClass([
|
|
15341
|
-
watch(["token", "useSession"], { waitUntilFirstUpdate: true })
|
|
15362
|
+
watch(["token", "useSession", "bearerToken"], { waitUntilFirstUpdate: true })
|
|
15342
15363
|
], CxContentBrowser.prototype, "handleAuthChange", 1);
|
|
15343
15364
|
__decorateClass([
|
|
15344
15365
|
watch("useSiteSession", { waitUntilFirstUpdate: true })
|
|
@@ -31930,7 +31951,7 @@ const readAccessKey = (authState) => __async(null, null, function* () {
|
|
|
31930
31951
|
return readStoredAccessKey(authState.siteUrl);
|
|
31931
31952
|
});
|
|
31932
31953
|
const refreshAccessToken = () => __async(null, null, function* () {
|
|
31933
|
-
var _a2;
|
|
31954
|
+
var _a2, _b2, _c2;
|
|
31934
31955
|
if (store.getState()[AUTH_FEATURE_KEY].useSiteSession) {
|
|
31935
31956
|
return null;
|
|
31936
31957
|
}
|
|
@@ -31945,6 +31966,20 @@ const refreshAccessToken = () => __async(null, null, function* () {
|
|
|
31945
31966
|
if (authState.useSiteSession) {
|
|
31946
31967
|
return null;
|
|
31947
31968
|
}
|
|
31969
|
+
if (authState.useHeaders) {
|
|
31970
|
+
try {
|
|
31971
|
+
const result = yield (_c2 = (_b2 = window.OrangeDAMContentBrowser) == null ? void 0 : _b2._onRequestToken) == null ? void 0 : _c2.call(_b2);
|
|
31972
|
+
if (!store.getState()[AUTH_FEATURE_KEY].useHeaders) {
|
|
31973
|
+
return null;
|
|
31974
|
+
}
|
|
31975
|
+
if (result == null ? void 0 : result.token) {
|
|
31976
|
+
store.dispatch(updateAuthTokens({ accessKey: result.token }));
|
|
31977
|
+
return result.token;
|
|
31978
|
+
}
|
|
31979
|
+
} catch (e2) {
|
|
31980
|
+
}
|
|
31981
|
+
return null;
|
|
31982
|
+
}
|
|
31948
31983
|
let accessKey;
|
|
31949
31984
|
try {
|
|
31950
31985
|
accessKey = yield readAccessKey(authState);
|
|
@@ -32203,6 +32238,7 @@ const authSlice = createSlice({
|
|
|
32203
32238
|
state.accessToken = accessToken;
|
|
32204
32239
|
state.status = "authenticated";
|
|
32205
32240
|
state.siteUrl = siteUrl;
|
|
32241
|
+
state.useHeaders = false;
|
|
32206
32242
|
storeData(AUTH_FEATURE_ACCESS_KEY_KEY, accessKey != null ? accessKey : "");
|
|
32207
32243
|
storeData(AUTH_FEATURE_SITE_URL_KEY, siteUrl);
|
|
32208
32244
|
}
|
|
@@ -32229,6 +32265,10 @@ const authStateSelector = (rootState) => rootState[AUTH_FEATURE_KEY].status;
|
|
|
32229
32265
|
const applySessionSelector = (rootState) => rootState[AUTH_FEATURE_KEY].useSession;
|
|
32230
32266
|
const applyHeadersSelector = (rootState) => !!rootState[AUTH_FEATURE_KEY].useHeaders;
|
|
32231
32267
|
const siteSessionSelector = (rootState) => !!rootState[AUTH_FEATURE_KEY].useSiteSession;
|
|
32268
|
+
const bearerTokenSelector = (rootState) => {
|
|
32269
|
+
const { accessKey, useHeaders } = rootState[AUTH_FEATURE_KEY];
|
|
32270
|
+
return useHeaders ? accessKey : void 0;
|
|
32271
|
+
};
|
|
32232
32272
|
const appAuthUrlSelector = (rootState) => {
|
|
32233
32273
|
const siteUrl = rootState[AUTH_FEATURE_KEY].siteUrl;
|
|
32234
32274
|
return siteUrl ? getRequestUrl(siteUrl, `AppAuth?RID=${rootState[AUTH_FEATURE_KEY].nonce}`) : "";
|
|
@@ -32452,6 +32492,7 @@ const AssetsPicker = reactExports.forwardRef(function AssetsPicker2({ accessToke
|
|
|
32452
32492
|
const appDispatch = useAppDispatch();
|
|
32453
32493
|
const useSession = useAppSelector(applySessionSelector);
|
|
32454
32494
|
const useSiteSession = useAppSelector(siteSessionSelector);
|
|
32495
|
+
const bearerToken = useAppSelector(bearerTokenSelector);
|
|
32455
32496
|
const {
|
|
32456
32497
|
allowFavorites,
|
|
32457
32498
|
allowFormatDialogPin,
|
|
@@ -32697,6 +32738,7 @@ const AssetsPicker = reactExports.forwardRef(function AssetsPicker2({ accessToke
|
|
|
32697
32738
|
"default-search-text": defaultSettings.searchText,
|
|
32698
32739
|
"default-folder-id": defaultSettings.lastLocation,
|
|
32699
32740
|
token: accessToken != null ? accessToken : "",
|
|
32741
|
+
bearerToken: bearerToken != null ? bearerToken : "",
|
|
32700
32742
|
"base-url": siteUrl != null ? siteUrl : "",
|
|
32701
32743
|
"use-session": useSession,
|
|
32702
32744
|
"use-site-session": useSiteSession,
|
|
@@ -196,6 +196,7 @@ export declare const authStateSelector: (rootState: RootState) => "authenticated
|
|
|
196
196
|
export declare const applySessionSelector: (rootState: RootState) => string;
|
|
197
197
|
export declare const applyHeadersSelector: (rootState: RootState) => boolean;
|
|
198
198
|
export declare const siteSessionSelector: (rootState: RootState) => boolean;
|
|
199
|
+
export declare const bearerTokenSelector: (rootState: RootState) => string | undefined;
|
|
199
200
|
export declare const appAuthUrlSelector: (rootState: RootState) => string;
|
|
200
201
|
export declare const cancelAuth: import("@reduxjs/toolkit").AsyncThunk<void, void, import("@reduxjs/toolkit").AsyncThunkConfig>;
|
|
201
202
|
export declare const oAuth: import("@reduxjs/toolkit").AsyncThunk<OAuthRes, {
|
|
@@ -8,6 +8,7 @@ import type { ReactiveController } from 'lit';
|
|
|
8
8
|
type FetchAndMergeAssetsControllerOptions = {
|
|
9
9
|
availableDocTypes: string[];
|
|
10
10
|
baseUrl: string;
|
|
11
|
+
bearerToken: string;
|
|
11
12
|
defaultFolderId: string;
|
|
12
13
|
defaultIsSeeThrough: boolean;
|
|
13
14
|
defaultSearchText: string;
|
|
@@ -37,6 +38,7 @@ export declare class FetchAndMergeAssetsController implements ReactiveController
|
|
|
37
38
|
private loading;
|
|
38
39
|
private isLoggedIn;
|
|
39
40
|
private token;
|
|
41
|
+
private bearerToken;
|
|
40
42
|
private useSession;
|
|
41
43
|
private useSiteSession;
|
|
42
44
|
private baseUrl;
|
|
@@ -52,7 +54,7 @@ export declare class FetchAndMergeAssetsController implements ReactiveController
|
|
|
52
54
|
private readonly defaultIsSeeThrough;
|
|
53
55
|
private requestInterceptorId;
|
|
54
56
|
private responseInterceptorId;
|
|
55
|
-
constructor(host: CortexElement, { availableDocTypes, baseUrl, defaultFolderId, defaultIsSeeThrough, defaultSearchText, defaultSelectedFacets, defaultSortDirection, defaultSortOrderName, token, useSession, useSiteSession, }: FetchAndMergeAssetsControllerOptions);
|
|
57
|
+
constructor(host: CortexElement, { availableDocTypes, baseUrl, bearerToken, defaultFolderId, defaultIsSeeThrough, defaultSearchText, defaultSelectedFacets, defaultSortDirection, defaultSortOrderName, token, useSession, useSiteSession, }: FetchAndMergeAssetsControllerOptions);
|
|
56
58
|
private waitForNewToken;
|
|
57
59
|
/**
|
|
58
60
|
* Site-session mode decides the transport (cookies on the Cortex origin vs. Token/UseSession
|
|
@@ -63,8 +65,8 @@ export declare class FetchAndMergeAssetsController implements ReactiveController
|
|
|
63
65
|
* `setSiteSession(...)` can flip the mode while the host stays mounted, so keep the transport in
|
|
64
66
|
* step with the UI instead of serving requests through the mode the controller was built with.
|
|
65
67
|
*/
|
|
66
|
-
updateSiteSession(useSiteSession: boolean, baseUrl: string, token: string, useSession: string): void;
|
|
67
|
-
updateAuth(token: string, useSession: string): void;
|
|
68
|
+
updateSiteSession(useSiteSession: boolean, baseUrl: string, token: string, useSession: string, bearerToken: string): void;
|
|
69
|
+
updateAuth(token: string, useSession: string, bearerToken: string): void;
|
|
68
70
|
private fetchInitialData;
|
|
69
71
|
private _debounceTimeout;
|
|
70
72
|
private _debouncePromise;
|
package/package.json
CHANGED