@mapcreator/api 3.2.0 → 3.3.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.
@@ -29,11 +29,11 @@
29
29
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
30
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
31
  *
32
- * hash:137066ba610a3f2911c3, chunkhash:36abec87a7608356106d, name:bundle.browser, version:v3.2.0
32
+ * hash:3e335130ac54b76fcfe7, chunkhash:21bfda8bbd411c86f2b3, name:bundle.browser, version:v3.3.1
33
33
  */
34
34
  /*!
35
35
  * This bundle contains the following packages:
36
- * └─ @mapcreator/api (3.2.0) ── BSD 3-clause "New" or "Revised" License (http://www.opensource.org/licenses/BSD-3-Clause) ── package.json
36
+ * └─ @mapcreator/api (3.3.1) ── BSD 3-clause "New" or "Revised" License (http://www.opensource.org/licenses/BSD-3-Clause) ── package.json
37
37
  * ├─ @babel/runtime (7.10.2) ── MIT License (http://www.opensource.org/licenses/MIT) ── node_modules/@babel/runtime/package.json
38
38
  * │ └─ regenerator-runtime (0.13.5) ── MIT License (http://www.opensource.org/licenses/MIT) ── node_modules/@babel/runtime ~ regenerator-runtime/package.json
39
39
  * ├─ case (1.6.3) ── mit or gpl 3.0 or later ── node_modules/case/package.json
@@ -78,8 +78,8 @@ __webpack_require__.r(__webpack_exports__);
78
78
  /* harmony export */ "mix": () => (/* binding */ mix),
79
79
  /* harmony export */ "hasTrait": () => (/* binding */ hasTrait)
80
80
  /* harmony export */ });
81
- /* harmony import */ var _traits_Trait__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31);
82
- /* harmony import */ var _hash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32);
81
+ /* harmony import */ var _traits_Trait__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(32);
82
+ /* harmony import */ var _hash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33);
83
83
  /*
84
84
  * BSD 3-Clause License
85
85
  *
@@ -431,7 +431,7 @@ __webpack_require__.r(__webpack_exports__);
431
431
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
432
432
  /* harmony export */ "default": () => (/* binding */ CrudBase)
433
433
  /* harmony export */ });
434
- /* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35);
434
+ /* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36);
435
435
  /* harmony import */ var _ResourceBase__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
436
436
  /* harmony import */ var _utils_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1);
437
437
  /*
@@ -477,9 +477,10 @@ class CrudBase extends _ResourceBase__WEBPACK_IMPORTED_MODULE_1__["default"] {
477
477
  /**
478
478
  * @param {Mapcreator} api - Api instance
479
479
  * @param {Object<String, *>} data - Item data
480
+ * @param {String} [altUrl] - Internal use, Optional alternative url for more complex routing
480
481
  */
481
- constructor(api, data = {}) {
482
- super(api, data);
482
+ constructor(api, data = {}, altUrl = null) {
483
+ super(api, data, altUrl);
483
484
 
484
485
  if (this.constructor === CrudBase) {
485
486
  throw new _errors__WEBPACK_IMPORTED_MODULE_0__.AbstractClassError();
@@ -662,13 +663,13 @@ __webpack_require__.r(__webpack_exports__);
662
663
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
663
664
  /* harmony export */ "default": () => (/* binding */ ResourceBase)
664
665
  /* harmony export */ });
665
- /* harmony import */ var case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
666
+ /* harmony import */ var case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5);
666
667
  /* harmony import */ var case__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(case__WEBPACK_IMPORTED_MODULE_0__);
667
668
  /* harmony import */ var _errors_AbstractError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(21);
668
- /* harmony import */ var _Mapcreator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16);
669
- /* harmony import */ var _proxy_SimpleResourceProxy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(14);
669
+ /* harmony import */ var _Mapcreator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17);
670
+ /* harmony import */ var _proxy_SimpleResourceProxy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(15);
670
671
  /* harmony import */ var _traits_Injectable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(65);
671
- /* harmony import */ var _utils_hash__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(32);
672
+ /* harmony import */ var _utils_hash__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(33);
672
673
  /* harmony import */ var _utils_reflection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(0);
673
674
  /* harmony import */ var _utils_helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1);
674
675
  /*
@@ -724,14 +725,19 @@ class ResourceBase extends (0,_utils_reflection__WEBPACK_IMPORTED_MODULE_6__.mix
724
725
  /**
725
726
  * @param {Mapcreator} api - Api instance
726
727
  * @param {Object<String, *>} data - Item data
728
+ * @param {String} [altUrl] - Internal use, Optional alternative url for more complex routing
727
729
  */
728
- constructor(api, data = {}) {
730
+ constructor(api, data = {}, altUrl = null) {
729
731
  super();
730
732
 
731
733
  if (this.constructor === ResourceBase) {
732
734
  throw new _errors_AbstractError__WEBPACK_IMPORTED_MODULE_1__.AbstractClassError();
733
735
  }
734
736
 
737
+ if (altUrl) {
738
+ this.__baseUrl = altUrl;
739
+ }
740
+
735
741
  this.api = api; // De-reference
736
742
 
737
743
  data = (0,_utils_helpers__WEBPACK_IMPORTED_MODULE_7__.clone)(data); // Normalize keys to snake_case
@@ -1032,8 +1038,12 @@ class ResourceBase extends (0,_utils_reflection__WEBPACK_IMPORTED_MODULE_6__.mix
1032
1038
 
1033
1039
 
1034
1040
  get baseUrl() {
1035
- const basePath = this.constructor.resourcePath.match(/^(\/[^{]+\b)/)[1];
1036
- return `${this._api.url}${basePath}`;
1041
+ if (!this.__baseUrl) {
1042
+ const basePath = this.constructor.resourcePath.match(/^(\/[^{]+\b)/)[1];
1043
+ this.__baseUrl = `${this._api.url}${basePath}`;
1044
+ }
1045
+
1046
+ return this.__baseUrl;
1037
1047
  }
1038
1048
  /**
1039
1049
  * List fields that contain object data
@@ -1156,6 +1166,75 @@ class ResourceBase extends (0,_utils_reflection__WEBPACK_IMPORTED_MODULE_6__.mix
1156
1166
 
1157
1167
  /***/ }),
1158
1168
  /* 4 */
1169
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1170
+
1171
+ "use strict";
1172
+ __webpack_require__.r(__webpack_exports__);
1173
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1174
+ /* harmony export */ "default": () => (/* binding */ OwnableResource)
1175
+ /* harmony export */ });
1176
+ /* harmony import */ var _proxy_OrganisationProxy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35);
1177
+ /* harmony import */ var _Trait__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32);
1178
+ /*
1179
+ * BSD 3-Clause License
1180
+ *
1181
+ * Copyright (c) 2020, Mapcreator
1182
+ * All rights reserved.
1183
+ *
1184
+ * Redistribution and use in source and binary forms, with or without
1185
+ * modification, are permitted provided that the following conditions are met:
1186
+ *
1187
+ * Redistributions of source code must retain the above copyright notice, this
1188
+ * list of conditions and the following disclaimer.
1189
+ *
1190
+ * Redistributions in binary form must reproduce the above copyright notice,
1191
+ * this list of conditions and the following disclaimer in the documentation
1192
+ * and/or other materials provided with the distribution.
1193
+ *
1194
+ * Neither the name of the copyright holder nor the names of its
1195
+ * contributors may be used to endorse or promote products derived from
1196
+ * this software without specific prior written permission.
1197
+ *
1198
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
1199
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1200
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
1201
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
1202
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1203
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
1204
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
1205
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
1206
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1207
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1208
+ */
1209
+
1210
+
1211
+ /**
1212
+ * Provides a {@link ResourceBase} with functions for dealing with being ownable by an organisation
1213
+ * @mixin
1214
+ */
1215
+
1216
+ class OwnableResource extends _Trait__WEBPACK_IMPORTED_MODULE_1__["default"] {
1217
+ /**
1218
+ * Get the list of associated organisations
1219
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
1220
+ */
1221
+ get organisations() {
1222
+ return new _proxy_OrganisationProxy__WEBPACK_IMPORTED_MODULE_0__["default"](this.api, this);
1223
+ }
1224
+ /**
1225
+ * If the resource can be owned by an organisation
1226
+ * @returns {boolean} - Can be owned by an organisation
1227
+ */
1228
+
1229
+
1230
+ get ownable() {
1231
+ return true;
1232
+ }
1233
+
1234
+ }
1235
+
1236
+ /***/ }),
1237
+ /* 5 */
1159
1238
  /***/ (function(module) {
1160
1239
 
1161
1240
  /*! Case - v1.6.2 - 2020-03-24
@@ -1332,7 +1411,7 @@ class ResourceBase extends (0,_utils_reflection__WEBPACK_IMPORTED_MODULE_6__.mix
1332
1411
 
1333
1412
 
1334
1413
  /***/ }),
1335
- /* 5 */
1414
+ /* 6 */
1336
1415
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1337
1416
 
1338
1417
  "use strict";
@@ -1460,75 +1539,6 @@ function wrapKyPrefixUrl(fn, baseUrl) {
1460
1539
  };
1461
1540
  }
1462
1541
 
1463
- /***/ }),
1464
- /* 6 */
1465
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1466
-
1467
- "use strict";
1468
- __webpack_require__.r(__webpack_exports__);
1469
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1470
- /* harmony export */ "default": () => (/* binding */ OwnableResource)
1471
- /* harmony export */ });
1472
- /* harmony import */ var _proxy_OrganisationProxy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34);
1473
- /* harmony import */ var _Trait__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31);
1474
- /*
1475
- * BSD 3-Clause License
1476
- *
1477
- * Copyright (c) 2020, Mapcreator
1478
- * All rights reserved.
1479
- *
1480
- * Redistribution and use in source and binary forms, with or without
1481
- * modification, are permitted provided that the following conditions are met:
1482
- *
1483
- * Redistributions of source code must retain the above copyright notice, this
1484
- * list of conditions and the following disclaimer.
1485
- *
1486
- * Redistributions in binary form must reproduce the above copyright notice,
1487
- * this list of conditions and the following disclaimer in the documentation
1488
- * and/or other materials provided with the distribution.
1489
- *
1490
- * Neither the name of the copyright holder nor the names of its
1491
- * contributors may be used to endorse or promote products derived from
1492
- * this software without specific prior written permission.
1493
- *
1494
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
1495
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1496
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
1497
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
1498
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1499
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
1500
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
1501
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
1502
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1503
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1504
- */
1505
-
1506
-
1507
- /**
1508
- * Provides a {@link ResourceBase} with functions for dealing with being ownable by an organisation
1509
- * @mixin
1510
- */
1511
-
1512
- class OwnableResource extends _Trait__WEBPACK_IMPORTED_MODULE_1__["default"] {
1513
- /**
1514
- * Get the list of associated organisations
1515
- * @returns {SimpleResourceProxy} - A proxy for accessing the resource
1516
- */
1517
- get organisations() {
1518
- return new _proxy_OrganisationProxy__WEBPACK_IMPORTED_MODULE_0__["default"](this.api, this);
1519
- }
1520
- /**
1521
- * If the resource can be owned by an organisation
1522
- * @returns {boolean} - Can be owned by an organisation
1523
- */
1524
-
1525
-
1526
- get ownable() {
1527
- return true;
1528
- }
1529
-
1530
- }
1531
-
1532
1542
  /***/ }),
1533
1543
  /* 7 */
1534
1544
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
@@ -1730,14 +1740,14 @@ __webpack_require__.r(__webpack_exports__);
1730
1740
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1731
1741
  /* harmony export */ "default": () => (/* binding */ RequestParameters)
1732
1742
  /* harmony export */ });
1733
- /* harmony import */ var case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
1743
+ /* harmony import */ var case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5);
1734
1744
  /* harmony import */ var case__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(case__WEBPACK_IMPORTED_MODULE_0__);
1735
1745
  /* harmony import */ var events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(24);
1736
1746
  /* harmony import */ var events__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(events__WEBPACK_IMPORTED_MODULE_1__);
1737
1747
  /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
1738
- /* harmony import */ var _utils_hash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(32);
1748
+ /* harmony import */ var _utils_hash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(33);
1739
1749
  /* harmony import */ var _utils_reflection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(0);
1740
- /* harmony import */ var _utils_requests__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5);
1750
+ /* harmony import */ var _utils_requests__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6);
1741
1751
  /*
1742
1752
  * BSD 3-Clause License
1743
1753
  *
@@ -2537,7 +2547,7 @@ __webpack_require__.r(__webpack_exports__);
2537
2547
  /* harmony export */ });
2538
2548
  /* harmony import */ var _errors_AbstractError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(21);
2539
2549
  /* harmony import */ var _CrudBase__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
2540
- /* harmony import */ var case__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4);
2550
+ /* harmony import */ var case__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5);
2541
2551
  /* harmony import */ var case__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(case__WEBPACK_IMPORTED_MODULE_2__);
2542
2552
  /*
2543
2553
  * BSD 3-Clause License
@@ -2582,9 +2592,10 @@ class CrudSetItemBase extends _CrudBase__WEBPACK_IMPORTED_MODULE_1__["default"]
2582
2592
  /**
2583
2593
  * @param {Mapcreator} api - Api instance
2584
2594
  * @param {Object<String, *>} data - Item data
2595
+ * @param {String} [altUrl] - Internal use, Optional alternative url for more complex routing
2585
2596
  */
2586
- constructor(api, data = {}) {
2587
- super(api, data);
2597
+ constructor(api, data = {}, altUrl = null) {
2598
+ super(api, data, altUrl);
2588
2599
 
2589
2600
  if (this.constructor === _CrudBase__WEBPACK_IMPORTED_MODULE_1__["default"]) {
2590
2601
  throw new _errors_AbstractError__WEBPACK_IMPORTED_MODULE_0__.AbstractClassError();
@@ -2635,7 +2646,7 @@ __webpack_require__.d(__webpack_exports__, {
2635
2646
  });
2636
2647
 
2637
2648
  // EXTERNAL MODULE: ./node_modules/case/dist/Case.js
2638
- var Case = __webpack_require__(4);
2649
+ var Case = __webpack_require__(5);
2639
2650
  // EXTERNAL MODULE: ./src/utils/reflection.js
2640
2651
  var reflection = __webpack_require__(0);
2641
2652
  ;// CONCATENATED MODULE: ./src/utils/Unobservable.js
@@ -2849,7 +2860,7 @@ __webpack_require__.r(__webpack_exports__);
2849
2860
  /* harmony export */ "default": () => (/* binding */ OAuthToken)
2850
2861
  /* harmony export */ });
2851
2862
  /* harmony import */ var _storage_StorageManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22);
2852
- /* harmony import */ var _utils_requests__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);
2863
+ /* harmony import */ var _utils_requests__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6);
2853
2864
  /*
2854
2865
  * BSD 3-Clause License
2855
2866
  *
@@ -3032,23 +3043,13 @@ class OAuthToken {
3032
3043
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3033
3044
 
3034
3045
  "use strict";
3035
- // ESM COMPAT FLAG
3036
3046
  __webpack_require__.r(__webpack_exports__);
3037
-
3038
- // EXPORTS
3039
- __webpack_require__.d(__webpack_exports__, {
3040
- "default": () => (/* binding */ SimpleResourceProxy)
3041
- });
3042
-
3043
- // EXTERNAL MODULE: ./src/Mapcreator.js + 1 modules
3044
- var Mapcreator = __webpack_require__(16);
3045
- // EXTERNAL MODULE: ./src/RequestParameters.js
3046
- var RequestParameters = __webpack_require__(8);
3047
- // EXTERNAL MODULE: ./src/utils/reflection.js
3048
- var reflection = __webpack_require__(0);
3049
- // EXTERNAL MODULE: ./src/utils/helpers.js
3050
- var helpers = __webpack_require__(1);
3051
- ;// CONCATENATED MODULE: ./src/PaginatedResourceListing.js
3047
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3048
+ /* harmony export */ "default": () => (/* binding */ ResourceProxy)
3049
+ /* harmony export */ });
3050
+ /* harmony import */ var _utils_requests__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
3051
+ /* harmony import */ var _SimpleResourceProxy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15);
3052
+ /* harmony import */ var _utils_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1);
3052
3053
  /*
3053
3054
  * BSD 3-Clause License
3054
3055
  *
@@ -3083,69 +3084,206 @@ var helpers = __webpack_require__(1);
3083
3084
 
3084
3085
 
3085
3086
 
3086
-
3087
3087
  /**
3088
- * Proxy for accessing paginated resources
3088
+ * Proxy for accessing resource. This will make sure that they
3089
+ * are properly wrapped before the promise resolves.
3090
+ * @protected
3089
3091
  */
3090
3092
 
3091
- class PaginatedResourceListing {
3093
+ class ResourceProxy extends _SimpleResourceProxy__WEBPACK_IMPORTED_MODULE_1__["default"] {
3092
3094
  /**
3093
- * @param {Mapcreator} api - Instance of the api
3094
- * @param {String} route - Resource route
3095
- * @param {Class<ResourceBase>} Target - Wrapper target
3096
- * @param {RequestParameters} parameters - Request parameters
3097
- * @param {Number} pageCount - Resolved page count
3098
- * @param {Number} rowCount - Resolved rowCount
3099
- * @param {Array<ResourceBase>} data - Resolved data
3095
+ * Parse selector
3096
+ * @param {Number|String|Object} [id=] - The resource id to be requested
3097
+ * @returns {Object} - Parsed selector
3100
3098
  * @private
3101
3099
  */
3102
- constructor(api, route, Target, parameters, pageCount = null, rowCount = 0, data = []) {
3103
- if (!(0,reflection.isParentOf)(Mapcreator["default"], api)) {
3104
- throw new TypeError('Expected api to be of type Mapcreator');
3100
+ _parseSelector(id) {
3101
+ if (id === '' || id === null) {
3102
+ return {};
3105
3103
  }
3106
3104
 
3107
- if (!(0,reflection.isParentOf)(RequestParameters["default"], parameters)) {
3108
- parameters = new RequestParameters["default"](parameters);
3109
- }
3105
+ switch (typeof id) {
3106
+ case 'number':
3107
+ case 'string':
3108
+ return {
3109
+ [this.Target.resourceUrlKey]: id
3110
+ };
3110
3111
 
3111
- this._api = api;
3112
- this.route = route;
3113
- this._Target = Target;
3114
- this._parameters = parameters;
3115
- this._pageCount = pageCount;
3116
- this._rows = rowCount;
3117
- this._data = data;
3112
+ case 'object':
3113
+ return id;
3114
+
3115
+ default:
3116
+ return {};
3117
+ }
3118
3118
  }
3119
3119
  /**
3120
- * Get api instance
3121
- * @returns {Mapcreator} - Api instance
3120
+ * Get target resource
3121
+ * @param {Number|String|Object} [id=] - The resource id to be requested
3122
+ * @param {String} [deleted=null] - Determines if the resource should be shown if deleted, requires special resource permissions. Possible values: only, none, all
3123
+ * @returns {CancelablePromise<ResourceBase>} - Target resource
3124
+ * @throws {ApiError} - If the api returns errors
3122
3125
  */
3123
3126
 
3124
3127
 
3125
- get api() {
3126
- return this._api;
3127
- }
3128
- /**
3129
- * Target route
3130
- * @returns {String} - Url
3131
- */
3128
+ get(id, deleted = null) {
3129
+ return (0,_utils_helpers__WEBPACK_IMPORTED_MODULE_2__.makeCancelable)(async signal => {
3130
+ const data = { ...this._seedData,
3131
+ ...this._parseSelector(id)
3132
+ };
3133
+ let url = this.new(data).url;
3132
3134
 
3135
+ if (typeof deleted === 'string') {
3136
+ const glue = url.includes('?') ? '&' : '?';
3137
+ url += glue + (0,_utils_requests__WEBPACK_IMPORTED_MODULE_0__.encodeQueryString)({
3138
+ deleted
3139
+ });
3140
+ }
3133
3141
 
3134
- get route() {
3135
- return this._route;
3142
+ const {
3143
+ data: result
3144
+ } = await this.api.ky.get(url, {
3145
+ signal
3146
+ }).json();
3147
+ return this.new(result);
3148
+ });
3136
3149
  }
3137
3150
  /**
3138
- * Override the target route
3139
- * @param {String} value - route
3151
+ * Select target resource without obtaining data
3152
+ * @param {Number|String} [id=] - Resource id
3153
+ * @returns {ResourceBase} - Empty target resource
3154
+ * @example
3155
+ * api.users.select('me').colors().then(doSomethingCool);
3140
3156
  */
3141
3157
 
3142
3158
 
3143
- set route(value) {
3144
- if (!value.startsWith('https://') && !value.startsWith('http://')) {
3145
- if (!value.startsWith('/')) {
3146
- value = `/${value}`;
3147
- }
3148
-
3159
+ select(id) {
3160
+ const data = { ...this._seedData,
3161
+ ...this._parseSelector(id)
3162
+ };
3163
+ return this.new(data);
3164
+ }
3165
+
3166
+ }
3167
+
3168
+ /***/ }),
3169
+ /* 15 */
3170
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3171
+
3172
+ "use strict";
3173
+ // ESM COMPAT FLAG
3174
+ __webpack_require__.r(__webpack_exports__);
3175
+
3176
+ // EXPORTS
3177
+ __webpack_require__.d(__webpack_exports__, {
3178
+ "default": () => (/* binding */ SimpleResourceProxy)
3179
+ });
3180
+
3181
+ // EXTERNAL MODULE: ./src/Mapcreator.js + 1 modules
3182
+ var Mapcreator = __webpack_require__(17);
3183
+ // EXTERNAL MODULE: ./src/RequestParameters.js
3184
+ var RequestParameters = __webpack_require__(8);
3185
+ // EXTERNAL MODULE: ./src/utils/reflection.js
3186
+ var reflection = __webpack_require__(0);
3187
+ // EXTERNAL MODULE: ./src/utils/helpers.js
3188
+ var helpers = __webpack_require__(1);
3189
+ ;// CONCATENATED MODULE: ./src/PaginatedResourceListing.js
3190
+ /*
3191
+ * BSD 3-Clause License
3192
+ *
3193
+ * Copyright (c) 2020, Mapcreator
3194
+ * All rights reserved.
3195
+ *
3196
+ * Redistribution and use in source and binary forms, with or without
3197
+ * modification, are permitted provided that the following conditions are met:
3198
+ *
3199
+ * Redistributions of source code must retain the above copyright notice, this
3200
+ * list of conditions and the following disclaimer.
3201
+ *
3202
+ * Redistributions in binary form must reproduce the above copyright notice,
3203
+ * this list of conditions and the following disclaimer in the documentation
3204
+ * and/or other materials provided with the distribution.
3205
+ *
3206
+ * Neither the name of the copyright holder nor the names of its
3207
+ * contributors may be used to endorse or promote products derived from
3208
+ * this software without specific prior written permission.
3209
+ *
3210
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
3211
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
3212
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
3213
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
3214
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3215
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
3216
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
3217
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
3218
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3219
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3220
+ */
3221
+
3222
+
3223
+
3224
+
3225
+ /**
3226
+ * Proxy for accessing paginated resources
3227
+ */
3228
+
3229
+ class PaginatedResourceListing {
3230
+ /**
3231
+ * @param {Mapcreator} api - Instance of the api
3232
+ * @param {String} route - Resource route
3233
+ * @param {Class<ResourceBase>} Target - Wrapper target
3234
+ * @param {RequestParameters} parameters - Request parameters
3235
+ * @param {Number} pageCount - Resolved page count
3236
+ * @param {Number} rowCount - Resolved rowCount
3237
+ * @param {Array<ResourceBase>} data - Resolved data
3238
+ * @private
3239
+ */
3240
+ constructor(api, route, Target, parameters, pageCount = null, rowCount = 0, data = []) {
3241
+ if (!(0,reflection.isParentOf)(Mapcreator["default"], api)) {
3242
+ throw new TypeError('Expected api to be of type Mapcreator');
3243
+ }
3244
+
3245
+ if (!(0,reflection.isParentOf)(RequestParameters["default"], parameters)) {
3246
+ parameters = new RequestParameters["default"](parameters);
3247
+ }
3248
+
3249
+ this._api = api;
3250
+ this.route = route;
3251
+ this._Target = Target;
3252
+ this._parameters = parameters;
3253
+ this._pageCount = pageCount;
3254
+ this._rows = rowCount;
3255
+ this._data = data;
3256
+ }
3257
+ /**
3258
+ * Get api instance
3259
+ * @returns {Mapcreator} - Api instance
3260
+ */
3261
+
3262
+
3263
+ get api() {
3264
+ return this._api;
3265
+ }
3266
+ /**
3267
+ * Target route
3268
+ * @returns {String} - Url
3269
+ */
3270
+
3271
+
3272
+ get route() {
3273
+ return this._route;
3274
+ }
3275
+ /**
3276
+ * Override the target route
3277
+ * @param {String} value - route
3278
+ */
3279
+
3280
+
3281
+ set route(value) {
3282
+ if (!value.startsWith('https://') && !value.startsWith('http://')) {
3283
+ if (!value.startsWith('/')) {
3284
+ value = `/${value}`;
3285
+ }
3286
+
3149
3287
  value = `${this._api.url}${value}`;
3150
3288
  }
3151
3289
 
@@ -3481,7 +3619,7 @@ class SimpleResourceProxy {
3481
3619
  data = { ...this._seedData,
3482
3620
  ...data
3483
3621
  };
3484
- return new this.Target(this._api, data);
3622
+ return new this.Target(this._api, data, this.__baseUrl);
3485
3623
  }
3486
3624
  /**
3487
3625
  * List target resource
@@ -3568,7 +3706,7 @@ class SimpleResourceProxy {
3568
3706
  }
3569
3707
 
3570
3708
  /***/ }),
3571
- /* 15 */
3709
+ /* 16 */
3572
3710
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3573
3711
 
3574
3712
  "use strict";
@@ -3578,7 +3716,7 @@ __webpack_require__.r(__webpack_exports__);
3578
3716
  /* harmony export */ });
3579
3717
  /* harmony import */ var _errors_AbstractError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(21);
3580
3718
  /* harmony import */ var _CrudBase__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
3581
- /* harmony import */ var case__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4);
3719
+ /* harmony import */ var case__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5);
3582
3720
  /* harmony import */ var case__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(case__WEBPACK_IMPORTED_MODULE_2__);
