@orangelogic/orange-dam-content-browser-sdk 2.3.5 → 2.3.6-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/README.md +56 -1
- package/build/GlobalConfigContext.d.ts +1 -0
- package/build/OrangeDAMContentBrowserSDK.min.js +166 -161
- package/build/components/content-browser/content-browser.d.ts +8 -0
- package/build/components/content-browser-browser/content-browser-browser.d.ts +1 -0
- package/build/content-browser.mjs +153 -29
- package/build/index.d.ts +11 -0
- package/build/index.mjs +221 -43
- package/build/store/auth/auth.slice.d.ts +37 -1
- package/build/tools/fetch-and-merge-assets.d.ts +15 -1
- package/build/utils/site-session.d.ts +3 -0
- package/package.json +1 -1
|
@@ -14,8 +14,34 @@ export type AuthState = {
|
|
|
14
14
|
status: 'authenticated' | 'unauthenticated' | 'restoreSession' | 'requestLogin' | 'waitForAuthorize';
|
|
15
15
|
useHeaders?: boolean;
|
|
16
16
|
useSession: string;
|
|
17
|
+
useSiteSession?: boolean;
|
|
17
18
|
};
|
|
18
19
|
export declare const authSlice: import("@reduxjs/toolkit").Slice<AuthState, {
|
|
20
|
+
setSiteSession: (state: {
|
|
21
|
+
siteUrl: string;
|
|
22
|
+
userConfigSiteUrl?: string | undefined;
|
|
23
|
+
nonce?: string | undefined;
|
|
24
|
+
accessToken?: string | undefined;
|
|
25
|
+
accessKey?: string | undefined;
|
|
26
|
+
oAuthUrl?: string | undefined;
|
|
27
|
+
error?: string | undefined;
|
|
28
|
+
status: "authenticated" | "unauthenticated" | "restoreSession" | "requestLogin" | "waitForAuthorize";
|
|
29
|
+
useHeaders?: boolean | undefined;
|
|
30
|
+
useSession: string;
|
|
31
|
+
useSiteSession?: boolean | undefined;
|
|
32
|
+
}, action: PayloadAction<string | undefined>) => {
|
|
33
|
+
siteUrl: string;
|
|
34
|
+
userConfigSiteUrl?: string;
|
|
35
|
+
nonce?: string;
|
|
36
|
+
accessToken?: string;
|
|
37
|
+
accessKey?: string;
|
|
38
|
+
oAuthUrl?: string;
|
|
39
|
+
error?: string;
|
|
40
|
+
status: "authenticated" | "unauthenticated" | "restoreSession" | "requestLogin" | "waitForAuthorize";
|
|
41
|
+
useHeaders?: boolean;
|
|
42
|
+
useSession: string;
|
|
43
|
+
useSiteSession?: boolean;
|
|
44
|
+
} | undefined;
|
|
19
45
|
setAccessToken: (state: {
|
|
20
46
|
siteUrl: string;
|
|
21
47
|
userConfigSiteUrl?: string | undefined;
|
|
@@ -27,6 +53,7 @@ export declare const authSlice: import("@reduxjs/toolkit").Slice<AuthState, {
|
|
|
27
53
|
status: "authenticated" | "unauthenticated" | "restoreSession" | "requestLogin" | "waitForAuthorize";
|
|
28
54
|
useHeaders?: boolean | undefined;
|
|
29
55
|
useSession: string;
|
|
56
|
+
useSiteSession?: boolean | undefined;
|
|
30
57
|
}, action: PayloadAction<string | undefined>) => void;
|
|
31
58
|
updateAuthTokens: (state: {
|
|
32
59
|
siteUrl: string;
|
|
@@ -39,6 +66,7 @@ export declare const authSlice: import("@reduxjs/toolkit").Slice<AuthState, {
|
|
|
39
66
|
status: "authenticated" | "unauthenticated" | "restoreSession" | "requestLogin" | "waitForAuthorize";
|
|
40
67
|
useHeaders?: boolean | undefined;
|
|
41
68
|
useSession: string;
|
|
69
|
+
useSiteSession?: boolean | undefined;
|
|
42
70
|
}, action: PayloadAction<Partial<AuthState>>) => void;
|
|
43
71
|
setSiteUrl: (state: {
|
|
44
72
|
siteUrl: string;
|
|
@@ -51,6 +79,7 @@ export declare const authSlice: import("@reduxjs/toolkit").Slice<AuthState, {
|
|
|
51
79
|
status: "authenticated" | "unauthenticated" | "restoreSession" | "requestLogin" | "waitForAuthorize";
|
|
52
80
|
useHeaders?: boolean | undefined;
|
|
53
81
|
useSession: string;
|
|
82
|
+
useSiteSession?: boolean | undefined;
|
|
54
83
|
}, action: PayloadAction<string>) => void;
|
|
55
84
|
setUserConfigSiteUrl: (state: {
|
|
56
85
|
siteUrl: string;
|
|
@@ -63,6 +92,7 @@ export declare const authSlice: import("@reduxjs/toolkit").Slice<AuthState, {
|
|
|
63
92
|
status: "authenticated" | "unauthenticated" | "restoreSession" | "requestLogin" | "waitForAuthorize";
|
|
64
93
|
useHeaders?: boolean | undefined;
|
|
65
94
|
useSession: string;
|
|
95
|
+
useSiteSession?: boolean | undefined;
|
|
66
96
|
}, action: PayloadAction<string>) => void;
|
|
67
97
|
generateNonce: (state: {
|
|
68
98
|
siteUrl: string;
|
|
@@ -75,6 +105,7 @@ export declare const authSlice: import("@reduxjs/toolkit").Slice<AuthState, {
|
|
|
75
105
|
status: "authenticated" | "unauthenticated" | "restoreSession" | "requestLogin" | "waitForAuthorize";
|
|
76
106
|
useHeaders?: boolean | undefined;
|
|
77
107
|
useSession: string;
|
|
108
|
+
useSiteSession?: boolean | undefined;
|
|
78
109
|
}) => void;
|
|
79
110
|
logout: (state: {
|
|
80
111
|
siteUrl: string;
|
|
@@ -87,6 +118,7 @@ export declare const authSlice: import("@reduxjs/toolkit").Slice<AuthState, {
|
|
|
87
118
|
status: "authenticated" | "unauthenticated" | "restoreSession" | "requestLogin" | "waitForAuthorize";
|
|
88
119
|
useHeaders?: boolean | undefined;
|
|
89
120
|
useSession: string;
|
|
121
|
+
useSiteSession?: boolean | undefined;
|
|
90
122
|
}) => void;
|
|
91
123
|
setAuthStatus: (state: {
|
|
92
124
|
siteUrl: string;
|
|
@@ -99,6 +131,7 @@ export declare const authSlice: import("@reduxjs/toolkit").Slice<AuthState, {
|
|
|
99
131
|
status: "authenticated" | "unauthenticated" | "restoreSession" | "requestLogin" | "waitForAuthorize";
|
|
100
132
|
useHeaders?: boolean | undefined;
|
|
101
133
|
useSession: string;
|
|
134
|
+
useSiteSession?: boolean | undefined;
|
|
102
135
|
}, action: PayloadAction<AuthState["status"]>) => void;
|
|
103
136
|
setUseSession: (state: {
|
|
104
137
|
siteUrl: string;
|
|
@@ -111,6 +144,7 @@ export declare const authSlice: import("@reduxjs/toolkit").Slice<AuthState, {
|
|
|
111
144
|
status: "authenticated" | "unauthenticated" | "restoreSession" | "requestLogin" | "waitForAuthorize";
|
|
112
145
|
useHeaders?: boolean | undefined;
|
|
113
146
|
useSession: string;
|
|
147
|
+
useSiteSession?: boolean | undefined;
|
|
114
148
|
}, action: PayloadAction<string>) => void;
|
|
115
149
|
setUseHeaders: (state: {
|
|
116
150
|
siteUrl: string;
|
|
@@ -123,11 +157,12 @@ export declare const authSlice: import("@reduxjs/toolkit").Slice<AuthState, {
|
|
|
123
157
|
status: "authenticated" | "unauthenticated" | "restoreSession" | "requestLogin" | "waitForAuthorize";
|
|
124
158
|
useHeaders?: boolean | undefined;
|
|
125
159
|
useSession: string;
|
|
160
|
+
useSiteSession?: boolean | undefined;
|
|
126
161
|
}, action: PayloadAction<boolean>) => void;
|
|
127
162
|
}, "auth", "auth", import("@reduxjs/toolkit").SliceSelectors<AuthState>>;
|
|
128
163
|
declare const _default: import("redux").Reducer<AuthState>;
|
|
129
164
|
export default _default;
|
|
130
|
-
export declare const logout: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"auth/logout">, setAccessToken: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, "auth/setAccessToken">, generateNonce: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"auth/generateNonce">, setSiteUrl: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "auth/setSiteUrl">, setUserConfigSiteUrl: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "auth/setUserConfigSiteUrl">, setUseSession: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "auth/setUseSession">, setUseHeaders: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "auth/setUseHeaders">, setAuthStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<"authenticated" | "unauthenticated" | "restoreSession" | "requestLogin" | "waitForAuthorize", "auth/setAuthStatus">;
|
|
165
|
+
export declare const logout: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"auth/logout">, setAccessToken: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, "auth/setAccessToken">, generateNonce: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"auth/generateNonce">, setSiteUrl: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "auth/setSiteUrl">, setUserConfigSiteUrl: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "auth/setUserConfigSiteUrl">, setUseSession: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "auth/setUseSession">, setUseHeaders: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "auth/setUseHeaders">, setAuthStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<"authenticated" | "unauthenticated" | "restoreSession" | "requestLogin" | "waitForAuthorize", "auth/setAuthStatus">, setSiteSession: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, "auth/setSiteSession">;
|
|
131
166
|
export declare const authenticatedSelector: (rootState: RootState) => boolean;
|
|
132
167
|
export declare const accessKeySelector: (rootState: RootState) => string | undefined;
|
|
133
168
|
export declare const accessTokenSelector: (rootState: RootState) => string | undefined;
|
|
@@ -139,6 +174,7 @@ export declare const nonceSelector: (rootState: RootState) => string | undefined
|
|
|
139
174
|
export declare const authStateSelector: (rootState: RootState) => "authenticated" | "unauthenticated" | "restoreSession" | "requestLogin" | "waitForAuthorize";
|
|
140
175
|
export declare const applySessionSelector: (rootState: RootState) => string;
|
|
141
176
|
export declare const applyHeadersSelector: (rootState: RootState) => boolean;
|
|
177
|
+
export declare const siteSessionSelector: (rootState: RootState) => boolean;
|
|
142
178
|
export declare const appAuthUrlSelector: (rootState: RootState) => string;
|
|
143
179
|
export declare const cancelAuth: import("@reduxjs/toolkit").AsyncThunk<void, void, import("@reduxjs/toolkit").AsyncThunkConfig>;
|
|
144
180
|
export declare const oAuth: import("@reduxjs/toolkit").AsyncThunk<OAuthRes, {
|
|
@@ -16,6 +16,7 @@ type FetchAndMergeAssetsControllerOptions = {
|
|
|
16
16
|
defaultSortOrderName: string;
|
|
17
17
|
token: string;
|
|
18
18
|
useSession: string;
|
|
19
|
+
useSiteSession?: boolean;
|
|
19
20
|
};
|
|
20
21
|
type FetchAndMergeAssetsControllerDataOptions = {
|
|
21
22
|
allowedExtensions: string[];
|
|
@@ -37,6 +38,8 @@ export declare class FetchAndMergeAssetsController implements ReactiveController
|
|
|
37
38
|
private isLoggedIn;
|
|
38
39
|
private token;
|
|
39
40
|
private useSession;
|
|
41
|
+
private useSiteSession;
|
|
42
|
+
private baseUrl;
|
|
40
43
|
private pendingTokenRefresh;
|
|
41
44
|
private resolvePendingTokenRefresh;
|
|
42
45
|
private readonly tokenRefreshTimeoutMs;
|
|
@@ -49,8 +52,18 @@ export declare class FetchAndMergeAssetsController implements ReactiveController
|
|
|
49
52
|
private readonly defaultIsSeeThrough;
|
|
50
53
|
private requestInterceptorId;
|
|
51
54
|
private responseInterceptorId;
|
|
52
|
-
constructor(host: CortexElement, { availableDocTypes, baseUrl, defaultFolderId, defaultIsSeeThrough, defaultSearchText, defaultSelectedFacets, defaultSortDirection, defaultSortOrderName, token, useSession, }: FetchAndMergeAssetsControllerOptions);
|
|
55
|
+
constructor(host: CortexElement, { availableDocTypes, baseUrl, defaultFolderId, defaultIsSeeThrough, defaultSearchText, defaultSelectedFacets, defaultSortDirection, defaultSortOrderName, token, useSession, useSiteSession, }: FetchAndMergeAssetsControllerOptions);
|
|
53
56
|
private waitForNewToken;
|
|
57
|
+
/**
|
|
58
|
+
* Site-session mode decides the transport (cookies on the Cortex origin vs. Token/UseSession
|
|
59
|
+
* params), so it has to be applied to the interceptor state and base URL, not just captured once.
|
|
60
|
+
*/
|
|
61
|
+
private applyTransportMode;
|
|
62
|
+
/**
|
|
63
|
+
* `setSiteSession(...)` can flip the mode while the host stays mounted, so keep the transport in
|
|
64
|
+
* step with the UI instead of serving requests through the mode the controller was built with.
|
|
65
|
+
*/
|
|
66
|
+
updateSiteSession(useSiteSession: boolean, baseUrl: string, token: string, useSession: string): void;
|
|
54
67
|
updateAuth(token: string, useSession: string): void;
|
|
55
68
|
private fetchInitialData;
|
|
56
69
|
private _debounceTimeout;
|
|
@@ -70,6 +83,7 @@ export declare class FetchAndMergeAssetsController implements ReactiveController
|
|
|
70
83
|
fetchAssetByID(id: string, options?: {
|
|
71
84
|
allowedExtensions?: string[];
|
|
72
85
|
canFavorite?: boolean;
|
|
86
|
+
simplePick?: boolean;
|
|
73
87
|
}): Promise<{
|
|
74
88
|
asset: {
|
|
75
89
|
allowATSLink: boolean;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const SITE_SESSION_EXPIRED_MESSAGE = "Your Cortex site session has expired. Sign in to the site and reopen the content browser.";
|
|
2
|
+
export declare const resolveSiteSessionUrl: (baseUrl?: string) => string;
|
|
3
|
+
export declare const getSiteSessionRequestUrl: (baseUrl: string, resource: string) => string;
|
package/package.json
CHANGED