@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.
@@ -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
- const basePath = this.constructor.resourcePath.match(/^(\/[^{]+\b)/)[1];
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 `${this._api.url}${basePath}`;
366
+ return this.__baseUrl;
358
367
  }
359
368
 
360
369
  /**
@@ -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';