@esri/hub-common 9.48.0 → 9.49.2
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.
- package/dist/es2017/core/traits/WithCatalog.js +1 -0
- package/dist/es2017/core/traits/WithCatalog.js.map +1 -0
- package/dist/es2017/index.js +1 -0
- package/dist/es2017/index.js.map +1 -1
- package/dist/es2017/search/Catalog.js +346 -0
- package/dist/es2017/search/Catalog.js.map +1 -0
- package/dist/es2017/search/Collection.js +38 -19
- package/dist/es2017/search/Collection.js.map +1 -1
- package/dist/es2017/search/_internal/{ipredicate-utils.js → expandPredicate.js} +1 -1
- package/dist/es2017/search/_internal/expandPredicate.js.map +1 -0
- package/dist/es2017/search/_internal/portalSearchGroups.js +1 -1
- package/dist/es2017/search/_internal/portalSearchGroups.js.map +1 -1
- package/dist/es2017/search/_internal/portalSearchItems.js +1 -1
- package/dist/es2017/search/_internal/portalSearchItems.js.map +1 -1
- package/dist/es2017/search/_internal/portalSearchUsers.js +1 -1
- package/dist/es2017/search/_internal/portalSearchUsers.js.map +1 -1
- package/dist/es2017/search/fetchCatalog.js +46 -0
- package/dist/es2017/search/fetchCatalog.js.map +1 -0
- package/dist/es2017/search/hubSearch.js +1 -1
- package/dist/es2017/search/hubSearch.js.map +1 -1
- package/dist/es2017/search/index.js +3 -1
- package/dist/es2017/search/index.js.map +1 -1
- package/dist/es2017/search/serializeQueryForPortal.js +3 -2
- package/dist/es2017/search/serializeQueryForPortal.js.map +1 -1
- package/dist/es2017/search/upgradeCatalogSchema.js +66 -0
- package/dist/es2017/search/upgradeCatalogSchema.js.map +1 -0
- package/dist/es2017/types/IMessage.js +1 -0
- package/dist/es2017/types/IMessage.js.map +1 -0
- package/dist/es2017/types/index.js +2 -0
- package/dist/es2017/types/index.js.map +1 -0
- package/dist/esm/core/traits/WithCatalog.js +1 -0
- package/dist/esm/core/traits/WithCatalog.js.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/search/Catalog.js +404 -0
- package/dist/esm/search/Catalog.js.map +1 -0
- package/dist/esm/search/Collection.js +40 -24
- package/dist/esm/search/Collection.js.map +1 -1
- package/dist/esm/search/_internal/{ipredicate-utils.js → expandPredicate.js} +1 -1
- package/dist/esm/search/_internal/expandPredicate.js.map +1 -0
- package/dist/esm/search/_internal/portalSearchGroups.js +1 -1
- package/dist/esm/search/_internal/portalSearchGroups.js.map +1 -1
- package/dist/esm/search/_internal/portalSearchItems.js +1 -1
- package/dist/esm/search/_internal/portalSearchItems.js.map +1 -1
- package/dist/esm/search/_internal/portalSearchUsers.js +1 -1
- package/dist/esm/search/_internal/portalSearchUsers.js.map +1 -1
- package/dist/esm/search/fetchCatalog.js +59 -0
- package/dist/esm/search/fetchCatalog.js.map +1 -0
- package/dist/esm/search/hubSearch.js +1 -1
- package/dist/esm/search/hubSearch.js.map +1 -1
- package/dist/esm/search/index.js +3 -1
- package/dist/esm/search/index.js.map +1 -1
- package/dist/esm/search/serializeQueryForPortal.js +3 -2
- package/dist/esm/search/serializeQueryForPortal.js.map +1 -1
- package/dist/esm/search/upgradeCatalogSchema.js +66 -0
- package/dist/esm/search/upgradeCatalogSchema.js.map +1 -0
- package/dist/esm/types/IMessage.js +1 -0
- package/dist/esm/types/IMessage.js.map +1 -0
- package/dist/esm/types/index.js +2 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/node/core/traits/WithCatalog.js +3 -0
- package/dist/node/core/traits/WithCatalog.js.map +1 -0
- package/dist/node/index.js +1 -0
- package/dist/node/index.js.map +1 -1
- package/dist/node/search/Catalog.js +350 -0
- package/dist/node/search/Catalog.js.map +1 -0
- package/dist/node/search/Collection.js +37 -18
- package/dist/node/search/Collection.js.map +1 -1
- package/dist/node/search/_internal/{ipredicate-utils.js → expandPredicate.js} +1 -1
- package/dist/node/search/_internal/expandPredicate.js.map +1 -0
- package/dist/node/search/_internal/portalSearchGroups.js +2 -2
- package/dist/node/search/_internal/portalSearchGroups.js.map +1 -1
- package/dist/node/search/_internal/portalSearchItems.js +2 -2
- package/dist/node/search/_internal/portalSearchItems.js.map +1 -1
- package/dist/node/search/_internal/portalSearchUsers.js +2 -2
- package/dist/node/search/_internal/portalSearchUsers.js.map +1 -1
- package/dist/node/search/fetchCatalog.js +50 -0
- package/dist/node/search/fetchCatalog.js.map +1 -0
- package/dist/node/search/hubSearch.js +1 -1
- package/dist/node/search/hubSearch.js.map +1 -1
- package/dist/node/search/index.js +3 -1
- package/dist/node/search/index.js.map +1 -1
- package/dist/node/search/serializeQueryForPortal.js +4 -3
- package/dist/node/search/serializeQueryForPortal.js.map +1 -1
- package/dist/node/search/upgradeCatalogSchema.js +71 -0
- package/dist/node/search/upgradeCatalogSchema.js.map +1 -0
- package/dist/node/types/IMessage.js +3 -0
- package/dist/node/types/IMessage.js.map +1 -0
- package/dist/node/types/index.js +5 -0
- package/dist/node/types/index.js.map +1 -0
- package/dist/types/core/traits/WithCatalog.d.ts +7 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/search/Catalog.d.ts +143 -0
- package/dist/types/search/Collection.d.ts +23 -2
- package/dist/types/search/_internal/{ipredicate-utils.d.ts → expandPredicate.d.ts} +0 -0
- package/dist/types/search/fetchCatalog.d.ts +10 -0
- package/dist/types/search/index.d.ts +3 -1
- package/dist/types/search/types/IHubSearchOptions.d.ts +5 -1
- package/dist/types/search/types/IHubSearchResponse.d.ts +5 -0
- package/dist/types/search/upgradeCatalogSchema.d.ts +12 -0
- package/dist/types/types/IMessage.d.ts +32 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/umd/common.umd.js +635 -33
- package/dist/umd/common.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/es2017/search/_internal/ipredicate-utils.js.map +0 -1
- package/dist/es2017/search/convertCatalog.js +0 -33
- package/dist/es2017/search/convertCatalog.js.map +0 -1
- package/dist/esm/search/_internal/ipredicate-utils.js.map +0 -1
- package/dist/esm/search/convertCatalog.js +0 -33
- package/dist/esm/search/convertCatalog.js.map +0 -1
- package/dist/node/search/_internal/ipredicate-utils.js.map +0 -1
- package/dist/node/search/convertCatalog.js +0 -37
- package/dist/node/search/convertCatalog.js.map +0 -1
- package/dist/types/search/convertCatalog.d.ts +0 -6
|
@@ -63,7 +63,7 @@ async function hubSearch(query, options) {
|
|
|
63
63
|
};
|
|
64
64
|
const fn = objects_1.getProp(fnHash, `${apiType}.${filterType}`);
|
|
65
65
|
if (!fn) {
|
|
66
|
-
throw new HubError_1.default(`hubSearch`, `Search via "${filterType}" filter against "${apiType}" api is not implemented
|
|
66
|
+
throw new HubError_1.default(`hubSearch`, `Search via "${filterType}" filter against "${apiType}" api is not implemented. Please ensure "targetEntity" is defined on the query.`);
|
|
67
67
|
}
|
|
68
68
|
return fn(util_1.cloneObject(query), options);
|
|
69
69
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hubSearch.js","sourceRoot":"","sources":["../../../src/search/hubSearch.ts"],"names":[],"mappings":";;;AAAA,0CAAmC;AACnC,wCAAqC;AACrC,kCAAsC;AAQtC,mCAAoC;AACpC,2CAKqB;AAErB;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,cAAc,CAClC,KAAa,EACb,OAA0B;IAE1B,WAAW;IACX,OAAO,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACnC,CAAC;AAND,wCAMC;AAED;;;;;;;;GAQG;AACI,KAAK,UAAU,SAAS,CAC7B,KAAa,EACb,OAA0B;IAE1B,kBAAkB;IAClB,IAAI,CAAC,KAAK,EAAE;QACV,MAAM,IAAI,kBAAQ,CAAC,WAAW,EAAE,oBAAoB,CAAC,CAAC;KACvD;IACD,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE;QAC3C,MAAM,IAAI,kBAAQ,CAAC,WAAW,EAAE,yCAAyC,CAAC,CAAC;KAC5E;IAED,IAAI,CAAC,OAAO,CAAC,cAAc,EAA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AAC,KAAK,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE;QAC3C,MAAM,IAAI,kBAAQ,CAAC,WAAW,EAAE,yCAAyC,CAAC,CAAC;KAC5E;IAED,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE;QAC3B,MAAM,IAAI,kBAAQ,CAChB,WAAW,EACX,iDAAiD,CAClD,CAAC;KACH;IAED,8BAA8B;IAC9B,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;QACpB,OAAO,CAAC,OAAO,GAAG,EAAE,CAAC;KACtB;IAED,wCAAwC;IACxC,MAAM,UAAU,GAAG,KAAK,CAAC,YAAY,CAAC;IACtC,cAAc;IACd,MAAM,OAAO,GAAG,iBAAS,CAAC,OAAO,CAAC,GAAG,IAAI,QAAQ,CAAC,CAAC,IAAI,CAAC;IAExD,MAAM,MAAM,GAAG;QACb,MAAM,EAAE;YACN,IAAI,EAAE,6BAAiB;YACvB,KAAK,EAAE,8BAAkB;YACzB,IAAI,EAAE,6BAAiB;SACxB;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,0BAAc;SACrB;KACF,CAAC;IAEF,MAAM,EAAE,GAAG,iBAAO,CAAC,MAAM,EAAE,GAAG,OAAO,IAAI,UAAU,EAAE,CAAC,CAAC;IACvD,IAAI,CAAC,EAAE,EAAE;QACP,MAAM,IAAI,kBAAQ,CAChB,WAAW,EACX,eAAe,UAAU,qBAAqB,OAAO,iFAAiF,CACvI,CAAC;KACH;IACD,OAAO,EAAE,CAAC,kBAAW,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC;AAhDD,8BAgDC"}
|
|
@@ -11,8 +11,10 @@ tslib_1.__exportStar(require("./_searchGroups"), exports);
|
|
|
11
11
|
tslib_1.__exportStar(require("./_searchUsers"), exports);
|
|
12
12
|
tslib_1.__exportStar(require("./types"), exports);
|
|
13
13
|
tslib_1.__exportStar(require("./collectionState"), exports);
|
|
14
|
-
tslib_1.__exportStar(require("./
|
|
14
|
+
tslib_1.__exportStar(require("./upgradeCatalogSchema"), exports);
|
|
15
15
|
tslib_1.__exportStar(require("./filter-utils"), exports);
|
|
16
16
|
tslib_1.__exportStar(require("./serializeQueryForPortal"), exports);
|
|
17
17
|
tslib_1.__exportStar(require("./hubSearch"), exports);
|
|
18
|
+
tslib_1.__exportStar(require("./Catalog"), exports);
|
|
19
|
+
tslib_1.__exportStar(require("./Collection"), exports);
|
|
18
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/search/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC;AACjC,0DAAgC;AAChC,wDAA8B;AAC9B,uDAA6B;AAC7B,kDAAwB;AACxB,2DAAiC;AACjC,0DAAgC;AAChC,yDAA+B;AAC/B,kDAAwB;AACxB,4DAAkC;AAClC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/search/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC;AACjC,0DAAgC;AAChC,wDAA8B;AAC9B,uDAA6B;AAC7B,kDAAwB;AACxB,2DAAiC;AACjC,0DAAgC;AAChC,yDAA+B;AAC/B,kDAAwB;AACxB,4DAAkC;AAClC,iEAAuC;AACvC,yDAA+B;AAC/B,oEAA0C;AAC1C,sDAA4B;AAC5B,oDAA0B;AAC1B,uDAA6B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.serializeQueryForPortal = void 0;
|
|
4
|
-
const
|
|
4
|
+
const expandPredicate_1 = require("./_internal/expandPredicate");
|
|
5
5
|
/**
|
|
6
6
|
* Serialize IQuery into ISearchOptions for ArcGIS Portal
|
|
7
7
|
* @param query
|
|
@@ -50,7 +50,7 @@ function mergeSearchOptions(options, operation) {
|
|
|
50
50
|
*/
|
|
51
51
|
function serializeFilter(filter) {
|
|
52
52
|
const operation = filter.operation || "AND";
|
|
53
|
-
const predicates = filter.predicates.map(
|
|
53
|
+
const predicates = filter.predicates.map(expandPredicate_1.expandPredicate);
|
|
54
54
|
const predicateSearchOptions = predicates
|
|
55
55
|
.map(serializePredicate)
|
|
56
56
|
.filter((e) => e !== undefined && e !== null);
|
|
@@ -81,6 +81,7 @@ function serializePredicate(predicate) {
|
|
|
81
81
|
const portalAllowList = [
|
|
82
82
|
"access",
|
|
83
83
|
"categories",
|
|
84
|
+
"capabilities",
|
|
84
85
|
"created",
|
|
85
86
|
"description",
|
|
86
87
|
"disabled",
|
|
@@ -149,7 +150,7 @@ function serializePredicate(predicate) {
|
|
|
149
150
|
// merge up all the searchOptions
|
|
150
151
|
if (opts.length) {
|
|
151
152
|
const searchOptions = mergeSearchOptions(opts, "AND");
|
|
152
|
-
if (
|
|
153
|
+
if (searchOptions.q) {
|
|
153
154
|
searchOptions.q = `(${searchOptions.q})`;
|
|
154
155
|
}
|
|
155
156
|
return searchOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializeQueryForPortal.js","sourceRoot":"","sources":["../../../src/search/serializeQueryForPortal.ts"],"names":[],"mappings":";;;AAQA,
|
|
1
|
+
{"version":3,"file":"serializeQueryForPortal.js","sourceRoot":"","sources":["../../../src/search/serializeQueryForPortal.ts"],"names":[],"mappings":";;;AAQA,iEAA8D;AAE9D;;;;GAIG;AACH,SAAgB,uBAAuB,CAAC,KAAa;IACnD,MAAM,mBAAmB,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAC/D,2BAA2B;IAC3B,MAAM,eAAe,GAAG,mBAAmB,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;IACvE,MAAM,MAAM,GAAG,kBAAkB,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IAE1D,OAAO,MAAM,CAAC;AAChB,CAAC;AAPD,0DAOC;AAED;;;;GAIG;AACH,SAAS,kBA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B,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC;SACd;KACF;SAAM;QACL,CAAC,GAAG,GAAG,GAAG,KAAK,KAAK,GAAG,CAAC;KACzB;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertCatalog = exports.upgradeCatalogSchema = void 0;
|
|
4
|
+
const objects_1 = require("../objects");
|
|
5
|
+
const util_1 = require("../util");
|
|
6
|
+
const CATALOG_SCHEMA_VERSION = 1.0;
|
|
7
|
+
/**
|
|
8
|
+
* Apply schema upgrades to Catalog objects
|
|
9
|
+
* @param catalog
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
function upgradeCatalogSchema(catalog) {
|
|
13
|
+
let clone = util_1.cloneObject(catalog);
|
|
14
|
+
if (objects_1.getProp(clone, "schemaVersion") === CATALOG_SCHEMA_VERSION) {
|
|
15
|
+
return clone;
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
// apply migrations in order
|
|
19
|
+
clone = applyCatalogSchema(clone);
|
|
20
|
+
return clone;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.upgradeCatalogSchema = upgradeCatalogSchema;
|
|
24
|
+
/**
|
|
25
|
+
* Apply the Catalog schema to the original, unversioned
|
|
26
|
+
* site catalog objects
|
|
27
|
+
* @param original
|
|
28
|
+
* @returns
|
|
29
|
+
*/
|
|
30
|
+
function applyCatalogSchema(original) {
|
|
31
|
+
if (objects_1.getProp(original, "schemaVersion") > 1.0) {
|
|
32
|
+
return original;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
const catalog = {
|
|
36
|
+
schemaVersion: 1,
|
|
37
|
+
title: "Default Catalog",
|
|
38
|
+
scopes: {
|
|
39
|
+
item: {
|
|
40
|
+
targetEntity: "item",
|
|
41
|
+
filters: [],
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
collections: [],
|
|
45
|
+
};
|
|
46
|
+
const rawGroups = objects_1.getProp(original, "groups");
|
|
47
|
+
let groups = [];
|
|
48
|
+
if (Array.isArray(rawGroups) && rawGroups.length) {
|
|
49
|
+
groups = rawGroups;
|
|
50
|
+
}
|
|
51
|
+
else if (typeof rawGroups === "string") {
|
|
52
|
+
groups = [rawGroups];
|
|
53
|
+
}
|
|
54
|
+
if (groups.length) {
|
|
55
|
+
catalog.scopes.item.filters.push({
|
|
56
|
+
predicates: [{ group: groups }],
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return catalog;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* DEPRECATED: Use upgradeCatalogSchema(...)
|
|
64
|
+
* @param original
|
|
65
|
+
*/
|
|
66
|
+
/* istanbul ignore next */
|
|
67
|
+
function convertCatalog(original) {
|
|
68
|
+
return upgradeCatalogSchema(original);
|
|
69
|
+
}
|
|
70
|
+
exports.convertCatalog = convertCatalog;
|
|
71
|
+
//# sourceMappingURL=upgradeCatalogSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upgradeCatalogSchema.js","sourceRoot":"","sources":["../../../src/search/upgradeCatalogSchema.ts"],"names":[],"mappings":";;;AAAA,wCAAqC;AACrC,kCAAsC;AAGtC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAEnC;;;;GAIG;AACH,SAAgB,oBAAoB,CAAC,OAAY;IAC/C,IAAI,KAAK,GAAG,kBAAW,CAAC,OAAO,CAAC,CAAC;IACjC,IAAI,iBAAO,CAAC,KAAK,EAAE,eAAe,CAAC,KAAK,sBAAsB,EAAE;QAC9D,OAAO,KAAK,CAAC;KACd;SAAM;QACL,4BAA4B;QAC5B,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAElC,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AAVD,oDAUC;AAED;;;;;GAKG;AACH,SAAS,kBAAkB,CAAC,QAAa;IACvC,IAAI,iBAAO,CAAC,QAAQ,EAAE,eAAe,CAAC,GAAG,GAAG,EAAE;QAC5C,OAAO,QAAuB,CAAC;KAChC;SAAM;QACL,MAAM,OAAO,GAAgB;YAC3B,aAAa,EAAE,CAAC;YAChB,KAAK,EAAE,iBAAiB;YACxB,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,YAAY,EAAE,MAAM;oBACpB,OAAO,EAAE,EAAE;iBACZ;aACF;YACD,WAAW,EAAE,EAAE;SAChB,CAAC;QAEF,MAAM,SAAS,GAAG,iBAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC9C,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,MAAM,EAAE;YAChD,MAAM,GAAG,SAAS,CAAC;SACpB;aAAM,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE;YACxC,MAAM,GAAG,CAAC,SAAS,CAAC,CAAC;SACtB;QAED,IAAI,MAAM,CAAC,MAAM,EAAE;YACjB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;gBAC/B,UAAU,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;aAChC,CAAC,CAAC;SACJ;QAED,OAAO,OAAO,CAAC;KAChB;AACH,CAAC;AAED;;;GAGG;AACH,0BAA0B;AAC1B,SAAgB,cAAc,CAAC,QAAa;IAC1C,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC;AACxC,CAAC;AAFD,wCAEC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IMessage.js","sourceRoot":"","sources":["../../../src/types/IMessage.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export * from "./Hub";
|
|
|
27
27
|
export * from "./pages";
|
|
28
28
|
export * from "./org";
|
|
29
29
|
export * from "./users";
|
|
30
|
+
export * from "./types";
|
|
30
31
|
import OperationStack from "./OperationStack";
|
|
31
32
|
import OperationError from "./OperationError";
|
|
32
33
|
import HubError from "./HubError";
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { IArcGISContext } from "../ArcGISContext";
|
|
2
|
+
import { Collection } from "./Collection";
|
|
3
|
+
import { IHubSearchOptions, IHubSearchResponse, IHubSearchResult } from "./types";
|
|
4
|
+
import { EntityType, ICatalogScope, IHubCatalog, IQuery } from "./types/IHubCatalog";
|
|
5
|
+
/**
|
|
6
|
+
* Response from a Catalog search operation where the responses for different collections
|
|
7
|
+
* or entities are grouped into a single object.
|
|
8
|
+
*/
|
|
9
|
+
export interface ISearchResponseHash extends Record<string, IHubSearchResponse<IHubSearchResult>> {
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Catalog Class
|
|
13
|
+
*
|
|
14
|
+
* Abstracts working with Catalogs and fetching collections with
|
|
15
|
+
* the correct scope applied.
|
|
16
|
+
*
|
|
17
|
+
* For more information, check out the [Catalog & Collection Guide](/hub.js/guides/concepts/catalog-collection/)
|
|
18
|
+
*/
|
|
19
|
+
export declare class Catalog implements IHubCatalog {
|
|
20
|
+
private _context;
|
|
21
|
+
private _catalog;
|
|
22
|
+
private constructor();
|
|
23
|
+
/**
|
|
24
|
+
* Create a Collection instance from a Catalog json object, a site url or itemId
|
|
25
|
+
* '''js
|
|
26
|
+
* const catalog = await Catalog.create('https://site-org.hub.arcgis.com', context);
|
|
27
|
+
* '''
|
|
28
|
+
*
|
|
29
|
+
* @param identifier
|
|
30
|
+
* @param context
|
|
31
|
+
* @returns
|
|
32
|
+
*/
|
|
33
|
+
static init(identifier: string, context?: IArcGISContext): Promise<Catalog>;
|
|
34
|
+
/**
|
|
35
|
+
* Create a Catalog instance from a Catalog Json object
|
|
36
|
+
* @param json
|
|
37
|
+
* @param context
|
|
38
|
+
* @returns
|
|
39
|
+
*/
|
|
40
|
+
static fromJson(json: any, context?: IArcGISContext): Catalog;
|
|
41
|
+
/**
|
|
42
|
+
* Return the JSON object backing the instance
|
|
43
|
+
* @returns
|
|
44
|
+
*/
|
|
45
|
+
toJson(): IHubCatalog;
|
|
46
|
+
/**
|
|
47
|
+
* Return the schema version
|
|
48
|
+
*/
|
|
49
|
+
get schemaVersion(): number;
|
|
50
|
+
/**
|
|
51
|
+
* Title getter
|
|
52
|
+
*/
|
|
53
|
+
get title(): string;
|
|
54
|
+
/**
|
|
55
|
+
* Title setter
|
|
56
|
+
*/
|
|
57
|
+
set title(v: string);
|
|
58
|
+
/**
|
|
59
|
+
* Return the existing scopes hash
|
|
60
|
+
*/
|
|
61
|
+
get scopes(): ICatalogScope;
|
|
62
|
+
/**
|
|
63
|
+
* Return an array of the entity types available in this Catalog
|
|
64
|
+
*/
|
|
65
|
+
get availableScopes(): EntityType[];
|
|
66
|
+
/**
|
|
67
|
+
* Get the scope's query for a particular entity type
|
|
68
|
+
* @param type
|
|
69
|
+
* @returns
|
|
70
|
+
*/
|
|
71
|
+
getScope(type: EntityType): IQuery | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* Set the scope for a specific entity type
|
|
74
|
+
* @param type
|
|
75
|
+
* @param query
|
|
76
|
+
*/
|
|
77
|
+
setScope(type: EntityType, query: IQuery): void;
|
|
78
|
+
/**
|
|
79
|
+
* Get the collections array. Returns simple objects not Collection instances
|
|
80
|
+
*/
|
|
81
|
+
get collections(): import("./types").IHubCollection[];
|
|
82
|
+
/**
|
|
83
|
+
* Get the names of the collections
|
|
84
|
+
*/
|
|
85
|
+
get collectionNames(): string[];
|
|
86
|
+
/**
|
|
87
|
+
* Get a Collection instance by name
|
|
88
|
+
* @param name
|
|
89
|
+
* @returns
|
|
90
|
+
*/
|
|
91
|
+
getCollection(name: string): Collection;
|
|
92
|
+
/**
|
|
93
|
+
* Search for Items
|
|
94
|
+
* Will throw if the Catalog does not have a scope defined for items
|
|
95
|
+
* @param query
|
|
96
|
+
* @param options
|
|
97
|
+
* @returns
|
|
98
|
+
*/
|
|
99
|
+
searchItems(query: string | IQuery, options?: IHubSearchOptions): Promise<IHubSearchResponse<IHubSearchResult>>;
|
|
100
|
+
/**
|
|
101
|
+
* Search for Groups
|
|
102
|
+
* Will throw if the Catalog does not have a scope defined for groups
|
|
103
|
+
* @param query
|
|
104
|
+
* @param options
|
|
105
|
+
* @returns
|
|
106
|
+
*/
|
|
107
|
+
searchGroups(query: string | IQuery, options?: IHubSearchOptions): Promise<IHubSearchResponse<IHubSearchResult>>;
|
|
108
|
+
/**
|
|
109
|
+
* Search for Users
|
|
110
|
+
* Will throw if the Catalog does not have a scope defined for users
|
|
111
|
+
* @param query
|
|
112
|
+
* @param options
|
|
113
|
+
* @returns
|
|
114
|
+
*/
|
|
115
|
+
searchUsers(query: string | IQuery, options?: IHubSearchOptions): Promise<IHubSearchResponse<IHubSearchResult>>;
|
|
116
|
+
/**
|
|
117
|
+
* Execute a search against all the collections in the Catalog
|
|
118
|
+
* @param query
|
|
119
|
+
* @param options
|
|
120
|
+
* @returns
|
|
121
|
+
*/
|
|
122
|
+
searchCollections(query: string, options?: IHubSearchOptions): Promise<ISearchResponseHash>;
|
|
123
|
+
/**
|
|
124
|
+
* Execute a search against all the scopes in the Catalog
|
|
125
|
+
* @param query
|
|
126
|
+
* @param options
|
|
127
|
+
* @returns
|
|
128
|
+
*/
|
|
129
|
+
searchScopes(query: string, options?: IHubSearchOptions): Promise<ISearchResponseHash>;
|
|
130
|
+
/**
|
|
131
|
+
* Execute a search against the Catalog as a whole
|
|
132
|
+
* @param query
|
|
133
|
+
* @param targetEntity
|
|
134
|
+
* @returns
|
|
135
|
+
*/
|
|
136
|
+
private search;
|
|
137
|
+
/**
|
|
138
|
+
* Construct an empty result. Returned when a search is performed against an entity type that
|
|
139
|
+
* does not have a scope defined.
|
|
140
|
+
* @returns
|
|
141
|
+
*/
|
|
142
|
+
private getEmptyResult;
|
|
143
|
+
}
|
|
@@ -1,13 +1,28 @@
|
|
|
1
1
|
import { IArcGISContext } from "..";
|
|
2
2
|
import { EntityType, IHubCollection, IHubSearchOptions, IHubSearchResponse, IHubSearchResult, IQuery } from "./types";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Collection Class
|
|
5
|
+
*
|
|
6
|
+
* Abstracts searching a Collection
|
|
7
|
+
*
|
|
8
|
+
* For more information, check out the [Catalog & Collection Guide](/hub.js/guides/concepts/catalog-collection/)
|
|
5
9
|
*/
|
|
6
10
|
export declare class Collection implements IHubCollection {
|
|
7
11
|
private _context;
|
|
8
12
|
private _collection;
|
|
9
13
|
private constructor();
|
|
10
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Create an instance of a Collection from a JSON object
|
|
16
|
+
* @param collection
|
|
17
|
+
* @param context
|
|
18
|
+
* @returns
|
|
19
|
+
*/
|
|
20
|
+
static fromJson(collection: IHubCollection, context: IArcGISContext): Collection;
|
|
21
|
+
/**
|
|
22
|
+
* Return the JSON object backing the instance
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
toJson(): IHubCollection;
|
|
11
26
|
get label(): string;
|
|
12
27
|
get key(): string;
|
|
13
28
|
get include(): string[];
|
|
@@ -15,5 +30,11 @@ export declare class Collection implements IHubCollection {
|
|
|
15
30
|
get sortField(): string;
|
|
16
31
|
get sortDirection(): "asc" | "desc";
|
|
17
32
|
get targetEntity(): EntityType;
|
|
33
|
+
/**
|
|
34
|
+
* Search the collection using a string or IQuery
|
|
35
|
+
* @param query
|
|
36
|
+
* @param options
|
|
37
|
+
* @returns
|
|
38
|
+
*/
|
|
18
39
|
search(query: string | IQuery, options?: IHubSearchOptions): Promise<IHubSearchResponse<IHubSearchResult>>;
|
|
19
40
|
}
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IHubRequestOptions } from "../types";
|
|
2
|
+
import { IHubCatalog } from "./types/IHubCatalog";
|
|
3
|
+
/**
|
|
4
|
+
* Fetch a IHubCatalog from a backing item.
|
|
5
|
+
* This will apply schema upgrades to the structure
|
|
6
|
+
* @param identifier
|
|
7
|
+
* @param requestOptions
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
export declare function fetchCatalog(identifier: string, requestOptions: IHubRequestOptions): Promise<IHubCatalog>;
|
|
@@ -8,7 +8,9 @@ export * from "./_searchGroups";
|
|
|
8
8
|
export * from "./_searchUsers";
|
|
9
9
|
export * from "./types";
|
|
10
10
|
export * from "./collectionState";
|
|
11
|
-
export * from "./
|
|
11
|
+
export * from "./upgradeCatalogSchema";
|
|
12
12
|
export * from "./filter-utils";
|
|
13
13
|
export * from "./serializeQueryForPortal";
|
|
14
14
|
export * from "./hubSearch";
|
|
15
|
+
export * from "./Catalog";
|
|
16
|
+
export * from "./Collection";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UserSession } from "@esri/arcgis-rest-auth";
|
|
2
|
-
import { IHubRequestOptions, IModel } from "
|
|
2
|
+
import { EntityType, IHubRequestOptions, IModel } from "../../index";
|
|
3
3
|
import { NamedApis, IApiDefinition } from "./types";
|
|
4
4
|
export declare type Enrichments = "data" | "metadata" | "org" | "service" | "layers";
|
|
5
5
|
/**
|
|
@@ -42,6 +42,10 @@ export interface IHubSearchOptions {
|
|
|
42
42
|
* DEPRECATED: Use `include` instead
|
|
43
43
|
*/
|
|
44
44
|
enrichments?: Enrichments[];
|
|
45
|
+
/**
|
|
46
|
+
* Specify what entity to search for; For use with hubSearch
|
|
47
|
+
*/
|
|
48
|
+
targetEntity?: EntityType;
|
|
45
49
|
/**
|
|
46
50
|
* Maximum number of results to return, per-page
|
|
47
51
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IMessage } from "../../types/IMessage";
|
|
1
2
|
import { IFacet } from "./IFacet";
|
|
2
3
|
import { IHubAggregation } from "./IHubAggregation";
|
|
3
4
|
/**
|
|
@@ -30,6 +31,10 @@ export interface IHubSearchResponse<T> {
|
|
|
30
31
|
* Array of requested aggregations
|
|
31
32
|
*/
|
|
32
33
|
aggregations?: IHubAggregation[];
|
|
34
|
+
/**
|
|
35
|
+
* Array of messages / warnings
|
|
36
|
+
*/
|
|
37
|
+
messages?: IMessage[];
|
|
33
38
|
/**
|
|
34
39
|
* DEPRECATED - hub.js no longer computes facets; consumers need to construct them from aggregations
|
|
35
40
|
*/
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IHubCatalog } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Apply schema upgrades to Catalog objects
|
|
4
|
+
* @param catalog
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
export declare function upgradeCatalogSchema(catalog: any): IHubCatalog;
|
|
8
|
+
/**
|
|
9
|
+
* DEPRECATED: Use upgradeCatalogSchema(...)
|
|
10
|
+
* @param original
|
|
11
|
+
*/
|
|
12
|
+
export declare function convertCatalog(original: any): IHubCatalog;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic structure for returning a translatable message from
|
|
3
|
+
* one package to another, such that the calling package is responsible
|
|
4
|
+
* for the translation
|
|
5
|
+
*
|
|
6
|
+
* @export
|
|
7
|
+
* @interface IMessage
|
|
8
|
+
*/
|
|
9
|
+
export interface IMessage {
|
|
10
|
+
/**
|
|
11
|
+
* Unique key that can be used with a i18n system in a consuming application
|
|
12
|
+
*
|
|
13
|
+
* @type {string}
|
|
14
|
+
* @memberof IMessage
|
|
15
|
+
*/
|
|
16
|
+
code: string;
|
|
17
|
+
/**
|
|
18
|
+
* English message describing the issue, for debugging only. Not intended to be shown
|
|
19
|
+
* in an application interface.
|
|
20
|
+
*
|
|
21
|
+
* @type {string}
|
|
22
|
+
* @memberof IMessage
|
|
23
|
+
*/
|
|
24
|
+
message: string;
|
|
25
|
+
/**
|
|
26
|
+
* Optional data that can be sent along
|
|
27
|
+
*
|
|
28
|
+
* @type {Record<string, unknown>}
|
|
29
|
+
* @memberof IMessage
|
|
30
|
+
*/
|
|
31
|
+
data?: Record<string, unknown>;
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./IMessage";
|