@esri/hub-common 10.0.0-next.1 → 10.0.0-next.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.
Files changed (112) hide show
  1. package/dist/es2017/projects/HubProjects.js.map +1 -1
  2. package/dist/es2017/search/_internal/hubSearchItems.js +3 -94
  3. package/dist/es2017/search/_internal/hubSearchItems.js.map +1 -1
  4. package/dist/es2017/search/_internal/portalSearchItems.js +3 -25
  5. package/dist/es2017/search/_internal/portalSearchItems.js.map +1 -1
  6. package/dist/es2017/search/index.js +0 -7
  7. package/dist/es2017/search/index.js.map +1 -1
  8. package/dist/es2017/search/types/index.js +0 -3
  9. package/dist/es2017/search/types/index.js.map +1 -1
  10. package/dist/es2017/search/utils.js +1 -207
  11. package/dist/es2017/search/utils.js.map +1 -1
  12. package/dist/esm/projects/HubProjects.js.map +1 -1
  13. package/dist/esm/search/_internal/hubSearchItems.js +4 -102
  14. package/dist/esm/search/_internal/hubSearchItems.js.map +1 -1
  15. package/dist/esm/search/_internal/portalSearchItems.js +3 -25
  16. package/dist/esm/search/_internal/portalSearchItems.js.map +1 -1
  17. package/dist/esm/search/index.js +0 -7
  18. package/dist/esm/search/index.js.map +1 -1
  19. package/dist/esm/search/types/index.js +0 -3
  20. package/dist/esm/search/types/index.js.map +1 -1
  21. package/dist/esm/search/utils.js +1 -204
  22. package/dist/esm/search/utils.js.map +1 -1
  23. package/dist/node/projects/HubProjects.js.map +1 -1
  24. package/dist/node/search/_internal/hubSearchItems.js +3 -94
  25. package/dist/node/search/_internal/hubSearchItems.js.map +1 -1
  26. package/dist/node/search/_internal/portalSearchItems.js +4 -26
  27. package/dist/node/search/_internal/portalSearchItems.js.map +1 -1
  28. package/dist/node/search/index.js +0 -7
  29. package/dist/node/search/index.js.map +1 -1
  30. package/dist/node/search/types/index.js +0 -3
  31. package/dist/node/search/types/index.js.map +1 -1
  32. package/dist/node/search/utils.js +1 -213
  33. package/dist/node/search/utils.js.map +1 -1
  34. package/dist/types/search/_internal/hubSearchItems.d.ts +3 -3
  35. package/dist/types/search/_internal/portalSearchItems.d.ts +15 -15
  36. package/dist/types/search/index.d.ts +0 -7
  37. package/dist/types/search/types/index.d.ts +0 -3
  38. package/dist/types/search/types/types.d.ts +0 -204
  39. package/dist/types/search/utils.d.ts +2 -58
  40. package/dist/umd/common.umd.js +101 -1459
  41. package/dist/umd/common.umd.js.map +1 -1
  42. package/package.json +1 -1
  43. package/dist/es2017/search/_searchContent.js +0 -112
  44. package/dist/es2017/search/_searchContent.js.map +0 -1
  45. package/dist/es2017/search/_searchGroups.js +0 -88
  46. package/dist/es2017/search/_searchGroups.js.map +0 -1
  47. package/dist/es2017/search/_searchUsers.js +0 -89
  48. package/dist/es2017/search/_searchUsers.js.map +0 -1
  49. package/dist/es2017/search/content-utils.js +0 -390
  50. package/dist/es2017/search/content-utils.js.map +0 -1
  51. package/dist/es2017/search/filter-utils.js +0 -31
  52. package/dist/es2017/search/filter-utils.js.map +0 -1
  53. package/dist/es2017/search/group-utils.js +0 -142
  54. package/dist/es2017/search/group-utils.js.map +0 -1
  55. package/dist/es2017/search/types/ICatalog.js +0 -1
  56. package/dist/es2017/search/types/ICatalog.js.map +0 -1
  57. package/dist/es2017/search/types/ICollection.js +0 -1
  58. package/dist/es2017/search/types/ICollection.js.map +0 -1
  59. package/dist/es2017/search/types/IHubApiSearchRequest.js +0 -1
  60. package/dist/es2017/search/types/IHubApiSearchRequest.js.map +0 -1
  61. package/dist/es2017/search/user-utils.js +0 -139
  62. package/dist/es2017/search/user-utils.js.map +0 -1
  63. package/dist/esm/search/_searchContent.js +0 -114
  64. package/dist/esm/search/_searchContent.js.map +0 -1
  65. package/dist/esm/search/_searchGroups.js +0 -91
  66. package/dist/esm/search/_searchGroups.js.map +0 -1
  67. package/dist/esm/search/_searchUsers.js +0 -92
  68. package/dist/esm/search/_searchUsers.js.map +0 -1
  69. package/dist/esm/search/content-utils.js +0 -394
  70. package/dist/esm/search/content-utils.js.map +0 -1
  71. package/dist/esm/search/filter-utils.js +0 -31
  72. package/dist/esm/search/filter-utils.js.map +0 -1
  73. package/dist/esm/search/group-utils.js +0 -146
  74. package/dist/esm/search/group-utils.js.map +0 -1
  75. package/dist/esm/search/types/ICatalog.js +0 -1
  76. package/dist/esm/search/types/ICatalog.js.map +0 -1
  77. package/dist/esm/search/types/ICollection.js +0 -1
  78. package/dist/esm/search/types/ICollection.js.map +0 -1
  79. package/dist/esm/search/types/IHubApiSearchRequest.js +0 -1
  80. package/dist/esm/search/types/IHubApiSearchRequest.js.map +0 -1
  81. package/dist/esm/search/user-utils.js +0 -143
  82. package/dist/esm/search/user-utils.js.map +0 -1
  83. package/dist/node/search/_searchContent.js +0 -116
  84. package/dist/node/search/_searchContent.js.map +0 -1
  85. package/dist/node/search/_searchGroups.js +0 -92
  86. package/dist/node/search/_searchGroups.js.map +0 -1
  87. package/dist/node/search/_searchUsers.js +0 -93
  88. package/dist/node/search/_searchUsers.js.map +0 -1
  89. package/dist/node/search/content-utils.js +0 -399
  90. package/dist/node/search/content-utils.js.map +0 -1
  91. package/dist/node/search/filter-utils.js +0 -36
  92. package/dist/node/search/filter-utils.js.map +0 -1
  93. package/dist/node/search/group-utils.js +0 -148
  94. package/dist/node/search/group-utils.js.map +0 -1
  95. package/dist/node/search/types/ICatalog.js +0 -3
  96. package/dist/node/search/types/ICatalog.js.map +0 -1
  97. package/dist/node/search/types/ICollection.js +0 -3
  98. package/dist/node/search/types/ICollection.js.map +0 -1
  99. package/dist/node/search/types/IHubApiSearchRequest.js +0 -3
  100. package/dist/node/search/types/IHubApiSearchRequest.js.map +0 -1
  101. package/dist/node/search/user-utils.js +0 -145
  102. package/dist/node/search/user-utils.js.map +0 -1
  103. package/dist/types/search/_searchContent.d.ts +0 -9
  104. package/dist/types/search/_searchGroups.d.ts +0 -13
  105. package/dist/types/search/_searchUsers.d.ts +0 -31
  106. package/dist/types/search/content-utils.d.ts +0 -66
  107. package/dist/types/search/filter-utils.d.ts +0 -13
  108. package/dist/types/search/group-utils.d.ts +0 -36
  109. package/dist/types/search/types/ICatalog.d.ts +0 -82
  110. package/dist/types/search/types/ICollection.d.ts +0 -26
  111. package/dist/types/search/types/IHubApiSearchRequest.d.ts +0 -16
  112. package/dist/types/search/user-utils.d.ts +0 -35
@@ -1,5 +1,5 @@
1
1
  /* @preserve
2
- * @esri/hub-common - v9.49.0 - Thu Jul 21 2022 17:19:07 GMT+0000 (Coordinated Universal Time)
2
+ * @esri/hub-common - v10.0.0-next.1 - Fri Jul 22 2022 18:15:55 GMT+0000 (Coordinated Universal Time)
3
3
  * Copyright (c) 2022 Environmental Systems Research Institute, Inc.
4
4
  * Apache-2.0
5
5
  */
@@ -13431,76 +13431,6 @@
13431
13431
  return api;
13432
13432
  }
13433
13433
  }