3583
3721
  /*
3584
3722
  * BSD 3-Clause License
@@ -3664,7 +3802,7 @@ class CrudSetBase extends _CrudBase__WEBPACK_IMPORTED_MODULE_1__["default"] {
3664
3802
  }
3665
3803
 
3666
3804
  /***/ }),
3667
- /* 16 */
3805
+ /* 17 */
3668
3806
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3669
3807
 
3670
3808
  "use strict";
@@ -3677,29 +3815,29 @@ __webpack_require__.d(__webpack_exports__, {
3677
3815
  });
3678
3816
 
3679
3817
  // EXTERNAL MODULE: ./node_modules/ky-universal/browser.js + 1 modules
3680
- var browser = __webpack_require__(30);
3818
+ var browser = __webpack_require__(31);
3681
3819
  // EXTERNAL MODULE: ./src/enums/index.js + 3 modules
3682
3820
  var enums = __webpack_require__(7);
3683
3821
  // EXTERNAL MODULE: ./src/oauth/DummyFlow.js
3684
3822
  var DummyFlow = __webpack_require__(76);
3685
3823
  // EXTERNAL MODULE: ./src/oauth/OAuth.js
3686
- var OAuth = __webpack_require__(18);
3824
+ var OAuth = __webpack_require__(19);
3687
3825
  // EXTERNAL MODULE: ./src/oauth/OAuthToken.js
3688
3826
  var OAuthToken = __webpack_require__(13);
3689
3827
  // EXTERNAL MODULE: ./src/proxy/GeoResourceProxy.js
3690
3828
  var GeoResourceProxy = __webpack_require__(43);
3691
3829
  // EXTERNAL MODULE: ./src/proxy/ResourceProxy.js
3692
- var ResourceProxy = __webpack_require__(19);
3830
+ var ResourceProxy = __webpack_require__(14);
3693
3831
  // EXTERNAL MODULE: ./src/proxy/SimpleResourceProxy.js + 1 modules
3694
- var SimpleResourceProxy = __webpack_require__(14);
3695
- // EXTERNAL MODULE: ./src/resources/index.js + 10 modules
3696
- var resources = __webpack_require__(37);
3832
+ var SimpleResourceProxy = __webpack_require__(15);
3833
+ // EXTERNAL MODULE: ./src/resources/index.js + 11 modules
3834
+ var resources = __webpack_require__(30);
3697
3835
  // EXTERNAL MODULE: ./src/resources/base/ResourceBase.js
3698
3836
  var ResourceBase = __webpack_require__(3);
3699
3837
  // EXTERNAL MODULE: ./src/traits/Injectable.js
3700
3838
  var Injectable = __webpack_require__(65);
3701
3839
  // EXTERNAL MODULE: ./src/utils/hash.js
3702
- var hash = __webpack_require__(32);
3840
+ var hash = __webpack_require__(33);
3703
3841
  ;// CONCATENATED MODULE: ./src/utils/Logger.js
3704
3842
  /*
3705
3843
  * BSD 3-Clause License
@@ -3849,7 +3987,7 @@ var ValidationError = __webpack_require__(78);
3849
3987
  // EXTERNAL MODULE: ./src/errors/ApiError.js
3850
3988
  var ApiError = __webpack_require__(66);
3851
3989
  // EXTERNAL MODULE: ./src/utils/requests.js
3852
- var requests = __webpack_require__(5);
3990
+ var requests = __webpack_require__(6);
3853
3991
  // EXTERNAL MODULE: ./node_modules/events/events.js
3854
3992
  var events = __webpack_require__(24);
3855
3993
  var events_default = /*#__PURE__*/__webpack_require__.n(events);
@@ -4569,7 +4707,7 @@ class Mapcreator extends (0,reflection.mix)((events_default()), Injectable["defa
4569
4707
  }
4570
4708
 
4571
4709
  /***/ }),
4572
- /* 17 */
4710
+ /* 18 */
4573
4711
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4574
4712
 
4575
4713
  "use strict";
@@ -4657,7 +4795,7 @@ class OAuthError extends Error {
4657
4795
  }
4658
4796
 
4659
4797
  /***/ }),
4660
- /* 18 */
4798
+ /* 19 */
4661
4799
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4662
4800
 
4663
4801
  "use strict";
@@ -4667,7 +4805,7 @@ __webpack_require__.r(__webpack_exports__);
4667
4805
  /* harmony export */ });
4668
4806
  /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
4669
4807
  /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);
4670
- /* harmony import */ var ky_universal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(30);
4808
+ /* harmony import */ var ky_universal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31);
4671
4809
  /* harmony import */ var _errors_AbstractError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(21);
4672
4810
  /* harmony import */ var _storage_StorageManager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(22);
4673
4811
  /* harmony import */ var _OAuthToken__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13);
@@ -4812,17 +4950,16 @@ class OAuth {
4812
4950
  }
4813
4951
 
4814
4952
  /***/ }),
4815
- /* 19 */
4953
+ /* 20 */
4816
4954
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4817
4955
 
4818
4956
  "use strict";
4819
4957
  __webpack_require__.r(__webpack_exports__);
4820
4958
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4821
- /* harmony export */ "default": () => (/* binding */ ResourceProxy)
4959
+ /* harmony export */ "default": () => (/* binding */ OwnedResourceProxy)
4822
4960
  /* harmony export */ });
4823
- /* harmony import */ var _utils_requests__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5);
4824
- /* harmony import */ var _SimpleResourceProxy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14);
4825
- /* harmony import */ var _utils_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1);
4961
+ /* harmony import */ var _SimpleResourceProxy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15);
4962
+ /* harmony import */ var _utils_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
4826
4963
  /*
4827
4964
  * BSD 3-Clause License
4828
4965
  *
@@ -4856,211 +4993,85 @@ __webpack_require__.r(__webpack_exports__);
4856
4993
  */
4857
4994
 
4858
4995
 
4859
-
4860
4996
  /**
4861
- * Proxy for accessing resource. This will make sure that they
4862
- * are properly wrapped before the promise resolves.
4863
- * @protected
4997
+ * Used for proxying resource => organisation
4864
4998
  */
4865
4999
 
4866
- class ResourceProxy extends _SimpleResourceProxy__WEBPACK_IMPORTED_MODULE_1__["default"] {
5000
+ class OwnedResourceProxy extends _SimpleResourceProxy__WEBPACK_IMPORTED_MODULE_0__["default"] {
4867
5001
  /**
4868
- * Parse selector
4869
- * @param {Number|String|Object} [id=] - The resource id to be requested
4870
- * @returns {Object} - Parsed selector
4871
- * @private
5002
+ * OwnedResourceProxy Constructor
5003
+ * @param {Mapcreator} api - Api instance
5004
+ * @param {ResourceBase} parent - Parent instance
5005
+ * @param {Class<ResourceBase>} Target - Target constructor
5006
+ */
5007
+ constructor(api, parent, Target) {
5008
+ const resource = Target.resourceName.replace(/s+$/, '');
5009
+ const url = `${parent.url}/${resource}s`;
5010
+ super(api, Target, url);
5011
+ }
5012
+ /**
5013
+ * Sync items to the organisation
5014
+ * @param {Array<ResourceBase>|Array<number>|ResourceBase|number} items - List of items to sync
5015
+ * @throws {TypeError}
5016
+ * @throws {ApiError} - If the api returns errors
5017
+ * @returns {CancelablePromise}
4872
5018
  */
4873
- _parseSelector(id) {
4874
- if (id === '' || id === null) {
4875
- return {};
4876
- }
4877
5019
 
4878
- switch (typeof id) {
4879
- case 'number':
4880
- case 'string':
4881
- return {
4882
- [this.Target.resourceUrlKey]: id
4883
- };
4884
5020
 
4885
- case 'object':
4886
- return id;
5021
+ sync(items) {
5022
+ return this._modifyResourceLink(items, 'PATCH');
5023
+ }
5024
+ /**
5025
+ * Attach items to the organisation
5026
+ * @param {Array<ResourceBase>|Array<number>|ResourceBase|number} items - List of items to attach
5027
+ * @throws {TypeError}
5028
+ * @throws {ApiError} - If the api returns errors
5029
+ * @returns {CancelablePromise}
5030
+ */
4887
5031
 
4888
- default:
4889
- return {};
4890
- }
5032
+
5033
+ attach(items) {
5034
+ return this._modifyResourceLink(items, 'POST');
4891
5035
  }
4892
5036
  /**
4893
- * Get target resource
4894
- * @param {Number|String|Object} [id=] - The resource id to be requested
4895
- * @param {String} [deleted=null] - Determines if the resource should be shown if deleted, requires special resource permissions. Possible values: only, none, all
4896
- * @returns {CancelablePromise<ResourceBase>} - Target resource
5037
+ * Detach items from the organisation
5038
+ * @param {Array<ResourceBase>|Array<number>|ResourceBase|number} items - List of items to unlink
5039
+ * @throws {TypeError}
4897
5040
  * @throws {ApiError} - If the api returns errors
5041
+ * @returns {CancelablePromise}
4898
5042
  */
4899
5043
 
4900
5044
 
4901
- get(id, deleted = null) {
4902
- return (0,_utils_helpers__WEBPACK_IMPORTED_MODULE_2__.makeCancelable)(async signal => {
4903
- const data = { ...this._seedData,
4904
- ...this._parseSelector(id)
4905
- };
4906
- let url = this.new(data).url;
5045
+ detach(items) {
5046
+ return this._modifyResourceLink(items, 'DELETE');
5047
+ }
5048
+ /**
5049
+ * Attach parent resource to all organisations
5050
+ * @throws {ApiError} - If the api returns errors
5051
+ * @returns {CancelablePromise}
5052
+ */
4907
5053
 
4908
- if (typeof deleted === 'string') {
4909
- const glue = url.includes('?') ? '&' : '?';
4910
- url += glue + (0,_utils_requests__WEBPACK_IMPORTED_MODULE_0__.encodeQueryString)({
4911
- deleted
4912
- });
4913
- }
4914
5054
 
4915
- const {
4916
- data: result
4917
- } = await this.api.ky.get(url, {
5055
+ attachAll() {
5056
+ return (0,_utils_helpers__WEBPACK_IMPORTED_MODULE_1__.makeCancelable)(async signal => {
5057
+ await this.api.ky.post(`${this.baseUrl}/all`, {
4918
5058
  signal
4919
- }).json();
4920
- return this.new(result);
5059
+ });
4921
5060
  });
4922
5061
  }
4923
5062
  /**
4924
- * Select target resource without obtaining data
4925
- * @param {Number|String} [id=] - Resource id
4926
- * @returns {ResourceBase} - Empty target resource
4927
- * @example
4928
- * api.users.select('me').colors().then(doSomethingCool);
5063
+ * Detach parent resource to all organisations
5064
+ * @throws {ApiError} - If the api returns errors
5065
+ * @returns {CancelablePromise}
4929
5066
  */
4930
5067
 
4931
5068
 
4932
- select(id) {
4933
- const data = { ...this._seedData,
4934
- ...this._parseSelector(id)
4935
- };
4936
- return this.new(data);
4937
- }
4938
-
4939
- }
4940
-
4941
- /***/ }),
4942
- /* 20 */
4943
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4944
-
4945
- "use strict";
4946
- __webpack_require__.r(__webpack_exports__);
4947
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4948
- /* harmony export */ "default": () => (/* binding */ OwnedResourceProxy)
4949
- /* harmony export */ });
4950
- /* harmony import */ var _SimpleResourceProxy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14);
4951
- /* harmony import */ var _utils_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
4952
- /*
4953
- * BSD 3-Clause License
4954
- *
4955
- * Copyright (c) 2020, Mapcreator
4956
- * All rights reserved.
4957
- *
4958
- * Redistribution and use in source and binary forms, with or without
4959
- * modification, are permitted provided that the following conditions are met:
4960
- *
4961
- * Redistributions of source code must retain the above copyright notice, this
4962
- * list of conditions and the following disclaimer.
4963
- *
4964
- * Redistributions in binary form must reproduce the above copyright notice,
4965
- * this list of conditions and the following disclaimer in the documentation
4966
- * and/or other materials provided with the distribution.
4967
- *
4968
- * Neither the name of the copyright holder nor the names of its
4969
- * contributors may be used to endorse or promote products derived from
4970
- * this software without specific prior written permission.
4971
- *
4972
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
4973
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
4974
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
4975
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
4976
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
4977
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
4978
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
4979
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
4980
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
4981
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4982
- */
4983
-
4984
-
4985
- /**
4986
- * Used for proxying resource => organisation
4987
- */
4988
-
4989
- class OwnedResourceProxy extends _SimpleResourceProxy__WEBPACK_IMPORTED_MODULE_0__["default"] {
4990
- /**
4991
- * OwnedResourceProxy Constructor
4992
- * @param {Mapcreator} api - Api instance
4993
- * @param {ResourceBase} parent - Parent instance
4994
- * @param {Class<ResourceBase>} Target - Target constructor
4995
- */
4996
- constructor(api, parent, Target) {
4997
- const resource = Target.resourceName.replace(/s+$/, '');
4998
- const url = `${parent.url}/${resource}s`;
4999
- super(api, Target, url);
5000
- }
5001
- /**
5002
- * Sync items to the organisation
5003
- * @param {Array<ResourceBase>|Array<number>|ResourceBase|number} items - List of items to sync
5004
- * @throws {TypeError}
5005
- * @throws {ApiError} - If the api returns errors
5006
- * @returns {CancelablePromise}
5007
- */
5008
-
5009
-
5010
- sync(items) {
5011
- return this._modifyResourceLink(items, 'PATCH');
5012
- }
5013
- /**
5014
- * Attach items to the organisation
5015
- * @param {Array<ResourceBase>|Array<number>|ResourceBase|number} items - List of items to attach
5016
- * @throws {TypeError}
5017
- * @throws {ApiError} - If the api returns errors
5018
- * @returns {CancelablePromise}
5019
- */
5020
-
5021
-
5022
- attach(items) {
5023
- return this._modifyResourceLink(items, 'POST');
5024
- }
5025
- /**
5026
- * Detach items from the organisation
5027
- * @param {Array<ResourceBase>|Array<number>|ResourceBase|number} items - List of items to unlink
5028
- * @throws {TypeError}
5029
- * @throws {ApiError} - If the api returns errors
5030
- * @returns {CancelablePromise}
5031
- */
5032
-
5033
-
5034
- detach(items) {
5035
- return this._modifyResourceLink(items, 'DELETE');
5036
- }
5037
- /**
5038
- * Attach parent resource to all organisations
5039
- * @throws {ApiError} - If the api returns errors
5040
- * @returns {CancelablePromise}
5041
- */
5042
-
5043
-
5044
- attachAll() {
5045
- return (0,_utils_helpers__WEBPACK_IMPORTED_MODULE_1__.makeCancelable)(async signal => {
5046
- await this.api.ky.post(`${this.baseUrl}/all`, {
5047
- signal
5048
- });
5049
- });
5050
- }
5051
- /**
5052
- * Detach parent resource to all organisations
5053
- * @throws {ApiError} - If the api returns errors
5054
- * @returns {CancelablePromise}
5055
- */
5056
-
5057
-
5058
- detachAll() {
5059
- return (0,_utils_helpers__WEBPACK_IMPORTED_MODULE_1__.makeCancelable)(async signal => {
5060
- await this.api.ky.delete(`${this.baseUrl}/all`, {
5061
- signal
5062
- });
5063
- });
5069
+ detachAll() {
5070
+ return (0,_utils_helpers__WEBPACK_IMPORTED_MODULE_1__.makeCancelable)(async signal => {
5071
+ await this.api.ky.delete(`${this.baseUrl}/all`, {
5072
+ signal
5073
+ });
5074
+ });
5064
5075
  }
5065
5076
  /**
5066
5077
  * @param {Array<ResourceBase>|Array<number>|ResourceBase|number} items - List of items to sync, attach or detach
@@ -5204,7 +5215,7 @@ __webpack_require__.d(__webpack_exports__, {
5204
5215
  });
5205
5216
 
5206
5217
  // EXTERNAL MODULE: ./src/utils/StaticClass.js
5207
- var StaticClass = __webpack_require__(33);
5218
+ var StaticClass = __webpack_require__(34);
5208
5219
  // EXTERNAL MODULE: ./src/utils/node.js
5209
5220
  var node = __webpack_require__(9);
5210
5221
  // EXTERNAL MODULE: ./src/storage/DataStoreContract.js
@@ -6673,7 +6684,7 @@ __webpack_require__.r(__webpack_exports__);
6673
6684
  /* harmony export */ "default": () => (/* binding */ Layer)
6674
6685
  /* harmony export */ });
6675
6686
  /* harmony import */ var _traits_HandlesImages__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(54);
6676
- /* harmony import */ var _traits_OwnableResource__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6);
6687
+ /* harmony import */ var _traits_OwnableResource__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
6677
6688
  /* harmony import */ var _utils_reflection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
6678
6689
  /* harmony import */ var _base_CrudBase__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2);
6679
6690
  /*
@@ -6739,15 +6750,15 @@ __webpack_require__.d(__webpack_exports__, {
6739
6750
  });
6740
6751
 
6741
6752
  // EXTERNAL MODULE: ./src/traits/OwnableResource.js
6742
- var OwnableResource = __webpack_require__(6);
6753
+ var OwnableResource = __webpack_require__(4);
6743
6754
  // EXTERNAL MODULE: ./src/utils/reflection.js
6744
6755
  var reflection = __webpack_require__(0);
6745
6756
  // EXTERNAL MODULE: ./src/resources/base/CrudSetBase.js
6746
- var CrudSetBase = __webpack_require__(15);
6757
+ var CrudSetBase = __webpack_require__(16);
6747
6758
  // EXTERNAL MODULE: ./src/resources/Mapstyle.js
6748
6759
  var Mapstyle = __webpack_require__(70);
6749
6760
  // EXTERNAL MODULE: ./src/proxy/ResourceProxy.js
6750
- var ResourceProxy = __webpack_require__(19);
6761
+ var ResourceProxy = __webpack_require__(14);
6751
6762
  // EXTERNAL MODULE: ./src/resources/base/CrudSetItemBase.js
6752
6763
  var CrudSetItemBase = __webpack_require__(10);
6753
6764
  ;// CONCATENATED MODULE: ./src/resources/MapstyleSetColor.js
@@ -6877,7 +6888,7 @@ __webpack_require__.r(__webpack_exports__);
6877
6888
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6878
6889
  /* harmony export */ "default": () => (/* binding */ Tag)
