@bcrumbs.net/bc-api 0.0.43 → 0.0.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/index.cjs.js +115 -51
- package/index.esm.js +114 -52
- package/package.json +1 -1
- package/src/index.d.ts +1 -0
- package/src/lib/clients/authClient.d.ts +2 -0
- package/src/lib/config/index.d.ts +11 -0
- package/src/lib/endpoints/graphql/config/index.d.ts +1 -1
- package/src/lib/endpoints/rest/showcase/index.d.ts +1 -1
package/index.cjs.js
CHANGED
|
@@ -2040,6 +2040,7 @@ function initBackendsLocations() {
|
|
|
2040
2040
|
exports.apiBackend = 'https://api.bcrumbs.net';
|
|
2041
2041
|
exports.apiV2Backend = 'https://apiv2.bcrumbs.net';
|
|
2042
2042
|
showcaseRenderer = 'https://test-showcase.bcrumbs.net';
|
|
2043
|
+
gateway = 'https://gateway.bcrumbs.net';
|
|
2043
2044
|
break;
|
|
2044
2045
|
case 'test':
|
|
2045
2046
|
dBackend = 'https://query.bcrumbs.net';
|
|
@@ -2047,6 +2048,7 @@ function initBackendsLocations() {
|
|
|
2047
2048
|
exports.apiBackend = 'https://api.bcrumbs.net';
|
|
2048
2049
|
exports.apiV2Backend = 'apiv2-dev.bcrumbs.net';
|
|
2049
2050
|
showcaseRenderer = 'https://test-showcase.bcrumbs.net';
|
|
2051
|
+
gateway = 'https://gateway.bcrumbs.net';
|
|
2050
2052
|
break;
|
|
2051
2053
|
case 'local':
|
|
2052
2054
|
dBackend = 'https://localhost:44322';
|
|
@@ -2054,6 +2056,7 @@ function initBackendsLocations() {
|
|
|
2054
2056
|
exports.apiBackend = 'http://localhost:6085';
|
|
2055
2057
|
exports.apiV2Backend = 'https://apiv2-dev.bcrumbs.net';
|
|
2056
2058
|
showcaseRenderer = 'https://test-showcase.bcrumbs.net';
|
|
2059
|
+
gateway = 'https://gateway.bcrumbs.net';
|
|
2057
2060
|
break;
|
|
2058
2061
|
default:
|
|
2059
2062
|
if (currentUrl && currentUrl.indexOf('localhost') > -1) {
|
|
@@ -2062,24 +2065,28 @@ function initBackendsLocations() {
|
|
|
2062
2065
|
exports.apiBackend = 'https://api.bcrumbs.net';
|
|
2063
2066
|
exports.apiV2Backend = 'https://apiv2.bcrumbs.net';
|
|
2064
2067
|
showcaseRenderer = 'https://test-showcase.bcrumbs.net';
|
|
2068
|
+
gateway = 'https://gateway.bcrumbs.net';
|
|
2065
2069
|
} else if (currentUrl && currentUrl.indexOf('dconfig.com') > -1) {
|
|
2066
2070
|
dBackend = 'https://query.bcrumbs.net';
|
|
2067
2071
|
exports.frontend = 'https://app.bcrumbs.net';
|
|
2068
2072
|
exports.apiBackend = 'https://api.bcrumbs.net';
|
|
2069
2073
|
exports.apiV2Backend = 'https://apiv2.bcrumbs.net';
|
|
2070
2074
|
showcaseRenderer = 'https://test-showcase.bcrumbs.net';
|
|
2075
|
+
gateway = 'https://gateway.bcrumbs.net';
|
|
2071
2076
|
} else if (currentUrl && currentUrl.indexOf('dev.bcrumbs.net') > -1) {
|
|
2072
2077
|
dBackend = 'https://query.bcrumbs.net';
|
|
2073
2078
|
exports.frontend = 'https://dev.bcrumbs.net';
|
|
2074
2079
|
exports.apiBackend = 'https://api.bcrumbs.net';
|
|
2075
2080
|
exports.apiV2Backend = 'https://apiv2.bcrumbs.net';
|
|
2076
2081
|
showcaseRenderer = 'https://test-showcase.bcrumbs.net';
|
|
2082
|
+
gateway = 'https://gateway.bcrumbs.net';
|
|
2077
2083
|
} else {
|
|
2078
2084
|
dBackend = 'https://query.bcrumbs.net';
|
|
2079
2085
|
exports.frontend = 'https://app.bcrumbs.net';
|
|
2080
2086
|
exports.apiBackend = 'https://api.bcrumbs.net';
|
|
2081
2087
|
exports.apiV2Backend = 'https://apiv2.bcrumbs.net';
|
|
2082
2088
|
showcaseRenderer = 'https://test-showcase.bcrumbs.net';
|
|
2089
|
+
gateway = 'https://gateway.bcrumbs.net';
|
|
2083
2090
|
}
|
|
2084
2091
|
break;
|
|
2085
2092
|
}
|
|
@@ -2091,6 +2098,7 @@ let dBackend;
|
|
|
2091
2098
|
exports.apiBackend = void 0;
|
|
2092
2099
|
exports.apiV2Backend = void 0;
|
|
2093
2100
|
let showcaseRenderer;
|
|
2101
|
+
let gateway;
|
|
2094
2102
|
let api;
|
|
2095
2103
|
initBackendsLocations();
|
|
2096
2104
|
const appConfig = {
|
|
@@ -2104,19 +2112,44 @@ const appConfig = {
|
|
|
2104
2112
|
networkInterface: showcaseRenderer
|
|
2105
2113
|
},
|
|
2106
2114
|
billing: {
|
|
2107
|
-
networkInterface:
|
|
2115
|
+
networkInterface: gateway + '/billing'
|
|
2108
2116
|
},
|
|
2109
2117
|
core: {
|
|
2110
|
-
networkInterface:
|
|
2118
|
+
networkInterface: gateway + '/core'
|
|
2111
2119
|
},
|
|
2112
2120
|
bot: {
|
|
2113
|
-
networkInterface:
|
|
2121
|
+
networkInterface: gateway + '/bot'
|
|
2122
|
+
},
|
|
2123
|
+
auth: {
|
|
2124
|
+
networkInterface: gateway + '/auth'
|
|
2114
2125
|
},
|
|
2115
2126
|
// sw path
|
|
2116
2127
|
sw: {
|
|
2117
2128
|
path: 'assets/sw.js'
|
|
2118
2129
|
}
|
|
2119
2130
|
};
|
|
2131
|
+
/**
|
|
2132
|
+
* Gets the partner name from build-time configuration
|
|
2133
|
+
* The partner can be set via:
|
|
2134
|
+
* - window.__PARTNER__ (set at build time via webpack DefinePlugin or script tag)
|
|
2135
|
+
* - window._env_.PARTNER (if using env.sh script)
|
|
2136
|
+
* @returns Partner name if configured, undefined otherwise
|
|
2137
|
+
*/
|
|
2138
|
+
function getPartner() {
|
|
2139
|
+
var _a;
|
|
2140
|
+
if (typeof window === 'undefined') {
|
|
2141
|
+
return undefined;
|
|
2142
|
+
}
|
|
2143
|
+
// Check window.__PARTNER__ first (can be set via webpack DefinePlugin)
|
|
2144
|
+
if (window.__PARTNER__) {
|
|
2145
|
+
return window.__PARTNER__;
|
|
2146
|
+
}
|
|
2147
|
+
// Check window._env_.PARTNER (if using env.sh script)
|
|
2148
|
+
if ((_a = window._env_) === null || _a === void 0 ? void 0 : _a.PARTNER) {
|
|
2149
|
+
return window._env_.PARTNER;
|
|
2150
|
+
}
|
|
2151
|
+
return undefined;
|
|
2152
|
+
}
|
|
2120
2153
|
|
|
2121
2154
|
var wellKnownSymbol$b = wellKnownSymbol$h;
|
|
2122
2155
|
var create$1 = objectCreate;
|
|
@@ -3796,23 +3829,29 @@ const getErrorHandler = () => currentErrorHandler;
|
|
|
3796
3829
|
const handleHandler = (...args) => {
|
|
3797
3830
|
return currentErrorHandler(...args);
|
|
3798
3831
|
};
|
|
3832
|
+
// Get partner from build-time configuration
|
|
3799
3833
|
const handleAuth = (operation_1, _a) => __awaiter(void 0, [operation_1, _a], void 0, function* (operation, {
|
|
3800
3834
|
headers
|
|
3801
3835
|
}) {
|
|
3802
3836
|
const currentUsertoken = yield getUserToken();
|
|
3803
3837
|
const isAPIKey = (currentUsertoken === null || currentUsertoken === void 0 ? void 0 : currentUsertoken.length) === 36;
|
|
3838
|
+
const partner = getPartner();
|
|
3804
3839
|
if (headers === undefined) {
|
|
3805
3840
|
headers = {};
|
|
3806
3841
|
}
|
|
3842
|
+
const baseHeaders = Object.assign(Object.assign({}, headers), {
|
|
3843
|
+
Accept: 'application/json'
|
|
3844
|
+
});
|
|
3845
|
+
// Add partner header if domain matches a partner
|
|
3846
|
+
if (partner) {
|
|
3847
|
+
baseHeaders['partner'] = partner;
|
|
3848
|
+
}
|
|
3807
3849
|
const resultHeaders = currentUsertoken ? {
|
|
3808
|
-
headers: Object.assign(Object.assign({},
|
|
3809
|
-
Accept: 'application/json',
|
|
3850
|
+
headers: Object.assign(Object.assign({}, baseHeaders), {
|
|
3810
3851
|
Authorization: isAPIKey ? currentUsertoken : `Bearer ${currentUsertoken}`
|
|
3811
3852
|
})
|
|
3812
3853
|
} : {
|
|
3813
|
-
headers:
|
|
3814
|
-
Accept: 'application/json'
|
|
3815
|
-
})
|
|
3854
|
+
headers: baseHeaders
|
|
3816
3855
|
};
|
|
3817
3856
|
return resultHeaders;
|
|
3818
3857
|
});
|
|
@@ -3853,9 +3892,9 @@ const redirectToLogin = () => {
|
|
|
3853
3892
|
};
|
|
3854
3893
|
|
|
3855
3894
|
const {
|
|
3856
|
-
networkInterface: uri$
|
|
3895
|
+
networkInterface: uri$5
|
|
3857
3896
|
} = appConfig.dconfig;
|
|
3858
|
-
const authLink$
|
|
3897
|
+
const authLink$3 = context.setContext((operation_1, _a) => __awaiter(void 0, [operation_1, _a], void 0, function* (operation, {
|
|
3859
3898
|
headers
|
|
3860
3899
|
}) {
|
|
3861
3900
|
const currentUsertoken = yield getUserToken();
|
|
@@ -3879,8 +3918,8 @@ const authLink$2 = context.setContext((operation_1, _a) => __awaiter(void 0, [op
|
|
|
3879
3918
|
};
|
|
3880
3919
|
return resultHeaders;
|
|
3881
3920
|
}));
|
|
3882
|
-
const cache$
|
|
3883
|
-
const errorLink$
|
|
3921
|
+
const cache$5 = new client.InMemoryCache();
|
|
3922
|
+
const errorLink$4 = error.onError(({
|
|
3884
3923
|
networkError
|
|
3885
3924
|
}) => {
|
|
3886
3925
|
if (networkError && networkError.statusCode === 401) {
|
|
@@ -3899,10 +3938,10 @@ const errorLink$3 = error.onError(({
|
|
|
3899
3938
|
}
|
|
3900
3939
|
});
|
|
3901
3940
|
/* eslint-disable no-process-env */
|
|
3902
|
-
const isDevEnv$
|
|
3941
|
+
const isDevEnv$5 = process.env['NODE_ENV'] !== 'production';
|
|
3903
3942
|
/* eslint-enable no-process-env */
|
|
3904
3943
|
const link_dconfig = new apolloLinkRest.RestLink({
|
|
3905
|
-
uri: uri$
|
|
3944
|
+
uri: uri$5 || 'https://api.bcrumbs.net',
|
|
3906
3945
|
bodySerializers: {
|
|
3907
3946
|
fileEncode: (data, headers) => {
|
|
3908
3947
|
const formData = new FormData();
|
|
@@ -3916,9 +3955,9 @@ const link_dconfig = new apolloLinkRest.RestLink({
|
|
|
3916
3955
|
}
|
|
3917
3956
|
});
|
|
3918
3957
|
const dconfigClient = new client.ApolloClient({
|
|
3919
|
-
link: client.from([authLink$
|
|
3920
|
-
cache: cache$
|
|
3921
|
-
connectToDevTools: isDevEnv$
|
|
3958
|
+
link: client.from([authLink$3, errorLink$4, link_dconfig]),
|
|
3959
|
+
cache: cache$5,
|
|
3960
|
+
connectToDevTools: isDevEnv$5,
|
|
3922
3961
|
queryDeduplication: true
|
|
3923
3962
|
});
|
|
3924
3963
|
const formSerializer = (data, headers) => {
|
|
@@ -3936,13 +3975,13 @@ const formSerializer = (data, headers) => {
|
|
|
3936
3975
|
};
|
|
3937
3976
|
};
|
|
3938
3977
|
const link_dconfig_token = new apolloLinkRest.RestLink({
|
|
3939
|
-
uri: uri$
|
|
3978
|
+
uri: uri$5 || 'https://api.bcrumbs.net',
|
|
3940
3979
|
defaultSerializer: formSerializer
|
|
3941
3980
|
});
|
|
3942
3981
|
const tokenClient = new client.ApolloClient({
|
|
3943
|
-
link: client.from([link_dconfig_token, errorLink$
|
|
3944
|
-
cache: cache$
|
|
3945
|
-
connectToDevTools: isDevEnv$
|
|
3982
|
+
link: client.from([link_dconfig_token, errorLink$4]),
|
|
3983
|
+
cache: cache$5,
|
|
3984
|
+
connectToDevTools: isDevEnv$5
|
|
3946
3985
|
});
|
|
3947
3986
|
|
|
3948
3987
|
let _$8 = t => t,
|
|
@@ -4045,23 +4084,23 @@ const useModelChildrenQuery = (parentId, templateId) => client.useQuery(viewType
|
|
|
4045
4084
|
});
|
|
4046
4085
|
|
|
4047
4086
|
const {
|
|
4048
|
-
networkInterface: uri$
|
|
4087
|
+
networkInterface: uri$4
|
|
4049
4088
|
} = appConfig.dquery;
|
|
4050
|
-
const cache$
|
|
4051
|
-
const errorLink$
|
|
4089
|
+
const cache$4 = new client.InMemoryCache();
|
|
4090
|
+
const errorLink$3 = error.onError(handleHandler);
|
|
4052
4091
|
/* eslint-disable no-process-env */
|
|
4053
|
-
const isDevEnv$
|
|
4092
|
+
const isDevEnv$4 = process.env['NODE_ENV'] !== 'production';
|
|
4054
4093
|
/* eslint-enable no-process-env */
|
|
4055
4094
|
const link_dquery$1 = client.createHttpLink({
|
|
4056
|
-
uri: uri$
|
|
4095
|
+
uri: uri$4,
|
|
4057
4096
|
fetchOptions: {
|
|
4058
4097
|
mode: 'cors'
|
|
4059
4098
|
}
|
|
4060
4099
|
});
|
|
4061
4100
|
const dqueryClient = new client.ApolloClient({
|
|
4062
|
-
link: client.from([errorLink$
|
|
4063
|
-
cache: cache$
|
|
4064
|
-
connectToDevTools: isDevEnv$
|
|
4101
|
+
link: client.from([errorLink$3, link_dquery$1]),
|
|
4102
|
+
cache: cache$4,
|
|
4103
|
+
connectToDevTools: isDevEnv$4,
|
|
4065
4104
|
queryDeduplication: true
|
|
4066
4105
|
});
|
|
4067
4106
|
|
|
@@ -4072,12 +4111,13 @@ const portalThemeConfig = gql(_t$7 || (_t$7 = _$7`
|
|
|
4072
4111
|
configuration(type: "portalTheme", domain: $domain)
|
|
4073
4112
|
}
|
|
4074
4113
|
`));
|
|
4075
|
-
const usePortalThemeConfig = domain => client.useQuery(portalThemeConfig, {
|
|
4114
|
+
const usePortalThemeConfig = (domain, skip = false) => client.useQuery(portalThemeConfig, {
|
|
4076
4115
|
fetchPolicy: 'cache-first',
|
|
4077
4116
|
client: dqueryClient,
|
|
4078
4117
|
variables: {
|
|
4079
4118
|
domain
|
|
4080
|
-
}
|
|
4119
|
+
},
|
|
4120
|
+
skip
|
|
4081
4121
|
});
|
|
4082
4122
|
|
|
4083
4123
|
let _$6 = t => t,
|
|
@@ -5382,19 +5422,19 @@ const useUpdateContentsOrderingMutation = () => client.useMutation(updateContent
|
|
|
5382
5422
|
});
|
|
5383
5423
|
|
|
5384
5424
|
const {
|
|
5385
|
-
networkInterface: uri$
|
|
5425
|
+
networkInterface: uri$3
|
|
5386
5426
|
} = appConfig.showcase;
|
|
5387
|
-
const cache$
|
|
5427
|
+
const cache$3 = new client.InMemoryCache();
|
|
5388
5428
|
/* eslint-disable no-process-env */
|
|
5389
|
-
const isDevEnv$
|
|
5429
|
+
const isDevEnv$3 = process.env['NODE_ENV'] !== 'production';
|
|
5390
5430
|
/* eslint-enable no-process-env */
|
|
5391
5431
|
const link$1 = new apolloLinkRest.RestLink({
|
|
5392
|
-
uri: uri$
|
|
5432
|
+
uri: uri$3 || "https://api.bcrumbs.net"
|
|
5393
5433
|
});
|
|
5394
5434
|
const showcaseRendererClient = new client.ApolloClient({
|
|
5395
5435
|
link: link$1,
|
|
5396
|
-
cache: cache$
|
|
5397
|
-
connectToDevTools: isDevEnv$
|
|
5436
|
+
cache: cache$3,
|
|
5437
|
+
connectToDevTools: isDevEnv$3,
|
|
5398
5438
|
queryDeduplication: true
|
|
5399
5439
|
});
|
|
5400
5440
|
|
|
@@ -5467,13 +5507,13 @@ const menuConfigurationQuery = gql(_t2$1 || (_t2$1 = _$1`
|
|
|
5467
5507
|
)
|
|
5468
5508
|
}
|
|
5469
5509
|
`));
|
|
5470
|
-
const useMenuConfigurationQuery = ContextId => client.useQuery(menuConfigurationQuery, {
|
|
5510
|
+
const useMenuConfigurationQuery = (ContextId, skip = false) => client.useQuery(menuConfigurationQuery, {
|
|
5471
5511
|
fetchPolicy: 'cache-first',
|
|
5472
5512
|
client: dconfigClient,
|
|
5473
5513
|
variables: {
|
|
5474
5514
|
ContextId
|
|
5475
5515
|
},
|
|
5476
|
-
skip: !ContextId
|
|
5516
|
+
skip: !ContextId || skip
|
|
5477
5517
|
});
|
|
5478
5518
|
const addDomain = gql(_t3$1 || (_t3$1 = _$1`
|
|
5479
5519
|
mutation ($rootContent: String!, $body: JSON!) {
|
|
@@ -87434,22 +87474,22 @@ const showcaseClient = new client.ApolloClient({
|
|
|
87434
87474
|
});
|
|
87435
87475
|
|
|
87436
87476
|
const {
|
|
87437
|
-
networkInterface: uri$
|
|
87477
|
+
networkInterface: uri$2
|
|
87438
87478
|
} = appConfig.core;
|
|
87439
|
-
const authLink$
|
|
87440
|
-
const cache$
|
|
87441
|
-
const errorLink$
|
|
87479
|
+
const authLink$2 = context.setContext(handleAuth);
|
|
87480
|
+
const cache$2 = new client.InMemoryCache();
|
|
87481
|
+
const errorLink$2 = error.onError(handleHandler);
|
|
87442
87482
|
/* eslint-disable no-process-env */
|
|
87443
|
-
const isDevEnv$
|
|
87483
|
+
const isDevEnv$2 = process.env['NODE_ENV'] !== 'production';
|
|
87444
87484
|
/* eslint-enable no-process-env */
|
|
87445
87485
|
const httpLink = client.createHttpLink({
|
|
87446
|
-
uri: `${uri$
|
|
87486
|
+
uri: `${uri$2}/gq`,
|
|
87447
87487
|
fetchOptions: {
|
|
87448
87488
|
mode: 'cors'
|
|
87449
87489
|
}
|
|
87450
87490
|
});
|
|
87451
87491
|
const batchLink = new batchHttp.BatchHttpLink({
|
|
87452
|
-
uri: `${uri$
|
|
87492
|
+
uri: `${uri$2}/gq`,
|
|
87453
87493
|
batchMax: 5,
|
|
87454
87494
|
// Max number of operations in a single batch
|
|
87455
87495
|
batchInterval: 200,
|
|
@@ -87466,7 +87506,29 @@ const splitLink = client.split(({
|
|
|
87466
87506
|
return definition.kind === 'OperationDefinition' && definition.operation === 'query';
|
|
87467
87507
|
}, batchLink, httpLink);
|
|
87468
87508
|
const coreClient = new client.ApolloClient({
|
|
87469
|
-
link: client.from([authLink$
|
|
87509
|
+
link: client.from([authLink$2, errorLink$2, splitLink]),
|
|
87510
|
+
cache: cache$2,
|
|
87511
|
+
connectToDevTools: isDevEnv$2,
|
|
87512
|
+
queryDeduplication: true
|
|
87513
|
+
});
|
|
87514
|
+
|
|
87515
|
+
const {
|
|
87516
|
+
networkInterface: uri$1
|
|
87517
|
+
} = appConfig.bot;
|
|
87518
|
+
const authLink$1 = context.setContext(handleAuth);
|
|
87519
|
+
const cache$1 = new client.InMemoryCache();
|
|
87520
|
+
const errorLink$1 = error.onError(handleHandler);
|
|
87521
|
+
/* eslint-disable no-process-env */
|
|
87522
|
+
const isDevEnv$1 = process.env['NODE_ENV'] !== 'production';
|
|
87523
|
+
/* eslint-enable no-process-env */
|
|
87524
|
+
const link_dquery = client.createHttpLink({
|
|
87525
|
+
uri: `${uri$1}/gq`,
|
|
87526
|
+
fetchOptions: {
|
|
87527
|
+
mode: 'cors'
|
|
87528
|
+
}
|
|
87529
|
+
});
|
|
87530
|
+
const botClient = new client.ApolloClient({
|
|
87531
|
+
link: client.from([authLink$1, errorLink$1, link_dquery]),
|
|
87470
87532
|
cache: cache$1,
|
|
87471
87533
|
connectToDevTools: isDevEnv$1,
|
|
87472
87534
|
queryDeduplication: true
|
|
@@ -87474,21 +87536,21 @@ const coreClient = new client.ApolloClient({
|
|
|
87474
87536
|
|
|
87475
87537
|
const {
|
|
87476
87538
|
networkInterface: uri
|
|
87477
|
-
} = appConfig.
|
|
87539
|
+
} = appConfig.auth;
|
|
87478
87540
|
const authLink = context.setContext(handleAuth);
|
|
87479
87541
|
const cache = new client.InMemoryCache();
|
|
87480
87542
|
const errorLink = error.onError(handleHandler);
|
|
87481
87543
|
/* eslint-disable no-process-env */
|
|
87482
87544
|
const isDevEnv = process.env['NODE_ENV'] !== 'production';
|
|
87483
87545
|
/* eslint-enable no-process-env */
|
|
87484
|
-
const
|
|
87546
|
+
const link_auth = client.createHttpLink({
|
|
87485
87547
|
uri: `${uri}/gq`,
|
|
87486
87548
|
fetchOptions: {
|
|
87487
87549
|
mode: 'cors'
|
|
87488
87550
|
}
|
|
87489
87551
|
});
|
|
87490
|
-
const
|
|
87491
|
-
link: client.from([authLink, errorLink,
|
|
87552
|
+
const authClient = new client.ApolloClient({
|
|
87553
|
+
link: client.from([authLink, errorLink, link_auth]),
|
|
87492
87554
|
cache,
|
|
87493
87555
|
connectToDevTools: isDevEnv,
|
|
87494
87556
|
queryDeduplication: true
|
|
@@ -87555,6 +87617,7 @@ exports.VALIDATE_COMPANY_NAME = VALIDATE_COMPANY_NAME;
|
|
|
87555
87617
|
exports.addDomain = addDomain;
|
|
87556
87618
|
exports.addDomainOptions = addDomainOptions;
|
|
87557
87619
|
exports.appConfig = appConfig;
|
|
87620
|
+
exports.authClient = authClient;
|
|
87558
87621
|
exports.botClient = botClient;
|
|
87559
87622
|
exports.clearAuthData = clearAuthData;
|
|
87560
87623
|
exports.companyUsersQuery = companyUsersQuery;
|
|
@@ -87576,6 +87639,7 @@ exports.foldersTreeQuery = foldersTreeQuery;
|
|
|
87576
87639
|
exports.forgetPassword = forgetPassword;
|
|
87577
87640
|
exports.forgetPasswordOptions = forgetPasswordOptions;
|
|
87578
87641
|
exports.getErrorHandler = getErrorHandler;
|
|
87642
|
+
exports.getPartner = getPartner;
|
|
87579
87643
|
exports.getUserContext = getUserContext;
|
|
87580
87644
|
exports.getUserToken = getUserToken;
|
|
87581
87645
|
exports.handleAuth = handleAuth;
|
package/index.esm.js
CHANGED
|
@@ -2038,6 +2038,7 @@ function initBackendsLocations() {
|
|
|
2038
2038
|
apiBackend = 'https://api.bcrumbs.net';
|
|
2039
2039
|
apiV2Backend = 'https://apiv2.bcrumbs.net';
|
|
2040
2040
|
showcaseRenderer = 'https://test-showcase.bcrumbs.net';
|
|
2041
|
+
gateway = 'https://gateway.bcrumbs.net';
|
|
2041
2042
|
break;
|
|
2042
2043
|
case 'test':
|
|
2043
2044
|
dBackend = 'https://query.bcrumbs.net';
|
|
@@ -2045,6 +2046,7 @@ function initBackendsLocations() {
|
|
|
2045
2046
|
apiBackend = 'https://api.bcrumbs.net';
|
|
2046
2047
|
apiV2Backend = 'apiv2-dev.bcrumbs.net';
|
|
2047
2048
|
showcaseRenderer = 'https://test-showcase.bcrumbs.net';
|
|
2049
|
+
gateway = 'https://gateway.bcrumbs.net';
|
|
2048
2050
|
break;
|
|
2049
2051
|
case 'local':
|
|
2050
2052
|
dBackend = 'https://localhost:44322';
|
|
@@ -2052,6 +2054,7 @@ function initBackendsLocations() {
|
|
|
2052
2054
|
apiBackend = 'http://localhost:6085';
|
|
2053
2055
|
apiV2Backend = 'https://apiv2-dev.bcrumbs.net';
|
|
2054
2056
|
showcaseRenderer = 'https://test-showcase.bcrumbs.net';
|
|
2057
|
+
gateway = 'https://gateway.bcrumbs.net';
|
|
2055
2058
|
break;
|
|
2056
2059
|
default:
|
|
2057
2060
|
if (currentUrl && currentUrl.indexOf('localhost') > -1) {
|
|
@@ -2060,24 +2063,28 @@ function initBackendsLocations() {
|
|
|
2060
2063
|
apiBackend = 'https://api.bcrumbs.net';
|
|
2061
2064
|
apiV2Backend = 'https://apiv2.bcrumbs.net';
|
|
2062
2065
|
showcaseRenderer = 'https://test-showcase.bcrumbs.net';
|
|
2066
|
+
gateway = 'https://gateway.bcrumbs.net';
|
|
2063
2067
|
} else if (currentUrl && currentUrl.indexOf('dconfig.com') > -1) {
|
|
2064
2068
|
dBackend = 'https://query.bcrumbs.net';
|
|
2065
2069
|
frontend = 'https://app.bcrumbs.net';
|
|
2066
2070
|
apiBackend = 'https://api.bcrumbs.net';
|
|
2067
2071
|
apiV2Backend = 'https://apiv2.bcrumbs.net';
|
|
2068
2072
|
showcaseRenderer = 'https://test-showcase.bcrumbs.net';
|
|
2073
|
+
gateway = 'https://gateway.bcrumbs.net';
|
|
2069
2074
|
} else if (currentUrl && currentUrl.indexOf('dev.bcrumbs.net') > -1) {
|
|
2070
2075
|
dBackend = 'https://query.bcrumbs.net';
|
|
2071
2076
|
frontend = 'https://dev.bcrumbs.net';
|
|
2072
2077
|
apiBackend = 'https://api.bcrumbs.net';
|
|
2073
2078
|
apiV2Backend = 'https://apiv2.bcrumbs.net';
|
|
2074
2079
|
showcaseRenderer = 'https://test-showcase.bcrumbs.net';
|
|
2080
|
+
gateway = 'https://gateway.bcrumbs.net';
|
|
2075
2081
|
} else {
|
|
2076
2082
|
dBackend = 'https://query.bcrumbs.net';
|
|
2077
2083
|
frontend = 'https://app.bcrumbs.net';
|
|
2078
2084
|
apiBackend = 'https://api.bcrumbs.net';
|
|
2079
2085
|
apiV2Backend = 'https://apiv2.bcrumbs.net';
|
|
2080
2086
|
showcaseRenderer = 'https://test-showcase.bcrumbs.net';
|
|
2087
|
+
gateway = 'https://gateway.bcrumbs.net';
|
|
2081
2088
|
}
|
|
2082
2089
|
break;
|
|
2083
2090
|
}
|
|
@@ -2089,6 +2096,7 @@ let dBackend;
|
|
|
2089
2096
|
let apiBackend;
|
|
2090
2097
|
let apiV2Backend;
|
|
2091
2098
|
let showcaseRenderer;
|
|
2099
|
+
let gateway;
|
|
2092
2100
|
let api;
|
|
2093
2101
|
initBackendsLocations();
|
|
2094
2102
|
const appConfig = {
|
|
@@ -2102,19 +2110,44 @@ const appConfig = {
|
|
|
2102
2110
|
networkInterface: showcaseRenderer
|
|
2103
2111
|
},
|
|
2104
2112
|
billing: {
|
|
2105
|
-
networkInterface:
|
|
2113
|
+
networkInterface: gateway + '/billing'
|
|
2106
2114
|
},
|
|
2107
2115
|
core: {
|
|
2108
|
-
networkInterface:
|
|
2116
|
+
networkInterface: gateway + '/core'
|
|
2109
2117
|
},
|
|
2110
2118
|
bot: {
|
|
2111
|
-
networkInterface:
|
|
2119
|
+
networkInterface: gateway + '/bot'
|
|
2120
|
+
},
|
|
2121
|
+
auth: {
|
|
2122
|
+
networkInterface: gateway + '/auth'
|
|
2112
2123
|
},
|
|
2113
2124
|
// sw path
|
|
2114
2125
|
sw: {
|
|
2115
2126
|
path: 'assets/sw.js'
|
|
2116
2127
|
}
|
|
2117
2128
|
};
|
|
2129
|
+
/**
|
|
2130
|
+
* Gets the partner name from build-time configuration
|
|
2131
|
+
* The partner can be set via:
|
|
2132
|
+
* - window.__PARTNER__ (set at build time via webpack DefinePlugin or script tag)
|
|
2133
|
+
* - window._env_.PARTNER (if using env.sh script)
|
|
2134
|
+
* @returns Partner name if configured, undefined otherwise
|
|
2135
|
+
*/
|
|
2136
|
+
function getPartner() {
|
|
2137
|
+
var _a;
|
|
2138
|
+
if (typeof window === 'undefined') {
|
|
2139
|
+
return undefined;
|
|
2140
|
+
}
|
|
2141
|
+
// Check window.__PARTNER__ first (can be set via webpack DefinePlugin)
|
|
2142
|
+
if (window.__PARTNER__) {
|
|
2143
|
+
return window.__PARTNER__;
|
|
2144
|
+
}
|
|
2145
|
+
// Check window._env_.PARTNER (if using env.sh script)
|
|
2146
|
+
if ((_a = window._env_) === null || _a === void 0 ? void 0 : _a.PARTNER) {
|
|
2147
|
+
return window._env_.PARTNER;
|
|
2148
|
+
}
|
|
2149
|
+
return undefined;
|
|
2150
|
+
}
|
|
2118
2151
|
|
|
2119
2152
|
var wellKnownSymbol$b = wellKnownSymbol$h;
|
|
2120
2153
|
var create$1 = objectCreate;
|
|
@@ -3794,23 +3827,29 @@ const getErrorHandler = () => currentErrorHandler;
|
|
|
3794
3827
|
const handleHandler = (...args) => {
|
|
3795
3828
|
return currentErrorHandler(...args);
|
|
3796
3829
|
};
|
|
3830
|
+
// Get partner from build-time configuration
|
|
3797
3831
|
const handleAuth = (operation_1, _a) => __awaiter(void 0, [operation_1, _a], void 0, function* (operation, {
|
|
3798
3832
|
headers
|
|
3799
3833
|
}) {
|
|
3800
3834
|
const currentUsertoken = yield getUserToken();
|
|
3801
3835
|
const isAPIKey = (currentUsertoken === null || currentUsertoken === void 0 ? void 0 : currentUsertoken.length) === 36;
|
|
3836
|
+
const partner = getPartner();
|
|
3802
3837
|
if (headers === undefined) {
|
|
3803
3838
|
headers = {};
|
|
3804
3839
|
}
|
|
3840
|
+
const baseHeaders = Object.assign(Object.assign({}, headers), {
|
|
3841
|
+
Accept: 'application/json'
|
|
3842
|
+
});
|
|
3843
|
+
// Add partner header if domain matches a partner
|
|
3844
|
+
if (partner) {
|
|
3845
|
+
baseHeaders['partner'] = partner;
|
|
3846
|
+
}
|
|
3805
3847
|
const resultHeaders = currentUsertoken ? {
|
|
3806
|
-
headers: Object.assign(Object.assign({},
|
|
3807
|
-
Accept: 'application/json',
|
|
3848
|
+
headers: Object.assign(Object.assign({}, baseHeaders), {
|
|
3808
3849
|
Authorization: isAPIKey ? currentUsertoken : `Bearer ${currentUsertoken}`
|
|
3809
3850
|
})
|
|
3810
3851
|
} : {
|
|
3811
|
-
headers:
|
|
3812
|
-
Accept: 'application/json'
|
|
3813
|
-
})
|
|
3852
|
+
headers: baseHeaders
|
|
3814
3853
|
};
|
|
3815
3854
|
return resultHeaders;
|
|
3816
3855
|
});
|
|
@@ -3851,9 +3890,9 @@ const redirectToLogin = () => {
|
|
|
3851
3890
|
};
|
|
3852
3891
|
|
|
3853
3892
|
const {
|
|
3854
|
-
networkInterface: uri$
|
|
3893
|
+
networkInterface: uri$5
|
|
3855
3894
|
} = appConfig.dconfig;
|
|
3856
|
-
const authLink$
|
|
3895
|
+
const authLink$3 = setContext((operation_1, _a) => __awaiter(void 0, [operation_1, _a], void 0, function* (operation, {
|
|
3857
3896
|
headers
|
|
3858
3897
|
}) {
|
|
3859
3898
|
const currentUsertoken = yield getUserToken();
|
|
@@ -3877,8 +3916,8 @@ const authLink$2 = setContext((operation_1, _a) => __awaiter(void 0, [operation_
|
|
|
3877
3916
|
};
|
|
3878
3917
|
return resultHeaders;
|
|
3879
3918
|
}));
|
|
3880
|
-
const cache$
|
|
3881
|
-
const errorLink$
|
|
3919
|
+
const cache$5 = new InMemoryCache();
|
|
3920
|
+
const errorLink$4 = onError(({
|
|
3882
3921
|
networkError
|
|
3883
3922
|
}) => {
|
|
3884
3923
|
if (networkError && networkError.statusCode === 401) {
|
|
@@ -3897,10 +3936,10 @@ const errorLink$3 = onError(({
|
|
|
3897
3936
|
}
|
|
3898
3937
|
});
|
|
3899
3938
|
/* eslint-disable no-process-env */
|
|
3900
|
-
const isDevEnv$
|
|
3939
|
+
const isDevEnv$5 = process.env['NODE_ENV'] !== 'production';
|
|
3901
3940
|
/* eslint-enable no-process-env */
|
|
3902
3941
|
const link_dconfig = new RestLink({
|
|
3903
|
-
uri: uri$
|
|
3942
|
+
uri: uri$5 || 'https://api.bcrumbs.net',
|
|
3904
3943
|
bodySerializers: {
|
|
3905
3944
|
fileEncode: (data, headers) => {
|
|
3906
3945
|
const formData = new FormData();
|
|
@@ -3914,9 +3953,9 @@ const link_dconfig = new RestLink({
|
|
|
3914
3953
|
}
|
|
3915
3954
|
});
|
|
3916
3955
|
const dconfigClient = new ApolloClient({
|
|
3917
|
-
link: from([authLink$
|
|
3918
|
-
cache: cache$
|
|
3919
|
-
connectToDevTools: isDevEnv$
|
|
3956
|
+
link: from([authLink$3, errorLink$4, link_dconfig]),
|
|
3957
|
+
cache: cache$5,
|
|
3958
|
+
connectToDevTools: isDevEnv$5,
|
|
3920
3959
|
queryDeduplication: true
|
|
3921
3960
|
});
|
|
3922
3961
|
const formSerializer = (data, headers) => {
|
|
@@ -3934,13 +3973,13 @@ const formSerializer = (data, headers) => {
|
|
|
3934
3973
|
};
|
|
3935
3974
|
};
|
|
3936
3975
|
const link_dconfig_token = new RestLink({
|
|
3937
|
-
uri: uri$
|
|
3976
|
+
uri: uri$5 || 'https://api.bcrumbs.net',
|
|
3938
3977
|
defaultSerializer: formSerializer
|
|
3939
3978
|
});
|
|
3940
3979
|
const tokenClient = new ApolloClient({
|
|
3941
|
-
link: from([link_dconfig_token, errorLink$
|
|
3942
|
-
cache: cache$
|
|
3943
|
-
connectToDevTools: isDevEnv$
|
|
3980
|
+
link: from([link_dconfig_token, errorLink$4]),
|
|
3981
|
+
cache: cache$5,
|
|
3982
|
+
connectToDevTools: isDevEnv$5
|
|
3944
3983
|
});
|
|
3945
3984
|
|
|
3946
3985
|
let _$8 = t => t,
|
|
@@ -4043,23 +4082,23 @@ const useModelChildrenQuery = (parentId, templateId) => useQuery(viewTypeChildre
|
|
|
4043
4082
|
});
|
|
4044
4083
|
|
|
4045
4084
|
const {
|
|
4046
|
-
networkInterface: uri$
|
|
4085
|
+
networkInterface: uri$4
|
|
4047
4086
|
} = appConfig.dquery;
|
|
4048
|
-
const cache$
|
|
4049
|
-
const errorLink$
|
|
4087
|
+
const cache$4 = new InMemoryCache();
|
|
4088
|
+
const errorLink$3 = onError(handleHandler);
|
|
4050
4089
|
/* eslint-disable no-process-env */
|
|
4051
|
-
const isDevEnv$
|
|
4090
|
+
const isDevEnv$4 = process.env['NODE_ENV'] !== 'production';
|
|
4052
4091
|
/* eslint-enable no-process-env */
|
|
4053
4092
|
const link_dquery$1 = createHttpLink({
|
|
4054
|
-
uri: uri$
|
|
4093
|
+
uri: uri$4,
|
|
4055
4094
|
fetchOptions: {
|
|
4056
4095
|
mode: 'cors'
|
|
4057
4096
|
}
|
|
4058
4097
|
});
|
|
4059
4098
|
const dqueryClient = new ApolloClient({
|
|
4060
|
-
link: from([errorLink$
|
|
4061
|
-
cache: cache$
|
|
4062
|
-
connectToDevTools: isDevEnv$
|
|
4099
|
+
link: from([errorLink$3, link_dquery$1]),
|
|
4100
|
+
cache: cache$4,
|
|
4101
|
+
connectToDevTools: isDevEnv$4,
|
|
4063
4102
|
queryDeduplication: true
|
|
4064
4103
|
});
|
|
4065
4104
|
|
|
@@ -4070,12 +4109,13 @@ const portalThemeConfig = gql(_t$7 || (_t$7 = _$7`
|
|
|
4070
4109
|
configuration(type: "portalTheme", domain: $domain)
|
|
4071
4110
|
}
|
|
4072
4111
|
`));
|
|
4073
|
-
const usePortalThemeConfig = domain => useQuery(portalThemeConfig, {
|
|
4112
|
+
const usePortalThemeConfig = (domain, skip = false) => useQuery(portalThemeConfig, {
|
|
4074
4113
|
fetchPolicy: 'cache-first',
|
|
4075
4114
|
client: dqueryClient,
|
|
4076
4115
|
variables: {
|
|
4077
4116
|
domain
|
|
4078
|
-
}
|
|
4117
|
+
},
|
|
4118
|
+
skip
|
|
4079
4119
|
});
|
|
4080
4120
|
|
|
4081
4121
|
let _$6 = t => t,
|
|
@@ -5380,19 +5420,19 @@ const useUpdateContentsOrderingMutation = () => useMutation(updateContentsOrderi
|
|
|
5380
5420
|
});
|
|
5381
5421
|
|
|
5382
5422
|
const {
|
|
5383
|
-
networkInterface: uri$
|
|
5423
|
+
networkInterface: uri$3
|
|
5384
5424
|
} = appConfig.showcase;
|
|
5385
|
-
const cache$
|
|
5425
|
+
const cache$3 = new InMemoryCache();
|
|
5386
5426
|
/* eslint-disable no-process-env */
|
|
5387
|
-
const isDevEnv$
|
|
5427
|
+
const isDevEnv$3 = process.env['NODE_ENV'] !== 'production';
|
|
5388
5428
|
/* eslint-enable no-process-env */
|
|
5389
5429
|
const link$1 = new RestLink({
|
|
5390
|
-
uri: uri$
|
|
5430
|
+
uri: uri$3 || "https://api.bcrumbs.net"
|
|
5391
5431
|
});
|
|
5392
5432
|
const showcaseRendererClient = new ApolloClient({
|
|
5393
5433
|
link: link$1,
|
|
5394
|
-
cache: cache$
|
|
5395
|
-
connectToDevTools: isDevEnv$
|
|
5434
|
+
cache: cache$3,
|
|
5435
|
+
connectToDevTools: isDevEnv$3,
|
|
5396
5436
|
queryDeduplication: true
|
|
5397
5437
|
});
|
|
5398
5438
|
|
|
@@ -5465,13 +5505,13 @@ const menuConfigurationQuery = gql(_t2$1 || (_t2$1 = _$1`
|
|
|
5465
5505
|
)
|
|
5466
5506
|
}
|
|
5467
5507
|
`));
|
|
5468
|
-
const useMenuConfigurationQuery = ContextId => useQuery(menuConfigurationQuery, {
|
|
5508
|
+
const useMenuConfigurationQuery = (ContextId, skip = false) => useQuery(menuConfigurationQuery, {
|
|
5469
5509
|
fetchPolicy: 'cache-first',
|
|
5470
5510
|
client: dconfigClient,
|
|
5471
5511
|
variables: {
|
|
5472
5512
|
ContextId
|
|
5473
5513
|
},
|
|
5474
|
-
skip: !ContextId
|
|
5514
|
+
skip: !ContextId || skip
|
|
5475
5515
|
});
|
|
5476
5516
|
const addDomain = gql(_t3$1 || (_t3$1 = _$1`
|
|
5477
5517
|
mutation ($rootContent: String!, $body: JSON!) {
|
|
@@ -87432,22 +87472,22 @@ const showcaseClient = new ApolloClient({
|
|
|
87432
87472
|
});
|
|
87433
87473
|
|
|
87434
87474
|
const {
|
|
87435
|
-
networkInterface: uri$
|
|
87475
|
+
networkInterface: uri$2
|
|
87436
87476
|
} = appConfig.core;
|
|
87437
|
-
const authLink$
|
|
87438
|
-
const cache$
|
|
87439
|
-
const errorLink$
|
|
87477
|
+
const authLink$2 = setContext(handleAuth);
|
|
87478
|
+
const cache$2 = new InMemoryCache();
|
|
87479
|
+
const errorLink$2 = onError(handleHandler);
|
|
87440
87480
|
/* eslint-disable no-process-env */
|
|
87441
|
-
const isDevEnv$
|
|
87481
|
+
const isDevEnv$2 = process.env['NODE_ENV'] !== 'production';
|
|
87442
87482
|
/* eslint-enable no-process-env */
|
|
87443
87483
|
const httpLink = createHttpLink({
|
|
87444
|
-
uri: `${uri$
|
|
87484
|
+
uri: `${uri$2}/gq`,
|
|
87445
87485
|
fetchOptions: {
|
|
87446
87486
|
mode: 'cors'
|
|
87447
87487
|
}
|
|
87448
87488
|
});
|
|
87449
87489
|
const batchLink = new BatchHttpLink({
|
|
87450
|
-
uri: `${uri$
|
|
87490
|
+
uri: `${uri$2}/gq`,
|
|
87451
87491
|
batchMax: 5,
|
|
87452
87492
|
// Max number of operations in a single batch
|
|
87453
87493
|
batchInterval: 200,
|
|
@@ -87464,7 +87504,29 @@ const splitLink = split$1(({
|
|
|
87464
87504
|
return definition.kind === 'OperationDefinition' && definition.operation === 'query';
|
|
87465
87505
|
}, batchLink, httpLink);
|
|
87466
87506
|
const coreClient = new ApolloClient({
|
|
87467
|
-
link: from([authLink$
|
|
87507
|
+
link: from([authLink$2, errorLink$2, splitLink]),
|
|
87508
|
+
cache: cache$2,
|
|
87509
|
+
connectToDevTools: isDevEnv$2,
|
|
87510
|
+
queryDeduplication: true
|
|
87511
|
+
});
|
|
87512
|
+
|
|
87513
|
+
const {
|
|
87514
|
+
networkInterface: uri$1
|
|
87515
|
+
} = appConfig.bot;
|
|
87516
|
+
const authLink$1 = setContext(handleAuth);
|
|
87517
|
+
const cache$1 = new InMemoryCache();
|
|
87518
|
+
const errorLink$1 = onError(handleHandler);
|
|
87519
|
+
/* eslint-disable no-process-env */
|
|
87520
|
+
const isDevEnv$1 = process.env['NODE_ENV'] !== 'production';
|
|
87521
|
+
/* eslint-enable no-process-env */
|
|
87522
|
+
const link_dquery = createHttpLink({
|
|
87523
|
+
uri: `${uri$1}/gq`,
|
|
87524
|
+
fetchOptions: {
|
|
87525
|
+
mode: 'cors'
|
|
87526
|
+
}
|
|
87527
|
+
});
|
|
87528
|
+
const botClient = new ApolloClient({
|
|
87529
|
+
link: from([authLink$1, errorLink$1, link_dquery]),
|
|
87468
87530
|
cache: cache$1,
|
|
87469
87531
|
connectToDevTools: isDevEnv$1,
|
|
87470
87532
|
queryDeduplication: true
|
|
@@ -87472,21 +87534,21 @@ const coreClient = new ApolloClient({
|
|
|
87472
87534
|
|
|
87473
87535
|
const {
|
|
87474
87536
|
networkInterface: uri
|
|
87475
|
-
} = appConfig.
|
|
87537
|
+
} = appConfig.auth;
|
|
87476
87538
|
const authLink = setContext(handleAuth);
|
|
87477
87539
|
const cache = new InMemoryCache();
|
|
87478
87540
|
const errorLink = onError(handleHandler);
|
|
87479
87541
|
/* eslint-disable no-process-env */
|
|
87480
87542
|
const isDevEnv = process.env['NODE_ENV'] !== 'production';
|
|
87481
87543
|
/* eslint-enable no-process-env */
|
|
87482
|
-
const
|
|
87544
|
+
const link_auth = createHttpLink({
|
|
87483
87545
|
uri: `${uri}/gq`,
|
|
87484
87546
|
fetchOptions: {
|
|
87485
87547
|
mode: 'cors'
|
|
87486
87548
|
}
|
|
87487
87549
|
});
|
|
87488
|
-
const
|
|
87489
|
-
link: from([authLink, errorLink,
|
|
87550
|
+
const authClient = new ApolloClient({
|
|
87551
|
+
link: from([authLink, errorLink, link_auth]),
|
|
87490
87552
|
cache,
|
|
87491
87553
|
connectToDevTools: isDevEnv,
|
|
87492
87554
|
queryDeduplication: true
|
|
@@ -87546,4 +87608,4 @@ var ModelFieldsTypes;
|
|
|
87546
87608
|
ModelFieldsTypes["JSON"] = "JSON";
|
|
87547
87609
|
})(ModelFieldsTypes || (ModelFieldsTypes = {}));
|
|
87548
87610
|
|
|
87549
|
-
export { CreateCheckoutSessionUri, CreatePortalSessionUri, ModelFieldsTypes, ModelUtilities, VALIDATE_COMPANY_NAME, addDomain, addDomainOptions, apiBackend, apiV2Backend, appConfig, botClient, clearAuthData, companyUsersQuery, contentInstancesQuery, coreClient, createCompany, createContentInstanceMutation, createContentInstanceMutationOptions, createContentMutation, createContentMutationOptions, createFileMutation, createFolderMutation, dconfigClient, deleteFileMutation, deleteFolderMutation, dqueryClient, filesQuery, foldersTreeQuery, forgetPassword, forgetPasswordOptions, frontend, getErrorHandler, getUserContext, getUserToken, handleAuth, handleHandler, inviteUser, inviteUserOptions, login, loginOptions, menuConfigurationQuery, portalThemeConfig, querySectionThumb, queryUsage, redirectToLogin, registeUsage, register, registerOptions, removeContentMutation, removeDomain, removeDomainOptions, removeUserFromCompany, removeUserFromCompanyOptions, resetPassword, resetPasswordOptions, setErrorHandler, showcaseClient, showcaseConfig, showcaseConfigById, showcaseConfigurationQuery, showcaseConfigurationQueryOptions, showcaseContentsQuery, showcaseContext, showcaseDomainsQuery, showcasePagesQuery, showcaseSectionQuery, showcaseSectionsQuery, showcaseTemplateSectionsThumbsMap, showcaseTemplatesQuery, showcaseTemplatesQueryOptions, subscriptionConfigurationQuery, subscriptionConfigurationQueryOptions, tokenClient, updateCompany, updateCompanyOptions, updateContentInstanceFieldValuesMutation, updateContentInstanceFieldValuesMutationOptions, updateContentsOrderingMutation, updateContentsOrderingMutationOptions, updateTemplateSectionThumb, updateUserPassword, updateUserPasswordOptions, updateUserProfile, updateUserProfileOptions, useContentInstancesQuery, useCreateCompanyMutation, useCreateContentInstanceMutation, useCreateContentMutation, useCreateFileMutation, useCreateFolderMutation, useDeleteContentMutation, useDeleteFileMutation, useDeleteFolderMutation, useDomainsQuery, useFilesQuery, useFoldersTreeQuery, useMenuConfigurationQuery, useModelChildrenQuery, useModelsQuery, usePortalThemeConfig, useQuerySectionThumb, useQueryUsage, useRegisterUsage, useShowcaseConfig, useShowcaseConfigById, useShowcaseConfigurationQuery, useShowcaseContentsQuery, useShowcaseContext, useShowcasePagesQuery, useShowcaseSectionQuery, useShowcaseSectionsQuery, useShowcaseTemplate, useShowcaseTemplateOptions, useShowcaseTemplateProgress, useShowcaseTemplateProgressQuery, useTemplateSectionsThumbsMap, useUpdateContentInstanceFieldValuesMutation, useUpdateContentsOrderingMutation, useUserCompaniesQuery, useValidateCompanyName, userCompaniesQuery, userCompaniesQueryOptions, userInfoQuery, userInfoQueryOptions, viewTypeChildrenQuery, viewTypeChildrenQueryOptions, viewTypesQuery, viewTypesQueryOptions };
|
|
87611
|
+
export { CreateCheckoutSessionUri, CreatePortalSessionUri, ModelFieldsTypes, ModelUtilities, VALIDATE_COMPANY_NAME, addDomain, addDomainOptions, apiBackend, apiV2Backend, appConfig, authClient, botClient, clearAuthData, companyUsersQuery, contentInstancesQuery, coreClient, createCompany, createContentInstanceMutation, createContentInstanceMutationOptions, createContentMutation, createContentMutationOptions, createFileMutation, createFolderMutation, dconfigClient, deleteFileMutation, deleteFolderMutation, dqueryClient, filesQuery, foldersTreeQuery, forgetPassword, forgetPasswordOptions, frontend, getErrorHandler, getPartner, getUserContext, getUserToken, handleAuth, handleHandler, inviteUser, inviteUserOptions, login, loginOptions, menuConfigurationQuery, portalThemeConfig, querySectionThumb, queryUsage, redirectToLogin, registeUsage, register, registerOptions, removeContentMutation, removeDomain, removeDomainOptions, removeUserFromCompany, removeUserFromCompanyOptions, resetPassword, resetPasswordOptions, setErrorHandler, showcaseClient, showcaseConfig, showcaseConfigById, showcaseConfigurationQuery, showcaseConfigurationQueryOptions, showcaseContentsQuery, showcaseContext, showcaseDomainsQuery, showcasePagesQuery, showcaseSectionQuery, showcaseSectionsQuery, showcaseTemplateSectionsThumbsMap, showcaseTemplatesQuery, showcaseTemplatesQueryOptions, subscriptionConfigurationQuery, subscriptionConfigurationQueryOptions, tokenClient, updateCompany, updateCompanyOptions, updateContentInstanceFieldValuesMutation, updateContentInstanceFieldValuesMutationOptions, updateContentsOrderingMutation, updateContentsOrderingMutationOptions, updateTemplateSectionThumb, updateUserPassword, updateUserPasswordOptions, updateUserProfile, updateUserProfileOptions, useContentInstancesQuery, useCreateCompanyMutation, useCreateContentInstanceMutation, useCreateContentMutation, useCreateFileMutation, useCreateFolderMutation, useDeleteContentMutation, useDeleteFileMutation, useDeleteFolderMutation, useDomainsQuery, useFilesQuery, useFoldersTreeQuery, useMenuConfigurationQuery, useModelChildrenQuery, useModelsQuery, usePortalThemeConfig, useQuerySectionThumb, useQueryUsage, useRegisterUsage, useShowcaseConfig, useShowcaseConfigById, useShowcaseConfigurationQuery, useShowcaseContentsQuery, useShowcaseContext, useShowcasePagesQuery, useShowcaseSectionQuery, useShowcaseSectionsQuery, useShowcaseTemplate, useShowcaseTemplateOptions, useShowcaseTemplateProgress, useShowcaseTemplateProgressQuery, useTemplateSectionsThumbsMap, useUpdateContentInstanceFieldValuesMutation, useUpdateContentsOrderingMutation, useUserCompaniesQuery, useValidateCompanyName, userCompaniesQuery, userCompaniesQueryOptions, userInfoQuery, userInfoQueryOptions, viewTypeChildrenQuery, viewTypeChildrenQueryOptions, viewTypesQuery, viewTypesQueryOptions };
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from './lib/clients/dqueryClient';
|
|
|
13
13
|
export * from './lib/clients/showcaseClient';
|
|
14
14
|
export * from './lib/clients/coreClient';
|
|
15
15
|
export * from './lib/clients/botClient';
|
|
16
|
+
export * from './lib/clients/authClient';
|
|
16
17
|
export * from './lib/models/contentInstance';
|
|
17
18
|
export * from './lib/models/model';
|
|
18
19
|
export * from './lib/models/file';
|
|
@@ -20,9 +20,20 @@ export declare const appConfig: {
|
|
|
20
20
|
bot: {
|
|
21
21
|
networkInterface: string;
|
|
22
22
|
};
|
|
23
|
+
auth: {
|
|
24
|
+
networkInterface: string;
|
|
25
|
+
};
|
|
23
26
|
sw: {
|
|
24
27
|
path: string;
|
|
25
28
|
};
|
|
26
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* Gets the partner name from build-time configuration
|
|
32
|
+
* The partner can be set via:
|
|
33
|
+
* - window.__PARTNER__ (set at build time via webpack DefinePlugin or script tag)
|
|
34
|
+
* - window._env_.PARTNER (if using env.sh script)
|
|
35
|
+
* @returns Partner name if configured, undefined otherwise
|
|
36
|
+
*/
|
|
37
|
+
export declare function getPartner(): string | undefined;
|
|
27
38
|
export default appConfig;
|
|
28
39
|
export { frontend, apiBackend, apiV2Backend };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const portalThemeConfig: import("@apollo/client").DocumentNode;
|
|
2
|
-
export declare const usePortalThemeConfig: (domain: string) => import("@apollo/client").QueryResult<any, import("@apollo/client").OperationVariables>;
|
|
2
|
+
export declare const usePortalThemeConfig: (domain: string, skip?: boolean) => import("@apollo/client").QueryResult<any, import("@apollo/client").OperationVariables>;
|
|
@@ -3,7 +3,7 @@ export declare const showcaseConfigurationQuery: import("@apollo/client").Docume
|
|
|
3
3
|
export declare const useShowcaseConfigurationQuery: (ContextId: number) => import("@apollo/client").QueryResult<any, import("@apollo/client").OperationVariables>;
|
|
4
4
|
export declare const showcaseConfigurationQueryOptions: any;
|
|
5
5
|
export declare const menuConfigurationQuery: import("@apollo/client").DocumentNode;
|
|
6
|
-
export declare const useMenuConfigurationQuery: (ContextId?: number) => import("@apollo/client").QueryResult<any, import("@apollo/client").OperationVariables>;
|
|
6
|
+
export declare const useMenuConfigurationQuery: (ContextId?: number, skip?: boolean) => import("@apollo/client").QueryResult<any, import("@apollo/client").OperationVariables>;
|
|
7
7
|
export declare const addDomain: import("@apollo/client").DocumentNode;
|
|
8
8
|
export declare const addDomainOptions: any;
|
|
9
9
|
export declare const removeDomain: import("@apollo/client").DocumentNode;
|