@webda/core 2.3.1 → 2.4.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 (65) hide show
  1. package/lib/application.d.ts +12 -0
  2. package/lib/application.js.map +1 -1
  3. package/lib/core.d.ts +26 -3
  4. package/lib/core.js +53 -2
  5. package/lib/core.js.map +1 -1
  6. package/lib/core.spec.js +1 -1
  7. package/lib/core.spec.js.map +1 -1
  8. package/lib/queues/memoryqueue.spec.js +4 -0
  9. package/lib/queues/memoryqueue.spec.js.map +1 -1
  10. package/lib/queues/queueservice.d.ts +8 -0
  11. package/lib/queues/queueservice.js +28 -0
  12. package/lib/queues/queueservice.js.map +1 -1
  13. package/lib/services/authentication.d.ts +14 -2
  14. package/lib/services/authentication.js +105 -70
  15. package/lib/services/authentication.js.map +1 -1
  16. package/lib/services/binary.d.ts +11 -1
  17. package/lib/services/binary.js +28 -1
  18. package/lib/services/binary.js.map +1 -1
  19. package/lib/services/fileconfiguration.js +9 -3
  20. package/lib/services/fileconfiguration.js.map +1 -1
  21. package/lib/services/fileconfiguration.spec.js +43 -0
  22. package/lib/services/fileconfiguration.spec.js.map +1 -1
  23. package/lib/services/mailer.d.ts +9 -1
  24. package/lib/services/mailer.js +30 -7
  25. package/lib/services/mailer.js.map +1 -1
  26. package/lib/services/mailer.spec.js +5 -0
  27. package/lib/services/mailer.spec.js.map +1 -1
  28. package/lib/services/oauth.d.ts +8 -1
  29. package/lib/services/oauth.js +11 -0
  30. package/lib/services/oauth.js.map +1 -1
  31. package/lib/services/prometheus.d.ts +97 -0
  32. package/lib/services/prometheus.js +151 -0
  33. package/lib/services/prometheus.js.map +1 -0
  34. package/lib/services/prometheus.spec.d.ts +1 -0
  35. package/lib/services/prometheus.spec.js +57 -0
  36. package/lib/services/prometheus.spec.js.map +1 -0
  37. package/lib/services/proxy.d.ts +11 -0
  38. package/lib/services/proxy.js +47 -2
  39. package/lib/services/proxy.js.map +1 -1
  40. package/lib/services/resource.js +2 -1
  41. package/lib/services/resource.js.map +1 -1
  42. package/lib/services/resource.spec.js +5 -5
  43. package/lib/services/service.d.ts +16 -1
  44. package/lib/services/service.js +18 -0
  45. package/lib/services/service.js.map +1 -1
  46. package/lib/stores/file.js +1 -0
  47. package/lib/stores/file.js.map +1 -1
  48. package/lib/stores/store.d.ts +8 -13
  49. package/lib/stores/store.js +34 -35
  50. package/lib/stores/store.js.map +1 -1
  51. package/lib/test.js +8 -0
  52. package/lib/test.js.map +1 -1
  53. package/lib/utils/context.d.ts +6 -1
  54. package/lib/utils/context.js +10 -3
  55. package/lib/utils/context.js.map +1 -1
  56. package/lib/utils/serializers.js +1 -1
  57. package/lib/utils/serializers.js.map +1 -1
  58. package/lib/utils/serializers.spec.js +1 -1
  59. package/lib/utils/serializers.spec.js.map +1 -1
  60. package/package.json +4 -3
  61. package/test/config-file-missing-file-no-default.json +44 -0
  62. package/test/config-file-missing-file.json +57 -0
  63. package/test/config-invitation.json +3 -1
  64. package/test/config.json +3 -0
  65. package/webda.module.json +202 -0