6879
6890
  /* harmony export */ });
6880
- /* harmony import */ var _traits_OwnableResource__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
6891
+ /* harmony import */ var _traits_OwnableResource__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
6881
6892
  /* harmony import */ var _utils_reflection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
6882
6893
  /* harmony import */ var _base_CrudSetItemBase__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(10);
6883
6894
  /*
@@ -6941,528 +6952,530 @@ __webpack_require__.r(__webpack_exports__);
6941
6952
 
6942
6953
  // EXPORTS
6943
6954
  __webpack_require__.d(__webpack_exports__, {
6944
- "default": () => (/* reexport */ ky)
6955
+ "Choropleth": () => (/* reexport */ Choropleth),
6956
+ "Color": () => (/* reexport */ Color["default"]),
6957
+ "Contract": () => (/* reexport */ Contract["default"]),
6958
+ "Dimension": () => (/* reexport */ Dimension["default"]),
6959
+ "DimensionSet": () => (/* reexport */ DimensionSet["default"]),
6960
+ "Domain": () => (/* reexport */ Domain["default"]),
6961
+ "Faq": () => (/* reexport */ Faq),
6962
+ "Feature": () => (/* reexport */ Feature["default"]),
6963
+ "Font": () => (/* reexport */ Font["default"]),
6964
+ "FontFamily": () => (/* reexport */ FontFamily["default"]),
6965
+ "Highlight": () => (/* reexport */ Highlight),
6966
+ "InsetMap": () => (/* reexport */ InsetMap),
6967
+ "Job": () => (/* reexport */ Job["default"]),
6968
+ "JobResult": () => (/* reexport */ JobResult["default"]),
6969
+ "JobRevision": () => (/* reexport */ JobRevision["default"]),
6970
+ "JobShare": () => (/* reexport */ JobShare["default"]),
6971
+ "JobType": () => (/* reexport */ JobType["default"]),
6972
+ "Language": () => (/* reexport */ Language["default"]),
6973
+ "Layer": () => (/* reexport */ Layer["default"]),
6974
+ "LayerFaq": () => (/* reexport */ LayerFaq),
6975
+ "LayerGroup": () => (/* reexport */ LayerGroup["default"]),
6976
+ "Mapstyle": () => (/* reexport */ Mapstyle["default"]),
6977
+ "MapstyleSet": () => (/* reexport */ MapstyleSet["default"]),
6978
+ "Message": () => (/* reexport */ Message["default"]),
6979
+ "Notification": () => (/* reexport */ Notification["default"]),
6980
+ "Organisation": () => (/* reexport */ Organisation["default"]),
6981
+ "OrganisationNote": () => (/* reexport */ OrganisationNote),
6982
+ "Permission": () => (/* reexport */ Permission["default"]),
6983
+ "ProductTour": () => (/* reexport */ ProductTour),
6984
+ "ProductTourStep": () => (/* reexport */ ProductTourStep),
6985
+ "Role": () => (/* reexport */ Role["default"]),
6986
+ "Svg": () => (/* reexport */ Svg["default"]),
6987
+ "SvgSet": () => (/* reexport */ SvgSet["default"]),
6988
+ "Tag": () => (/* reexport */ Tag["default"]),
6989
+ "TagType": () => (/* reexport */ TagType),
6990
+ "User": () => (/* reexport */ User["default"]),
6991
+ "VectorChoropleth": () => (/* reexport */ VectorChoropleth),
6992
+ "VectorHighlight": () => (/* reexport */ VectorHighlight),
6993
+ "base": () => (/* binding */ base)
6945
6994
  });
6946
6995
 
6947
- ;// CONCATENATED MODULE: ./node_modules/ky/index.js
6948
- /*! MIT License © Sindre Sorhus */
6996
+ // EXTERNAL MODULE: ./src/resources/base/DownloadedResource.js + 1 modules
6997
+ var DownloadedResource = __webpack_require__(25);
6998
+ // EXTERNAL MODULE: ./src/resources/base/ResourceBase.js
6999
+ var ResourceBase = __webpack_require__(3);
7000
+ // EXTERNAL MODULE: ./src/utils/helpers.js
7001
+ var helpers = __webpack_require__(1);
7002
+ ;// CONCATENATED MODULE: ./src/resources/Choropleth.js
7003
+ /*
7004
+ * BSD 3-Clause License
7005
+ *
7006
+ * Copyright (c) 2020, Mapcreator
7007
+ * All rights reserved.
7008
+ *
7009
+ * Redistribution and use in source and binary forms, with or without
7010
+ * modification, are permitted provided that the following conditions are met:
7011
+ *
7012
+ * Redistributions of source code must retain the above copyright notice, this
7013
+ * list of conditions and the following disclaimer.
7014
+ *
7015
+ * Redistributions in binary form must reproduce the above copyright notice,
7016
+ * this list of conditions and the following disclaimer in the documentation
7017
+ * and/or other materials provided with the distribution.
7018
+ *
7019
+ * Neither the name of the copyright holder nor the names of its
7020
+ * contributors may be used to endorse or promote products derived from
7021
+ * this software without specific prior written permission.
7022
+ *
7023
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
7024
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
7025
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7026
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
7027
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
7028
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7029
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
7030
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
7031
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7032
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7033
+ */
6949
7034
 
6950
- const globals = {};
6951
7035
 
