@esri/solution-common 5.3.7 → 5.4.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 (49) hide show
  1. package/dist/cjs/completeItem.js +2 -7
  2. package/dist/cjs/completeItem.js.map +1 -1
  3. package/dist/cjs/deleteHelpers/removeItems.js +5 -0
  4. package/dist/cjs/deleteHelpers/removeItems.js.map +1 -1
  5. package/dist/cjs/formHelpers.d.ts +0 -15
  6. package/dist/cjs/formHelpers.js +1 -39
  7. package/dist/cjs/formHelpers.js.map +1 -1
  8. package/dist/cjs/index.d.ts +1 -0
  9. package/dist/cjs/index.js +1 -0
  10. package/dist/cjs/index.js.map +1 -1
  11. package/dist/cjs/interfaces.d.ts +40 -0
  12. package/dist/cjs/interfaces.js.map +1 -1
  13. package/dist/cjs/item-reuse.d.ts +141 -0
  14. package/dist/cjs/item-reuse.js +173 -0
  15. package/dist/cjs/item-reuse.js.map +1 -0
  16. package/dist/cjs/restHelpers.d.ts +5 -7
  17. package/dist/cjs/restHelpers.js +7 -12
  18. package/dist/cjs/restHelpers.js.map +1 -1
  19. package/dist/cjs/restHelpersGet.d.ts +16 -0
  20. package/dist/cjs/restHelpersGet.js +27 -1
  21. package/dist/cjs/restHelpersGet.js.map +1 -1
  22. package/dist/cjs/workflowHelpers.d.ts +22 -21
  23. package/dist/cjs/workflowHelpers.js +77 -48
  24. package/dist/cjs/workflowHelpers.js.map +1 -1
  25. package/dist/esm/completeItem.js +2 -7
  26. package/dist/esm/completeItem.js.map +1 -1
  27. package/dist/esm/deleteHelpers/removeItems.js +5 -0
  28. package/dist/esm/deleteHelpers/removeItems.js.map +1 -1
  29. package/dist/esm/formHelpers.d.ts +0 -15
  30. package/dist/esm/formHelpers.js +0 -36
  31. package/dist/esm/formHelpers.js.map +1 -1
  32. package/dist/esm/index.d.ts +1 -0
  33. package/dist/esm/index.js +1 -0
  34. package/dist/esm/index.js.map +1 -1
  35. package/dist/esm/interfaces.d.ts +40 -0
  36. package/dist/esm/interfaces.js.map +1 -1
  37. package/dist/esm/item-reuse.d.ts +141 -0
  38. package/dist/esm/item-reuse.js +164 -0
  39. package/dist/esm/item-reuse.js.map +1 -0
  40. package/dist/esm/restHelpers.d.ts +5 -7
  41. package/dist/esm/restHelpers.js +7 -12
  42. package/dist/esm/restHelpers.js.map +1 -1
  43. package/dist/esm/restHelpersGet.d.ts +16 -0
  44. package/dist/esm/restHelpersGet.js +24 -0
  45. package/dist/esm/restHelpersGet.js.map +1 -1
  46. package/dist/esm/workflowHelpers.d.ts +22 -21
  47. package/dist/esm/workflowHelpers.js +73 -44
  48. package/dist/esm/workflowHelpers.js.map +1 -1
  49. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"workflowHelpers.js","sourceRoot":"","sources":["../../src/workflowHelpers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AASH,2EAAqD;AACrD,8DAAwC;AACxC,mEAAmE;AACnE,qDAAwD;AACxD,0DAA0B;AAE1B,wHAAwH;AAExH;;;;;GAKG;AACI,KAAK,UAAU,2BAA2B,CAC/C,cAAmB;IAEnB,MAAM,GAAG,GAAG,IAAI,eAAK,EAAE,CAAC;IACxB,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,GAAW,EAAE,EAAE;QAClD,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,IAAA,sCAAmB,EAAC;QAClC,IAAI,EAAE,MAAM,GAAG,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAC/C,QAAQ,EAAE,4BAA4B;QACtC,QAAQ,EAAE,iBAAiB;KAC5B,CAAC,CAAA;IAEF,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC;AAfD,kEAeC;AAED;;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nB,OAAO,EAAE,CAAC;KACX;IACD,OAAO,cAAc,CAAC,GAAa,CAAC;AACtC,CAAC;AAfD,kFAeC"}
@@ -58,13 +58,8 @@ export async function getCompleteItem(itemId, authentication) {
58
58
  completeItem.featureServiceProperties = await restHelpers.getFeatureServiceProperties(itemBase.url, authentication);
59
59
  }