package/webda.module.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "moddas": {
3
3
  "webda/aggregator": "lib/stores/aggregator:default",
4
+ "webda/aliasstore": "lib/stores/aliasstore:AliasStore",
4
5
  "webda/asyncevents": "lib/services/asyncevents:EventService",
5
6
  "webda/authentication": "lib/services/authentication:Authentication",
6
7
  "webda/configurationservice": "lib/services/configuration:default",
@@ -23,6 +24,7 @@
23
24
  "webda/memoryqueue": "lib/queues/memoryqueue:MemoryQueue",
24
25
  "webda/memorystore": "lib/stores/memory:MemoryStore",
25
26
  "webda/multinotificationservice": "lib/services/notificationservice:default",
27
+ "webda/prometheusservice": "lib/services/prometheus:PrometheusService",
26
28
  "webda/proxyservice": "lib/services/proxy:ProxyService",
27
29
  "webda/resourceservice": "lib/services/resource:default",
28
30
  "webda/versionservice": "lib/services/version:VersionService"
@@ -1473,6 +1475,148 @@
1473
1475
  "$schema": "http://json-schema.org/draft-07/schema#",
1474
1476
  "title": "VersionService"
1475
1477
  },
1478
+ "webda/aliasstore": {
1479
+ "type": "object",
1480
+ "properties": {
1481
+ "type": {
1482
+ "type": "string",
1483
+ "description": "Type of the service"
1484
+ },
1485
+ "url": {
1486
+ "type": "string",
1487
+ "description": "URL on which to serve the content"
1488
+ },
1489
+ "model": {
1490
+ "type": "string",
1491
+ "description": "Webda model to use within the Store",
1492
+ "default": "Webda/CoreModel"
1493
+ },
1494
+ "models": {
1495
+ "type": "array",
1496
+ "items": {
1497
+ "type": "string"
1498
+ },
1499
+ "description": "Different models managed by this store"
1500
+ },
1501
+ "asyncDelete": {
1502
+ "type": "boolean",
1503
+ "description": "async delete"
1504
+ },
1505
+ "expose": {
1506
+ "$ref": "#/definitions/ExposeParameters",
1507
+ "description": "Expose the service to an urls"
1508
+ },
1509
+ "strict": {
1510
+ "type": "boolean",
1511
+ "description": "Allow to load object that does not have the type data\n\nIf set to true, then the Store will only managed the defined _model and no model extending this one",
1512
+ "default": false
1513
+ },
1514
+ "defaultModel": {
1515
+ "type": "boolean",
1516
+ "description": "When __type model not found, use the model If strict is setup this parameter is not used",
1517
+ "default": true
1518
+ },
1519
+ "forceModel": {
1520
+ "type": "boolean",
1521
+ "description": "If set, Store will ignore the __type",
1522
+ "default": false
1523
+ },
1524
+ "slowQueryThreshold": {
1525
+ "type": "number",
1526
+ "description": "Slow query threshold",
1527
+ "default": 30000
1528
+ },
1529
+ "parent": {
1530
+ "type": "object",
1531
+ "properties": {
1532
+ "name": {
1533
+ "type": "string"
1534
+ },
1535
+ "condition": {
1536
+ "type": "string"
1537
+ }
1538
+ },
1539
+ "required": [
1540
+ "name",
1541
+ "condition"
1542
+ ],
1543
+ "description": "Parent of the store\n\nIf parent is specified the url route is relative to it"
1544
+ },
1545
+ "graphql": {
1546
+ "type": "boolean",
1547
+ "description": "For future use in our GraphQL api\n\nExpose this store in the graphql"
1548
+ },
1549
+ "targetStore": {
1550
+ "type": "string",
1551
+ "description": "Store to alias"
1552
+ },
1553
+ "idTemplate": {
1554
+ "type": "string",
1555
+ "description": "Store to alias"
1556
+ },
1557
+ "openapi": {
1558
+ "type": "object",
1559
+ "additionalProperties": true
1560
+ }
1561
+ },
1562
+ "required": [
1563
+ "asyncDelete",
1564
+ "idTemplate",
1565
+ "slowQueryThreshold",
1566
+ "targetStore",
1567
+ "type"
1568
+ ],
1569
+ "$schema": "http://json-schema.org/draft-07/schema#",
1570
+ "definitions": {
1571
+ "ExposeParameters": {
1572
+ "type": "object",
1573
+ "properties": {
1574
+ "url": {
1575
+ "type": "string",
1576
+ "description": "URL endpoint to use to expose REST Resources API",
1577
+ "default": "service.getName().toLowerCase()"
1578
+ },
1579
+ "restrict": {
1580
+ "type": "object",
1581
+ "properties": {
1582
+ "create": {
1583
+ "type": "boolean",
1584
+ "description": "Do not expose the POST"
1585
+ },
1586
+ "update": {
1587
+ "type": "boolean",
1588
+ "description": "Do not expose the PUT and PATCH"
1589
+ },
1590
+ "get": {
1591
+ "type": "boolean",
1592
+ "description": "Do not expose the GET"
1593
+ },
1594
+ "delete": {
1595
+ "type": "boolean",
1596
+ "description": "Do not expose the DELETE"
1597
+ },
1598
+ "query": {
1599
+ "type": "boolean",
1600
+ "description": "Do not expose the query endpoint"
1601
+ }
1602
+ },
1603
+ "description": "You can restrict any part of the CRUD",
1604
+ "default": {}
1605
+ },
1606
+ "queryMethod": {
1607
+ "type": "string",
1608
+ "enum": [
1609
+ "PUT",
1610
+ "GET"
1611
+ ],
1612
+ "description": "For confidentiality sometimes you might prefer to expose query through PUT To avoid GET logging",
1613
+ "default": "GET"
1614
+ }
1615
+ }
1616
+ }
1617
+ },
1618
+ "title": "AliasStore"
1619
+ },
1476
1620
  "webda/mapper": {
1477
1621
  "type": "object",
1478
1622
  "properties": {
@@ -2044,6 +2188,64 @@
2044
2188
  }
2045
2189
  },
