@webda/core 2.4.1 → 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.
- package/lib/application.d.ts +171 -34
- package/lib/application.js +243 -47
- package/lib/application.js.map +1 -1
- package/lib/application.spec.js +44 -8
- package/lib/application.spec.js.map +1 -1
- package/lib/core.d.ts +113 -54
- package/lib/core.js +222 -135
- package/lib/core.js.map +1 -1
- package/lib/core.spec.js +87 -43
- package/lib/core.spec.js.map +1 -1
- package/lib/errors.d.ts +65 -0
- package/lib/errors.js +113 -0
- package/lib/errors.js.map +1 -0
- package/lib/errors.spec.d.ts +1 -0
- package/lib/errors.spec.js +33 -0
- package/lib/errors.spec.js.map +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -1
- package/lib/models/aclmodel.d.ts +4 -4
- package/lib/models/aclmodel.js +10 -6
- package/lib/models/aclmodel.js.map +1 -1
- package/lib/models/aclmodel.spec.js +33 -24
- package/lib/models/aclmodel.spec.js.map +1 -1
- package/lib/models/coremodel.d.ts +284 -92
- package/lib/models/coremodel.js +403 -103
- package/lib/models/coremodel.js.map +1 -1
- package/lib/models/coremodel.spec.js +162 -24
- package/lib/models/coremodel.spec.js.map +1 -1
- package/lib/models/ident.d.ts +20 -6
- package/lib/models/ident.js.map +1 -1
- package/lib/models/ownermodel.d.ts +13 -23
- package/lib/models/ownermodel.js +24 -51
- package/lib/models/ownermodel.js.map +1 -1
- package/lib/models/ownermodel.spec.js +23 -11
- package/lib/models/ownermodel.spec.js.map +1 -1
- package/lib/models/relations.d.ts +167 -0
- package/lib/models/relations.js +113 -0
- package/lib/models/relations.js.map +1 -0
- package/lib/models/rolemodel.d.ts +3 -3
- package/lib/models/rolemodel.js +6 -6
- package/lib/models/rolemodel.js.map +1 -1
- package/lib/models/rolemodel.spec.js +12 -12
- package/lib/models/rolemodel.spec.js.map +1 -1
- package/lib/models/user.d.ts +40 -24
- package/lib/models/user.js +74 -48
- package/lib/models/user.js.map +1 -1
- package/lib/models/user.spec.js +24 -4
- package/lib/models/user.spec.js.map +1 -1
- package/lib/queues/memoryqueue.spec.js +9 -5
- package/lib/queues/memoryqueue.spec.js.map +1 -1
- package/lib/queues/queueservice.js.map +1 -1
- package/lib/router.d.ts +17 -8
- package/lib/router.js +81 -9
- package/lib/router.js.map +1 -1
- package/lib/router.spec.js +89 -5
- package/lib/router.spec.js.map +1 -1
- package/lib/services/asyncevents.spec.js +4 -4
- package/lib/services/authentication.d.ts +21 -22
- package/lib/services/authentication.js +90 -109
- package/lib/services/authentication.js.map +1 -1
- package/lib/services/authentication.spec.js +51 -65
- package/lib/services/authentication.spec.js.map +1 -1
- package/lib/services/binary.d.ts +132 -31
- package/lib/services/binary.js +257 -72
- package/lib/services/binary.js.map +1 -1
- package/lib/services/binary.spec.d.ts +16 -6
- package/lib/services/binary.spec.js +44 -117
- package/lib/services/binary.spec.js.map +1 -1
- package/lib/services/cloudbinary.d.ts +9 -10
- package/lib/services/cloudbinary.js +14 -15
- package/lib/services/cloudbinary.js.map +1 -1
- package/lib/services/cloudbinary.spec.d.ts +2 -2
- package/lib/services/cloudbinary.spec.js +13 -12
- package/lib/services/cloudbinary.spec.js.map +1 -1
- package/lib/services/configuration.js +9 -9
- package/lib/services/configuration.js.map +1 -1
- package/lib/services/configuration.spec.js +5 -7
- package/lib/services/configuration.spec.js.map +1 -1
- package/lib/services/cron.spec.js +3 -4
- package/lib/services/cron.spec.js.map +1 -1
- package/lib/services/cryptoservice.d.ts +2 -2
- package/lib/services/cryptoservice.js +5 -2
- package/lib/services/cryptoservice.js.map +1 -1
- package/lib/services/domainservice.d.ts +113 -0
- package/lib/services/domainservice.js +357 -0
- package/lib/services/domainservice.js.map +1 -0
- package/lib/services/domainservice.spec.d.ts +1 -0
- package/lib/services/domainservice.spec.js +334 -0
- package/lib/services/domainservice.spec.js.map +1 -0
- package/lib/services/echo.d.ts +2 -2
- package/lib/services/echo.js.map +1 -1
- package/lib/services/echo.spec.js +9 -2
- package/lib/services/echo.spec.js.map +1 -1
- package/lib/services/filebinary.d.ts +13 -14
- package/lib/services/filebinary.js +79 -73
- package/lib/services/filebinary.js.map +1 -1
- package/lib/services/filebinary.spec.d.ts +5 -0
- package/lib/services/filebinary.spec.js +222 -11
- package/lib/services/filebinary.spec.js.map +1 -1
- package/lib/services/fileconfiguration.js +7 -7
- package/lib/services/fileconfiguration.js.map +1 -1
- package/lib/services/fileconfiguration.spec.js +23 -24
- package/lib/services/fileconfiguration.spec.js.map +1 -1
- package/lib/services/invitationservice.d.ts +11 -9
- package/lib/services/invitationservice.js +17 -23
- package/lib/services/invitationservice.js.map +1 -1
- package/lib/services/invitationservice.spec.js +43 -40
- package/lib/services/invitationservice.spec.js.map +1 -1
- package/lib/services/kubernetesconfiguration.js +12 -22
- package/lib/services/kubernetesconfiguration.js.map +1 -1
- package/lib/services/kubernetesconfiguration.spec.js +1 -6
- package/lib/services/kubernetesconfiguration.spec.js.map +1 -1
- package/lib/services/mailer.js +1 -1
- package/lib/services/mailer.js.map +1 -1
- package/lib/services/mailer.spec.js +4 -1
- package/lib/services/mailer.spec.js.map +1 -1
- package/lib/services/oauth.d.ts +17 -9
- package/lib/services/oauth.js +30 -4
- package/lib/services/oauth.js.map +1 -1
- package/lib/services/oauth.spec.js +32 -15
- package/lib/services/oauth.spec.js.map +1 -1
- package/lib/services/prometheus.spec.js.map +1 -1
- package/lib/services/proxy.d.ts +9 -8
- package/lib/services/proxy.js +65 -36
- package/lib/services/proxy.js.map +1 -1
- package/lib/services/proxy.spec.js +28 -2
- package/lib/services/proxy.spec.js.map +1 -1
- package/lib/services/resource.d.ts +3 -3
- package/lib/services/resource.js +4 -3
- package/lib/services/resource.js.map +1 -1
- package/lib/services/resource.spec.js +3 -3
- package/lib/services/resource.spec.js.map +1 -1
- package/lib/services/service.d.ts +10 -13
- package/lib/services/service.js +29 -13
- package/lib/services/service.js.map +1 -1
- package/lib/services/service.spec.js +49 -11
- package/lib/services/service.spec.js.map +1 -1
- package/lib/services/version.d.ts +2 -2
- package/lib/services/version.js.map +1 -1
- package/lib/stores/aggregator.js +1 -0
- package/lib/stores/aggregator.js.map +1 -1
- package/lib/stores/aliasstore.d.ts +2 -2
- package/lib/stores/aliasstore.js +15 -4
- package/lib/stores/aliasstore.js.map +1 -1
- package/lib/stores/aliasstore.spec.js +4 -2
- package/lib/stores/aliasstore.spec.js.map +1 -1
- package/lib/stores/file.d.ts +5 -2
- package/lib/stores/file.js +11 -8
- package/lib/stores/file.js.map +1 -1
- package/lib/stores/file.spec.js +21 -34
- package/lib/stores/file.spec.js.map +1 -1
- package/lib/stores/mapper.d.ts +4 -2
- package/lib/stores/mapper.js +18 -11
- package/lib/stores/mapper.js.map +1 -1
- package/lib/stores/mapper.spec.js +6 -3
- package/lib/stores/mapper.spec.js.map +1 -1
- package/lib/stores/memory.d.ts +5 -2
- package/lib/stores/memory.js +11 -9
- package/lib/stores/memory.js.map +1 -1
- package/lib/stores/memory.spec.d.ts +3 -0
- package/lib/stores/memory.spec.js +100 -11
- package/lib/stores/memory.spec.js.map +1 -1
- package/lib/stores/store.d.ts +177 -87
- package/lib/stores/store.js +312 -141
- package/lib/stores/store.js.map +1 -1
- package/lib/stores/store.spec.d.ts +2 -2
- package/lib/stores/store.spec.js +54 -38
- package/lib/stores/store.spec.js.map +1 -1
- package/lib/stores/webdaql/WebdaQLLexer.d.ts +14 -13
- package/lib/stores/webdaql/WebdaQLLexer.js +121 -112
- package/lib/stores/webdaql/WebdaQLLexer.js.map +1 -1
- package/lib/stores/webdaql/WebdaQLParserLexer.d.ts +14 -13
- package/lib/stores/webdaql/WebdaQLParserLexer.js +121 -112
- package/lib/stores/webdaql/WebdaQLParserLexer.js.map +1 -1
- package/lib/stores/webdaql/WebdaQLParserListener.d.ts +15 -3
- package/lib/stores/webdaql/WebdaQLParserParser.d.ts +23 -13
- package/lib/stores/webdaql/WebdaQLParserParser.js +149 -94
- package/lib/stores/webdaql/WebdaQLParserParser.js.map +1 -1
- package/lib/stores/webdaql/WebdaQLParserVisitor.d.ts +9 -2
- package/lib/stores/webdaql/query.d.ts +6 -2
- package/lib/stores/webdaql/query.js +14 -1
- package/lib/stores/webdaql/query.js.map +1 -1
- package/lib/stores/webdaql/query.spec.js +10 -1
- package/lib/stores/webdaql/query.spec.js.map +1 -1
- package/lib/test.d.ts +48 -19
- package/lib/test.js +171 -63
- package/lib/test.js.map +1 -1
- package/lib/unpackedapplication.d.ts +5 -0
- package/lib/unpackedapplication.js +58 -10
- package/lib/unpackedapplication.js.map +1 -1
- package/lib/utils/context.d.ts +76 -29
- package/lib/utils/context.js +91 -55
- package/lib/utils/context.js.map +1 -1
- package/lib/utils/context.spec.d.ts +9 -1
- package/lib/utils/context.spec.js +73 -8
- package/lib/utils/context.spec.js.map +1 -1
- package/lib/utils/cookie.d.ts +4 -5
- package/lib/utils/cookie.js +1 -2
- package/lib/utils/cookie.js.map +1 -1
- package/lib/utils/cookie.spec.js +5 -3
- package/lib/utils/cookie.spec.js.map +1 -1
- package/lib/utils/httpcontext.spec.js +9 -3
- package/lib/utils/httpcontext.spec.js.map +1 -1
- package/lib/utils/serializers.d.ts +46 -17
- package/lib/utils/serializers.js +116 -2
- package/lib/utils/serializers.js.map +1 -1
- package/lib/utils/serializers.spec.js +84 -20
- package/lib/utils/serializers.spec.js.map +1 -1
- package/lib/utils/session.d.ts +14 -8
- package/lib/utils/session.js +14 -3
- package/lib/utils/session.js.map +1 -1
- package/lib/utils/session.spec.js +6 -1
- package/lib/utils/session.spec.js.map +1 -1
- package/package.json +16 -10
- package/test/cachedapp/webda.config.json +6 -1
- package/test/config-cached.json +5 -0
- package/test/config-file-missing-file.json +5 -7
- package/test/config-file-no-reload.json +5 -7
- package/test/config-file-reload.json +5 -7
- package/test/config-kube-reload.json +5 -11
- package/test/config-reload.json +2 -4
- package/test/config.json +12 -2
- package/test/moddas/voidstore.js +1 -1
- package/test/models/ident.js +6 -4
- package/test/models/task.js +4 -4
- package/webda.module.json +1587 -1266
package/lib/services/binary.d.ts
CHANGED
|
@@ -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 {
|
|
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:
|
|
15
|
+
service: BinaryService;
|
|
16
16
|
/**
|
|
17
17
|
* In case the Context is known
|
|
18
18
|
*/
|
|
19
|
-
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?:
|
|
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:
|
|
162
|
+
__ctx: OperationContext;
|
|
156
163
|
/**
|
|
157
164
|
* Link to the binary store
|
|
158
165
|
*/
|
|
159
|
-
__store:
|
|
160
|
-
constructor(service:
|
|
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:
|
|
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
|
-
* @
|
|
352
|
+
* @WebdaModda Binary
|
|
261
353
|
*/
|
|
262
|
-
declare abstract class
|
|
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
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
517
|
+
httpChallenge(ctx: WebContext<BinaryFile>): Promise<void>;
|
|
416
518
|
/**
|
|
417
519
|
* Manage the different routes
|
|
418
520
|
* @param ctx
|
|
419
521
|
*/
|
|
420
|
-
httpRoute(ctx:
|
|
522
|
+
httpRoute(ctx: WebContext): Promise<void>;
|
|
421
523
|
}
|
|
422
|
-
export { Binary };
|