6952
- const getGlobal = property => {
6953
- /* istanbul ignore next */
6954
- if (typeof self !== 'undefined' && self && property in self) {
6955
- return self;
6956
- }
6957
7036
 
6958
- /* istanbul ignore next */
6959
- if (typeof window !== 'undefined' && window && property in window) {
6960
- return window;
6961
- }
7037
+ /**
7038
+ * Choropleth resource
7039
+ */
6962
7040
 
6963
- if (typeof global !== 'undefined' && global && property in global) {
6964
- return global;
6965
- }
7041
+ class Choropleth extends ResourceBase["default"] {
7042
+ static get resourceName() {
7043
+ return 'choropleths';
7044
+ }
7045
+ /**
7046
+ * Get the inset map json
7047
+ * @returns {CancelablePromise<Object>} - Choropleth json
7048
+ * @throws {ApiError} - If the api returns errors
7049
+ */
6966
7050
 
6967
- /* istanbul ignore next */
6968
- if (typeof globalThis !== 'undefined' && globalThis) {
6969
- return globalThis;
6970
- }
6971
- };
6972
7051
 
6973
- const globalProperties = [
6974
- 'Headers',
6975
- 'Request',
6976
- 'Response',
6977
- 'ReadableStream',
6978
- 'fetch',
6979
- 'AbortController',
6980
- 'FormData'
6981
- ];
7052
+ getJson() {
7053
+ return (0,helpers.makeCancelable)(signal => this.api.ky.get(`${this.url}/json`, {
7054
+ signal
7055
+ }).json());
7056
+ }
7057
+ /**
7058
+ * Download the choropleth preview
7059
+ * @returns {CancelablePromise<DownloadedResource>} - Choropleth preview
7060
+ * @throws {ApiError} - If the api returns errors
7061
+ */
6982
7062
 
6983
- for (const property of globalProperties) {
6984
- Object.defineProperty(globals, property, {
6985
- get() {
6986
- const globalObject = getGlobal(property);
6987
- const value = globalObject && globalObject[property];
6988
- return typeof value === 'function' ? value.bind(globalObject) : value;
6989
- }
6990
- });
6991
- }
6992
-
6993
- const isObject = value => value !== null && typeof value === 'object';
6994
- const supportsAbortController = typeof globals.AbortController === 'function';
6995
- const supportsStreams = typeof globals.ReadableStream === 'function';
6996
- const supportsFormData = typeof globals.FormData === 'function';
6997
7063
 
6998
- const mergeHeaders = (source1, source2) => {
6999
- const result = new globals.Headers(source1);
7000
- const isHeadersInstance = source2 instanceof globals.Headers;
7001
- const source = new globals.Headers(source2);
7002
-
7003
- for (const [key, value] of source) {
7004
- if ((isHeadersInstance && value === 'undefined') || value === undefined) {
7005
- result.delete(key);
7006
- } else {
7007
- result.set(key, value);
7008
- }
7009
- }
7010
-
7011
- return result;
7012
- };
7013
-
7014
- const deepMerge = (...sources) => {
7015
- let returnValue = {};
7016
- let headers = {};
7017
-
7018
- for (const source of sources) {
7019
- if (Array.isArray(source)) {
7020
- if (!(Array.isArray(returnValue))) {
7021
- returnValue = [];
7022
- }
7023
-
7024
- returnValue = [...returnValue, ...source];
7025
- } else if (isObject(source)) {
7026
- for (let [key, value] of Object.entries(source)) {
7027
- if (isObject(value) && Reflect.has(returnValue, key)) {
7028
- value = deepMerge(returnValue[key], value);
7029
- }
7030
-
7031
- returnValue = {...returnValue, [key]: value};
7032
- }
7033
-
7034
- if (isObject(source.headers)) {
7035
- headers = mergeHeaders(headers, source.headers);
7036
- }
7037
- }
7038
-
7039
- returnValue.headers = headers;
7040
- }
7041
-
7042
- return returnValue;
7043
- };
7044
-
7045
- const requestMethods = [
7046
- 'get',
7047
- 'post',
7048
- 'put',
7049
- 'patch',
7050
- 'head',
7051
- 'delete'
7052
- ];
7053
-
7054
- const responseTypes = {
7055
- json: 'application/json',
7056
- text: 'text/*',
7057
- formData: 'multipart/form-data',
7058
- arrayBuffer: '*/*',
7059
- blob: '*/*'
7060
- };
7061
-
7062
- const retryMethods = [
7063
- 'get',
7064
- 'put',
7065
- 'head',
7066
- 'delete',
7067
- 'options',
7068
- 'trace'
7069
- ];
7070
-
7071
- const retryStatusCodes = [
7072
- 408,
7073
- 413,
7074
- 429,
7075
- 500,
7076
- 502,
7077
- 503,
7078
- 504
7079
- ];
7080
-
7081
- const retryAfterStatusCodes = [
7082
- 413,
7083
- 429,
7084
- 503
7085
- ];
7086
-
7087
- const stop = Symbol('stop');
7088
-
7089
- class HTTPError extends Error {
7090
- constructor(response) {
7091
- // Set the message to the status text, such as Unauthorized,
7092
- // with some fallbacks. This message should never be undefined.
7093
- super(
7094
- response.statusText ||
7095
- String(
7096
- (response.status === 0 || response.status) ?
7097
- response.status : 'Unknown response error'
7098
- )
7099
- );
7100
- this.name = 'HTTPError';
7101
- this.response = response;
7102
- }
7103
- }
7064
+ downloadPreview() {
7065
+ return (0,helpers.makeCancelable)(async signal => {
7066
+ const response = await this.api.ky.get(`${this.url}/preview`, {
7067
+ signal
7068
+ });
7069
+ return DownloadedResource["default"].fromResponse(response);
7070
+ });
7071
+ }
7104
7072
 
7105
- class TimeoutError extends Error {
7106
- constructor(request) {
7107
- super('Request timed out');
7108
- this.name = 'TimeoutError';
7109
- this.request = request;
7110
- }
7111
7073
  }
7074
+ // EXTERNAL MODULE: ./src/resources/Color.js
7075
+ var Color = __webpack_require__(46);
7076
+ // EXTERNAL MODULE: ./src/resources/Contract.js
7077
+ var Contract = __webpack_require__(67);
7078
+ // EXTERNAL MODULE: ./src/resources/Dimension.js
7079
+ var Dimension = __webpack_require__(48);
7080
+ // EXTERNAL MODULE: ./src/resources/DimensionSet.js
7081
+ var DimensionSet = __webpack_require__(47);
7082
+ // EXTERNAL MODULE: ./src/resources/Domain.js
7083
+ var Domain = __webpack_require__(68);
7084
+ // EXTERNAL MODULE: ./src/resources/base/CrudBase.js
7085
+ var CrudBase = __webpack_require__(2);
7086
+ ;// CONCATENATED MODULE: ./src/resources/Faq.js
7087
+ /*
7088
+ * BSD 3-Clause License
7089
+ *
7090
+ * Copyright (c) 2020, Mapcreator
7091
+ * All rights reserved.
7092
+ *
7093
+ * Redistribution and use in source and binary forms, with or without
7094
+ * modification, are permitted provided that the following conditions are met:
7095
+ *
7096
+ * Redistributions of source code must retain the above copyright notice, this
7097
+ * list of conditions and the following disclaimer.
7098
+ *
7099
+ * Redistributions in binary form must reproduce the above copyright notice,
7100
+ * this list of conditions and the following disclaimer in the documentation
7101
+ * and/or other materials provided with the distribution.
7102
+ *
7103
+ * Neither the name of the copyright holder nor the names of its
7104
+ * contributors may be used to endorse or promote products derived from
7105
+ * this software without specific prior written permission.
7106
+ *
7107
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
7108
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
7109
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7110
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
7111
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
7112
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7113
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
7114
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
7115
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7116
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7117
+ */
7112
7118
 
7113
- const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
7114
-
7115
- // `Promise.race()` workaround (#91)
7116
- const timeout = (request, ms, abortController) =>
7117
- new Promise((resolve, reject) => {
7118
- const timeoutID = setTimeout(() => {
7119
- if (abortController) {
7120
- abortController.abort();
7121
- }
7122
-
7123
- reject(new TimeoutError(request));
7124
- }, ms);
7125
-
7126
- /* eslint-disable promise/prefer-await-to-then */
7127
- globals.fetch(request)
7128
- .then(resolve)
7129
- .catch(reject)
7130
- .then(() => {
7131
- clearTimeout(timeoutID);
7132
- });
7133
- /* eslint-enable promise/prefer-await-to-then */
7134
- });
7135
-
7136
- const normalizeRequestMethod = input => requestMethods.includes(input) ? input.toUpperCase() : input;
7137
-
7138
- const defaultRetryOptions = {
7139
- limit: 2,
7140
- methods: retryMethods,
7141
- statusCodes: retryStatusCodes,
7142
- afterStatusCodes: retryAfterStatusCodes
7143
- };
7144
-
7145
- const normalizeRetryOptions = (retry = {}) => {
7146
- if (typeof retry === 'number') {
7147
- return {
7148
- ...defaultRetryOptions,
7149
- limit: retry
7150
- };
7151
- }
7152
-
7153
- if (retry.methods && !Array.isArray(retry.methods)) {
7154
- throw new Error('retry.methods must be an array');
7155
- }
7156
-
7157
- if (retry.statusCodes && !Array.isArray(retry.statusCodes)) {
7158
- throw new Error('retry.statusCodes must be an array');
7159
- }
7160
-
7161
- return {
7162
- ...defaultRetryOptions,
7163
- ...retry,
7164
- afterStatusCodes: retryAfterStatusCodes
7165
- };
7166
- };
7167
-
7168
- // The maximum value of a 32bit int (see issue #117)
7169
- const maxSafeTimeout = 2147483647;
7170
-
7171
- class Ky {
7172
- constructor(input, options = {}) {
7173
- this._retryCount = 0;
7174
- this._input = input;
7175
- this._options = {
7176
- // TODO: credentials can be removed when the spec change is implemented in all browsers. Context: https://www.chromestatus.com/feature/4539473312350208
7177
- credentials: this._input.credentials || 'same-origin',
7178
- ...options,
7179
- headers: mergeHeaders(this._input.headers, options.headers),
7180
- hooks: deepMerge({
7181
- beforeRequest: [],
7182
- beforeRetry: [],
7183
- afterResponse: []
7184
- }, options.hooks),
7185
- method: normalizeRequestMethod(options.method || this._input.method),
7186
- prefixUrl: String(options.prefixUrl || ''),
7187
- retry: normalizeRetryOptions(options.retry),
7188
- throwHttpErrors: options.throwHttpErrors !== false,
7189
- timeout: typeof options.timeout === 'undefined' ? 10000 : options.timeout
7190
- };
7191
-
7192
- if (typeof this._input !== 'string' && !(this._input instanceof URL || this._input instanceof globals.Request)) {
7193
- throw new TypeError('`input` must be a string, URL, or Request');
7194
- }
7195
-
7196
- if (this._options.prefixUrl && typeof this._input === 'string') {
7197
- if (this._input.startsWith('/')) {
7198
- throw new Error('`input` must not begin with a slash when using `prefixUrl`');
7199
- }
7200
-
7201
- if (!this._options.prefixUrl.endsWith('/')) {
7202
- this._options.prefixUrl += '/';
7203
- }
7204
-
7205
- this._input = this._options.prefixUrl + this._input;
7206
- }
7207
-
7208
- if (supportsAbortController) {
7209
- this.abortController = new globals.AbortController();
7210
- if (this._options.signal) {
7211
- this._options.signal.addEventListener('abort', () => {
7212
- this.abortController.abort();
7213
- });
7214
- }
7215
-
7216
- this._options.signal = this.abortController.signal;
7217
- }
7218
-
7219
- this.request = new globals.Request(this._input, this._options);
7220
-
7221
- if (this._options.searchParams) {
7222
- const url = new URL(this.request.url);
7223
- url.search = new URLSearchParams(this._options.searchParams);
7224
-
7225
- // To provide correct form boundary, Content-Type header should be deleted each time when new Request instantiated from another one
7226
- if (((supportsFormData && this._options.body instanceof globals.FormData) || this._options.body instanceof URLSearchParams) && !(this._options.headers && this._options.headers['content-type'])) {
7227
- this.request.headers.delete('content-type');
7228
- }
7229
-
7230
- this.request = new globals.Request(new globals.Request(url, this.request), this._options);
7231
- }
7232
-
7233
- if (this._options.json !== undefined) {
7234
- this._options.body = JSON.stringify(this._options.json);
7235
- this.request.headers.set('content-type', 'application/json');
7236
- this.request = new globals.Request(this.request, {body: this._options.body});
7237
- }
7238
-
7239
- const fn = async () => {
7240
- if (this._options.timeout > maxSafeTimeout) {
7241
- throw new RangeError(`The \`timeout\` option cannot be greater than ${maxSafeTimeout}`);
7242
- }
7243
-
7244
- await delay(1);
7245
- let response = await this._fetch();
7246
-
7247
- for (const hook of this._options.hooks.afterResponse) {
7248
- // eslint-disable-next-line no-await-in-loop
7249
- const modifiedResponse = await hook(
7250
- this.request,
7251
- this._options,
7252
- response.clone()
7253
- );
7254
-
7255
- if (modifiedResponse instanceof globals.Response) {
7256
- response = modifiedResponse;
7257
- }
7258
- }
7259
-
7260
- if (!response.ok && this._options.throwHttpErrors) {
7261
- throw new HTTPError(response);
7262
- }
7263
-
7264
- // If `onDownloadProgress` is passed, it uses the stream API internally
7265
- /* istanbul ignore next */
7266
- if (this._options.onDownloadProgress) {
7267
- if (typeof this._options.onDownloadProgress !== 'function') {
7268
- throw new TypeError('The `onDownloadProgress` option must be a function');
7269
- }
7270
-
7271
- if (!supportsStreams) {
7272
- throw new Error('Streams are not supported in your environment. `ReadableStream` is missing.');
7273
- }
7274
-
7275
- return this._stream(response.clone(), this._options.onDownloadProgress);
7276
- }
7277
-
7278
- return response;
7279
- };
7280
-
7281
- const isRetriableMethod = this._options.retry.methods.includes(this.request.method.toLowerCase());
7282
- const result = isRetriableMethod ? this._retry(fn) : fn();
7283
-
7284
- for (const [type, mimeType] of Object.entries(responseTypes)) {
7285
- result[type] = async () => {
7286
- this.request.headers.set('accept', this.request.headers.get('accept') || mimeType);
7287
- const response = (await result).clone();
7288
- return (type === 'json' && response.status === 204) ? '' : response[type]();
7289
- };
7290
- }
7291
-
7292
- return result;
7293
- }
7294
-
7295
- _calculateRetryDelay(error) {
7296
- this._retryCount++;
7297
-
7298
- if (this._retryCount < this._options.retry.limit && !(error instanceof TimeoutError)) {
7299
- if (error instanceof HTTPError) {
7300
- if (!this._options.retry.statusCodes.includes(error.response.status)) {
7301
- return 0;
7302
- }
7303
-
7304
- const retryAfter = error.response.headers.get('Retry-After');
7305
- if (retryAfter && this._options.retry.afterStatusCodes.includes(error.response.status)) {
7306
- let after = Number(retryAfter);
7307
- if (Number.isNaN(after)) {
7308
- after = Date.parse(retryAfter) - Date.now();
7309
- } else {
7310
- after *= 1000;
7311
- }
7312
-
7313
- if (typeof this._options.retry.maxRetryAfter !== 'undefined' && after > this._options.retry.maxRetryAfter) {
7314
- return 0;
7315
- }
7316
-
7317
- return after;
7318
- }
7319
-
7320
- if (error.response.status === 413) {
7321
- return 0;
7322
- }
7323
- }
7324
-
7325
- const BACKOFF_FACTOR = 0.3;
7326
- return BACKOFF_FACTOR * (2 ** (this._retryCount - 1)) * 1000;
7327
- }
7119
+ /**
7120
+ * Faq resource
7121
+ */
7328
7122
 
7329
- return 0;
7330
- }
7123
+ class Faq extends CrudBase["default"] {
7124
+ static get resourceName() {
7125
+ return 'faqs';
7126
+ }
7331
7127
 
7332
- async _retry(fn) {
7333
- try {
7334
- return await fn();
7335
- } catch (error) {
7336
- const ms = Math.min(this._calculateRetryDelay(error), maxSafeTimeout);
7337
- if (ms !== 0 && this._retryCount > 0) {
7338
- await delay(ms);
7128
+ }
7129
+ // EXTERNAL MODULE: ./src/resources/Feature.js
7130
+ var Feature = __webpack_require__(49);
7131
+ // EXTERNAL MODULE: ./src/resources/Font.js
7132
+ var Font = __webpack_require__(51);
7133
+ // EXTERNAL MODULE: ./src/resources/FontFamily.js
7134
+ var FontFamily = __webpack_require__(50);
7135
+ ;// CONCATENATED MODULE: ./src/resources/Highlight.js
7136
+ /*
7137
+ * BSD 3-Clause License
7138
+ *
7139
+ * Copyright (c) 2020, Mapcreator
7140
+ * All rights reserved.
7141
+ *
7142
+ * Redistribution and use in source and binary forms, with or without
7143
+ * modification, are permitted provided that the following conditions are met:
7144
+ *
7145
+ * Redistributions of source code must retain the above copyright notice, this
7146
+ * list of conditions and the following disclaimer.
7147
+ *
7148
+ * Redistributions in binary form must reproduce the above copyright notice,
7149
+ * this list of conditions and the following disclaimer in the documentation
7150
+ * and/or other materials provided with the distribution.
7151
+ *
7152
+ * Neither the name of the copyright holder nor the names of its
7153
+ * contributors may be used to endorse or promote products derived from
7154
+ * this software without specific prior written permission.
7155
+ *
7156
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
7157
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
7158
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7159
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
7160
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
7161
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7162
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
7163
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
7164
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7165
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7166
+ */
7339
7167
 
7340
- for (const hook of this._options.hooks.beforeRetry) {
7341
- // eslint-disable-next-line no-await-in-loop
7342
- const hookResult = await hook({
7343
- request: this.request,
7344
- options: this._options,
7345
- error,
7346
- response: error.response.clone(),
7347
- retryCount: this._retryCount
7348
- });
7168
+ class Highlight extends ResourceBase["default"] {
7169
+ static get resourceName() {
7170
+ return 'highlights';
7171
+ }
7349
7172
 
7350
- // If `stop` is returned from the hook, the retry process is stopped
7351
- if (hookResult === stop) {
7352
- return;
7353
- }
7354
- }
7173
+ }
7174
+ ;// CONCATENATED MODULE: ./src/resources/InsetMap.js
7175
+ /*
7176
+ * BSD 3-Clause License
7177
+ *
7178
+ * Copyright (c) 2020, Mapcreator
7179
+ * All rights reserved.
7180
+ *
7181
+ * Redistribution and use in source and binary forms, with or without
7182
+ * modification, are permitted provided that the following conditions are met:
7183
+ *
7184
+ * Redistributions of source code must retain the above copyright notice, this
7185
+ * list of conditions and the following disclaimer.
7186
+ *
7187
+ * Redistributions in binary form must reproduce the above copyright notice,
7188
+ * this list of conditions and the following disclaimer in the documentation
7189
+ * and/or other materials provided with the distribution.
7190
+ *
7191
+ * Neither the name of the copyright holder nor the names of its
7192
+ * contributors may be used to endorse or promote products derived from
7193
+ * this software without specific prior written permission.
7194
+ *
7195
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
7196
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
7197
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7198
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
7199
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
7200
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7201
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
7202
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
7203
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7204
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7205
+ */
7355
7206
 
7356
- return this._retry(fn);
7357
- }
7358
7207
 
7359
- if (this._options.throwHttpErrors) {
7360
- throw error;
7361
- }
7362
- }
7363
- }
7208
+ class InsetMap extends ResourceBase["default"] {
7209
+ static get resourceName() {
7210
+ return 'inset-maps';
7211
+ }
7212
+ /**
7213
+ * Get the inset map json
7214
+ * @returns {CancelablePromise<Object>} - Inset map json
7215
+ * @throws {ApiError} - If the api returns errors
7216
+ */
7364
7217
 
7365
- async _fetch() {
7366
- for (const hook of this._options.hooks.beforeRequest) {
7367
- // eslint-disable-next-line no-await-in-loop
7368
- const result = await hook(this.request, this._options);
7369
7218
 
7370
- if (result instanceof Request) {
7371
- this.request = result;
7372
- break;
7373
- }
7219
+ getJson() {
7220
+ return (0,helpers.makeCancelable)(signal => this.api.ky.get(`${this.url}/json`, {
7221
+ signal
7222
+ }).json());
7223
+ }
7374
7224
 
7375
- if (result instanceof Response) {
7376
- return result;
7377
- }
7378
- }
7225
+ }
7226
+ // EXTERNAL MODULE: ./src/resources/Job.js
7227
+ var Job = __webpack_require__(52);
7228
+ // EXTERNAL MODULE: ./src/resources/JobResult.js
7229
+ var JobResult = __webpack_require__(53);
7230
+ // EXTERNAL MODULE: ./src/resources/JobRevision.js
7231
+ var JobRevision = __webpack_require__(69);
7232
+ // EXTERNAL MODULE: ./src/resources/JobShare.js
7233
+ var JobShare = __webpack_require__(26);
7234
+ // EXTERNAL MODULE: ./src/resources/JobType.js
7235
+ var JobType = __webpack_require__(55);
7236
+ // EXTERNAL MODULE: ./src/resources/Language.js
7237
+ var Language = __webpack_require__(71);
7238
+ // EXTERNAL MODULE: ./src/resources/Layer.js
7239
+ var Layer = __webpack_require__(27);
7240
+ // EXTERNAL MODULE: ./src/resources/base/CrudSetItemBase.js
7241
+ var CrudSetItemBase = __webpack_require__(10);
7242
+ ;// CONCATENATED MODULE: ./src/resources/LayerFaq.js
7243
+ /*
7244
+ * BSD 3-Clause License
7245
+ *
7246
+ * Copyright (c) 2022, Mapcreator
7247
+ * All rights reserved.
7248
+ *
7249
+ * Redistribution and use in source and binary forms, with or without
7250
+ * modification, are permitted provided that the following conditions are met:
7251
+ *
7252
+ * Redistributions of source code must retain the above copyright notice, this
7253
+ * list of conditions and the following disclaimer.
7254
+ *
7255
+ * Redistributions in binary form must reproduce the above copyright notice,
7256
+ * this list of conditions and the following disclaimer in the documentation
7257
+ * and/or other materials provided with the distribution.
7258
+ *
7259
+ * Neither the name of the copyright holder nor the names of its
7260
+ * contributors may be used to endorse or promote products derived from
7261
+ * this software without specific prior written permission.
7262
+ *
7263
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
7264
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
7265
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7266
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
7267
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
7268
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7269
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
7270
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
7271
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7272
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7273
+ */
7379
7274
 
7380
- if (this._options.timeout === false) {
7381
- return globals.fetch(this.request.clone());
7382
- }
7275
+ /**
7276
+ * LayerFaq
7277
+ * @extends CrudSetItemBase
7278
+ */
7383
7279
 
7384
- return timeout(this.request.clone(), this._options.timeout, this.abortController);
7385
- }
7280
+ class LayerFaq extends CrudSetItemBase["default"] {
7281
+ static get resourceName() {
7282
+ return 'layer-faqs';
7283
+ }
7386
7284
 
7387
- /* istanbul ignore next */
7388
- _stream(response, onDownloadProgress) {
7389
- const totalBytes = Number(response.headers.get('content-length')) || 0;
7390
- let transferredBytes = 0;
7285
+ static get parentKey() {
7286
+ return 'layer_group_id';
7287
+ }
7391
7288
 
7392
- return new globals.Response(
7393
- new globals.ReadableStream({
7394
- start(controller) {
7395
- const reader = response.body.getReader();
7289
+ }
7290
+ // EXTERNAL MODULE: ./src/resources/LayerGroup.js
7291
+ var LayerGroup = __webpack_require__(74);
7292
+ // EXTERNAL MODULE: ./src/resources/Mapstyle.js
7293
+ var Mapstyle = __webpack_require__(70);
7294
+ // EXTERNAL MODULE: ./src/resources/MapstyleSet.js + 1 modules
7295
+ var MapstyleSet = __webpack_require__(28);
7296
+ // EXTERNAL MODULE: ./src/resources/Message.js + 1 modules
7297
+ var Message = __webpack_require__(37);
7298
+ // EXTERNAL MODULE: ./src/resources/Notification.js
7299
+ var Notification = __webpack_require__(72);
7300
+ // EXTERNAL MODULE: ./src/resources/Organisation.js
7301
+ var Organisation = __webpack_require__(45);
7302
+ // EXTERNAL MODULE: ./src/traits/OwnableResource.js
7303
+ var OwnableResource = __webpack_require__(4);
7304
+ // EXTERNAL MODULE: ./src/utils/reflection.js
7305
+ var reflection = __webpack_require__(0);
7306
+ ;// CONCATENATED MODULE: ./src/resources/OrganisationNote.js
7307
+ /*
7308
+ * BSD 3-Clause License
7309
+ *
7310
+ * Copyright (c) 2020, Mapcreator
7311
+ * All rights reserved.
7312
+ *
7313
+ * Redistribution and use in source and binary forms, with or without
7314
+ * modification, are permitted provided that the following conditions are met:
7315
+ *
7316
+ * Redistributions of source code must retain the above copyright notice, this
7317
+ * list of conditions and the following disclaimer.
7318
+ *
7319
+ * Redistributions in binary form must reproduce the above copyright notice,
7320
+ * this list of conditions and the following disclaimer in the documentation
7321
+ * and/or other materials provided with the distribution.
7322
+ *
7323
+ * Neither the name of the copyright holder nor the names of its
7324
+ * contributors may be used to endorse or promote products derived from
7325
+ * this software without specific prior written permission.
7326
+ *
7327
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
7328
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
7329
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7330
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
7331
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
7332
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7333
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
7334
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
7335
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7336
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7337
+ */
7396
7338
 
7397
- if (onDownloadProgress) {
7398
- onDownloadProgress({percent: 0, transferredBytes: 0, totalBytes}, new Uint8Array());
7399
- }
7400
7339
 
7401
- async function read() {
7402
- const {done, value} = await reader.read();
7403
- if (done) {
7404
- controller.close();
7405
- return;
7406
- }
7407
7340
 
7408
- if (onDownloadProgress) {
7409
- transferredBytes += value.byteLength;
7410
- const percent = totalBytes === 0 ? 0 : transferredBytes / totalBytes;
7411
- onDownloadProgress({percent, transferredBytes, totalBytes}, value);
7412
- }
7341
+ /**
7342
+ * Font family
7343
+ * @extends CrudSetBase
7344
+ * @mixes OwnableResource
7345
+ *
7346
+ * @property {number} id
7347
+ * @property {number} organisationId
7348
+ * @property {number} userId
7349
+ * @property {string} content
7350
+ * @property {Date} createdAt
7351
+ * @property {Date} updatedAt
7352
+ */
7413
7353
 
7414
- controller.enqueue(value);
7415
- read();
7416
- }
7354
+ class OrganisationNote extends (0,reflection.mix)(CrudBase["default"], OwnableResource["default"]) {
7355
+ static get resourcePath() {
7356
+ return '/organisations/{organisation_id}/notes/{id}';
7357
+ }
7358
+
7359
+ static get resourceName() {
7360
+ return 'notes';
7361
+ }
7417
7362
 
7418
- read();
7419
- }
7420
- })
7421
- );
7422
- }
7423
7363
  }
7364
+ // EXTERNAL MODULE: ./src/resources/Permission.js
7365
+ var Permission = __webpack_require__(59);
7366
+ // EXTERNAL MODULE: ./src/resources/base/CrudSetBase.js
7367
+ var CrudSetBase = __webpack_require__(16);
7368
+ ;// CONCATENATED MODULE: ./src/resources/ProductTourStep.js
7369
+ /*
7370
+ * BSD 3-Clause License
7371
+ *
7372
+ * Copyright (c) 2020, Mapcreator
7373
+ * All rights reserved.
7374
+ *
7375
+ * Redistribution and use in source and binary forms, with or without
7376
+ * modification, are permitted provided that the following conditions are met:
7377
+ *
7378
+ * Redistributions of source code must retain the above copyright notice, this
7379
+ * list of conditions and the following disclaimer.
7380
+ *
7381
+ * Redistributions in binary form must reproduce the above copyright notice,
7382
+ * this list of conditions and the following disclaimer in the documentation
7383
+ * and/or other materials provided with the distribution.
7384
+ *
7385
+ * Neither the name of the copyright holder nor the names of its
7386
+ * contributors may be used to endorse or promote products derived from
7387
+ * this software without specific prior written permission.
7388
+ *
7389
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
7390
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
7391
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7392
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
7393
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
7394
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7395
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
7396
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
7397
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7398
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7399
+ */
7424
7400
 
7425
- const validateAndMerge = (...sources) => {
7426
- for (const source of sources) {
7427
- if ((!isObject(source) || Array.isArray(source)) && typeof source !== 'undefined') {
7428
- throw new TypeError('The `options` argument must be an object');
7429
- }
7430
- }
7431
7401
 
7432
- return deepMerge({}, ...sources);
7433
- };
7402
+ /**
7403
+ * @extends CrudSetItemBase
7404
+ */
7434
7405
 
7435
- const createInstance = defaults => {
7436
- const ky = (input, options) => new Ky(input, validateAndMerge(defaults, options));
7406
+ class ProductTourStep extends (0,reflection.mix)(CrudSetItemBase["default"]) {
7407
+ static get resourceName() {
7408
+ return 'product-tours/steps';
7409
+ }
7437
7410
 
7438
- for (const method of requestMethods) {
7439
- ky[method] = (input, options) => new Ky(input, validateAndMerge(defaults, options, {method}));
7440
- }
7411
+ static get parentKey() {
7412
+ return 'product_tour_id';
7413
+ }
7441
7414
 
7442
- ky.HTTPError = HTTPError;
7443
- ky.TimeoutError = TimeoutError;
7444
- ky.create = newDefaults => createInstance(validateAndMerge(newDefaults));
7445
- ky.extend = newDefaults => createInstance(validateAndMerge(defaults, newDefaults));
7446
- ky.stop = stop;
7415
+ }
7416
+ ;// CONCATENATED MODULE: ./src/resources/ProductTour.js
7417
+ /*
7418
+ * BSD 3-Clause License
7419
+ *
7420
+ * Copyright (c) 2020, Mapcreator
7421
+ * All rights reserved.
7422
+ *
7423
+ * Redistribution and use in source and binary forms, with or without
7424
+ * modification, are permitted provided that the following conditions are met:
7425
+ *
7426
+ * Redistributions of source code must retain the above copyright notice, this
7427
+ * list of conditions and the following disclaimer.
7428
+ *
7429
+ * Redistributions in binary form must reproduce the above copyright notice,
7430
+ * this list of conditions and the following disclaimer in the documentation
7431
+ * and/or other materials provided with the distribution.
7432
+ *
7433
+ * Neither the name of the copyright holder nor the names of its
7434
+ * contributors may be used to endorse or promote products derived from
7435
+ * this software without specific prior written permission.
7436
+ *
7437
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
7438
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
7439
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7440
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
7441
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
7442
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7443
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
7444
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
7445
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7446
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7447
+ */
7447
7448
 
7448
- return ky;
7449
- };
7450
7449
 
7451
- /* harmony default export */ const ky = (createInstance());
7452
7450
 
7453
- ;// CONCATENATED MODULE: ./node_modules/ky-universal/browser.js
7451
+ /**
7452
+ * Mapstyle set
7453
+ * @extends CrudSetBase
7454
+ */
7454
7455
 
7456
+ class ProductTour extends (0,reflection.mix)(CrudSetBase["default"]) {
7457
+ static get resourcePath() {
7458
+ return '/product-tours/{id}';
7459
+ }
7455
7460
 
7461
+ static get resourceName() {
7462
+ return 'product-tours';
7463
+ }
7456
7464
 
7457
- /***/ }),
7458
- /* 31 */
7459
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
7465
+ get _Child() {
7466
+ return ProductTourStep;
7467
+ }
7460
7468
 
7461
- "use strict";
7462
- __webpack_require__.r(__webpack_exports__);
7463
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7464
- /* harmony export */ "default": () => (/* binding */ Trait)
7465
- /* harmony export */ });
7469
+ }
7470
+ // EXTERNAL MODULE: ./src/resources/Role.js
7471
+ var Role = __webpack_require__(73);
7472
+ // EXTERNAL MODULE: ./src/resources/Svg.js
7473
+ var Svg = __webpack_require__(57);
7474
+ // EXTERNAL MODULE: ./src/resources/SvgSet.js
7475
+ var SvgSet = __webpack_require__(56);
7476
+ // EXTERNAL MODULE: ./src/resources/Tag.js
7477
+ var Tag = __webpack_require__(29);
7478
+ ;// CONCATENATED MODULE: ./src/resources/TagType.js
7466
7479
  /*
7467
7480
  * BSD 3-Clause License
7468
7481
  *
@@ -7495,31 +7508,34 @@ __webpack_require__.r(__webpack_exports__);
7495
7508
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7496
7509
  */
7497
7510
 
7511
+
7498
7512
  /**
7499
- * Trait interface
7500
- * @interface
7501
- * @mixin
7513
+ * TagType resource
7514
+ * @mixes CrudSetBase
7502
7515
  */
7503
- class Trait {
7516
+
7517
+ class TagType extends CrudBase["default"] {
7518
+ static get resourcePath() {
7519
+ return '/tags/types/{id}';
7520
+ }
7521
+
7522
+ static get resourceName() {
7523
+ return 'tag-types';
7524
+ }
7504
7525
  /**
7505
- * Optional initialization method
7526
+ * Get the list of tags that are attached to this type
7527
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
7506
7528
  */
7507
- initializer() {}
7508
7529
 
7509
- }
7510
7530
 
7511
- /***/ }),
7512
- /* 32 */
7513
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
7531
+ get tags() {
7532
+ return this._proxyResourceList(Tag["default"], `${this.url}/tags`);
7533
+ }
7514
7534
 
7515
- "use strict";
7516
- __webpack_require__.r(__webpack_exports__);
7517
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7518
- /* harmony export */ "fnv32b": () => (/* binding */ fnv32b),
7519
- /* harmony export */ "hashObject": () => (/* binding */ hashObject)
7520
- /* harmony export */ });
7521
- /* harmony import */ var json_stable_stringify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(38);
7522
- /* harmony import */ var json_stable_stringify__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(json_stable_stringify__WEBPACK_IMPORTED_MODULE_0__);
7535
+ }
7536
+ // EXTERNAL MODULE: ./src/resources/User.js
7537
+ var User = __webpack_require__(58);
7538
+ ;// CONCATENATED MODULE: ./src/resources/VectorHighlight.js
7523
7539
  /*
7524
7540
  * BSD 3-Clause License
7525
7541
  *
@@ -7552,49 +7568,52 @@ __webpack_require__.r(__webpack_exports__);
7552
7568
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7553
7569
  */
7554
7570
 
7555
- const FNV1_32A_INIT = 0x811c9dc5;
7556
- /**
7557
- * Fast hash function for non-cryptographic use
7558
- * @param {string} str - Input to be hashed
7559
- * @returns {string} - String representation of the hash
7560
- * @private
7561
- */
7562
-
7563
- function fnv32b(str) {
7564
- let hash = str.split('').map(x => x.charCodeAt(0)).reduce((sum, val) => {
7565
- sum ^= val;
7566
- return sum + (sum << 1) + (sum << 4) + (sum << 7) + (sum << 8) + (sum << 24);
7567
- }, FNV1_32A_INIT); // Avalanche
7571
+ class VectorHighlight extends ResourceBase["default"] {
7572
+ static get resourceName() {
7573
+ return 'highlights/vector';
7574
+ }
7568
7575
 
7569
- hash ^= hash << 3;
7570
- hash += hash >> 5;
7571
- hash ^= hash << 4;
7572
- hash += hash >> 17;
7573
- hash ^= hash << 25;
7574
- hash += hash >> 6;
7575
- return `0000000${(hash >>> 0).toString(16)}`.substr(-8);
7576
7576
  }
7577
- /**
7578
- * Fast object hashing for non-cryptographic use
7579
- * @param {object} data - input data
7580
- * @returns {string} - String reprisentation of the hash
7581
- * @private
7577
+ ;// CONCATENATED MODULE: ./src/resources/VectorChoropleth.js
7578
+ /*
7579
+ * BSD 3-Clause License
7580
+ *
7581
+ * Copyright (c) 2020, Mapcreator
7582
+ * All rights reserved.
7583
+ *
7584
+ * Redistribution and use in source and binary forms, with or without
7585
+ * modification, are permitted provided that the following conditions are met:
7586
+ *
7587
+ * Redistributions of source code must retain the above copyright notice, this
7588
+ * list of conditions and the following disclaimer.
7589
+ *
7590
+ * Redistributions in binary form must reproduce the above copyright notice,
7591
+ * this list of conditions and the following disclaimer in the documentation
7592
+ * and/or other materials provided with the distribution.
7593
+ *
7594
+ * Neither the name of the copyright holder nor the names of its
7595
+ * contributors may be used to endorse or promote products derived from
7596
+ * this software without specific prior written permission.
7597
+ *
7598
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
7599
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
7600
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7601
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
7602
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
7603
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7604
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
7605
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
7606
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7607
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7582
7608
  */
7583
7609
 
7584
- function hashObject(data) {
7585
- return fnv32b(json_stable_stringify__WEBPACK_IMPORTED_MODULE_0___default()(data));
7586
- }
7587
-
7588
- /***/ }),
7589
- /* 33 */
7590
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
7610
+ class VectorChoropleth extends ResourceBase["default"] {
7611
+ static get resourceName() {
7612
+ return 'choropleths/vector';
7613
+ }
7591
7614
 
7592
- "use strict";
7593
- __webpack_require__.r(__webpack_exports__);
7594
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7595
- /* harmony export */ "default": () => (/* binding */ StaticClass)
7596
- /* harmony export */ });
7597
- /* harmony import */ var _errors_StaticClassError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(62);
7615
+ }
7616
+ ;// CONCATENATED MODULE: ./src/resources/index.js
7598
7617
  /*
7599
7618
  * BSD 3-Clause License
7600
7619
  *
@@ -7627,644 +7646,588 @@ __webpack_require__.r(__webpack_exports__);
7627
7646
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7628
7647
  */
