@mapcreator/api 2.8.0 → 3.0.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.
Files changed (123) hide show
  1. package/dist/ImageHandler.d.ts +56 -0
  2. package/dist/Mapcreator.d.ts +338 -0
  3. package/dist/PaginatedResourceListing.d.ts +156 -0
  4. package/dist/RequestParameters.d.ts +241 -0
  5. package/dist/ResourceLister.d.ts +155 -0
  6. package/dist/bundle.browser.js +1264 -1253
  7. package/dist/bundle.browser.min.js +1 -1
  8. package/dist/bundle.browser.min.js.LICENSE.txt +2 -2
  9. package/dist/bundle.js +1263 -1252
  10. package/dist/bundle.min.js +1 -1
  11. package/dist/bundle.min.js.LICENSE.txt +1 -1
  12. package/dist/enums/DeletedState.d.ts +16 -0
  13. package/dist/enums/Enum.d.ts +40 -0
  14. package/dist/enums/JobShareVisibility.d.ts +15 -0
  15. package/dist/enums/ResultStatus.d.ts +17 -0
  16. package/dist/enums/index.d.ts +5 -0
  17. package/dist/errors/AbstractError.d.ts +26 -0
  18. package/dist/errors/ApiError.d.ts +65 -0
  19. package/dist/errors/GeoError.d.ts +6 -0
  20. package/dist/errors/NodeError.d.ts +6 -0
  21. package/dist/errors/OAuthError.d.ts +17 -0
  22. package/dist/errors/StaticClassError.d.ts +7 -0
  23. package/dist/errors/ValidationError.d.ts +125 -0
  24. package/dist/errors/index.d.ts +8 -0
  25. package/dist/index.d.ts +27 -0
  26. package/dist/oauth/DummyFlow.d.ts +19 -0
  27. package/dist/oauth/ImplicitFlow.d.ts +68 -0
  28. package/dist/oauth/ImplicitFlowPopup.d.ts +25 -0
  29. package/dist/oauth/OAuth.d.ts +50 -0
  30. package/dist/oauth/OAuthToken.d.ts +67 -0
  31. package/dist/oauth/PasswordFlow.d.ts +56 -0
  32. package/dist/oauth/StateContainer.d.ts +36 -0
  33. package/dist/proxy/GeoResourceProxy.d.ts +69 -0
  34. package/dist/proxy/OrganisationProxy.d.ts +62 -0
  35. package/dist/proxy/OwnedResourceProxy.d.ts +60 -0
  36. package/dist/proxy/ResourceProxy.d.ts +32 -0
  37. package/dist/proxy/SimpleResourceProxy.d.ts +76 -0
  38. package/dist/proxy/index.d.ts +6 -0
  39. package/dist/resources/Choropleth.d.ts +20 -0
  40. package/dist/resources/Color.d.ts +9 -0
  41. package/dist/resources/Contract.d.ts +7 -0
  42. package/dist/resources/Dimension.d.ts +7 -0
  43. package/dist/resources/DimensionSet.d.ts +11 -0
  44. package/dist/resources/Domain.d.ts +7 -0
  45. package/dist/resources/Faq.d.ts +7 -0
  46. package/dist/resources/Feature.d.ts +9 -0
  47. package/dist/resources/Font.d.ts +4 -0
  48. package/dist/resources/FontFamily.d.ts +11 -0
  49. package/dist/resources/Highlight.d.ts +4 -0
  50. package/dist/resources/InsetMap.d.ts +10 -0
  51. package/dist/resources/Job.d.ts +56 -0
  52. package/dist/resources/JobResult.d.ts +76 -0
  53. package/dist/resources/JobRevision.d.ts +64 -0
  54. package/dist/resources/JobShare.d.ts +15 -0
  55. package/dist/resources/JobType.d.ts +9 -0
  56. package/dist/resources/Language.d.ts +4 -0
  57. package/dist/resources/Layer.d.ts +10 -0
  58. package/dist/resources/LayerFaq.d.ts +8 -0
  59. package/dist/resources/LayerGroup.d.ts +14 -0
  60. package/dist/resources/Mapstyle.d.ts +8 -0
  61. package/dist/resources/MapstyleSet.d.ts +13 -0
  62. package/dist/resources/MapstyleSetColor.d.ts +8 -0
  63. package/dist/resources/Message.d.ts +7 -0
  64. package/dist/resources/MessageVariant.d.ts +4 -0
  65. package/dist/resources/Notification.d.ts +4 -0
  66. package/dist/resources/Organisation.d.ts +97 -0
  67. package/dist/resources/Permission.d.ts +4 -0
  68. package/dist/resources/ProductTour.d.ts +10 -0
  69. package/dist/resources/ProductTourStep.d.ts +7 -0
  70. package/dist/resources/Role.d.ts +14 -0
  71. package/dist/resources/Svg.d.ts +4 -0
  72. package/dist/resources/SvgSet.d.ts +11 -0
  73. package/dist/resources/Tag.d.ts +9 -0
  74. package/dist/resources/TagType.d.ts +13 -0
  75. package/dist/resources/User.d.ts +119 -0
  76. package/dist/resources/VectorChoropleth.d.ts +4 -0
  77. package/dist/resources/VectorHighlight.d.ts +4 -0
  78. package/dist/resources/base/CrudBase.d.ts +65 -0
  79. package/dist/resources/base/CrudBase.d.ts.map +1 -0
  80. package/dist/resources/base/CrudSetBase.d.ts +27 -0
  81. package/dist/resources/base/CrudSetBase.d.ts.map +1 -0
  82. package/dist/resources/base/CrudSetItemBase.d.ts +19 -0
  83. package/dist/resources/base/CrudSetItemBase.d.ts.map +1 -0
  84. package/dist/resources/base/DownloadedResource.d.ts +72 -0
  85. package/dist/resources/base/DownloadedResource.d.ts.map +1 -0
  86. package/dist/resources/base/ResourceBase.d.ts +162 -0
  87. package/dist/resources/base/ResourceBase.d.ts.map +1 -0
  88. package/dist/resources/index.d.ts +45 -0
  89. package/dist/storage/CookiesDriver.d.ts +37 -0
  90. package/dist/storage/DataStoreContract.d.ts +46 -0
  91. package/dist/storage/DummyDriver.d.ts +15 -0
  92. package/dist/storage/FileDriver.d.ts +54 -0
  93. package/dist/storage/LocalStorageDriver.d.ts +13 -0
  94. package/dist/storage/StorageManager.d.ts +46 -0
  95. package/dist/traits/HandlesImages.d.ts +15 -0
  96. package/dist/traits/Injectable.d.ts +60 -0
  97. package/dist/traits/OwnableResource.d.ts +18 -0
  98. package/dist/traits/Trait.d.ts +12 -0
  99. package/dist/utils/Logger.d.ts +55 -0
  100. package/dist/utils/Singleton.d.ts +9 -0
  101. package/dist/utils/StaticClass.d.ts +7 -0
  102. package/dist/utils/Unobservable.d.ts +13 -0
  103. package/dist/utils/base64.d.ts +12 -0
  104. package/dist/utils/geo.d.ts +74 -0
  105. package/dist/utils/hash.d.ts +15 -0
  106. package/dist/utils/helpers.d.ts +47 -0
  107. package/dist/utils/node.d.ts +15 -0
  108. package/dist/utils/reflection.d.ts +43 -0
  109. package/dist/utils/requests.d.ts +24 -0
  110. package/dist/utils/uuid.d.ts +19 -0
  111. package/package.json +4 -1
  112. package/src/Mapcreator.js +53 -33
  113. package/src/enums/index.js +1 -1
  114. package/src/errors/index.js +6 -6
  115. package/src/index.js +14 -14
  116. package/src/proxy/index.js +5 -5
  117. package/src/resources/LayerFaq.js +47 -0
  118. package/src/resources/LayerGroup.js +1 -1
  119. package/src/resources/index.js +36 -35
  120. package/dist/bundle.browser.js.map +0 -1
  121. package/dist/bundle.browser.min.js.map +0 -1
  122. package/dist/bundle.js.map +0 -1
  123. package/dist/bundle.min.js.map +0 -1
