@esri/hub-common 14.65.0 → 14.65.1

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.
@@ -17,6 +17,17 @@ export async function reharvestSiteCatalog(siteId, context) {
17
17
  authorization: context.hubRequestOptions.authentication.token,
18
18
  },
19
19
  };
20
- return fetch(url, options).then((result) => result.json());
20
+ return fetch(url, options)
21
+ .then((result) => result.json())
22
+ .then((rawResult) => {
23
+ const result = {};
24
+ if (rawResult.groups) {
25
+ result.groups = rawResult.groups;
26
+ }
27
+ if (rawResult.message) {
28
+ result.error = rawResult;
29
+ }
30
+ return result;
31
+ });
21
32
  }
22
33
  //# sourceMappingURL=reharvestSiteCatalog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reharvestSiteCatalog.js","sourceRoot":"","sources":["../../../src/sites/reharvestSiteCatalog.ts"],"names":[],"mappings":"AAiBA;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,MAAc,EACd,OAAuB;IAEvB,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAC/B,MAAM,GAAG,GAAG,GAAG,OAAO,qBAAqB,MAAM,UAAU,CAAC;IAC5D,MAAM,OAAO,GAAG;QACd,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,aAAa,EAAE,OAAO,CAAC,iBAAiB,CAAC,cAAc,CAAC,KAAK;SAC9D;KACF,CAAC;IACF,OAAO,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;AAC7D,CAAC"}
1
+ {"version":3,"file":"reharvestSiteCatalog.js","sourceRoot":"","sources":["../../../src/sites/reharvestSiteCatalog.ts"],"names":[],"mappings":"AA2BA;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,MAAc,EACd,OAAuB;IAEvB,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAC/B,MAAM,GAAG,GAAG,GAAG,OAAO,qBAAqB,MAAM,UAAU,CAAC;IAC5D,MAAM,OAAO,GAAG;QACd,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,aAAa,EAAE,OAAO,CAAC,iBAAiB,CAAC,cAAc,CAAC,KAAK;SAC9D;KACF,CAAC;IAEF,OAAO,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC;SACvB,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;SAC/B,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE;QAClB,MAAM,MAAM,GAAmB,EAAE,CAAC;QAClC,IAAI,SAAS,CAAC,MAAM,EAAE;YACpB,MAAM,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;SAClC;QACD,IAAI,SAAS,CAAC,OAAO,EAAE;YACrB,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC;SAC1B;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -20,7 +20,18 @@ async function reharvestSiteCatalog(siteId, context) {
20
20
  authorization: context.hubRequestOptions.authentication.token,
21
21
  },
22
22
  };
23
- return fetch(url, options).then((result) => result.json());
23
+ return fetch(url, options)
24
+ .then((result) => result.json())
25
+ .then((rawResult) => {
26
+ const result = {};
27
+ if (rawResult.groups) {
28
+ result.groups = rawResult.groups;
29
+ }
30
+ if (rawResult.message) {
31
+ result.error = rawResult;
32
+ }
33
+ return result;
34
+ });
24
35
  }
25
36
  exports.reharvestSiteCatalog = reharvestSiteCatalog;
26
37
  //# sourceMappingURL=reharvestSiteCatalog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reharvestSiteCatalog.js","sourceRoot":"","sources":["../../../src/sites/reharvestSiteCatalog.ts"],"names":[],"mappings":";;;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AAG,SAAS,CAAC,MAAM,CAAC;SAClC;QACD,IAAI,SAAS,CAAC,OAAO,EAAE;YACrB,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC;SAC1B;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC,CAAC;AACP,CAAC;AA1BD,oDA0BC"}
@@ -13,6 +13,14 @@ interface IGroupReharvestInfo {
13
13
  */
14
14
  status: number;
15
15
  }
16
+ interface IReharvestError {
17
+ message: string;
18
+ cause: string;
19
+ }
20
+ interface IReharvestInfo {
21
+ groups?: IGroupReharvestInfo[];
22
+ error?: IReharvestError;
23
+ }
16
24
  /**
17
25
  * Trigger a manual update to reharvest each public item within a site's catalog.
18
26
  * This should only be used when search metadata has gotten out of sync despite
@@ -22,5 +30,5 @@ interface IGroupReharvestInfo {
22
30
  * @param context
23
31
  * @returns Job info for each group whose content is being harvested
24
32
  */
25
- export declare function reharvestSiteCatalog(siteId: string, context: IArcGISContext): Promise<IGroupReharvestInfo[]>;
33
+ export declare function reharvestSiteCatalog(siteId: string, context: IArcGISContext): Promise<IReharvestInfo>;
26
34
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/hub-common",
3
- "version": "14.65.0",
3
+ "version": "14.65.1",
4
4
  "description": "Common TypeScript types and utility functions for @esri/hub.js.",
5
5
  "main": "dist/node/index.js",
6
6
  "module": "dist/esm/index.js",