7629
7648
 
7649
+
7650
+
7651
+
7652
+
7653
+
7654
+
7655
+
7656
+
7657
+
7658
+
7659
+
7660
+
7661
+
7662
+
7663
+
7664
+
7665
+
7666
+
7667
+
7668
+
7669
+
7670
+
7671
+
7672
+
7673
+
7674
+
7675
+
7676
+
7677
+
7678
+
7679
+
7680
+
7681
+
7682
+
7683
+
7684
+
7685
+
7686
+
7687
+
7688
+
7630
7689
  /**
7631
- * Disables the constructor and throws a {@link StaticClassError} when an instance is created.
7632
- * @protected
7690
+ * @private
7633
7691
  */
7634
7692
 
7635
- class StaticClass {
7636
- constructor() {
7637
- throw new _errors_StaticClassError__WEBPACK_IMPORTED_MODULE_0__["default"]();
7638
- }
7639
-
7640
- }
7693
+ const base = {
7694
+ CrudBase: CrudBase["default"],
7695
+ CrudSetBase: CrudSetBase["default"],
7696
+ ResourceBase: ResourceBase["default"]
7697
+ };
7641
7698
 
7642
7699
  /***/ }),
7643
- /* 34 */
7700
+ /* 31 */
7644
7701
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
7645
7702
 
7646
7703
  "use strict";
7704
+ // ESM COMPAT FLAG
7647
7705
  __webpack_require__.r(__webpack_exports__);
7648
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7649
- /* harmony export */ "default": () => (/* binding */ OrganisationProxy)
7650
- /* harmony export */ });
7651
- /* harmony import */ var _utils_reflection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
7652
- /* harmony import */ var _SimpleResourceProxy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14);
7653
- /* harmony import */ var _utils_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1);
7654
- /*
7655
- * BSD 3-Clause License
7656
- *
7657
- * Copyright (c) 2020, Mapcreator
7658
- * All rights reserved.
7659
- *
7660
- * Redistribution and use in source and binary forms, with or without
7661
- * modification, are permitted provided that the following conditions are met:
7662
- *
7663
- * Redistributions of source code must retain the above copyright notice, this
7664
- * list of conditions and the following disclaimer.
7665
- *
7666
- * Redistributions in binary form must reproduce the above copyright notice,
7667
- * this list of conditions and the following disclaimer in the documentation
7668
- * and/or other materials provided with the distribution.
7669
- *
7670
- * Neither the name of the copyright holder nor the names of its
7671
- * contributors may be used to endorse or promote products derived from
7672
- * this software without specific prior written permission.
7673
- *
7674
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
7675
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
7676
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7677
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
7678
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
7679
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7680
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
7681
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
7682
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7683
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7684
- */
7685
7706
 
7707
+ // EXPORTS
7708
+ __webpack_require__.d(__webpack_exports__, {
7709
+ "default": () => (/* reexport */ ky)
7710
+ });
7686
7711
 
7712
+ ;// CONCATENATED MODULE: ./node_modules/ky/index.js
7713
+ /*! MIT License © Sindre Sorhus */
7687
7714
 
7688
- class OrganisationProxy extends _SimpleResourceProxy__WEBPACK_IMPORTED_MODULE_1__["default"] {
7689
- /**
7690
- * @param {Mapcreator} api - Instance of the api
7691
- * @param {ResourceBase} parent - Parent instance
7692
- */
7693
- constructor(api, parent) {
7694
- // Fixes dependency issue
7695
- const Organisation = (__webpack_require__(45)["default"]);
7715
+ const globals = {};
7696
7716
 
7697
- super(api, Organisation, `${parent.url}/organisations`, {});
7698
- this._parent = parent;
7699
- }
7700
- /**
7701
- * Returns parent instance
7702
- * @returns {ResourceBase} - Parent instance
7703
- */
7717
+ const getGlobal = property => {
7718
+ /* istanbul ignore next */
7719
+ if (typeof self !== 'undefined' && self && property in self) {
7720
+ return self;
7721
+ }
7704
7722
 
7723
+ /* istanbul ignore next */
7724
+ if (typeof window !== 'undefined' && window && property in window) {
7725
+ return window;
7726
+ }
7705
7727
 
7706
- get parent() {
7707
- return this._parent;
7708
- }
7709
- /**
7710
- * Sync organisations to the parent resource
7711
- * The organisations attached to the target resource will be replaced with the organisations provided in the request.
7712
- * @param {Array<Organisation|number>} organisations - List of items to sync
7713
- * @throws {ApiError} - If the api returns errors
7714
- * @returns {CancelablePromise}
7715
- */
7728
+ if (typeof global !== 'undefined' && global && property in global) {
7729
+ return global;
7730
+ }
7716
7731
 
7732
+ /* istanbul ignore next */
7733
+ if (typeof globalThis !== 'undefined' && globalThis) {
7734
+ return globalThis;
7735
+ }
7736
+ };
7717
7737
 
7718
- sync(organisations) {
7719
- return this._modifyLink(organisations, 'PATCH', this.Target);
7720
- }
7721
- /**
7722
- * Attach organisations to the parent resource
7723
- * The provided organisations will be attached to the resource if they're not already attached
7724
- * @param {Array<Organisation|number>} organisations - List of items to attach
7725
- * @throws {ApiError} - If the api returns errors
7726
- * @returns {CancelablePromise}
7727
- */
7738
+ const globalProperties = [
7739
+ 'Headers',
7740
+ 'Request',
7741
+ 'Response',
7742
+ 'ReadableStream',
7743
+ 'fetch',
7744
+ 'AbortController',
7745
+ 'FormData'
7746
+ ];
7747
+
7748
+ for (const property of globalProperties) {
7749
+ Object.defineProperty(globals, property, {
7750
+ get() {
7751
+ const globalObject = getGlobal(property);
7752
+ const value = globalObject && globalObject[property];
7753
+ return typeof value === 'function' ? value.bind(globalObject) : value;
7754
+ }
7755
+ });
7756
+ }
7728
7757
 
7758
+ const isObject = value => value !== null && typeof value === 'object';
7759
+ const supportsAbortController = typeof globals.AbortController === 'function';
7760
+ const supportsStreams = typeof globals.ReadableStream === 'function';
7761
+ const supportsFormData = typeof globals.FormData === 'function';
7729
7762
 
7730
- attach(organisations) {
7731
- return this._modifyLink(organisations, 'POST', this.Target);
7732
- }
7733
- /**
7734
- * Detach organisations from the parent resource
7735
- * The provided organisations will be detached from the resource
7736
- * @param {Array<Organisation|number>} organisations - List of items to detach
7737
- * @throws {ApiError} - If the api returns errors
7738
- * @returns {CancelablePromise}
7739
- */
7763
+ const mergeHeaders = (source1, source2) => {
7764
+ const result = new globals.Headers(source1);
7765
+ const isHeadersInstance = source2 instanceof globals.Headers;
7766
+ const source = new globals.Headers(source2);
7767
+
7768
+ for (const [key, value] of source) {
7769
+ if ((isHeadersInstance && value === 'undefined') || value === undefined) {
7770
+ result.delete(key);
7771
+ } else {
7772
+ result.set(key, value);
7773
+ }
7774
+ }
7775
+
7776
+ return result;
7777
+ };
7778
+
7779
+ const deepMerge = (...sources) => {
7780
+ let returnValue = {};
7781
+ let headers = {};
7782
+
7783
+ for (const source of sources) {
7784
+ if (Array.isArray(source)) {
7785
+ if (!(Array.isArray(returnValue))) {
7786
+ returnValue = [];
7787
+ }
7788
+
7789
+ returnValue = [...returnValue, ...source];
7790
+ } else if (isObject(source)) {
7791
+ for (let [key, value] of Object.entries(source)) {
7792
+ if (isObject(value) && Reflect.has(returnValue, key)) {
7793
+ value = deepMerge(returnValue[key], value);
7794
+ }
7795
+
7796
+ returnValue = {...returnValue, [key]: value};
7797
+ }
7798
+
7799
+ if (isObject(source.headers)) {
7800
+ headers = mergeHeaders(headers, source.headers);
7801
+ }
7802
+ }
7803
+
7804
+ returnValue.headers = headers;
7805
+ }
7806
+
7807
+ return returnValue;
7808
+ };
7809
+
7810
+ const requestMethods = [
7811
+ 'get',
7812
+ 'post',
7813
+ 'put',
7814
+ 'patch',
7815
+ 'head',
7816
+ 'delete'
7817
+ ];
7818
+
7819
+ const responseTypes = {
7820
+ json: 'application/json',
7821
+ text: 'text/*',
7822
+ formData: 'multipart/form-data',
7823
+ arrayBuffer: '*/*',
7824
+ blob: '*/*'
7825
+ };
7826
+
7827
+ const retryMethods = [
7828
+ 'get',
7829
+ 'put',
7830
+ 'head',
7831
+ 'delete',
7832
+ 'options',
7833
+ 'trace'
7834
+ ];
7835
+
7836
+ const retryStatusCodes = [
7837
+ 408,
7838
+ 413,
7839
+ 429,
7840
+ 500,
7841
+ 502,
7842
+ 503,
7843
+ 504
7844
+ ];
7845
+
7846
+ const retryAfterStatusCodes = [
7847
+ 413,
7848
+ 429,
7849
+ 503
7850
+ ];
7851
+
7852
+ const stop = Symbol('stop');
7853
+
7854
+ class HTTPError extends Error {
7855
+ constructor(response) {
7856
+ // Set the message to the status text, such as Unauthorized,
7857
+ // with some fallbacks. This message should never be undefined.
7858
+ super(
7859
+ response.statusText ||
7860
+ String(
7861
+ (response.status === 0 || response.status) ?
7862
+ response.status : 'Unknown response error'
7863
+ )
7864
+ );
7865
+ this.name = 'HTTPError';
7866
+ this.response = response;
7867
+ }
7868
+ }
7869
+
7870
+ class TimeoutError extends Error {
7871
+ constructor(request) {
7872
+ super('Request timed out');
7873
+ this.name = 'TimeoutError';
7874
+ this.request = request;
7875
+ }
7876
+ }
7740
7877
 
7878
+ const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
7741
7879
 
7742
- detach(organisations) {
7743
- return this._modifyLink(organisations, 'DELETE', this.Target);
7744
- }
7745
- /**
7746
- * Attach all organisations to the parent resource
7747
- * @throws {ApiError} - If the api returns errors
7748
- * @returns {CancelablePromise}
7749
- */
7880
+ // `Promise.race()` workaround (#91)
7881
+ const timeout = (request, ms, abortController) =>
7882
+ new Promise((resolve, reject) => {
7883
+ const timeoutID = setTimeout(() => {
7884
+ if (abortController) {
7885
+ abortController.abort();
7886
+ }
7750
7887
 
7888
+ reject(new TimeoutError(request));
7889
+ }, ms);
7751
7890
 
7752
- attachAll() {
7753
- return (0,_utils_helpers__WEBPACK_IMPORTED_MODULE_2__.makeCancelable)(async signal => {
7754
- await this.api.ky.post(`${this.baseUrl}/all`, {
7755
- signal
7756
- });
7757
- });
7758
- }
7759
- /**
7760
- * Detach all organisations from the parent resource
7761
- * @throws {ApiError} - If the api returns errors
7762
- * @returns {CancelablePromise}
7763
- */
7891
+ /* eslint-disable promise/prefer-await-to-then */
7892
+ globals.fetch(request)
7893
+ .then(resolve)
7894
+ .catch(reject)
7895
+ .then(() => {
7896
+ clearTimeout(timeoutID);
7897
+ });
7898
+ /* eslint-enable promise/prefer-await-to-then */
7899
+ });
7764
7900
 
7901
+ const normalizeRequestMethod = input => requestMethods.includes(input) ? input.toUpperCase() : input;
7765
7902
 
7766
- detachAll() {
7767
- return (0,_utils_helpers__WEBPACK_IMPORTED_MODULE_2__.makeCancelable)(async signal => {
7768
- await this.api.ky.delete(`${this.baseUrl}/all`, {
7769
- signal
7770
- });
7771
- });
7772
- }
7773
- /**
7774
- * Sync, attach or unlink resources
7775
- * @param {Array<Organisation|Number>|Organisation|Number} items - List of items to sync or attach
7776
- * @param {String} method - Http method to use
7777
- * @param {Class<ResourceBase>} Type - Resource type
7778
- * @param {?String} path - Optional appended resource path, will guess if null
7779
- * @throws {ApiError} - If the api returns errors
7780
- * @protected
7781
- * @returns {CancelablePromise}
7782
- */
7903
+ const defaultRetryOptions = {
7904
+ limit: 2,
7905
+ methods: retryMethods,
7906
+ statusCodes: retryStatusCodes,
7907
+ afterStatusCodes: retryAfterStatusCodes
7908
+ };
7783
7909
 
7910
+ const normalizeRetryOptions = (retry = {}) => {
7911
+ if (typeof retry === 'number') {
7912
+ return {
7913
+ ...defaultRetryOptions,
7914
+ limit: retry
7915
+ };
7916
+ }
7784
7917
 
7785
- _modifyLink(items, method, Type, path = null) {
7786
- if (!Array.isArray(items)) {
7787
- items = [items];
7788
- }
7918
+ if (retry.methods && !Array.isArray(retry.methods)) {
7919
+ throw new Error('retry.methods must be an array');
7920
+ }
7789
7921
 
7790
- if (!path) {
7791
- const resource = Type.resourceName.replace(/s+$/, '');
7792
- path = `${resource}s`;
7793
- }
7922
+ if (retry.statusCodes && !Array.isArray(retry.statusCodes)) {
7923
+ throw new Error('retry.statusCodes must be an array');
7924
+ }
7794
7925
 
7795
- const keys = items.map(x => typeof x === 'number' ? x : x.id).map(Number);
7926
+ return {
7927
+ ...defaultRetryOptions,
7928
+ ...retry,
7929
+ afterStatusCodes: retryAfterStatusCodes
7930
+ };
7931
+ };
7796
7932
 
7797
- const filter = x => !(0,_utils_reflection__WEBPACK_IMPORTED_MODULE_0__.isParentOf)(Type, x) && !Number.isFinite(x);
7933
+ // The maximum value of a 32bit int (see issue #117)
7934
+ const maxSafeTimeout = 2147483647;
7798
7935
 
7799
- const isValid = keys.filter(filter).length === 0;
7936
+ class Ky {
7937
+ constructor(input, options = {}) {
7938
+ this._retryCount = 0;
7939
+ this._input = input;
7940
+ this._options = {
7941
+ // TODO: credentials can be removed when the spec change is implemented in all browsers. Context: https://www.chromestatus.com/feature/4539473312350208
7942
+ credentials: this._input.credentials || 'same-origin',
7943
+ ...options,
7944
+ headers: mergeHeaders(this._input.headers, options.headers),
7945
+ hooks: deepMerge({
7946
+ beforeRequest: [],
7947
+ beforeRetry: [],
7948
+ afterResponse: []
7949
+ }, options.hooks),
7950
+ method: normalizeRequestMethod(options.method || this._input.method),
7951
+ prefixUrl: String(options.prefixUrl || ''),
7952
+ retry: normalizeRetryOptions(options.retry),
7953
+ throwHttpErrors: options.throwHttpErrors !== false,
7954
+ timeout: typeof options.timeout === 'undefined' ? 10000 : options.timeout
7955
+ };
7800
7956
 
7801
- if (!isValid) {
7802
- throw new TypeError(`Array must contain either Numbers (resource id) or "${Type.name}".`);
7803
- }
7957
+ if (typeof this._input !== 'string' && !(this._input instanceof URL || this._input instanceof globals.Request)) {
7958
+ throw new TypeError('`input` must be a string, URL, or Request');
7959
+ }
7804
7960
 
7805
- const url = `${this.parent.url}/${path}`;
7806
- return (0,_utils_helpers__WEBPACK_IMPORTED_MODULE_2__.makeCancelable)(async signal => {
7807
- await this.api.ky(url, {
7808
- method,
7809
- signal,
7810
- json: {
7811
- keys
7812
- }
7813
- });
7814
- });
7815
- }
7961
+ if (this._options.prefixUrl && typeof this._input === 'string') {
7962
+ if (this._input.startsWith('/')) {
7963
+ throw new Error('`input` must not begin with a slash when using `prefixUrl`');
7964
+ }
7816
7965
 
7817
- }
7966
+ if (!this._options.prefixUrl.endsWith('/')) {
7967
+ this._options.prefixUrl += '/';
7968
+ }
7818
7969
 
7819
- /***/ }),
7820
- /* 35 */
7821
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
7970
+ this._input = this._options.prefixUrl + this._input;
7971
+ }
7822
7972
 
7823
- "use strict";
7824
- // ESM COMPAT FLAG
7825
- __webpack_require__.r(__webpack_exports__);
7973
+ if (supportsAbortController) {
7974
+ this.abortController = new globals.AbortController();
7975
+ if (this._options.signal) {
7976
+ this._options.signal.addEventListener('abort', () => {
7977
+ this.abortController.abort();
7978
+ });
7979
+ }
7826
7980
 
7827
- // EXPORTS
7828
- __webpack_require__.d(__webpack_exports__, {
7829
- "AbstractClassError": () => (/* reexport */ AbstractError.AbstractClassError),
7830
- "AbstractError": () => (/* reexport */ AbstractError.AbstractError),
7831
- "AbstractMethodError": () => (/* reexport */ AbstractError.AbstractMethodError),
7832
- "ApiError": () => (/* reexport */ ApiError["default"]),
7833
- "GeoError": () => (/* reexport */ GeoError["default"]),
7834
- "NodeError": () => (/* reexport */ NodeError),
7835
- "OAuthError": () => (/* reexport */ OAuthError["default"]),
7836
- "StaticClassError": () => (/* reexport */ StaticClassError["default"]),
7837
- "ValidationError": () => (/* reexport */ ValidationError["default"])
7838
- });
7981
+ this._options.signal = this.abortController.signal;
7982
+ }
7839
7983
 
7840
- // EXTERNAL MODULE: ./src/errors/AbstractError.js
7841
- var AbstractError = __webpack_require__(21);
7842
- // EXTERNAL MODULE: ./src/errors/ApiError.js
7843
- var ApiError = __webpack_require__(66);
7844
- // EXTERNAL MODULE: ./src/errors/ValidationError.js
7845
- var ValidationError = __webpack_require__(78);
7846
- ;// CONCATENATED MODULE: ./src/errors/NodeError.js
7847
- /*
7848
- * BSD 3-Clause License
7849
- *
7850
- * Copyright (c) 2020, Mapcreator
7851
- * All rights reserved.
7852
- *
7853
- * Redistribution and use in source and binary forms, with or without
7854
- * modification, are permitted provided that the following conditions are met:
7855
- *
7856
- * Redistributions of source code must retain the above copyright notice, this
7857
- * list of conditions and the following disclaimer.
7858
- *
7859
- * Redistributions in binary form must reproduce the above copyright notice,
7860
- * this list of conditions and the following disclaimer in the documentation
7861
- * and/or other materials provided with the distribution.
7862
- *
7863
- * Neither the name of the copyright holder nor the names of its
7864
- * contributors may be used to endorse or promote products derived from
7865
- * this software without specific prior written permission.
7866
- *
7867
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
7868
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
7869
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7870
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
7871
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
7872
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7873
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
7874
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
7875
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7876
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7877
- */
7984
+ this.request = new globals.Request(this._input, this._options);
7878
7985
 
7879
- /**
7880
- * Invoked upon nodejs specific errors
7881
- */
7882
- class NodeError extends Error {}
7883
- // EXTERNAL MODULE: ./src/errors/OAuthError.js
7884
- var OAuthError = __webpack_require__(17);
7885
- // EXTERNAL MODULE: ./src/errors/StaticClassError.js
7886
- var StaticClassError = __webpack_require__(62);
7887
- // EXTERNAL MODULE: ./src/errors/GeoError.js
7888
- var GeoError = __webpack_require__(44);
7889
- ;// CONCATENATED MODULE: ./src/errors/index.js
7890
- /*
7891
- * BSD 3-Clause License
7892
- *
7893
- * Copyright (c) 2020, Mapcreator
7894
- * All rights reserved.
7895
- *
7896
- * Redistribution and use in source and binary forms, with or without
7897
- * modification, are permitted provided that the following conditions are met:
7898
- *
7899
- * Redistributions of source code must retain the above copyright notice, this
7900
- * list of conditions and the following disclaimer.
7901
- *
7902
- * Redistributions in binary form must reproduce the above copyright notice,
7903
- * this list of conditions and the following disclaimer in the documentation
7904
- * and/or other materials provided with the distribution.
7905
- *
7906
- * Neither the name of the copyright holder nor the names of its
7907
- * contributors may be used to endorse or promote products derived from
7908
- * this software without specific prior written permission.
7909
- *
7910
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
7911
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
7912
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7913
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
7914
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
7915
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7916
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
7917
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
7918
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7919
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7920
- */
7986
+ if (this._options.searchParams) {
7987
+ const url = new URL(this.request.url);
7988
+ url.search = new URLSearchParams(this._options.searchParams);
7921
7989
 
7990
+ // To provide correct form boundary, Content-Type header should be deleted each time when new Request instantiated from another one
7991
+ if (((supportsFormData && this._options.body instanceof globals.FormData) || this._options.body instanceof URLSearchParams) && !(this._options.headers && this._options.headers['content-type'])) {
7992
+ this.request.headers.delete('content-type');
7993
+ }
7922
7994
 
7995
+ this.request = new globals.Request(new globals.Request(url, this.request), this._options);
7996
+ }
7923
7997
 
7998
+ if (this._options.json !== undefined) {
7999
+ this._options.body = JSON.stringify(this._options.json);
8000
+ this.request.headers.set('content-type', 'application/json');
8001
+ this.request = new globals.Request(this.request, {body: this._options.body});
8002
+ }
7924
8003
 
