@esri/hub-common 17.21.0 → 18.1.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 (77) hide show
  1. package/dist/esm/events/_internal/EventBusinessRules.js +19 -0
  2. package/dist/esm/events/_internal/EventBusinessRules.js.map +1 -1
  3. package/dist/esm/events/_internal/PropertyMapper.js +0 -1
  4. package/dist/esm/events/_internal/PropertyMapper.js.map +1 -1
  5. package/dist/esm/events/_internal/getPropertyMap.js +4 -0
  6. package/dist/esm/events/_internal/getPropertyMap.js.map +1 -1
  7. package/dist/esm/events/defaults.js +2 -2
  8. package/dist/esm/events/defaults.js.map +1 -1
  9. package/dist/esm/events/edit.js +1 -0
  10. package/dist/esm/events/edit.js.map +1 -1
  11. package/dist/esm/search/_internal/commonHelpers/getApi.js +7 -27
  12. package/dist/esm/search/_internal/commonHelpers/getApi.js.map +1 -1
  13. package/dist/esm/search/_internal/commonHelpers/shouldUseOgcApi.js +2 -2
  14. package/dist/esm/search/_internal/commonHelpers/shouldUseOgcApi.js.map +1 -1
  15. package/dist/esm/search/_internal/hubSearchItemsHelpers/getOgcAggregationQueryParams.js.map +1 -1
  16. package/dist/esm/search/_internal/hubSearchItemsHelpers/getOgcCollectionUrl.js +4 -7
  17. package/dist/esm/search/_internal/hubSearchItemsHelpers/getOgcCollectionUrl.js.map +1 -1
  18. package/dist/esm/search/_internal/hubSearchItemsHelpers/ogcApiRequest.js +3 -24
  19. package/dist/esm/search/_internal/hubSearchItemsHelpers/ogcApiRequest.js.map +1 -1
  20. package/dist/esm/search/_internal/hubSearchItemsHelpers/searchOgcAggregations.js +1 -1
  21. package/dist/esm/search/_internal/hubSearchItemsHelpers/searchOgcAggregations.js.map +1 -1
  22. package/dist/esm/search/_internal/hubSearchItemsHelpers/searchOgcItems.js +1 -1
  23. package/dist/esm/search/_internal/hubSearchItemsHelpers/searchOgcItems.js.map +1 -1
  24. package/dist/esm/search/hubSearch.js +4 -4
  25. package/dist/esm/search/hubSearch.js.map +1 -1
  26. package/dist/esm/search/searchAssociatedContent.js +4 -4
  27. package/dist/esm/search/searchAssociatedContent.js.map +1 -1
  28. package/dist/esm/search/utils.js +0 -61
  29. package/dist/esm/search/utils.js.map +1 -1
  30. package/dist/node/events/_internal/EventBusinessRules.js +19 -0
  31. package/dist/node/events/_internal/EventBusinessRules.js.map +1 -1
  32. package/dist/node/events/_internal/PropertyMapper.js +0 -1
  33. package/dist/node/events/_internal/PropertyMapper.js.map +1 -1
  34. package/dist/node/events/_internal/getPropertyMap.js +4 -0
  35. package/dist/node/events/_internal/getPropertyMap.js.map +1 -1
  36. package/dist/node/events/defaults.js +2 -2
  37. package/dist/node/events/defaults.js.map +1 -1
  38. package/dist/node/events/edit.js +1 -0
  39. package/dist/node/events/edit.js.map +1 -1
  40. package/dist/node/search/_internal/commonHelpers/getApi.js +7 -27
  41. package/dist/node/search/_internal/commonHelpers/getApi.js.map +1 -1
  42. package/dist/node/search/_internal/commonHelpers/shouldUseOgcApi.js +2 -2
  43. package/dist/node/search/_internal/commonHelpers/shouldUseOgcApi.js.map +1 -1
  44. package/dist/node/search/_internal/hubSearchItemsHelpers/getOgcAggregationQueryParams.js.map +1 -1
  45. package/dist/node/search/_internal/hubSearchItemsHelpers/getOgcCollectionUrl.js +4 -7
  46. package/dist/node/search/_internal/hubSearchItemsHelpers/getOgcCollectionUrl.js.map +1 -1
  47. package/dist/node/search/_internal/hubSearchItemsHelpers/ogcApiRequest.js +3 -24
  48. package/dist/node/search/_internal/hubSearchItemsHelpers/ogcApiRequest.js.map +1 -1
  49. package/dist/node/search/_internal/hubSearchItemsHelpers/searchOgcAggregations.js +1 -1
  50. package/dist/node/search/_internal/hubSearchItemsHelpers/searchOgcAggregations.js.map +1 -1
  51. package/dist/node/search/_internal/hubSearchItemsHelpers/searchOgcItems.js +1 -1
  52. package/dist/node/search/_internal/hubSearchItemsHelpers/searchOgcItems.js.map +1 -1
  53. package/dist/node/search/hubSearch.js +4 -4
  54. package/dist/node/search/hubSearch.js.map +1 -1
  55. package/dist/node/search/searchAssociatedContent.js +4 -4
  56. package/dist/node/search/searchAssociatedContent.js.map +1 -1
  57. package/dist/node/search/utils.js +1 -64
  58. package/dist/node/search/utils.js.map +1 -1
  59. package/dist/types/events/_internal/EventBusinessRules.d.ts +1 -1
  60. package/dist/types/search/_internal/commonHelpers/getApi.d.ts +4 -7
  61. package/dist/types/search/_internal/hubSearchItemsHelpers/getOgcAggregationQueryParams.d.ts +5 -4
  62. package/dist/types/search/_internal/hubSearchItemsHelpers/ogcApiRequest.d.ts +5 -15
  63. package/dist/types/search/hubSearch.d.ts +4 -1
  64. package/dist/types/search/types/IHubSearchOptions.d.ts +3 -9
  65. package/dist/types/search/types/types.d.ts +3 -18
  66. package/dist/types/search/utils.d.ts +1 -21
  67. package/package.json +1 -1
  68. package/dist/esm/search/_internal/commonHelpers/getDiscussionsApiDefinition.js +0 -10
  69. package/dist/esm/search/_internal/commonHelpers/getDiscussionsApiDefinition.js.map +0 -1
  70. package/dist/esm/search/_internal/commonHelpers/getOgcApiDefinition.js +0 -20
  71. package/dist/esm/search/_internal/commonHelpers/getOgcApiDefinition.js.map +0 -1
  72. package/dist/node/search/_internal/commonHelpers/getDiscussionsApiDefinition.js +0 -14
  73. package/dist/node/search/_internal/commonHelpers/getDiscussionsApiDefinition.js.map +0 -1
  74. package/dist/node/search/_internal/commonHelpers/getOgcApiDefinition.js +0 -24
  75. package/dist/node/search/_internal/commonHelpers/getOgcApiDefinition.js.map +0 -1
  76. package/dist/types/search/_internal/commonHelpers/getDiscussionsApiDefinition.d.ts +0 -2
  77. package/dist/types/search/_internal/commonHelpers/getOgcApiDefinition.d.ts +0 -11
