@riverscapes/common 2.0.21 → 2.0.23

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 (55) hide show
  1. package/README.md +5 -0
  2. package/dist/classes/ProjectXML.js +0 -5
  3. package/dist/classes/ProjectXML.js.map +1 -1
  4. package/dist/constants.js +2 -2
  5. package/dist/constants.js.map +1 -1
  6. package/dist/gen/gqlSchema.js +1 -1
  7. package/dist/gen/gqlSchema.js.map +1 -1
  8. package/dist/gen/schema.types.d.ts +34 -16
  9. package/dist/gen/schema.types.js +36 -35
  10. package/dist/gen/schema.types.js.map +1 -1
  11. package/dist/schema.graphql +29 -21
  12. package/dist_esnext/classes/BusinessLogicXML.d.ts +20 -0
  13. package/dist_esnext/classes/BusinessLogicXML.js +119 -0
  14. package/dist_esnext/classes/BusinessLogicXML.js.map +1 -0
  15. package/dist_esnext/classes/ProjectXML.d.ts +30 -0
  16. package/dist_esnext/classes/ProjectXML.js +375 -0
  17. package/dist_esnext/classes/ProjectXML.js.map +1 -0
  18. package/dist_esnext/classes/index.d.ts +2 -0
  19. package/dist_esnext/classes/index.js +3 -0
  20. package/dist_esnext/classes/index.js.map +1 -0
  21. package/dist_esnext/classes/mock/BusinessLogic1_parsed.d.ts +173 -0
  22. package/dist_esnext/classes/mock/BusinessLogic1_parsed.js +252 -0
  23. package/dist_esnext/classes/mock/BusinessLogic1_parsed.js.map +1 -0
  24. package/dist_esnext/constants.d.ts +56 -0
  25. package/dist_esnext/constants.js +76 -0
  26. package/dist_esnext/constants.js.map +1 -0
  27. package/dist_esnext/gen/gqlSchema.d.ts +2 -0
  28. package/dist_esnext/gen/gqlSchema.js +8 -0
  29. package/dist_esnext/gen/gqlSchema.js.map +1 -0
  30. package/dist_esnext/gen/schema.types.d.ts +2795 -0
  31. package/dist_esnext/gen/schema.types.js +274 -0
  32. package/dist_esnext/gen/schema.types.js.map +1 -0
  33. package/dist_esnext/index.d.ts +10 -0
  34. package/dist_esnext/index.js +11 -0
  35. package/dist_esnext/index.js.map +1 -0
  36. package/dist_esnext/lib/dates.d.ts +2 -0
  37. package/dist_esnext/lib/dates.js +31 -0
  38. package/dist_esnext/lib/dates.js.map +1 -0
  39. package/dist_esnext/lib/rsPaths.d.ts +8 -0
  40. package/dist_esnext/lib/rsPaths.js +143 -0
  41. package/dist_esnext/lib/rsPaths.js.map +1 -0
  42. package/dist_esnext/lib/tiles.d.ts +4 -0
  43. package/dist_esnext/lib/tiles.js +35 -0
  44. package/dist_esnext/lib/tiles.js.map +1 -0
  45. package/dist_esnext/lib/util.d.ts +6 -0
  46. package/dist_esnext/lib/util.js +43 -0
  47. package/dist_esnext/lib/util.js.map +1 -0
  48. package/dist_esnext/lib/xml.d.ts +6 -0
  49. package/dist_esnext/lib/xml.js +89 -0
  50. package/dist_esnext/lib/xml.js.map +1 -0
  51. package/dist_esnext/types.d.ts +71 -0
  52. package/dist_esnext/types.js +6 -0
  53. package/dist_esnext/types.js.map +1 -0
  54. package/package.json +16 -15
  55. package/tsconfig.esnext.json +9 -0
@@ -478,7 +478,7 @@ type MapCluster {
478
478
  coords: [Float!]!
479
479
  count: Int!
480
480
 
481
- """check out npm's 'ngeogrid' for how to turn this back into coordinates """
481
+ """check out npm's 'ngeogrid' for how to turn this back into coordinates"""
482
482
  hash: String!
483
483
  }
484
484
 
@@ -487,7 +487,7 @@ type MetaData {
487
487
  key: String!
488
488
  locked: Boolean
489
489
  type: MetaDataTypeEnum
490
- value: String!
490
+ value: String
491
491
  }
492
492
 