8004
+ const fn = async () => {
8005
+ if (this._options.timeout > maxSafeTimeout) {
8006
+ throw new RangeError(`The \`timeout\` option cannot be greater than ${maxSafeTimeout}`);
8007
+ }
7925
8008
 
8009
+ await delay(1);
8010
+ let response = await this._fetch();
7926
8011
 
8012
+ for (const hook of this._options.hooks.afterResponse) {
8013
+ // eslint-disable-next-line no-await-in-loop
8014
+ const modifiedResponse = await hook(
8015
+ this.request,
8016
+ this._options,
8017
+ response.clone()
8018
+ );
7927
8019
 
8020
+ if (modifiedResponse instanceof globals.Response) {
8021
+ response = modifiedResponse;
8022
+ }
8023
+ }
7928
8024
 
7929
- /***/ }),
7930
- /* 36 */
7931
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8025
+ if (!response.ok && this._options.throwHttpErrors) {
8026
+ throw new HTTPError(response);
8027
+ }
7932
8028
 
7933
- "use strict";
7934
- // ESM COMPAT FLAG
7935
- __webpack_require__.r(__webpack_exports__);
8029
+ // If `onDownloadProgress` is passed, it uses the stream API internally
8030
+ /* istanbul ignore next */
8031
+ if (this._options.onDownloadProgress) {
8032
+ if (typeof this._options.onDownloadProgress !== 'function') {
8033
+ throw new TypeError('The `onDownloadProgress` option must be a function');
8034
+ }
7936
8035
 
7937
- // EXPORTS
7938
- __webpack_require__.d(__webpack_exports__, {
7939
- "default": () => (/* binding */ Message)
7940
- });
8036
+ if (!supportsStreams) {
8037
+ throw new Error('Streams are not supported in your environment. `ReadableStream` is missing.');
8038
+ }
7941
8039
 
7942
- // EXTERNAL MODULE: ./src/resources/base/CrudBase.js
7943
- var CrudBase = __webpack_require__(2);
7944
- // EXTERNAL MODULE: ./src/resources/base/ResourceBase.js
7945
- var ResourceBase = __webpack_require__(3);
7946
- ;// CONCATENATED MODULE: ./src/resources/MessageVariant.js
7947
- /*
7948
- * BSD 3-Clause License
7949
- *
7950
- * Copyright (c) 2020, Mapcreator
7951
- * All rights reserved.
7952
- *
7953
- * Redistribution and use in source and binary forms, with or without
7954
- * modification, are permitted provided that the following conditions are met:
7955
- *
7956
- * Redistributions of source code must retain the above copyright notice, this
7957
- * list of conditions and the following disclaimer.
7958
- *
7959
- * Redistributions in binary form must reproduce the above copyright notice,
7960
- * this list of conditions and the following disclaimer in the documentation
7961
- * and/or other materials provided with the distribution.
7962
- *
7963
- * Neither the name of the copyright holder nor the names of its
7964
- * contributors may be used to endorse or promote products derived from
7965
- * this software without specific prior written permission.
7966
- *
7967
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
7968
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
7969
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7970
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
7971
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
7972
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7973
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
7974
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
7975
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7976
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7977
- */
8040
+ return this._stream(response.clone(), this._options.onDownloadProgress);
8041
+ }
7978
8042
 
7979
- class MessageVariant extends ResourceBase["default"] {}
7980
- // EXTERNAL MODULE: ./src/utils/helpers.js
7981
- var helpers = __webpack_require__(1);
7982
- // EXTERNAL MODULE: ./node_modules/case/dist/Case.js
7983
- var Case = __webpack_require__(4);
7984
- ;// CONCATENATED MODULE: ./src/resources/Message.js
7985
- /*
7986
- * BSD 3-Clause License
7987
- *
7988
- * Copyright (c) 2020, Mapcreator
7989
- * All rights reserved.
7990
- *
7991
- * Redistribution and use in source and binary forms, with or without
7992
- * modification, are permitted provided that the following conditions are met:
7993
- *
7994
- * Redistributions of source code must retain the above copyright notice, this
7995
- * list of conditions and the following disclaimer.
7996
- *
7997
- * Redistributions in binary form must reproduce the above copyright notice,
7998
- * this list of conditions and the following disclaimer in the documentation
7999
- * and/or other materials provided with the distribution.
8000
- *
8001
- * Neither the name of the copyright holder nor the names of its
8002
- * contributors may be used to endorse or promote products derived from
8003
- * this software without specific prior written permission.
8004
- *
8005
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
8006
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
8007
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
8008
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
8009
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
8010
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
8011
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
8012
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
8013
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8014
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8015
- */
8043
+ return response;
8044
+ };
8016
8045
 
8046
+ const isRetriableMethod = this._options.retry.methods.includes(this.request.method.toLowerCase());
8047
+ const result = isRetriableMethod ? this._retry(fn) : fn();
8017
8048
 
8049
+ for (const [type, mimeType] of Object.entries(responseTypes)) {
8050
+ result[type] = async () => {
8051
+ this.request.headers.set('accept', this.request.headers.get('accept') || mimeType);
8052
+ const response = (await result).clone();
8053
+ return (type === 'json' && response.status === 204) ? '' : response[type]();
8054
+ };
8055
+ }
8018
8056
 
8057
+ return result;
8058
+ }
8019
8059
 
8020
- class Message extends CrudBase["default"] {
8021
- static get resourceName() {
8022
- return 'messages';
8023
- }
8060
+ _calculateRetryDelay(error) {
8061
+ this._retryCount++;
8024
8062
 
8025
- toObject(camelCaseKeys = false) {
8026
- const superObject = super.toObject(camelCaseKeys);
8027
- superObject.variants = superObject.variants.map(variant => {
8028
- if (variant instanceof MessageVariant) {
8029
- return variant.toObject(camelCaseKeys);
8030
- }
8063
+ if (this._retryCount < this._options.retry.limit && !(error instanceof TimeoutError)) {
8064
+ if (error instanceof HTTPError) {
8065
+ if (!this._options.retry.statusCodes.includes(error.response.status)) {
8066
+ return 0;
8067
+ }
8031
8068
 
8032
- const caseFn = camelCaseKeys ? Case.camel : Case.snake;
8033
- const res = {};
8034
- const fields = Object.keys(variant);
8069
+ const retryAfter = error.response.headers.get('Retry-After');
8070
+ if (retryAfter && this._options.retry.afterStatusCodes.includes(error.response.status)) {
8071
+ let after = Number(retryAfter);
8072
+ if (Number.isNaN(after)) {
8073
+ after = Date.parse(retryAfter) - Date.now();
8074
+ } else {
8075
+ after *= 1000;
8076
+ }
8035
8077
 
8036
- for (const field of fields) {
8037
- res[caseFn(field)] = variant[field];
8038
- }
8078
+ if (typeof this._options.retry.maxRetryAfter !== 'undefined' && after > this._options.retry.maxRetryAfter) {
8079
+ return 0;
8080
+ }
8039
8081
 
8040
- return res;
8041
- });
8042
- return superObject;
8043
- }
8082
+ return after;
8083
+ }
8044
8084
 
8045
- _guessType(name, value) {
8046
- if (name === 'variants') {
8047
- return Array.from(value).map(data => new MessageVariant(this.api, data));
8048
- }
8085
+ if (error.response.status === 413) {
8086
+ return 0;
8087
+ }
8088
+ }
8049
8089
 
8050
- return super._guessType(name, value);
8051
- }
8090
+ const BACKOFF_FACTOR = 0.3;
8091
+ return BACKOFF_FACTOR * (2 ** (this._retryCount - 1)) * 1000;
8092
+ }
8052
8093
 
8053
- _buildCreateData() {
8054
- return this.toObject();
8055
- }
8094
+ return 0;
8095
+ }
8056
8096
 
8057
- _update() {
8058
- return (0,helpers.makeCancelable)(async signal => {
8059
- const json = this.toObject();
8060
- await this.api.ky.patch(this.url, {
8061
- json,
8062
- signal
8063
- }); // Reset changes
8097
+ async _retry(fn) {
8098
+ try {
8099
+ return await fn();
8100
+ } catch (error) {
8101
+ const ms = Math.min(this._calculateRetryDelay(error), maxSafeTimeout);
8102
+ if (ms !== 0 && this._retryCount > 0) {
8103
+ await delay(ms);
8104
+
8105
+ for (const hook of this._options.hooks.beforeRetry) {
8106
+ // eslint-disable-next-line no-await-in-loop
8107
+ const hookResult = await hook({
8108
+ request: this.request,
8109
+ options: this._options,
8110
+ error,
8111
+ response: error.response.clone(),
8112
+ retryCount: this._retryCount
8113
+ });
8114
+
8115
+ // If `stop` is returned from the hook, the retry process is stopped
8116
+ if (hookResult === stop) {
8117
+ return;
8118
+ }
8119
+ }
8120
+
8121
+ return this._retry(fn);
8122
+ }
8123
+
8124
+ if (this._options.throwHttpErrors) {
8125
+ throw error;
8126
+ }
8127
+ }
8128
+ }
8129
+
8130
+ async _fetch() {
8131
+ for (const hook of this._options.hooks.beforeRequest) {
8132
+ // eslint-disable-next-line no-await-in-loop
8133
+ const result = await hook(this.request, this._options);
8134
+
8135
+ if (result instanceof Request) {
8136
+ this.request = result;
8137
+ break;
8138
+ }
8139
+
8140
+ if (result instanceof Response) {
8141
+ return result;
8142
+ }
8143
+ }
8144
+
8145
+ if (this._options.timeout === false) {
8146
+ return globals.fetch(this.request.clone());
8147
+ }
8064
8148
 
8065
- Object.assign(this._baseProperties, this._properties);
8066
- this._properties = {};
8149
+ return timeout(this.request.clone(), this._options.timeout, this.abortController);
8150
+ }
8067
8151
 
8068
- if ('updated_at' in this._baseProperties) {
8069
- this._baseProperties['updated_at'] = new Date();
8070
- }
8152
+ /* istanbul ignore next */
8153
+ _stream(response, onDownloadProgress) {
8154
+ const totalBytes = Number(response.headers.get('content-length')) || 0;
8155
+ let transferredBytes = 0;
8071
8156
 
8072
- return this;
8073
- });
8074
- }
8157
+ return new globals.Response(
8158
+ new globals.ReadableStream({
8159
+ start(controller) {
8160
+ const reader = response.body.getReader();
8075
8161
 
8076
- }
8162
+ if (onDownloadProgress) {
8163
+ onDownloadProgress({percent: 0, transferredBytes: 0, totalBytes}, new Uint8Array());
8164
+ }
8077
8165
 
8078
- /***/ }),
8079
- /* 37 */
8080
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8166
+ async function read() {
8167
+ const {done, value} = await reader.read();
8168
+ if (done) {
8169
+ controller.close();
8170
+ return;
8171
+ }
8081
8172
 
8082
- "use strict";
8083
- // ESM COMPAT FLAG
8084
- __webpack_require__.r(__webpack_exports__);
8173
+ if (onDownloadProgress) {
8174
+ transferredBytes += value.byteLength;
8175
+ const percent = totalBytes === 0 ? 0 : transferredBytes / totalBytes;
8176
+ onDownloadProgress({percent, transferredBytes, totalBytes}, value);
8177
+ }
8085
8178
 
8086
- // EXPORTS
8087
- __webpack_require__.d(__webpack_exports__, {
8088
- "Choropleth": () => (/* reexport */ Choropleth),
8089
- "Color": () => (/* reexport */ Color["default"]),
8090
- "Contract": () => (/* reexport */ Contract["default"]),
8091
- "Dimension": () => (/* reexport */ Dimension["default"]),
8092
- "DimensionSet": () => (/* reexport */ DimensionSet["default"]),
8093
- "Domain": () => (/* reexport */ Domain["default"]),
8094
- "Faq": () => (/* reexport */ Faq),
8095
- "Feature": () => (/* reexport */ Feature["default"]),
8096
- "Font": () => (/* reexport */ Font["default"]),
8097
- "FontFamily": () => (/* reexport */ FontFamily["default"]),
8098
- "Highlight": () => (/* reexport */ Highlight),
8099
- "InsetMap": () => (/* reexport */ InsetMap),
8100
- "Job": () => (/* reexport */ Job["default"]),
8101
- "JobResult": () => (/* reexport */ JobResult["default"]),
8102
- "JobRevision": () => (/* reexport */ JobRevision["default"]),
8103
- "JobShare": () => (/* reexport */ JobShare["default"]),
8104
- "JobType": () => (/* reexport */ JobType["default"]),
8105
- "Language": () => (/* reexport */ Language["default"]),
8106
- "Layer": () => (/* reexport */ Layer["default"]),
8107
- "LayerFaq": () => (/* reexport */ LayerFaq),
8108
- "LayerGroup": () => (/* reexport */ LayerGroup["default"]),
8109
- "Mapstyle": () => (/* reexport */ Mapstyle["default"]),
8110
- "MapstyleSet": () => (/* reexport */ MapstyleSet["default"]),
8111
- "Message": () => (/* reexport */ Message["default"]),
8112
- "Notification": () => (/* reexport */ Notification["default"]),
8113
- "Organisation": () => (/* reexport */ Organisation["default"]),
8114
- "Permission": () => (/* reexport */ Permission["default"]),
8115
- "ProductTour": () => (/* reexport */ ProductTour),
8116
- "ProductTourStep": () => (/* reexport */ ProductTourStep),
8117
- "Role": () => (/* reexport */ Role["default"]),
8118
- "Svg": () => (/* reexport */ Svg["default"]),
8119
- "SvgSet": () => (/* reexport */ SvgSet["default"]),
8120
- "Tag": () => (/* reexport */ Tag["default"]),
8121
- "TagType": () => (/* reexport */ TagType),
8122
- "User": () => (/* reexport */ User["default"]),
8123
- "VectorChoropleth": () => (/* reexport */ VectorChoropleth),
8124
- "VectorHighlight": () => (/* reexport */ VectorHighlight),
8125
- "base": () => (/* binding */ base)
8126
- });
8179
+ controller.enqueue(value);
8180
+ read();
8181
+ }
8127
8182
 
8128
- // EXTERNAL MODULE: ./src/resources/base/DownloadedResource.js + 1 modules
8129
- var DownloadedResource = __webpack_require__(25);
8130
- // EXTERNAL MODULE: ./src/resources/base/ResourceBase.js
8131
- var ResourceBase = __webpack_require__(3);
8132
- // EXTERNAL MODULE: ./src/utils/helpers.js
8133
- var helpers = __webpack_require__(1);
8134
- ;// CONCATENATED MODULE: ./src/resources/Choropleth.js
8135
- /*
8136
- * BSD 3-Clause License
8137
- *
8138
- * Copyright (c) 2020, Mapcreator
8139
- * All rights reserved.
8140
- *
8141
- * Redistribution and use in source and binary forms, with or without
8142
- * modification, are permitted provided that the following conditions are met:
8143
- *
8144
- * Redistributions of source code must retain the above copyright notice, this
8145
- * list of conditions and the following disclaimer.
8146
- *
8147
- * Redistributions in binary form must reproduce the above copyright notice,
8148
- * this list of conditions and the following disclaimer in the documentation
8149
- * and/or other materials provided with the distribution.
8150
- *
8151
- * Neither the name of the copyright holder nor the names of its
8152
- * contributors may be used to endorse or promote products derived from
8153
- * this software without specific prior written permission.
8154
- *
8155
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
8156
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
8157
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
8158
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
8159
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
8160
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
8161
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
8162
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
8163
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8164
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8165
- */
8183
+ read();
8184
+ }
8185
+ })
8186
+ );
8187
+ }
8188
+ }
8166
8189
 
8190
+ const validateAndMerge = (...sources) => {
8191
+ for (const source of sources) {
8192
+ if ((!isObject(source) || Array.isArray(source)) && typeof source !== 'undefined') {
8193
+ throw new TypeError('The `options` argument must be an object');
8194
+ }
8195
+ }
8167
8196
 
8197
+ return deepMerge({}, ...sources);
8198
+ };
8168
8199
 
8169
- /**
8170
- * Choropleth resource
8171
- */
8200
+ const createInstance = defaults => {
8201
+ const ky = (input, options) => new Ky(input, validateAndMerge(defaults, options));
8172
8202
 
8173
- class Choropleth extends ResourceBase["default"] {
8174
- static get resourceName() {
8175
- return 'choropleths';
8176
- }
8177
- /**
8178
- * Get the inset map json
8179
- * @returns {CancelablePromise<Object>} - Choropleth json
8180
- * @throws {ApiError} - If the api returns errors
8181
- */
8203
+ for (const method of requestMethods) {
8204
+ ky[method] = (input, options) => new Ky(input, validateAndMerge(defaults, options, {method}));
8205
+ }
8182
8206
 
8207
+ ky.HTTPError = HTTPError;
8208
+ ky.TimeoutError = TimeoutError;
8209
+ ky.create = newDefaults => createInstance(validateAndMerge(newDefaults));
8210
+ ky.extend = newDefaults => createInstance(validateAndMerge(defaults, newDefaults));
8211
+ ky.stop = stop;
8183
8212
 
8184
- getJson() {
8185
- return (0,helpers.makeCancelable)(signal => this.api.ky.get(`${this.url}/json`, {
8186
- signal
8187
- }).json());
8188
- }
8189
- /**
8190
- * Download the choropleth preview
8191
- * @returns {CancelablePromise<DownloadedResource>} - Choropleth preview
8192
- * @throws {ApiError} - If the api returns errors
8193
- */
8213
+ return ky;
8214
+ };
8194
8215
 
8216
+ /* harmony default export */ const ky = (createInstance());
8195
8217
 
8196
- downloadPreview() {
8197
- return (0,helpers.makeCancelable)(async signal => {
8198
- const response = await this.api.ky.get(`${this.url}/preview`, {
8199
- signal
8200
- });
8201
- return DownloadedResource["default"].fromResponse(response);
8202
- });
8203
- }
8218
+ ;// CONCATENATED MODULE: ./node_modules/ky-universal/browser.js
8204
8219
 
8205
- }
8206
- // EXTERNAL MODULE: ./src/resources/Color.js
8207
- var Color = __webpack_require__(46);
8208
- // EXTERNAL MODULE: ./src/resources/Contract.js
8209
- var Contract = __webpack_require__(67);
8210
- // EXTERNAL MODULE: ./src/resources/Dimension.js
8211
- var Dimension = __webpack_require__(48);
8212
- // EXTERNAL MODULE: ./src/resources/DimensionSet.js
8213
- var DimensionSet = __webpack_require__(47);
8214
- // EXTERNAL MODULE: ./src/resources/Domain.js
8215
- var Domain = __webpack_require__(68);
8216
- // EXTERNAL MODULE: ./src/resources/base/CrudBase.js
8217
- var CrudBase = __webpack_require__(2);
8218
- ;// CONCATENATED MODULE: ./src/resources/Faq.js
8219
- /*
8220
- * BSD 3-Clause License
8221
- *
8222
- * Copyright (c) 2020, Mapcreator
8223
- * All rights reserved.
8224
- *
8225
- * Redistribution and use in source and binary forms, with or without
8226
- * modification, are permitted provided that the following conditions are met:
8227
- *
8228
- * Redistributions of source code must retain the above copyright notice, this
8229
- * list of conditions and the following disclaimer.
8230
- *
8231
- * Redistributions in binary form must reproduce the above copyright notice,
8232
- * this list of conditions and the following disclaimer in the documentation
8233
- * and/or other materials provided with the distribution.
8234
- *
8235
- * Neither the name of the copyright holder nor the names of its
8236
- * contributors may be used to endorse or promote products derived from
8237
- * this software without specific prior written permission.
8238
- *
8239
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
8240
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
8241
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
8242
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
8243
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
8244
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
8245
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
8246
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
8247
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8248
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8249
- */
8250
8220
 
8251
- /**
8252
- * Faq resource
8253
- */
8254
8221
 
8255
- class Faq extends CrudBase["default"] {
8256
- static get resourceName() {
8257
- return 'faqs';
8258
- }
8222
+ /***/ }),
8223
+ /* 32 */
8224
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8259
8225
 
8260
- }
8261
- // EXTERNAL MODULE: ./src/resources/Feature.js
8262
- var Feature = __webpack_require__(49);
8263
- // EXTERNAL MODULE: ./src/resources/Font.js
8264
- var Font = __webpack_require__(51);
8265
- // EXTERNAL MODULE: ./src/resources/FontFamily.js
8266
- var FontFamily = __webpack_require__(50);
8267
- ;// CONCATENATED MODULE: ./src/resources/Highlight.js
8226
+ "use strict";
8227
+ __webpack_require__.r(__webpack_exports__);
8228
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8229
+ /* harmony export */ "default": () => (/* binding */ Trait)
8230
+ /* harmony export */ });
8268
8231
  /*
8269
8232
  * BSD 3-Clause License
8270
8233
  *
@@ -8297,13 +8260,31 @@ var FontFamily = __webpack_require__(50);
8297
8260
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8298
8261
  */
8299
8262
 
8300
- class Highlight extends ResourceBase["default"] {
8301
- static get resourceName() {
8302
- return 'highlights';
8303
- }
8263
+ /**
8264
+ * Trait interface
8265
+ * @interface
8266
+ * @mixin
8267
+ */
8268
+ class Trait {
8269
+ /**
8270
+ * Optional initialization method
8271
+ */
8272
+ initializer() {}
8304
8273
 
8305
8274
  }
8306
- ;// CONCATENATED MODULE: ./src/resources/InsetMap.js
8275
+
8276
+ /***/ }),
8277
+ /* 33 */
8278
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8279
+
8280
+ "use strict";
8281
+ __webpack_require__.r(__webpack_exports__);
8282
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8283
+ /* harmony export */ "fnv32b": () => (/* binding */ fnv32b),
8284
+ /* harmony export */ "hashObject": () => (/* binding */ hashObject)
8285
+ /* harmony export */ });
8286
+ /* harmony import */ var json_stable_stringify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(38);
8287
+ /* harmony import */ var json_stable_stringify__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(json_stable_stringify__WEBPACK_IMPORTED_MODULE_0__);
8307
8288
  /*
8308
8289
  * BSD 3-Clause License
8309
8290
  *
@@ -8336,46 +8317,53 @@ class Highlight extends ResourceBase["default"] {
8336
8317
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8337
8318
  */