13434
- /**
13435
- * @private
13436
- * Merge two date ranges by taking the longest span
13437
- * @param dr1
13438
- * @param dr2
13439
- * @returns
13440
- */
13441
- function mergeDateRange(dr1, dr2) {
13442
- // TODO: Remove with _searchContent
13443
- var result = cloneObject$1(dr1);
13444
- // feels like there is a more concise way to do this...
13445
- if (dr2.from < dr1.from) {
13446
- result.from = dr2.from;
13447
- }
13448
- if (dr2.to > dr1.to) {
13449
- result.to = dr2.to;
13450
- }
13451
- return result;
13452
- }
13453
- /**
13454
- * @private
13455
- * Merge two [`MatchOptions`](../MatchOptions)
13456
- *
13457
- * Currently a naieve implementation where the arrays are simply merged
13458
- *
13459
- * @param mo1
13460
- * @param mo2
13461
- * @returns
13462
- */
13463
- function mergeMatchOptions(mo1, mo2) {
13464
- // TODO: Remove with _searchContent
13465
- var result = {};
13466
- // None of these props are required, so we can't just
13467
- // use Object.keys/.entries
13468
- var props = ["any", "all", "not", "exact"];
13469
- props.forEach(function (prop) {
13470
- var key = prop;
13471
- var merged = __spreadArrays(getMatchValue(mo1, key), getMatchValue(mo2, key));
13472
- if (merged.length) {
13473
- // remove any dupes and set on the return
13474
- result[key] = merged.filter(unique);
13475
- }
13476
- });
13477
- return result;
13478
- }
13479
- /**
13480
- * Get the value of a property on an IMatchOptions
13481
- *
13482
- * This is complex b/c all the props are optional, and
13483
- * they could be a simple string, or an array of strings.
13484
- *
13485
- * This function normalizes all that and returns an array,
13486
- * which may or may not be empty
13487
- * @param option
13488
- * @param key
13489
- * @returns
13490
- */
13491
- function getMatchValue(option, key) {
13492
- var matchValue = [];
13493
- if (option[key]) {
13494
- var val = option[key];
13495
- if (Array.isArray(val)) {
13496
- matchValue = val;
13497
- }
13498
- else {
13499
- matchValue = [val];
13500
- }
13501
- }
13502
- return matchValue;
13503
- }
13504
13434
  /**
13505
13435
  * @private
13506
13436
  * Convert a field value into a MatchOptions if it's not already one
@@ -13508,1209 +13438,129 @@
13508
13438
  * @returns
13509
13439
  */