2046
2190
  "title": "FileLogger"
2191
+ },
2192
+ "webda/prometheusservice": {
2193
+ "type": "object",
2194
+ "properties": {
2195
+ "type": {
2196
+ "type": "string",
2197
+ "description": "Type of the service"
2198
+ },
2199
+ "url": {
2200
+ "type": "string",
2201
+ "description": "URL on which to serve the content",
2202
+ "default": "/metrics"
2203
+ },
2204
+ "portNumber": {
2205
+ "type": "number",
2206
+ "description": "If defined will launch another http server to serve the scaper"
2207
+ },
2208
+ "bind": {
2209
+ "type": "string",
2210
+ "description": "If defined along with portNumber used to bind specific address for dedicated http server"
2211
+ },
2212
+ "includeNodeMetrics": {
2213
+ "type": "boolean",
2214
+ "description": "Include NodeJS engine metrics",
2215
+ "default": true
2216
+ },
2217
+ "includeRequestMetrics": {
2218
+ "type": "boolean",
2219
+ "description": "Include request served by Webda\n\nIt should generate common http_* metrics",
2220
+ "default": true
2221
+ },
2222
+ "partitionHistogram": {
2223
+ "type": "boolean",
2224
+ "description": "Do not partition histogram with requests labels"
2225
+ },
2226
+ "labels": {
2227
+ "type": "object",
2228
+ "additionalProperties": {
2229
+ "type": "string"
2230
+ },
2231
+ "description": "Labels to add"
2232
+ },
2233
+ "prefix": {
2234
+ "type": "string",
2235
+ "description": "Prefix to add to metrics"
2236
+ },
2237
+ "openapi": {
2238
+ "type": "object",
2239
+ "additionalProperties": true
2240
+ }
2241
+ },
2242
+ "required": [
2243
+ "includeNodeMetrics",
2244
+ "includeRequestMetrics",
2245
+ "type"
2246
+ ],
2247
+ "$schema": "http://json-schema.org/draft-07/schema#",
2248
+ "title": "PrometheusService"
2047
2249
  }
2048
2250
  }
2049
2251
  }