8338
8319
 
8320
+ const FNV1_32A_INIT = 0x811c9dc5;
8321
+ /**
8322
+ * Fast hash function for non-cryptographic use
8323
+ * @param {string} str - Input to be hashed
8324
+ * @returns {string} - String representation of the hash
8325
+ * @private
8326
+ */
8339
8327
 
8340
- class InsetMap extends ResourceBase["default"] {
8341
- static get resourceName() {
8342
- return 'inset-maps';
8343
- }
8344
- /**
8345
- * Get the inset map json
8346
- * @returns {CancelablePromise<Object>} - Inset map json
8347
- * @throws {ApiError} - If the api returns errors
8348
- */
8349
-
8328
+ function fnv32b(str) {
8329
+ let hash = str.split('').map(x => x.charCodeAt(0)).reduce((sum, val) => {
8330
+ sum ^= val;
8331
+ return sum + (sum << 1) + (sum << 4) + (sum << 7) + (sum << 8) + (sum << 24);
8332
+ }, FNV1_32A_INIT); // Avalanche
8350
8333
 
8351
- getJson() {
8352
- return (0,helpers.makeCancelable)(signal => this.api.ky.get(`${this.url}/json`, {
8353
- signal
8354
- }).json());
8355
- }
8334
+ hash ^= hash << 3;
8335
+ hash += hash >> 5;
8336
+ hash ^= hash << 4;
8337
+ hash += hash >> 17;
8338
+ hash ^= hash << 25;
8339
+ hash += hash >> 6;
8340
+ return `0000000${(hash >>> 0).toString(16)}`.substr(-8);
8341
+ }
8342
+ /**
8343
+ * Fast object hashing for non-cryptographic use
8344
+ * @param {object} data - input data
8345
+ * @returns {string} - String reprisentation of the hash
8346
+ * @private
8347
+ */
8356
8348
 
8349
+ function hashObject(data) {
8350
+ return fnv32b(json_stable_stringify__WEBPACK_IMPORTED_MODULE_0___default()(data));
8357
8351
  }
8358
- // EXTERNAL MODULE: ./src/resources/Job.js
8359
- var Job = __webpack_require__(52);
8360
- // EXTERNAL MODULE: ./src/resources/JobResult.js
8361
- var JobResult = __webpack_require__(53);
8362
- // EXTERNAL MODULE: ./src/resources/JobRevision.js
8363
- var JobRevision = __webpack_require__(69);
8364
- // EXTERNAL MODULE: ./src/resources/JobShare.js
8365
- var JobShare = __webpack_require__(26);
8366
- // EXTERNAL MODULE: ./src/resources/JobType.js
8367
- var JobType = __webpack_require__(55);
8368
- // EXTERNAL MODULE: ./src/resources/Language.js
8369
- var Language = __webpack_require__(71);
8370
- // EXTERNAL MODULE: ./src/resources/Layer.js
8371
- var Layer = __webpack_require__(27);
8372
- // EXTERNAL MODULE: ./src/resources/base/CrudSetItemBase.js
8373
- var CrudSetItemBase = __webpack_require__(10);
8374
- ;// CONCATENATED MODULE: ./src/resources/LayerFaq.js
8352
+
8353
+ /***/ }),
8354
+ /* 34 */
8355
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8356
+
8357
+ "use strict";
8358
+ __webpack_require__.r(__webpack_exports__);
8359
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8360
+ /* harmony export */ "default": () => (/* binding */ StaticClass)
8361
+ /* harmony export */ });
8362
+ /* harmony import */ var _errors_StaticClassError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(62);
8375
8363
  /*
8376
8364
  * BSD 3-Clause License
8377
8365
  *
8378
- * Copyright (c) 2022, Mapcreator
8366
+ * Copyright (c) 2020, Mapcreator
8379
8367
  * All rights reserved.
8380
8368
  *
8381
8369
  * Redistribution and use in source and binary forms, with or without
@@ -8405,39 +8393,29 @@ var CrudSetItemBase = __webpack_require__(10);
8405
8393
  */
8406
8394
 
8407
8395
  /**
8408
- * LayerFaq
8409
- * @extends CrudSetItemBase
8396
+ * Disables the constructor and throws a {@link StaticClassError} when an instance is created.
8397
+ * @protected
8410
8398
  */
8411
8399
 
8412
- class LayerFaq extends CrudSetItemBase["default"] {
8413
- static get resourceName() {
8414
- return 'layer-faqs';
8415
- }
8416
-
8417
- static get parentKey() {
8418
- return 'layer_group_id';
8400
+ class StaticClass {
8401
+ constructor() {
8402
+ throw new _errors_StaticClassError__WEBPACK_IMPORTED_MODULE_0__["default"]();
8419
8403
  }
8420
8404
 
8421
8405
  }
8422
- // EXTERNAL MODULE: ./src/resources/LayerGroup.js
8423
- var LayerGroup = __webpack_require__(74);
8424
- // EXTERNAL MODULE: ./src/resources/Mapstyle.js
8425
- var Mapstyle = __webpack_require__(70);
8426
- // EXTERNAL MODULE: ./src/resources/MapstyleSet.js + 1 modules
8427
- var MapstyleSet = __webpack_require__(28);
8428
- // EXTERNAL MODULE: ./src/resources/Message.js + 1 modules
8429
- var Message = __webpack_require__(36);
8430
- // EXTERNAL MODULE: ./src/resources/Notification.js
8431
- var Notification = __webpack_require__(72);
8432
- // EXTERNAL MODULE: ./src/resources/Organisation.js
8433
- var Organisation = __webpack_require__(45);
8434
- // EXTERNAL MODULE: ./src/resources/Permission.js
8435
- var Permission = __webpack_require__(59);
8436
- // EXTERNAL MODULE: ./src/utils/reflection.js
8437
- var reflection = __webpack_require__(0);
8438
- // EXTERNAL MODULE: ./src/resources/base/CrudSetBase.js
8439
- var CrudSetBase = __webpack_require__(15);
8440
- ;// CONCATENATED MODULE: ./src/resources/ProductTourStep.js
8406
+
8407
+ /***/ }),
8408
+ /* 35 */
8409
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8410
+
8411
+ "use strict";
8412
+ __webpack_require__.r(__webpack_exports__);
8413
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8414
+ /* harmony export */ "default": () => (/* binding */ OrganisationProxy)
8415
+ /* harmony export */ });
8416
+ /* harmony import */ var _utils_reflection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
8417
+ /* harmony import */ var _SimpleResourceProxy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15);
8418
+ /* harmony import */ var _utils_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1);
8441
8419
  /*
8442
8420
  * BSD 3-Clause License
8443
8421
  *
@@ -8471,21 +8449,166 @@ var CrudSetBase = __webpack_require__(15);
8471
8449
  */
8472
8450
 
8473
8451
 
8474
- /**
8475
- * @extends CrudSetItemBase
8476
- */
8477
8452
 
8478
- class ProductTourStep extends (0,reflection.mix)(CrudSetItemBase["default"]) {
8479
- static get resourceName() {
8480
- return 'product-tours/steps';
8481
- }
8453
+ class OrganisationProxy extends _SimpleResourceProxy__WEBPACK_IMPORTED_MODULE_1__["default"] {
8454
+ /**
8455
+ * @param {Mapcreator} api - Instance of the api
8456
+ * @param {ResourceBase} parent - Parent instance
8457
+ */
8458
+ constructor(api, parent) {
8459
+ // Fixes dependency issue
8460
+ const Organisation = (__webpack_require__(45)["default"]);
8461
+
8462
+ super(api, Organisation, `${parent.url}/organisations`, {});
8463
+ this._parent = parent;
8464
+ }
8465
+ /**
8466
+ * Returns parent instance
8467
+ * @returns {ResourceBase} - Parent instance
8468
+ */
8469
+
8470
+
8471
+ get parent() {
8472
+ return this._parent;
8473
+ }
8474
+ /**
8475
+ * Sync organisations to the parent resource
8476
+ * The organisations attached to the target resource will be replaced with the organisations provided in the request.
8477
+ * @param {Array<Organisation|number>} organisations - List of items to sync
8478
+ * @throws {ApiError} - If the api returns errors
8479
+ * @returns {CancelablePromise}
8480
+ */
8481
+
8482
+
8483
+ sync(organisations) {
8484
+ return this._modifyLink(organisations, 'PATCH', this.Target);
8485
+ }
8486
+ /**
8487
+ * Attach organisations to the parent resource
8488
+ * The provided organisations will be attached to the resource if they're not already attached
8489
+ * @param {Array<Organisation|number>} organisations - List of items to attach
8490
+ * @throws {ApiError} - If the api returns errors
8491
+ * @returns {CancelablePromise}
8492
+ */
8493
+
8494
+
8495
+ attach(organisations) {
8496
+ return this._modifyLink(organisations, 'POST', this.Target);
8497
+ }
8498
+ /**
8499
+ * Detach organisations from the parent resource
8500
+ * The provided organisations will be detached from the resource
8501
+ * @param {Array<Organisation|number>} organisations - List of items to detach
8502
+ * @throws {ApiError} - If the api returns errors
8503
+ * @returns {CancelablePromise}
8504
+ */
8505
+
8506
+
8507
+ detach(organisations) {
8508
+ return this._modifyLink(organisations, 'DELETE', this.Target);
8509
+ }
8510
+ /**
8511
+ * Attach all organisations to the parent resource
8512
+ * @throws {ApiError} - If the api returns errors
8513
+ * @returns {CancelablePromise}
8514
+ */
8515
+
8516
+
8517
+ attachAll() {
8518
+ return (0,_utils_helpers__WEBPACK_IMPORTED_MODULE_2__.makeCancelable)(async signal => {
8519
+ await this.api.ky.post(`${this.baseUrl}/all`, {
8520
+ signal
8521
+ });
8522
+ });
8523
+ }
8524
+ /**
8525
+ * Detach all organisations from the parent resource
8526
+ * @throws {ApiError} - If the api returns errors
8527
+ * @returns {CancelablePromise}
8528
+ */
8529
+
8530
+
8531
+ detachAll() {
8532
+ return (0,_utils_helpers__WEBPACK_IMPORTED_MODULE_2__.makeCancelable)(async signal => {
8533
+ await this.api.ky.delete(`${this.baseUrl}/all`, {
8534
+ signal
8535
+ });
8536
+ });
8537
+ }
8538
+ /**
8539
+ * Sync, attach or unlink resources
8540
+ * @param {Array<Organisation|Number>|Organisation|Number} items - List of items to sync or attach
8541
+ * @param {String} method - Http method to use
8542
+ * @param {Class<ResourceBase>} Type - Resource type
8543
+ * @param {?String} path - Optional appended resource path, will guess if null
8544
+ * @throws {ApiError} - If the api returns errors
8545
+ * @protected
8546
+ * @returns {CancelablePromise}
8547
+ */
8548
+
8549
+
8550
+ _modifyLink(items, method, Type, path = null) {
8551
+ if (!Array.isArray(items)) {
8552
+ items = [items];
8553
+ }
8554
+
8555
+ if (!path) {
8556
+ const resource = Type.resourceName.replace(/s+$/, '');
8557
+ path = `${resource}s`;
8558
+ }
8559
+
8560
+ const keys = items.map(x => typeof x === 'number' ? x : x.id).map(Number);
8561
+
8562
+ const filter = x => !(0,_utils_reflection__WEBPACK_IMPORTED_MODULE_0__.isParentOf)(Type, x) && !Number.isFinite(x);
8563
+
8564
+ const isValid = keys.filter(filter).length === 0;
8565
+
8566
+ if (!isValid) {
8567
+ throw new TypeError(`Array must contain either Numbers (resource id) or "${Type.name}".`);
8568
+ }
8569
+
8570
+ const url = `${this.parent.url}/${path}`;
8571
+ return (0,_utils_helpers__WEBPACK_IMPORTED_MODULE_2__.makeCancelable)(async signal => {
8572
+ await this.api.ky(url, {
8573
+ method,
8574
+ signal,
8575
+ json: {
8576
+ keys
8577
+ }
8578
+ });
8579
+ });
8580
+ }
8581
+
8582
+ }
8583
+
8584
+ /***/ }),
8585
+ /* 36 */
8586
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8587
+
8588
+ "use strict";
8589
+ // ESM COMPAT FLAG
8590
+ __webpack_require__.r(__webpack_exports__);
8482
8591
 
8483
- static get parentKey() {
8484
- return 'product_tour_id';
8485
- }
8592
+ // EXPORTS
8593
+ __webpack_require__.d(__webpack_exports__, {
8594
+ "AbstractClassError": () => (/* reexport */ AbstractError.AbstractClassError),
8595
+ "AbstractError": () => (/* reexport */ AbstractError.AbstractError),
8596
+ "AbstractMethodError": () => (/* reexport */ AbstractError.AbstractMethodError),
8597
+ "ApiError": () => (/* reexport */ ApiError["default"]),
8598
+ "GeoError": () => (/* reexport */ GeoError["default"]),
8599
+ "NodeError": () => (/* reexport */ NodeError),
8600
+ "OAuthError": () => (/* reexport */ OAuthError["default"]),
8601
+ "StaticClassError": () => (/* reexport */ StaticClassError["default"]),
8602
+ "ValidationError": () => (/* reexport */ ValidationError["default"])
8603
+ });
8486
8604
 
8487
- }
8488
- ;// CONCATENATED MODULE: ./src/resources/ProductTour.js
8605
+ // EXTERNAL MODULE: ./src/errors/AbstractError.js
8606
+ var AbstractError = __webpack_require__(21);
8607
+ // EXTERNAL MODULE: ./src/errors/ApiError.js
8608
+ var ApiError = __webpack_require__(66);
8609
+ // EXTERNAL MODULE: ./src/errors/ValidationError.js
8610
+ var ValidationError = __webpack_require__(78);
8611
+ ;// CONCATENATED MODULE: ./src/errors/NodeError.js
8489
8612
  /*
8490
8613
  * BSD 3-Clause License
8491
8614
  *
@@ -8518,36 +8641,17 @@ class ProductTourStep extends (0,reflection.mix)(CrudSetItemBase["default"]) {
8518
8641
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8519
8642
  */
8520
8643
 
8521
-
8522
-
8523
8644
  /**
8524
- * Mapstyle set
8525
- * @extends CrudSetBase
8645
+ * Invoked upon nodejs specific errors
8526
8646
  */
8527
-
8528
- class ProductTour extends (0,reflection.mix)(CrudSetBase["default"]) {
8529
- static get resourcePath() {
8530
- return '/product-tours/{id}';
8531
- }
8532
-
8533
- static get resourceName() {
8534
- return 'product-tours';
8535
- }
8536
-
8537
- get _Child() {
8538
- return ProductTourStep;
8539
- }
8540
-
8541
- }
8542
- // EXTERNAL MODULE: ./src/resources/Role.js
8543
- var Role = __webpack_require__(73);
8544
- // EXTERNAL MODULE: ./src/resources/Svg.js
8545
- var Svg = __webpack_require__(57);
8546
- // EXTERNAL MODULE: ./src/resources/SvgSet.js
8547
- var SvgSet = __webpack_require__(56);
8548
- // EXTERNAL MODULE: ./src/resources/Tag.js
8549
- var Tag = __webpack_require__(29);
8550
- ;// CONCATENATED MODULE: ./src/resources/TagType.js
8647
+ class NodeError extends Error {}
8648
+ // EXTERNAL MODULE: ./src/errors/OAuthError.js
8649
+ var OAuthError = __webpack_require__(18);
8650
+ // EXTERNAL MODULE: ./src/errors/StaticClassError.js
8651
+ var StaticClassError = __webpack_require__(62);
8652
+ // EXTERNAL MODULE: ./src/errors/GeoError.js
8653
+ var GeoError = __webpack_require__(44);
8654
+ ;// CONCATENATED MODULE: ./src/errors/index.js
8551
8655
  /*
8552
8656
  * BSD 3-Clause License
8553
8657
  *
@@ -8581,72 +8685,30 @@ var Tag = __webpack_require__(29);
8581
8685
  */
8582
8686
 
8583
8687
 
8584
- /**
8585
- * TagType resource
8586
- * @mixes CrudSetBase
8587
- */
8588
8688
 
8589
- class TagType extends CrudBase["default"] {
8590
- static get resourcePath() {
8591
- return '/tags/types/{id}';
8592
- }
8593
8689
 
8594
- static get resourceName() {
8595
- return 'tag-types';
8596
- }
8597
- /**
8598
- * Get the list of tags that are attached to this type
8599
- * @returns {SimpleResourceProxy} - A proxy for accessing the resource
8600
- */
8601
8690
 
8602
8691
 
8603
- get tags() {
8604
- return this._proxyResourceList(Tag["default"], `${this.url}/tags`);
8605
- }
8606
8692
 
8607
- }
8608
- // EXTERNAL MODULE: ./src/resources/User.js
8609
- var User = __webpack_require__(58);
8610
- ;// CONCATENATED MODULE: ./src/resources/VectorHighlight.js
8611
- /*
8612
- * BSD 3-Clause License
8613
- *
8614
- * Copyright (c) 2020, Mapcreator
8615
- * All rights reserved.
8616
- *
8617
- * Redistribution and use in source and binary forms, with or without
8618
- * modification, are permitted provided that the following conditions are met:
8619
- *
8620
- * Redistributions of source code must retain the above copyright notice, this
8621
- * list of conditions and the following disclaimer.
8622
- *
8623
- * Redistributions in binary form must reproduce the above copyright notice,
8624
- * this list of conditions and the following disclaimer in the documentation
8625
- * and/or other materials provided with the distribution.
8626
- *
8627
- * Neither the name of the copyright holder nor the names of its
8628
- * contributors may be used to endorse or promote products derived from
8629
- * this software without specific prior written permission.
8630
- *
8631
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
8632
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
8633
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
8634
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
8635
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
8636
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
8637
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
8638
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
8639
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8640
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8641
- */
8642
8693
 
8643
- class VectorHighlight extends ResourceBase["default"] {
8644
- static get resourceName() {
8645
- return 'highlights/vector';
8646
- }
8694
+ /***/ }),
8695
+ /* 37 */
8696
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8647
8697
 
8648
- }
8649
- ;// CONCATENATED MODULE: ./src/resources/VectorChoropleth.js
8698
+ "use strict";
8699
+ // ESM COMPAT FLAG
8700
+ __webpack_require__.r(__webpack_exports__);
8701
+
8702
+ // EXPORTS
8703
+ __webpack_require__.d(__webpack_exports__, {
8704
+ "default": () => (/* binding */ Message)
8705
+ });
8706
+
8707
+ // EXTERNAL MODULE: ./src/resources/base/CrudBase.js
8708
+ var CrudBase = __webpack_require__(2);
8709
+ // EXTERNAL MODULE: ./src/resources/base/ResourceBase.js
8710
+ var ResourceBase = __webpack_require__(3);
8711
+ ;// CONCATENATED MODULE: ./src/resources/MessageVariant.js
8650
8712
  /*
8651
8713
  * BSD 3-Clause License
8652
8714
  *
@@ -8679,13 +8741,12 @@ class VectorHighlight extends ResourceBase["default"] {
8679
8741
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8680
8742
  */
8681
8743
 
8682
- class VectorChoropleth extends ResourceBase["default"] {
8683
- static get resourceName() {
8684
- return 'choropleths/vector';
8685
- }
8686
-
8687
- }
8688
- ;// CONCATENATED MODULE: ./src/resources/index.js
8744
+ class MessageVariant extends ResourceBase["default"] {}
8745
+ // EXTERNAL MODULE: ./src/utils/helpers.js
8746
+ var helpers = __webpack_require__(1);
8747
+ // EXTERNAL MODULE: ./node_modules/case/dist/Case.js
8748
+ var Case = __webpack_require__(5);
8749
+ ;// CONCATENATED MODULE: ./src/resources/Message.js
8689
8750
  /*
8690
8751
  * BSD 3-Clause License
8691
8752
  *
@@ -8721,51 +8782,63 @@ class VectorChoropleth extends ResourceBase["default"] {
8721
8782
 
8722
8783
 
8723
8784
 
8785
+ class Message extends CrudBase["default"] {
8786
+ static get resourceName() {
8787
+ return 'messages';
8788
+ }
8724
8789
 
8790
+ toObject(camelCaseKeys = false) {
8791
+ const superObject = super.toObject(camelCaseKeys);
8792
+ superObject.variants = superObject.variants.map(variant => {
8793
+ if (variant instanceof MessageVariant) {
8794
+ return variant.toObject(camelCaseKeys);
8795
+ }
8725
8796
 
8797
+ const caseFn = camelCaseKeys ? Case.camel : Case.snake;
8798
+ const res = {};
8799
+ const fields = Object.keys(variant);
8726
8800
 
8801
+ for (const field of fields) {
8802
+ res[caseFn(field)] = variant[field];
8803
+ }
8727
8804
 
8805
+ return res;
8806
+ });
8807
+ return superObject;
8808
+ }
8728
8809
 
8810
+ _guessType(name, value) {
8811
+ if (name === 'variants') {
8812
+ return Array.from(value).map(data => new MessageVariant(this.api, data));
8813
+ }
8729
8814
 
8815
+ return super._guessType(name, value);
8816
+ }
8730
8817
 
8818
+ _buildCreateData() {
8819
+ return this.toObject();
8820
+ }
8731
8821
 
8822
+ _update() {
8823
+ return (0,helpers.makeCancelable)(async signal => {
8824
+ const json = this.toObject();
8825
+ await this.api.ky.patch(this.url, {
8826
+ json,
8827
+ signal
8828
+ }); // Reset changes
8732
8829
 
8830
+ Object.assign(this._baseProperties, this._properties);
8831
+ this._properties = {};
8733
8832
 
8833
+ if ('updated_at' in this._baseProperties) {
8834
+ this._baseProperties['updated_at'] = new Date();
8835
+ }
8734
8836
 
8837
+ return this;
8838
+ });
8839
+ }
8735
8840
 
8736
-
8737
-
8738
-
8739
-
8740
-
8741
-
8742
-
8743
-
8744
-
8745
-
8746
-
8747
-
8748
-
8749
-
8750
-
8751
-
8752
-
8753
-
8754
-
8755
-
8756
-
8757
-
8758
-
8759
-
8760
- /**
8761
- * @private
8762
- */
8763
-
8764
- const base = {
8765
- CrudBase: CrudBase["default"],
8766
- CrudSetBase: CrudSetBase["default"],
8767
- ResourceBase: ResourceBase["default"]
8768
- };
8841
+ }
8769
8842
 
