@webda/core 1.2.1 → 1.6.0-beta.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.
- package/lib/application.d.ts +3 -0
- package/lib/application.js +26 -22
- package/lib/application.js.map +1 -1
- package/lib/application.spec.js +185 -2
- package/lib/application.spec.js.map +1 -1
- package/lib/core.d.ts +62 -6
- package/lib/core.js +127 -86
- package/lib/core.js.map +1 -1
- package/lib/core.spec.js +151 -6
- package/lib/core.spec.js.map +1 -1
- package/lib/index.d.ts +4 -0
- package/lib/index.js +4 -0
- package/lib/index.js.map +1 -1
- package/lib/models/aclmodel.d.ts +42 -3
- package/lib/models/aclmodel.js +58 -3
- package/lib/models/aclmodel.js.map +1 -1
- package/lib/models/aclmodel.spec.js +46 -0
- package/lib/models/aclmodel.spec.js.map +1 -1
- package/lib/models/coremodel.d.ts +58 -10
- package/lib/models/coremodel.js +39 -32
- package/lib/models/coremodel.js.map +1 -1
- package/lib/models/coremodel.spec.js +68 -6
- package/lib/models/coremodel.spec.js.map +1 -1
- package/lib/models/ident.d.ts +8 -2
- package/lib/models/ident.js.map +1 -1
- package/lib/models/ident.spec.js +16 -0
- package/lib/models/ident.spec.js.map +1 -1
- package/lib/models/ownermodel.d.ts +1 -1
- package/lib/models/ownermodel.js.map +1 -1
- package/lib/models/ownermodel.spec.js +22 -19
- package/lib/models/ownermodel.spec.js.map +1 -1
- package/lib/models/user.d.ts +2 -0
- package/lib/models/user.js +4 -2
- package/lib/models/user.js.map +1 -1
- package/lib/models/user.spec.js +9 -2
- package/lib/models/user.spec.js.map +1 -1
- package/lib/queues/filequeue.d.ts +63 -0
- package/lib/queues/filequeue.js +161 -0
- package/lib/queues/filequeue.js.map +1 -0
- package/lib/queues/filequeue.spec.d.ts +1 -0
- package/lib/queues/filequeue.spec.js +90 -0
- package/lib/queues/filequeue.spec.js.map +1 -0
- package/lib/queues/memoryqueue.d.ts +18 -4
- package/lib/queues/memoryqueue.js +20 -13
- package/lib/queues/memoryqueue.js.map +1 -1
- package/lib/queues/memoryqueue.spec.js +142 -39
- package/lib/queues/memoryqueue.spec.js.map +1 -1
- package/lib/queues/pubsubservice.d.ts +27 -0
- package/lib/queues/pubsubservice.js +21 -0
- package/lib/queues/pubsubservice.js.map +1 -0
- package/lib/queues/queue.spec.js +16 -7
- package/lib/queues/queue.spec.js.map +1 -1
- package/lib/queues/queueservice.d.ts +108 -13
- package/lib/queues/queueservice.js +100 -36
- package/lib/queues/queueservice.js.map +1 -1
- package/lib/router.js +4 -6
- package/lib/router.js.map +1 -1
- package/lib/router.spec.js +27 -2
- package/lib/router.spec.js.map +1 -1
- package/lib/services/asyncevents.d.ts +110 -5
- package/lib/services/asyncevents.js +134 -39
- package/lib/services/asyncevents.js.map +1 -1
- package/lib/services/asyncevents.spec.js +58 -4
- package/lib/services/asyncevents.spec.js.map +1 -1
- package/lib/services/authentication.d.ts +57 -5
- package/lib/services/authentication.js +93 -84
- package/lib/services/authentication.js.map +1 -1
- package/lib/services/authentication.spec.js +118 -82
- package/lib/services/authentication.spec.js.map +1 -1
- package/lib/services/binary.d.ts +175 -48
- package/lib/services/binary.js +205 -170
- package/lib/services/binary.js.map +1 -1
- package/lib/services/binary.spec.d.ts +22 -3
- package/lib/services/binary.spec.js +327 -22
- package/lib/services/binary.spec.js.map +1 -1
- package/lib/services/configuration.d.ts +94 -13
- package/lib/services/configuration.js +98 -28
- package/lib/services/configuration.js.map +1 -1
- package/lib/services/configuration.spec.js +40 -1
- package/lib/services/configuration.spec.js.map +1 -1
- package/lib/services/cron.d.ts +4 -4
- package/lib/services/cron.js +37 -53
- package/lib/services/cron.js.map +1 -1
- package/lib/services/cron.spec.d.ts +1 -0
- package/lib/services/cron.spec.js +76 -0
- package/lib/services/cron.spec.js.map +1 -0
- package/lib/services/debugmailer.spec.js +18 -4
- package/lib/services/debugmailer.spec.js.map +1 -1
- package/lib/services/echo.js +22 -13
- package/lib/services/echo.js.map +1 -1
- package/lib/services/echo.spec.d.ts +1 -0
- package/lib/services/echo.spec.js +52 -0
- package/lib/services/echo.spec.js.map +1 -0
- package/lib/services/filebinary.d.ts +16 -9
- package/lib/services/filebinary.js +58 -73
- package/lib/services/filebinary.js.map +1 -1
- package/lib/services/filebinary.spec.d.ts +8 -1
- package/lib/services/filebinary.spec.js +133 -7
- package/lib/services/filebinary.spec.js.map +1 -1
- package/lib/services/fileconfiguration.d.ts +9 -3
- package/lib/services/fileconfiguration.js +13 -6
- package/lib/services/fileconfiguration.js.map +1 -1
- package/lib/services/fileconfiguration.spec.js +100 -5
- package/lib/services/fileconfiguration.spec.js.map +1 -1
- package/lib/services/kubernetesconfiguration.d.ts +8 -2
- package/lib/services/kubernetesconfiguration.js +16 -5
- package/lib/services/kubernetesconfiguration.js.map +1 -1
- package/lib/services/kubernetesconfiguration.spec.js +53 -16
- package/lib/services/kubernetesconfiguration.spec.js.map +1 -1
- package/lib/services/mailer.d.ts +11 -2
- package/lib/services/mailer.js +28 -34
- package/lib/services/mailer.js.map +1 -1
- package/lib/services/mailer.spec.js +69 -23
- package/lib/services/mailer.spec.js.map +1 -1
- package/lib/services/oauth.d.ts +5 -2
- package/lib/services/oauth.js +22 -8
- package/lib/services/oauth.js.map +1 -1
- package/lib/services/oauth.spec.js +33 -3
- package/lib/services/oauth.spec.js.map +1 -1
- package/lib/services/resource.spec.js +39 -2
- package/lib/services/resource.spec.js.map +1 -1
- package/lib/services/service.d.ts +16 -0
- package/lib/services/service.js +47 -6
- package/lib/services/service.js.map +1 -1
- package/lib/services/service.spec.d.ts +1 -0
- package/lib/services/service.spec.js +119 -0
- package/lib/services/service.spec.js.map +1 -0
- package/lib/stores/aggregator.d.ts +43 -0
- package/lib/stores/aggregator.js +106 -0
- package/lib/stores/aggregator.js.map +1 -0
- package/lib/stores/file.d.ts +49 -11
- package/lib/stores/file.js +84 -81
- package/lib/stores/file.js.map +1 -1
- package/lib/stores/file.spec.d.ts +6 -1
- package/lib/stores/file.spec.js +134 -9
- package/lib/stores/file.spec.js.map +1 -1
- package/lib/stores/mapper.d.ts +151 -0
- package/lib/stores/mapper.js +294 -0
- package/lib/stores/mapper.js.map +1 -0
- package/lib/stores/mapper.spec.d.ts +1 -0
- package/lib/stores/mapper.spec.js +55 -0
- package/lib/stores/mapper.spec.js.map +1 -0
- package/lib/stores/memory.d.ts +52 -7
- package/lib/stores/memory.js +71 -33
- package/lib/stores/memory.js.map +1 -1
- package/lib/stores/memory.spec.d.ts +6 -1
- package/lib/stores/memory.spec.js +65 -4
- package/lib/stores/memory.spec.js.map +1 -1
- package/lib/stores/store.d.ts +263 -126
- package/lib/stores/store.js +285 -493
- package/lib/stores/store.js.map +1 -1
- package/lib/stores/store.spec.d.ts +20 -0
- package/lib/stores/store.spec.js +242 -18
- package/lib/stores/store.spec.js.map +1 -1
- package/lib/test.d.ts +1 -7
- package/lib/test.js +3 -12
- package/lib/test.js.map +1 -1
- package/lib/utils/abstractdeployer.spec.d.ts +1 -0
- package/lib/utils/abstractdeployer.spec.js +23 -0
- package/lib/utils/abstractdeployer.spec.js.map +1 -0
- package/lib/utils/context.d.ts +25 -2
- package/lib/utils/context.js +33 -12
- package/lib/utils/context.js.map +1 -1
- package/lib/utils/context.spec.js +81 -11
- package/lib/utils/context.spec.js.map +1 -1
- package/lib/utils/cookie.d.ts +12 -0
- package/lib/utils/cookie.js +13 -1
- package/lib/utils/cookie.js.map +1 -1
- package/lib/utils/cookie.spec.js +42 -11
- package/lib/utils/cookie.spec.js.map +1 -1
- package/lib/utils/logger.d.ts +23 -4
- package/lib/utils/logger.js +29 -6
- package/lib/utils/logger.js.map +1 -1
- package/lib/utils/logger.spec.js +8 -0
- package/lib/utils/logger.spec.js.map +1 -1
- package/lib/utils/serializers.d.ts +5 -5
- package/lib/utils/serializers.js +10 -10
- package/lib/utils/serializers.js.map +1 -1
- package/lib/utils/serializers.spec.js +41 -16
- package/lib/utils/serializers.spec.js.map +1 -1
- package/lib/utils/waiter.d.ts +59 -1
- package/lib/utils/waiter.js +86 -3
- package/lib/utils/waiter.js.map +1 -1
- package/lib/utils/waiter.spec.js +48 -4
- package/lib/utils/waiter.spec.js.map +1 -1
- package/package.json +16 -11
- package/test/badapp/package.json +4 -0
- package/test/badapp/webda.config.json +1 -0
- package/test/cachedapp/webda.config.json +7 -0
- package/test/config-file-no-reload.json +70 -0
- package/test/config-file-reload.json +7 -1
- package/test/config-kube-reload.json +7 -1
- package/test/config.json +45 -21
- package/test/config.old-default.json +0 -16
- package/test/config.old.json +0 -16
- package/test/deployments/invalid.json +1 -0
- package/test/moddas/fakeservice.js +5 -0
- package/test/models/ident.js +10 -14
- package/test/models/task.js +2 -4
package/lib/services/binary.d.ts
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Readable } from "stream";
|
|
3
|
+
import { WebdaError } from "..";
|
|
1
4
|
import { CoreModel } from "../models/coremodel";
|
|
2
|
-
import { Store } from "../stores/store";
|
|
5
|
+
import { MappingService, Store } from "../stores/store";
|
|
3
6
|
import { Context } from "../utils/context";
|
|
4
7
|
import { Service, ServiceParameters } from "./service";
|
|
8
|
+
/**
|
|
9
|
+
* Represent basic EventBinary
|
|
10
|
+
*/
|
|
5
11
|
export interface EventBinary {
|
|
6
12
|
object: BinaryMap;
|
|
7
13
|
service: Binary;
|
|
8
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Emitted when someone download a binary
|
|
17
|
+
*/
|
|
9
18
|
export interface EventBinaryGet extends EventBinary {
|
|
10
19
|
}
|
|
11
20
|
export interface EventBinaryUploadSuccess extends EventBinary {
|
|
@@ -15,8 +24,52 @@ export interface EventBinaryDelete extends EventBinary {
|
|
|
15
24
|
}
|
|
16
25
|
export interface EventBinaryCreate extends EventBinaryUploadSuccess {
|
|
17
26
|
}
|
|
18
|
-
|
|
19
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Emitted if binary does not exist
|
|
29
|
+
*/
|
|
30
|
+
export declare class BinaryNotFoundError extends WebdaError {
|
|
31
|
+
constructor(hash: string, storeName: string);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Represent a file to store
|
|
35
|
+
*/
|
|
36
|
+
export interface BinaryFile {
|
|
37
|
+
/**
|
|
38
|
+
* Path on the hard drive
|
|
39
|
+
*/
|
|
40
|
+
path?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Content
|
|
43
|
+
*/
|
|
44
|
+
buffer?: Buffer;
|
|
45
|
+
/**
|
|
46
|
+
* Current name
|
|
47
|
+
*/
|
|
48
|
+
name?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Original name
|
|
51
|
+
*/
|
|
52
|
+
originalname?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Size of the binary
|
|
55
|
+
*/
|
|
56
|
+
size?: number;
|
|
57
|
+
/**
|
|
58
|
+
* Mimetype of the binary
|
|
59
|
+
*/
|
|
60
|
+
mimetype?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Will be computed by the service
|
|
63
|
+
*
|
|
64
|
+
* hash of the content prefixed by 'WEBDA'
|
|
65
|
+
*/
|
|
66
|
+
challenge?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Will be computed by the service
|
|
69
|
+
*
|
|
70
|
+
* hash of the content
|
|
71
|
+
*/
|
|
72
|
+
hash?: string;
|
|
20
73
|
}
|
|
21
74
|
/**
|
|
22
75
|
* This is a map used to retrieve binary
|
|
@@ -24,26 +77,44 @@ export interface EventBinaryUpdate extends EventBinaryUploadSuccess {
|
|
|
24
77
|
* @class BinaryMap
|
|
25
78
|
*/
|
|
26
79
|
export declare class BinaryMap {
|
|
80
|
+
/**
|
|
81
|
+
* Current context
|
|
82
|
+
*/
|
|
27
83
|
__ctx: Context;
|
|
84
|
+
/**
|
|
85
|
+
* Link to the binary store
|
|
86
|
+
*/
|
|
28
87
|
__store: Binary;
|
|
29
88
|
/**
|
|
30
89
|
* Hash of the binary
|
|
31
90
|
*/
|
|
32
91
|
hash: string;
|
|
92
|
+
/**
|
|
93
|
+
* Size of the file
|
|
94
|
+
*/
|
|
95
|
+
size: number;
|
|
96
|
+
/**
|
|
97
|
+
* Mimetype
|
|
98
|
+
*/
|
|
99
|
+
mime: string;
|
|
33
100
|
constructor(service: any, obj: any);
|
|
34
101
|
/**
|
|
35
|
-
*
|
|
102
|
+
* Prevent all the attributes starting with '__' to be serialized
|
|
103
|
+
* @returns
|
|
104
|
+
*/
|
|
105
|
+
toJSON(): {};
|
|
106
|
+
/**
|
|
107
|
+
* Get the binary data
|
|
36
108
|
*
|
|
37
109
|
* @returns
|
|
38
110
|
*/
|
|
39
|
-
get(): Promise<
|
|
111
|
+
get(): Promise<Readable>;
|
|
40
112
|
/**
|
|
41
113
|
* Download the binary to a path
|
|
42
114
|
*
|
|
43
115
|
* Shortcut to call {@link Binary.downloadTo} with current object
|
|
44
116
|
*
|
|
45
117
|
* @param filename
|
|
46
|
-
* @returns
|
|
47
118
|
*/
|
|
48
119
|
downloadTo(filename: string): Promise<void>;
|
|
49
120
|
/**
|
|
@@ -55,6 +126,9 @@ export declare class BinaryMap {
|
|
|
55
126
|
export declare class BinaryParameters extends ServiceParameters {
|
|
56
127
|
/**
|
|
57
128
|
* Define the map to Object collection
|
|
129
|
+
*
|
|
130
|
+
* key is a Store name
|
|
131
|
+
* the string[] represent all valids attributes to store files in
|
|
58
132
|
*/
|
|
59
133
|
map: {
|
|
60
134
|
[key: string]: string[];
|
|
@@ -89,8 +163,16 @@ export declare class BinaryParameters extends ServiceParameters {
|
|
|
89
163
|
}
|
|
90
164
|
/**
|
|
91
165
|
* This is an abstract service to represent a storage of files
|
|
92
|
-
* The binary allow you to expose this service as HTTP
|
|
93
|
-
*
|
|
166
|
+
* The binary allow you to expose this service as HTTP
|
|
167
|
+
*
|
|
168
|
+
* It supports two modes:
|
|
169
|
+
* - attached to a CoreModel (attach, detach, reattach)
|
|
170
|
+
* - pure storage with no managed id (read, write, delete)
|
|
171
|
+
*
|
|
172
|
+
* As we have deduplication builtin you can get some stats
|
|
173
|
+
* - getUsageCount(hash)
|
|
174
|
+
* - getUsageCountForRaw()
|
|
175
|
+
* - getUsageCountForMap()
|
|
94
176
|
*
|
|
95
177
|
* The Binary storage should store only once a binary and reference every object that are used by this binary, so it can be cleaned.
|
|
96
178
|
*
|
|
@@ -102,12 +184,8 @@ export declare class BinaryParameters extends ServiceParameters {
|
|
|
102
184
|
* @abstract
|
|
103
185
|
* @class Binary
|
|
104
186
|
*/
|
|
105
|
-
declare abstract class Binary<T extends BinaryParameters = BinaryParameters> extends Service<T> {
|
|
187
|
+
declare abstract class Binary<T extends BinaryParameters = BinaryParameters> extends Service<T> implements MappingService<BinaryMap> {
|
|
106
188
|
_lowercaseMaps: any;
|
|
107
|
-
/**
|
|
108
|
-
* @inheritdoc
|
|
109
|
-
*/
|
|
110
|
-
loadParameters(params: any): ServiceParameters;
|
|
111
189
|
/**
|
|
112
190
|
* When you store a binary to be able to retrieve it you need to store the information into another object
|
|
113
191
|
*
|
|
@@ -125,68 +203,88 @@ declare abstract class Binary<T extends BinaryParameters = BinaryParameters> ext
|
|
|
125
203
|
* ```
|
|
126
204
|
*
|
|
127
205
|
*
|
|
128
|
-
* @param {Store} targetStore The store that handles the object to attach binary to
|
|
129
206
|
* @param {CoreModel} object The object uuid to get from the store
|
|
130
207
|
* @param {String} property The object property to add the file to
|
|
131
208
|
* @param {Object} file The file by itself
|
|
132
209
|
* @param {Object} metadatas to add to the binary object
|
|
133
210
|
* @emits 'binaryCreate'
|
|
134
211
|
*/
|
|
135
|
-
abstract store(
|
|
212
|
+
abstract store(object: CoreModel, property: string, file: BinaryFile, metadatas?: {
|
|
213
|
+
[key: string]: any;
|
|
214
|
+
}): Promise<void>;
|
|
136
215
|
/**
|
|
137
216
|
* The store can retrieve how many time a binary has been used
|
|
138
217
|
*/
|
|
139
218
|
abstract getUsageCount(hash: any): Promise<number>;
|
|
140
219
|
/**
|
|
141
|
-
*
|
|
142
|
-
*
|
|
220
|
+
* Delete a binary
|
|
143
221
|
*
|
|
144
|
-
* @param {Store} targetStore The store that handles the object to attach binary to
|
|
145
|
-
* @param {String} object The object uuid to get from the store
|
|
146
|
-
* @param {String} property The object property to add the file to
|
|
147
|
-
* @param {Number} index The index of the file to change in the property
|
|
148
|
-
* @param {Object} file The file by itself
|
|
149
|
-
* @param {Object} metadatas to add to the binary object
|
|
150
|
-
* @emits 'binaryUpdate'
|
|
151
|
-
*/
|
|
152
|
-
abstract update(targetStore: any, object: any, property: any, index: any, file: any, metadatas: any): Promise<CoreModel>;
|
|
153
|
-
/**
|
|
154
|
-
* Update a binary
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
* @param {Store} targetStore The store that handles the object to attach binary to
|
|
158
222
|
* @param {CoreModel} object The object uuid to get from the store
|
|
159
223
|
* @param {String} property The object property to add the file to
|
|
160
224
|
* @param {Number} index The index of the file to change in the property
|
|
161
225
|
* @emits 'binaryDelete'
|
|
162
226
|
*/
|
|
163
|
-
abstract delete(
|
|
227
|
+
abstract delete(object: CoreModel, property: string, index: number): Promise<void>;
|
|
164
228
|
/**
|
|
165
229
|
* Get a binary
|
|
166
230
|
*
|
|
167
231
|
* @param {Object} info The reference stored in your target object
|
|
168
232
|
* @emits 'binaryGet'
|
|
169
233
|
*/
|
|
170
|
-
get(info: BinaryMap): Promise<
|
|
234
|
+
get(info: BinaryMap): Promise<Readable>;
|
|
171
235
|
/**
|
|
172
236
|
* Download a binary to a file
|
|
173
237
|
*
|
|
174
238
|
* @param {Object} info The reference stored in your target object
|
|
175
239
|
* @param {String} filepath to save the binary to
|
|
176
240
|
*/
|
|
177
|
-
downloadTo(info:
|
|
178
|
-
/**
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
241
|
+
downloadTo(info: BinaryMap, filename: any): Promise<void>;
|
|
242
|
+
/**
|
|
243
|
+
* @override
|
|
244
|
+
*/
|
|
245
|
+
resolve(): void;
|
|
246
|
+
abstract _get(info: BinaryMap): Promise<Readable>;
|
|
247
|
+
/**
|
|
248
|
+
* Init the declared maps, adding reverse maps
|
|
249
|
+
*
|
|
250
|
+
* @param map
|
|
251
|
+
*/
|
|
182
252
|
initMap(map: any): void;
|
|
253
|
+
/**
|
|
254
|
+
* Based on the raw Map init a BinaryMap
|
|
255
|
+
* @param obj
|
|
256
|
+
* @returns
|
|
257
|
+
*/
|
|
183
258
|
initModel(obj: any): BinaryMap;
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
259
|
+
/**
|
|
260
|
+
* Create hashes
|
|
261
|
+
* @param buffer
|
|
262
|
+
* @returns
|
|
263
|
+
*/
|
|
264
|
+
_getHashes(buffer: Buffer): {
|
|
265
|
+
hash: string;
|
|
266
|
+
challenge: string;
|
|
267
|
+
};
|
|
268
|
+
/**
|
|
269
|
+
* Read a stream to a buffer
|
|
270
|
+
*
|
|
271
|
+
* @param stream
|
|
272
|
+
* @returns
|
|
273
|
+
*/
|
|
274
|
+
static streamToBuffer(stream: Readable): Promise<Buffer>;
|
|
275
|
+
/**
|
|
276
|
+
* Update the BinaryFile
|
|
277
|
+
* @param file
|
|
278
|
+
*/
|
|
279
|
+
_prepareInput(file: BinaryFile): void;
|
|
280
|
+
/**
|
|
281
|
+
* Check if a map is defined
|
|
282
|
+
*
|
|
283
|
+
* @param name
|
|
284
|
+
* @param property
|
|
285
|
+
*/
|
|
286
|
+
_checkMap(name: string, property: string): void;
|
|
287
|
+
uploadSuccess(object: CoreModel, property: string, file: any, metadatas?: any): Promise<void>;
|
|
190
288
|
/**
|
|
191
289
|
* Cascade delete the object
|
|
192
290
|
*
|
|
@@ -202,20 +300,49 @@ declare abstract class Binary<T extends BinaryParameters = BinaryParameters> ext
|
|
|
202
300
|
* @param index
|
|
203
301
|
* @returns
|
|
204
302
|
*/
|
|
205
|
-
deleteSuccess(
|
|
206
|
-
|
|
303
|
+
deleteSuccess(object: CoreModel, property: string, index: number): Promise<void>;
|
|
304
|
+
/**
|
|
305
|
+
* Get file either from multipart post or raw
|
|
306
|
+
* @param req
|
|
307
|
+
* @returns
|
|
308
|
+
*/
|
|
309
|
+
_getFile(req: Context): any;
|
|
207
310
|
/**
|
|
208
311
|
* Init the Binary system routes
|
|
209
312
|
*/
|
|
210
313
|
initRoutes(): void;
|
|
314
|
+
/**
|
|
315
|
+
* Return the name of the service for OpenAPI
|
|
316
|
+
* @returns
|
|
317
|
+
*/
|
|
318
|
+
protected getOperationName(): string;
|
|
211
319
|
/**
|
|
212
320
|
* This is used to allow subclasses to add more route
|
|
213
321
|
*/
|
|
214
322
|
_initRoutes(): boolean;
|
|
215
|
-
|
|
323
|
+
/**
|
|
324
|
+
* Based on the request parameter verify it match a known mapping
|
|
325
|
+
* @param ctx
|
|
326
|
+
* @returns
|
|
327
|
+
*/
|
|
216
328
|
_verifyMapAndStore(ctx: Context): Store<CoreModel>;
|
|
217
|
-
|
|
329
|
+
/**
|
|
330
|
+
* By default no challenge is managed so throws 404
|
|
331
|
+
*
|
|
332
|
+
* @param ctx
|
|
333
|
+
*/
|
|
334
|
+
putRedirectUrl(ctx: Context): Promise<{
|
|
335
|
+
url: string;
|
|
336
|
+
method?: string;
|
|
337
|
+
}>;
|
|
338
|
+
/**
|
|
339
|
+
* Mechanism to add a data based on challenge
|
|
340
|
+
*/
|
|
218
341
|
httpChallenge(ctx: Context): Promise<void>;
|
|
342
|
+
/**
|
|
343
|
+
* Manage the different routes
|
|
344
|
+
* @param ctx
|
|
345
|
+
*/
|
|
219
346
|
httpRoute(ctx: Context): Promise<void>;
|
|
220
347
|
}
|
|
221
348
|
export { Binary };
|