@webda/core 2.4.2 → 3.0.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 (227) hide show
  1. package/lib/application.d.ts +171 -34
  2. package/lib/application.js +243 -47
  3. package/lib/application.js.map +1 -1
  4. package/lib/application.spec.js +44 -8
  5. package/lib/application.spec.js.map +1 -1
  6. package/lib/core.d.ts +113 -54
  7. package/lib/core.js +222 -135
  8. package/lib/core.js.map +1 -1
  9. package/lib/core.spec.js +87 -43
  10. package/lib/core.spec.js.map +1 -1
  11. package/lib/errors.d.ts +65 -0
  12. package/lib/errors.js +113 -0
  13. package/lib/errors.js.map +1 -0
  14. package/lib/errors.spec.d.ts +1 -0
  15. package/lib/errors.spec.js +33 -0
  16. package/lib/errors.spec.js.map +1 -0
  17. package/lib/index.d.ts +3 -0
  18. package/lib/index.js +3 -0
  19. package/lib/index.js.map +1 -1
  20. package/lib/models/aclmodel.d.ts +4 -4
  21. package/lib/models/aclmodel.js +10 -6
  22. package/lib/models/aclmodel.js.map +1 -1
  23. package/lib/models/aclmodel.spec.js +33 -24
  24. package/lib/models/aclmodel.spec.js.map +1 -1
  25. package/lib/models/coremodel.d.ts +284 -92
  26. package/lib/models/coremodel.js +403 -103
  27. package/lib/models/coremodel.js.map +1 -1
  28. package/lib/models/coremodel.spec.js +162 -24
  29. package/lib/models/coremodel.spec.js.map +1 -1
  30. package/lib/models/ident.d.ts +20 -6
  31. package/lib/models/ident.js.map +1 -1
  32. package/lib/models/ownermodel.d.ts +13 -23
  33. package/lib/models/ownermodel.js +24 -51
  34. package/lib/models/ownermodel.js.map +1 -1
  35. package/lib/models/ownermodel.spec.js +23 -11
  36. package/lib/models/ownermodel.spec.js.map +1 -1
  37. package/lib/models/relations.d.ts +167 -0
  38. package/lib/models/relations.js +113 -0
  39. package/lib/models/relations.js.map +1 -0
  40. package/lib/models/rolemodel.d.ts +3 -3
  41. package/lib/models/rolemodel.js +6 -6
  42. package/lib/models/rolemodel.js.map +1 -1
  43. package/lib/models/rolemodel.spec.js +12 -12
  44. package/lib/models/rolemodel.spec.js.map +1 -1
  45. package/lib/models/user.d.ts +40 -24
  46. package/lib/models/user.js +74 -48
  47. package/lib/models/user.js.map +1 -1
  48. package/lib/models/user.spec.js +24 -4
  49. package/lib/models/user.spec.js.map +1 -1
  50. package/lib/queues/memoryqueue.spec.js +9 -5
  51. package/lib/queues/memoryqueue.spec.js.map +1 -1
  52. package/lib/queues/queueservice.js.map +1 -1
  53. package/lib/router.d.ts +17 -8
  54. package/lib/router.js +81 -9
  55. package/lib/router.js.map +1 -1
  56. package/lib/router.spec.js +89 -5
  57. package/lib/router.spec.js.map +1 -1
  58. package/lib/services/asyncevents.spec.js +4 -4
  59. package/lib/services/authentication.d.ts +21 -22
  60. package/lib/services/authentication.js +90 -109
  61. package/lib/services/authentication.js.map +1 -1
  62. package/lib/services/authentication.spec.js +51 -65
  63. package/lib/services/authentication.spec.js.map +1 -1
  64. package/lib/services/binary.d.ts +132 -31
  65. package/lib/services/binary.js +257 -72
  66. package/lib/services/binary.js.map +1 -1
  67. package/lib/services/binary.spec.d.ts +16 -6
  68. package/lib/services/binary.spec.js +44 -117
  69. package/lib/services/binary.spec.js.map +1 -1
  70. package/lib/services/cloudbinary.d.ts +9 -10
  71. package/lib/services/cloudbinary.js +14 -15
  72. package/lib/services/cloudbinary.js.map +1 -1
  73. package/lib/services/cloudbinary.spec.d.ts +2 -2
  74. package/lib/services/cloudbinary.spec.js +13 -12
  75. package/lib/services/cloudbinary.spec.js.map +1 -1
  76. package/lib/services/configuration.js +9 -9
  77. package/lib/services/configuration.js.map +1 -1
  78. package/lib/services/configuration.spec.js +5 -7
  79. package/lib/services/configuration.spec.js.map +1 -1
  80. package/lib/services/cron.spec.js +3 -4
  81. package/lib/services/cron.spec.js.map +1 -1
  82. package/lib/services/cryptoservice.d.ts +2 -2
  83. package/lib/services/cryptoservice.js +5 -2
  84. package/lib/services/cryptoservice.js.map +1 -1
  85. package/lib/services/domainservice.d.ts +113 -0
  86. package/lib/services/domainservice.js +357 -0
  87. package/lib/services/domainservice.js.map +1 -0
  88. package/lib/services/domainservice.spec.d.ts +1 -0
  89. package/lib/services/domainservice.spec.js +334 -0
  90. package/lib/services/domainservice.spec.js.map +1 -0
  91. package/lib/services/echo.d.ts +2 -2
  92. package/lib/services/echo.js.map +1 -1
  93. package/lib/services/echo.spec.js +9 -2
  94. package/lib/services/echo.spec.js.map +1 -1
  95. package/lib/services/filebinary.d.ts +13 -14
  96. package/lib/services/filebinary.js +79 -73
  97. package/lib/services/filebinary.js.map +1 -1
  98. package/lib/services/filebinary.spec.d.ts +5 -0
  99. package/lib/services/filebinary.spec.js +222 -11
  100. package/lib/services/filebinary.spec.js.map +1 -1
  101. package/lib/services/fileconfiguration.js +4 -4
  102. package/lib/services/fileconfiguration.js.map +1 -1
  103. package/lib/services/fileconfiguration.spec.js +23 -24
  104. package/lib/services/fileconfiguration.spec.js.map +1 -1
  105. package/lib/services/invitationservice.d.ts +11 -9
  106. package/lib/services/invitationservice.js +17 -23
  107. package/lib/services/invitationservice.js.map +1 -1
  108. package/lib/services/invitationservice.spec.js +43 -40
  109. package/lib/services/invitationservice.spec.js.map +1 -1
  110. package/lib/services/kubernetesconfiguration.js +12 -22
  111. package/lib/services/kubernetesconfiguration.js.map +1 -1
  112. package/lib/services/kubernetesconfiguration.spec.js +1 -6
  113. package/lib/services/kubernetesconfiguration.spec.js.map +1 -1
  114. package/lib/services/mailer.js +1 -1
  115. package/lib/services/mailer.js.map +1 -1
  116. package/lib/services/mailer.spec.js +4 -1
  117. package/lib/services/mailer.spec.js.map +1 -1
  118. package/lib/services/oauth.d.ts +17 -9
  119. package/lib/services/oauth.js +30 -4
  120. package/lib/services/oauth.js.map +1 -1
  121. package/lib/services/oauth.spec.js +32 -15
  122. package/lib/services/oauth.spec.js.map +1 -1
  123. package/lib/services/prometheus.spec.js.map +1 -1
  124. package/lib/services/proxy.d.ts +9 -8
  125. package/lib/services/proxy.js +65 -36
  126. package/lib/services/proxy.js.map +1 -1
  127. package/lib/services/proxy.spec.js +28 -2
  128. package/lib/services/proxy.spec.js.map +1 -1
  129. package/lib/services/resource.d.ts +3 -3
  130. package/lib/services/resource.js +4 -3
  131. package/lib/services/resource.js.map +1 -1
  132. package/lib/services/resource.spec.js +3 -3
  133. package/lib/services/resource.spec.js.map +1 -1
  134. package/lib/services/service.d.ts +10 -13
  135. package/lib/services/service.js +29 -13
  136. package/lib/services/service.js.map +1 -1
  137. package/lib/services/service.spec.js +49 -11
  138. package/lib/services/service.spec.js.map +1 -1
  139. package/lib/services/version.d.ts +2 -2
  140. package/lib/services/version.js.map +1 -1
  141. package/lib/stores/aggregator.js +1 -0
  142. package/lib/stores/aggregator.js.map +1 -1
  143. package/lib/stores/aliasstore.d.ts +2 -2
  144. package/lib/stores/aliasstore.js +15 -4
  145. package/lib/stores/aliasstore.js.map +1 -1
  146. package/lib/stores/aliasstore.spec.js +4 -2
  147. package/lib/stores/aliasstore.spec.js.map +1 -1
  148. package/lib/stores/file.d.ts +5 -2
  149. package/lib/stores/file.js +11 -8
  150. package/lib/stores/file.js.map +1 -1
  151. package/lib/stores/file.spec.js +21 -34
  152. package/lib/stores/file.spec.js.map +1 -1
  153. package/lib/stores/mapper.d.ts +4 -2
  154. package/lib/stores/mapper.js +18 -11
  155. package/lib/stores/mapper.js.map +1 -1
  156. package/lib/stores/mapper.spec.js +6 -3
  157. package/lib/stores/mapper.spec.js.map +1 -1
  158. package/lib/stores/memory.d.ts +5 -2
  159. package/lib/stores/memory.js +11 -9
  160. package/lib/stores/memory.js.map +1 -1
  161. package/lib/stores/memory.spec.d.ts +3 -0
  162. package/lib/stores/memory.spec.js +100 -11
  163. package/lib/stores/memory.spec.js.map +1 -1
  164. package/lib/stores/store.d.ts +177 -87
  165. package/lib/stores/store.js +312 -141
  166. package/lib/stores/store.js.map +1 -1
  167. package/lib/stores/store.spec.d.ts +2 -2
  168. package/lib/stores/store.spec.js +54 -38
  169. package/lib/stores/store.spec.js.map +1 -1
  170. package/lib/stores/webdaql/WebdaQLLexer.d.ts +14 -13
  171. package/lib/stores/webdaql/WebdaQLLexer.js +121 -112
  172. package/lib/stores/webdaql/WebdaQLLexer.js.map +1 -1
  173. package/lib/stores/webdaql/WebdaQLParserLexer.d.ts +14 -13
  174. package/lib/stores/webdaql/WebdaQLParserLexer.js +121 -112
  175. package/lib/stores/webdaql/WebdaQLParserLexer.js.map +1 -1
  176. package/lib/stores/webdaql/WebdaQLParserListener.d.ts +15 -3
  177. package/lib/stores/webdaql/WebdaQLParserParser.d.ts +23 -13
  178. package/lib/stores/webdaql/WebdaQLParserParser.js +149 -94
  179. package/lib/stores/webdaql/WebdaQLParserParser.js.map +1 -1
  180. package/lib/stores/webdaql/WebdaQLParserVisitor.d.ts +9 -2
  181. package/lib/stores/webdaql/query.d.ts +6 -2
  182. package/lib/stores/webdaql/query.js +14 -1
  183. package/lib/stores/webdaql/query.js.map +1 -1
  184. package/lib/stores/webdaql/query.spec.js +10 -1
  185. package/lib/stores/webdaql/query.spec.js.map +1 -1
  186. package/lib/test.d.ts +48 -19
  187. package/lib/test.js +171 -63
  188. package/lib/test.js.map +1 -1
  189. package/lib/unpackedapplication.d.ts +5 -0
  190. package/lib/unpackedapplication.js +58 -10
  191. package/lib/unpackedapplication.js.map +1 -1
  192. package/lib/utils/context.d.ts +76 -29
  193. package/lib/utils/context.js +91 -55
  194. package/lib/utils/context.js.map +1 -1
  195. package/lib/utils/context.spec.d.ts +9 -1
  196. package/lib/utils/context.spec.js +73 -8
  197. package/lib/utils/context.spec.js.map +1 -1
  198. package/lib/utils/cookie.d.ts +4 -5
  199. package/lib/utils/cookie.js +1 -2
  200. package/lib/utils/cookie.js.map +1 -1
  201. package/lib/utils/cookie.spec.js +5 -3
  202. package/lib/utils/cookie.spec.js.map +1 -1
  203. package/lib/utils/httpcontext.spec.js +9 -3
  204. package/lib/utils/httpcontext.spec.js.map +1 -1
  205. package/lib/utils/serializers.d.ts +46 -17
  206. package/lib/utils/serializers.js +116 -2
  207. package/lib/utils/serializers.js.map +1 -1
  208. package/lib/utils/serializers.spec.js +84 -20
  209. package/lib/utils/serializers.spec.js.map +1 -1
  210. package/lib/utils/session.d.ts +14 -8
  211. package/lib/utils/session.js +14 -3
  212. package/lib/utils/session.js.map +1 -1
  213. package/lib/utils/session.spec.js +6 -1
  214. package/lib/utils/session.spec.js.map +1 -1
  215. package/package.json +16 -10
  216. package/test/cachedapp/webda.config.json +6 -1
  217. package/test/config-cached.json +5 -0
  218. package/test/config-file-missing-file.json +5 -7
  219. package/test/config-file-no-reload.json +5 -7
  220. package/test/config-file-reload.json +5 -7
  221. package/test/config-kube-reload.json +5 -11
  222. package/test/config-reload.json +2 -4
  223. package/test/config.json +12 -2
  224. package/test/moddas/voidstore.js +1 -1
  225. package/test/models/ident.js +6 -4
  226. package/test/models/task.js +4 -4
  227. package/webda.module.json +1587 -1266