8770
8843
  /***/ }),
8771
8844
  /* 38 */
@@ -9320,7 +9393,7 @@ __webpack_require__.d(__webpack_exports__, {
9320
9393
  // EXTERNAL MODULE: ./src/storage/StorageManager.js + 3 modules
9321
9394
  var StorageManager = __webpack_require__(22);
9322
9395
  // EXTERNAL MODULE: ./src/utils/StaticClass.js
9323
- var StaticClass = __webpack_require__(33);
9396
+ var StaticClass = __webpack_require__(34);
9324
9397
  ;// CONCATENATED MODULE: ./src/utils/uuid.js
9325
9398
  /*
9326
9399
  * BSD 3-Clause License
@@ -9510,7 +9583,7 @@ __webpack_require__.r(__webpack_exports__);
9510
9583
  /* harmony import */ var _errors_GeoError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(44);
9511
9584
  /* harmony import */ var _RequestParameters__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8);
9512
9585
  /* harmony import */ var _utils_geo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(64);
9513
- /* harmony import */ var _ResourceProxy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(19);
9586
+ /* harmony import */ var _ResourceProxy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(14);
9514
9587
  /* harmony import */ var _utils_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1);
9515
9588
  /*
9516
9589
  * BSD 3-Clause License
@@ -9656,7 +9729,7 @@ class GeoResourceProxy extends _ResourceProxy__WEBPACK_IMPORTED_MODULE_3__["defa
9656
9729
  throw new TypeError(`Invalid resource limit ${limit}, maximum allowed is ${_RequestParameters__WEBPACK_IMPORTED_MODULE_1__["default"].maxPerPage}`);
9657
9730
  }
9658
9731
 
9659
- const url = `${this.new().baseUrl}/for-point`;
9732
+ const url = `${this.new().baseUrl}/for-point?per_page=${limit}`;
9660
9733
  return (0,_utils_helpers__WEBPACK_IMPORTED_MODULE_4__.makeCancelable)(async signal => {
9661
9734
  const {
9662
9735
  data
@@ -9745,8 +9818,10 @@ __webpack_require__.r(__webpack_exports__);
9745
9818
  /* harmony import */ var _Tag__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(29);
9746
9819
  /* harmony import */ var _User__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(58);
9747
9820
  /* harmony import */ var _utils_helpers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(1);
9748
- /* harmony import */ var _utils_requests__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(5);
9821
+ /* harmony import */ var _utils_requests__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(6);
9749
9822
  /* harmony import */ var _LayerGroup__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(74);
9823
+ /* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(30);
9824
+ /* harmony import */ var _proxy_ResourceProxy__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(14);
9750
9825
  /*
9751
9826
  * BSD 3-Clause License
9752
9827
  *
@@ -9796,6 +9871,8 @@ __webpack_require__.r(__webpack_exports__);
9796
9871
 
9797
9872
 
9798
9873
 
9874
+
9875
+
9799
9876
 
9800
9877
  class Organisation extends _base_CrudBase__WEBPACK_IMPORTED_MODULE_1__["default"] {
9801
9878
  static get resourceName() {
@@ -9829,6 +9906,13 @@ class Organisation extends _base_CrudBase__WEBPACK_IMPORTED_MODULE_1__["default"
9829
9906
  get mapstyleSets() {
9830
9907
  return new _proxy_OwnedResourceProxy__WEBPACK_IMPORTED_MODULE_0__["default"](this.api, this, _MapstyleSet__WEBPACK_IMPORTED_MODULE_12__["default"]);
9831
9908
  }
9909
+
9910
+ get notes() {
9911
+ const data = {
9912
+ organisationId: this.id
9913
+ };
9914
+ return new _proxy_ResourceProxy__WEBPACK_IMPORTED_MODULE_20__["default"](this.api, _index__WEBPACK_IMPORTED_MODULE_19__.OrganisationNote, `${this.api.url}/organisations/${this.id}/notes`, data);
9915
+ }
9832
9916
  /**
9833
9917
  * Get a proxy for svg sets linked to the organisation
9834
9918
  * @returns {OwnedResourceProxy} - A proxy for accessing the resource
@@ -9992,7 +10076,7 @@ __webpack_require__.r(__webpack_exports__);
9992
10076
  /* harmony export */ "default": () => (/* binding */ Color)
9993
10077
  /* harmony export */ });
9994
10078
  /* harmony import */ var _base_CrudBase__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
9995
- /* harmony import */ var _traits_OwnableResource__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6);
10079
+ /* harmony import */ var _traits_OwnableResource__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
9996
10080
  /* harmony import */ var _utils_reflection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
9997
10081
  /*
9998
10082
  * BSD 3-Clause License
@@ -10050,9 +10134,9 @@ __webpack_require__.r(__webpack_exports__);
10050
10134
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10051
10135
  /* harmony export */ "default": () => (/* binding */ DimensionSet)
10052
10136
  /* harmony export */ });
10053
- /* harmony import */ var _base_CrudSetBase__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15);
10137
+ /* harmony import */ var _base_CrudSetBase__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16);
10054
10138
  /* harmony import */ var _Dimension__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(48);
10055
- /* harmony import */ var _traits_OwnableResource__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6);
10139
+ /* harmony import */ var _traits_OwnableResource__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4);
10056
10140
  /* harmony import */ var _utils_reflection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(0);
10057
10141
  /*
10058
10142
  * BSD 3-Clause License
@@ -10173,7 +10257,7 @@ __webpack_require__.r(__webpack_exports__);
10173
10257
  /* harmony export */ "default": () => (/* binding */ Feature)
10174
10258
  /* harmony export */ });
10175
10259
  /* harmony import */ var _base_CrudBase__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
10176
- /* harmony import */ var _traits_OwnableResource__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6);
10260
+ /* harmony import */ var _traits_OwnableResource__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
10177
10261
  /* harmony import */ var _utils_reflection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
10178
10262
  /*
10179
10263
  * BSD 3-Clause License
@@ -10231,9 +10315,9 @@ __webpack_require__.r(__webpack_exports__);
10231
10315
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10232
10316
  /* harmony export */ "default": () => (/* binding */ FontFamily)
10233
10317
  /* harmony export */ });
10234
- /* harmony import */ var _traits_OwnableResource__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
10318
+ /* harmony import */ var _traits_OwnableResource__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
10235
10319
  /* harmony import */ var _utils_reflection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
10236
- /* harmony import */ var _base_CrudSetBase__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15);
10320
+ /* harmony import */ var _base_CrudSetBase__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16);
10237
10321
  /* harmony import */ var _Font__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(51);
10238
10322
  /*
10239
10323
  * BSD 3-Clause License
@@ -10353,13 +10437,13 @@ __webpack_require__.r(__webpack_exports__);
10353
10437
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10354
10438
  /* harmony export */ "default": () => (/* binding */ Job)
10355
10439
  /* harmony export */ });
10356
- /* harmony import */ var _proxy_ResourceProxy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19);
10440
+ /* harmony import */ var _proxy_ResourceProxy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14);
10357
10441
  /* harmony import */ var _base_DownloadedResource__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25);
10358
10442
  /* harmony import */ var _base_CrudBase__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2);
10359
10443
  /* harmony import */ var _JobResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(53);
10360
10444
  /* harmony import */ var _JobRevision__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(69);
10361
10445
  /* harmony import */ var _RequestParameters__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8);
10362
- /* harmony import */ var _utils_requests__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5);
10446
+ /* harmony import */ var _utils_requests__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(6);
10363
10447
  /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7);
10364
10448
  /* harmony import */ var _utils_helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1);
10365
10449
  /* harmony import */ var _JobShare__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(26);
@@ -10557,7 +10641,7 @@ __webpack_require__.r(__webpack_exports__);
10557
10641
  /* harmony import */ var _base_DownloadedResource__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25);
10558
10642
  /* harmony import */ var _base_ResourceBase__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
10559
10643
  /* harmony import */ var _RequestParameters__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8);
10560
- /* harmony import */ var _utils_requests__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5);
10644
+ /* harmony import */ var _utils_requests__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6);
10561
10645
  /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
10562
10646
  /* harmony import */ var _utils_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1);
10563
10647
  /*
@@ -10781,9 +10865,9 @@ __webpack_require__.d(__webpack_exports__, {
10781
10865
  });
10782
10866
 
10783
10867
  // EXTERNAL MODULE: ./src/traits/Trait.js
10784
- var Trait = __webpack_require__(31);
10868
+ var Trait = __webpack_require__(32);
10785
10869
  // EXTERNAL MODULE: ./src/Mapcreator.js + 1 modules
10786
- var Mapcreator = __webpack_require__(16);
10870
+ var Mapcreator = __webpack_require__(17);
10787
10871
  // EXTERNAL MODULE: ./src/resources/base/DownloadedResource.js + 1 modules
10788
10872
  var DownloadedResource = __webpack_require__(25);
10789
10873
  // EXTERNAL MODULE: ./src/resources/base/ResourceBase.js
@@ -10791,7 +10875,7 @@ var ResourceBase = __webpack_require__(3);
10791
10875
  // EXTERNAL MODULE: ./src/utils/reflection.js
10792
10876
  var reflection = __webpack_require__(0);
10793
10877
  // EXTERNAL MODULE: ./src/utils/requests.js
10794
- var requests = __webpack_require__(5);
10878
+ var requests = __webpack_require__(6);
10795
10879
  // EXTERNAL MODULE: ./src/utils/helpers.js
10796
10880
  var helpers = __webpack_require__(1);
10797
10881
  ;// CONCATENATED MODULE: ./src/ImageHandler.js
@@ -11000,7 +11084,7 @@ __webpack_require__.r(__webpack_exports__);
11000
11084
  /* harmony export */ "default": () => (/* binding */ JobType)
11001
11085
  /* harmony export */ });
11002
11086
  /* harmony import */ var _base_CrudBase__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
11003
- /* harmony import */ var _traits_OwnableResource__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6);
11087
+ /* harmony import */ var _traits_OwnableResource__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
11004
11088
  /* harmony import */ var _utils_reflection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
11005
11089
  /*
11006
11090
  * BSD 3-Clause License
@@ -11062,8 +11146,8 @@ __webpack_require__.r(__webpack_exports__);
11062
11146
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11063
11147
  /* harmony export */ "default": () => (/* binding */ SvgSet)
11064
11148
  /* harmony export */ });
11065
- /* harmony import */ var _traits_OwnableResource__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
11066
- /* harmony import */ var _base_CrudSetBase__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15);
11149
+ /* harmony import */ var _traits_OwnableResource__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
11150
+ /* harmony import */ var _base_CrudSetBase__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16);
11067
11151
  /* harmony import */ var _Svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57);
11068
11152
  /* harmony import */ var _utils_reflection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(0);
11069
11153
  /*
@@ -11181,7 +11265,7 @@ __webpack_require__.r(__webpack_exports__);
11181
11265
  /* harmony export */ "default": () => (/* binding */ User)
11182
11266
  /* harmony export */ });
11183
11267
  /* harmony import */ var _proxy_OwnedResourceProxy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20);
11184
- /* harmony import */ var _proxy_ResourceProxy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(19);
11268
+ /* harmony import */ var _proxy_ResourceProxy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14);
11185
11269
  /* harmony import */ var _base_CrudBase__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2);
11186
11270
  /* harmony import */ var _Color__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(46);
11187
11271
  /* harmony import */ var _Dimension__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(48);
@@ -11196,7 +11280,7 @@ __webpack_require__.r(__webpack_exports__);
11196
11280
  /* harmony import */ var _Layer__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(27);
11197
11281
  /* harmony import */ var _Mapstyle__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(70);
11198
11282
  /* harmony import */ var _MapstyleSet__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(28);
11199
- /* harmony import */ var _Message__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(36);
11283
+ /* harmony import */ var _Message__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(37);
11200
11284
  /* harmony import */ var _Notification__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(72);
11201
11285
  /* harmony import */ var _Organisation__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(45);
11202
11286
  /* harmony import */ var _Permission__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(59);
@@ -11959,7 +12043,7 @@ __webpack_require__.r(__webpack_exports__);
11959
12043
  /* harmony export */ });
11960
12044
  /* harmony import */ var _resources_base_ResourceBase__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
11961
12045
  /* harmony import */ var _utils_reflection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
11962
- /* harmony import */ var _Trait__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31);
12046
+ /* harmony import */ var _Trait__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(32);
11963
12047
  /*
11964
12048
  * BSD 3-Clause License
11965
12049
  *
@@ -12154,7 +12238,7 @@ class Injectable extends _Trait__WEBPACK_IMPORTED_MODULE_2__["default"] {
12154
12238
  name = `${name.replace(/^\w/, c => c.toLowerCase())}s`;
12155
12239
  }
12156
12240
 
12157
- const OwnableResource = (__webpack_require__(6)["default"]);
12241
+ const OwnableResource = (__webpack_require__(4)["default"]);
12158
12242
 
12159
12243
  if ((0,_utils_reflection__WEBPACK_IMPORTED_MODULE_1__.hasTrait)(value, OwnableResource)) {
12160
12244
  const OwnedResourceProxy = (__webpack_require__(20)["default"]);
@@ -12168,7 +12252,7 @@ class Injectable extends _Trait__WEBPACK_IMPORTED_MODULE_2__["default"] {
12168
12252
  return this._proxyResourceList(value);
12169
12253
  });
12170
12254
  } else {
12171
- const ResourceProxy = (__webpack_require__(19)["default"]);
12255
+ const ResourceProxy = (__webpack_require__(14)["default"]);
12172
12256
 
12173
12257
  this._inject(name, function () {
12174
12258
  return new ResourceProxy(this, value);
@@ -12481,7 +12565,7 @@ __webpack_require__.r(__webpack_exports__);
12481
12565
  /* harmony import */ var _JobShare__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26);
12482
12566
  /* harmony import */ var _Layer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(27);
12483
12567
  /* harmony import */ var _RequestParameters__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8);
12484
- /* harmony import */ var _utils_requests__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5);
12568
+ /* harmony import */ var _utils_requests__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(6);
12485
12569
  /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7);
12486
12570
  /* harmony import */ var _utils_helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1);
12487
12571
  /*
@@ -12970,10 +13054,10 @@ __webpack_require__.r(__webpack_exports__);
12970
13054
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12971
13055
  /* harmony export */ "default": () => (/* binding */ LayerGroup)
12972
13056
  /* harmony export */ });
12973
- /* harmony import */ var _traits_OwnableResource__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
13057
+ /* harmony import */ var _traits_OwnableResource__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
12974
13058
  /* harmony import */ var _utils_reflection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
12975
13059
  /* harmony import */ var _Layer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(27);
12976
- /* harmony import */ var _base_CrudSetBase__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(15);
13060
+ /* harmony import */ var _base_CrudSetBase__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16);
12977
13061
  /* harmony import */ var _proxy__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(75);
12978
13062
  /*
12979
13063
  * BSD 3-Clause License
@@ -13047,10 +13131,10 @@ __webpack_require__.r(__webpack_exports__);
13047
13131
  /* harmony export */ "SimpleResourceProxy": () => (/* reexport safe */ _SimpleResourceProxy__WEBPACK_IMPORTED_MODULE_4__["default"])
13048
13132
  /* harmony export */ });
13049
13133
  /* harmony import */ var _GeoResourceProxy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(43);
13050
- /* harmony import */ var _OrganisationProxy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34);
13134
+ /* harmony import */ var _OrganisationProxy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(35);
13051
13135
  /* harmony import */ var _OwnedResourceProxy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20);
13052
- /* harmony import */ var _ResourceProxy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(19);
13053
- /* harmony import */ var _SimpleResourceProxy__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(14);
13136
+ /* harmony import */ var _ResourceProxy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(14);
13137
+ /* harmony import */ var _SimpleResourceProxy__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(15);
13054
13138
  /*
13055
13139
  * BSD 3-Clause License
13056
13140
  *
@@ -13097,8 +13181,8 @@ __webpack_require__.r(__webpack_exports__);
13097
13181
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13098
13182
  /* harmony export */ "default": () => (/* binding */ DummyFlow)
13099
13183
  /* harmony export */ });
13100
- /* harmony import */ var _errors_OAuthError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17);
13101
- /* harmony import */ var _OAuth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18);
13184
+ /* harmony import */ var _errors_OAuthError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18);
13185
+ /* harmony import */ var _OAuth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(19);
13102
13186
  /*
13103
13187
  * BSD 3-Clause License
13104
13188
  *
@@ -13173,11 +13257,11 @@ __webpack_require__.r(__webpack_exports__);
13173
13257
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13174
13258
  /* harmony export */ "default": () => (/* binding */ ResourceLister)
13175
13259
  /* harmony export */ });
13176
- /* harmony import */ var case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
13260
+ /* harmony import */ var case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5);
13177
13261
  /* harmony import */ var case__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(case__WEBPACK_IMPORTED_MODULE_0__);
13178
13262
  /* harmony import */ var events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(24);
13179
13263
  /* harmony import */ var events__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(events__WEBPACK_IMPORTED_MODULE_1__);
13180
- /* harmony import */ var _Mapcreator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16);
13264
+ /* harmony import */ var _Mapcreator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17);
13181
13265
  /* harmony import */ var _RequestParameters__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8);
13182
13266
  /* harmony import */ var _resources_base_ResourceBase__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3);
13183
13267
  /* harmony import */ var _utils_reflection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(0);
@@ -13865,7 +13949,7 @@ __webpack_require__.d(__webpack_exports__, {
13865
13949
  });
13866
13950
 
13867
13951
  // EXTERNAL MODULE: ./src/Mapcreator.js + 1 modules
13868
- var Mapcreator = __webpack_require__(16);
13952
+ var Mapcreator = __webpack_require__(17);
13869
13953
  // EXTERNAL MODULE: ./src/RequestParameters.js
13870
13954
  var RequestParameters = __webpack_require__(8);
13871
13955
  // EXTERNAL MODULE: ./src/storage/StorageManager.js + 3 modules
@@ -13875,19 +13959,19 @@ var Enum = __webpack_require__(11);
13875
13959
  // EXTERNAL MODULE: ./src/enums/index.js + 3 modules
13876
13960
  var enums = __webpack_require__(7);
13877
13961
  // EXTERNAL MODULE: ./src/oauth/OAuth.js
13878
- var OAuth = __webpack_require__(18);
13962
+ var OAuth = __webpack_require__(19);
13879
13963
  // EXTERNAL MODULE: ./src/oauth/OAuthToken.js
13880
13964
  var OAuthToken = __webpack_require__(13);
13881
13965
  // EXTERNAL MODULE: ./src/oauth/StateContainer.js + 1 modules
13882
13966
  var StateContainer = __webpack_require__(42);
13883
13967
  // EXTERNAL MODULE: ./src/utils/requests.js
13884
- var requests = __webpack_require__(5);
13968
+ var requests = __webpack_require__(6);
13885
13969
  // EXTERNAL MODULE: ./src/errors/OAuthError.js
13886
- var OAuthError = __webpack_require__(17);
13970
+ var OAuthError = __webpack_require__(18);
13887
13971
  // EXTERNAL MODULE: ./src/utils/node.js
13888
13972
  var node = __webpack_require__(9);
13889
13973
  // EXTERNAL MODULE: ./node_modules/case/dist/Case.js
13890
- var Case = __webpack_require__(4);
13974
+ var Case = __webpack_require__(5);
13891
13975
  ;// CONCATENATED MODULE: ./src/oauth/ImplicitFlow.js
13892
13976
  /*
13893
13977
  * BSD 3-Clause License
@@ -14231,7 +14315,7 @@ class ImplicitFlowPopup extends ImplicitFlow {
14231
14315
 
14232
14316
  }
14233
14317
  // EXTERNAL MODULE: ./node_modules/ky-universal/browser.js + 1 modules
14234
- var browser = __webpack_require__(30);
14318
+ var browser = __webpack_require__(31);
14235
14319
  // EXTERNAL MODULE: ./src/utils/helpers.js
14236
14320
  var helpers = __webpack_require__(1);
14237
14321
  ;// CONCATENATED MODULE: ./src/oauth/PasswordFlow.js
@@ -14415,14 +14499,14 @@ var AbstractError = __webpack_require__(21);
14415
14499
  var ValidationError = __webpack_require__(78);
14416
14500
  // EXTERNAL MODULE: ./src/errors/StaticClassError.js
14417
14501
  var StaticClassError = __webpack_require__(62);
14418
- // EXTERNAL MODULE: ./src/resources/index.js + 10 modules
14419
- var resources = __webpack_require__(37);
14502
+ // EXTERNAL MODULE: ./src/resources/index.js + 11 modules
14503
+ var resources = __webpack_require__(30);
14420
14504
  // EXTERNAL MODULE: ./src/ResourceLister.js
14421
14505
  var ResourceLister = __webpack_require__(77);
14422
14506
  // EXTERNAL MODULE: ./src/utils/geo.js
14423
14507
  var geo = __webpack_require__(64);
14424
14508
  // EXTERNAL MODULE: ./src/errors/index.js + 1 modules
14425
- var errors = __webpack_require__(35);
14509
+ var errors = __webpack_require__(36);
14426
14510
  // EXTERNAL MODULE: ./src/proxy/index.js
14427
14511
  var proxy = __webpack_require__(75);
14428
14512
  ;// CONCATENATED MODULE: ./src/index.js
@@ -14496,7 +14580,7 @@ var proxy = __webpack_require__(75);
14496
14580
  * @private
14497
14581
  */
14498
14582
 
14499
- const version = "v3.2.0";
14583
+ const version = "v3.3.1";
14500
14584
  })();
14501
14585
 
14502
14586
  /******/ return __webpack_exports__;