@esri/solution-common 3.0.0 → 3.1.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 (261) hide show
  1. package/dist/esm/featureServiceHelpers.js +20 -2
  2. package/dist/esm/featureServiceHelpers.js.map +1 -1
  3. package/dist/esm/resourceHelpers.d.ts +3 -2
  4. package/dist/esm/resourceHelpers.js +4 -3
  5. package/dist/esm/resourceHelpers.js.map +1 -1
  6. package/dist/esm/resources/copyAssociatedFiles.d.ts +17 -2
  7. package/dist/esm/resources/copyAssociatedFiles.js +106 -42
  8. package/dist/esm/resources/copyAssociatedFiles.js.map +1 -1
  9. package/dist/esm/resources/copyResourceIntoZip.js +8 -1
  10. package/dist/esm/resources/copyResourceIntoZip.js.map +1 -1
  11. package/dist/esm/resources/getItemResourcesPaths.js +9 -2
  12. package/dist/esm/resources/getItemResourcesPaths.js.map +1 -1
  13. package/package.json +3 -3
  14. package/dist/node/completeItem.d.ts +0 -29
  15. package/dist/node/completeItem.js +0 -82
  16. package/dist/node/completeItem.js.map +0 -1
  17. package/dist/node/create-hub-request-options.d.ts +0 -29
  18. package/dist/node/create-hub-request-options.js +0 -64
  19. package/dist/node/create-hub-request-options.js.map +0 -1
  20. package/dist/node/deleteHelpers/deleteEmptyGroups.d.ts +0 -24
  21. package/dist/node/deleteHelpers/deleteEmptyGroups.js +0 -42
  22. package/dist/node/deleteHelpers/deleteEmptyGroups.js.map +0 -1
  23. package/dist/node/deleteHelpers/deleteGroupIfEmpty.d.ts +0 -27
  24. package/dist/node/deleteHelpers/deleteGroupIfEmpty.js +0 -97
  25. package/dist/node/deleteHelpers/deleteGroupIfEmpty.js.map +0 -1
  26. package/dist/node/deleteHelpers/deleteSolutionContents.d.ts +0 -38
  27. package/dist/node/deleteHelpers/deleteSolutionContents.js +0 -130
  28. package/dist/node/deleteHelpers/deleteSolutionContents.js.map +0 -1
  29. package/dist/node/deleteHelpers/deleteSolutionFolder.d.ts +0 -29
  30. package/dist/node/deleteHelpers/deleteSolutionFolder.js +0 -79
  31. package/dist/node/deleteHelpers/deleteSolutionFolder.js.map +0 -1
  32. package/dist/node/deleteHelpers/deleteSolutionItem.d.ts +0 -30
  33. package/dist/node/deleteHelpers/deleteSolutionItem.js +0 -54
  34. package/dist/node/deleteHelpers/deleteSolutionItem.js.map +0 -1
  35. package/dist/node/deleteHelpers/index.d.ts +0 -22
  36. package/dist/node/deleteHelpers/index.js +0 -26
  37. package/dist/node/deleteHelpers/index.js.map +0 -1
  38. package/dist/node/deleteHelpers/reconstructBuildOrderIds.d.ts +0 -27
  39. package/dist/node/deleteHelpers/reconstructBuildOrderIds.js +0 -34
  40. package/dist/node/deleteHelpers/reconstructBuildOrderIds.js.map +0 -1
  41. package/dist/node/deleteHelpers/removeItems.d.ts +0 -34
  42. package/dist/node/deleteHelpers/removeItems.js +0 -112
  43. package/dist/node/deleteHelpers/removeItems.js.map +0 -1
  44. package/dist/node/deleteHelpers/reportProgress.d.ts +0 -27
  45. package/dist/node/deleteHelpers/reportProgress.js +0 -46
  46. package/dist/node/deleteHelpers/reportProgress.js.map +0 -1
  47. package/dist/node/deleteSolution.d.ts +0 -55
  48. package/dist/node/deleteSolution.js +0 -107
  49. package/dist/node/deleteSolution.js.map +0 -1
  50. package/dist/node/dependencies.d.ts +0 -26
  51. package/dist/node/dependencies.js +0 -171
  52. package/dist/node/dependencies.js.map +0 -1
  53. package/dist/node/featureServiceHelpers.d.ts +0 -791
  54. package/dist/node/featureServiceHelpers.js +0 -2403
  55. package/dist/node/featureServiceHelpers.js.map +0 -1
  56. package/dist/node/generalHelpers.d.ts +0 -372
  57. package/dist/node/generalHelpers.js +0 -842
  58. package/dist/node/generalHelpers.js.map +0 -1
  59. package/dist/node/get-subscription-info.d.ts +0 -27
  60. package/dist/node/get-subscription-info.js +0 -39
  61. package/dist/node/get-subscription-info.js.map +0 -1
  62. package/dist/node/getDeletableSolutionInfo.d.ts +0 -29
  63. package/dist/node/getDeletableSolutionInfo.js +0 -53
  64. package/dist/node/getDeletableSolutionInfo.js.map +0 -1
  65. package/dist/node/getItemTypeAbbrev.d.ts +0 -19
  66. package/dist/node/getItemTypeAbbrev.js +0 -184
  67. package/dist/node/getItemTypeAbbrev.js.map +0 -1
  68. package/dist/node/getSolutionSummary.d.ts +0 -27
  69. package/dist/node/getSolutionSummary.js +0 -101
  70. package/dist/node/getSolutionSummary.js.map +0 -1
  71. package/dist/node/index.d.ts +0 -44
  72. package/dist/node/index.js +0 -48
  73. package/dist/node/index.js.map +0 -1
  74. package/dist/node/interfaces.d.ts +0 -1321
  75. package/dist/node/interfaces.js +0 -75
  76. package/dist/node/interfaces.js.map +0 -1
  77. package/dist/node/libConnectors.d.ts +0 -73
  78. package/dist/node/libConnectors.js +0 -115
  79. package/dist/node/libConnectors.js.map +0 -1
  80. package/dist/node/migrations/apply-schema.d.ts +0 -24
  81. package/dist/node/migrations/apply-schema.js +0 -36
  82. package/dist/node/migrations/apply-schema.js.map +0 -1
  83. package/dist/node/migrations/is-legacy-solution.d.ts +0 -24
  84. package/dist/node/migrations/is-legacy-solution.js +0 -40
  85. package/dist/node/migrations/is-legacy-solution.js.map +0 -1
  86. package/dist/node/migrations/upgrade-three-dot-one.d.ts +0 -27
  87. package/dist/node/migrations/upgrade-three-dot-one.js +0 -49
  88. package/dist/node/migrations/upgrade-three-dot-one.js.map +0 -1
  89. package/dist/node/migrations/upgrade-three-dot-zero.d.ts +0 -27
  90. package/dist/node/migrations/upgrade-three-dot-zero.js +0 -43
  91. package/dist/node/migrations/upgrade-three-dot-zero.js.map +0 -1
  92. package/dist/node/migrations/upgrade-two-dot-five.d.ts +0 -24
  93. package/dist/node/migrations/upgrade-two-dot-five.js +0 -73
  94. package/dist/node/migrations/upgrade-two-dot-five.js.map +0 -1
  95. package/dist/node/migrations/upgrade-two-dot-four.d.ts +0 -24
  96. package/dist/node/migrations/upgrade-two-dot-four.js +0 -72
  97. package/dist/node/migrations/upgrade-two-dot-four.js.map +0 -1
  98. package/dist/node/migrations/upgrade-two-dot-one.d.ts +0 -7
  99. package/dist/node/migrations/upgrade-two-dot-one.js +0 -39
  100. package/dist/node/migrations/upgrade-two-dot-one.js.map +0 -1
  101. package/dist/node/migrations/upgrade-two-dot-seven.d.ts +0 -23
  102. package/dist/node/migrations/upgrade-two-dot-seven.js +0 -58
  103. package/dist/node/migrations/upgrade-two-dot-seven.js.map +0 -1
  104. package/dist/node/migrations/upgrade-two-dot-six.d.ts +0 -27
  105. package/dist/node/migrations/upgrade-two-dot-six.js +0 -61
  106. package/dist/node/migrations/upgrade-two-dot-six.js.map +0 -1
  107. package/dist/node/migrations/upgrade-two-dot-three.d.ts +0 -23
  108. package/dist/node/migrations/upgrade-two-dot-three.js +0 -55
  109. package/dist/node/migrations/upgrade-two-dot-three.js.map +0 -1
  110. package/dist/node/migrations/upgrade-two-dot-two.d.ts +0 -23
  111. package/dist/node/migrations/upgrade-two-dot-two.js +0 -58
  112. package/dist/node/migrations/upgrade-two-dot-two.js.map +0 -1
  113. package/dist/node/migrations/upgrade-two-dot-zero.d.ts +0 -44
  114. package/dist/node/migrations/upgrade-two-dot-zero.js +0 -95
  115. package/dist/node/migrations/upgrade-two-dot-zero.js.map +0 -1
  116. package/dist/node/migrator.d.ts +0 -25
  117. package/dist/node/migrator.js +0 -77
  118. package/dist/node/migrator.js.map +0 -1
  119. package/dist/node/polyfills.d.ts +0 -40
  120. package/dist/node/polyfills.js +0 -98
  121. package/dist/node/polyfills.js.map +0 -1
  122. package/dist/node/resourceHelpers.d.ts +0 -190
  123. package/dist/node/resourceHelpers.js +0 -390
  124. package/dist/node/resourceHelpers.js.map +0 -1
  125. package/dist/node/resources/add-resource-from-blob.d.ts +0 -26
  126. package/dist/node/resources/add-resource-from-blob.js +0 -52
  127. package/dist/node/resources/add-resource-from-blob.js.map +0 -1
  128. package/dist/node/resources/addMetadataFromBlob.d.ts +0 -25
  129. package/dist/node/resources/addMetadataFromBlob.js +0 -43
  130. package/dist/node/resources/addMetadataFromBlob.js.map +0 -1
  131. package/dist/node/resources/convert-item-resource-to-storage-resource.d.ts +0 -32
  132. package/dist/node/resources/convert-item-resource-to-storage-resource.js +0 -70
  133. package/dist/node/resources/convert-item-resource-to-storage-resource.js.map +0 -1
  134. package/dist/node/resources/convert-storage-resource-to-item-resource.d.ts +0 -29
  135. package/dist/node/resources/convert-storage-resource-to-item-resource.js +0 -70
  136. package/dist/node/resources/convert-storage-resource-to-item-resource.js.map +0 -1
  137. package/dist/node/resources/copyAssociatedFiles.d.ts +0 -52
  138. package/dist/node/resources/copyAssociatedFiles.js +0 -237
  139. package/dist/node/resources/copyAssociatedFiles.js.map +0 -1
  140. package/dist/node/resources/copyDataIntoItem.d.ts +0 -33
  141. package/dist/node/resources/copyDataIntoItem.js +0 -63
  142. package/dist/node/resources/copyDataIntoItem.js.map +0 -1
  143. package/dist/node/resources/copyMetadataIntoItem.d.ts +0 -26
  144. package/dist/node/resources/copyMetadataIntoItem.js +0 -46
  145. package/dist/node/resources/copyMetadataIntoItem.js.map +0 -1
  146. package/dist/node/resources/copyResourceIntoZip.d.ts +0 -33
  147. package/dist/node/resources/copyResourceIntoZip.js +0 -71
  148. package/dist/node/resources/copyResourceIntoZip.js.map +0 -1
  149. package/dist/node/resources/copyZipIntoItem.d.ts +0 -25
  150. package/dist/node/resources/copyZipIntoItem.js +0 -54
  151. package/dist/node/resources/copyZipIntoItem.js.map +0 -1
  152. package/dist/node/resources/createCopyResults.d.ts +0 -25
  153. package/dist/node/resources/createCopyResults.js +0 -36
  154. package/dist/node/resources/createCopyResults.js.map +0 -1
  155. package/dist/node/resources/get-blob.d.ts +0 -26
  156. package/dist/node/resources/get-blob.js +0 -27
  157. package/dist/node/resources/get-blob.js.map +0 -1
  158. package/dist/node/resources/getItemResourcesFilesFromPaths.d.ts +0 -24
  159. package/dist/node/resources/getItemResourcesFilesFromPaths.js +0 -49
  160. package/dist/node/resources/getItemResourcesFilesFromPaths.js.map +0 -1
  161. package/dist/node/resources/getItemResourcesPaths.d.ts +0 -26
  162. package/dist/node/resources/getItemResourcesPaths.js +0 -66
  163. package/dist/node/resources/getItemResourcesPaths.js.map +0 -1
  164. package/dist/node/resources/index.d.ts +0 -29
  165. package/dist/node/resources/index.js +0 -33
  166. package/dist/node/resources/index.js.map +0 -1
  167. package/dist/node/resources/solution-resource.d.ts +0 -35
  168. package/dist/node/resources/solution-resource.js +0 -31
  169. package/dist/node/resources/solution-resource.js.map +0 -1
  170. package/dist/node/resources/transform-resource-paths-to-solution-resources.d.ts +0 -56
  171. package/dist/node/resources/transform-resource-paths-to-solution-resources.js +0 -146
  172. package/dist/node/resources/transform-resource-paths-to-solution-resources.js.map +0 -1
  173. package/dist/node/restHelpers.d.ts +0 -585
  174. package/dist/node/restHelpers.js +0 -1887
  175. package/dist/node/restHelpers.js.map +0 -1
  176. package/dist/node/restHelpersGet.d.ts +0 -288
  177. package/dist/node/restHelpersGet.js +0 -804
  178. package/dist/node/restHelpersGet.js.map +0 -1
  179. package/dist/node/sharing/index.d.ts +0 -16
  180. package/dist/node/sharing/index.js +0 -20
  181. package/dist/node/sharing/index.js.map +0 -1
  182. package/dist/node/sharing/share-item-to-groups.d.ts +0 -26
  183. package/dist/node/sharing/share-item-to-groups.js +0 -44
  184. package/dist/node/sharing/share-item-to-groups.js.map +0 -1
  185. package/dist/node/templatization.d.ts +0 -139
  186. package/dist/node/templatization.js +0 -314
  187. package/dist/node/templatization.js.map +0 -1
  188. package/dist/node/trackingHelpers.d.ts +0 -116
  189. package/dist/node/trackingHelpers.js +0 -217
  190. package/dist/node/trackingHelpers.js.map +0 -1
  191. package/dist/node/velocityHelpers.d.ts +0 -57
  192. package/dist/node/velocityHelpers.js +0 -135
  193. package/dist/node/velocityHelpers.js.map +0 -1
  194. package/dist/node/workforceHelpers.d.ts +0 -115
  195. package/dist/node/workforceHelpers.js +0 -747
  196. package/dist/node/workforceHelpers.js.map +0 -1
  197. package/dist/umd/common.umd.js +0 -15471
  198. package/dist/umd/common.umd.js.map +0 -1
  199. package/dist/umd/common.umd.min.js +0 -19
  200. package/dist/umd/common.umd.min.js.map +0 -1
  201. package/dist/umd/src/completeItem.d.ts +0 -29
  202. package/dist/umd/src/create-hub-request-options.d.ts +0 -29
  203. package/dist/umd/src/deleteHelpers/deleteEmptyGroups.d.ts +0 -24
  204. package/dist/umd/src/deleteHelpers/deleteGroupIfEmpty.d.ts +0 -27
  205. package/dist/umd/src/deleteHelpers/deleteSolutionContents.d.ts +0 -38
  206. package/dist/umd/src/deleteHelpers/deleteSolutionFolder.d.ts +0 -29
  207. package/dist/umd/src/deleteHelpers/deleteSolutionItem.d.ts +0 -30
  208. package/dist/umd/src/deleteHelpers/index.d.ts +0 -22
  209. package/dist/umd/src/deleteHelpers/reconstructBuildOrderIds.d.ts +0 -27
  210. package/dist/umd/src/deleteHelpers/removeItems.d.ts +0 -34
  211. package/dist/umd/src/deleteHelpers/reportProgress.d.ts +0 -27
  212. package/dist/umd/src/deleteSolution.d.ts +0 -55
  213. package/dist/umd/src/dependencies.d.ts +0 -26
  214. package/dist/umd/src/featureServiceHelpers.d.ts +0 -791
  215. package/dist/umd/src/generalHelpers.d.ts +0 -372
  216. package/dist/umd/src/get-subscription-info.d.ts +0 -27
  217. package/dist/umd/src/getDeletableSolutionInfo.d.ts +0 -29
  218. package/dist/umd/src/getItemTypeAbbrev.d.ts +0 -19
  219. package/dist/umd/src/getSolutionSummary.d.ts +0 -27
  220. package/dist/umd/src/index.d.ts +0 -44
  221. package/dist/umd/src/interfaces.d.ts +0 -1321
  222. package/dist/umd/src/libConnectors.d.ts +0 -73
  223. package/dist/umd/src/migrations/apply-schema.d.ts +0 -24
  224. package/dist/umd/src/migrations/is-legacy-solution.d.ts +0 -24
  225. package/dist/umd/src/migrations/upgrade-three-dot-one.d.ts +0 -27
  226. package/dist/umd/src/migrations/upgrade-three-dot-zero.d.ts +0 -27
  227. package/dist/umd/src/migrations/upgrade-two-dot-five.d.ts +0 -24
  228. package/dist/umd/src/migrations/upgrade-two-dot-four.d.ts +0 -24
  229. package/dist/umd/src/migrations/upgrade-two-dot-one.d.ts +0 -7
  230. package/dist/umd/src/migrations/upgrade-two-dot-seven.d.ts +0 -23
  231. package/dist/umd/src/migrations/upgrade-two-dot-six.d.ts +0 -27
  232. package/dist/umd/src/migrations/upgrade-two-dot-three.d.ts +0 -23
  233. package/dist/umd/src/migrations/upgrade-two-dot-two.d.ts +0 -23
  234. package/dist/umd/src/migrations/upgrade-two-dot-zero.d.ts +0 -44
  235. package/dist/umd/src/migrator.d.ts +0 -25
  236. package/dist/umd/src/polyfills.d.ts +0 -40
  237. package/dist/umd/src/resourceHelpers.d.ts +0 -190
  238. package/dist/umd/src/resources/add-resource-from-blob.d.ts +0 -26
  239. package/dist/umd/src/resources/addMetadataFromBlob.d.ts +0 -25
  240. package/dist/umd/src/resources/convert-item-resource-to-storage-resource.d.ts +0 -32
  241. package/dist/umd/src/resources/convert-storage-resource-to-item-resource.d.ts +0 -29
  242. package/dist/umd/src/resources/copyAssociatedFiles.d.ts +0 -52
  243. package/dist/umd/src/resources/copyDataIntoItem.d.ts +0 -33
  244. package/dist/umd/src/resources/copyMetadataIntoItem.d.ts +0 -26
  245. package/dist/umd/src/resources/copyResourceIntoZip.d.ts +0 -33
  246. package/dist/umd/src/resources/copyZipIntoItem.d.ts +0 -25
  247. package/dist/umd/src/resources/createCopyResults.d.ts +0 -25
  248. package/dist/umd/src/resources/get-blob.d.ts +0 -26
  249. package/dist/umd/src/resources/getItemResourcesFilesFromPaths.d.ts +0 -24
  250. package/dist/umd/src/resources/getItemResourcesPaths.d.ts +0 -26
  251. package/dist/umd/src/resources/index.d.ts +0 -29
  252. package/dist/umd/src/resources/solution-resource.d.ts +0 -35
  253. package/dist/umd/src/resources/transform-resource-paths-to-solution-resources.d.ts +0 -56
  254. package/dist/umd/src/restHelpers.d.ts +0 -585
  255. package/dist/umd/src/restHelpersGet.d.ts +0 -288
  256. package/dist/umd/src/sharing/index.d.ts +0 -16
  257. package/dist/umd/src/sharing/share-item-to-groups.d.ts +0 -26
  258. package/dist/umd/src/templatization.d.ts +0 -139
  259. package/dist/umd/src/trackingHelpers.d.ts +0 -116
  260. package/dist/umd/src/velocityHelpers.d.ts +0 -57
  261. package/dist/umd/src/workforceHelpers.d.ts +0 -115
