@esri/hub-common 14.108.4 → 14.109.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.
@@ -0,0 +1,46 @@
1
+ import HubError from "../HubError";
2
+ import { JobRecordType, } from "./types";
3
+ /**
4
+ * Fetches job records for a specific item.
5
+ *
6
+ * @param id - The ID of the item.
7
+ * @param options - The options for fetching job records.
8
+ * @returns A promise that resolves to an array of job records.
9
+ * @throws {HubError} If any unimplemented options are provided.
10
+ */
11
+ export async function fetchItemJobRecords(id, options) {
12
+ const unimplementedOptions = [
13
+ "types",
14
+ "statuses",
15
+ ];
16
+ if (unimplementedOptions.some((option) => options[option])) {
17
+ throw new HubError("fetchItemJobRecords", `The following options are not yet implemented: ${unimplementedOptions.join(", ")}`);
18
+ }
19
+ const { context } = options;
20
+ const requestUrl = `${context.hubUrl}/api/download/v1/items/${id}/errors${getQueryString(options)}`;
21
+ const { errors: rawErrors } = await fetch(requestUrl).then((response) => response.json());
22
+ // TODO: account for additional row types once the API supports them
23
+ return rawErrors.map(rowToDownloadJobRecord);
24
+ }
25
+ function getQueryString(options) {
26
+ const params = new URLSearchParams();
27
+ options.from && params.append("fromDate", options.from);
28
+ options.to && params.append("toDate", options.to);
29
+ options.limit && params.append("limit", options.limit.toString());
30
+ const result = params.toString();
31
+ return result && `?${result}`;
32
+ }
33
+ function rowToDownloadJobRecord(row) {
34
+ return {
35
+ type: JobRecordType.DOWNLOAD,
36
+ message: row.message,
37
+ created: new Date(row.timestamp).getTime(),
38
+ layerId: row.layerId,
39
+ // implement the rest of the fields once the API supports them
40
+ id: null,
41
+ status: null,
42
+ messageId: null,
43
+ modified: null,
44
+ };
45
+ }
46
+ //# sourceMappingURL=fetchItemJobRecords.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchItemJobRecords.js","sourceRoot":"","sources":["../../../src/content/fetchItemJobRecords.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,aAAa,CA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,CAAC,QAAQ,EAAE,CAAC;IAEjC,OAAO,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;AAChC,CAAC;AAED,SAAS,sBAAsB,CAC7B,GAA2B;IAE3B,OAAO;QACL,IAAI,EAAE,aAAa,CAAC,QAAQ;QAC5B,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,OAAO,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE;QAC1C,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,8DAA8D;QAC9D,EAAE,EAAE,IAAI;QACR,MAAM,EAAE,IAAI;QACZ,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,IAAI;KACf,CAAC;AACJ,CAAC"}
@@ -10,4 +10,5 @@ export * from "./search";
10
10
  export * from "./slugs";
11
11
  export * from "./types";
12
12
  export * from "./hostedServiceUtils";
13
+ export * from "./fetchItemJobRecords";
13
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/content/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/content/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC"}
@@ -1 +1,13 @@
1
+ export var JobRecordType;
2
+ (function (JobRecordType) {
3
+ JobRecordType["DOWNLOAD"] = "download";
4
+ JobRecordType["UPDATE"] = "update";
5
+ })(JobRecordType || (JobRecordType = {}));
6
+ export var JobRecordStatus;
7
+ (function (JobRecordStatus) {
8
+ JobRecordStatus["SUCCESS"] = "success";
9
+ JobRecordStatus["ERROR"] = "error";
10
+ JobRecordStatus["WARNING"] = "warning";
11
+ JobRecordStatus["INFO"] = "info";
12
+ })(JobRecordStatus || (JobRecordStatus = {}));
1
13
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/content/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/content/types.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,sCAAqB,CAAA;IACrB,kCAAiB,CAAA;AACnB,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB;AAED,MAAM,CAAN,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,sCAAmB,CAAA;IACnB,kCAAe,CAAA;IACf,sCAAmB,CAAA;IACnB,gCAAa,CAAA;AACf,CAAC,EALW,eAAe,KAAf,eAAe,QAK1B"}
@@ -8,6 +8,7 @@
8
8
  */
