@mapcreator/api 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.browser.js +1779 -1695
- package/dist/bundle.browser.min.js +1 -1
- package/dist/bundle.browser.min.js.LICENSE.txt +2 -2
- package/dist/bundle.js +1003 -919
- package/dist/bundle.min.js +1 -1
- package/dist/bundle.min.js.LICENSE.txt +1 -1
- package/dist/resources/Organisation.d.ts +2 -0
- package/dist/resources/OrganisationNote.d.ts +17 -0
- package/dist/resources/base/CrudBase.d.ts +2 -1
- package/dist/resources/base/CrudBase.d.ts.map +1 -1
- package/dist/resources/base/CrudSetItemBase.d.ts.map +1 -1
- package/dist/resources/base/DownloadedResource.d.ts +2 -2
- package/dist/resources/base/ResourceBase.d.ts +3 -1
- package/dist/resources/base/ResourceBase.d.ts.map +1 -1
- package/dist/resources/index.d.ts +1 -0
- package/package.json +2 -2
- package/src/proxy/SimpleResourceProxy.js +1 -1
- package/src/resources/Organisation.js +15 -0
- package/src/resources/OrganisationNote.js +57 -0
- package/src/resources/base/CrudBase.js +3 -2
- package/src/resources/base/CrudSetItemBase.js +3 -2
- package/src/resources/base/ResourceBase.js +12 -3
- package/src/resources/index.js +1 -0
|
@@ -42,9 +42,10 @@ export default class CrudSetItemBase extends CrudBase {
|
|
|
42
42
|
/**
|
|
43
43
|
* @param {Mapcreator} api - Api instance
|
|
44
44
|
* @param {Object<String, *>} data - Item data
|
|
45
|
+
* @param {String} [altUrl] - Internal use, Optional alternative url for more complex routing
|
|
45
46
|
*/
|
|
46
|
-
constructor (api, data = {}) {
|
|
47
|
-
super(api, data);
|
|
47
|
+
constructor (api, data = {}, altUrl = null) {
|
|
48
|
+
super(api, data, altUrl);
|
|
48
49
|
|
|
49
50
|
if (this.constructor === CrudBase) {
|
|
50
51
|
throw new AbstractClassError();
|
|
@@ -51,14 +51,19 @@ export default class ResourceBase extends mix(null, Injectable) {
|
|
|
51
51
|
/**
|
|
52
52
|
* @param {Mapcreator} api - Api instance
|
|
53
53
|
* @param {Object<String, *>} data - Item data
|
|
54
|
+
* @param {String} [altUrl] - Internal use, Optional alternative url for more complex routing
|
|
54
55
|
*/
|
|
55
|
-
constructor (api, data = {}) {
|
|
56
|
+
constructor (api, data = {}, altUrl = null) {
|
|
56
57
|
super();
|
|
57
58
|
|
|
58
59
|
if (this.constructor === ResourceBase) {
|
|
59
60
|
throw new AbstractClassError();
|
|
60
61
|
}
|
|
61
62
|
|
|
63
|
+
if (altUrl) {
|
|
64
|
+
this.__baseUrl = altUrl;
|
|
65
|
+
}
|
|
66
|
+
|
|
62
67
|
this.api = api;
|
|
63
68
|
|
|
64
69
|
// De-reference
|
|
@@ -352,9 +357,13 @@ export default class ResourceBase extends mix(null, Injectable) {
|
|
|
352
357
|
* @returns {string} - Resource base url
|
|
353
358
|
*/
|
|
354
359
|
get baseUrl () {
|
|
355
|
-
|
|
360
|
+
if (!this.__baseUrl) {
|
|
361
|
+
const basePath = this.constructor.resourcePath.match(/^(\/[^{]+\b)/)[1];
|
|
362
|
+
|
|
363
|
+
this.__baseUrl = `${this._api.url}${basePath}`;
|
|
364
|
+
}
|
|
356
365
|
|
|
357
|
-
return
|
|
366
|
+
return this.__baseUrl;
|
|
358
367
|
}
|
|
359
368
|
|
|
360
369
|
/**
|
package/src/resources/index.js
CHANGED
|
@@ -56,6 +56,7 @@ export { default as MapstyleSet } from './MapstyleSet';
|
|
|
56
56
|
export { default as Message } from './Message';
|
|
57
57
|
export { default as Notification } from './Notification';
|
|
58
58
|
export { default as Organisation } from './Organisation';
|
|
59
|
+
export { default as OrganisationNote } from './OrganisationNote';
|
|
59
60
|
export { default as Permission } from './Permission';
|
|
60
61
|
export { default as ProductTour } from './ProductTour';
|
|
61
62
|
export { default as ProductTourStep } from './ProductTourStep';
|