13510
13440
  function valueToMatchOptions(value) {
13511
- var result = {};
13512
- if (Array.isArray(value)) {
13513
- result = {
13514
- any: value,
13515
- };
13516
- }
13517
- else {
13518
- if (typeof value === "string") {
13519
- result = {
13520
- any: [value],
13521
- };
13522
- }
13523
- if (typeof value === "object") {
13524
- result = value;
13525
- }
13526
- }
13527
- return result;
13528
- }
13529
- /**
13530
- * @private
13531
- * Convert a RelativeDate to a DateRange<number>
13532
- * @param relative
13533
- * @returns
13534
- */
13535
- function relativeDateToDateRange(relative) {
13536
- // hash of offsets
13537
- var offsetMs = {
13538
- min: 1000 * 60,
13539
- hours: 1000 * 60 * 60,
13540
- days: 1000 * 60 * 60 * 24,
13541
- weeks: 1000 * 60 * 60 * 24 * 7,
13542
- };
13543
- var now = new Date();
13544
- // default
13545
- var result = {
13546
- type: "date-range",
13547
- from: now.getTime(),
13548
- to: now.getTime(),
13549
- };
13550
- //
13551
- switch (relative.unit) {
13552
- case "hours":
13553
- case "days":
13554
- case "weeks":
13555
- result.from = result.to - offsetMs[relative.unit] * relative.num;
13556
- break;
13557
- case "months":
13558
- // get the current month and subtract num
13559
- // NOTE: when the previous month has fewer days than this month
13560
- // setMonth() will return a date w/in the current month
13561
- // example: 3/30 -> 3/2 b/c there is no 2/28
13562
- now.setMonth(now.getMonth() - relative.num);
13563
- result.from = now.getTime();
13564
- break;
13565
- case "years":
13566
- now.setFullYear(now.getFullYear() - relative.num);
13567
- result.from = now.getTime();
13568
- break;
13569
- }
13570
- return result;
13571
- }
13572
- /**
13573
- * @private
13574
- * As a final `ISearchOptions` object gets created, many such objects are created, and
13575
- * need to be systematically "merged" so as to return consistently structured `q` and `filter`
13576
- * values.
13577
- * @param so1
13578
- * @param so2
13579
- * @param join
13580
- * @returns
13581
- */
13582
- function mergeSearchOptions$1(so1, so2, join) {
13583
- // TODO: Remove with _searchContent
13584
- Logger.warn("DEPRECATION: mergeSearchOptions will be removed. Work with IFilterGroups<\"group\"> and hubSearch() instead");
13585
- var result = cloneObject$1(so1);
13586
- var q = so2.q, filter = so2.filter;
13587
- if (q) {
13588
- result.q = (result.q ? " (" + result.q + " " + join + " " + q + ")" : q).trim();
13589
- }
13590
- if (filter) {
13591
- result.filter = (result.filter ? "(" + result.filter + " " + join + " " + filter + ")" : filter).trim();
13592
- }
13593
- return result;
13594
- }
13595
- /**
13596
- * @private
13597
- * Serialize a `MatchOptions` into `q` or `filter` on an `ISearchOptions`
13598
- * DEPRECATED: Serialization should be handled in filter-utils.ts
13599
- * @param key
13600
- * @param opts
13601
- * @returns
13602
- */
13603
- function serializeMatchOptions$1(key, opts) {
13604
- var result = {
13605
- q: "",
13606
- filter: "",
13607
- };
13608
- if (opts.exact) {
13609
- // defined separately for refactoring later
13610
- var userFilterableFields = [
13611
- "username",
13612
- "firstname",
13613
- "lastname",
13614
- "fullname",
13615
- "email",
13616
- ];
13617
- var itemFilterableFields = [
13618
- "title",
13619
- "tags",
13620
- "typekeywords",
13621
- "type",
13622
- "name",
13623
- "owner",
13624
- ];
13625
- var groupFilterableFields = ["title", "typekeywords", "owner"];
13626
- var filterableFields = __spreadArrays(userFilterableFields, itemFilterableFields, groupFilterableFields);
13627
- if (filterableFields.includes(key)) {
13628
- result.filter = serializeStringOrArray$1("AND", key, opts.exact);
13629
- }
13630
- else {
13631
- // Treat it the same as .all
13632
- if (typeof opts.exact === "string") {
13633
- if (!opts.all) {
13634
- opts.all = [];
13635
- }
13636
- if (typeof opts.all === "string") {
13637
- opts.all = [opts.all];
13638
- }
13639
- opts.all.push(opts.exact);
13640
- }
13641
- if (Array.isArray(opts.exact)) {
13642
- if (!opts.all) {
13643
- opts.all = [];
13644
- }
13645
- if (typeof opts.all === "string") {
13646
- opts.all = [opts.all];
13647
- }
13648
- opts.all = opts.all.concat(opts.exact);
13649
- }
13650
- }
13651
- }
13652
- // Handle the other props
13653
- if (opts.any) {
13654
- result.q = serializeStringOrArray$1("OR", key, opts.any);
13655
- }
13656
- if (opts.all) {
13657
- result.q =
13658
- (result.q ? result.q + " AND " : "") +
13659
- serializeStringOrArray$1("AND", key, opts.all);
13660
- }
13661
- if (opts.not) {
13662
- // negate the entries if they are not
13663
- result.q =
13664
- (result.q ? result.q + " AND " : "") +
13665
- serializeStringOrArray$1("OR", "-" + key, opts.not);
13666
- }
13667
- return result;
13668
- }
13669
- /**
13670
- * @private
13671
- * Serialize a DateRange<number> into a Portal Query string
13672
- * @param key
13673
- * @param range
13674
- * @returns
13675
- */
13676
- function serializeDateRange$1(key, range) {
13677
- return {
13678
- q: key + ":[" + range.from + " TO " + range.to + "]",
13679
- filter: "",
13680
- };
13681
- }
13682
- /**
13683
- * @private
13684
- * Serialize a `string` or `string[]` into a string
13685
- * @param join
13686
- * @param key
13687
- * @param value
13688
- * @returns
13689
- */
13690
- function serializeStringOrArray$1(join, key, value) {
13691
- var q = "";
13692
- if (Array.isArray(value)) {
13693
- q = key + ":\"" + value.join("\" " + join + " " + key + ":\"") + "\"";
13694
- if (value.length > 1) {
13695
- q = "(" + q + ")";
13696
- }
13697
- }
13698
- else {
13699
- q = key + ":\"" + value + "\"";
13700
- }
13701
- return q;
13702
- }
13703
- /**
13704
- * Create a `.next()` function for a type
13705
- * @param request
13706
- * @param nextStart
13707
- * @param total
13708
- * @param fn
13709
- * @returns
13710
- */
13711
- function getNextFunction(request, nextStart, total, fn) {
13712
- var clonedRequest = cloneObject$1(request);
13713
- // clone will not handle authentication so we do it manually
13714
- if (request.authentication) {
13715
- clonedRequest.authentication = UserSession.deserialize(request.authentication.serialize());
13716
- }
13717
- // figure out the start
13718
- clonedRequest.start = nextStart > -1 ? nextStart : total + 1;
13719
- return function (authentication) {
13720
- if (authentication) {
13721
- clonedRequest.authentication = authentication;
13722
- }
13723
- return fn(clonedRequest);
13724
- };
13725
- }
13726
- /**
13727
- * Construct a the full url to a group thumbnail
13728
- *
13729
- * - If the group has a thumbnail, construct the full url
13730
- * - If the group is not public, append on the token (if passed in)
13731
- * @param portalUrl
13732
- * @param group
13733
- * @param token
13734
- * @returns
13735
- */
13736
- function getGroupThumbnailUrl(portalUrl, group, token) {
13737
- var thumbnailUrl = null;
13738
- if (group.thumbnail) {
13739
- thumbnailUrl = portalUrl + "/community/groups/" + group.id + "/info/" + group.thumbnail;
13740
- if (token && group.access !== "public") {
13741
- thumbnailUrl = thumbnailUrl + "?token=" + token;
13742
- }
13743
- }
13744
- return thumbnailUrl;
13745
- }
13746
- /**
13747
- * Construct a the full url to a user thumbnail
13748
- *
13749
- * - If the user has a thumbnail, construct the full url
13750
- * - If the user is not public, append on the token
13751
- * @param portalUrl
13752
- * @param user
13753
- * @param token
13754
- * @returns
13755
- */
13756
- function getUserThumbnailUrl(portalUrl, user, token) {
13757
- var thumbnailUrl = null;
13758
- if (user.thumbnail) {
13759
- thumbnailUrl = portalUrl + "/community/users/" + user.username + "/info/" + user.thumbnail;
13760
- if (token && user.access !== "public") {
13761
- thumbnailUrl = thumbnailUrl + "?token=" + token;
13762
- }
13763
- }
13764
- return thumbnailUrl;
13765
- }
13766
-
13767
- // TODO: Remove with _searchContent
13768
- // TODO: Implement $dataset
13769
- var ContentFilterExpansions = {
13770
- $apps: [
13771
- {
13772
- type: {
13773
- any: [
13774
- "Code Sample",
13775
- "Web Mapping Application",
13776
- "Mobile Application",
13777
- "Application",
13778
- "Desktop Application Template",
13779
- "Desktop Application",
13780
- "Operation View",
13781
- "Dashboard",
13782
- "Operations Dashboard Extension",
13783
- "Workforce Project",
13784
- "Insights Workbook",
13785
- "Insights Page",
13786
- "Insights Model",
13787
- "Hub Page",
13788
- "Hub Initiative",
13789
- "Hub Site Application",
13790
- "StoryMap",
13791
- "Web Experience",
13792
- "Web Experience Template",
13793
- "Form",
13794
- ],
13795
- not: [
13796
- "Code Attachment",
13797
- "Featured Items",
13798
- "Symbol Set",
13799
- "Color Set",
13800
- "Windows Viewer Add In",
13801
- "Windows Viewer Configuration",
13802
- "Map Area",
13803
- "Indoors Map Configuration",
13804
- ],
13805
- },
13806
- typekeywords: {
13807
- not: ["MapAreaPackage", "SMX"],
13808
- },
13809
- },
13810
- ],
13811
- $storymap: [
13812
- {
13813
- type: "StoryMap",
13814
- },
13815
- {
13816
- type: "Web Mapping Application",
13817
- typekeywords: ["Story Map"],
13818
- },
13819
- ],
13820
- $dashboard: [
13821
- {
13822
- type: "Dashboard",
13823
- typekeywords: {
13824
- any: ["Dashboard"],
13825
- not: ["ArcGIS Operation View", "Add In", "Extension"],
13826
- },
13827
- },
13828
- ],
13829
- $dataset: [],
13830
- $experience: [
13831
- {
13832
- type: {
13833
- any: ["Web Experience"],
13834
- not: ["Web Experience Template"],
13835
- },
13836
- },
13837
- ],
13838
- $site: [
13839
- {
13840
- type: ["Hub Site Application", "Site Application"],
13841
- },
13842
- {
13843
- type: ["Web Mapping Application"],
13844
- typekeywords: ["hubSite"],
13845
- },
13846
- ],
13847
- $initiative: [
13848
- {
13849
- type: {
13850
- any: "Hub Initiative",
13851
- not: "Hub Initiative Template",
13852
- },
13853
- },
13854
- ],
13855
- $document: [
13856
- {
13857
- typekeywords: {
13858
- any: "Document",
13859
- not: ["MapAreaPackage", "SMX"],
13860
- },
13861
- type: {
13862
- any: [
13863
- "Image",
13864
- "Layout",
13865
- "Desktop Style",
13866
- "Project Template",
13867
- "Report Template",
13868
- "Pro Report",
13869
- "Statistical Data Collection",
13870
- "360 VR Experience",
13871
- "netCDF",
13872
- "PDF",
13873
- "CSV",
13874
- "Administrative Report",
13875
- "Raster function template",
13876
- ],
13877
- not: [
13878
- "Image Service",
13879
- "Explorer Document",
13880
- "Explorer Map",
13881
- "Globe Document",
13882
- "Scene Document",
13883
- "Code Attachment",
13884
- "Featured Items",
13885
- "Symbol Set",
13886
- "ColorSet",
13887
- "Windows Viewer Add In",
13888
- "Windows Viewer Configuration",
13889
- "Map Area",
13890
- "Indoors Map Configuration",
13891
- ],
13892
- },
13893
- },
13894
- ],
13895
- };
13896
- /**
13897
- * Merge `Filter<"content">` objects
13898
- *
13899
- * Useful in components which may get partial filters from a variety of
13900
- * sub-components, which are then combined into a single filter prior
13901
- * to executing the search.
13902
- * @param filters
13903
- * @returns
13904
- */
13905
- function mergeContentFilter(filters) {
13906
- Logger.warn("DEPRECATION: mergeContentFilter will be removed and filters should not longer be merged. Work with IFilterGroups instead");
13907
- // expand all the filters so all prop types are consistent
13908
- var expanded = filters.map(expandContentFilter);
13909
- // now we can merge based on fields
13910
- var dateFields = ["created", "modified"];
13911
- var specialFields = __spreadArrays(["filterType", "subFilters", "term"], dateFields);
13912
- var result = expanded.reduce(function (acc, entry) {
13913
- // process fields
13914
- Object.entries(entry).forEach(function (_a) {
13915
- var key = _a[0], value = _a[1];
13916
- if (acc.hasOwnProperty(key)) {
13917
- /* istanbul ignore else */
13918
- if (!specialFields.includes(key)) {
13919
- acc[key] = mergeMatchOptions(acc[key], value);
13920
- }
13921
- else if (dateFields.includes(key)) {
13922
- acc[key] = mergeDateRange(acc[key], value);
13923
- }
13924
- else if (key === "term") {
13925
- acc[key] = acc[key] + " " + value;
13926
- }
13927
- else if (key === "subFilters") {
13928
- acc[key] = mergeSubFilters(acc[key], value);
13929
- }
13930
- }
13931
- else {
13932
- acc[key] = cloneObject$1(value);
13933
- }
13934
- });
13935
- return acc;
13936
- }, {});
13937
- result.filterType = "content";
13938
- return result;
13939
- }
13940
- function mergeSubFilters(sf1, sf2) {
13941
- // Simplistic implementation: we just merge the arrays
13942
- // in the future we may try to de-dupe things as a safeguard
13943
- return __spreadArrays(sf1, sf2);
13944
- }
13945
- /**
13946
- * Prior to serialization into the query syntax for the backing APIs, we first expand [Filters](../Filter)
13947
- *
13948
- * Filter's can express their intent in a very terse form, but to ensure consistent structures
13949
- * we expand them into their more verbose form.
13950
- *
13951
- * i.e. `title: "Water"` expands into `title: { any: ["Water"]}`
13952
- *
13953
- * - "well known" type values are expanded
13954
- * - i.e. `type: "$storymap"` expands into two `subFilter` entries
13955
- * - Fields defined as `string | string[] | MatchOptions` will be converted to a `MatchOptions`
13956
- * - RelativeDate fields are converted to DateRange<number>
13957
- *
13958
- * @param filter
13959
- * @returns
13960
- */
13961
- function expandContentFilter(filter) {
13962
- Logger.warn("DEPRECATION: expandContentFilter will be removed. Work with IFilterGroups<\"item\"> instead");
13963
- // Expand filter.type first
13964
- var expandedTypeFilter = expandTypeField(filter);
13965
- // Expand subfilters
13966
- // Guard - JS Clients could send in anything...
13967
- if (Array.isArray(filter.subFilters)) {
13968
- // Convert any strings into the coresponding ContentFilterDefinition
13969
- expandedTypeFilter.subFilters = expandedTypeFilter.subFilters.reduce(function (acc, entry) {
13970
- if (typeof entry === "string") {
13971
- // if the entry is not a key of ContentFilterExpansions
13972
- // we just skip over it
13973
- if (ContentFilterExpansions[entry]) {
13974
- acc = acc.concat(ContentFilterExpansions[entry]);
13975
- }
13976
- }
13977
- else {
13978
- acc.push(entry); // should be a ContentFilterDefinition
13979
- }
13980
- return acc;
13981
- }, []);
13982
- }
13983
- // Convert all props into MatchOptions/DateRanges
13984
- return convertContentDefinitionToFilter(expandedTypeFilter);
13985
- }
13986
- /**
13987
- * @private
13988
- * Expand from a well-known "type" into it's longer form
13989
- *
13990
- * i.e. `type: "$storymap"` expands into two subFilters entries
13991
- *
13992
- * @param filter
13993
- * @returns
13994
- */
13995
- function expandTypeField(filter) {
13996
- var clone = cloneObject$1(filter);
13997
- // ensure subFilters is defined as an array
13998
- clone.subFilters = clone.subFilters || [];
13999
- if (clone.type) {
14000
- // if .type is an Array...
14001
- if (Array.isArray(clone.type)) {
14002
- // remove any well-known-keys and move their expansions into subfilters
14003
- clone.type = clone.type.reduce(function (acc, entry) {
14004
- if (isWellKnownType(entry)) {
14005
- // working with dynamic objects in typescript requires some assertions
14006
- var key = entry;
14007
- clone.subFilters = clone.subFilters.concat(lookupTypeFilters(key));
14008
- }
14009
- else {
14010
- acc.push(entry);
14011
- }
14012
- return acc;
14013
- }, []);
14014
- }
14015
- else if (isWellKnownType(clone.type)) {
14016
- var key = clone.type;
14017
- clone.subFilters = clone.subFilters.concat(lookupTypeFilters(key));
14018
- delete clone.type;
14019
- }
14020
- else ;
14021
- }
14022
- return clone;
14023
- }
14024
- /**
14025
- * Is the argument a well-known type "key"
14026
- *
14027
- * Accepts `string`, `string[]` or `IMatchOptions`
14028
- * but only string values can possibly be properties
14029
- * on `ContentFilterExpansions`
14030
- * @param key
14031
- * @returns
14032
- */
14033
- function isWellKnownType(key) {
14034
- var result = false;
14035
- if (typeof key === "string") {
14036
- result = key in ContentFilterExpansions;
14037
- }
14038
- return result;
14039
- }
14040
- function lookupTypeFilters(key) {
14041
- return ContentFilterExpansions[key];
14042
- }
14043
- /**
14044
- * @private
14045
- * Convert a `ContentFilterDefinition` to a `ContentFilter`
14046
- *
14047
- * ContentFilter is a narrower version of ContentFilterDefinition, without
14048
- * the union types. Using a ContentFilter makes working with the structure
14049
- * in typescript much easier.
14050
- *
14051
- * @param filter
14052
- * @returns
14053
- */
14054
- function convertContentDefinitionToFilter(filter) {
14055
- // TODO: Remove with _searchContent
14056
- Logger.warn("DEPRECATION: convertContentDefinitionToFilter will be removed. Work with IFilterGroups<\"item\"> instead");
14057
- var result = {};
14058
- if (filter.term) {
14059
- result.term = filter.term;
14060
- }
14061
- var dateProps = ["created", "modified"];
14062
- // Some properties should not get converted to MatchOptions
14063
- var specialProps = __spreadArrays(["filterType", "subFilters", "term"], dateProps);
14064
- // Do the conversion
14065
- Object.entries(filter).forEach(function (_a) {
14066
- var key = _a[0], value = _a[1];
14067
- if (!specialProps.includes(key)) {
14068
- result[key] = valueToMatchOptions(value);
14069
- }
14070
- });
14071
- // Special Cases
14072
- // subFilters; Array of ContentFilterDefinitions
14073
- if (filter.subFilters && Array.isArray(filter.subFilters)) {
14074
- // downcast - would be nice to skip this or use some other constuct
14075
- var sf = filter.subFilters;
14076
- result.subFilters = sf.map(convertContentDefinitionToFilter);
14077
- }
14078
- // Dates; Ensure they are all DateRange<number>
14079
- dateProps.forEach(function (fld) {
14080
- if (filter[fld]) {
14081
- if (filter[fld].type === "relative-date") {
14082
- result[fld] = relativeDateToDateRange(filter[fld]);
14083
- }
14084
- else {
14085
- result[fld] = cloneObject$1(filter[fld]);
14086
- }
14087
- }
14088
- });
14089
- return result;
14090
- }
14091
- /**
14092
- * @private
14093
- * Serialize a `ContentFilter` into an `ISearchOptions` for use with `searchItems`
14094
- * @param filter
14095
- * @returns
14096
- */
14097
- function serializeContentFilterForPortal(filter) {
14098
- // TODO: Remove with _searchContent
14099
- Logger.warn("DEPRECATION: serializeContentFilterForPortal will be removed. Work with IFilterGroups<\"item\"> and hubSearch() instead");
14100
- var searchOptions = convertContentFilterToSearchOptions(filter);
14101
- if (filter.subFilters) {
14102
- var subFilterOptions = filter.subFilters.reduce(function (acc, entry) {
14103
- // Next guard is present b/c this can be used from javascript
14104
- // but our tests are written in typescript which prevents us
14105
- // from hitting the else
14106
- /* istanbul ignore else */
14107
- if (typeof entry === "object") {
14108
- acc = mergeSearchOptions$1(acc, convertContentFilterToSearchOptions(entry), "OR");
14109
- }
14110
- return acc;
14111
- }, { q: "", filter: "" });
14112
- // merge with searchOptions using AND
14113
- searchOptions = mergeSearchOptions$1(searchOptions, subFilterOptions, "AND");
14114
- }
14115
- // term is always last, and pre-pended on searchOptions.q
14116
- if (filter.term) {
14117
- searchOptions.q = (filter.term + " " + searchOptions.q).trim();
14118
- }
14119
- return searchOptions;
14120
- }
14121
- /**
14122
- * @private
14123
- * Convert a ContentFilter to a SearchOptions
14124
- *
14125
- * @param filter
14126
- * @returns
14127
- */
14128
- function convertContentFilterToSearchOptions(filter) {
14129
- // TODO: Remove with _searchContent
14130
- Logger.warn("DEPRECATION: convertContentFilterToSearchOptions will be removed. Work with IFilterGroups<\"item\"> and hubSearch() instead");
14131
- var result = {
14132
- q: "",
14133
- filter: "",
14134
- };
14135
- var dateProps = ["created", "modified"];
14136
- var specialProps = __spreadArrays(["filterType", "subFilters", "term"], dateProps);
14137
- Object.entries(filter).forEach(function (_a) {
14138
- var key = _a[0], value = _a[1];
14139
- // MatchOptions may go into either q or filter
14140
- if (!specialProps.includes(key)) {
14141
- result = mergeSearchOptions$1(result, serializeMatchOptions$1(key, value), "AND");
14142
- }
14143
- // Dates only go into q
14144
- if (dateProps.includes(key)) {
14145
- result = mergeSearchOptions$1(result, serializeDateRange$1(key, value), "AND");
14146
- }
14147
- });
14148
- return result;
14149
- }
14150
-
14151
- // TODO: Remove with _searchContent
14152
- /**
14153
- *
14154
- * Merge `Filter<"group">` objects
14155
- *
14156
- * Useful in components which may get partial filters from a variety of
14157
- * sub-components, which are then combined into a single filter prior
14158
- * to executing the search.
14159
- * @param filters
14160
- * @returns
14161
- */
14162
- function mergeGroupFilters(filters) {
14163
- // TODO: Remove with _searchContent
14164
- Logger.warn("DEPRECATION: mergeGroupFilters will be removed. Work with IFilterGroups<\"group\"> and hubSearch() instead");
14165
- // expand all the filters so all prop types are consistent
14166
- var expanded = filters.map(expandGroupFilter);
14167
- // now we can merge based on fields
14168
- var dateFields = ["created", "modified"];
14169
- var specialFields = __spreadArrays(["filterType", "term"], dateFields);
14170
- // acc is initialized as Filter<group> but also needs it
14171
- // in the function signature... for reasons?!
14172
- var result = expanded.reduce(function (acc, entry) {
14173
- // process fields
14174
- Object.entries(entry).forEach(function (_a) {
14175
- // Note: getProp/setProp are used to get around
14176
- // typescript issues with string indexing
14177
- var key = _a[0], value = _a[1];
14178
- if (acc.hasOwnProperty(key)) {
14179
- var existingValue = getProp(acc, key);
14180
- // if the key is not to a special field
14181
- if (!specialFields.includes(key)) {
14182
- // treat as an IMatchOptions
14183
- setProp(key, mergeMatchOptions(existingValue, value), acc);
14184
- }
14185
- else if (dateFields.includes(key)) {
14186
- // treat as IDateRange
14187
- setProp(key, mergeDateRange(existingValue, value), acc);
14188
- }
14189
- else if (key === "term") {
14190
- // append terms
14191
- acc[key] = acc[key] + " " + value;
14192
- }
14193
- }
14194
- else {
14195
- // Acc does not have an entry for this yet
14196
- // so just clone it
14197
- setProp(key, cloneObject$1(value), acc);
14198
- }
14199
- });
14200
- return acc;
14201
- }, {
14202
- filterType: "group",
14203
- });
14204
- return result;
14205
- }
14206
- /**
14207
- * Prior to serialization into the query syntax for the backing APIs, we first expand [Filters](../Filter)
14208
- *
14209
- * Filter's can express their intent in a very terse form, but to ensure consistent structures
14210
- * we expand them into their more verbose form.
14211
- *
14212
- * i.e. `title: "Water"` expands into `title: { any: ["Water"]}`
14213
- *
14214
- * - Fields defined as `string | string[] | MatchOptions` will be converted to a `MatchOptions`
14215
- * - RelativeDate fields are converted to DateRange<number>
14216
- *
14217
- * @param filter
14218
- * @returns
14219
- */
14220
- function expandGroupFilter(filter) {
14221
- // TODO: Remove with _searchContent
14222
- Logger.warn("DEPRECATION: expandGroupFilters will be removed. Work with IFilterGroups<\"group\"> and hubSearch() instead");
14223
- var result = {};
14224
- var dateProps = ["created", "modified"];
14225
- // Some properties should not get converted to MatchOptions
14226
- var specialProps = __spreadArrays(["term", "searchUserAccess"], dateProps);
14227
- // Do the conversion
14228
- Object.entries(filter).forEach(function (_a) {
14229
- var key = _a[0], value = _a[1];
14230
- // handle Matchish fields
14231
- if (!specialProps.includes(key)) {
14232
- // setProp side-steps typescript complaining
14233
- setProp(key, valueToMatchOptions(value), result);
14234
- }
14235
- // Handle date fields
14236
- if (dateProps.includes(key)) {
14237
- var dateFieldValue = cloneObject$1(getProp(filter, key));
14238
- if (getProp(filter, key + ".type") === "relative-date") {
14239
- setProp(key, relativeDateToDateRange(dateFieldValue), result);
14240
- }
14241
- else {
14242
- setProp(key, dateFieldValue, result);
14243
- }
14244
- }
14245
- });
14246
- // searchUserAccess is boolean, so we check if the prop exists
14247
- // vs checking if the value is truthy
14248
- if (filter.hasOwnProperty("searchUserAccess")) {
14249
- result.searchUserAccess = filter.searchUserAccess;
14250
- }
14251
- if (filter.term) {
14252
- result.term = filter.term;
14253
- }
14254
- return result;
14255
- }
14256
- /**
14257
- * @private
14258
- * Serialize an `IGroupFilterDefinition` into an `ISearchOptions` for use
14259
- * with `searchGroups`
14260
- * @param filter
14261
- * @returns
14262
- */
14263
- function serializeGroupFilterForPortal(filter) {
14264
- // TODO: Remove with _searchContent
14265
- Logger.warn("DEPRECATION: serializeGroupFilterForPortal will be removed. Work with IFilterGroups<\"group\"> and hubSearch() instead");
14266
- var result = {
14267
- q: "",
14268
- filter: "",
14269
- };
14270
- var dateProps = ["created", "modified"];
14271
- var specialProps = __spreadArrays(["term", "searchUserAccess", "filterType"], dateProps);
14272
- Object.entries(filter).forEach(function (_a) {
14273
- var key = _a[0], value = _a[1];
14274
- // MatchOptions fields
14275
- if (!specialProps.includes(key)) {
14276
- result = mergeSearchOptions$1(result, serializeMatchOptions$1(key, value), "AND");
14277
- }
14278
- // Dates only go into q
14279
- if (dateProps.includes(key)) {
14280
- result = mergeSearchOptions$1(result, serializeDateRange$1(key, value), "AND");
14281
- }
14282
- });
14283
- // searchUserAccess is also a top-level property
14284
- if (filter.hasOwnProperty("searchUserAccess")) {
14285
- result.searchUserAccess = filter.searchUserAccess;
14286
- }
14287
- // add the term
14288
- if (filter.term) {
14289
- result.q = (filter.term + " " + result.q).trim();
14290
- }
14291
- return result;
14292
- }
14293
-
14294
- // TODO: Remove with _searchContent
14295
- /**
14296
- *
14297
- * Merge `Filter<"user">` objects
14298
- *
14299
- * Useful in components which may get partial filters from a variety of
14300
- * sub-components, which are then combined into a single filter prior
14301
- * to executing the search.
14302
- * @param filters
14303
- * @returns
14304
- */
14305
- function mergeUserFilters(filters) {
14306
- // TODO: Remove with _searchContent
14307
- Logger.warn("DEPRECATION: mergeUserFilters will be removed. Work with IFilterGroups<\"user\"> and hubSearch() instead");
14308
- // expand all the filters so all prop types are consistent
14309
- var expanded = filters.map(expandUserFilter);
14310
- // now we can merge based on fields
14311
- var dateFields = ["created", "modified", "lastlogin"];
14312
- var specialFields = __spreadArrays(["disabled", "term", "filterType"], dateFields);
14313
- // acc is initialized as Filter<group> but also needs it
14314
- // in the function signature... for reasons?!
14315
- var result = expanded.reduce(function (acc, entry) {
14316
- // process fields
14317
- Object.entries(entry).forEach(function (_a) {
14318
- // Note: getProp/setProp are used to get around
14319
- // typescript issues with string indexing
14320
- var key = _a[0], value = _a[1];
14321
- if (acc.hasOwnProperty(key)) {
14322
- var existingValue = getProp(acc, key);
14323
- // if the key is not to a special field
14324
- if (!specialFields.includes(key)) {
14325
- // treat as an IMatchOptions
14326
- setProp(key, mergeMatchOptions(existingValue, value), acc);
14327
- }
14328
- else if (dateFields.includes(key)) {
14329
- // treat as IDateRange
14330
- setProp(key, mergeDateRange(existingValue, value), acc);
14331
- }
14332
- else if (key === "term") {
14333
- // append terms
14334
- acc[key] = acc[key] + " " + value;
14335
- }
14336
- }
14337
- else {
14338
- // Acc does not have an entry for this yet
14339
- // so just clone it
14340
- setProp(key, cloneObject$1(value), acc);
14341
- }
14342
- });
14343
- return acc;
14344
- }, {
14345
- filterType: "user",
14346
- });
14347
- return result;
14348
- }
14349
- /**
14350
- * Prior to serialization into the query syntax for the backing APIs, we first expand [Filters](../Filter)
14351
- *
14352
- * Filter's can express their intent in a very terse form, but to ensure consistent structures
14353
- * we expand them into their more verbose form.
14354
- *
14355
- * i.e. `firstname: "John"` expands into `firstname: { any: ["John"]}`
14356
- *
14357
- * - Fields defined as `string | string[] | MatchOptions` will be converted to a `MatchOptions`
14358
- * - RelativeDate fields are converted to DateRange<number>
14359
- * @param filter
14360
- * @returns
14361
- */
14362
- function expandUserFilter(filter) {
14363
- // TODO: Remove with _searchContent
14364
- Logger.warn("DEPRECATION: expandUserFilter will be removed. Work with IFilterGroups<\"user\"> and hubSearch() instead");
14365
- var result = {};
14366
- var dateProps = ["created", "modified", "lastlogin"];
14367
- var specialProps = __spreadArrays(["disabled", "term"], dateProps);
14368
- Object.entries(filter).forEach(function (_a) {
14369
- var key = _a[0], value = _a[1];
14370
- // handle Matchish fields
14371
- if (!specialProps.includes(key)) {
14372
- // setProp side-steps typescript complaining
14373
- setProp(key, valueToMatchOptions(value), result);
13441
+ var result = {};
13442
+ if (Array.isArray(value)) {
13443
+ result = {
13444
+ any: value,
13445
+ };
13446
+ }
13447
+ else {
13448
+ if (typeof value === "string") {
13449
+ result = {
13450
+ any: [value],
13451
+ };
14374
13452
  }
14375
- // Handle date fields
14376
- if (dateProps.includes(key)) {
14377
- var dateFieldValue = cloneObject$1(getProp(filter, key));
14378
- if (getProp(filter, key + ".type") === "relative-date") {
14379
- setProp(key, relativeDateToDateRange(dateFieldValue), result);
14380
- }
14381
- else {
14382
- setProp(key, dateFieldValue, result);
14383
- }
13453
+ if (typeof value === "object") {
13454
+ result = value;
14384
13455
  }
14385
- });
14386
- // disabled is boolean, so we check if the prop exists
14387
- // vs checking if the value is truthy
14388
- if (filter.hasOwnProperty("disabled")) {
14389
- result.disabled = filter.disabled;
14390
- }
14391
- if (filter.term) {
14392
- result.term = filter.term;
14393
13456
  }
14394
13457
  return result;
14395
13458
  }
14396
13459
  /**
14397
13460
  * @private
14398
- * Serialize an `IUserFilterDefinition` into an `ISearchOptions` for use
14399
- * with `searchUsers`
14400
- * @param filter
13461
+ * Convert a RelativeDate to a DateRange<number>
13462
+ * @param relative
14401
13463
  * @returns
14402
13464
  */
14403
- function serializeUserFilterForPortal(filter) {
14404
- // TODO: Remove with _searchContent
14405
- Logger.warn("DEPRECATION: serializeUserFilterForPortal will be removed. Work with IFilterGroups<\"user\"> and hubSearch() instead");
13465
+ function relativeDateToDateRange(relative) {
13466
+ // hash of offsets
13467
+ var offsetMs = {
13468
+ min: 1000 * 60,
13469
+ hours: 1000 * 60 * 60,
13470
+ days: 1000 * 60 * 60 * 24,
13471
+ weeks: 1000 * 60 * 60 * 24 * 7,
13472
+ };
13473
+ var now = new Date();
13474
+ // default
14406
13475
  var result = {
14407
- q: "",
14408
- filter: "",
13476
+ type: "date-range",
13477
+ from: now.getTime(),
13478
+ to: now.getTime(),
14409
13479
  };
14410
- var dateProps = ["created", "modified", "lastlogin"];
14411
- var specialProps = __spreadArrays(["term", "filterType"], dateProps);
14412
- Object.entries(filter).forEach(function (_a) {
14413
- var key = _a[0], value = _a[1];
14414
- // MatchOptions fields
14415
- if (!specialProps.includes(key)) {
14416
- result = mergeSearchOptions$1(result, serializeMatchOptions$1(key, value), "AND");
14417
- }
14418
- // Dates only go into q
14419
- if (dateProps.includes(key)) {
14420
- result = mergeSearchOptions$1(result, serializeDateRange$1(key, value), "AND");
14421
- }
14422
- });
14423
- // disabled is also a top-level property
14424
- if (filter.hasOwnProperty("disabled")) {
14425
- result.disabled = filter.disabled;
14426
- }
14427
- // add the term
14428
- if (filter.term) {
14429
- // Note: this is slightly different from other types
14430
- result.q = ("(" + filter.term + ") " + result.q).trim();
13480
+ //
13481
+ switch (relative.unit) {
13482
+ case "hours":
13483
+ case "days":
13484
+ case "weeks":
13485
+ result.from = result.to - offsetMs[relative.unit] * relative.num;
13486
+ break;
13487
+ case "months":
13488
+ // get the current month and subtract num
13489
+ // NOTE: when the previous month has fewer days than this month
13490
+ // setMonth() will return a date w/in the current month
13491
+ // example: 3/30 -> 3/2 b/c there is no 2/28
13492
+ now.setMonth(now.getMonth() - relative.num);
13493
+ result.from = now.getTime();
13494
+ break;
13495
+ case "years":
13496
+ now.setFullYear(now.getFullYear() - relative.num);
13497
+ result.from = now.getTime();
13498
+ break;
14431
13499
  }
14432
13500
  return result;
14433
13501
  }
14434
-
14435
- // TODO: Remove with _searchContent
14436
- /**
14437
- * @private
14438
- * Search for content via the Portal or Hub API
14439
- * @param filter
14440
- * @param options
14441
- */
14442
- function _searchContent(filter, options) {
14443
- var _a, _b;
14444
- return __awaiter(this, void 0, void 0, function () {
14445
- var expanded, api, searchPromise, so_1, props;
14446
- return __generator(this, function (_c) {
14447
- Logger.warn("DEPRECATION: _searchContent will be removed; switch to hubSearch(...)");
14448
- expanded = expandContentFilter(filter);
14449
- api = expandApi(options.api || "arcgis");
14450
- // Portal Search
14451
- if (api.type === "arcgis") {
14452
- so_1 = serializeContentFilterForPortal(expanded);
14453
- props = [
14454
- "authentication",
14455
- "num",
14456
- "sortField",
14457
- "sortOrder",
14458
- "site",
14459
- "start",
14460
- ];
14461
- // copy the props over
14462
- props.forEach(function (prop) {
14463
- if (options.hasOwnProperty(prop)) {
14464
- so_1[prop] = options[prop];
14465
- }
14466
- });
14467
- // If we don't have auth, ensure we have .portal
14468
- if (!so_1.authentication) {
14469
- so_1.portal = api.url + "/sharing/rest";
14470
- }
14471
- // DEPRECATION
14472
- if ((_a = options.aggregations) === null || _a === void 0 ? void 0 : _a.length) {
14473
- // tslint:disable-next-line:no-console
14474
- console.warn("IHubSearchOptions.aggregations is deprecated. Please use .aggFields instead.");
14475
- so_1.countFields = options.aggregations.join(",");
14476
- so_1.countSize = options.aggLimit || 10;
14477
- }
14478
- // Aggregations
14479
- if ((_b = options.aggFields) === null || _b === void 0 ? void 0 : _b.length) {
14480
- so_1.countFields = options.aggFields.join(",");
14481
- so_1.countSize = options.aggLimit || 10;
14482
- }
14483
- searchPromise = searchPortal$3(so_1);
14484
- }
14485
- else {
14486
- // Hub API Search
14487
- // TODO: Implement hub api content search
14488
- searchPromise = Promise.resolve({
14489
- total: 0,
14490
- results: [],
14491
- hasNext: false,
14492
- next: function () {
14493
- // tslint:disable-next-line
14494
- Promise.resolve(null);
14495
- },
14496
- });
14497
- }
14498
- return [2 /*return*/, searchPromise];
14499
- });
14500
- });
14501
- }
14502
13502
  /**
14503
- * Internal portal search, which then converts items to Content, and
14504
- * if a Site was passed, also sets urls
14505
- *
14506
- * @param searchOptions
14507
- * @param site
13503
+ * Create a `.next()` function for a type
13504
+ * @param request
13505
+ * @param nextStart
13506
+ * @param total
13507
+ * @param fn
14508
13508
  * @returns
14509
13509
  */
14510
- function searchPortal$3(searchOptions) {
14511
- var _a;
14512
- var portalUrl = ((_a = searchOptions.authentication) === null || _a === void 0 ? void 0 : _a.portal) || searchOptions.portal;
14513
- var token;
14514
- if (searchOptions.authentication) {
14515
- var us = searchOptions.authentication;
14516
- token = us.token;
14517
- }
14518
- var thumbnailify = function (content) {
14519
- content.thumbnailUrl = getItemThumbnailUrl(content, portalUrl, token);
14520
- return content;
14521
- };
14522
- return searchItems(searchOptions).then(function (resp) {
14523
- var hasNext = resp.nextStart > -1;
14524
- // convert items to IHubContent's
14525
- var content = resp.results.map(itemToContent);
14526
- // if we have a site, add those urls
14527
- if (searchOptions.site) {
14528
- content = content.map(function (entry) {
14529
- return setContentSiteUrls(entry, searchOptions.site);
14530
- });
13510
+ function getNextFunction(request, nextStart, total, fn) {
13511
+ var clonedRequest = cloneObject$1(request);
13512
+ // clone will not handle authentication so we do it manually
13513
+ if (request.authentication) {
13514
+ clonedRequest.authentication = UserSession.deserialize(request.authentication.serialize());
13515
+ }
13516
+ // figure out the start
13517
+ clonedRequest.start = nextStart > -1 ? nextStart : total + 1;
13518
+ return function (authentication) {
13519
+ if (authentication) {
13520
+ clonedRequest.authentication = authentication;
14531
13521
  }
14532
- // add thumbnailUrl
14533
- content = content.map(thumbnailify);
14534
- return {
14535
- total: resp.total,
14536
- results: content,
14537
- hasNext: hasNext,
14538
- next: getNextFunction(searchOptions, resp.nextStart, resp.total, searchPortal$3),
14539
- };
14540
- });
13522
+ return fn(clonedRequest);
13523
+ };
14541
13524
  }
14542
-
14543
- // TODO: Remove with _searchContent
14544
13525
  /**
14545
- * @private
14546
- * Search Groups using Filter<"group">
13526
+ * Construct a the full url to a group thumbnail
14547
13527
  *
14548
- * Currently just returns ISearchResult<IGroup>
14549
- * @param filter
14550
- * @param options
14551
- * @returns
14552
- */
14553
- function _searchGroups(filter, options) {
14554
- return __awaiter(this, void 0, void 0, function () {
14555
- var expanded, api, so_1, props;
14556
- return __generator(this, function (_a) {
14557
- Logger.warn("DEPRECATION: _searchGroups will be removed; switch to hubSearch(...)");
14558
- expanded = expandGroupFilter(filter);
14559
- api = expandApi(options.api || "arcgis");
14560
- if (api.type === "arcgis") {
14561
- so_1 = serializeGroupFilterForPortal(expanded);
14562
- props = [
14563
- "authentication",
14564
- "num",
14565
- "sortField",
14566
- "sortOrder",
14567
- "site",
14568
- "start",
14569
- ];
14570
- // copy the props over
14571
- props.forEach(function (prop) {
14572
- if (options.hasOwnProperty(prop)) {
14573
- so_1[prop] = options[prop];
14574
- }
14575
- });
14576
- // If we don't have auth, ensure we have .portal
14577
- if (!so_1.authentication) {
14578
- so_1.portal = api.url + "/sharing/rest";
14579
- }
14580
- return [2 /*return*/, searchPortalGroups(so_1)];
14581
- }
14582
- else {
14583
- throw new Error("_searchGroups is not implemented for non-arcgis apis");
14584
- }
14585
- });
14586
- });
14587
- }
14588
- /**
14589
- * Internal function that searches for groups using the ArcGIS Portal API
14590
- * @param searchOptions
13528
+ * - If the group has a thumbnail, construct the full url
13529
+ * - If the group is not public, append on the token (if passed in)
13530
+ * @param portalUrl
13531
+ * @param group
13532
+ * @param token
14591
13533
  * @returns
14592
13534
  */
14593
- function searchPortalGroups(searchOptions) {
14594
- var _a;
14595
- var teamLinkify = function (group) {
14596
- group.siteTeamUrl = searchOptions.site.item.url + "/teams/" + group.id + "/about";
14597
- return group;
14598
- };
14599
- var portalUrl = ((_a = searchOptions.authentication) === null || _a === void 0 ? void 0 : _a.portal) || searchOptions.portal;
14600
- var token;
14601
- if (searchOptions.authentication) {
14602
- var us = searchOptions.authentication;
14603
- token = us.token;
14604
- }
14605
- var thumbnailify = function (group) {
14606
- group.thumbnailUrl = getGroupThumbnailUrl(portalUrl, group, token);
14607
- return group;
14608
- };
14609
- // execute the search
14610
- return searchGroups(searchOptions).then(function (response) {
14611
- var _a, _b;
14612
- var hasNext = response.nextStart > -1;
14613
- // upgrade thumbnail url
14614
- var results = response.results.map(thumbnailify);
14615
- // generate the site team url if site url is provided
14616
- if ((_b = (_a = searchOptions.site) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.url) {
14617
- results = response.results.map(teamLinkify);
13535
+ function getGroupThumbnailUrl(portalUrl, group, token) {
13536
+ var thumbnailUrl = null;
13537
+ if (group.thumbnail) {
13538
+ thumbnailUrl = portalUrl + "/community/groups/" + group.id + "/info/" + group.thumbnail;
13539
+ if (token && group.access !== "public") {
13540
+ thumbnailUrl = thumbnailUrl + "?token=" + token;
14618
13541
  }
14619
- return {
14620
- hasNext: hasNext,
14621
- total: response.total,
14622
- results: results,
14623
- next: getNextFunction(searchOptions, response.nextStart, response.total, searchPortalGroups),
14624
- };
14625
- });
13542
+ }
13543
+ return thumbnailUrl;
14626
13544
  }
14627
-
14628
- // TODO: Remove with _searchContent
14629
13545
  /**
14630
- * @private
14631
- * Search for Users via the Portal API.
14632
- *
14633
- * **Note** Authentication is required
14634
- *
14635
- * Another trivial comment to force a release
13546
+ * Construct a the full url to a user thumbnail
14636
13547
  *
14637
- * Note: in the future, there may be options to search via
14638
- * a Hub specific API
14639
- * @param filter
14640
- * @param options
14641
- * @returns
14642
- */
14643
- function _searchUsers(filter, options) {
14644
- return __awaiter(this, void 0, void 0, function () {
14645
- var expanded, api, searchOptions_1, props;
14646
- return __generator(this, function (_a) {
14647
- Logger.warn("DEPRECATION: _searchUsers will be removed; switch to hubSearch(...)");
14648
- // JS Clients may not pass in authentication
14649
- if (!options.authentication) {
14650
- throw new Error("Authentication required to search for users.");
14651
- }
14652
- expanded = expandUserFilter(filter);
14653
- api = expandApi(options.api || "arcgis");
14654
- if (api.type === "arcgis") {
14655
- searchOptions_1 = serializeUserFilterForPortal(expanded);
14656
- props = [
14657
- "authentication",
14658
- "num",
14659
- "sortField",
14660
- "sortOrder",
14661
- "site",
14662
- "start",
14663
- ];
14664
- // copy the props over
14665
- props.forEach(function (prop) {
14666
- if (options.hasOwnProperty(prop)) {
14667
- searchOptions_1[prop] = options[prop];
14668
- }
14669
- });
14670
- return [2 /*return*/, searchPortalUsers(searchOptions_1)];
14671
- }
14672
- else {
14673
- throw new Error("_searchUsers is not implemented for non-arcgis apis");
14674
- }
14675
- });
14676
- });
14677
- }
14678
- /**
14679
- * Internal function that executes the user search along with
14680
- * some simple enrichments
14681
- * @param searchOptions
13548
+ * - If the user has a thumbnail, construct the full url
13549
+ * - If the user is not public, append on the token
13550
+ * @param portalUrl
13551
+ * @param user
13552
+ * @param token
14682
13553
  * @returns
14683
13554
  */
14684
- function searchPortalUsers(searchOptions) {
14685
- var portalUrl = searchOptions.authentication.portal;
14686
- var token = searchOptions.authentication.token;
14687
- // Partially applied functions for mapping over the results
14688
- var userLinkify = function (user) {
14689
- user.profileUrl = searchOptions.site.item.url + "/people/" + user.username + "/profile";
14690
- return user;
14691
- };
14692
- var thumbnailify = function (user) {
14693
- if (user.thumbnail) {
14694
- user.thumbnailUrl = getUserThumbnailUrl(portalUrl, user, token);
14695
- }
14696
- return user;
14697
- };
14698
- return searchUsers(searchOptions).then(function (response) {
14699
- var _a, _b;
14700
- var hasNext = response.nextStart > -1;
14701
- // upgrade thumbnail url
14702
- var results = response.results.map(thumbnailify);
14703
- // generate the site team url if site url is provided
14704
- if ((_b = (_a = searchOptions.site) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.url) {
14705
- results = response.results.map(userLinkify);
13555
+ function getUserThumbnailUrl(portalUrl, user, token) {
13556
+ var thumbnailUrl = null;
13557
+ if (user.thumbnail) {
13558
+ thumbnailUrl = portalUrl + "/community/users/" + user.username + "/info/" + user.thumbnail;
13559
+ if (token && user.access !== "public") {
13560
+ thumbnailUrl = thumbnailUrl + "?token=" + token;
14706
13561
  }
14707
- return {
14708
- hasNext: hasNext,
14709
- total: response.total,
14710
- results: results,
14711
- next: getNextFunction(searchOptions, response.nextStart, response.total, searchPortalUsers),
14712
- };
14713
- });
13562
+ }
13563
+ return thumbnailUrl;
14714
13564
  }
14715
13565
 
14716
13566
  var CATALOG_SCHEMA_VERSION = 1.0;
@@ -14777,37 +13627,6 @@
14777
13627
  return upgradeCatalogSchema(original);
14778
13628
  }
14779
13629
 
14780
- /**
14781
- * Determine if a Filter is "empty"
14782
- * @param filter
14783
- * @returns
14784
- */
14785
- function isEmptyFilter(filter) {
14786
- // if it has one property, filterType, it's empty
14787
- return (Object.keys(filter).length === 1 && filter.hasOwnProperty("filterType"));
14788
- }
14789
- /**
14790
- * Determine if a filterGroup is "empty"
14791
- * @param filterGroup
14792
- * @returns
14793
- */
14794
- function isEmptyFilterGroup(filterGroup) {
14795
- // if filters array is empty
14796
- if (filterGroup.filters.length === 0) {
14797
- return true;
14798
- }
14799
- else {
14800
- // if all filters are empty
14801
- var result = filterGroup.filters.reduce(function (acc, entry) {
14802
- if (acc) {
14803
- acc = isEmptyFilter(entry);
14804
- }
14805
- return acc;
14806
- }, true);
14807
- return result;
14808
- }
14809
- }
14810
-
14811
13630
  /**
14812
13631
  * @private
14813
13632
  * Expand a predicate
@@ -17869,10 +16688,9 @@
17869
16688
  });
17870
16689
  });
17871
16690
  }
17872
- var WellKnownItemFilters = {
16691
+ var WellKnownItemPredicates = {
17873
16692
  $application: [
17874
16693
  {
17875
- filterType: "item",
17876
16694
  type: {
17877
16695
  any: [
17878
16696
  "Web Mapping Application",
@@ -17887,14 +16705,12 @@
17887
16705
  },
17888
16706
  },
17889
16707
  {
17890
- filterType: "item",
17891
16708
  type: "Web Mapping Experience",
17892
16709
  typekeywords: "EXB Experience",
17893
16710
  },
17894
16711
  ],
17895
16712
  $dashboard: [
17896
16713
  {
17897
- filterType: "item",
17898
16714
  type: {
17899
16715
  any: ["Dashboard"],
17900
16716
  not: ["Operation View"],
@@ -17906,7 +16722,6 @@
17906
16722
  ],
17907
16723
  $dataset: [
17908
16724
  {
17909
- filterType: "item",
17910
16725
  type: {
17911
16726
  any: [
17912
16727
  "Scene Service",
@@ -17941,13 +16756,11 @@
17941
16756
  },
17942
16757
  },
17943
16758
  {
17944
- filterType: "item",
17945
16759
  typekeywords: ["OGC", "Geodata Service"],
17946
16760
  },
17947
16761
  ],
17948
16762
  $document: [
17949
16763
  {
17950
- filterType: "item",
17951
16764
  type: [
17952
16765
  "PDF",
17953
16766
  "Microsoft Excel",
@@ -17963,48 +16776,40 @@
17963
16776
  ],
17964
16777
  $initiative: [
17965
16778
  {
17966
- filterType: "item",
17967
16779
  type: "Hub Initiative",
17968
16780
  },
17969
16781
  ],
17970
16782
  $experience: [
17971
16783
  {
17972
- filterType: "item",
17973
16784
  type: "Web Experience",
17974
16785
  },
17975
16786
  ],
17976
16787
  $feedback: [
17977
16788
  {
17978
- filterType: "item",
17979
16789
  type: "Form",
17980
16790
  },
17981
16791
  ],
17982
16792
  $page: [
17983
16793
  {
17984
- filterType: "item",
17985
16794
  typekeywords: "hubPage",
17986
16795
  },
17987
16796
  ],
17988
16797
  $site: [
17989
16798
  {
17990
- filterType: "item",
17991
16799
  type: ["Hub Site Application", "Site Application"],
17992
16800
  },
17993
16801
  ],
17994
16802
  $storymap: [
17995
16803
  {
17996
- filterType: "item",
17997
16804
  type: "Storymap",
17998
16805
  },
17999
16806
  {
18000
- filterType: "item",
18001
16807
  type: "Web Mapping Application",
18002
16808
  typekeywords: "Story Map",
18003
16809
  },
18004
16810
  ],
18005
16811
  $template: [
18006
16812
  {
18007
- filterType: "item",
18008
16813
  type: [
18009
16814
  "Web Mapping Application",
18010
16815
  "Hub Initiative",
@@ -18019,7 +16824,6 @@
18019
16824
  ],
18020
16825
  $webmap: [
18021
16826
  {
18022
- filterType: "item",
18023
16827
  type: {
18024
16828
  any: ["Web Map", "Web Scene"],
18025
16829
  not: "Web Mapping Application",
@@ -18088,7 +16892,7 @@
18088
16892
  function isWellKnownTypeFilter(key) {
18089
16893
  var result = false;
18090
16894
  if (typeof key === "string") {
18091
- result = key in WellKnownItemFilters;
16895
+ result = key in WellKnownItemPredicates;
18092
16896
  }
18093
16897
  return result;
18094
16898
  }
@@ -18098,14 +16902,7 @@
18098
16902
  * @returns
18099
16903
  */
18100
16904
  function lookupTypePredicates(key) {
18101
- var rawPredicates = WellKnownItemFilters[key];
18102
- // Remove the filterType property as it's not needed in an IPredicate
18103
- var predicates = rawPredicates.map(function (entry) {
18104
- var c = cloneObject$1(entry);
18105
- delete c.filterType;
18106
- return c;
18107
- });
18108
- return predicates;
16905
+ return WellKnownItemPredicates[key];
18109
16906
  }
18110
16907
 
18111
16908
  // ## ## ####### ######## ########
@@ -18120,150 +16917,18 @@
18120
16917
  /**
18121
16918
  * @private
18122
16919
  * Execute item search against the Hub API
18123
- * @param filter
16920
+ * @param query
18124
16921
  * @param options
18125
16922
  * @returns
18126
16923
  */
18127
16924
  /* istanbul ignore next */
18128
- function hubSearchItems(filters, options) {
18129
- var _a;
16925
+ function hubSearchItems(query, options) {
18130
16926
  return __awaiter(this, void 0, void 0, function () {
18131
- var api, apiUrl, cleanFilters, searchRequest, aggs, session, opts, raw, json, token_1, us, tokenizeThubmnailUrl, conversion, results, response, ex_1;
18132
- return __generator(this, function (_b) {
18133
- switch (_b.label) {
18134
- case 0:
18135
- api = expandApi(options.api || "hub");
18136
- apiUrl = api.url + "/api/items/beta/search";
18137
- cleanFilters = [];
18138
- filters.forEach(function (block) {
18139
- var b = {
18140
- operation: block.operation,
18141
- filters: block.filters.map(function (f) {
18142
- var c = cloneObject$1(f);
18143
- delete c.filterType;
18144
- return c;
18145
- }),
18146
- };
18147
- cleanFilters.push(b);
18148
- });
18149
- searchRequest = {
18150
- q: cleanFilters,
18151
- options: {
18152
- num: options.num || 10,
18153
- start: options.start || 1,
18154
- sortField: options.sortField,
18155
- sortOrder: options.sortOrder,
18156
- },
18157
- };
18158
- // Add optional props via setProp b/c typescript really does not like
18159
- // adding properties after defining an object
18160
- if ((_a = options.aggFields) === null || _a === void 0 ? void 0 : _a.length) {
18161
- aggs = [
18162
- {
18163
- mode: "terms",
18164
- fields: options.aggFields,
18165
- num: options.aggLimit || 10,
18166
- },
18167
- ];
18168
- setProp("aggregations", aggs, searchRequest.options);
18169
- }
18170
- if (options.authentication) {
18171
- session = {
18172
- token: options.authentication.token,
18173
- portal: options.authentication.portal,
18174
- };
18175
- setProp("session", session, searchRequest.options);
18176
- }
18177
- opts = {
18178
- method: "POST",
18179
- mode: "cors",
18180
- cache: "no-cache",
18181
- headers: {
18182
- "Content-Type": "application/json",
18183
- },
18184
- body: JSON.stringify(searchRequest),
18185
- };
18186
- _b.label = 1;
18187
- case 1:
18188
- _b.trys.push([1, 5, , 6]);
18189
- return [4 /*yield*/, fetch(apiUrl, opts)];
18190
- case 2:
18191
- raw = _b.sent();
18192
- return [4 /*yield*/, raw.json()];
18193
- case 3:
18194
- json = _b.sent();
18195
- if (options.authentication) {
18196
- us = options.authentication;
18197
- token_1 = us.token;
18198
- }
18199
- tokenizeThubmnailUrl = function (entry) {
18200
- if (token_1 && entry.attributes.access !== "public") {
18201
- entry.attributes.thumbnailUrl = entry.attributes.thumbnailUrl + "?token=" + token_1;
18202
- }
18203
- return entry;
18204
- };
18205
- json.data = json.data.map(tokenizeThubmnailUrl);
18206
- conversion = function (entry) {
18207
- return hubContentToSearchResult(jsonApiToHubContent(entry));
18208
- };
18209
- return [4 /*yield*/, Promise.all(json.data.map(conversion))];
18210
- case 4:
18211
- results = _b.sent();
18212
- response = {
18213
- total: json.meta.total,
18214
- results: results,
18215
- hasNext: json.meta.hasNext,
18216
- next: function () {
18217
- // tslint:disable-next-line
18218
- Promise.resolve(null);
18219
- },
18220
- };
18221
- return [2 /*return*/, Promise.resolve(response)];
18222
- case 5:
18223
- ex_1 = _b.sent();
18224
- // TODO: Turn into a formal error
18225
- throw ex_1;
18226
- case 6: return [2 /*return*/];
18227
- }
16927
+ return __generator(this, function (_a) {
16928
+ throw new Error("Not implemented");
18228
16929
  });
18229
16930
  });
18230
16931
  }
18231
- /**
18232
- * Re-structure a jsonApi data entry into a flat object cast into
18233
- * IHubContent
18234
- * @param data
18235
- * @returns
18236
- */
18237
- /* istanbul ignore next */
18238
- function jsonApiToHubContent(data) {
18239
- var content = cloneObject$1(data.attributes);
18240
- content.id = data.id;
18241
- return content;
18242
- }
18243
- /* istanbul ignore next */
18244
- function hubContentToSearchResult(content) {
18245
- var result = {
18246
- access: content.access,
18247
- id: content.id,
18248
- type: content.type,
18249
- name: content.name,
18250
- owner: content.owner,
18251
- summary: content.snippet || content.description,
18252
- createdDate: new Date(content.createdDate),
18253
- createdDateSource: content.createdDateSource,
18254
- updatedDate: new Date(content.updatedDate),
18255
- updatedDateSource: content.updatedDateSource,
18256
- thumbnailUrl: content.thumbnailUrl,
18257
- metadata: [],
18258
- family: content.family,
18259
- urls: {
18260
- portalHome: "not-implemented",
18261
- relative: "not-implemented",
18262
- },
18263
- };
18264
- // TODO: Per-type plucking of props into the `meta` hash for use in the card components
18265
- return Promise.resolve(result);
18266
- }
18267
16932
 
18268
16933
  /**
18269
16934
  * @private
@@ -20764,9 +19429,6 @@
20764
19429
  exports._processInvite = _processInvite;
20765
19430
  exports._processPrimaryEmail = _processPrimaryEmail;
20766
19431
  exports._processSecondaryEmail = _processSecondaryEmail;
20767
- exports._searchContent = _searchContent;
20768
- exports._searchGroups = _searchGroups;
20769
- exports._searchUsers = _searchUsers;
20770
19432
  exports._unprotectAndRemoveGroup = _unprotectAndRemoveGroup;
20771
19433
  exports._unprotectAndRemoveItem = _unprotectAndRemoveItem;
20772
19434
  exports.addContextToSlug = addContextToSlug;
@@ -20802,8 +19464,6 @@
20802
19464
  exports.composeContent = composeContent;
20803
19465
  exports.constructSlug = constructSlug;
20804
19466
  exports.convertCatalog = convertCatalog;
20805
- exports.convertContentDefinitionToFilter = convertContentDefinitionToFilter;
20806
- exports.convertContentFilterToSearchOptions = convertContentFilterToSearchOptions;
20807
19467
  exports.convertItemToProject = convertItemToProject;
20808
19468
  exports.convertItemToSite = convertItemToSite;
20809
19469
  exports.convertSolutionTemplateResourcesToAssets = convertSolutionTemplateResourcesToAssets;
@@ -20843,10 +19503,6 @@
20843
19503
  exports.ensureUniqueString = ensureUniqueString;
20844
19504
  exports.expandApi = expandApi;
20845
19505
  exports.expandApis = expandApis;
20846
- exports.expandContentFilter = expandContentFilter;
20847
- exports.expandGroupFilter = expandGroupFilter;
20848
- exports.expandTypeField = expandTypeField;
20849
- exports.expandUserFilter = expandUserFilter;
20850
19506
  exports.extend = extend;
20851
19507
  exports.extentToBBox = extentToBBox;
20852
19508
  exports.extentToPolygon = extentToPolygon;
@@ -20947,8 +19603,6 @@
20947
19603
  exports.isDomainForLegacySite = isDomainForLegacySite;
20948
19604
  exports.isDomainUsedElsewhere = isDomainUsedElsewhere;
20949
19605
  exports.isDownloadable = isDownloadable;
20950
- exports.isEmptyFilter = isEmptyFilter;
20951
- exports.isEmptyFilterGroup = isEmptyFilterGroup;
20952
19606
  exports.isExtentCoordinateArray = isExtentCoordinateArray;
20953
19607
  exports.isFeatureService = isFeatureService$1;
20954
19608
  exports.isFieldworkerView = isFieldworkerView;
@@ -20967,13 +19621,7 @@
20967
19621
  exports.mapBy = mapBy;
20968
19622
  exports.maybeAdd = maybeAdd;
20969
19623
  exports.maybePush = maybePush;
20970
- exports.mergeContentFilter = mergeContentFilter;
20971
- exports.mergeDateRange = mergeDateRange;
20972
- exports.mergeGroupFilters = mergeGroupFilters;
20973
- exports.mergeMatchOptions = mergeMatchOptions;
20974
19624
  exports.mergeObjects = mergeObjects;
20975
- exports.mergeSearchOptions = mergeSearchOptions$1;
20976
- exports.mergeUserFilters = mergeUserFilters;
20977
19625
  exports.normalizeItemType = normalizeItemType;
20978
19626
  exports.normalizeSolutionTemplateItem = normalizeSolutionTemplateItem;
20979
19627
  exports.objectToArray = objectToArray;
@@ -20995,15 +19643,9 @@
20995
19643
  exports.saveSession = saveSession;
20996
19644
  exports.searchProjects = searchProjects;
20997
19645
  exports.searchSites = searchSites;
20998
- exports.serializeContentFilterForPortal = serializeContentFilterForPortal;
20999
- exports.serializeDateRange = serializeDateRange$1;
21000
- exports.serializeGroupFilterForPortal = serializeGroupFilterForPortal;
21001
- exports.serializeMatchOptions = serializeMatchOptions$1;
21002
19646
  exports.serializeModel = serializeModel;
21003
19647
  exports.serializeQueryForPortal = serializeQueryForPortal;
21004
19648
  exports.serializeSpatialReference = serializeSpatialReference;
21005
- exports.serializeStringOrArray = serializeStringOrArray$1;
21006
- exports.serializeUserFilterForPortal = serializeUserFilterForPortal;
21007
19649
  exports.setContentHubId = setContentHubId;
21008
19650
  exports.setContentSiteUrls = setContentSiteUrls;
21009
19651
  exports.setContentType = setContentType;