@forestadmin/agent 1.0.0-beta.4 → 1.0.0-beta.40
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.
- package/CHANGELOG.md +398 -0
- package/dist/agent/forestadmin-http-driver.d.ts +5 -27
- package/dist/agent/forestadmin-http-driver.js +17 -47
- package/dist/agent/routes/access/api-chart.d.ts +16 -0
- package/dist/agent/routes/access/api-chart.js +45 -0
- package/dist/agent/routes/access/chart.js +47 -23
- package/dist/agent/routes/access/count-related.js +13 -6
- package/dist/agent/routes/access/count.js +14 -7
- package/dist/agent/routes/access/csv-related.js +3 -3
- package/dist/agent/routes/access/csv.js +4 -3
- package/dist/agent/routes/access/get.js +3 -2
- package/dist/agent/routes/access/list-related.js +2 -3
- package/dist/agent/routes/access/list.js +2 -3
- package/dist/agent/routes/base-route.d.ts +0 -1
- package/dist/agent/routes/base-route.js +1 -4
- package/dist/agent/routes/index.js +8 -1
- package/dist/agent/routes/modification/action.d.ts +0 -1
- package/dist/agent/routes/modification/action.js +11 -11
- package/dist/agent/routes/modification/associate-related.d.ts +3 -3
- package/dist/agent/routes/modification/associate-related.js +13 -11
- package/dist/agent/routes/modification/create.js +14 -12
- package/dist/agent/routes/modification/delete.js +3 -2
- package/dist/agent/routes/modification/dissociate-delete-related.js +19 -18
- package/dist/agent/routes/modification/update-relation.js +19 -13
- package/dist/agent/routes/modification/update.js +5 -3
- package/dist/agent/routes/system/error-handling.js +18 -4
- package/dist/agent/routes/system/logger.js +4 -5
- package/dist/agent/types.d.ts +2 -1
- package/dist/agent/types.js +2 -1
- package/dist/agent/utils/condition-tree-parser.d.ts +11 -0
- package/dist/agent/utils/condition-tree-parser.js +53 -0
- package/dist/agent/utils/context-filter-factory.js +1 -2
- package/dist/agent/utils/csv-generator.d.ts +2 -2
- package/dist/agent/utils/csv-generator.js +3 -3
- package/dist/agent/utils/forest-http-api.d.ts +1 -0
- package/dist/agent/utils/forest-http-api.js +58 -50
- package/dist/agent/utils/forest-schema/generator-actions.js +2 -2
- package/dist/agent/utils/forest-schema/generator-collection.js +8 -3
- package/dist/agent/utils/forest-schema/generator-fields.d.ts +1 -0
- package/dist/agent/utils/forest-schema/generator-fields.js +56 -27
- package/dist/agent/utils/forest-schema/types.d.ts +9 -3
- package/dist/agent/utils/forest-schema/types.js +1 -1
- package/dist/agent/utils/query-string.d.ts +2 -2
- package/dist/agent/utils/query-string.js +8 -4
- package/dist/builder/agent.d.ts +58 -39
- package/dist/builder/agent.js +195 -52
- package/dist/builder/collection.d.ts +151 -53
- package/dist/builder/collection.js +205 -59
- package/dist/builder/decorators-stack.d.ts +24 -0
- package/dist/builder/decorators-stack.js +39 -0
- package/dist/builder/types.d.ts +10 -2
- package/dist/builder/utils/options-validator.d.ts +13 -0
- package/dist/builder/utils/options-validator.js +103 -0
- package/dist/builder/utils/typing-generator.d.ts +10 -0
- package/dist/builder/utils/typing-generator.js +98 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.js +13 -5
- package/dist/types.d.ts +4 -8
- package/dist/types.js +1 -9
- package/package.json +15 -5
- package/dist/agent/utils/http-driver-options.d.ts +0 -13
- package/dist/agent/utils/http-driver-options.js +0 -86
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,401 @@
|
|
|
1
|
+
# @forestadmin/agent [1.0.0-beta.40](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.39...@forestadmin/agent@1.0.0-beta.40) (2022-06-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* add collection hooks ([#340](https://github.com/ForestAdmin/agent-nodejs/issues/340)) ([28adde9](https://github.com/ForestAdmin/agent-nodejs/commit/28adde93ca544862203777585388a43521beac4b))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Dependencies
|
|
13
|
+
|
|
14
|
+
* **@forestadmin/datasource-toolkit:** upgraded to 1.0.0-beta.25
|
|
15
|
+
|
|
16
|
+
# @forestadmin/agent [1.0.0-beta.39](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.38...@forestadmin/agent@1.0.0-beta.39) (2022-06-14)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* **agent:** move chart decorator to allow use sort emulate inside handler ([#354](https://github.com/ForestAdmin/agent-nodejs/issues/354)) ([79c199b](https://github.com/ForestAdmin/agent-nodejs/commit/79c199be272b03238c8211d2a717747b9e8ea0c0))
|
|
22
|
+
* **schema:** mark relations as readonly when the foreign key is readonly ([#350](https://github.com/ForestAdmin/agent-nodejs/issues/350)) ([a1a8f30](https://github.com/ForestAdmin/agent-nodejs/commit/a1a8f304857979590fe78ba69b1bfa80dffe914f))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Dependencies
|
|
29
|
+
|
|
30
|
+
* **@forestadmin/datasource-toolkit:** upgraded to 1.0.0-beta.24
|
|
31
|
+
|
|
32
|
+
# @forestadmin/agent [1.0.0-beta.38](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.37...@forestadmin/agent@1.0.0-beta.38) (2022-06-14)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Dependencies
|
|
39
|
+
|
|
40
|
+
* **@forestadmin/datasource-toolkit:** upgraded to 1.0.0-beta.23
|
|
41
|
+
|
|
42
|
+
# @forestadmin/agent [1.0.0-beta.37](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.36...@forestadmin/agent@1.0.0-beta.37) (2022-06-09)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### Bug Fixes
|
|
46
|
+
|
|
47
|
+
* **typing-generator:** add simple quote arround the collection and fiel name to be compatible with ts ([#336](https://github.com/ForestAdmin/agent-nodejs/issues/336)) ([138b593](https://github.com/ForestAdmin/agent-nodejs/commit/138b593bff7d6dadbb5779d503e30c722f7978cf))
|
|
48
|
+
|
|
49
|
+
# @forestadmin/agent [1.0.0-beta.36](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.35...@forestadmin/agent@1.0.0-beta.36) (2022-06-09)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
### Dependencies
|
|
56
|
+
|
|
57
|
+
* **@forestadmin/datasource-toolkit:** upgraded to 1.0.0-beta.22
|
|
58
|
+
|
|
59
|
+
# @forestadmin/agent [1.0.0-beta.35](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.34...@forestadmin/agent@1.0.0-beta.35) (2022-06-01)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
### Features
|
|
63
|
+
|
|
64
|
+
* **builder:** add helper method to create embedded relationships ([#311](https://github.com/ForestAdmin/agent-nodejs/issues/311)) ([662cf58](https://github.com/ForestAdmin/agent-nodejs/commit/662cf5885c8b7c4fa17fed59f20f54625d4e5660))
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
### Dependencies
|
|
71
|
+
|
|
72
|
+
* **@forestadmin/datasource-toolkit:** upgraded to 1.0.0-beta.21
|
|
73
|
+
|
|
74
|
+
# @forestadmin/agent [1.0.0-beta.34](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.33...@forestadmin/agent@1.0.0-beta.34) (2022-05-31)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
### Features
|
|
78
|
+
|
|
79
|
+
* make count an optional feature ([#327](https://github.com/ForestAdmin/agent-nodejs/issues/327)) ([b6f688c](https://github.com/ForestAdmin/agent-nodejs/commit/b6f688ca5f84aa29740761ff848c4beca5ee61d6))
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
### Dependencies
|
|
86
|
+
|
|
87
|
+
* **@forestadmin/datasource-toolkit:** upgraded to 1.0.0-beta.20
|
|
88
|
+
|
|
89
|
+
# @forestadmin/agent [1.0.0-beta.33](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.32...@forestadmin/agent@1.0.0-beta.33) (2022-05-25)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
### Dependencies
|
|
96
|
+
|
|
97
|
+
* **@forestadmin/datasource-toolkit:** upgraded to 1.0.0-beta.19
|
|
98
|
+
|
|
99
|
+
# @forestadmin/agent [1.0.0-beta.32](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.31...@forestadmin/agent@1.0.0-beta.32) (2022-05-24)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
### Dependencies
|
|
106
|
+
|
|
107
|
+
* **@forestadmin/datasource-toolkit:** upgraded to 1.0.0-beta.18
|
|
108
|
+
|
|
109
|
+
# @forestadmin/agent [1.0.0-beta.31](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.30...@forestadmin/agent@1.0.0-beta.31) (2022-05-24)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
### Features
|
|
113
|
+
|
|
114
|
+
* add replaceSearch to collection customizer ([#310](https://github.com/ForestAdmin/agent-nodejs/issues/310)) ([09a45c7](https://github.com/ForestAdmin/agent-nodejs/commit/09a45c783c277dd5642aa9b289a43750f3d97ade))
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
### Dependencies
|
|
121
|
+
|
|
122
|
+
* **@forestadmin/datasource-toolkit:** upgraded to 1.0.0-beta.17
|
|
123
|
+
|
|
124
|
+
# @forestadmin/agent [1.0.0-beta.30](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.29...@forestadmin/agent@1.0.0-beta.30) (2022-05-19)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
### Bug Fixes
|
|
128
|
+
|
|
129
|
+
* **permissions:** switch read to browse for csv permissions ([#313](https://github.com/ForestAdmin/agent-nodejs/issues/313)) ([ac06dae](https://github.com/ForestAdmin/agent-nodejs/commit/ac06daec8593a26a2232a1c699fb5c9557643313))
|
|
130
|
+
|
|
131
|
+
# @forestadmin/agent [1.0.0-beta.29](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.28...@forestadmin/agent@1.0.0-beta.29) (2022-05-18)
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
### Bug Fixes
|
|
135
|
+
|
|
136
|
+
* **agent:** import fastify/express only if needed ([#312](https://github.com/ForestAdmin/agent-nodejs/issues/312)) ([81933c1](https://github.com/ForestAdmin/agent-nodejs/commit/81933c1aa67a5e08ef89c7c9d913da9518fdb660))
|
|
137
|
+
|
|
138
|
+
# @forestadmin/agent [1.0.0-beta.28](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.27...@forestadmin/agent@1.0.0-beta.28) (2022-05-18)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
### Features
|
|
142
|
+
|
|
143
|
+
* compatibility with Express.js, Koa, Fastify & NestJS ([#300](https://github.com/ForestAdmin/agent-nodejs/issues/300)) ([904639e](https://github.com/ForestAdmin/agent-nodejs/commit/904639ec66f4116b3c5557d83ec43656e55ccbbc))
|
|
144
|
+
|
|
145
|
+
# @forestadmin/agent [1.0.0-beta.27](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.26...@forestadmin/agent@1.0.0-beta.27) (2022-05-17)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
### Features
|
|
149
|
+
|
|
150
|
+
* add support for standalone mode ([#304](https://github.com/ForestAdmin/agent-nodejs/issues/304)) ([c2bca75](https://github.com/ForestAdmin/agent-nodejs/commit/c2bca75a882c1591ad7560583ba0c56fb8020e12))
|
|
151
|
+
|
|
152
|
+
# @forestadmin/agent [1.0.0-beta.26](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.25...@forestadmin/agent@1.0.0-beta.26) (2022-05-16)
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
### Features
|
|
156
|
+
|
|
157
|
+
* autocomplete on field names ([#263](https://github.com/ForestAdmin/agent-nodejs/issues/263)) ([e2025d5](https://github.com/ForestAdmin/agent-nodejs/commit/e2025d57d930edf6d326bd0c6d7fffcd4aad728d))
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
### Dependencies
|
|
164
|
+
|
|
165
|
+
* **@forestadmin/datasource-toolkit:** upgraded to 1.0.0-beta.16
|
|
166
|
+
|
|
167
|
+
# @forestadmin/agent [1.0.0-beta.25](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.24...@forestadmin/agent@1.0.0-beta.25) (2022-05-16)
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
### Features
|
|
171
|
+
|
|
172
|
+
* **builder:** create one method per relation type in the collection customizer ([#302](https://github.com/ForestAdmin/agent-nodejs/issues/302)) ([df5438d](https://github.com/ForestAdmin/agent-nodejs/commit/df5438d641bd8c4f8ad7c114120189d9dda26c44))
|
|
173
|
+
|
|
174
|
+
# @forestadmin/agent [1.0.0-beta.24](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.23...@forestadmin/agent@1.0.0-beta.24) (2022-05-16)
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
### Bug Fixes
|
|
178
|
+
|
|
179
|
+
* **onboarding:** display better errors when the agent fails to start ([#294](https://github.com/ForestAdmin/agent-nodejs/issues/294)) ([03f756b](https://github.com/ForestAdmin/agent-nodejs/commit/03f756b9964ba5970d7f5be37b47956fbcf9c5f7))
|
|
180
|
+
|
|
181
|
+
# @forestadmin/agent [1.0.0-beta.23](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.22...@forestadmin/agent@1.0.0-beta.23) (2022-05-12)
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
### Bug Fixes
|
|
185
|
+
|
|
186
|
+
* **schema:** broken generation for composite types ([#291](https://github.com/ForestAdmin/agent-nodejs/issues/291)) ([b1cb7e8](https://github.com/ForestAdmin/agent-nodejs/commit/b1cb7e86070acce0dc303f54c8d400d870e705a9))
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
### Features
|
|
190
|
+
|
|
191
|
+
* implement api-charts ([#284](https://github.com/ForestAdmin/agent-nodejs/issues/284)) ([5917b8c](https://github.com/ForestAdmin/agent-nodejs/commit/5917b8cf645998cd3c0d750310cd81920b250e71))
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
### Dependencies
|
|
198
|
+
|
|
199
|
+
* **@forestadmin/datasource-toolkit:** upgraded to 1.0.0-beta.15
|
|
200
|
+
|
|
201
|
+
# @forestadmin/agent [1.0.0-beta.22](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.21...@forestadmin/agent@1.0.0-beta.22) (2022-05-09)
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
### Bug Fixes
|
|
205
|
+
|
|
206
|
+
* **agent:** export a factory to create the agent ([#298](https://github.com/ForestAdmin/agent-nodejs/issues/298)) ([8370ab7](https://github.com/ForestAdmin/agent-nodejs/commit/8370ab7a7d58cbbbbae0991d48ab89033573fbb2))
|
|
207
|
+
|
|
208
|
+
# @forestadmin/agent [1.0.0-beta.21](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.20...@forestadmin/agent@1.0.0-beta.21) (2022-05-09)
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
### Bug Fixes
|
|
212
|
+
|
|
213
|
+
* **computed:** crash at construction when making computed fields which have zero dependencies ([#293](https://github.com/ForestAdmin/agent-nodejs/issues/293)) ([7fe0319](https://github.com/ForestAdmin/agent-nodejs/commit/7fe031933a46189f8c6951ffe4b5a23912febc99))
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
### Dependencies
|
|
220
|
+
|
|
221
|
+
* **@forestadmin/datasource-toolkit:** upgraded to 1.0.0-beta.14
|
|
222
|
+
|
|
223
|
+
# @forestadmin/agent [1.0.0-beta.20](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.19...@forestadmin/agent@1.0.0-beta.20) (2022-05-09)
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
### Dependencies
|
|
230
|
+
|
|
231
|
+
* **@forestadmin/datasource-toolkit:** upgraded to 1.0.0-beta.13
|
|
232
|
+
|
|
233
|
+
# @forestadmin/agent [1.0.0-beta.19](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.18...@forestadmin/agent@1.0.0-beta.19) (2022-05-09)
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
### Bug Fixes
|
|
237
|
+
|
|
238
|
+
* datasource naming consistency ([#292](https://github.com/ForestAdmin/agent-nodejs/issues/292)) ([ff50a1f](https://github.com/ForestAdmin/agent-nodejs/commit/ff50a1f02aa65b3d99824c2bc9fb19d729a4e465))
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
### Dependencies
|
|
245
|
+
|
|
246
|
+
* **@forestadmin/datasource-toolkit:** upgraded to 1.0.0-beta.12
|
|
247
|
+
|
|
248
|
+
# @forestadmin/agent [1.0.0-beta.18](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.17...@forestadmin/agent@1.0.0-beta.18) (2022-05-04)
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
### Bug Fixes
|
|
252
|
+
|
|
253
|
+
* correctly parse the value of "in" nodes in conditions trees ([#281](https://github.com/ForestAdmin/agent-nodejs/issues/281)) ([3c34e30](https://github.com/ForestAdmin/agent-nodejs/commit/3c34e30da8922ebf81337c6ac9695eb6bae50397))
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
### Dependencies
|
|
260
|
+
|
|
261
|
+
* **@forestadmin/datasource-toolkit:** upgraded to 1.0.0-beta.11
|
|
262
|
+
|
|
263
|
+
# @forestadmin/agent [1.0.0-beta.17](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.16...@forestadmin/agent@1.0.0-beta.17) (2022-04-29)
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
### Bug Fixes
|
|
267
|
+
|
|
268
|
+
* do not perform queries which are known to yield zero records ([#279](https://github.com/ForestAdmin/agent-nodejs/issues/279)) ([30b4dd7](https://github.com/ForestAdmin/agent-nodejs/commit/30b4dd7d7fcf43568800ff9c23a62c3fafc53d4b))
|
|
269
|
+
* having nulls in the throughTable of a many to many crashes the frontend ([#277](https://github.com/ForestAdmin/agent-nodejs/issues/277)) ([8d9d388](https://github.com/ForestAdmin/agent-nodejs/commit/8d9d388a7ce510be83c9aed76125b49be4b94c69))
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
### Dependencies
|
|
276
|
+
|
|
277
|
+
* **@forestadmin/datasource-toolkit:** upgraded to 1.0.0-beta.10
|
|
278
|
+
|
|
279
|
+
# @forestadmin/agent [1.0.0-beta.16](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.15...@forestadmin/agent@1.0.0-beta.16) (2022-04-29)
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
### Dependencies
|
|
286
|
+
|
|
287
|
+
* **@forestadmin/datasource-toolkit:** upgraded to 1.0.0-beta.9
|
|
288
|
+
|
|
289
|
+
# @forestadmin/agent [1.0.0-beta.15](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.14...@forestadmin/agent@1.0.0-beta.15) (2022-04-28)
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
### Bug Fixes
|
|
293
|
+
|
|
294
|
+
* can't set a relation to null in the detail-view form ([#275](https://github.com/ForestAdmin/agent-nodejs/issues/275)) ([06ae054](https://github.com/ForestAdmin/agent-nodejs/commit/06ae054d524717b4eec4e19f85e9bdf675d75cf0))
|
|
295
|
+
|
|
296
|
+
# @forestadmin/agent [1.0.0-beta.14](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.13...@forestadmin/agent@1.0.0-beta.14) (2022-04-28)
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
### Dependencies
|
|
303
|
+
|
|
304
|
+
* **@forestadmin/datasource-toolkit:** upgraded to 1.0.0-beta.8
|
|
305
|
+
|
|
306
|
+
# @forestadmin/agent [1.0.0-beta.13](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.12...@forestadmin/agent@1.0.0-beta.13) (2022-04-27)
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
### Bug Fixes
|
|
310
|
+
|
|
311
|
+
* typos in message at startup ([#270](https://github.com/ForestAdmin/agent-nodejs/issues/270)) ([9fe940a](https://github.com/ForestAdmin/agent-nodejs/commit/9fe940a40da153d2f4ab8674daee1d62c8df6fbf))
|
|
312
|
+
|
|
313
|
+
# @forestadmin/agent [1.0.0-beta.12](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.11...@forestadmin/agent@1.0.0-beta.12) (2022-04-27)
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
### Bug Fixes
|
|
317
|
+
|
|
318
|
+
* schema generation retrieves keys in the wrong collection ([#269](https://github.com/ForestAdmin/agent-nodejs/issues/269)) ([7151667](https://github.com/ForestAdmin/agent-nodejs/commit/715166799840c60d9a40098f501e7e236eba443d))
|
|
319
|
+
|
|
320
|
+
# @forestadmin/agent [1.0.0-beta.11](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.10...@forestadmin/agent@1.0.0-beta.11) (2022-04-26)
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
### Bug Fixes
|
|
324
|
+
|
|
325
|
+
* example project write override uses an outdated handler prototype ([#267](https://github.com/ForestAdmin/agent-nodejs/issues/267)) ([c32e212](https://github.com/ForestAdmin/agent-nodejs/commit/c32e21245d1703b599f474dfddfc5888e1a6fc77))
|
|
326
|
+
|
|
327
|
+
# @forestadmin/agent [1.0.0-beta.10](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.9...@forestadmin/agent@1.0.0-beta.10) (2022-04-26)
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
### Bug Fixes
|
|
331
|
+
|
|
332
|
+
* do not crash when operators are not provided by the datasource ([#264](https://github.com/ForestAdmin/agent-nodejs/issues/264)) ([0004005](https://github.com/ForestAdmin/agent-nodejs/commit/000400555aa53c4e440cadf23e37684877532cf5))
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
### Features
|
|
336
|
+
|
|
337
|
+
* give access to logged in user to customization context ([#253](https://github.com/ForestAdmin/agent-nodejs/issues/253)) ([be97812](https://github.com/ForestAdmin/agent-nodejs/commit/be978121e47ab06c7a50cc6dec0cdb9284ea9d96))
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
### Dependencies
|
|
344
|
+
|
|
345
|
+
* **@forestadmin/datasource-toolkit:** upgraded to 1.0.0-beta.7
|
|
346
|
+
|
|
347
|
+
# @forestadmin/agent [1.0.0-beta.9](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.8...@forestadmin/agent@1.0.0-beta.9) (2022-04-25)
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
### Bug Fixes
|
|
351
|
+
|
|
352
|
+
* **agent:** force default value for some options when null or undefined are given ([#258](https://github.com/ForestAdmin/agent-nodejs/issues/258)) ([4d40954](https://github.com/ForestAdmin/agent-nodejs/commit/4d409542b80f21f7195ca1666fd42f2e36c6dc01))
|
|
353
|
+
* import packages from js ([#260](https://github.com/ForestAdmin/agent-nodejs/issues/260)) ([de00886](https://github.com/ForestAdmin/agent-nodejs/commit/de008862971ea5d3559e5a4c3136b0dd2161d760))
|
|
354
|
+
|
|
355
|
+
# @forestadmin/agent [1.0.0-beta.8](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.7...@forestadmin/agent@1.0.0-beta.8) (2022-04-21)
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
### Features
|
|
359
|
+
|
|
360
|
+
* harmonize datasource creation and pass logger to it ([#257](https://github.com/ForestAdmin/agent-nodejs/issues/257)) ([82cb4ea](https://github.com/ForestAdmin/agent-nodejs/commit/82cb4ea37ac0a9fe83423d917226dfd8fad7d0a6))
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
### Dependencies
|
|
367
|
+
|
|
368
|
+
* **@forestadmin/datasource-toolkit:** upgraded to 1.0.0-beta.6
|
|
369
|
+
|
|
370
|
+
# @forestadmin/agent [1.0.0-beta.7](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.6...@forestadmin/agent@1.0.0-beta.7) (2022-04-21)
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
### Bug Fixes
|
|
374
|
+
|
|
375
|
+
* **cors:** handle future private network access header ([#259](https://github.com/ForestAdmin/agent-nodejs/issues/259)) ([e9442f8](https://github.com/ForestAdmin/agent-nodejs/commit/e9442f8aa508dd4e6c663f1641d3161d35da321a))
|
|
376
|
+
|
|
377
|
+
# @forestadmin/agent [1.0.0-beta.6](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.5...@forestadmin/agent@1.0.0-beta.6) (2022-04-19)
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
### Bug Fixes
|
|
381
|
+
|
|
382
|
+
* leaderboard chart and aggregation emulation ([#241](https://github.com/ForestAdmin/agent-nodejs/issues/241)) ([d2015d7](https://github.com/ForestAdmin/agent-nodejs/commit/d2015d7f82fe6a42b36d797d6e5945b0b8f1c6ba))
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
### Dependencies
|
|
389
|
+
|
|
390
|
+
* **@forestadmin/datasource-toolkit:** upgraded to 1.0.0-beta.5
|
|
391
|
+
|
|
392
|
+
# @forestadmin/agent [1.0.0-beta.5](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.4...@forestadmin/agent@1.0.0-beta.5) (2022-04-19)
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
### Bug Fixes
|
|
396
|
+
|
|
397
|
+
* unpublished fields should be usable on actions ([#245](https://github.com/ForestAdmin/agent-nodejs/issues/245)) ([52c8a68](https://github.com/ForestAdmin/agent-nodejs/commit/52c8a680c1341232d8fb87f18d9d9fb802ff03d9))
|
|
398
|
+
|
|
1
399
|
# @forestadmin/agent [1.0.0-beta.4](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.0.0-beta.3...@forestadmin/agent@1.0.0-beta.4) (2022-04-15)
|
|
2
400
|
|
|
3
401
|
|
|
@@ -1,34 +1,12 @@
|
|
|
1
|
-
/// <reference types="
|
|
1
|
+
/// <reference types="koa__router" />
|
|
2
2
|
import { DataSource } from '@forestadmin/datasource-toolkit';
|
|
3
|
-
import
|
|
4
|
-
import { AgentOptions } from '../types';
|
|
3
|
+
import Router from '@koa/router';
|
|
5
4
|
import { AgentOptionsWithDefaults } from './types';
|
|
6
|
-
import BaseRoute from './routes/base-route';
|
|
7
|
-
import { ForestAdminHttpDriverServices } from './services';
|
|
8
|
-
/** Native NodeJS callback that can be passed to an HTTP Server */
|
|
9
|
-
export declare type HttpCallback = (req: IncomingMessage, res: ServerResponse) => void;
|
|
10
5
|
export default class ForestAdminHttpDriver {
|
|
11
6
|
readonly dataSource: DataSource;
|
|
12
7
|
readonly options: AgentOptionsWithDefaults;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
private status;
|
|
17
|
-
/**
|
|
18
|
-
* Native request handler.
|
|
19
|
-
* Can be used directly with express.js or the NodeJS http module.
|
|
20
|
-
* Other frameworks will require adapters.
|
|
21
|
-
*/
|
|
22
|
-
get handler(): HttpCallback;
|
|
23
|
-
constructor(dataSource: DataSource, options: AgentOptions);
|
|
24
|
-
/**
|
|
25
|
-
* Builds the underlying application from the datasource.
|
|
26
|
-
* This method can only be called once.
|
|
27
|
-
*/
|
|
28
|
-
start(): Promise<void>;
|
|
29
|
-
/**
|
|
30
|
-
* Tear down all routes (close open sockets, ...)
|
|
31
|
-
*/
|
|
32
|
-
stop(): Promise<void>;
|
|
8
|
+
constructor(dataSource: DataSource, options: AgentOptionsWithDefaults);
|
|
9
|
+
getRouter(): Promise<Router>;
|
|
10
|
+
sendSchema(): Promise<void>;
|
|
33
11
|
}
|
|
34
12
|
//# sourceMappingURL=forestadmin-http-driver.d.ts.map
|
|
@@ -3,71 +3,41 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const koa_1 = __importDefault(require("koa"));
|
|
7
6
|
const router_1 = __importDefault(require("@koa/router"));
|
|
8
7
|
const koa_bodyparser_1 = __importDefault(require("koa-bodyparser"));
|
|
9
8
|
const cors_1 = __importDefault(require("@koa/cors"));
|
|
10
|
-
const path_1 = __importDefault(require("path"));
|
|
11
|
-
const types_1 = require("../types");
|
|
12
9
|
const forest_http_api_1 = __importDefault(require("./utils/forest-http-api"));
|
|
13
|
-
const http_driver_options_1 = __importDefault(require("./utils/http-driver-options"));
|
|
14
10
|
const emitter_1 = __importDefault(require("./utils/forest-schema/emitter"));
|
|
15
11
|
const routes_1 = __importDefault(require("./routes"));
|
|
16
12
|
const services_1 = __importDefault(require("./services"));
|
|
17
13
|
class ForestAdminHttpDriver {
|
|
18
14
|
constructor(dataSource, options) {
|
|
19
|
-
this.routes = [];
|
|
20
|
-
this.app = new koa_1.default();
|
|
21
|
-
this.status = 'waiting';
|
|
22
15
|
this.dataSource = dataSource;
|
|
23
|
-
this.options =
|
|
24
|
-
this.services = (0, services_1.default)(this.options);
|
|
25
|
-
http_driver_options_1.default.validate(this.options);
|
|
16
|
+
this.options = options;
|
|
26
17
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
18
|
+
async getRouter() {
|
|
19
|
+
// Bootstrap app
|
|
20
|
+
const services = (0, services_1.default)(this.options);
|
|
21
|
+
const routes = (0, routes_1.default)(this.dataSource, this.options, services);
|
|
22
|
+
await Promise.all(routes.map(route => route.bootstrap()));
|
|
23
|
+
// Build router
|
|
24
|
+
const router = new router_1.default();
|
|
25
|
+
router.all('(.*)', (0, cors_1.default)({ credentials: true, maxAge: 24 * 3600, privateNetworkAccess: true }));
|
|
26
|
+
router.use((0, koa_bodyparser_1.default)({ jsonLimit: '50mb' }));
|
|
27
|
+
routes.forEach(route => route.setupRoutes(router));
|
|
28
|
+
return router;
|
|
34
29
|
}
|
|
35
|
-
|
|
36
|
-
* Builds the underlying application from the datasource.
|
|
37
|
-
* This method can only be called once.
|
|
38
|
-
*/
|
|
39
|
-
async start() {
|
|
40
|
-
if (this.status !== 'waiting') {
|
|
41
|
-
throw new Error('Agent cannot be restarted.');
|
|
42
|
-
}
|
|
43
|
-
this.status = 'running';
|
|
44
|
-
// Build http application
|
|
45
|
-
const router = new router_1.default({ prefix: path_1.default.join('/', this.options.prefix) });
|
|
46
|
-
this.routes = (0, routes_1.default)(this.dataSource, this.options, this.services);
|
|
47
|
-
this.routes.forEach(route => route.setupRoutes(router));
|
|
48
|
-
await Promise.all(this.routes.map(route => route.bootstrap()));
|
|
49
|
-
this.app
|
|
50
|
-
.use((0, cors_1.default)({ credentials: true, maxAge: 24 * 3600 }))
|
|
51
|
-
.use((0, koa_bodyparser_1.default)({ jsonLimit: '50mb' }))
|
|
52
|
-
.use(router.routes());
|
|
53
|
-
// Send schema to forestadmin-server (if relevant).
|
|
30
|
+
async sendSchema() {
|
|
54
31
|
const schema = await emitter_1.default.getSerializedSchema(this.options, this.dataSource);
|
|
55
32
|
const schemaIsKnown = await forest_http_api_1.default.hasSchema(this.options, schema.meta.schemaFileHash);
|
|
56
33
|
if (!schemaIsKnown) {
|
|
34
|
+
this.options.logger('Info', 'Schema was updated, sending new version');
|
|
57
35
|
await forest_http_api_1.default.uploadSchema(this.options, schema);
|
|
58
36
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Tear down all routes (close open sockets, ...)
|
|
63
|
-
*/
|
|
64
|
-
async stop() {
|
|
65
|
-
if (this.status !== 'running') {
|
|
66
|
-
throw new Error('Agent is not running.');
|
|
37
|
+
else {
|
|
38
|
+
this.options.logger('Info', 'Schema was not updated since last run');
|
|
67
39
|
}
|
|
68
|
-
this.status = 'done';
|
|
69
|
-
await Promise.all(this.routes.map(route => route.tearDown()));
|
|
70
40
|
}
|
|
71
41
|
}
|
|
72
42
|
exports.default = ForestAdminHttpDriver;
|
|
73
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
43
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9yZXN0YWRtaW4taHR0cC1kcml2ZXIuanMiLCJ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|
|
4
|
+
import { AgentOptionsWithDefaults, RouteType } from '../../types';
|
|
5
|
+
import { ForestAdminHttpDriverServices } from '../../services';
|
|
6
|
+
import BaseRoute from '../base-route';
|
|
7
|
+
export default class ApiChartRoute extends BaseRoute {
|
|
8
|
+
readonly type = RouteType.PrivateRoute;
|
|
9
|
+
private dataSource;
|
|
10
|
+
private chartName;
|
|
11
|
+
constructor(services: ForestAdminHttpDriverServices, options: AgentOptionsWithDefaults, dataSource: DataSource, chartName: string);
|
|
12
|
+
setupRoutes(router: Router): void;
|
|
13
|
+
private handleApiChart;
|
|
14
|
+
private handleSmartChart;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=api-chart.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const uuid_1 = require("uuid");
|
|
7
|
+
const types_1 = require("../../types");
|
|
8
|
+
const base_route_1 = __importDefault(require("../base-route"));
|
|
9
|
+
const query_string_1 = __importDefault(require("../../utils/query-string"));
|
|
10
|
+
class ApiChartRoute extends base_route_1.default {
|
|
11
|
+
constructor(services, options, dataSource, chartName) {
|
|
12
|
+
super(services, options);
|
|
13
|
+
this.type = types_1.RouteType.PrivateRoute;
|
|
14
|
+
this.dataSource = dataSource;
|
|
15
|
+
this.chartName = chartName;
|
|
16
|
+
}
|
|
17
|
+
setupRoutes(router) {
|
|
18
|
+
// Mount both GET and POST, respectively for smart and api charts.
|
|
19
|
+
const path = `/_charts/${this.chartName}`;
|
|
20
|
+
router.get(path, this.handleSmartChart.bind(this));
|
|
21
|
+
router.post(path, this.handleApiChart.bind(this));
|
|
22
|
+
// Log the route to help the customer fill the url in the frontend
|
|
23
|
+
if (!this.options.isProduction) {
|
|
24
|
+
this.options.logger('Info', `Chart '${this.chartName}' was mounted at '${this.options.prefix}${path}'`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
async handleApiChart(context) {
|
|
28
|
+
// Api Charts need the data to be formatted in JSON-API
|
|
29
|
+
context.response.body = {
|
|
30
|
+
data: {
|
|
31
|
+
id: (0, uuid_1.v1)(),
|
|
32
|
+
type: 'stats',
|
|
33
|
+
attributes: {
|
|
34
|
+
value: await this.dataSource.renderChart(query_string_1.default.parseCaller(context), this.chartName),
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
async handleSmartChart(context) {
|
|
40
|
+
// Smart charts need the data to be unformatted
|
|
41
|
+
context.response.body = await this.dataSource.renderChart(query_string_1.default.parseCaller(context), this.chartName);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.default = ApiChartRoute;
|
|
45
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBpLWNoYXJ0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2FnZW50L3JvdXRlcy9hY2Nlc3MvYXBpLWNoYXJ0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBRUEsK0JBQW9DO0FBR3BDLHVDQUFrRTtBQUVsRSwrREFBc0M7QUFDdEMsNEVBQXlEO0FBRXpELE1BQXFCLGFBQWMsU0FBUSxvQkFBUztJQU1sRCxZQUNFLFFBQXVDLEVBQ3ZDLE9BQWlDLEVBQ2pDLFVBQXNCLEVBQ3RCLFNBQWlCO1FBRWpCLEtBQUssQ0FBQyxRQUFRLEVBQUUsT0FBTyxDQUFDLENBQUM7UUFYbEIsU0FBSSxHQUFHLGlCQUFTLENBQUMsWUFBWSxDQUFDO1FBYXJDLElBQUksQ0FBQyxVQUFVLEdBQUcsVUFBVSxDQUFDO1FBQzdCLElBQUksQ0FBQyxTQUFTLEdBQU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