9
9
  export async function ogcItemToDiscussionPostResult(ogcItem) {
10
10
  return {
11
+ // Base IHubSearchResult properties
11
12
  id: ogcItem.id,
12
13
  name: ogcItem.properties.title,
13
14
  summary: ogcItem.properties.body,
@@ -15,13 +16,13 @@ export async function ogcItemToDiscussionPostResult(ogcItem) {
15
16
  createdDateSource: "properties.createdAt",
16
17
  updatedDate: new Date(ogcItem.properties.updatedAt),
17
18
  updatedDateSource: "properties.updatedAt",
18
- type: ogcItem.properties.postType,
19
+ type: "post",
19
20
  owner: ogcItem.properties.creator,
20
- location: ogcItem.properties.geometry,
21
+ location: null,
21
22
  created: new Date(ogcItem.properties.createdAt),
22
23
  modified: new Date(ogcItem.properties.updatedAt),
23
24
  title: ogcItem.properties.title,
24
- rawResult: ogcItem.properties,
25
+ rawResult: ogcItem,
25
26
  access: null,
26
27
  family: null,
27
28
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ogcItemToDiscussionPostResult.js","sourceRoot":"","sources":["../../../../../src/search/_internal/hubSearchItemsHelpers/ogcItemToDiscussionPostResult.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,OAAiB;IAEjB,OAAO;QACL,EAAE,EAAE,OAAO,CAAC,EAAE;QACd,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK;QAC9B,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI;QAChC,WAAW,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;QACnD,iBAAiB,EAAE,sBAAsB;QACzC,WAAW,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;QACnD,iBAAiB,EAAE,sBAAsB;QACzC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ;QACjC,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO;QACjC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ;QACrC,OAAO,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;QAC/C,QAAQ,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;QAChD,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK;QAC/B,SAAS,EAAE,OAAO,CAAC,UAAU;QAC7B,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,IAAI;KACO,CAAC;AACxB,CAAC"}
1
+ {"version":3,"file":"ogcItemToDiscussionPostResult.js","sourceRoot":"","sources":["../../../../../src/search/_internal/hubSearchItemsHelpers/ogcItemToDiscussionPostResult.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,OAAiB;IAEjB,OAAO;QACL,mCAAmC;QACnC,EAAE,EAAE,OAAO,CAAC,EAAE;QACd,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK;QAC9B,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI;QAChC,WAAW,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;QACnD,iBAAiB,EAAE,sBAAsB;QACzC,WAAW,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;QACnD,iBAAiB,EAAE,sBAAsB;QACzC,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO;QACjC,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;QAC/C,QAAQ,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;QAChD,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK;QAC/B,SAAS,EAAE,OAAO;QAClB,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,IAAI;KACO,CAAC;AACxB,CAAC"}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchItemJobRecords = void 0;
4
+ const HubError_1 = require("../HubError");
5
+ const types_1 = require("./types");
6
+ /**
7
+ * Fetches job records for a specific item.
8
+ *
9
+ * @param id - The ID of the item.
10
+ * @param options - The options for fetching job records.
11
+ * @returns A promise that resolves to an array of job records.
12
+ * @throws {HubError} If any unimplemented options are provided.
13
+ */
14
+ async function fetchItemJobRecords(id, options) {
15
+ const unimplementedOptions = [
16
+ "types",
17
+ "statuses",
18
+ ];
19
+ if (unimplementedOptions.some((option) => options[option])) {
20
+ throw new HubError_1.default("fetchItemJobRecords", `The following options are not yet implemented: ${unimplementedOptions.join(", ")}`);
21
+ }
22
+ const { context } = options;
23
+ const requestUrl = `${context.hubUrl}/api/download/v1/items/${id}/errors${getQueryString(options)}`;
24
+ const { errors: rawErrors } = await fetch(requestUrl).then((response) => response.json());
25
+ // TODO: account for additional row types once the API supports them
26
+ return rawErrors.map(rowToDownloadJobRecord);
27
+ }
28
+ exports.fetchItemJobRecords = fetchItemJobRecords;
29
+ function getQueryString(options) {
30
+ const params = new URLSearchParams();
31
+ options.from && params.append("fromDate", options.from);
32
+ options.to && params.append("toDate", options.to);
33
+ options.limit && params.append("limit", options.limit.toString());
34
+ const result = params.toString();
35
+ return result && `?${result}`;
36
+ }
37
+ function rowToDownloadJobRecord(row) {
38
+ return {
39
+ type: types_1.JobRecordType.DOWNLOAD,
40
+ message: row.message,
41
+ created: new Date(row.timestamp).getTime(),
42
+ layerId: row.layerId,
43
+ // implement the rest of the fields once the API supports them
44
+ id: null,
45
+ status: null,
46
+ messageId: null,
47
+ modified: null,
48
+ };
49
+ }
50
+ //# sourceMappingURL=fetchItemJobRecords.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchItemJobRecords.js","sourceRoot":"","sources":["../../../src/content/fetchItemJobRecords.ts"],"names":[],"mappings":";;;AAAA,0CAAmC;AACnC,mCAKiB;AAEjB;;;;;;;GAOG;AACI,KAAK,UAAU,mBAAmB,CACvC,EAAU,EACV,OAAoC;IAEpC,MAAM,oBAAoB,GAA6C;QACrE,OAAO;QACP,UAAU;KACX,CAAC;IACF,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CA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AC,CAAC,OAAO,EAAE;QAC1C,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,8DAA8D;QAC9D,EAAE,EAAE,IAAI;QACR,MAAM,EAAE,IAAI;QACZ,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,IAAI;KACf,CAAC;AACJ,CAAC"}
@@ -13,4 +13,5 @@ tslib_1.__exportStar(require("./search"), exports);
13
13
  tslib_1.__exportStar(require("./slugs"), exports);
14
14
  tslib_1.__exportStar(require("./types"), exports);
15
15
  tslib_1.__exportStar(require("./hostedServiceUtils"), exports);
16
+ tslib_1.__exportStar(require("./fetchItemJobRecords"), exports);
16
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/content/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B;AAC1B,uDAA6B;AAC7B,oDAA0B;AAC1B,yDAA+B;AAC/B,iDAAuB;AACvB,kDAAwB;AACxB,uDAA6B;AAC7B,uDAA6B;AAC7B,mDAAyB;AACzB,kDAAwB;AACxB,kDAAwB;AACxB,+DAAqC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/content/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B;AAC1B,uDAA6B;AAC7B,oDAA0B;AAC1B,yDAA+B;AAC/B,iDAAuB;AACvB,kDAAwB;AACxB,uDAA6B;AAC7B,uDAA6B;AAC7B,mDAAyB;AACzB,kDAAwB;AACxB,kDAAwB;AACxB,+DAAqC;AACrC,gEAAsC"}
@@ -1,3 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.JobRecordStatus = exports.JobRecordType = void 0;
4
+ var JobRecordType;
5
+ (function (JobRecordType) {
6
+ JobRecordType["DOWNLOAD"] = "download";
7
+ JobRecordType["UPDATE"] = "update";
8
+ })(JobRecordType = exports.JobRecordType || (exports.JobRecordType = {}));
9
+ var JobRecordStatus;
10
+ (function (JobRecordStatus) {
11
+ JobRecordStatus["SUCCESS"] = "success";
12
+ JobRecordStatus["ERROR"] = "error";
13
+ JobRecordStatus["WARNING"] = "warning";
14
+ JobRecordStatus["INFO"] = "info";
15
+ })(JobRecordStatus = exports.JobRecordStatus || (exports.JobRecordStatus = {}));
3
16
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/content/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/content/types.ts"],"names":[],"mappings":";;;AAgBA,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,sCAAqB,CAAA;IACrB,kCAAiB,CAAA;AACnB,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB;AAED,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,sCAAmB,CAAA;IACnB,kCAAe,CAAA;IACf,sCAAmB,CAAA;IACnB,gCAAa,CAAA;AACf,CAAC,EALW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAK1B"}
@@ -11,6 +11,7 @@ exports.ogcItemToDiscussionPostResult = void 0;
11
11
  */
12
12
  async function ogcItemToDiscussionPostResult(ogcItem) {
13
13
  return {
14
+ // Base IHubSearchResult properties
14
15
  id: ogcItem.id,
15
16
  name: ogcItem.properties.title,
16
17
  summary: ogcItem.properties.body,
@@ -18,13 +19,13 @@ async function ogcItemToDiscussionPostResult(ogcItem) {
18
19
  createdDateSource: "properties.createdAt",
19
20
  updatedDate: new Date(ogcItem.properties.updatedAt),
20
21
  updatedDateSource: "properties.updatedAt",
21
- type: ogcItem.properties.postType,
22
+ type: "post",
22
23
  owner: ogcItem.properties.creator,
23
- location: ogcItem.properties.geometry,
24
+ location: null,
24
25
  created: new Date(ogcItem.properties.createdAt),
25
26
  modified: new Date(ogcItem.properties.updatedAt),
26
27
  title: ogcItem.properties.title,
27
- rawResult: ogcItem.properties,
28
+ rawResult: ogcItem,
28
29
  access: null,
29
30
  family: null,
30
31
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ogcItemToDiscussionPostResult.js","sourceRoot":"","sources":["../../../../../src/search/_internal/hubSearchItemsHelpers/ogcItemToDiscussionPostResult.ts"],"names":[],"mappings":";;;AAIA;;;;;;;GAOG;AACI,KAAK,UAAU,6BAA6B,CACjD,OAAiB;IAEjB,OAAO;QACL,EAAE,EAAE,OAAO,CAAC,EAAE;QACd,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK;QAC9B,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI;QAChC,WAAW,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;QACnD,iBAAiB,EAAE,sBAAsB;QACzC,WAAW,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;QACnD,iBAAiB,EAAE,sBAAsB;QACzC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ;QACjC,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO;QACjC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ;QACrC,OAAO,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;QAC/C,QAAQ,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;QAChD,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK;QAC/B,SAAS,EAAE,OAAO,CAAC,UAAU;QAC7B,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,IAAI;KACO,CAAC;AACxB,CAAC;AArBD,sEAqBC"}
1
+ {"version":3,"file":"ogcItemToDiscussionPostResult.js","sourceRoot":"","sources":["../../../../../src/search/_internal/hubSearchItemsHelpers/ogcItemToDiscussionPostResult.ts"],"names":[],"mappings":";;;AAGA;;;;;;;GAOG;AACI,KAAK,UAAU,6BAA6B,CACjD,OAAiB;IAEjB,OAAO;QACL,mCAAmC;QACnC,EAAE,EAAE,OAAO,CAAC,EAAE;QACd,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK;QAC9B,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI;QAChC,WAAW,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;QACnD,iBAAiB,EAAE,sBAAsB;QACzC,WAAW,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;QACnD,iBAAiB,EAAE,sBAAsB;QACzC,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO;QACjC,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;QAC/C,QAAQ,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;QAChD,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK;QAC/B,SAAS,EAAE,OAAO;QAClB,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,IAAI;KACO,CAAC;AACxB,CAAC;AAtBD,sEAsBC"}
@@ -0,0 +1,10 @@
1
+ import { IHubJobRecord, IHubJobRecordRequestOptions } from "./types";
2
+ /**
3
+ * Fetches job records for a specific item.
4
+ *
5
+ * @param id - The ID of the item.
6
+ * @param options - The options for fetching job records.
7
+ * @returns A promise that resolves to an array of job records.
8
+ * @throws {HubError} If any unimplemented options are provided.
9
+ */
10
+ export declare function fetchItemJobRecords(id: string, options: IHubJobRecordRequestOptions): Promise<IHubJobRecord[]>;
@@ -10,3 +10,4 @@ export * from "./search";
10
10
  export * from "./slugs";
11
11
  export * from "./types";
12
12
  export * from "./hostedServiceUtils";
13
+ export * from "./fetchItemJobRecords";
@@ -1,7 +1,62 @@
1
1
  import { ResourceObject } from "jsonapi-typescript";
2
+ import { IArcGISContext } from "../ArcGISContext";
2
3
  /**
3
4
  * JSONAPI dataset resource returned by the Hub API
4
5
  */
5
6
  export declare type DatasetResource = ResourceObject<"dataset", {
6
7
  [k: string]: any;
7
8
  }>;
9
+ export declare enum JobRecordType {
10
+ DOWNLOAD = "download",
11
+ UPDATE = "update"
12
+ }
13
+ export declare enum JobRecordStatus {
14
+ SUCCESS = "success",
15
+ ERROR = "error",
16
+ WARNING = "warning",
17
+ INFO = "info"
18
+ }
19
+ /**
20
+ * Represents a job record from the Hub API
21
+ */
22
+ export interface IHubJobRecord {
23
+ /** Unique entry id */
24
+ id: string;
25
+ /** Type of job record */
26
+ type: JobRecordType;
27
+ /** Status of the job record */
28
+ status: JobRecordStatus;
29
+ /** wellknown message id */
30
+ messageId: string;
31
+ /** untranslated plaintext message */
32
+ message: string;
33
+ /** Timestamp of when the job record was created */
34
+ created: number;
35
+ /** Timestamp of when the job record was last modified */
36
+ modified: number;
37
+ }
38
+ /**
39
+ * Represents a download job record from the Hub API
40
+ */
41
+ export interface IHubDownloadJobRecord extends IHubJobRecord {
42
+ type: JobRecordType.DOWNLOAD;
43
+ /** The layer associated with the download */
44
+ layerId?: string;
45
+ }
46
+ /**
47
+ * Request options for fetching job records
48
+ */
49
+ export interface IHubJobRecordRequestOptions {
50
+ /** Context object from consuming application */
51
+ context: IArcGISContext;
52
+ /** Job types to be included in the results */
53
+ types?: JobRecordType[];
54
+ /** Job statuses to be included in the results */
55
+ statuses?: JobRecordStatus[];
56
+ /** ISO Date string indicating the start date for the search */
57
+ from?: string;
58
+ /** ISO Date string indicating the end date of the search */
59
+ to?: string;
60
+ /** Total number of records to return */
61
+ limit?: number;
62
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/hub-common",
3
- "version": "14.108.4",
3
+ "version": "14.109.0",
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",