60
60
  else if (itemBase.type === "Workflow") {
61
- const user = await restHelpersGet.getUser(authentication);
62
- let server;
63
- const portal = new URL(authentication.portal);
64
- if (!portal.origin.endsWith(".arcgis.com") && !portal.origin.endsWith(".esri.com")) {
65
- server = authentication.portal.replace("/sharing/rest", "");
66
- }
67
- const workflowConfigZip = await restHelpers.getWorkflowConfigurationZip(itemBase.id, authentication, user.orgId, server);
61
+ const workflowBaseUrl = await workflowHelpers.getWorkflowBaseURL(authentication);
62
+ const workflowConfigZip = await restHelpers.getWorkflowConfigurationZip(itemBase.id, workflowBaseUrl, authentication);
68
63
  completeItem.workflowConfiguration = await workflowHelpers.extractWorkflowFromZipFile(workflowConfigZip);
69
64
  }
70
65
  return Promise.resolve(completeItem);
@@ -1 +1 @@
1
- {"version":3,"file":"completeItem.js","sourceRoot":"","sources":["../../src/completeItem.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAYH,OAAO,KAAK,WAAW,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,eAAe,MAAM,mBAAmB,CAAC;AAErD,wHAAwH;AAExH;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,MAAc,EACd,cAA2B;IAE3B,MAAM,QAAQ,GAAQ,MAAM,cAAc,CAAC,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAE/E,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAClC,cAAc,CAAC,iBAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;QACvE,cAAc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ites from "@esri/hub-sites";
22
22
  import * as portal from "@esri/arcgis-rest-portal";
23
23
  import * as restHelpers from "../restHelpers";
24
+ import * as workflowHelpers from "../workflowHelpers";
24
25
  import { createHubRequestOptions } from "../create-hub-request-options";
25
26
  // ------------------------------------------------------------------------------------------------------------------ //
26
27
  /**
@@ -60,6 +61,10 @@ export function removeItems(solutionSummary, hubSiteItemIds, authentication, per
60
61
  const options = await createHubRequestOptions(authentication);
61
62
  return hubSites.removeSite(itemToDelete.id, options);
62
63
  }
64
+ else if (itemToDelete.type === "Workflow") {
65
+ const workflowBaseUrl = await workflowHelpers.getWorkflowBaseURL(authentication);
66
+ return workflowHelpers.deleteWorkflowItem(itemToDelete.id, workflowBaseUrl, authentication);
67
+ }
63
68
  else {
64
69
  return restHelpers.removeItem(itemToDelete.id, authentication);
65
70
  }
@@ -1 +1 @@
1
- {"version":3,"file":"removeItems.js","sourceRoot":"","sources":["../../../src/deleteHelpers/removeItems.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;GAEG;AAEH,OAAO,EACL,mBAAmB,EAIpB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAExE,wHAAwH;AAExH;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,WAAW,CACzB,eAAgC,EAChC,cAAwB,EACxB,cAA2B,EAC3B,WAAmB,EACnB,mBAA2B,EAC3B,gBAAwC,EAAE;IAE1C,IAAI,sBAAuC,CAAC;IAC5C,IAAI,sBAAuC,CAAC;IAC5C,MAAM,YAAY,GAAG,eAAe,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACnD,MAAM,iBAAiB,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C;aACH;YACD,OAAO,CAAC,sBAAsB,EAAE,sBAAsB,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;KACN;SAAM;QACL,4EAA4E;QAC5E,sBAAsB,GAAG;YACvB,EAAE,EAAE,eAAe,CAAC,EAAE;YACtB,KAAK,EAAE,eAAe,CAAC,KAAK;YAC5B,MAAM,EAAE,eAAe,CAAC,MAAM;YAC9B,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;SACX,CAAC;QACF,sBAAsB,GAAG;YACvB,EAAE,EAAE,eAAe,CAAC,EAAE;YACtB,KAAK,EAAE,eAAe,CAAC,KAAK;YAC5B,MAAM,EAAE,eAAe,CAAC,MAAM;YAC9B,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;SACX,CAAC;QACF,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,sBAAsB,EAAE,sBAAsB,CAAC,CAAC,CAAC;KAC1E;AACH,CAAC"}
@@ -15,21 +15,6 @@
15
15
  */
16
16
  import { UserSession } from "./interfaces";
17
17
  import JSZip from "jszip";
18
- /**
19
- * Gets the webhooks from a Form zip object's *.info file.
20
- *
21
- * @param zipObject Zip file object from which to get the webhooks
22
- * @returns Promise that resolves to an array of webhooks
23
- */
24
- export declare function getWebHooksFromZipObject(zipObject: JSZip): Promise<string[]>;
25
- /**
26
- * Sets the webhooks in a Form zip object's *.info file.
27
- *
28
- * @param zipObject Zip file object in which to set the webhooks
29
- * @param webHooks Array of webhooks to set
30
- * @returns Promise that resolves to the updated zip object
31
- */
32
- export declare function setWebHooksInZipObject(zipObject: JSZip, webHooks: any[]): Promise<JSZip>;
33
18
  /**
34
19
  * Updates an item with a zip object, including any webhooks.
35
20
  *
@@ -13,45 +13,9 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import * as generalHelpers from "./generalHelpers";
17
16
  import * as zipUtils from "./zip-utils";
18
17
  import { updateItem } from "./restHelpers";
19
18
  // ------------------------------------------------------------------------------------------------------------------ //
20
- /**
21
- * Gets the webhooks from a Form zip object's *.info file.
22
- *
23
- * @param zipObject Zip file object from which to get the webhooks
24
- * @returns Promise that resolves to an array of webhooks
25
- */
26
- export async function getWebHooksFromZipObject(zipObject) {
27
- const zipObjectContents = await zipUtils.getZipObjectContents(zipObject);
28
- let webhooks = [];
29
- zipObjectContents.forEach((zipFile) => {
30
- if (zipFile.file.endsWith(".info")) {
31
- const infoFileJson = JSON.parse(zipFile.content);
32
- webhooks = generalHelpers.getProp(infoFileJson, "notificationsInfo.webhooks") || [];
33
- }
34
- });
35
- return Promise.resolve(webhooks);
36
- }
37
- /**
38
- * Sets the webhooks in a Form zip object's *.info file.
39
- *
40
- * @param zipObject Zip file object in which to set the webhooks
41
- * @param webHooks Array of webhooks to set
42
- * @returns Promise that resolves to the updated zip object
43
- */
44
- export async function setWebHooksInZipObject(zipObject, webHooks) {
45
- const zipObjectContents = await zipUtils.getZipObjectContents(zipObject);
46
- zipObjectContents.forEach((zipFile) => {
47
- if (zipFile.file.endsWith(".info")) {
48
- const infoFileJson = JSON.parse(zipFile.content);
49
- generalHelpers.setProp(infoFileJson, "notificationsInfo.webhooks", webHooks);
50
- zipObject.file(zipFile.file, JSON.stringify(infoFileJson));
51
- }
52
- });
53
- return Promise.resolve(zipObject);
54
- }
55
19
  /**
56
20
  * Updates an item with a zip object, including any webhooks.
57
21
  *
@@ -1 +1 @@
1
- {"version":3,"file":"formHelpers.js","sourceRoot":"","sources":["../../src/formHelpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAC;AAEnD,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,wHAAwH;AAExH;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,SAAgB;IAEhB,MAAM,iBAAiB,GAAuC,MAAM,QAAQ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AM,MAAM,GAAgB;QAC1B,EAAE,EAAE,iBAAiB;QACrB,IAAI,EAAG,MAAM,QAAQ,CAAC,kBAAkB,CAAC,SAAS,EAAE,GAAG,iBAAiB,MAAM,CAAC;KAChF,CAAA;IAED,OAAO,UAAU,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC;AACvD,CAAC"}
1
+ {"version":3,"file":"formHelpers.js","sourceRoot":"","sources":["../../src/formHelpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,wHAAwH;AAExH;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,SAAgB,EAChB,iBAAyB,EACzB,yBAAsC;IAEtC,sCAAsC;IACtC,MAAM,MAAM,GAAgB;QAC1B,EAAE,EAAE,iBAAiB;QACrB,IAAI,EAAG,MAAM,QAAQ,CAAC,kBAAkB,CAAC,SAAS,EAAE,GAAG,iBAAiB,MAAM,CAAC;KAChF,CAAA;IAED,OAAO,UAAU,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC;AACvD,CAAC"}
@@ -31,6 +31,7 @@ export * from "./getItemTypeAbbrev";
31
31
  export * from "./getSolutionSummary";
32
32
  export * from "./get-subscription-info";
33
33
  export * from "./interfaces";
34
+ export * from "./item-reuse";
34
35
  export * from "./libConnectors";
35
36
  export * from "./migrator";
36
37
  export * from "./resourceHelpers";
package/dist/esm/index.js CHANGED
@@ -31,6 +31,7 @@ export * from "./getItemTypeAbbrev";
31
31
  export * from "./getSolutionSummary";
32
32
  export * from "./get-subscription-info";
33
33
  export * from "./interfaces";
34
+ export * from "./item-reuse";
34
35
  export * from "./libConnectors";
35
36
  export * from "./migrator";
36
37
  export * from "./resourceHelpers";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mapp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AAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC"}
@@ -1014,11 +1014,51 @@ export interface ISolutionItemData {
1014
1014
  * General information about the solution template
1015
1015
  */
1016
1016
  metadata: any;
1017
+ /**
1018
+ * Supplemental information about the solution, e.g., its default spatial reference
1019
+ */
1020
+ params?: ISolutionItemDataParams;
1017
1021
  /**
1018
1022
  * The collection of templates
1019
1023
  */
1020
1024
  templates: IItemTemplate[];
1021
1025
  }
1026
+ /**
1027
+ * Supplemental information about the solution, e.g., its default spatial reference
1028
+ */
1029
+ interface ISolutionItemDataParams {
1030
+ /**
1031
+ * Information about the default spatial reference for a solution item.
1032
+ */
1033
+ wkid: ISolutionItemDataWkidParams;
1034
+ }
1035
+ /**
1036
+ * Information about the default spatial reference for a solution item.
1037
+ */
1038
+ interface ISolutionItemDataWkidParams {
1039
+ /**
1040
+ * A label for the wkid, e.g., "Spatial Reference".
1041
+ */
1042
+ label: string;
1043
+ /**
1044
+ * The default wkid, e.g., "102100"
1045
+ */
1046
+ default: string;
1047
+ /**
1048
+ * A value flag, e.g., "spatialReference"
1049
+ */
1050
+ valueType: string;
1051
+ /**
1052
+ * Attributes of the default spatial reference for a solution item.
1053
+ */
1054
+ attributes: ISolutionItemDataWkidAttrsParams;
1055
+ }
1056
+ /**
1057
+ * Attributes of the default spatial reference for a solution item.
1058
+ */
1059
+ interface ISolutionItemDataWkidAttrsParams {
1060
+ required: boolean;
1061
+ }
1022
1062
  /**
1023
1063
  * A brief form of an item in a deployed Solution item.
1024
1064
  */
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAeH,wHAAwH;AAExH,OAAO,EAGL,WAAW,EACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAKL,YAAY,EACb,MAAM,iCAAiC,CAAC;AAuBzC,wHAAwH;AAExH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAC/C,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAC/C,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;AAEzC,wHAAwH;AAExH;;GAEG;AACH,MAAM,CAAN,IAAY,SAMX;AAND,WAAY,SAAS;IACnB,yCAAI,CAAA;IACJ,yCAAI,CAAA;IACJ,iDAAQ,CAAA;IACR,iDAAQ,CAAA;IACR,mDAAS,CAAA;AACX,CAAC,EANW,SAAS,KAAT,SAAS,QAMpB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,SAMX;AAND,WAAY,SAAS;IACnB,yCAAM,CAAA;IACN,yCAAM,CAAA;IACN,iDAAU,CAAA;IACV,iDAAU,CAAA;IACV,mDAAW,CAAA;AACb,CAAC,EANW,SAAS,KAAT,SAAS,QAMpB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,mBAQX;AARD,WAAY,mBAAmB;IAC7B,mEAAO,CAAA;IACP,mEAAO,CAAA;IACP,uEAAS,CAAA;IACT,qEAAQ,CAAA;IACR,mEAAO,CAAA;IACP,iEAAM,CAAA;IACN,mEAAO,CAAA;AACT,CAAC,EARW,mBAAmB,KAAnB,mBAAmB,QAQ9B;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,WAAW;IACX,WAAW;IACX,aAAa;IACb,YAAY;IACZ,WAAW;IACX,UAAU;IACV,SAAS;CACV,CAAC;AA2hDF,wHAAwH"}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAeH,wHAAwH;AAExH,OAAO,EAGL,WAAW,EACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAKL,YAAY,EACb,MAAM,iCAAiC,CAAC;AAuBzC,wHAAwH;AAExH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAC/C,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAC/C,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;AAEzC,wHAAwH;AAExH;;GAEG;AACH,MAAM,CAAN,IAAY,SAMX;AAND,WAAY,SAAS;IACnB,yCAAI,CAAA;IACJ,yCAAI,CAAA;IACJ,iDAAQ,CAAA;IACR,iDAAQ,CAAA;IACR,mDAAS,CAAA;AACX,CAAC,EANW,SAAS,KAAT,SAAS,QAMpB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,SAMX;AAND,WAAY,SAAS;IACnB,yCAAM,CAAA;IACN,yCAAM,CAAA;IACN,iDAAU,CAAA;IACV,iDAAU,CAAA;IACV,mDAAW,CAAA;AACb,CAAC,EANW,SAAS,KAAT,SAAS,QAMpB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,mBAQX;AARD,WAAY,mBAAmB;IAC7B,mEAAO,CAAA;IACP,mEAAO,CAAA;IACP,uEAAS,CAAA;IACT,qEAAQ,CAAA;IACR,mEAAO,CAAA;IACP,iEAAM,CAAA;IACN,mEAAO,CAAA;AACT,CAAC,EARW,mBAAmB,KAAnB,mBAAmB,QAQ9B;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,WAAW;IACX,WAAW;IACX,aAAa;IACb,YAAY;IACZ,WAAW;IACX,UAAU;IACV,SAAS;CACV,CAAC;AA0kDF,wHAAwH"}
@@ -0,0 +1,141 @@
1
+ /** @license
2
+ * Copyright 2024 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
+ * @module item-reuse
17
+ */
18
+ import { UserSession } from "./interfaces";
19
+ import { IItem, ISearchResult } from "@esri/arcgis-rest-portal";
20
+ export interface ISourceItem {
21
+ /**
22
+ * The key is the id of the item as it is within the solution template that will be deployed
23
+ */
24
+ [key: string]: IReuseItem;
25
+ }
26
+ /**
27
+ * Object that contains key details for items that could be leveraged for reuse
28
+ */
29
+ export interface IReuseItem {
30
+ /**
31
+ * The key is the id of the item as it is within the solution template that will be deployed
32
+ */
33
+ [key: string]: IReuseItemInfo;
34
+ }
35
+ /**
36
+ * Object that contains key details for an item that could be leveraged for reuse
37
+ */
38
+ export interface IReuseItemInfo {
39
+ /**
40
+ * The date/time the item was created
41
+ */
42
+ created: number;
43
+ /**
44
+ * A collection of key details from solutions that leverage this item
45
+ */
46
+ solutions: IReuseSolutions;
47
+ /**
48
+ * The title of the item that is already deployed
49
+ */
50
+ title: string;
51
+ /**
52
+ * The type of item that is already deployed
53
+ */
54
+ type: string;
55
+ }
56
+ /**
57
+ * A collection of key details from a solutions that leverage one or more reuse items
58
+ */
59
+ export interface IReuseSolutions {
60
+ /**
61
+ * A collection of key details from a solution that leverages one or more reuse items
62
+ * The key is the id of the deployed solution.
63
+ */
64
+ [key: string]: IReuseSolution;
65
+ }
66
+ /**
67
+ * A collection of key details from a solution that leverages one or more reuse items
68
+ */
69
+ export interface IReuseSolution {
70
+ /**
71
+ * The date/time the solution was created
72
+ */
73
+ created: number;
74
+ /**
75
+ * The title of the solution is already deployed
76
+ */
77
+ title: string;
78
+ }
79
+ /**
80
+ * Collection of key details about one or more solutions
81
+ */
82
+ export interface ISolutionInfos {
83
+ /**
84
+ * Key details about a solution
85
+ * The key value is the solutions item id
86
+ */
87
+ [key: string]: ISolutionInfo;
88
+ }
89
+ /**
90
+ * Key details about a solution
91
+ */
92
+ export interface ISolutionInfo {
93
+ /**
94
+ * Array of template ids from the solution
95
+ */
96
+ templates: string[];
97
+ /**
98
+ * A collection of key details from a solution that leverages one or more reuse items
99
+ */
100
+ solutionInfo: IReuseSolution;
101
+ }
102
+ /**
103
+ * Find all deployed solutions and their items from the current org for the current user
104
+ *
105
+ * @param authentication Credentials for the request
106
+ */
107
+ export declare function getDeployedSolutionsAndItems(authentication: UserSession): Promise<ISolutionInfos>;
108
+ /**
109
+ * Find all deployed solutions from the current org for the current user
110
+ *
111
+ * @param authentication Credentials for the request
112
+ */
113
+ export declare function getDeployedSolutions(authentication: UserSession): Promise<ISearchResult<IItem>>;
114
+ /**
115
+ * Find key details for the items from each of the deployed solutions
116
+ *
117
+ * @param authentication Credentials for the request
118
+ * @param searchResults key details of the deployed solutions
119
+ */
120
+ export declare function getSolutionItemsFromDeployedSolutions(authentication: UserSession, searchResults: ISearchResult<IItem>): Promise<ISolutionInfos>;
121
+ /**
122
+ * Get the ids for each template in a solution
123
+ *
124
+ * @param authentication Credentials for the request
125
+ */
126
+ export declare function getIdsFromSolutionTemplates(id: string, authentication: UserSession): Promise<string[]>;
127
+ /**
128
+ * Fetch key details for the solution that will be deployed and find any solutions
129
+ * that leverage any of the source items that exist in the solution to be deployed.
130
+ *
131
+ * @param id The id of the solution that will be deployed
132
+ * @param authentication Credentials for the request
133
+ */
134
+ export declare function findReusableSolutionsAndItems(id: string, authentication: UserSession): Promise<ISourceItem>;
135
+ /**
136
+ * Fetch key details for the solution that will be deployed
137
+ *
138
+ * @param id The id of the solution that will be deployed
139
+ * @param authentication Credentials for the request
140
+ */
141
+ export declare function getItemHash(id: string, authentication: UserSession): Promise<ISourceItem>;
@@ -0,0 +1,164 @@
1
+ /** @license
2
+ * Copyright 2024 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
+ * @module item-reuse
17
+ */
18
+ import { getItemData, searchItems, SearchQueryBuilder } from "@esri/arcgis-rest-portal";
19
+ /**
20
+ * Find all deployed solutions and their items from the current org for the current user
21
+ *
22
+ * @param authentication Credentials for the request
23
+ */
24
+ export function getDeployedSolutionsAndItems(authentication) {
25
+ return getDeployedSolutions(authentication).then((searchResults) => {
26
+ return getSolutionItemsFromDeployedSolutions(authentication, searchResults);
27
+ });
28
+ }
29
+ /**
30
+ * Find all deployed solutions from the current org for the current user
31
+ *
32
+ * @param authentication Credentials for the request
33
+ */
34
+ export function getDeployedSolutions(authentication) {
35
+ const query = new SearchQueryBuilder()
36
+ .match(authentication.username).in("owner").and()
37
+ .match("Solution").in("type").and()
38
+ .match("Deployed").in("typekeywords");
39
+ return searchItems({
40
+ q: query,
41
+ num: 100,
42
+ authentication
43
+ })
44
+ .then((searchResponse) => {
45
+ // Sort the results by title and then id
46
+ searchResponse.results.sort((e1, e2) => {
47
+ if (e1.title !== e2.title) {
48
+ return e1.title < e2.title ? -1 : 1;
49
+ }
50
+ else {
51
+ return e1.id < e2.id ? -1 : 1;
52
+ }
53
+ });
54
+ return searchResponse;
55
+ });
56
+ }
57
+ /**
58
+ * Find key details for the items from each of the deployed solutions
59
+ *
60
+ * @param authentication Credentials for the request
61
+ * @param searchResults key details of the deployed solutions
62
+ */
63
+ export function getSolutionItemsFromDeployedSolutions(authentication, searchResults) {
64
+ const promises = [];
65
+ const itemIds = [];
66
+ const solutions = {};
67
+ if (searchResults.results.length > 0) {
68
+ searchResults.results.forEach((r) => {
69
+ const versionKeywords = r.typeKeywords.filter(v => /solutionversion-.+/.exec(v));
70
+ const version = versionKeywords.length > 0 ? versionKeywords[0] : "";
71
+ itemIds.push(r.id);
72
+ solutions[r.id] = {
73
+ created: r.created,
74
+ title: r.title,
75
+ version
76
+ };
77
+ promises.push(getItemData(r.id, { authentication }));
78
+ });
79
+ }
80
+ return Promise.all(promises).then(results => {
81
+ return results.reduce((prev, cur, i) => {
82
+ const id = itemIds[i];
83
+ prev[id] = {
84
+ templates: cur.templates.map(template => template.itemId),
85
+ solutionInfo: solutions[id]
86
+ };
87
+ return prev;
88
+ }, {});
89
+ });
90
+ }
91
+ /**
92
+ * Get the ids for each template in a solution
93
+ *
94
+ * @param authentication Credentials for the request
95
+ */
96
+ export function getIdsFromSolutionTemplates(id, authentication) {
97
+ return getItemData(id, { authentication }).then(data => {
98
+ ;
99
+ return data.templates.map(t => t.itemId);
100
+ });
101
+ }
102
+ /**
103
+ * Fetch key details for the solution that will be deployed and find any solutions
104
+ * that leverage any of the source items that exist in the solution to be deployed.
105
+ *
106
+ * @param id The id of the solution that will be deployed
107
+ * @param authentication Credentials for the request
108
+ */
109
+ export function findReusableSolutionsAndItems(id, authentication) {
110
+ return getItemHash(id, authentication).then(itemHash => {
111
+ return getDeployedSolutionsAndItems(authentication).then(results => {
112
+ const sourceIds = Object.keys(itemHash);
113
+ Object.keys(results).forEach(solutionId => {
114
+ const solution = results[solutionId];
115
+ sourceIds.forEach(sourceId => {
116
+ const itemKeys = Object.keys(itemHash[sourceId]);
117
+ itemKeys.forEach(deployedId => {
118
+ const item = itemHash[sourceId][deployedId];
119
+ if (solution.templates.indexOf(deployedId) > -1 && Object.keys(item.solutions).indexOf(solutionId) < 0) {
120
+ item.solutions[solutionId] = solution.solutionInfo;
121
+ }
122
+ });
123
+ });
124
+ });
125
+ return itemHash;
126
+ });
127
+ });
128
+ }
129
+ /**
130
+ * Fetch key details for the solution that will be deployed
131
+ *
132
+ * @param id The id of the solution that will be deployed
133
+ * @param authentication Credentials for the request
134
+ */
135
+ export function getItemHash(id, authentication) {
136
+ return getIdsFromSolutionTemplates(id, authentication).then(ids => {
137
+ // search for existing items that reference any of these ids in their typeKeywords
138
+ const promises = ids.map(id => {
139
+ const q = `typekeywords:source-${id} owner:${authentication.username}`;
140
+ const searchOptions = {
141
+ q,
142
+ authentication
143
+ };
144
+ return searchItems(searchOptions);
145
+ });
146
+ return Promise.all(promises).then(results => {
147
+ // if we have a result from the typeKeyword search we need to understand what solution it came from and what its id is
148
+ return results.reduce((prev, cur, i) => {
149
+ // key is source id and value is any ids for items that were deployed based on this source
150
+ prev[ids[i]] = cur.results.reduce((prev, cur) => {
151
+ prev[cur.id] = {
152
+ created: cur.created,
153
+ solutions: {},
154
+ title: cur.title,
155
+ type: cur.type
156
+ };
157
+ return prev;
158
+ }, {});
159
+ return prev;
160
+ }, {});
161
+ });
162
+ });
163
+ }
164
+ //# sourceMappingURL=item-reuse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item-reuse.js","sourceRoot":"","sources":["../../src/item-reuse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAE,WAAW,EAAwB,WAAW,EAAE,kBAAkB,EAAC,MAAM,0BAA0B,CAAC;AA+F7G;;;;GAIG;AACH,MAAM,UAAU,4BAA4B,CAC1C,cAA2B;IAE3B,OAAO,oBAAoB,CAAC,cAAc,CAAC,CAAC,IAAI,CAC9C,CAAC,aAAmC,EAAE,EAAE;QACtC,OAAO,qCAAqC,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC;IAC9E,CAAC,CACF,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAClC,cAA2B;IAE3B,MAAM,KAAK,GAAG,IAAI,kBAAkB,EAAE;SACrC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,GAA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2BAA2B,CAAC,EAAE,EAAE,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QAChE,kFAAkF;QAClF,MAAM,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;YAC5B,MAAM,CAAC,GAAG,uBAAuB,EAAE,UAAU,cAAc,CAAC,QAAQ,EAAE,CAAC;YACvE,MAAM,aAAa,GAAG;gBACpB,CAAC;gBACD,cAAc;aACf,CAAC;YACF,OAAO,WAAW,CAAC,aAAa,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;YAC1C,sHAAsH;YACtH,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,IAAS,EAAE,GAAQ,EAAE,CAAS,EAAE,EAAE;gBACvD,0FAA0F;gBAC1F,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;oBAC9C,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG;wBACb,OAAO,EAAE,GAAG,CAAC,OAAO;wBACpB,SAAS,EAAE,EAAE;wBACb,KAAK,EAAE,GAAG,CAAC,KAAK;wBAChB,IAAI,EAAE,GAAG,CAAC,IAAI;qBACf,CAAA;oBACD,OAAO,IAAI,CAAC;gBACd,CAAC,EAAE,EAAE,CAAC,CAAC;gBACP,OAAO,IAAI,CAAC;YACd,CAAC,EAAE,EAAE,CAAC,CAAC;QACT,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -271,25 +271,23 @@ export declare function getFeatureServiceProperties(serviceUrl: string, authenti
271
271
  * Fetches the configuration of a workflow.