@@ -61,20 +61,7 @@ export interface IMatchOptions {
61
61
  */
62
62
  exact?: string | string[];
63
63
  }
64
- export interface IWellKnownApis {
65
- arcgis: IApiDefinition;
66
- arcgisQA: IApiDefinition;
67
- arcgisDEV: IApiDefinition;
68
- hub: IApiDefinition;
69
- hubQA: IApiDefinition;
70
- hubDEV: IApiDefinition;
71
- }
72
- export declare type NamedApis = keyof IWellKnownApis;
73
- export interface IApiDefinition {
74
- label?: string;
75
- url: string;
76
- type: "arcgis" | "arcgis-hub";
77
- }
64
+ export declare type ApiTarget = "portal" | "hub";
78
65
  /**
79
66
  * Base options when checking catalog containment
80
67
  */
@@ -92,8 +79,7 @@ export interface IContainsOptions {
92
79
  /**
93
80
  * Basic information about a catalog
94
81
  */
95
- export interface ICatalogInfo extends Partial<IDeepCatalogInfo> {
96
- }
82
+ export declare type ICatalogInfo = Partial<IDeepCatalogInfo>;
97
83
  /**
98
84
  * Cacheable information about a catalog
99
85
  */
@@ -134,8 +120,7 @@ export interface ICatalogSearchResponse {
134
120
  * Response from a Catalog search operation where the responses for different collections
135
121
  * or entities are grouped into a single object.
136
122
  */
137
- export interface ISearchResponseHash extends Record<string, IHubSearchResponse<IHubSearchResult>> {
138
- }
123
+ export declare type ISearchResponseHash = Record<string, IHubSearchResponse<IHubSearchResult>>;
139
124
  /**
140
125
  * Type wrapper for a kilobyte
141
126
  * This is complete syntactic sugar, it makes sizes easier to understand
@@ -3,29 +3,9 @@ import { IGroup, SearchQueryBuilder } from "@esri/arcgis-rest-portal";
3
3
  import { IHubSite } from "../core";
4
4
  import { IHubSearchResult } from "./types";
5
5
  import { IPredicate, IQuery } from "./types/IHubCatalog";
6
- import { IMatchOptions, IDateRange, IRelativeDate, IWellKnownApis, IApiDefinition, NamedApis, Kilobyte } from "./types/types";
6
+ import { IMatchOptions, IDateRange, IRelativeDate, Kilobyte } from "./types/types";
7
7
  import { WellKnownCollection } from "./wellKnownCatalog";
8
8
  import { LegacySearchCategory } from "./_internal/commonHelpers/isLegacySearchCategory";
9
- /**
10
- * Well known APIs
11
- * Short-forms for specifying common APIs
12
- * We will likely deprecate this
13
- */
14
- export declare const SEARCH_APIS: IWellKnownApis;
15
- /**
16
- * @private
17
- * Convert array of api "names" into full ApiDefinitions
18
- * @param apis
19
- * @returns
20
- */
21
- export declare function expandApis(apis: Array<NamedApis | IApiDefinition>): IApiDefinition[];
22
- /**
23
- * @private
24
- * Convert an api "name" into a full ApiDefinition
25
- * @param api
26
- * @returns
27
- */
28
- export declare function expandApi(api: NamedApis | IApiDefinition): IApiDefinition;
29
9
  /**
30
10
  * @private
31
11
  * Convert a field value into a MatchOptions if it's not already one
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/hub-common",
3
- "version": "17.21.0",
3
+ "version": "18.1.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",
@@ -1,10 +0,0 @@
1
- export function getDiscussionsApiDefinition() {
2
- // Currently, url is null because this is handled internally by the
3
- // discussions request method called by searchChannels, which relies on
4
- // the URL defined in the request options.hubApiUrl
5
- return {
6
- type: "arcgis-hub",
7
- url: null,
8
- };
9
- }
10
- //# sourceMappingURL=getDiscussionsApiDefinition.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getDiscussionsApiDefinition.js","sourceRoot":"","sources":["../../../../../src/search/_internal/commonHelpers/getDiscussionsApiDefinition.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,2BAA2B;IACzC,mEAAmE;IACnE,uEAAuE;IACvE,mDAAmD;IACnD,OAAO;QACL,IAAI,EAAE,YAAY;QAClB,GAAG,EAAE,IAAI;KACV,CAAC;AACJ,CAAC"}
@@ -1,20 +0,0 @@
1
- /**
2
- * @private
3
- * Returns information about the current environment's OGC API
4
- *
5
- * @param options IHubRequestOptions to derive OGC API info from
6
- * @returns an IApiDefinition with needed info to target the OGC API
7
- */
8
- export function getOgcApiDefinition(targetEntity, requestOptions) {
9
- const umbrellaDomain = new URL(requestOptions.hubApiUrl).hostname;
10
- return targetEntity === "discussionPost"
11
- ? {
12
- type: "arcgis-hub",
13
- url: `https://${umbrellaDomain}/api/search/v2`,
14
- }
15
- : {
16
- type: "arcgis-hub",
17
- url: `https://${umbrellaDomain}/api/search/v1`,
18
- };
19
- }
20
- //# sourceMappingURL=getOgcApiDefinition.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getOgcApiDefinition.js","sourceRoot":"","sources":["../../../../../src/search/_internal/commonHelpers/getOgcApiDefinition.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CACjC,YAAwB,EACxB,cAAkC;IAElC,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC;IAClE,OAAO,YAAY,KAAK,gBAAgB;QACtC,CAAC,CAAC;YACE,IAAI,EAAE,YAAY;YAClB,GAAG,EAAE,WAAW,cAAc,gBAAgB;SAC/C;QACH,CAAC,CAAC;YACE,IAAI,EAAE,YAAY;YAClB,GAAG,EAAE,WAAW,cAAc,gBAAgB;SAC/C,CAAC;AACR,CAAC"}
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDiscussionsApiDefinition = void 0;
4
- function getDiscussionsApiDefinition() {
5
- // Currently, url is null because this is handled internally by the
6
- // discussions request method called by searchChannels, which relies on
7
- // the URL defined in the request options.hubApiUrl
8
- return {
9
- type: "arcgis-hub",
10
- url: null,
11
- };
12
- }
13
- exports.getDiscussionsApiDefinition = getDiscussionsApiDefinition;
14
- //# sourceMappingURL=getDiscussionsApiDefinition.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getDiscussionsApiDefinition.js","sourceRoot":"","sources":["../../../../../src/search/_internal/commonHelpers/getDiscussionsApiDefinition.ts"],"names":[],"mappings":";;;AAEA,SAAgB,2BAA2B;IACzC,mEAAmE;IACnE,uEAAuE;IACvE,mDAAmD;IACnD,OAAO;QACL,IAAI,EAAE,YAAY;QAClB,GAAG,EAAE,IAAI;KACV,CAAC;AACJ,CAAC;AARD,kEAQC"}
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getOgcApiDefinition = void 0;
4
- /**
5
- * @private
6
- * Returns information about the current environment's OGC API
7
- *
8
- * @param options IHubRequestOptions to derive OGC API info from
9
- * @returns an IApiDefinition with needed info to target the OGC API
10
- */
11
- function getOgcApiDefinition(targetEntity, requestOptions) {
12
- const umbrellaDomain = new URL(requestOptions.hubApiUrl).hostname;
13
- return targetEntity === "discussionPost"
14
- ? {
15
- type: "arcgis-hub",
16
- url: `https://${umbrellaDomain}/api/search/v2`,
17
- }
18
- : {
19
- type: "arcgis-hub",
20
- url: `https://${umbrellaDomain}/api/search/v1`,
21
- };
22
- }
23
- exports.getOgcApiDefinition = getOgcApiDefinition;
24
- //# sourceMappingURL=getOgcApiDefinition.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getOgcApiDefinition.js","sourceRoot":"","sources":["../../../../../src/search/_internal/commonHelpers/getOgcApiDefinition.ts"],"names":[],"mappings":";;;AAIA;;;;;;GAMG;AACH,SAAgB,mBAAmB,CACjC,YAAwB,EACxB,cAAkC;IAElC,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC;IAClE,OAAO,YAAY,KAAK,gBAAgB;QACtC,CAAC,CAAC;YACE,IAAI,EAAE,YAAY;YAClB,GAAG,EAAE,WAAW,cAAc,gBAAgB;SAC/C;QACH,CAAC,CAAC;YACE,IAAI,EAAE,YAAY;YAClB,GAAG,EAAE,WAAW,cAAc,gBAAgB;SAC/C,CAAC;AACR,CAAC;AAdD,kDAcC"}
@@ -1,2 +0,0 @@
1
- import { IApiDefinition } from "../../types/types";
2
- export declare function getDiscussionsApiDefinition(): IApiDefinition;
@@ -1,11 +0,0 @@
1
- import { IHubRequestOptions } from "../../../hub-types";
2
- import { EntityType } from "../../types";
3
- import { IApiDefinition } from "../../types/types";
4
- /**
5
- * @private
6
- * Returns information about the current environment's OGC API
7
- *
8
- * @param options IHubRequestOptions to derive OGC API info from
9
- * @returns an IApiDefinition with needed info to target the OGC API
10
- */
11
- export declare function getOgcApiDefinition(targetEntity: EntityType, requestOptions: IHubRequestOptions): IApiDefinition;