493
493
  enum MetaDataExtEnum {
@@ -515,8 +515,11 @@ input MetaDataInput {
515
515
  """Optional meta type value. Defaults to String"""
516
516
  type: MetaDataTypeEnum
517
517
 
518
- """Strignified metadata value"""
519
- value: String!
518
+ """
519
+ Strignified metadata value
520
+ NOTE: In the XML spec null is allowed so technically it is allowed here too.
521
+ """
522
+ value: String
520
523
  }
521
524
 
522
525
  """
@@ -994,9 +997,9 @@ type Profile implements DBObj & UserInterface {
994
997
  """If the user has never logged in here this is uninitialized"""
995
998
  initialized: Boolean
996
999
  isAdmin: Boolean!
997
- jobTitle: String!
1000
+ jobTitle: String
998
1001
  lastLogin: DateTime!
999
- location: String!
1002
+ location: String
1000
1003
  meta: [MetaData!]!
1001
1004
  name: String!
1002
1005
  notifications(limit: Int!, offset: Int!, op: NotificationOperationEnum): PaginatedNotifications!
@@ -1212,7 +1215,7 @@ input ProjectInput {
1212
1215
 
1213
1216
  type ProjectSearchMeta {
1214
1217
  """
1215
- The area covered by all projects returned
1218
+ The area covered by all projects returned
1216
1219
  (all overlaps are included)
1217
1220
  """
1218
1221
  area: Float
@@ -1232,6 +1235,11 @@ type ProjectSearchMeta {
1232
1235
  maxScore: Float
1233
1236
  metaDataBuckets: JSONObject!
1234
1237
 
1238
+ """
1239
+ OpenSearch query/results for development. Only present when debug=true on the query and the user is an admin.
1240
+ """
1241
+ openSearch: JSONObject
1242
+
1235
1243
  """
1236
1244
  ProjectTypes: Key-balue pairs of project types and counts
1237
1245
  (Applies to projects only)
@@ -1260,7 +1268,7 @@ type ProjectSearchParams {
1260
1268
  """
1261
1269
  createdOn: SearchDate
1262
1270
 
1263
- """Only projects that I can edit as a user """
1271
+ """Only projects that I can edit as a user"""
1264
1272
  editableOnly: Boolean
1265
1273
  keywords: String
1266
1274
  meta: [MetaData!]
@@ -1302,7 +1310,7 @@ input ProjectSearchParamsInput {
1302
1310
  """
1303
1311
  createdOn: SearchDateInput
1304
1312
 
1305
- """Only projects that I can edit as a user """
1313
+ """Only projects that I can edit as a user"""
1306
1314
  editableOnly: Boolean
1307
1315
  keywords: String
1308
1316
  meta: [MetaDataInput!]
@@ -1608,7 +1616,7 @@ type Query {
1608
1616
  """
1609
1617
  requestUploadProjectFilesUrl(files: [String!]!, token: String!): [UploadProjectFileUrls]
1610
1618
  savedSearch(id: ID!): SavedSearch
1611
- searchCollections(limit: Int!, minScore: Float, offset: Int!, params: SearchParamsInput!, sort: [SearchSortEnum!]): SearchCollectionPagination!
1619
+ searchCollections(debug: Boolean, limit: Int!, minScore: Float, offset: Int!, params: SearchParamsInput!, sort: [SearchSortEnum!]): SearchCollectionPagination!
1612
1620
 
1613
1621
  """
1614
1622
  This is a complementary search to "searchProjects". It can be run with essentially the same
@@ -1617,24 +1625,24 @@ type Query {
1617
1625
  Note: params.bbox MUST be included for the searchProjectsMap
1618
1626
  clusters: the number of clusters we should aim for
1619
1627
  """
1620
- searchMapBounds(limit: Int!, minScore: Float, params: ProjectSearchParamsInput!): SearchMapBoundsResult!
1628
+ searchMapBounds(debug: Boolean, limit: Int!, minScore: Float, params: ProjectSearchParamsInput!): SearchMapBoundsResult!
1621
1629
 
1622
1630
  """
1623
1631
  Discussion here https://github.com/Riverscapes/rs-web-monorepo/discussions/251
1624
1632
  limit: the maximum number of clusters to get back. After this number the list is truncated and any remaining projects are simply represented by the "remaining" property
1625
1633
  precision: The size of the grid to place the clusters on. We use npm's ngeohash for gridding
1626
1634
  """
1627
- searchMapClusters(limit: Int!, minScore: Float, params: ProjectSearchParamsInput!, precision: Int!): SearchMapClusterResult!
1628
- searchOrganizations(limit: Int!, minScore: Float, offset: Int!, params: SearchParamsInput!, sort: [SearchSortEnum!]): SearchOrganizationPagination!
1629
- searchProjects(limit: Int!, minScore: Float, offset: Int!, params: ProjectSearchParamsInput!, sort: [SearchSortEnum!]): SearchProjectPagination!
1630
- searchSavedSearches(limit: Int!, minScore: Float, offset: Int!, params: SearchParamsInput!, sort: [SearchSortEnum!]): SearchSavedSearchPagination!
1635
+ searchMapClusters(debug: Boolean, limit: Int!, minScore: Float, params: ProjectSearchParamsInput!, precision: Int!): SearchMapClusterResult!
1636
+ searchOrganizations(debug: Boolean, limit: Int!, minScore: Float, offset: Int!, params: SearchParamsInput!, sort: [SearchSortEnum!]): SearchOrganizationPagination!
1637
+ searchProjects(debug: Boolean, limit: Int!, minScore: Float, offset: Int!, params: ProjectSearchParamsInput!, sort: [SearchSortEnum!]): SearchProjectPagination!
1638
+ searchSavedSearches(debug: Boolean, limit: Int!, minScore: Float, offset: Int!, params: SearchParamsInput!, sort: [SearchSortEnum!]): SearchSavedSearchPagination!
1631
1639
 
1632
1640
  """
1633
1641
  As-you-type suggestions:
1634
1642
  TODO: this needs to be typed but for now it's just pure JSON
1635
1643
  """
1636
1644
  searchSuggest(minScore: Float, text: String!, type: StarrableTypesEnum): SearchSuggestionResults
1637
- searchUsers(limit: Int!, minScore: Float, offset: Int!, params: SearchParamsInput!, sort: [SearchSortEnum!]): SearchUserPagination!
1645
+ searchUsers(debug: Boolean, limit: Int!, minScore: Float, offset: Int!, params: SearchParamsInput!, sort: [SearchSortEnum!]): SearchUserPagination!
1638
1646
 
1639
1647
  """A User is any user in the system"""
1640
1648
  user(id: ID!): User
@@ -1873,7 +1881,7 @@ input SearchParamsInput {
1873
1881
  """
1874
1882
  createdOn: SearchDateInput
1875
1883
 
1876
- """Only items that I can edit as a user """
1884
+ """Only items that I can edit as a user"""
1877
1885
  editableOnly: Boolean
1878
1886
  keywords: String
1879
1887
  meta: [MetaDataInput!]
@@ -2241,9 +2249,9 @@ type User implements DBObj & UserInterface {
2241
2249
  createdOn: DateTime!
2242
2250
  description: String!
2243
2251
  id: ID!
2244
- jobTitle: String!
2252
+ jobTitle: String
2245
2253
  lastLogin: DateTime!
2246
- location: String!
2254
+ location: String
2247
2255
  meta: [MetaData!]!
2248
2256
  name: String!
2249
2257
 
@@ -2312,7 +2320,7 @@ interface UserInterface {
2312
2320
  id: ID!
2313
2321
 
2314
2322
  """Simple job title string field"""
2315
- jobTitle: String!
2323
+ jobTitle: String
2316
2324
 
2317
2325
  """When did we last see the user?"""
2318
2326
  lastLogin: DateTime!
@@ -2320,7 +2328,7 @@ interface UserInterface {
2320
2328
  """
2321
2329
  Simple location string (Optional) eg: "Vancouver, Canada"
2322
2330
  """
2323
- location: String!
2331
+ location: String
2324
2332
  meta: [MetaData!]!
2325
2333
  name: String!
2326
2334
 
@@ -0,0 +1,20 @@
1
+ import { ProjectTreeView } from '../gen/schema.types';
2
+ import { BusinessLogicInterface, BusinessLogicNode } from '../types';
3
+ export declare class BusinessLogic implements BusinessLogicInterface {
4
+ private dom;
5
+ name: string;
6
+ description?: string;
7
+ projectType: string;
8
+ node: BusinessLogicNode;
9
+ defaultView?: string;
10
+ views?: ProjectTreeView[];
11
+ leaves?: any;
12
+ branches?: any;
13
+ private projectNode;
14
+ constructor(projectType: string, xmlRaw: string);
15
+ private parse;
16
+ parseNode: (inNode: Element, isRepeater?: boolean) => BusinessLogicNode;
17
+ getDefaultView: () => string;
18
+ getSymbologies: () => [string, string][];
19
+ parseViews: () => ProjectTreeView[];
20
+ }
@@ -0,0 +1,119 @@
1
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
2
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3
+ if (ar || !(i in from)) {
4
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
5
+ ar[i] = from[i];
6
+ }
7
+ }
8
+ return to.concat(ar || Array.prototype.slice.call(from));
9
+ };
10
+ import xPathLib from 'xpath';
11
+ import { DOMParser } from '@xmldom/xmldom';
12
+ import { ProjectTreeLayerTypeEnum } from '../gen/schema.types';
13
+ import { getChildNodeText, getNodeAttrDict } from '../lib/xml';
14
+ var BusinessLogic = (function () {
15
+ function BusinessLogic(projectType, xmlRaw) {
16
+ var _this = this;
17
+ this.parse = function () {
18
+ _this.projectNode = xPathLib.select1('Project', _this.dom);
19
+ _this.name = getChildNodeText('Name', _this.projectNode);
20
+ _this.description = getChildNodeText('Description', _this.projectNode);
21
+ _this.projectType = getChildNodeText('ProjectType', _this.projectNode);
22
+ _this.node = _this.parseNode(xPathLib.select1('Node', _this.projectNode));
23
+ _this.views = _this.parseViews();
24
+ _this.defaultView = _this.getDefaultView();
25
+ };
26
+ this.parseNode = function (inNode, isRepeater) {
27
+ if (isRepeater === void 0) { isRepeater = false; }
28
+ var _a = getNodeAttrDict(inNode), id = _a.id, label = _a.label, xpath = _a.xpath, xpathlabel = _a.xpathlabel, symbology = _a.symbology, datatype = _a.type, transparency = _a.transparency;
29
+ var blnode = {
30
+ id: id,
31
+ label: label,
32
+ xpath: xpath,
33
+ xpathlabel: xpathlabel,
34
+ symbology: symbology,
35
+ isRepeater: isRepeater,
36
+ };
37
+ if (datatype) {
38
+ blnode.datatype = Object.values(ProjectTreeLayerTypeEnum).find(function (val) { return val === datatype.toUpperCase(); });
39
+ }
40
+ if (transparency)
41
+ blnode.transparency = parseInt(transparency, 10);
42
+ var children = xPathLib.select1('Children', inNode);
43
+ var tileService = getChildNodeText('Tileservice', inNode);
44
+ if (tileService && tileService.length > 0)
45
+ blnode.tileservice = tileService;
46
+ if (children) {
47
+ var childrenAttr = getNodeAttrDict(children);
48
+ var nodes = xPathLib.select('Node', children);
49
+ blnode.collapsed = Boolean(childrenAttr && childrenAttr.collapsed && childrenAttr.collapsed.toLowerCase() === 'true');
50
+ var repeaters = xPathLib.select('Repeater', children);
51
+ blnode.children = __spreadArray(__spreadArray([], nodes.map(function (n) { return _this.parseNode(n, false); }), true), repeaters.map(function (n) { return _this.parseNode(n, true); }), true);
52
+ }
53
+ else if (isRepeater) {
54
+ blnode.children = [_this.parseNode(xPathLib.select1('Node', inNode))];
55
+ }
56
+ for (var i in blnode) {
57
+ if (typeof blnode[i] === 'undefined') {
58
+ delete blnode[i];
59
+ }
60
+ }
61
+ return blnode;
62
+ };
63
+ this.getDefaultView = function () {
64
+ var viewsNode = xPathLib.select1('Views', _this.projectNode);
65
+ if (!viewsNode)
66
+ return;
67
+ var defaultViewId = viewsNode.getAttribute('default');
68
+ if (!defaultViewId) {
69
+ var firstNode = xPathLib.select1('View', viewsNode);
70
+ defaultViewId = firstNode && firstNode.getAttribute('id');
71
+ }
72
+ return defaultViewId;
73
+ };
74
+ this.getSymbologies = function () {
75
+ var nodeElements = _this.dom.getElementsByTagName('Node').filter(function (node) { return node.getAttribute('symbology'); });
76
+ var flatList = [];
77
+ for (var i = 0; i < nodeElements.length; i++) {
78
+ var node = nodeElements[i];
79
+ if (node.getAttribute('symbology') === 'none' || node.getAttribute('symbology').trim().length === 0)
80
+ continue;
81
+ var parentXPaths = [];
82
+ var parent_1 = node.parentNode;
83
+ while (parent_1 && parent_1.tagName !== 'Document') {
84
+ if (parent_1.getAttribute && parent_1.getAttribute('xpath'))
85
+ parentXPaths.unshift(parent_1.getAttribute('xpath'));
86
+ parent_1 = parent_1.parentNode;
87
+ }
88
+ if (node.getAttribute('xpath'))
89
+ parentXPaths.push(node.getAttribute('xpath'));
90
+ var symbology = node.getAttribute('symbology');
91
+ flatList.push([parentXPaths.join('/'), symbology]);
92
+ }
93
+ return flatList;
94
+ };
95
+ this.parseViews = function () {
96
+ var viewNodes = xPathLib.select('Views/View', _this.projectNode);
97
+ return viewNodes.map(function (vNode) {
98
+ return {
99
+ id: vNode.getAttribute('id'),
100
+ name: vNode.getAttribute('name'),
101
+ description: getChildNodeText('Description', vNode),
102
+ layers: xPathLib.select('Layers/Layer', vNode).map(function (lyrNode) {
103
+ var attrs = getNodeAttrDict(lyrNode);
104
+ return {
105
+ id: attrs.id,
106
+ visible: !(attrs.visible && attrs.visible.toLowerCase() === 'false'),
107
+ };
108
+ }),
109
+ };
110
+ });
111
+ };
112
+ this.projectType = projectType;
113
+ this.dom = new DOMParser().parseFromString(xmlRaw, 'text/xml');
114
+ this.parse();
115
+ }
116
+ return BusinessLogic;
117
+ }());
118
+ export { BusinessLogic };
119
+ //# sourceMappingURL=BusinessLogicXML.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BusinessLogicXML.js","sourceRoot":"","sources":["../../src/classes/BusinessLogicXML.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,QAAQ,MAAM,OAAO,CAAA;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,wBAAwB,EAAmB,MAAM,qBAAqB,CAAA;AAE/E,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,M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KAAK,CAAC,EAAE;4BACZ,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC;yBACrE,CAAA;oBACH,CAAC,CAAC;iBACH,CAAA;YACH,CAAC,CAAC,CAAA;QACJ,CAAC,CAAA;QAhIC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;QAC9B,IAAI,CAAC,GAAG,GAAG,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;QAC9D,IAAI,CAAC,KAAK,EAAE,CAAA;IACd,CAAC;IA8HH,oBAAC;AAAD,CAAC,AAnJD,IAmJC"}
@@ -0,0 +1,30 @@
1
+ import { DatasetInput, MetaData, MetaDataInput, ProjectInput, QaqcEventInput } from '../gen/schema.types';
2
+ import { WarehouseEl } from '../types';
3
+ export declare class ProjectXML {
4
+ dom: any;
5
+ projNode: Node;
6
+ constructor(xmlStr: string);
7
+ _toString: () => string;
8
+ setNodeContent: (node: Element, content: string) => void;
9
+ setTextNode: (parent: Element, TagName: string, content?: string) => void;
10
+ addWarehouseEl: (newTag: WarehouseEl) => void;
11
+ removeWarehouseEl: () => void;
12
+ setProjectName: (newName: string) => void;
13
+ setProjectDescription: (newDescription?: string) => void;
14
+ setProjectSummary: (newSummary?: string) => void;
15
+ setProjectCitation: (newCitation?: string) => void;
16
+ setProjectMeta: (newMeta: MetaData[]) => void;
17
+ getWarehouseEl: () => WarehouseEl | null;
18
+ getProjectType: () => string | null;
19
+ getBoundsPath: () => string | null;
20
+ getProjectMeta: () => MetaDataInput[];
21
+ getProjectInput: () => ProjectInput;
22
+ getQAQCEvents: () => QaqcEventInput[];
23
+ getDatasetInputs: () => DatasetInput[];
24
+ }
25
+ interface mapFilesToDatasetReturn {
26
+ filesMap: Record<string, string> | null;
27
+ errors: string[];
28
+ }
29
+ export declare const mapFilesToDataset: (fileList: string[], datasets: DatasetInput[]) => mapFilesToDatasetReturn;
30
+ export {};