272
272
  *
273
273
  * @param itemId Id of the workflow item
274
+ * @param workflowBaseUrl URL of the workflow manager, e.g., "https://workflow.arcgis.com/orgId"
274
275
  * @param authentication Credentials for the request to AGOL
275
- * @param orgId Id of organization whose license is to be checked; only used if `enterpriseWebAdaptorUrl` is falsy
276
- * @param workflowURL URL of the workflow manager, e.g., "https://workflow.arcgis.com"
277
276
  * @returns Promise resolving with the workflow configuration in a zip file
278
277
  * @throws {WorkflowJsonExceptionDTO} if request to workflow manager fails
279
278
  */
280
- export declare function getWorkflowConfigurationZip(itemId: string, authentication: UserSession, orgId: string | undefined, workflowURL: string): Promise<File>;
279
+ export declare function getWorkflowConfigurationZip(itemId: string, workflowBaseUrl: string, authentication: UserSession): Promise<File>;
281
280
  /**
282
281
  * Sets the configuration of a workflow.
283
282
  *
284
- * @param configurationZipFile Configuration files in a zip file
285
283
  * @param itemId Id of the workflow item
284
+ * @param configurationZipFile Configuration files in a zip file
285
+ * @param workflowBaseUrl URL of the workflow manager, e.g., "https://workflow.arcgis.com/orgId"
286
286
  * @param authentication Credentials for the request to AGOL
287
- * @param orgId Id of organization whose license is to be checked; only used if `enterpriseWebAdaptorUrl` is falsy
288
- * @param workflowURL URL of the workflow manager, e.g., "https://workflow.arcgis.com"
289
287
  * @returns Promise resolving with the workflow configuration in a zip file
290
288
  * @throws {WorkflowJsonExceptionDTO} if request to workflow manager fails
291
289
  */
