@evergis/api 3.0.200 → 3.0.202
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/Api.d.ts +0 -1
- package/dist/__generated__/AccountService.d.ts +1 -1
- package/dist/__generated__/LayersService.d.ts +2 -2
- package/dist/__generated__/ProjectsService.d.ts +2 -2
- package/dist/__generated__/StatisticService.d.ts +2 -2
- package/dist/__generated__/TablesService.d.ts +2 -2
- package/dist/__generated__/WmsServerService.d.ts +2 -2
- package/dist/__generated__/data-contracts.d.ts +5 -5
- package/dist/api.cjs.development.js +26 -37
- package/dist/api.cjs.development.js.map +1 -1
- package/dist/api.cjs.production.min.js +1 -1
- package/dist/api.cjs.production.min.js.map +1 -1
- package/dist/api.esm.js +24 -38
- package/dist/api.esm.js.map +1 -1
- package/dist/constants.d.ts +2 -0
- package/dist/index.d.ts +10 -9
- package/dist/services/Statistic.d.ts +2 -2
- package/dist/utils/index.d.ts +10 -9
- package/package.json +2 -2
- package/dist/services/constants.d.ts +0 -2
package/dist/api.esm.js
CHANGED
|
@@ -175,15 +175,9 @@ function _get(target, property, receiver) {
|
|
|
175
175
|
return _get(target, property, receiver || target);
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
+
const API_USER_INFO_KEY = '@evergis/user-info';
|
|
178
179
|
const STORAGE_TOKEN_KEY = "evergis-jwt-token";
|
|
179
|
-
const STORAGE_REFRESH_TOKEN_KEY = "evergis-
|
|
180
|
-
|
|
181
|
-
const parseJwt = token => {
|
|
182
|
-
const base64Url = token.split(".")[1];
|
|
183
|
-
const base64 = base64Url.replace(/-/g, "+").replace(/_/g, "/");
|
|
184
|
-
const jsonPayload = decodeURIComponent(atob(base64).split("").map(c => "%" + "00".concat(c.charCodeAt(0).toString(16)).slice(-2)).join(""));
|
|
185
|
-
return JSON.parse(jsonPayload);
|
|
186
|
-
};
|
|
180
|
+
const STORAGE_REFRESH_TOKEN_KEY = "evergis-refresh-token";
|
|
187
181
|
|
|
188
182
|
let HttpClient = /*#__PURE__*/function () {
|
|
189
183
|
function HttpClient(options) {
|
|
@@ -204,30 +198,7 @@ let HttpClient = /*#__PURE__*/function () {
|
|
|
204
198
|
value: function extend(options) {
|
|
205
199
|
var _options$prefixUrl2;
|
|
206
200
|
|
|
207
|
-
this.ky = ky.extend(
|
|
208
|
-
hooks: {
|
|
209
|
-
beforeRequest: [async request => {
|
|
210
|
-
const token = window.localStorage.getItem(STORAGE_TOKEN_KEY);
|
|
211
|
-
const refreshToken = window.localStorage.getItem(STORAGE_REFRESH_TOKEN_KEY);
|
|
212
|
-
|
|
213
|
-
if (token) {
|
|
214
|
-
var _request$headers;
|
|
215
|
-
|
|
216
|
-
const {
|
|
217
|
-
exp
|
|
218
|
-
} = parseJwt(token) || {};
|
|
219
|
-
|
|
220
|
-
if (typeof exp === 'number' && exp - new Date().getTime() < 60 * 1000) {
|
|
221
|
-
await this.post("/account/refresh-token", {
|
|
222
|
-
refreshToken
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
(_request$headers = request.headers) == null ? void 0 : _request$headers.set('Authorization', "Bearer " + (token || ''));
|
|
227
|
-
}
|
|
228
|
-
}]
|
|
229
|
-
}
|
|
230
|
-
}));
|
|
201
|
+
this.ky = ky.extend(options);
|
|
231
202
|
this.prefixUrl = ((_options$prefixUrl2 = options.prefixUrl) == null ? void 0 : _options$prefixUrl2.toString()) || '';
|
|
232
203
|
}
|
|
233
204
|
}, {
|
|
@@ -1208,7 +1179,7 @@ let AccountService = /*#__PURE__*/function (_Service) {
|
|
|
1208
1179
|
}, {
|
|
1209
1180
|
key: "refreshToken",
|
|
1210
1181
|
value: function refreshToken(data) {
|
|
1211
|
-
return this.http.post("/account/refresh-token", data).
|
|
1182
|
+
return this.http.post("/account/refresh-token", data).json();
|
|
1212
1183
|
}
|
|
1213
1184
|
/**
|
|
1214
1185
|
* No description
|
|
@@ -1439,8 +1410,6 @@ let AccountService = /*#__PURE__*/function (_Service) {
|
|
|
1439
1410
|
return AccountService;
|
|
1440
1411
|
}(Service);
|
|
1441
1412
|
|
|
1442
|
-
const API_USER_INFO_KEY = '@evergis/user-info';
|
|
1443
|
-
|
|
1444
1413
|
const getUserInfo = () => JSON.parse(localStorage.getItem(API_USER_INFO_KEY) || 'null') || void 0;
|
|
1445
1414
|
const updateUserInfo = newUserInfo => {
|
|
1446
1415
|
if (newUserInfo) {
|
|
@@ -4713,6 +4682,13 @@ function isString(v) {
|
|
|
4713
4682
|
|
|
4714
4683
|
const addSubDomainToLocation = subDomain => window.location.protocol + "//" + subDomain + "." + window.location.host;
|
|
4715
4684
|
|
|
4685
|
+
const parseJwt = token => {
|
|
4686
|
+
const base64Url = token.split(".")[1];
|
|
4687
|
+
const base64 = base64Url.replace(/-/g, "+").replace(/_/g, "/");
|
|
4688
|
+
const jsonPayload = decodeURIComponent(atob(base64).split("").map(c => "%" + "00".concat(c.charCodeAt(0).toString(16)).slice(-2)).join(""));
|
|
4689
|
+
return JSON.parse(jsonPayload);
|
|
4690
|
+
};
|
|
4691
|
+
|
|
4716
4692
|
function unique(value, index, array) {
|
|
4717
4693
|
return array.indexOf(value) === index;
|
|
4718
4694
|
}
|
|
@@ -7538,6 +7514,8 @@ let Api = /*#__PURE__*/function (_EventEmitter) {
|
|
|
7538
7514
|
var _super = /*#__PURE__*/_createSuper(Api);
|
|
7539
7515
|
|
|
7540
7516
|
function Api(_ref) {
|
|
7517
|
+
var _hooks$beforeRequest;
|
|
7518
|
+
|
|
7541
7519
|
var _this;
|
|
7542
7520
|
|
|
7543
7521
|
let {
|
|
@@ -7561,7 +7539,15 @@ let Api = /*#__PURE__*/function (_EventEmitter) {
|
|
|
7561
7539
|
timeout: false
|
|
7562
7540
|
}, httpOptions || {}, {
|
|
7563
7541
|
hooks: _extends({}, hooks || {}, {
|
|
7564
|
-
beforeRequest: [
|
|
7542
|
+
beforeRequest: [request => {
|
|
7543
|
+
const token = window.localStorage.getItem(STORAGE_TOKEN_KEY);
|
|
7544
|
+
|
|
7545
|
+
if (token) {
|
|
7546
|
+
var _request$headers;
|
|
7547
|
+
|
|
7548
|
+
(_request$headers = request.headers) == null ? void 0 : _request$headers.set('Authorization', "Bearer " + (token || ''));
|
|
7549
|
+
}
|
|
7550
|
+
}, ...((_hooks$beforeRequest = hooks == null ? void 0 : hooks.beforeRequest) != null ? _hooks$beforeRequest : [])],
|
|
7565
7551
|
afterResponse: [response => {
|
|
7566
7552
|
const apiEvent = apiEventsByResponseStatus[response.status];
|
|
7567
7553
|
|
|
@@ -7570,7 +7556,7 @@ let Api = /*#__PURE__*/function (_EventEmitter) {
|
|
|
7570
7556
|
}
|
|
7571
7557
|
|
|
7572
7558
|
return response;
|
|
7573
|
-
}, ...(hooks
|
|
7559
|
+
}, ...((hooks == null ? void 0 : hooks.afterResponse) || [])]
|
|
7574
7560
|
})
|
|
7575
7561
|
}));
|
|
7576
7562
|
_this.url = url;
|
|
@@ -9069,5 +9055,5 @@ var TextVerticalAlignment;
|
|
|
9069
9055
|
TextVerticalAlignment["Middle"] = "middle";
|
|
9070
9056
|
})(TextVerticalAlignment || (TextVerticalAlignment = {}));
|
|
9071
9057
|
|
|
9072
|
-
export { Account, AccountPreview, AggregationFunction, Api, ApiEvent, AttributeIconType, AttributeSelectorType, AttributeType, AuthorizationGrant, BulkOperations, Cameras, CatalogResourceType, ClassificationType, ClassifyAttributeType, ClientSettings, ConfigurationErrorEnum, ConnectionStatus, DataSourceType, DependencyType, Eql, ErrorDetailsType, ErrorReason, ErrorType, EvergisDynamicLayer, EvergisTileLayer, External, FeatureType, Feedback, FileUpload, Filters, FontStyle, FontWeight, GEOCODE_PROVIDER, General, Geocode, GeometryType, Group, HttpClient, IceRouter, Import, Layers, LayersManager, LineCapStyle, LineEndingType, LineJoinType, Names, Namespace, Notification, NotificationEvent, Operation, OwnerFilter, PbfSchema, Permissions, PolicyType, PortalSettings, Print, Projects, Quality, ResourceCatalog, ResourceSeparator, ResourceSubTypeFilter, ResourceType, ResourceTypeFilter, ResourceTypeLink, Resources, ResponseType, Scheduler, Security, ServerTaskStatus, SimplifyType, SpatialProcessor, Statistic, StringSubType, Styles, Tables, TaskGroup, TextAlignment, TextVerticalAlignment, Tools, UrlPath, VectorTiles, addSubDomainToLocation, errorHandler, formDataFromFile, generateId, isEvergisDynamicLayer, isEvergisTileLayer, isFeatureLayer, isHTTPError, isHandledError, isLayer, isProjectContentItems, isString, isTileLayerService, promiseAllIgnoreErrors, stripUselessSlashes, toFormData, unique };
|
|
9058
|
+
export { Account, AccountPreview, AggregationFunction, Api, ApiEvent, AttributeIconType, AttributeSelectorType, AttributeType, AuthorizationGrant, BulkOperations, Cameras, CatalogResourceType, ClassificationType, ClassifyAttributeType, ClientSettings, ConfigurationErrorEnum, ConnectionStatus, DataSourceType, DependencyType, Eql, ErrorDetailsType, ErrorReason, ErrorType, EvergisDynamicLayer, EvergisTileLayer, External, FeatureType, Feedback, FileUpload, Filters, FontStyle, FontWeight, GEOCODE_PROVIDER, General, Geocode, GeometryType, Group, HttpClient, IceRouter, Import, Layers, LayersManager, LineCapStyle, LineEndingType, LineJoinType, Names, Namespace, Notification, NotificationEvent, Operation, OwnerFilter, PbfSchema, Permissions, PolicyType, PortalSettings, Print, Projects, Quality, ResourceCatalog, ResourceSeparator, ResourceSubTypeFilter, ResourceType, ResourceTypeFilter, ResourceTypeLink, Resources, ResponseType, STORAGE_REFRESH_TOKEN_KEY, STORAGE_TOKEN_KEY, Scheduler, Security, ServerTaskStatus, SimplifyType, SpatialProcessor, Statistic, StringSubType, Styles, Tables, TaskGroup, TextAlignment, TextVerticalAlignment, Tools, UrlPath, VectorTiles, addSubDomainToLocation, errorHandler, formDataFromFile, generateId, isEvergisDynamicLayer, isEvergisTileLayer, isFeatureLayer, isHTTPError, isHandledError, isLayer, isProjectContentItems, isString, isTileLayerService, parseJwt, promiseAllIgnoreErrors, stripUselessSlashes, toFormData, unique };
|
|
9073
9059
|
//# sourceMappingURL=api.esm.js.map
|