@esri/hub-common 16.6.0 → 16.6.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.
Files changed (34) hide show
  1. package/dist/esm/items/_internal/ensureUniqueEntitySlug.js +7 -0
  2. package/dist/esm/items/_internal/ensureUniqueEntitySlug.js.map +1 -1
  3. package/dist/esm/items/fetch.js +13 -1
  4. package/dist/esm/items/fetch.js.map +1 -1
  5. package/dist/esm/rest/index.js +2 -0
  6. package/dist/esm/rest/index.js.map +1 -0
  7. package/dist/esm/rest/portal/_internal/helpers.js +23 -0
  8. package/dist/esm/rest/portal/_internal/helpers.js.map +1 -0
  9. package/dist/esm/rest/portal/index.js +2 -0
  10. package/dist/esm/rest/portal/index.js.map +1 -0
  11. package/dist/esm/rest/portal/wrappers.js +33 -0
  12. package/dist/esm/rest/portal/wrappers.js.map +1 -0
  13. package/dist/esm/search/searchAssociatedContent.js +44 -0
  14. package/dist/esm/search/searchAssociatedContent.js.map +1 -0
  15. package/dist/node/items/_internal/ensureUniqueEntitySlug.js +7 -0
  16. package/dist/node/items/_internal/ensureUniqueEntitySlug.js.map +1 -1
  17. package/dist/node/items/fetch.js +13 -1
  18. package/dist/node/items/fetch.js.map +1 -1
  19. package/dist/node/rest/index.js +5 -0
  20. package/dist/node/rest/index.js.map +1 -0
  21. package/dist/node/rest/portal/_internal/helpers.js +27 -0
  22. package/dist/node/rest/portal/_internal/helpers.js.map +1 -0
  23. package/dist/node/rest/portal/index.js +5 -0
  24. package/dist/node/rest/portal/index.js.map +1 -0
  25. package/dist/node/rest/portal/wrappers.js +39 -0
  26. package/dist/node/rest/portal/wrappers.js.map +1 -0
  27. package/dist/node/search/searchAssociatedContent.js +48 -0
  28. package/dist/node/search/searchAssociatedContent.js.map +1 -0
  29. package/dist/types/rest/index.d.ts +1 -0
  30. package/dist/types/rest/portal/_internal/helpers.d.ts +2 -0
  31. package/dist/types/rest/portal/index.d.ts +1 -0
  32. package/dist/types/rest/portal/wrappers.d.ts +22 -0
  33. package/dist/types/search/searchAssociatedContent.d.ts +12 -0
  34. package/package.json +1 -1
@@ -1,6 +1,13 @@
1
1
  import { getUniqueSlug, setSlugKeyword } from "../slugs";
2
+ import { truncateSlug } from "./slugs";
2
3
  // NOTE: this mutates the entity that is passed in