@@ -1,95 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports._convertIndicatorField = exports._convertIndicatorToDefinition = exports._convertIndicatorsToDefinitions = exports._upgradeTwoDotZero = void 0;
4
- /** @license
5
- * Copyright 2020 Esri
6
- *
7
- * Licensed under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
18
- */
19
- const hub_common_1 = require("@esri/hub-common");
20
- /**
21
- * Convert indicator "definitions" from the CAS style to the Indicator schema
22
- * see https://github.com/ArcGIS/Hub/blob/master/indicators.md
23
- *
24
- * @param model
25
- * @private
26
- */
27
- function _upgradeTwoDotZero(model) {
28
- if ((0, hub_common_1.getProp)(model, "item.properties.schemaVersion") >= 2) {
29
- return model;
30
- }
31
- // get the indicators from the .configurationSettings...
32
- const clone = (0, hub_common_1.cloneObject)(model);
33
- const configSettings = (0, hub_common_1.getProp)(clone, "data.configurationSettings") || [];
34
- const indicatorsHash = configSettings.find((e) => e.category === "Indicators");
35
- clone.data.indicators = _convertIndicatorsToDefinitions(indicatorsHash);
36
- // remove CAS structure
37
- delete clone.data.configurationSettings;
38
- // set the schemaVersion...
39
- clone.item.properties.schemaVersion = 2;
40
- return clone;
41
- }
42
- exports._upgradeTwoDotZero = _upgradeTwoDotZero;
43
- /**
44
- * Given the Indicators entry from a CAS configurationSettings array,
45
- * convert to an indicators object in the new schema
46
- *
47
- * @private
48
- */
49
- function _convertIndicatorsToDefinitions(indicatorsHash = {}) {
50
- // the incoming structure should have a .fields property, and what we want will be in there...
51
- if (!indicatorsHash.fields || !Array.isArray(indicatorsHash.fields)) {
52
- indicatorsHash.fields = [];
53
- }
54
- const defs = indicatorsHash.fields.map(exports._convertIndicatorToDefinition);
55
- // now we need to create an object which has props for each def
56
- return defs;
57
- }
58
- exports._convertIndicatorsToDefinitions = _convertIndicatorsToDefinitions;
59
- /**
60
- * Convert a CAS formatted indicator to the .definition in the new schama
61
- *
62
- * @private
63
- */
64
- const _convertIndicatorToDefinition = function (ind) {
65
- const def = {
66
- id: ind.fieldName,
67
- type: "Data",
68
- name: ind.label || ind.fieldName,
69
- optional: ind.optional || false,
70
- definition: {
71
- description: ind.label || ind.fieldName,
72
- supportedTypes: [].concat(ind.layerOptions.supportedTypes),
73
- geometryTypes: [].concat(ind.layerOptions.geometryTypes),
74
- fields: ind.fields.map(exports._convertIndicatorField)
75
- }
76
- };
77
- return def;
78
- };
79
- exports._convertIndicatorToDefinition = _convertIndicatorToDefinition;
80
- /**
81
- * Convert the CAS formatted "field" into the new schema
82
- *
83
- * @private
84
- */
85
- const _convertIndicatorField = function (field) {
86
- return {
87
- id: field.fieldName,
88
- name: field.label,
89
- optional: field.optional || false,
90
- description: field.tooltip,
91
- supportedTypes: [].concat(field.supportedTypes)
92
- };
93
- };
94
- exports._convertIndicatorField = _convertIndicatorField;
95
- //# sourceMappingURL=upgrade-two-dot-zero.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"upgrade-two-dot-zero.js","sourceRoot":"","sources":["../../../src/migrations/upgrade-two-dot-zero.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,iDAAwD;AAExD;;;;;;GAMG;AACH,SAAgB,kBAAkB,CAAC,KAAU;IAC3C,IAAI,IAAA,oBAAO,EAAC,KAAK,EAAE,+BAA+B,CAAC,IAAI,CAAC,EAAE;QACxD,OAAO,KAAK,CAAC;KACd;IACD,wDAAwD;IACxD,MAAM,KAAK,GAAG,IAAA,wBAAW,EAAC,KAAK,CAAC,CAAC;IACjC,MAAM,cAAc,GAAG,IAAA,oBAAO,EAAC,KAAK,EAAE,4BAA4B,CAAC,IAAI,EAAE,CAAC;IAE1E,MAAM,cAAc,GAAG,cAAc,CAAC,IAAI,CACxC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,YAAY,CACxC,CAAC;IACF,KAAK,CAAC,IAAI,CAAC,UAAU,GAAG,+BAA+B,CAAC,cAAc,CAAC,CAAC;IACxE,uBAAuB;IACvB,OAAO,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC;IAExC,2BAA2B;IAC3B,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,GAAG,CAAC,CAAC;IACxC,OAAO,KAAK,CAAC;AACf,CAAC;AAlBD,gDAkBC;AAED;;;;;GAKG;AACH,SAAgB,+BAA+B,CAAC,iBAAsB,EAAE;IACtE,8FAA8F;IAC9F,IAAI,CAAC,cAAc,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE;QACnE,cAAc,CAAC,MAAM,GAAG,EAAE,CAAC;KAC5B;IACD,MAAM,IAAI,GAAG,cAAc,CAAC,MAAM,CAAC,GAAG,CAAC,qCAA6B,CAAC,CAAC;IACtE,+DAA+D;IAC/D,OAAO,IAAI,CAAC;AACd,CAAC;AARD,0EAQC;AAED;;;;GAIG;AACI,MAAM,6BAA6B,GAAG,UAAS,GAAQ;IAC5D,MAAM,GAAG,GAAG;QACV,EAAE,EAAE,GAAG,CAAC,SAAS;QACjB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,SAAS;QAChC,QAAQ,EAAE,GAAG,CAAC,QAAQ,IAAI,KAAK;QAC/B,UAAU,EAAE;YACV,WAAW,EAAE,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,SAAS;YACvC,cAAc,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,cAAc,CAAC;YAC1D,aAAa,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC;YACxD,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,8BAAsB,CAAC;SAC/C;KACF,CAAC;IACF,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAdW,QAAA,6BAA6B,iCAcxC;AAEF;;;;GAIG;AACI,MAAM,sBAAsB,GAAG,UAAS,KAAU;IACvD,OAAO;QACL,EAAE,EAAE,KAAK,CAAC,SAAS;QACnB,IAAI,EAAE,KAAK,CAAC,KAAK;QACjB,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,KAAK;QACjC,WAAW,EAAE,KAAK,CAAC,OAAO;QAC1B,cAAc,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC;KAChD,CAAC;AACJ,CAAC,CAAC;AARW,QAAA,sBAAsB,0BAQjC"}
@@ -1,25 +0,0 @@
1
- /** @license
2
- * Copyright 2018 Esri
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { ISolutionItem } from "./interfaces";
17
- export declare const CURRENT_SCHEMA_VERSION = 3;
18
- /**
19
- * Apply schema migrations to a Solution item
20
- * This system allows the schema of the Solution item to change over time
21
- * while abstracting those changes into a single set of functional transforms
22
- *
23
- * @param model ISolutionItem
24
- */
25
- export declare function migrateSchema(model: ISolutionItem): Promise<ISolutionItem>;
@@ -1,77 +0,0 @@
1
- "use strict";
2
- /** @license
3
- * Copyright 2018 Esri
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.migrateSchema = exports.CURRENT_SCHEMA_VERSION = void 0;
19
- const is_legacy_solution_1 = require("./migrations/is-legacy-solution");
20
- const apply_schema_1 = require("./migrations/apply-schema");
21
- const upgrade_two_dot_zero_1 = require("./migrations/upgrade-two-dot-zero");
22
- const upgrade_two_dot_one_1 = require("./migrations/upgrade-two-dot-one");
23
- const upgrade_two_dot_two_1 = require("./migrations/upgrade-two-dot-two");
24
- const upgrade_two_dot_three_1 = require("./migrations/upgrade-two-dot-three");
25
- const upgrade_two_dot_four_1 = require("./migrations/upgrade-two-dot-four");
26
- const upgrade_two_dot_five_1 = require("./migrations/upgrade-two-dot-five");
27
- const upgrade_two_dot_six_1 = require("./migrations/upgrade-two-dot-six");
28
- const upgrade_two_dot_seven_1 = require("./migrations/upgrade-two-dot-seven");
29
- const upgrade_three_dot_zero_1 = require("./migrations/upgrade-three-dot-zero");
30
- const hub_common_1 = require("@esri/hub-common");
31
- // Starting at 3.0 because Hub has been versioning Solution items up to 2.x
32
- exports.CURRENT_SCHEMA_VERSION = 3.0;
33
- /**
34
- * Apply schema migrations to a Solution item
35
- * This system allows the schema of the Solution item to change over time
36
- * while abstracting those changes into a single set of functional transforms
37
- *
38
- * @param model ISolutionItem
39
- */
40
- function migrateSchema(model) {
41
- // ensure properties
42
- if (!(0, hub_common_1.getProp)(model, "item.properties")) {
43
- model.item.properties = {};
44
- }
45
- const modelVersion = (0, hub_common_1.getProp)(model, "item.properties.schemaVersion");
46
- // if it's already on the current version, return it
47
- if (modelVersion === exports.CURRENT_SCHEMA_VERSION) {
48
- return Promise.resolve(model);
49
- }
50
- else {
51
- // check if this is a legacy solution created by Hub
52
- const isLegacy = (0, is_legacy_solution_1._isLegacySolution)(model);
53
- const schemaUpgrades = [];
54
- // if this is a Solution.js "native" item, it is already at 3.0
55
- if (!modelVersion && !isLegacy) {
56
- // apply the 3.0+ transforms
57
- // TEMP to allow merge to develop w/o breaking things
58
- schemaUpgrades.push(upgrade_three_dot_zero_1._upgradeThreeDotZero);
59
- // schemaUpgrades.push(_upgradeThreeDotZero, _upgradeThreeDotOne);
60
- }
61
- else {
62
- // Hub created a set of Solution items that are not 100% compatible
63
- // with the Solution.js deployer.
64
- schemaUpgrades.push(apply_schema_1._applySchema, upgrade_two_dot_zero_1._upgradeTwoDotZero, upgrade_two_dot_one_1._upgradeTwoDotOne, upgrade_two_dot_two_1._upgradeTwoDotTwo, upgrade_two_dot_three_1._upgradeTwoDotThree, upgrade_two_dot_four_1._upgradeTwoDotFour, upgrade_two_dot_five_1._upgradeTwoDotFive, upgrade_two_dot_six_1._upgradeTwoDotSix, upgrade_two_dot_seven_1._upgradeTwoDotSeven);
65
- // Apply the 3.x upgrades
66
- schemaUpgrades.push(upgrade_three_dot_zero_1._upgradeThreeDotZero
67
- // _upgradeThreeDotOne // Not ready for prod yet
68
- );
69
- }
70
- // Run any migrations serially. Since we start with a promise,
71
- // individual migrations are free to return either ISolutionItem
72
- // or Promise<ISolutionItem>
73
- return schemaUpgrades.reduce((promise, upgradeFn) => promise.then((updatedModel) => upgradeFn(updatedModel)), Promise.resolve(model));
74
- }
75
- }
76
- exports.migrateSchema = migrateSchema;
77
- //# sourceMappingURL=migrator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"migrator.js","sourceRoot":"","sources":["../../src/migrator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,wEAAoE;AACpE,4DAAyD;AACzD,4EAAuE;AACvE,0EAAqE;AACrE,0EAAqE;AACrE,8EAAyE;AACzE,4EAAuE;AACvE,4EAAuE;AACvE,0EAAqE;AACrE,8EAAyE;AACzE,gFAA2E;AAI3E,iDAA2C;AAE3C,2EAA2E;AAC9D,QAAA,sBAAsB,GAAG,GAAG,CAAC;AAE1C;;;;;;GAMG;AACH,SAAgB,aAAa,CAAC,KAAoB;IAChD,oBAAoB;IACpB,IAAI,CAAC,IAAA,oBAAO,EAAC,KAAK,EAAE,iBAAiB,CAAC,EAAE;QACtC,KAAK,CAAC,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;KAC5B;IAED,MAAM,YAAY,GAAG,IAAA,oBAAO,EAAC,KAAK,EAAE,+BAA+B,CAAC,CAAC;IACrE,oDAAoD;IACpD,IAAI,YAAY,KAAK,8BAAsB,EAAE;QAC3C,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;KAC/B;SAAM;QACL,oDAAoD;QACpD,MAAM,QAAQ,GAAG,IAAA,sCAAiB,EAAC,KAAK,CAAC,CAAC;QAC1C,MAAM,cAAc,GAAG,EAAE,CAAC;QAE1B,+DAA+D;QAC/D,IAAI,CAAC,YAAY,IAAI,CAAC,QAAQ,EAAE;YAC9B,4BAA4B;YAC5B,qDAAqD;YACrD,cAAc,CAAC,IAAI,CAAC,6CAAoB,CAAC,CAAC;YAC1C,kEAAkE;SACnE;aAAM;YACL,mEAAmE;YACnE,iCAAiC;YACjC,cAAc,CAAC,IAAI,CACjB,2BAAY,EACZ,yCAAkB,EAClB,uCAAiB,EACjB,uCAAiB,EACjB,2CAAmB,EACnB,yCAAkB,EAClB,yCAAkB,EAClB,uCAAiB,EACjB,2CAAmB,CACpB,CAAC;YACF,yBAAyB;YACzB,cAAc,CAAC,IAAI,CACjB,6CAAoB;YACpB,gDAAgD;aACjD,CAAC;SACH;QACD,8DAA8D;QAC9D,gEAAgE;QAChE,4BAA4B;QAC5B,OAAO,cAAc,CAAC,MAAM,CAC1B,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,CACrB,OAAO,CAAC,IAAI,CAAC,CAAC,YAA2B,EAAE,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,EACxE,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CACvB,CAAC;KACH;AACH,CAAC;AAlDD,sCAkDC"}
@@ -1,40 +0,0 @@
1
- /** @license
2
- * Copyright 2020 Esri
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- /**
17
- * Provides polyfill helper functions.
18
- *
19
- * @module polyfills
20
- */
21
- /**
22
- * Supplies Blob.text for Microsoft Legacy Edge
23
- *
24
- * @param blob Blob to read
25
- * @returns Promise resolving to blob's text
26
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob
27
- * @see https://developer.mozilla.org/en-US/docs/Web/API/FileReader
28
- */
29
- export declare function getBlobText(blob: Blob): Promise<string>;
30
- /**
31
- * Supplies the File constructor for Microsoft Legacy Edge.
32
- *
33
- * @param fileBits Contents for file
34
- * @param fileName Name for file
35
- * @param options Bucket of options, euch as `type` for the MIME type; defaults to empty string for `type`
36
- * @returns File or, for Microsoft Legacy Edge, Blob
37
- * @see https://developer.mozilla.org/en-US/docs/Web/API/File/File
38
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob
39
- */
40
- export declare function new_File(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File;
@@ -1,98 +0,0 @@
1
- "use strict";
2
- /** @license
3
- * Copyright 2020 Esri
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.new_File = exports.getBlobText = void 0;
19
- /**
20
- * Provides polyfill helper functions.
21
- *
22
- * @module polyfills
23
- */
24
- // ------------------------------------------------------------------------------------------------------------------ //
25
- /**
26
- * Supplies Blob.text for Microsoft Legacy Edge
27
- *
28
- * @param blob Blob to read
29
- * @returns Promise resolving to blob's text
30
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob
31
- * @see https://developer.mozilla.org/en-US/docs/Web/API/FileReader
32
- */
33
- function getBlobText(blob) {
34
- let textPromise;
35
- /* istanbul ignore else */
36
- if (typeof blob.text !== "undefined") {
37
- // Modern browser
38
- textPromise = blob.text();
39
- }
40
- else {
41
- // Microsoft Legacy Edge
42
- textPromise = new Promise((resolve, reject) => {
43
- const reader = new FileReader();
44
- reader.onload = function (event) {
45
- if (event.target && event.target.result) {
46
- // event.target.result is typed as "string | ArrayBuffer | null", but for the readAsText function,
47
- // the result is a string
48
- resolve(event.target.result);
49
- }
50
- else {
51
- resolve("");
52
- }
53
- };
54
- reader.onerror = function (event) {
55
- reject(event);
56
- };
57
- reader.readAsText(blob);
58
- });
59
- }
60
- return textPromise;
61
- }
62
- exports.getBlobText = getBlobText;
63
- /**
64
- * Supplies the File constructor for Microsoft Legacy Edge.
65
- *
66
- * @param fileBits Contents for file
67
- * @param fileName Name for file
68
- * @param options Bucket of options, euch as `type` for the MIME type; defaults to empty string for `type`
69
- * @returns File or, for Microsoft Legacy Edge, Blob
70
- * @see https://developer.mozilla.org/en-US/docs/Web/API/File/File
71
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob
72
- */
73
- function new_File(fileBits, fileName, options) {
74
- let file;
75
- try {
76
- // Modern browser
77
- file = new File(fileBits, fileName, options);
78
- }
79
- catch (error) {
80
- // Microsoft Legacy Edge
81
- /* istanbul ignore next */
82
- file = (function () {
83
- if (typeof options === "undefined") {
84
- // Microsoft Legacy Edge fails in karma if options is not defined
85
- options = {
86
- type: ""
87
- };
88
- }
89
- const blob = new Blob(fileBits, options);
90
- blob.lastModified = new Date();
91
- blob.name = fileName;
92
- return blob;
93
- })();
94
- }
95
- return file;
96
- }
97
- exports.new_File = new_File;
98
- //# sourceMappingURL=polyfills.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"polyfills.js","sourceRoot":"","sources":["../../src/polyfills.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;;;GAIG;AAEH,wHAAwH;AAExH;;;;;;;GAOG;AACH,SAAgB,WAAW,CAAC,IAAU;IACpC,IAAI,WAA4B,CAAC;IAEjC,0BAA0B;IAC1B,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,WAAW,EAAE;QACpC,iBAAiB;QACjB,WAAW,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;KAC3B;SAAM;QACL,wBAAwB;QACxB,WAAW,GAAG,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACpD,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;YAChC,MAAM,CAAC,MAAM,GAAG,UAAS,KAAK;gBAC5B,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE;oBACvC,kGAAkG;oBAClG,yBAAyB;oBACzB,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAgB,CAAC,CAAC;iBACxC;qBAAM;oBACL,OAAO,CAAC,EAAE,CAAC,CAAC;iBACb;YACH,CAAC,CAAC;YACF,MAAM,CAAC,OAAO,GAAG,UAAS,KAAK;gBAC7B,MAAM,CAAC,KAAK,CAAC,CAAC;YAChB,CAAC,CAAC;YACF,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;KACJ;IAED,OAAO,WAAW,CAAC;AACrB,CAAC;AA5BD,kCA4BC;AAED;;;;;;;;;GASG;AACH,SAAgB,QAAQ,CACtB,QAAoB,EACpB,QAAgB,EAChB,OAAyB;IAEzB,IAAI,IAAU,CAAC;IAEf,IAAI;QACF,iBAAiB;QACjB,IAAI,GAAG,IAAI,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;KAC9C;IAAC,OAAO,KAAK,EAAE;QACd,wBAAwB;QACxB,0BAA0B;QAC1B,IAAI,GAAG,CAAC;YACN,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;gBAClC,iEAAiE;gBACjE,OAAO,GAAG;oBACR,IAAI,EAAE,EAAE;iBACT,CAAC;aACH;YACD,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAQ,CAAC;YAChD,IAAI,CAAC,YAAY,GAAG,IAAI,IAAI,EAAE,CAAC;YAC/B,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;YACrB,OAAO,IAAY,CAAC;QACtB,CAAC,CAAC,EAAE,CAAC;KACN;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AA5BD,4BA4BC"}
@@ -1,190 +0,0 @@
1
- /** @license
2
- * Copyright 2018 Esri
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- /**
17
- * Provides common functions involving the management of item and group resources.
18
- *
19
- * @module resourceHelpers
20
- *
21
- * How it works
22
- *
23
- * An item may have resources that are listed as a set of filenames and/or folder/filename combinations. It may have
24
- * a thumbnail, listed in its item info as a filename or folder/filename combination. It may have metadata, which is
25
- * not listed, but has a distinct URL. A group may have a thumbnail, but not the others.
26
- *
27
- * For storing these files in a common storage item, a new folder and filename combination is created for each. The
28
- * filename is kept as-is. The folder consists of the source item's id and an optional suffix. For thumbnails, the
29
- * suffix is "_info_thumbnail"; for metadata, the suffix is "_info_metadata"; for resources, the suffix is "_" plus
30
- * the resource's folder's name; if the resource doesn't have a folder, there is no suffix.
31
- *
32
- * Note that "thumbnail" is included in an item's thumbnail property like a folder (e.g., "thumbnail/thumbnail.png"),
33
- * and the item's thumbnail is accessed using a path such as "%lt;itemId&gt;/info/thumbnail/thumbnail.png". Groups,
34
- * on the other hand, have a property with a simple name (e.g., "thumbnail.png") and it is accessed using a path
35
- * such as "%lt;groupId&gt;/info/thumbnail.png".
36
- *
37
- * For copying these files from the common storage item to another item, one converts the unique names back into the
38
- * original names (or the special cases for thumbnails and metadata).
39
- *
40
- * Routines are provided to
41
- * 1. create full URLs to resources, thumbnails, and metadata.
42
- * 2. create a folder and filename combination that uniquely identifies these files for
43
- * storing them in a single, shared storage item
44
- * 3. copy a set of resources, thumbnails, and metadata for an item to a storage item
45
- * 4. copy a file by URL to an item using specified folder and filename
46
- * 5. undo the unique folder and filename into the original folder and filename
47
- */
48
- import { IDeployFileCopyPath, IFileMimeTyped, ISourceFile, ISourceFileCopyPath, UserSession } from "./interfaces";
49
- import { IItemResourceResponse } from "@esri/arcgis-rest-portal";
50
- export declare function addThumbnailFromBlob(blob: any, itemId: string, authentication: UserSession, isGroup?: boolean): Promise<any>;
51
- export declare function convertBlobToSupportableResource(blob: Blob, filename?: string): IFileMimeTyped;
52
- /**
53
- * Copies the files described by a list of full URLs and folder/filename combinations for
54
- * the resources and metadata of an item or group to an item.
55
- *
56
- * @param storageAuthentication Credentials for the request to the storage
57
- * @param filePaths List of item files' URLs and folder/filenames for storing the files
58
- * @param destinationFolderId Id of folder
59
- * @param destinationItemId Id of item to receive copy of resource/metadata
60
- * @param destinationAuthentication Credentials for the request to the destination
61
- * @param template Template for using its itemId and properties for fine-tuning the filename for Hub
62
- * @returns A promise which resolves to a boolean indicating if the copies were successful
63
- */
64
- export declare function copyFilesFromStorageItem(storageAuthentication: UserSession, filePaths: IDeployFileCopyPath[], destinationFolderId: string, destinationItemId: string, destinationAuthentication: UserSession, template?: any): Promise<boolean>;
65
- /**
66
- * Copies the files for storing the resources, metadata, and thumbnail of an item or group to a storage item
67
- * with a specified path.
68
- *
69
- * @param files List of item files and paths for storing the files
70
- * @param storageItemId Id of item to receive copy of resource/metadata
71
- * @param storageAuthentication Credentials for the request to the storage
72
- * @returns A promise which resolves to a list of the filenames under which the resource/metadata are stored
73
- */
74
- export declare function copyFilesToStorageItem(files: ISourceFile[], storageItemId: string, storageAuthentication: UserSession): Promise<string[]>;
75
- /**
76
- * Generates a folder and filename for storing a copy of an item's metadata in a storage item.
77
- *
78
- * @param itemId Id of item
79
- * @returns Folder and filename for storage; folder is the itemID suffixed with "_info_metadata"
80
- * @see convertStorageResourceToItemResource
81
- */
82
- export declare function generateMetadataStorageFilename(itemId: string): {
83
- folder: string;
84
- filename: string;
85
- };
86
- /**
87
- * Generates a list of full URLs and storage folder/filename combinations for storing the resources, metadata,
88
- * and thumbnail of an item.
89
- *
90
- * @param portalSharingUrl Server/sharing
91
- * @param itemId Id of item
92
- * @param thumbnailUrlPart Partial path to the thumbnail held in an item's JSON
93
- * @param resourceFilenames List of resource filenames for an item, e.g., ["file1", "myFolder/file2"]
94
- * @param isGroup Boolean to indicate if the files are associated with a group or item
95
- * @param storageVersion Version of the Solution template
96
- * @returns List of item files' URLs and folder/filenames for storing the files
97
- */
98
- export declare function generateSourceFilePaths(portalSharingUrl: string, itemId: string, thumbnailUrlPart: string, resourceFilenames: string[], isGroup?: boolean, storageVersion?: number): ISourceFileCopyPath[];
99
- /**
100
- * Generates the URL for reading an item's metadata.
101
- *
102
- * @param sourcePortalSharingUrl Server/sharing
103
- * @param itemId Id of item
104
- * @param isGroup Boolean to indicate if the files are associated with a group or item
105
- * @returns URL string
106
- */
107
- export declare function generateSourceMetadataUrl(sourcePortalSharingUrl: string, itemId: string, isGroup?: boolean): string;
108
- /**
109
- * Generates the URL for reading an item's resource given the filename of the resource.
110
- *
111
- * @param sourcePortalSharingUrl Server/sharing
112
- * @param itemId Id of item
113
- * @param sourceResourceFilename Either filename or folder/filename to resource
114
- * @returns URL string
115
- */
116
- export declare function generateSourceResourceUrl(sourcePortalSharingUrl: string, itemId: string, sourceResourceFilename: string): string;
117
- /**
118
- * Generates the URL for reading an item's thumbnail.
119
- *
120
- * @param sourcePortalSharingUrl Server/sharing
121
- * @param itemId Id of item
122
- * @param thumbnailUrlPart Partial path to the thumbnail held in an item's JSON
123
- * @param isGroup Boolean to indicate if the files are associated with a group or item
124
- * @returns URL string
125
- */
126
- export declare function generateSourceThumbnailUrl(sourcePortalSharingUrl: string, itemId: string, thumbnailUrlPart: string, isGroup?: boolean): string;
127
- /**
128
- * Generates a list of full URLs and folder/filename combinations used to store the resources, metadata,
129
- * and thumbnail of an item.
130
- *
131
- * @param portalSharingUrl Server/sharing
132
- * @param storageItemId Id of storage item
133
- * @param resourceFilenames List of resource filenames for an item, e.g., ["file1", "myFolder/file2"]
134
- * @param storageVersion Version of the Solution template
135
- * @returns List of item files' URLs and folder/filenames for storing the files
136
- */
137
- export declare function generateStorageFilePaths(portalSharingUrl: string, storageItemId: string, resourceFilenames?: string[], storageVersion?: number): IDeployFileCopyPath[];
138
- /**
139
- * Generates a folder and filename for storing a copy of an item's thumbnail in a storage item.
140
- *
141
- * @param itemId Id of item
142
- * @param thumbnailUrlPart Partial path to the thumbnail held in an item's JSON; can also be a filename
143
- * @returns Folder and filename for storage; folder is the itemID suffixed with "_info_thumbnail";
144
- * file is URI-encoded thumbnailUrlPart
145
- * @see convertStorageResourceToItemResource
146
- */
147
- export declare function generateThumbnailStorageFilename(itemId: string, thumbnailurl: string): {
148
- folder: string;
149
- filename: string;
150
- };
151
- export declare function isSupportedFileType(filename: string): boolean;
152
- /**
153
- * Gets the thumbnail of an item or group.
154
- *
155
- * @param authentication Credentials for the request to the storage
156
- * @param filePaths List of item files' URLs and folder/filenames for storing the files
157
- * @returns A promise which resolves to a boolean indicating if the copies were successful
158
- */
159
- export declare function getThumbnailFromStorageItem(authentication: UserSession, filePaths: IDeployFileCopyPath[]): Promise<File>;
160
- /**
161
- * Removes the item's resource that matches the filename with new content
162
- *
163
- * @param itemId Id of the item to remove
164
- * @param filename Name of the resource file to remove
165
- * @param authentication Credentials for the request to the storage
166
- * @returns A promise which resolves with a success true/false response
167
- */
168
- export declare function removeItemResourceFile(itemId: string, filename: string, authentication: UserSession): Promise<{
169
- success: boolean;
170
- }>;
171
- /**
172
- * Updates the item's resource that matches the filename with new content
173
- *
174
- * @param itemId Id of the item to update
175
- * @param filename Name of the resource file to update; prefix optional (e.g., a/b/file.txt)
176
- * @param resource The new content to update the resource with
177
- * @param authentication Credentials for the request to the storage
178
- * @returns A promise which resolves with a success true/false response
179
- */
180
- export declare function updateItemResourceFile(itemId: string, filename: string, resource: File, authentication: UserSession): Promise<IItemResourceResponse>;
181
- /**
182
- * Updates the item's resource that matches the filename with new content
183
- *
184
- * @param itemId Id of the item to update
185
- * @param filename Name of the resource file to update
186
- * @param content The new content to update the resource with
187
- * @param authentication Credentials for the request to the storage
188
- * @returns A promise which resolves with a success true/false response
189
- */
190
- export declare function updateItemResourceText(itemId: string, filename: string, content: string, authentication: UserSession): Promise<IItemResourceResponse>;