@commercetools-frontend/application-shell-connectors 22.8.3 → 22.9.1
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/commercetools-frontend-application-shell-connectors.cjs.dev.js +618 -36
- package/dist/commercetools-frontend-application-shell-connectors.cjs.prod.js +612 -36
- package/dist/commercetools-frontend-application-shell-connectors.esm.js +590 -37
- package/dist/declarations/src/apollo-links/error-link.d.ts +2 -0
- package/dist/declarations/src/apollo-links/header-link.d.ts +3 -0
- package/dist/declarations/src/apollo-links/index.d.ts +4 -0
- package/dist/declarations/src/apollo-links/token-retry-link.d.ts +3 -0
- package/dist/declarations/src/apollo-links/utils.d.ts +10 -0
- package/dist/declarations/src/configure-apollo.d.ts +7 -0
- package/dist/declarations/src/export-types.d.ts +9 -0
- package/dist/declarations/src/hooks/apollo-hooks/apollo-hooks.d.ts +13 -0
- package/dist/declarations/src/hooks/apollo-hooks/index.d.ts +1 -0
- package/dist/declarations/src/index.d.ts +6 -1
- package/dist/declarations/src/types/generated/settings.d.ts +223 -29
- package/dist/declarations/src/utils/apollo-client-runtime-cache.d.ts +4 -0
- package/dist/declarations/src/utils/apollo-context.d.ts +15 -0
- package/dist/declarations/src/utils/get-correlation-id/get-correlation-id.d.ts +3 -0
- package/dist/declarations/src/utils/get-correlation-id/index.d.ts +1 -0
- package/dist/declarations/src/utils/http-client.d.ts +31 -0
- package/dist/declarations/src/utils/index.d.ts +7 -0
- package/dist/declarations/src/utils/logger.d.ts +10 -0
- package/dist/declarations/src/utils/oidc-storage.d.ts +11 -0
- package/dist/declarations/src/utils/select-project-key-from-url/index.d.ts +1 -0
- package/dist/declarations/src/utils/select-project-key-from-url/select-project-key-from-url.d.ts +1 -0
- package/dist/declarations/src/utils/select-team-id-from-storage/index.d.ts +1 -0
- package/dist/declarations/src/utils/select-team-id-from-storage/select-team-id-from-storage.d.ts +1 -0
- package/dist/declarations/src/utils/select-user-id/index.d.ts +1 -0
- package/dist/declarations/src/utils/select-user-id/select-user-id.d.ts +1 -0
- package/package.json +13 -4
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type NormalizedCacheObject, ApolloClient } from '@apollo/client';
|
|
2
|
+
declare const setCachedApolloClient: (apolloClient: ApolloClient<NormalizedCacheObject>) => void;
|
|
3
|
+
declare const getCachedApolloClient: () => ApolloClient<NormalizedCacheObject> | undefined;
|
|
4
|
+
export { setCachedApolloClient, getCachedApolloClient };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TGraphQLTargets } from '@commercetools-frontend/constants';
|
|
2
|
+
import type { THeaders, TForwardToConfig } from './http-client';
|
|
3
|
+
export type TApolloContext = {
|
|
4
|
+
uri?: string;
|
|
5
|
+
headers?: THeaders;
|
|
6
|
+
forwardToConfig?: TForwardToConfig;
|
|
7
|
+
skipGraphQlTargetCheck?: boolean;
|
|
8
|
+
skipTokenRetry?: boolean;
|
|
9
|
+
target?: TGraphQLTargets;
|
|
10
|
+
projectKey?: string;
|
|
11
|
+
teamId?: string;
|
|
12
|
+
featureFlag?: string;
|
|
13
|
+
};
|
|
14
|
+
declare const createApolloContextForProxyForwardTo: (proxyForwardTocontext: TForwardToConfig) => TApolloContext;
|
|
15
|
+
export { createApolloContextForProxyForwardTo };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './get-correlation-id';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type THeaders = Record<string, string>;
|
|
2
|
+
export type TForwardToAudiencePolicy = 'forward-url-full-path' | 'forward-url-origin';
|
|
3
|
+
export type TForwardToExchangeTokenClaim = 'permissions';
|
|
4
|
+
export type TForwardToConfigVersion = 'v1' | 'v2';
|
|
5
|
+
export type TForwardToConfig = {
|
|
6
|
+
uri: string;
|
|
7
|
+
headers?: THeaders;
|
|
8
|
+
audiencePolicy?: TForwardToAudiencePolicy;
|
|
9
|
+
includeUserPermissions?: boolean;
|
|
10
|
+
version?: TForwardToConfigVersion;
|
|
11
|
+
};
|
|
12
|
+
export type TConfig = {
|
|
13
|
+
userAgent?: string;
|
|
14
|
+
headers?: THeaders;
|
|
15
|
+
forwardToConfig?: TForwardToConfig;
|
|
16
|
+
projectKey?: string;
|
|
17
|
+
};
|
|
18
|
+
export type TOptions = {
|
|
19
|
+
credentials: 'include';
|
|
20
|
+
headers: THeaders;
|
|
21
|
+
};
|
|
22
|
+
export type TFetcherResponse<Data> = {
|
|
23
|
+
data: Data;
|
|
24
|
+
statusCode: number;
|
|
25
|
+
getHeader: (headerName: string) => string | null;
|
|
26
|
+
};
|
|
27
|
+
export type TFetcher<Data> = (options: TOptions) => Promise<TFetcherResponse<Data>>;
|
|
28
|
+
declare function buildApiUrl(endpoint: string): string;
|
|
29
|
+
declare function createHttpClientOptions(config?: TConfig): TOptions;
|
|
30
|
+
declare function executeHttpClientRequest<Data>(fetcher: TFetcher<Data>, config?: TConfig): Promise<Data>;
|
|
31
|
+
export { buildApiUrl, createHttpClientOptions, executeHttpClientRequest };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as selectTeamIdFromStorage } from './select-team-id-from-storage';
|
|
2
|
+
export { default as selectProjectKeyFromUrl } from './select-project-key-from-url';
|
|
3
|
+
export { default as selectUserId } from './select-user-id';
|
|
4
|
+
export { default as getCorrelationId } from './get-correlation-id';
|
|
5
|
+
export { default as getMcApiUrl } from './get-mc-api-url';
|
|
6
|
+
export { createApolloContextForProxyForwardTo } from './apollo-context';
|
|
7
|
+
export { isLoggerEnabled, default as logger } from './logger';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const isLoggerEnabled: () => boolean;
|
|
2
|
+
declare const logger: {
|
|
3
|
+
groupCollapsed(groupTitle?: string, ...optionalParams: unknown[]): void;
|
|
4
|
+
groupEnd(): void;
|
|
5
|
+
info(message?: unknown, ...optionalParams: unknown[]): void;
|
|
6
|
+
log(message?: unknown, ...optionalParams: unknown[]): void;
|
|
7
|
+
error(message?: unknown, ...optionalParams: unknown[]): void;
|
|
8
|
+
warn(message?: unknown, ...optionalParams: unknown[]): void;
|
|
9
|
+
};
|
|
10
|
+
export default logger;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const getSessionToken: () => string | null;
|
|
2
|
+
declare const setActiveSession: (sessionToken?: string) => void;
|
|
3
|
+
declare const clearSession: () => void;
|
|
4
|
+
declare const getActiveProjectKey: () => string | null;
|
|
5
|
+
declare const removeActiveProjectKey: () => void;
|
|
6
|
+
declare const setActiveProjectKey: (projectKey: string) => void;
|
|
7
|
+
declare const getSessionScope: () => string | null;
|
|
8
|
+
declare const setSessionScope: (scope: string) => void;
|
|
9
|
+
declare const getSessionState: <State extends {}>(stateId?: string) => State | null;
|
|
10
|
+
declare const setSessionState: <State extends {}>(stateId: string, state: State) => void;
|
|
11
|
+
export { getSessionToken, setActiveSession, clearSession, getSessionState, setSessionState, getActiveProjectKey, setActiveProjectKey, removeActiveProjectKey, getSessionScope, setSessionScope, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './select-project-key-from-url';
|
package/dist/declarations/src/utils/select-project-key-from-url/select-project-key-from-url.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function selectProjectKeyFromUrl(locationPath?: string): string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './select-team-id-from-storage';
|
package/dist/declarations/src/utils/select-team-id-from-storage/select-team-id-from-storage.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function selectTeamIdFromStorage(): string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './select-user-id';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function selectUserId(): string | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/application-shell-connectors",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.9.1",
|
|
4
4
|
"description": "Contains complementary tools for @commercetools-frontend/application-shell",
|
|
5
5
|
"bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
6
|
"repository": {
|
|
@@ -37,24 +37,33 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@babel/runtime": "^7.22.15",
|
|
39
39
|
"@babel/runtime-corejs3": "^7.22.15",
|
|
40
|
-
"@commercetools-frontend/
|
|
41
|
-
"@commercetools-frontend/
|
|
40
|
+
"@commercetools-frontend/application-config": "22.9.1",
|
|
41
|
+
"@commercetools-frontend/browser-history": "22.9.1",
|
|
42
|
+
"@commercetools-frontend/constants": "22.9.1",
|
|
43
|
+
"@commercetools-frontend/sentry": "22.9.1",
|
|
44
|
+
"@commercetools/http-user-agent": "3.0.0",
|
|
42
45
|
"@emotion/react": "11.11.0",
|
|
43
46
|
"@types/lodash": "^4.14.198",
|
|
44
47
|
"@types/prop-types": "^15.7.5",
|
|
45
48
|
"@types/react": "^17.0.56",
|
|
49
|
+
"apollo-link-logger": "2.0.1",
|
|
46
50
|
"graphql": "16.8.1",
|
|
47
51
|
"lodash": "4.17.21",
|
|
48
52
|
"moment-timezone": "^0.5.40",
|
|
53
|
+
"omit-empty-es": "1.1.3",
|
|
49
54
|
"prop-types": "15.8.1",
|
|
50
|
-
"tiny-warning": "1.0.3"
|
|
55
|
+
"tiny-warning": "1.0.3",
|
|
56
|
+
"uuid": "9.0.0",
|
|
57
|
+
"wait-for-observables": "1.0.3"
|
|
51
58
|
},
|
|
52
59
|
"devDependencies": {
|
|
53
60
|
"@apollo/client": "3.7.14",
|
|
54
61
|
"@testing-library/react": "12.1.5",
|
|
55
62
|
"@types/jest": "^29.5.4",
|
|
63
|
+
"headers-polyfill": "3.1.2",
|
|
56
64
|
"jest": "29.5.0",
|
|
57
65
|
"jest-mock": "29.5.0",
|
|
66
|
+
"msw": "0.49.3",
|
|
58
67
|
"react": "17.0.2"
|
|
59
68
|
},
|
|
60
69
|
"peerDependencies": {
|