3
4
  export const ensureUniqueEntitySlug = async (entity, requestOptions) => {
5
+ // if we got the entity from the entity editor, the slug will already have the orgUrlKey prefix
6
+ // but it might not have been edited with the entity editor...
7
+ // ie a dev might have just set the slug to "my-slug" and not "org|my-slug" (like i did)
8
+ if (entity.slug && !entity.slug.startsWith(`${entity.orgUrlKey}|`)) {
9
+ entity.slug = truncateSlug(entity.slug, entity.orgUrlKey);
10
+ }
4
11
  // verify that the slug is unique
5
12
  const { id: existingId, slug } = entity;
6
13
  const slugInfo = existingId ? { slug, existingId } : { slug };
@@ -1 +1 @@
1
- {"version":3,"file":"ensureUniqueEntitySlug.js","sourceRoot":"","sources":["../../../../src/items/_internal/ensureUniqueEntitySlug.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEzD,kDAAkD;AAClD,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,EACzC,MAAsB,EACtB,cAAkC,EACT,EAAE;IAC3B,iCAAiC;IACjC,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IACxC,MAAM,QAAQ,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;IAC9D,MAAM,CAAC,IAAI,GAAG,MAAM,aAAa,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IAC5D,uBAAuB;IACvB,MAAM,CAAC,YAAY,GAAG,cAAc,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IACvE,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
1
+ {"version":3,"file":"ensureUniqueEntitySlug.js","sourceRoot":"","sources":["../../../../src/items/_internal/ensureUniqueEntitySlug.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,kDAAkD;AAClD,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,EACzC,MAAsB,EACtB,cAAkC,EACT,EAAE;IAC3B,+FAA+F;IAC/F,8DAA8D;IAC9D,wFAAwF;IACxF,IAAI,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,SAAS,GAAG,CAAC,EAAE;QAClE,MAAM,CAAC,IAAI,GAAG,YAAY,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;KAC3D;IACD,iCAAiC;IACjC,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IACxC,MAAM,QAAQ,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;IAC9D,MAAM,CAAC,IAAI,GAAG,MAAM,aAAa,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IAC5D,uBAAuB;IACvB,MAAM,CAAC,YAAY,GAAG,cAAc,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IACvE,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
@@ -18,7 +18,19 @@ export function fetchItem(identifier, requestOptions) {
18
18
  // first, ensure the slug has the org key
19
19
  const fullyQualifiedSlug = addContextToSlug(slug, orgKey || requestOptions.siteOrgKey);
20
20
  const slugKeyword = uriSlugToKeywordSlug(fullyQualifiedSlug);
21
- return findItemsBySlug({ slug: slugKeyword }, requestOptions).then((results) => {
21
+ return findItemsBySlug({ slug: slugKeyword }, requestOptions)
22
+ .then((results) => {
23
+ if (results.length) {
24
+ return results;
25
+ }
26
+ else {
27
+ // we had a bug where page slugs could have been stored without the org url key prefix
28
+ // we decided to fall back to looking for them without the prefix
29
+ const slugWithoutOrgKey = slugKeyword.split("|").slice(1).join("|");
30
+ return findItemsBySlug({ slug: slugWithoutOrgKey }, requestOptions);
31
+ }
32
+ })
33
+ .then((results) => {
22
34
  if (results.length) {
23
35
  // search results only include a subset of properties of the item, so
24
36
  // issue a subsequent call to getItem to get the full item details
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../../src/items/fetch.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAWpD;;;;GAIG;AACH,MAAM,UAAU,SAAS,CACvB,UAAkB,EAClB,cAAiC;IAEjC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;IACzD,IAAI,EAAE,EAAE;QACN,+BAA+B;QAC/B,OAAO,OAAO,CAAC,EAAE,EAAE,cAAc,CAAC,CAAC;KACpC;IACD,gCAAgC;IAChC,yCAAyC;IACzC,MAAM,kBAAkB,GAAG,gBAAgB,CACzC,IAAI,EACJ,MAAM,IAAI,cAAc,CAAC,UAAU,CACpC,CAAC;IACF,MAAM,WAAW,GAAG,oBAAoB,CAAC,kBAAkB,CAAC,CAAC;IAC7D,OAAO,eAAe,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,cAAc,CAAC,CAAC,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F,iEAAiE;YACjE,MAAM,iBAAiB,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACpE,OAAO,eAAe,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,EAAE,cAAc,CAAC,CAAC;SACrE;IACH,CAAC,CAAC;SACD,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;QAChB,IAAI,OAAO,CAAC,MAAM,EAAE;YAClB,qEAAqE;YACrE,kEAAkE;YAClE,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,cAAc,CAAC,CAAC;SAC/C;aAAM;YACL,OAAO,IAAI,CAAC;SACb;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./portal/wrappers";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rest/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,23 @@
1
+ // needed to preserve 3.x behavior for saving item data
2
+ export function serializeItemParams(requestOptions) {
3
+ requestOptions.params = Object.assign(Object.assign({}, requestOptions.params), serializeItem(requestOptions.item));
4
+ return requestOptions;
5
+ }
6
+ // istanbul ignore next - copied from
7
+ // https://github.com/Esri/arcgis-rest-js/blob/8eccee45394850467194e53390df7df3e661f104/packages/arcgis-rest-portal/src/items/helpers.ts#L255
8
+ function serializeItem(item) {
9
+ // create a clone so we're not messing with the original
10
+ const clone = JSON.parse(JSON.stringify(item));
11
+ // binary data needs POSTed as a `file`
12
+ // JSON object literals should be passed as `text`.
13
+ if (clone.data) {
14
+ (typeof Blob !== "undefined" && item.data instanceof Blob) ||
15
+ // Node.js doesn't implement Blob
16
+ item.data.constructor.name === "ReadStream"
17
+ ? (clone.file = item.data)
18
+ : (clone.text = item.data);
19
+ delete clone.data;
20
+ }
21
+ return clone;
22
+ }
23
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../src/rest/portal/_internal/helpers.ts"],"names":[],"mappings":"AASA,uDAAuD;AACvD,MAAM,UAAU,mBAAmB,CACjC,cAA4E;IAE5E,cAAc,CAAC,MAAM,mCAChB,cAAc,CAAC,MAAM,GACrB,aAAa,CAAC,cAAc,CAAC,IAAI,CAAC,CACtC,CAAC;IACF,OAAO,cAA8B,CAAC;AACxC,CAAC;AAED,qCAAqC;AACrC,6IAA6I;AAC7I,SAAS,aAAa,CAAC,IAAoC;IACzD,wDAAwD;IACxD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAE/C,uCAAuC;IACvC,mDAAmD;IACnD,IAAI,KAAK,CAAC,IAAI,EAAE;QACd,CAAC,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,CAAC,IAAI,YAAY,IAAI,CAAC;YAC1D,iCAAiC;YACjC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,YAAY;YACzC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;YAC1B,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7B,OAAO,KAAK,CAAC,IAAI,CAAC;KACnB;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./wrappers";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rest/portal/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
@@ -0,0 +1,33 @@
1
+ /* istanbul ignore file - these are just wrappers around rest-js functions */
2
+ // import functions that need to be wrapped and/or spied on
3
+ import { commitItemUpload as _commitItemUpload, createItem as _createItem, updateItem as _updateItem, } from "@esri/arcgis-rest-portal";
4
+ import { serializeItemParams } from "./_internal/helpers";
5
+ // implement wrappers
6
+ /**
7
+ * wrapper around @esri/arcgis-rest-portal's createItem
8
+ * NOTE: this preserves 3.x behavior for saving item data
9
+ * @param args
10
+ * @returns
11
+ */
12
+ export function createItem(...args) {
13
+ return _createItem(serializeItemParams(args[0]));
14
+ }
15
+ /**
16
+ * wrapper around @esri/arcgis-rest-portal's updateItem
17
+ * NOTE: this preserves 3.x behavior for saving item data
18
+ * @param args
19
+ * @returns
20
+ */
21
+ export function updateItem(...args) {
22
+ return _updateItem(serializeItemParams(args[0]));
23
+ }
24
+ /**
25
+ * wrapper around @esri/arcgis-rest-portal's commitItemUpload
26
+ * NOTE: this preserves 3.x behavior for saving item data
27
+ * @param args
28
+ * @returns
29
+ */
30
+ export function commitItemUpload(...args) {
31
+ return _commitItemUpload(serializeItemParams(args[0]));
32
+ }
33
+ //# sourceMappingURL=wrappers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrappers.js","sourceRoot":"","sources":["../../../../src/rest/portal/wrappers.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,2DAA2D;AAC3D,OAAO,EACL,gBAAgB,IAAI,iBAAiB,EACrC,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,GAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,qBAAqB;AACrB;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CACxB,GAAG,IAAoC;IAEvC,OAAO,WAAW,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACnD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CACxB,GAAG,IAAoC;IAEvC,OAAO,WAAW,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACnD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAC9B,GAAG,IAA0C;IAE7C,OAAO,iBAAiB,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACzD,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { getTypeFromEntity } from "../core/getTypeFromEntity";
2
+ import { HUB_ITEM_ENTITY_TYPES, } from "../core/types/HubEntityType";
3
+ import HubError from "../HubError";
4
+ import { getOgcApiDefinition } from "./_internal/commonHelpers/getOgcApiDefinition";
5
+ import { searchOgcItems } from "./_internal/hubSearchItemsHelpers/searchOgcItems";
6
+ /**
7
+ * Searches for content that is associated with a given entity.
8
+ * Current associations supported are "related" and "connected".
9
+ *
10
+ * If unspecified, the number of results returned is 4.
11
+ *
12
+ * NOTE: only item based entities are supported for now.
13
+ *
14
+ * @returns Search results for the associated content
15
+ */
16
+ export async function searchAssociatedContent(opts) {
17
+ const { scope, requestOptions, num = 4 } = opts;
18
+ const searchOptions = {
19
+ requestOptions,
20
+ num,
21
+ };
22
+ // Validate that we received an item-based entity
23
+ const entityType = getTypeFromEntity(opts.entity);
24
+ if (!HUB_ITEM_ENTITY_TYPES.includes(entityType)) {
25
+ throw new HubError("searchAssociatedContent", `associated content is not supported for entity type "${entityType}"`);
26
+ }
27
+ // For now, we only support searching associated items, not other types of entities
28
+ if (scope.targetEntity !== "item") {
29
+ throw new HubError("searchAssociatedContent", `associated content scope does not support targetEntity "${scope.targetEntity}"`);
30
+ }
31
+ // The "connected" association requires a layerId
32
+ if (!opts.layerId && opts.association === "connected") {
33
+ throw new HubError("searchAssociatedContent", `"layerId" is required for searching "connected" content`);
34
+ }
35
+ // Calculate the hubId
36
+ const { entity, layerId } = opts;
37
+ const hubId = layerId ? `${entity.id}_${layerId}` : entity.id;
38
+ // Construct the OGC API URL
39
+ const { association } = opts;
40
+ const api = getOgcApiDefinition(scope.targetEntity, searchOptions.requestOptions);
41
+ const url = `${api.url}/collections/all/items/${hubId}/${association}`;
42
+ return searchOgcItems(url, scope, searchOptions);
43
+ }
44
+ //# sourceMappingURL=searchAssociatedContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"searchAssociatedContent.js","sourceRoot":"","sources":["../../../src/search/searchAssociatedContent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EACL,qBAAqB,GAEtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AAEpF,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAOlF;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,IAAqC;IAErC,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC;IAChD,MAAM,aAAa,GAA2B;QAC5C,cAAc;QACd,GAAG;KACJ,CAAC;IAEF,iDAAiD;IACjD,MAAM,UAAU,GAAG,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAsB,CAAC;IACvE,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;QAC/C,MAAM,IAAI,QAAQ,CAChB,yBAAyB,EACzB,wDAAwD,UAAU,GAAG,CACtE,CAAC;KACH;IAED,mFAAmF;IACnF,IAAI,KAAK,CAAC,YAAY,KAAK,MAAM,EAAE;QACjC,MAAM,IAAI,QAAQ,CAChB,yBAAyB,EACzB,2DAA2D,KAAK,CAAC,YAAY,GAAG,CACjF,CAAC;KACH;IAED,iDAAiD;IACjD,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,WAAW,KAAK,WAAW,EAAE;QACrD,MAAM,IAAI,QAAQ,CAChB,yBAAyB,EACzB,yDAAyD,CAC1D,CAAC;KACH;IAED,sBAAsB;IACtB,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACjC,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,IAAI,OAAO,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IAE9D,4BAA4B;IAC5B,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAC7B,MAAM,GAAG,GAAG,mBAAmB,CAC7B,KAAK,CAAC,YAAY,EAClB,aAAa,CAAC,cAAc,CAC7B,CAAC;IACF,MAAM,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,0BAA0B,KAAK,IAAI,WAAW,EAAE,CAAC;IAEvE,OAAO,cAAc,CAAC,GAAG,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC;AACnD,CAAC"}
@@ -2,8 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ensureUniqueEntitySlug = void 0;
4
4
  const slugs_1 = require("../slugs");
5
+ const slugs_2 = require("./slugs");
5
6
  // NOTE: this mutates the entity that is passed in
6
7
  exports.ensureUniqueEntitySlug = async (entity, requestOptions) => {
8
+ // if we got the entity from the entity editor, the slug will already have the orgUrlKey prefix
9
+ // but it might not have been edited with the entity editor...
10
+ // ie a dev might have just set the slug to "my-slug" and not "org|my-slug" (like i did)
11
+ if (entity.slug && !entity.slug.startsWith(`${entity.orgUrlKey}|`)) {
12
+ entity.slug = slugs_2.truncateSlug(entity.slug, entity.orgUrlKey);
13
+ }
7
14
  // verify that the slug is unique
8
15
  const { id: existingId, slug } = entity;
9
16
  const slugInfo = existingId ? { slug, existingId } : { slug };
@@ -1 +1 @@
1
- {"version":3,"file":"ensureUniqueEntitySlug.js","sourceRoot":"","sources":["../../../../src/items/_internal/ensureUniqueEntitySlug.ts"],"names":[],"mappings":";;;AAEA,oCAAyD;AAEzD,kDAAkD;AACrC,QAAA,sBAAsB,GAAG,KAA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AC,QAAQ,EAAE,cAAc,CAAC,CAAC;IAC5D,uBAAuB;IACvB,MAAM,CAAC,YAAY,GAAG,sBAAc,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IACvE,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
@@ -21,7 +21,19 @@ function fetchItem(identifier, requestOptions) {
21
21
  // first, ensure the slug has the org key
22
22
  const fullyQualifiedSlug = content_1.addContextToSlug(slug, orgKey || requestOptions.siteOrgKey);
23
23
  const slugKeyword = slugConverters_1.uriSlugToKeywordSlug(fullyQualifiedSlug);
24
- return slugs_1.findItemsBySlug({ slug: slugKeyword }, requestOptions).then((results) => {
24
+ return slugs_1.findItemsBySlug({ slug: slugKeyword }, requestOptions)
25
+ .then((results) => {
26
+ if (results.length) {
27
+ return results;
28
+ }
29
+ else {
30
+ // we had a bug where page slugs could have been stored without the org url key prefix
31
+ // we decided to fall back to looking for them without the prefix
32
+ const slugWithoutOrgKey = slugKeyword.split("|").slice(1).join("|");
33
+ return slugs_1.findItemsBySlug({ slug: slugWithoutOrgKey }, requestOptions);
34
+ }
35
+ })
36
+ .then((results) => {
25
37
  if (results.length) {
26
38
  // search results only include a subset of properties of the item, so
27
39
  // issue a subsequent call to getItem to get the full item details
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../../src/items/fetch.ts"],"names":[],"mappings":";;;AACA,iEAA0D;AAC1D,wCAA8C;AAC9C,mCAA0C;AAC1C,+DAAkE;AAClE,6CAAoD;AAWpD;;;;GAIG;AACH,SAAgB,SAAS,CACvB,UAAkB,EAClB,cAAiC;IAEjC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,uBAAe,CAAC,UAAU,CAAC,CAAC;IACzD,IAAI,EAAE,EAAE;QACN,+BAA+B;QAC/B,OAAO,4BAAO,CAAC,EAAE,EAAE,cAAc,CAAC,CAAC;KACpC;IACD,gCAAgC;IAChC,yC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OAAO,CAAC,MAAM,EAAE;YAClB,OAAO,OAAO,CAAC;SAChB;aAAM;YACL,sFAAsF;YACtF,iEAAiE;YACjE,MAAM,iBAAiB,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACpE,OAAO,uBAAe,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,EAAE,cAAc,CAAC,CAAC;SACrE;IACH,CAAC,CAAC;SACD,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;QAChB,IAAI,OAAO,CAAC,MAAM,EAAE;YAClB,qEAAqE;YACrE,kEAAkE;YAClE,OAAO,4BAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,cAAc,CAAC,CAAC;SAC/C;aAAM;YACL,OAAO,IAAI,CAAC;SACb;IACH,CAAC,CAAC,CAAC;AACP,CAAC;AAxCD,8BAwCC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./portal/wrappers"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rest/index.ts"],"names":[],"mappings":";;;AAAA,4DAAkC"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.serializeItemParams = void 0;
4
+ // needed to preserve 3.x behavior for saving item data
5
+ function serializeItemParams(requestOptions) {
6
+ requestOptions.params = Object.assign(Object.assign({}, requestOptions.params), serializeItem(requestOptions.item));
7
+ return requestOptions;
8
+ }
9
+ exports.serializeItemParams = serializeItemParams;
10
+ // istanbul ignore next - copied from
11
+ // https://github.com/Esri/arcgis-rest-js/blob/8eccee45394850467194e53390df7df3e661f104/packages/arcgis-rest-portal/src/items/helpers.ts#L255
12
+ function serializeItem(item) {
13
+ // create a clone so we're not messing with the original
14
+ const clone = JSON.parse(JSON.stringify(item));
15
+ // binary data needs POSTed as a `file`
16
+ // JSON object literals should be passed as `text`.
17
+ if (clone.data) {
18
+ (typeof Blob !== "undefined" && item.data instanceof Blob) ||
19
+ // Node.js doesn't implement Blob
20
+ item.data.constructor.name === "ReadStream"
21
+ ? (clone.file = item.data)
22
+ : (clone.text = item.data);
23
+ delete clone.data;
24
+ }
25
+ return clone;
26
+ }
27
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../src/rest/portal/_internal/helpers.ts"],"names":[],"mappings":";;;AASA,uDAAuD;AACvD,SAAgB,mBAAmB,CACjC,cAA4E;IAE5E,cAAc,CAAC,MAAM,mCAChB,cAAc,CAAC,MAAM,GACrB,aAAa,CAAC,cAAc,CAAC,IAAI,CAAC,CACtC,CAAC;IACF,OAAO,cAA8B,CAAC;AACxC,CAAC;AARD,kDAQC;AAED,qCAAqC;AACrC,6IAA6I;AAC7I,SAAS,aAAa,CAAC,IAAoC;IACzD,wDAAwD;IACxD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAE/C,uCAAuC;IACvC,mDAAmD;IACnD,IAAI,KAAK,CAAC,IAAI,EAAE;QACd,CAAC,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,CAAC,IAAI,YAAY,IAAI,CAAC;YAC1D,iCAAiC;YACjC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,YAAY;YACzC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;YAC1B,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7B,OAAO,KAAK,CAAC,IAAI,CAAC;KACnB;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./wrappers"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rest/portal/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B"}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.commitItemUpload = exports.updateItem = exports.createItem = void 0;
4
+ /* istanbul ignore file - these are just wrappers around rest-js functions */
5
+ // import functions that need to be wrapped and/or spied on
6
+ const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
7
+ const helpers_1 = require("./_internal/helpers");
8
+ // implement wrappers
9
+ /**
10
+ * wrapper around @esri/arcgis-rest-portal's createItem
11
+ * NOTE: this preserves 3.x behavior for saving item data
12
+ * @param args
13
+ * @returns
14
+ */
15
+ function createItem(...args) {
16
+ return arcgis_rest_portal_1.createItem(helpers_1.serializeItemParams(args[0]));
17
+ }
18
+ exports.createItem = createItem;
19
+ /**
20
+ * wrapper around @esri/arcgis-rest-portal's updateItem
21
+ * NOTE: this preserves 3.x behavior for saving item data
22
+ * @param args
23
+ * @returns
24
+ */
25
+ function updateItem(...args) {
26
+ return arcgis_rest_portal_1.updateItem(helpers_1.serializeItemParams(args[0]));
27
+ }
28
+ exports.updateItem = updateItem;
29
+ /**
30
+ * wrapper around @esri/arcgis-rest-portal's commitItemUpload
31
+ * NOTE: this preserves 3.x behavior for saving item data
32
+ * @param args
33
+ * @returns
34
+ */
35
+ function commitItemUpload(...args) {
36
+ return arcgis_rest_portal_1.commitItemUpload(helpers_1.serializeItemParams(args[0]));
37
+ }
38
+ exports.commitItemUpload = commitItemUpload;
39
+ //# sourceMappingURL=wrappers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrappers.js","sourceRoot":"","sources":["../../../../src/rest/portal/wrappers.ts"],"names":[],"mappings":";;;AAAA,6EAA6E;AAC7E,2DAA2D;AAC3D,iEAIkC;AAClC,iDAA0D;AAE1D,qBAAqB;AACrB;;;;;GAKG;AACH,SAAgB,UAAU,CACxB,GAAG,IAAoC;IAEvC,OAAO,+BAAW,CAAC,6BAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACnD,CAAC;AAJD,gCAIC;AAED;;;;;GAKG;AACH,SAAgB,UAAU,CACxB,GAAG,IAAoC;IAEvC,OAAO,+BAAW,CAAC,6BAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACnD,CAAC;AAJD,gCAIC;AAED;;;;;GAKG;AACH,SAAgB,gBAAgB,CAC9B,GAAG,IAA0C;IAE7C,OAAO,qCAAiB,CAAC,6BAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACzD,CAAC;AAJD,4CAIC"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.searchAssociatedContent = void 0;
4
+ const getTypeFromEntity_1 = require("../core/getTypeFromEntity");
5
+ const HubEntityType_1 = require("../core/types/HubEntityType");
6
+ const HubError_1 = require("../HubError");
7
+ const getOgcApiDefinition_1 = require("./_internal/commonHelpers/getOgcApiDefinition");
8
+ const searchOgcItems_1 = require("./_internal/hubSearchItemsHelpers/searchOgcItems");
9
+ /**
10
+ * Searches for content that is associated with a given entity.
11
+ * Current associations supported are "related" and "connected".
12
+ *
13
+ * If unspecified, the number of results returned is 4.
14
+ *
15
+ * NOTE: only item based entities are supported for now.
16
+ *
17
+ * @returns Search results for the associated content
18
+ */
19
+ async function searchAssociatedContent(opts) {
20
+ const { scope, requestOptions, num = 4 } = opts;
21
+ const searchOptions = {
22
+ requestOptions,
23
+ num,
24
+ };
25
+ // Validate that we received an item-based entity
26
+ const entityType = getTypeFromEntity_1.getTypeFromEntity(opts.entity);
27
+ if (!HubEntityType_1.HUB_ITEM_ENTITY_TYPES.includes(entityType)) {
28
+ throw new HubError_1.default("searchAssociatedContent", `associated content is not supported for entity type "${entityType}"`);
29
+ }
30
+ // For now, we only support searching associated items, not other types of entities
31
+ if (scope.targetEntity !== "item") {
32
+ throw new HubError_1.default("searchAssociatedContent", `associated content scope does not support targetEntity "${scope.targetEntity}"`);
33
+ }
34
+ // The "connected" association requires a layerId
35
+ if (!opts.layerId && opts.association === "connected") {
36
+ throw new HubError_1.default("searchAssociatedContent", `"layerId" is required for searching "connected" content`);
37
+ }
38
+ // Calculate the hubId
39
+ const { entity, layerId } = opts;
40
+ const hubId = layerId ? `${entity.id}_${layerId}` : entity.id;
41
+ // Construct the OGC API URL
42
+ const { association } = opts;
43
+ const api = getOgcApiDefinition_1.getOgcApiDefinition(scope.targetEntity, searchOptions.requestOptions);
44
+ const url = `${api.url}/collections/all/items/${hubId}/${association}`;
45
+ return searchOgcItems_1.searchOgcItems(url, scope, searchOptions);
46
+ }
47
+ exports.searchAssociatedContent = searchAssociatedContent;
48
+ //# sourceMappingURL=searchAssociatedContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"searchAssociatedContent.js","sourceRoot":"","sources":["../../../src/search/searchAssociatedContent.ts"],"names":[],"mappings":";;;AAAA,iEAA8D;AAC9D,+DAGqC;AACrC,0CAAmC;AACnC,uFAAoF;AAEpF,qFAAkF;AAOlF;;;;;;;;;GASG;AACI,KAAK,UAAU,uBAAuB,CAC3C,IAAqC;IAErC,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC;IAChD,MAAM,aAAa,GAA2B;QAC5C,cAAc;QACd,GAAG;KACJ,CAAC;IAEF,iDAAiD;IACjD,MAAM,UAAU,GAAG,qCAAiB,CAAC,IAAI,CAAC,MAAM,CAAsB,CAAC;IACvE,IAAI,CAAC,qCAAqB,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;QAC/C,MAAM,IAAI,kBAAQ,CAChB,yBAAyB,EACzB,wDAAwD,UAAU,GAAG,CACtE,CAAC;KACH;IAED,mFAAmF;IACnF,IAAI,KAAK,CAAC,YAAY,KAAK,MAAM,EAAE;QACjC,MAAM,IAAI,kBAAQ,CAChB,yBAAyB,EACzB,2DAA2D,KAAK,CAAC,YAAY,GAAG,CACjF,CAAC;KACH;IAED,iDAAiD;IACjD,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,WAAW,KAAK,WAAW,EAAE;QACrD,MAAM,IAAI,kBAAQ,CAChB,yBAAyB,EACzB,yDAAyD,CAC1D,CAAC;KACH;IAED,sBAAsB;IACtB,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACjC,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,IAAI,OAAO,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IAE9D,4BAA4B;IAC5B,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAC7B,MAAM,GAAG,GAAG,yCAAmB,CAC7B,KAAK,CAAC,YAAY,EAClB,aAAa,CAAC,cAAc,CAC7B,CAAC;IACF,MAAM,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,0BAA0B,KAAK,IAAI,WAAW,EAAE,CAAC;IAEvE,OAAO,+BAAc,CAAC,GAAG,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC;AACnD,CAAC;AA/CD,0DA+CC"}
@@ -0,0 +1 @@
1
+ export * from "./portal/wrappers";
@@ -0,0 +1,2 @@
1
+ import { ICreateItemOptions, IUpdateItemOptions, ICommitItemOptions } from "@esri/arcgis-rest-portal";
2
+ export declare function serializeItemParams<T>(requestOptions: ICreateItemOptions | IUpdateItemOptions | ICommitItemOptions): T;
@@ -0,0 +1 @@
1
+ export * from "./wrappers";
@@ -0,0 +1,22 @@
1
+ import { commitItemUpload as _commitItemUpload, createItem as _createItem, updateItem as _updateItem } from "@esri/arcgis-rest-portal";
2
+ /**
3
+ * wrapper around @esri/arcgis-rest-portal's createItem
4
+ * NOTE: this preserves 3.x behavior for saving item data
5
+ * @param args
6
+ * @returns
7
+ */
8
+ export declare function createItem(...args: Parameters<typeof _createItem>): ReturnType<typeof _createItem>;
9
+ /**
10
+ * wrapper around @esri/arcgis-rest-portal's updateItem
11
+ * NOTE: this preserves 3.x behavior for saving item data
12
+ * @param args
13
+ * @returns
14
+ */
15
+ export declare function updateItem(...args: Parameters<typeof _updateItem>): ReturnType<typeof _updateItem>;
16
+ /**
17
+ * wrapper around @esri/arcgis-rest-portal's commitItemUpload
18
+ * NOTE: this preserves 3.x behavior for saving item data
19
+ * @param args
20
+ * @returns
21
+ */
22
+ export declare function commitItemUpload(...args: Parameters<typeof _commitItemUpload>): ReturnType<typeof _commitItemUpload>;
@@ -0,0 +1,12 @@
1
+ import { IHubSearchResponse, IHubSearchResult, ISearchAssociatedContentOptions } from "./types";
2
+ /**
3
+ * Searches for content that is associated with a given entity.
4
+ * Current associations supported are "related" and "connected".
5
+ *
6
+ * If unspecified, the number of results returned is 4.
7
+ *
8
+ * NOTE: only item based entities are supported for now.
9
+ *
10
+ * @returns Search results for the associated content
11
+ */
12
+ export declare function searchAssociatedContent(opts: ISearchAssociatedContentOptions): Promise<IHubSearchResponse<IHubSearchResult>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/hub-common",
3
- "version": "16.6.0",
3
+ "version": "16.6.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",