292
- export declare function setWorkflowConfigurationZip(configurationZipFile: File, itemId: string, authentication: UserSession, orgId: string | undefined, workflowURL: string): Promise<IStatusResponse>;
290
+ export declare function setWorkflowConfigurationZip(itemId: string, configurationZipFile: File, workflowBaseUrl: string, authentication: UserSession): Promise<IStatusResponse>;
293
291
  /**
294
292
  * Parses the layers array and will filter subsets of Layers and Tables
295
293
  * Layers and Tables are both returned in the layers array when we access a feature service from the admin api.
@@ -26,7 +26,6 @@ import { getItemBase, getItemDataAsJson } from "./restHelpersGet";
26
26
  import { addItemData as portalAddItemData, addItemRelationship, addItemResource, createFolder, createGroup, createItemInFolder, getItem, moveItem as portalMoveItem, removeFolder as portalRemoveFolder, removeGroup as portalRemoveGroup, removeGroupUsers as portalRemoveGroupUsers, removeItem as portalRemoveItem, searchGroupContent, searchGroups as portalSearchGroups, searchItems as portalSearchItems, SearchQueryBuilder, setItemAccess, shareItemWithGroup, updateItem as portalUpdateItem, updateGroup as portalUpdateGroup } from "@esri/arcgis-rest-portal";
27
27
  import { request } from "@esri/arcgis-rest-request";
28
28
  import { addToServiceDefinition as svcAdminAddToServiceDefinition, createFeatureService as svcAdminCreateFeatureService } from "@esri/arcgis-rest-service-admin";
29
- import { getWorkflowManagerUrlRoot } from "./workflowHelpers";
30
29
  import { getWorkforceDependencies, isWorkforceProject, getWorkforceServiceInfo } from "./workforceHelpers";
31
30
  import { hasUnresolvedVariables, replaceInTemplate } from "./templatization";
32
31
  import { isTrackingViewTemplate, setTrackingOptions } from "./trackingHelpers";
@@ -953,15 +952,13 @@ export function getFeatureServiceProperties(serviceUrl, authentication, workforc
953
952
  * Fetches the configuration of a workflow.
954
953
  *
955
954
  * @param itemId Id of the workflow item
955
+ * @param workflowBaseUrl URL of the workflow manager, e.g., "https://workflow.arcgis.com/orgId"
956
956
  * @param authentication Credentials for the request to AGOL
957
- * @param orgId Id of organization whose license is to be checked; only used if `enterpriseWebAdaptorUrl` is falsy
958
- * @param workflowURL URL of the workflow manager, e.g., "https://workflow.arcgis.com"
959
957
  * @returns Promise resolving with the workflow configuration in a zip file
960
958
  * @throws {WorkflowJsonExceptionDTO} if request to workflow manager fails
961
959
  */