@@ -5,18 +5,18 @@ import { Readable } from "stream";
5
5
  import { Counter, WebdaError } from "../index.js";
6
6
  import { CoreModel } from "../models/coremodel.js";
7
7
  import { MappingService, Store } from "../stores/store.js";
8
- import { Context } from "../utils/context.js";
8
+ import { OperationContext, WebContext } from "../utils/context.js";
9
9
  import { Service, ServiceParameters } from "./service.js";
10
10
  /**
11
11
  * Represent basic EventBinary
12
12
  */
13
13
  export interface EventBinary {
14
14
  object: BinaryFileInfo;
15
- service: Binary;
15
+ service: BinaryService;
16
16
  /**
17
17
  * In case the Context is known
18
18
  */
19
- context?: Context;
19
+ context?: OperationContext;
20
20
  }
21
21
  export interface EventBinaryUploadSuccess extends EventBinary {
22
22
  target: CoreModel;
@@ -31,7 +31,7 @@ export interface EventBinaryMetadataUpdate extends EventBinaryUploadSuccess {
31
31
  /**
32
32
  * Emitted if binary does not exist
33
33
  */
34
- export declare class BinaryNotFoundError extends WebdaError {
34
+ export declare class BinaryNotFoundError extends WebdaError.CodeError {
35
35
  constructor(hash: string, storeName: string);
36
36
  }
37
37
  export interface BinaryFileInfo {
@@ -62,10 +62,14 @@ export interface BinaryFileInfo {
62
62
  */
63
63
  metadata?: BinaryMetadata;
64
64
  }
65
+ /**
66
+ * Represent files attached to a model
67
+ */
68
+ export type BinaryFiles = BinaryFileInfo[];
65
69
  /**
66
70
  * Represent a file to store
67
71
  */
68
- export declare abstract class BinaryFile implements BinaryFileInfo {
72
+ export declare abstract class BinaryFile<T = any> implements BinaryFileInfo {
69
73
  /**
70
74
  * Current name
71
75
  */
@@ -97,8 +101,13 @@ export declare abstract class BinaryFile implements BinaryFileInfo {
97
101
  /**
98
102
  * Metadatas stored along with the binary
99
103
  */
100
- metadata?: BinaryMetadata;
104
+ metadata?: T;
101
105
  constructor(info: BinaryFileInfo);
106
+ /**
107
+ * Set the information
108
+ * @param info
109
+ */
110
+ set(info: BinaryFileInfo): void;
102
111
  /**
103
112
  * Retrieve a plain BinaryFileInfo object
104
113
  * @returns
@@ -140,29 +149,22 @@ export declare class MemoryBinaryFile extends BinaryFile {
140
149
  /**
141
150
  * Define the metadata for a Binary
142
151
  */
143
- export type BinaryMetadata = {
144
- [key: string]: any;
145
- };
152
+ export type BinaryMetadata = any;
146
153
  /**
147
154
  * This is a map used to retrieve binary
148
155
  *
149
156
  * @class BinaryMap
150
157
  */
151
- export declare class BinaryMap extends BinaryFile {
158
+ export declare class BinaryMap<T = any> extends BinaryFile<T> {
152
159
  /**
153
160
  * Current context
154
161
  */
155
- __ctx: Context;
162
+ __ctx: OperationContext;
156
163
  /**
157
164
  * Link to the binary store
158
165
  */
159
- __store: Binary;
160
- constructor(service: Binary, obj: BinaryFileInfo);
161
- /**
162
- * Prevent all the attributes starting with '__' to be serialized
163
- * @returns
164
- */
165
- toJSON(): {};
166
+ __store: BinaryService;
167
+ constructor(service: BinaryService, obj: BinaryFileInfo);
166
168
  /**
167
169
  * Get the binary data
168
170
  *
@@ -181,20 +183,104 @@ export declare class BinaryMap extends BinaryFile {
181
183
  * Set the http context
182
184
  * @param ctx
183
185
  */
184
- setContext(ctx: Context): void;
186
+ setContext(ctx: OperationContext): void;
187
+ }
188
+ /**
189
+ * One Binary instance
190
+ */
191
+ export declare class Binary<T = any> extends BinaryMap<T> {
192
+ protected model: CoreModel;
193
+ protected attribute: string;
194
+ constructor(attribute: string, model: CoreModel);
195
+ /**
196
+ * Replace the binary
197
+ * @param id
198
+ * @param ctx
199
+ * @returns
200
+ */
201
+ upload(file: BinaryFile): Promise<void>;
202
+ /**
203
+ * Delete the binary, if you need to replace just use upload
204
+ */
205
+ delete(): Promise<void>;
206
+ /**
207
+ * Return undefined if no hash
208
+ * @returns
209
+ */
210
+ toJSON(): this;
185
211
  }
212
+ /**
213
+ * Define a Binary map stored in a Binaries collection
214
+ */
215
+ export declare class BinariesItem<T = any> extends BinaryMap<T> {
216
+ protected parent: BinariesImpl;
217
+ constructor(parent: BinariesImpl, info: BinaryFileInfo);
218
+ /**
219
+ * Replace the binary
220
+ * @param id
221
+ * @param ctx
222
+ * @returns
223
+ */
224
+ upload(file: BinaryFile): Promise<void>;
225
+ /**
226
+ * Delete the binary, if you need to replace just use upload
227
+ */
228
+ delete(): Promise<void>;
229
+ }
230
+ /**
231
+ * Define a collection of Binary
232
+ */
233
+ export declare class BinariesImpl<T = any> extends Array<BinariesItem<T>> {
234
+ __service: BinaryService;
235
+ protected model: CoreModel;
236
+ protected attribute: string;
237
+ assign(model: CoreModel, attribute: string): this;
238
+ pop(): BinariesItem<T>;
239
+ slice(): BinariesItem<T>[];
240
+ unshift(): number;
241
+ shift(): BinariesItem<T>;
242
+ push(...args: any[]): number;
243
+ /**
244
+ * Upload a file to this model
245
+ * @param file
246
+ */
247
+ upload(file: BinaryFile, replace?: BinariesItem): Promise<void>;
248
+ /**
249
+ * Delete an item
250
+ * @param item
251
+ */
252
+ delete(item: BinariesItem): Promise<void>;
253
+ }
254
+ /**
255
+ * Define a collection of Binary with a Readonly and the upload method
256
+ */
257
+ export type Binaries = Readonly<Array<BinariesItem>> & {
258
+ upload: (file: BinaryFile) => Promise<void>;
259
+ };
186
260
  export declare class BinaryParameters extends ServiceParameters {
187
261
  /**
188
262
  * Define the map to Object collection
189
263
  *
190
264
  * key is a Store name
191
265
  * the string[] represent all valids attributes to store files in
266
+ * @deprecated
192
267
  */
193
268
  map: {
194
269
  [key: string]: string[];
195
270
  };
271
+ /**
272
+ * Define the map of models
273
+ * * indicates all models
274
+ *
275
+ * key is a Store name
276
+ * the string[] represent all valids attributes to store files in * indicates all attributes
277
+ */
278
+ models: {
279
+ [key: string]: string[];
280
+ };
196
281
  /**
197
282
  * Expose the service to http
283
+ * @deprecated will be removed in 4.0
198
284
  */
199
285
  expose?: {
200
286
  /**
@@ -236,6 +322,12 @@ export type BinaryEvents = {
236
322
  "Binary.Create": EventBinaryUploadSuccess;
237
323
  "Binary.Delete": EventBinary;
238
324
  };
325
+ /**
326
+ * Define a BinaryModel with infinite field for binary map
327
+ */
328
+ export type BinaryModel<T = {
329
+ [key: string]: BinaryMap[];
330
+ }> = CoreModel & T;
239
331
  /**
240
332
  * This is an abstract service to represent a storage of files
241
333
  * The binary allow you to expose this service as HTTP
@@ -257,9 +349,9 @@ export type BinaryEvents = {
257
349
  *
258
350
  * @exports
259
351
  * @abstract
260
- * @class Binary
352
+ * @WebdaModda Binary
261
353
  */
262
- declare abstract class Binary<T extends BinaryParameters = BinaryParameters, E extends BinaryEvents = BinaryEvents> extends Service<T, E> implements MappingService<BinaryMap> {
354
+ export declare abstract class BinaryService<T extends BinaryParameters = BinaryParameters, E extends BinaryEvents = BinaryEvents> extends Service<T, E> implements MappingService<BinaryMap> {
263
355
  _lowercaseMaps: any;
264
356
  metrics: {
265
357
  upload: Counter;
@@ -271,6 +363,13 @@ declare abstract class Binary<T extends BinaryParameters = BinaryParameters, E e
271
363
  * @override
272
364
  */
273
365
  initMetrics(): void;
366
+ /**
367
+ * Define if binary is managed by the store
368
+ * @param modelName
369
+ * @param attribute
370
+ * @returns -1 if not managed, 0 if managed but by default, 1 if managed and in the map, 2 if explicit with attribute and model
371
+ */
372
+ handleBinary(modelName: string, attribute: string): -1 | 0 | 1 | 2;
274
373
  /**
275
374
  * When you store a binary to be able to retrieve it you need to store the information into another object
276
375
  *
@@ -307,7 +406,7 @@ declare abstract class Binary<T extends BinaryParameters = BinaryParameters, E e
307
406
  * @param {Number} index The index of the file to change in the property
308
407
  * @emits 'binaryDelete'
309
408
  */
310
- abstract delete(object: CoreModel, property: string, index: number): Promise<void>;
409
+ abstract delete(object: CoreModel, property: string, index?: number): Promise<void>;
311
410
  /**
312
411
  * Get a binary
313
412
  *
@@ -352,11 +451,11 @@ declare abstract class Binary<T extends BinaryParameters = BinaryParameters, E e
352
451
  * @param name
353
452
  * @param property
354
453
  */
355
- protected checkMap(name: string, property: string): void;
454
+ protected checkMap(name: string, property: string, modelName?: string): void;
356
455
  /**
357
456
  * Ensure events are sent correctly after an upload and update the BinaryFileInfo in targetted object
358
457
  */
359
- uploadSuccess(object: CoreModel, property: string, file: BinaryFileInfo): Promise<void>;
458
+ uploadSuccess(object: BinaryModel, property: string, file: BinaryFileInfo): Promise<void>;
360
459
  /**
361
460
  * Cascade delete the object
362
461
  *
@@ -372,13 +471,13 @@ declare abstract class Binary<T extends BinaryParameters = BinaryParameters, E e
372
471
  * @param index
373
472
  * @returns
374
473
  */
375
- deleteSuccess(object: CoreModel, property: string, index: number): Promise<void>;
474
+ deleteSuccess(object: BinaryModel, property: string, index?: number): Promise<any>;
376
475
  /**
377
476
  * Get file either from multipart post or raw
378
477
  * @param req
379
478
  * @returns
380
479
  */
381
- _getFile(req: Context): Promise<BinaryFile>;
480
+ _getFile(req: WebContext): Promise<BinaryFile>;
382
481
  /**
383
482
  * @override
384
483
  */
@@ -399,24 +498,26 @@ declare abstract class Binary<T extends BinaryParameters = BinaryParameters, E e
399
498
  * @param ctx
400
499
  * @returns
401
500
  */
402
- _verifyMapAndStore(ctx: Context): Store<CoreModel>;
501
+ _verifyMapAndStore(ctx: WebContext): Store<CoreModel>;
403
502
  /**
404
503
  * By default no challenge is managed so throws 404
405
504
  *
406
505
  * @param ctx
407
506
  */
408
- putRedirectUrl(_ctx: Context): Promise<{
507
+ putRedirectUrl(_ctx: WebContext): Promise<{
409
508
  url: string;
410
509
  method?: string;
510
+ headers?: {
511
+ [key: string]: string;
512
+ };
411
513
  }>;
412
514
  /**
413
515
  * Mechanism to add a data based on challenge
414
516
  */
415
- httpChallenge(ctx: Context<BinaryFile>): Promise<void>;
517
+ httpChallenge(ctx: WebContext<BinaryFile>): Promise<void>;
416
518
  /**
417
519
  * Manage the different routes
418
520
  * @param ctx
419
521
  */
420
- httpRoute(ctx: Context): Promise<void>;
522
+ httpRoute(ctx: WebContext): Promise<void>;
421
523
  }
422
- export { Binary };