@@ -0,0 +1,97 @@
1
+ export default class Organisation extends CrudBase {
2
+ /**
3
+ * Get a proxy for font families linked to the organisation
4
+ * @returns {OwnedResourceProxy} - A proxy for accessing the resource
5
+ */
6
+ get fontFamilies(): OwnedResourceProxy;
7
+ /**
8
+ * Get a proxy for dimension sets linked to the organisation
9
+ * @returns {OwnedResourceProxy} - A proxy for accessing the resource
10
+ */
11
+ get dimensionSets(): OwnedResourceProxy;
12
+ /**
13
+ * Get a proxy for mapstyle sets linked to the organisation
14
+ * @returns {OwnedResourceProxy} - A proxy for accessing the resource
15
+ */
16
+ get mapstyleSets(): OwnedResourceProxy;
17
+ /**
18
+ * Get a proxy for svg sets linked to the organisation
19
+ * @returns {OwnedResourceProxy} - A proxy for accessing the resource
20
+ */
21
+ get svgSets(): OwnedResourceProxy;
22
+ /**
23
+ * Get a proxy for colors linked to the organisation
24
+ * @returns {OwnedResourceProxy} - A proxy for accessing the resource
25
+ */
26
+ get colors(): OwnedResourceProxy;
27
+ /**
28
+ * Get a proxy for tags linked to the organisation
29
+ * @returns {OwnedResourceProxy} - A proxy for accessing the resource
30
+ */
31
+ get tags(): OwnedResourceProxy;
32
+ /**
33
+ * Get a proxy for features linked to the organisation
34
+ * @returns {OwnedResourceProxy} - A proxy for accessing the resource
35
+ */
36
+ get features(): OwnedResourceProxy;
37
+ /**
38
+ * Get a proxy for layers linked to the organisation
39
+ * @returns {OwnedResourceProxy} - A proxy for accessing the resource
40
+ */
41
+ get layers(): OwnedResourceProxy;
42
+ /**
43
+ * Get a proxy for layer groups linked to the organisation
44
+ * @returns {OwnedResourceProxy} - A proxy for accessing the resource
45
+ */
46
+ get layerGroups(): OwnedResourceProxy;
47
+ /**
48
+ * Get a proxy for jobs linked to the organisation, also known as company maps
49
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
50
+ */
51
+ get jobs(): SimpleResourceProxy;
52
+ /**
53
+ * Get a proxy for job types linked to the organisation
54
+ * @returns {OwnedResourceProxy} - A proxy for accessing the resource
55
+ */
56
+ get jobTypes(): OwnedResourceProxy;
57
+ /**
58
+ * Get a proxy for job shares linked to the organisation
59
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
60
+ */
61
+ get jobShares(): SimpleResourceProxy;
62
+ /**
63
+ * Get a proxy for users linked to the organisation
64
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
65
+ */
66
+ get users(): SimpleResourceProxy;
67
+ /**
68
+ * Get a proxy for contracts linked to the organisation
69
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
70
+ */
71
+ get contracts(): SimpleResourceProxy;
72
+ /**
73
+ * Get a proxy for contracts linked to the organisation
74
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
75
+ */
76
+ get domains(): SimpleResourceProxy;
77
+ /**
78
+ * Get a tree representation of the organisation's relationships
79
+ * @returns {CancelablePromise<Array<Organisation>>} - List of organisation root nodes. Organisations contain an extra property called "children"
80
+ * @throws {ApiError} - If the api returns errors
81
+ * @example
82
+ * function printTree(nodes, prefix = '-') {
83
+ * for (const node of nodes) {
84
+ * console.log(`${prefix} ${node.name}`);
85
+ *
86
+ * printTree(node.children, prefix + '-');
87
+ * }
88
+ * }
89
+ *
90
+ * organisation.getTree().then(printTree)
91
+ */
92
+ getTree(deleted?: any): CancelablePromise<Organisation[]>;
93
+ _parseTree(rawNode: any): any;
94
+ }
95
+ import CrudBase from "./base/CrudBase";
96
+ import OwnedResourceProxy from "../proxy/OwnedResourceProxy";
97
+ //# sourceMappingURL=Organisation.d.ts.map
@@ -0,0 +1,4 @@
1
+ export default class Permission extends ResourceBase {
2
+ }
3
+ import ResourceBase from "./base/ResourceBase";
4
+ //# sourceMappingURL=Permission.d.ts.map
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Mapstyle set
3
+ * @extends CrudSetBase
4
+ */
5
+ export default class ProductTour extends CrudSetBase {
6
+ get _Child(): typeof ProductTourStep;
7
+ }
8
+ import CrudSetBase from "./base/CrudSetBase";
9
+ import ProductTourStep from "./ProductTourStep";
10
+ //# sourceMappingURL=ProductTour.d.ts.map
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @extends CrudSetItemBase
3
+ */
4
+ export default class ProductTourStep extends CrudSetItemBase {
5
+ }
6
+ import CrudSetItemBase from "./base/CrudSetItemBase";
7
+ //# sourceMappingURL=ProductTourStep.d.ts.map
@@ -0,0 +1,14 @@
1
+ export default class Role extends CrudBase {
2
+ /**
3
+ * Get the list permissions linked to the role
4
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
5
+ */
6
+ get permissions(): SimpleResourceProxy;
7
+ /**
8
+ * Get the list users linked to the role
9
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
10
+ */
11
+ get users(): SimpleResourceProxy;
12
+ }
13
+ import CrudBase from "./base/CrudBase";
14
+ //# sourceMappingURL=Role.d.ts.map
@@ -0,0 +1,4 @@
1
+ export default class Svg extends CrudSetItemBase {
2
+ }
3
+ import CrudSetItemBase from "./base/CrudSetItemBase";
4
+ //# sourceMappingURL=Svg.d.ts.map
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Svg set
3
+ * @extends CrudSetBase
4
+ * @mixes OwnableResource
5
+ */
6
+ export default class SvgSet extends CrudSetBase {
7
+ get _Child(): typeof Svg;
8
+ }
9
+ import CrudSetBase from "./base/CrudSetBase";
10
+ import Svg from "./Svg";
11
+ //# sourceMappingURL=SvgSet.d.ts.map
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Tag resource
3
+ * @extends CrudSetItemBase
4
+ * @mixes OwnableResource
5
+ */
6
+ export default class Tag extends CrudSetItemBase {
7
+ }
8
+ import CrudSetItemBase from "./base/CrudSetItemBase";
9
+ //# sourceMappingURL=Tag.d.ts.map
@@ -0,0 +1,13 @@
1
+ /**
2
+ * TagType resource
3
+ * @mixes CrudSetBase
4
+ */
5
+ export default class TagType extends CrudBase {
6
+ /**
7
+ * Get the list of tags that are attached to this type
8
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
9
+ */
10
+ get tags(): SimpleResourceProxy;
11
+ }
12
+ import CrudBase from "./base/CrudBase";
13
+ //# sourceMappingURL=TagType.d.ts.map
@@ -0,0 +1,119 @@
1
+ export default class User extends CrudBase {
2
+ /**
3
+ * Get all known ips
4
+ * @returns {CancelablePromise<string[]>} - List of ip addresses
5
+ * @throws {ApiError} - If the api returns errors
6
+ */
7
+ ips(): CancelablePromise<string[]>;
8
+ /**
9
+ * Get the user's organisation
10
+ * @returns {CancelablePromise<Organisation>} - User's organisation
11
+ * @throws {ApiError} - If the api returns errors
12
+ */
13
+ organisation(): CancelablePromise<Organisation>;
14
+ /**
15
+ * Get the user's language
16
+ * @returns {CancelablePromise<Language>} - User's language
17
+ * @throws {ApiError} - If the api returns errors
18
+ */
19
+ language(): CancelablePromise<Language>;
20
+ /**
21
+ * Get the list notifications linked to the user
22
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
23
+ */
24
+ get notifications(): SimpleResourceProxy;
25
+ /**
26
+ * Get a list of read/unread messages for the user
27
+ * @returns {CancelablePromise<{read: Message[], unread: Message[]}>} - Read and unread messages
28
+ */
29
+ messages(): CancelablePromise<{
30
+ read: Message[];
31
+ unread: Message[];
32
+ }>;
33
+ /**
34
+ * Get the list mapstyle sets linked to the user
35
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
36
+ */
37
+ get mapstyleSets(): SimpleResourceProxy;
38
+ /**
39
+ * Get the list mapstyles linked to the user
40
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
41
+ */
42
+ get mapstyles(): SimpleResourceProxy;
43
+ /**
44
+ * Get the list dimension sets linked to the user
45
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
46
+ */
47
+ get dimensionSets(): SimpleResourceProxy;
48
+ /**
49
+ * Get the list dimensions linked to the user
50
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
51
+ */
52
+ get dimensions(): SimpleResourceProxy;
53
+ /**
54
+ * Get the list font families linked to the user
55
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
56
+ */
57
+ get fontFamilies(): SimpleResourceProxy;
58
+ /**
59
+ * Get the list fonts linked to the user
60
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
61
+ */
62
+ get fonts(): SimpleResourceProxy;
63
+ /**
64
+ * Get the list svg sets linked to the user
65
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
66
+ */
67
+ get svgSets(): SimpleResourceProxy;
68
+ /**
69
+ * Get the list svgs linked to the user
70
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
71
+ */
72
+ get svgs(): SimpleResourceProxy;
73
+ /**
74
+ * Get the list colors linked to the user
75
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
76
+ */
77
+ get colors(): SimpleResourceProxy;
78
+ /**
79
+ * Get the list jobs linked to the user
80
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
81
+ */
82
+ get jobs(): SimpleResourceProxy;
83
+ /**
84
+ * Get the list features linked to the user
85
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
86
+ */
87
+ get features(): SimpleResourceProxy;
88
+ /**
89
+ * Get the list layers linked to the user
90
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
91
+ */
92
+ get layers(): SimpleResourceProxy;
93
+ /**
94
+ * Get the list job types linked to the user
95
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
96
+ */
97
+ get jobTypes(): SimpleResourceProxy;
98
+ /**
99
+ * Get the list job shares linked to the user
100
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
101
+ */
102
+ get jobShares(): SimpleResourceProxy;
103
+ /**
104
+ * Get the list permissions linked to the user
105
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
106
+ */
107
+ get permissions(): SimpleResourceProxy;
108
+ /**
109
+ * Get the list roles linked to the user
110
+ * @returns {OwnedResourceProxy} - A proxy for accessing the resource
111
+ */
112
+ get roles(): OwnedResourceProxy;
113
+ }
114
+ import CrudBase from "./base/CrudBase";
115
+ import Organisation from "./Organisation";
116
+ import Language from "./Language";
117
+ import Message from "./Message";
118
+ import OwnedResourceProxy from "../proxy/OwnedResourceProxy";
119
+ //# sourceMappingURL=User.d.ts.map
@@ -0,0 +1,4 @@
1
+ export default class VectorChoropleth extends ResourceBase {
2
+ }
3
+ import ResourceBase from "./base/ResourceBase";
4
+ //# sourceMappingURL=VectorChoropleth.d.ts.map
@@ -0,0 +1,4 @@
1
+ export default class VectorHighlight extends ResourceBase {
2
+ }
3
+ import ResourceBase from "./base/ResourceBase";
4
+ //# sourceMappingURL=VectorHighlight.d.ts.map
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Base of all resource items that support Crud operations
3
+ * @abstract
4
+ */
5
+ export default class CrudBase extends ResourceBase {
6
+ /**
7
+ * @param {Mapcreator} api - Api instance
8
+ * @param {Object<String, *>} data - Item data
9
+ */
10
+ constructor(api: Mapcreator, data?: any);
11
+ /**
12
+ * Build data for create operation
13
+ * @returns {Object<String, *>} - Create data
14
+ * @protected
15
+ */
16
+ protected _buildCreateData(): any;
17
+ /**
18
+ * Save item. This will create a new item if `id` is unset
19
+ * @returns {CancelablePromise<CrudBase>} - Current instance
20
+ * @throws {ApiError} - If the api returns errors
21
+ * @throws {ValidationError} - If the submitted data isn't valid
22
+ */
23
+ save(): CancelablePromise<CrudBase>;
24
+ /**
25
+ * Store new item
26
+ * @returns {CancelablePromise<CrudBase>} - Current instance
27
+ * @throws {ApiError} - If the api returns errors
28
+ * @throws {ValidationError} - If the submitted data isn't valid
29
+ * @private
30
+ */
31
+ private _create;
32
+ /**
33
+ * Update existing item
34
+ * @returns {CancelablePromise<CrudBase>} - Current instance
35
+ * @throws {ApiError} - If the api returns errors
36
+ * @throws {ValidationError} - If the submitted data isn't valid
37
+ * @protected
38
+ */
39
+ protected _update(): CancelablePromise<CrudBase>;
40
+ /**
41
+ * Delete item
42
+ * @param {Boolean} [updateSelf=true] - Update current instance (set the deletedAt property)
43
+ * @returns {CancelablePromise<CrudBase>} - Current instance
44
+ * @throws {ApiError} - If the api returns errors
45
+ * @throws {ValidationError} - If the submitted data isn't valid
46
+ */
47
+ delete(updateSelf?: boolean): CancelablePromise<CrudBase>;
48
+ /**
49
+ * Restore item
50
+ * @param {Boolean} [updateSelf=true] - Update current instance (unset the deletedAt property)
51
+ * @returns {CancelablePromise<CrudBase>} - New restored instance
52
+ * @throws {ApiError} - If the api returns errors
53
+ * @throws {ValidationError} - If the submitted data isn't valid
54
+ */
55
+ restore(updateSelf?: boolean): CancelablePromise<CrudBase>;
56
+ /**
57
+ * Prepare data to be sent to the api
58
+ * @param {Object} data
59
+ * @returns {Object} prepared
60
+ * @private
61
+ */
62
+ private _prepareData;
63
+ }
64
+ import ResourceBase from "./ResourceBase";
65
+ //# sourceMappingURL=CrudBase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CrudBase.d.ts","sourceRoot":"","sources":["../../../src/resources/base/CrudBase.js"],"names":[],"mappings":"AAoCA;;;GAGG;AACH;IACE;;;OAGG;IACH,yCAMC;IAED;;;;OAIG;IACH,kCAgBC;IAED;;;;;OAKG;IACH,oCAEC;IAED;;;;;;OAMG;IACH,gBAaC;IAED;;;;;;OAMG;IACH,iDAwBC;IAED;;;;;;OAMG;IACH,0DAUC;IAED;;;;;;OAMG;IACH,2DAcC;IAED;;;;;OAKG;IACH,qBAYC;CACF"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Crud base for resource sets
3
+ * @abstract
4
+ */
5
+ export default class CrudSetBase extends CrudBase {
6
+ /**
7
+ * Get the foreign key name
8
+ * @returns {string} - Foreign key name
9
+ * @example
10
+ * api.fontFamilies.select(1).constructor.foreignKeyName === 'fontFamilyId'
11
+ */
12
+ static get foreignKeyName(): string;
13
+ /**
14
+ * Get items associated with the set
15
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
16
+ */
17
+ get items(): SimpleResourceProxy;
18
+ /**
19
+ * Child constructor
20
+ * @returns {Class<ResourceBase>} - Child constructor
21
+ * @abstract
22
+ * @protected
23
+ */
24
+ protected get _Child(): Class<ResourceBase>;
25
+ }
26
+ import CrudBase from "./CrudBase";
27
+ //# sourceMappingURL=CrudSetBase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CrudSetBase.d.ts","sourceRoot":"","sources":["../../../src/resources/base/CrudSetBase.js"],"names":[],"mappings":"AAoCA;;;GAGG;AACH;IAyBE;;;;;OAKG;IACH,oCAUC;IAvCD;;;OAGG;IACH,iCAOC;IAED;;;;;OAKG;IACH,4CAEC;CAmBF"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Items that are part of a set
3
+ * @abstract
4
+ */
5
+ export default class CrudSetItemBase extends CrudBase {
6
+ /**
7
+ * Get the parent key
8
+ * @returns {string} - Parent key
9
+ */
10
+ static get parentKey(): string;
11
+ get hasParent(): boolean;
12
+ /**
13
+ * Get the parent id
14
+ * @returns {number|undefined} - Parent number
15
+ */
16
+ get parentId(): number;
17
+ }
18
+ import CrudBase from "./CrudBase";
19
+ //# sourceMappingURL=CrudSetItemBase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CrudSetItemBase.d.ts","sourceRoot":"","sources":["../../../src/resources/base/CrudSetItemBase.js"],"names":[],"mappings":"AAoCA;;;GAGG;AACH;IAiCE;;;OAGG;IACH,+BAEC;IA1BD,yBAIC;IAED;;;OAGG;IACH,uBAQC;CASF"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Downloaded resource from the api
3
+ */
4
+ export default class DownloadedResource {
5
+ /**
6
+ * Build instance from response
7
+ * @param {Response} response - Response
8
+ * @returns {DownloadedResource} - Instance
9
+ */
10
+ static fromResponse(response: Response): DownloadedResource;
11
+ /**
12
+ *
13
+ * @param {ArrayBuffer|Buffer} data - Data
14
+ * @param {string} [type=application/octet-stream] - Mime-type
15
+ * @param {string} [fileName=Untitled] - File name
16
+ */
17
+ constructor(data: ArrayBuffer | Buffer, type?: string, fileName?: string);
18
+ _data: ArrayBuffer | Buffer;
19
+ _type: string;
20
+ _fileName: string;
21
+ /**
22
+ * In Nodejs it will return a {@link Buffer} and in the browser it will respond with a {@link ArrayBuffer}
23
+ * @returns {ArrayBuffer|Buffer} - Resource data
24
+ */
25
+ get data(): ArrayBuffer | Buffer;
26
+ /**
27
+ * Resource mime-type
28
+ * @return {string} - Mime-type
29
+ */
30
+ get type(): string;
31
+ /**
32
+ * Resource file name, if available
33
+ * @return {string} - File name
34
+ */
35
+ get fileName(): string;
36
+ /**
37
+ * Get the size of the data
38
+ * @return {Number} - Size in bytes
39
+ */
40
+ get size(): number;
41
+ /**
42
+ * Create a object url
43
+ * The URL lifetime is tied to the document in the window on which it
44
+ * was created. The new object URL represents the resource.
45
+ * *Do not forget* to release the object urls once used.
46
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL
47
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL#Memory_management
48
+ * @return {string} - Object url
49
+ */
50
+ createObjectUrl(): string;
51
+ /**
52
+ * Create a blob from the resource
53
+ * @returns {Blob}
54
+ */
55
+ createBlob(): Blob;
56
+ /**
57
+ * Get base64-encoded data uri
58
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
59
+ * @returns {string} - Data uri
60
+ */
61
+ toDataUri(): string;
62
+ /**
63
+ * Base64 encode data
64
+ * @returns {string} - Base64 encoded data
65
+ */
66
+ toBase64(): string;
67
+ /**
68
+ * @inheritDoc
69
+ */
70
+ toString(): string;
71
+ }
72
+ //# sourceMappingURL=DownloadedResource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DownloadedResource.d.ts","sourceRoot":"","sources":["../../../src/resources/base/DownloadedResource.js"],"names":[],"mappings":"AAmCA;;GAEG;AACH;IAaE;;;;OAIG;IACH,8BAHW,QAAQ,GACN,kBAAkB,CA4B9B;IA3CD;;;;;OAKG;IACH,kBAJW,WAAW,GAAC,MAAM,SAClB,MAAM,aACN,MAAM,EAMhB;IAHC,4BAAiB;IACjB,cAAiB;IACjB,kBAAyB;IAoC3B;;;OAGG;IACH,iCAEC;IAED;;;OAGG;IACH,mBAEC;IAED;;;OAGG;IACH,uBAEC;IAED;;;OAGG;IACH,mBAEC;IAED;;;;;;;;OAQG;IACH,mBAFY,MAAM,CAQjB;IAED;;;OAGG;IACH,cAFa,IAAI,CAIhB;IAED;;;;OAIG;IACH,aAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,YAFa,MAAM,CAIlB;IAED;;OAEG;IACH,mBAEC;CACF"}
@@ -0,0 +1,162 @@
1
+ /**
2
+ * Resource base
3
+ * @abstract
4
+ */
5
+ export default class ResourceBase {
6
+ /**
7
+ * Resource path template
8
+ * @returns {String} - Path template
9
+ */
10
+ static get resourcePath(): string;
11
+ /**
12
+ * Resource name
13
+ * @returns {String} - Resource name
14
+ * @abstract
15
+ */
16
+ static get resourceName(): string;
17
+ /**
18
+ * Returns the url key of the resource
19
+ * @returns {String} - Resource key
20
+ */
21
+ static get resourceUrlKey(): string;
22
+ /**
23
+ * Protected read-only fields
24
+ * @returns {Array<string>} - Array containing protected read-only fields
25
+ * @protected
26
+ */
27
+ protected static get protectedFields(): string[];
28
+ /**
29
+ * Returns if the resource is readonly
30
+ * @returns {boolean} - Readonly
31
+ */
32
+ static get readonly(): boolean;
33
+ /**
34
+ * @param {Mapcreator} api - Api instance
35
+ * @param {Object<String, *>} data - Item data
36
+ */
37
+ constructor(api: Mapcreator, data?: any);
38
+ /**
39
+ * Set the api instance
40
+ * @param {Mapcreator} value - Api instance
41
+ */
42
+ set api(arg: Mapcreator);
43
+ /**
44
+ * Get api instance
45
+ * @returns {Mapcreator} - Api instance
46
+ */
47
+ get api(): Mapcreator;
48
+ _baseProperties: any;
49
+ _properties: {};
50
+ _api: Mapcreator;
51
+ _knownFields: string[];
52
+ /**
53
+ * Moves new fields to this._properties and turns them into a getter/setter
54
+ * @protected
55
+ */
56
+ protected _updateProperties(): void;
57
+ /**
58
+ * Clean up instance and commit all changes locally.
59
+ * This means that any changed fields will be marked
60
+ * as unchanged whilst keeping their new values. The
61
+ * changes will not be saved.
62
+ */
63
+ sanitize(): void;
64
+ /**
65
+ * Resets model instance to it's original state
66
+ * @param {Array<string>|string|null} [fields=null] - Fields to reset, defaults to all fields
67
+ */
68
+ reset(fields?: Array<string> | string | null): void;
69
+ /**
70
+ * Clone the object
71
+ * @returns {ResourceBase} - Exact clone of the object
72
+ */
73
+ clone(): ResourceBase;
74
+ /**
75
+ * Refresh the resource by requesting it from the server again
76
+ * @param {Boolean} updateSelf - Update the current instance
77
+ * @returns {CancelablePromise<ResourceBase>} - Refreshed instance
78
+ * @throws {ApiError} - If the api returns errors
79
+ */
80
+ refresh(updateSelf?: boolean): CancelablePromise<ResourceBase>;
81
+ /**
82
+ * Create proxy for property
83
+ * @param {string} key - property key
84
+ * @private
85
+ */
86
+ private _applyProperty;
87
+ /**
88
+ * Guess type based on property name
89
+ * @param {string} name - Field name
90
+ * @param {*} value - Field Value
91
+ * @protected
92
+ * @returns {*} - Original or converted value
93
+ */
94
+ protected _guessType(name: string, value: any): any;
95
+ /**
96
+ * If the resource can be owned by an organisation
97
+ * @returns {boolean} - Can be owned by an organisation
98
+ */
99
+ get ownable(): boolean;
100
+ /**
101
+ * Auto generated resource url
102
+ * @returns {string} - Resource url
103
+ */
104
+ get url(): string;
105
+ _url: string;
106
+ /**
107
+ * Auto generated Resource base url
108
+ * @returns {string} - Resource base url
109
+ */
110
+ get baseUrl(): string;
111
+ /**
112
+ * List fields that contain object data
113
+ * @returns {Array<String>} - A list of fields
114
+ */
115
+ get fieldNames(): string[];
116
+ /**
117
+ * String representation of the resource, similar to Python's __repr__
118
+ * @returns {string} - Resource name and id
119
+ */
120
+ toString(): string;
121
+ /**
122
+ * Transform instance to object
123
+ * @param {boolean} [camelCaseKeys=false] - camelCase object keys
124
+ * @returns {{}} - Object
125
+ */
126
+ toObject(camelCaseKeys?: boolean): {};
127
+ /**
128
+ * Macro for resource listing
129
+ * @param {string|Class<ResourceBase>} Target - Target object
130
+ * @param {?String} url - Target url, if null it will guess
131
+ * @param {object} seedData - Internal use, used for seeding SimpleResourceProxy::new
132
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
133
+ * @protected
134
+ */
135
+ protected _proxyResourceList(Target: string | Class<ResourceBase>, url?: string | null, seedData?: object): SimpleResourceProxy;
136
+ /**
137
+ * Static proxy generation
138
+ * @param {string|Class} Target - Constructor or url
139
+ * @param {Class?} Constructor - Constructor for a resource that the results should be cast to
140
+ * @param {Object<string, *>} seedData - Optional data to seed the resolved resources
141
+ * @returns {SimpleResourceProxy} - A proxy for accessing the resource
142
+ * @example
143
+ * user.static('jobs').lister();
144
+ *
145
+ * @example
146
+ * class FooBar extends ResourceBase {
147
+ * static get resourceName() {
148
+ * return 'custom';
149
+ * }
150
+ * }
151
+ *
152
+ * api.static(FooBar)
153
+ * .get(1)
154
+ * .then(console.log);
155
+ */
156
+ static(Target: string | Class, Constructor?: Class, seedData?: {
157
+ [x: string]: any;
158
+ }): SimpleResourceProxy;
159
+ }
160
+ import Mapcreator from "../../Mapcreator";
161
+ import SimpleResourceProxy from "../../proxy/SimpleResourceProxy";
162
+ //# sourceMappingURL=ResourceBase.d.ts.map