962
- export async function getWorkflowConfigurationZip(itemId, authentication, orgId, workflowURL) {
963
- const workflowUrlRoot = getWorkflowManagerUrlRoot(orgId, workflowURL);
964
- const url = `${workflowUrlRoot}/admin/${itemId}/export`;
960
+ export async function getWorkflowConfigurationZip(itemId, workflowBaseUrl, authentication) {
961
+ const url = `${workflowBaseUrl}/admin/${itemId}/export`;
965
962
  return request(url, {
966
963
  authentication,
967
964
  headers: {
@@ -977,17 +974,15 @@ export async function getWorkflowConfigurationZip(itemId, authentication, orgId,
977
974
  /**
978
975
  * Sets the configuration of a workflow.
979
976
  *
980
- * @param configurationZipFile Configuration files in a zip file
981
977
  * @param itemId Id of the workflow item
978
+ * @param configurationZipFile Configuration files in a zip file
979
+ * @param workflowBaseUrl URL of the workflow manager, e.g., "https://workflow.arcgis.com/orgId"
982
980
  * @param authentication Credentials for the request to AGOL
983
- * @param orgId Id of organization whose license is to be checked; only used if `enterpriseWebAdaptorUrl` is falsy
984
- * @param workflowURL URL of the workflow manager, e.g., "https://workflow.arcgis.com"
985
981
  * @returns Promise resolving with the workflow configuration in a zip file
986
982
  * @throws {WorkflowJsonExceptionDTO} if request to workflow manager fails
987
983
  */
988
- export async function setWorkflowConfigurationZip(configurationZipFile, itemId, authentication, orgId, workflowURL) {
989
- const workflowUrlRoot = getWorkflowManagerUrlRoot(orgId, workflowURL);
990
- const url = `${workflowUrlRoot}/admin/${itemId}/import`;
984
+ export async function setWorkflowConfigurationZip(itemId, configurationZipFile, workflowBaseUrl, authentication) {
985
+ const url = `${workflowBaseUrl}/admin/${itemId}/import`;
991
986
  return request(url, {
992
987
  authentication,
993
988
  headers: {