@webda/core 1.6.0-beta.3 → 2.0.0-beta.2
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 +355 -195
- package/lib/application.js +188 -682
- package/lib/application.js.map +1 -1
- package/lib/application.spec.js +109 -289
- package/lib/application.spec.js.map +1 -1
- package/lib/core.d.ts +150 -215
- package/lib/core.js +188 -71
- package/lib/core.js.map +1 -1
- package/lib/core.spec.js +103 -42
- package/lib/core.spec.js.map +1 -1
- package/lib/index.d.ts +4 -0
- package/lib/index.js +9 -1
- package/lib/index.js.map +1 -1
- package/lib/models/aclmodel.d.ts +3 -1
- package/lib/models/aclmodel.js +6 -3
- package/lib/models/aclmodel.js.map +1 -1
- package/lib/models/aclmodel.spec.js +10 -5
- package/lib/models/aclmodel.spec.js.map +1 -1
- package/lib/models/coremodel.d.ts +86 -24
- package/lib/models/coremodel.js +85 -36
- package/lib/models/coremodel.js.map +1 -1
- package/lib/models/coremodel.spec.js +21 -2
- package/lib/models/coremodel.spec.js.map +1 -1
- package/lib/models/ident.d.ts +7 -5
- package/lib/models/ident.js +2 -1
- package/lib/models/ident.js.map +1 -1
- package/lib/models/ident.spec.js +1 -1
- package/lib/models/ident.spec.js.map +1 -1
- package/lib/models/ownermodel.d.ts +18 -4
- package/lib/models/ownermodel.js +24 -4
- package/lib/models/ownermodel.js.map +1 -1
- package/lib/models/ownermodel.spec.js +18 -1
- package/lib/models/ownermodel.spec.js.map +1 -1
- package/lib/models/rolemodel.js.map +1 -1
- package/lib/models/rolemodel.spec.js +5 -2
- package/lib/models/rolemodel.spec.js.map +1 -1
- package/lib/models/user.d.ts +7 -6
- package/lib/models/user.js +2 -1
- package/lib/models/user.js.map +1 -1
- package/lib/models/user.spec.js +1 -1
- package/lib/models/user.spec.js.map +1 -1
- package/lib/queues/filequeue.d.ts +2 -7
- package/lib/queues/filequeue.js +4 -13
- package/lib/queues/filequeue.js.map +1 -1
- package/lib/queues/filequeue.spec.js +2 -3
- package/lib/queues/filequeue.spec.js.map +1 -1
- package/lib/queues/memoryqueue.d.ts +2 -7
- package/lib/queues/memoryqueue.js +1 -11
- package/lib/queues/memoryqueue.js.map +1 -1
- package/lib/queues/memoryqueue.spec.js +1 -1
- package/lib/queues/memoryqueue.spec.js.map +1 -1
- package/lib/queues/queue.spec.d.ts +1 -1
- package/lib/queues/queue.spec.js +12 -10
- package/lib/queues/queue.spec.js.map +1 -1
- package/lib/queues/queueservice.d.ts +1 -1
- package/lib/queues/queueservice.js +1 -1
- package/lib/queues/queueservice.js.map +1 -1
- package/lib/router.d.ts +52 -2
- package/lib/router.js +80 -51
- package/lib/router.js.map +1 -1
- package/lib/router.spec.js +23 -6
- package/lib/router.spec.js.map +1 -1
- package/lib/services/asyncevents.d.ts +1 -0
- package/lib/services/asyncevents.js +4 -3
- package/lib/services/asyncevents.js.map +1 -1
- package/lib/services/asyncevents.spec.js +2 -2
- package/lib/services/asyncevents.spec.js.map +1 -1
- package/lib/services/authentication.d.ts +39 -11
- package/lib/services/authentication.js +60 -55
- package/lib/services/authentication.js.map +1 -1
- package/lib/services/authentication.spec.js +2 -1
- package/lib/services/authentication.spec.js.map +1 -1
- package/lib/services/binary.d.ts +127 -65
- package/lib/services/binary.js +255 -98
- package/lib/services/binary.js.map +1 -1
- package/lib/services/binary.spec.d.ts +2 -1
- package/lib/services/binary.spec.js +101 -30
- package/lib/services/binary.spec.js.map +1 -1
- package/lib/services/cloudbinary.d.ts +67 -0
- package/lib/services/cloudbinary.js +178 -0
- package/lib/services/cloudbinary.js.map +1 -0
- package/lib/services/cloudbinary.spec.d.ts +13 -0
- package/lib/services/cloudbinary.spec.js +212 -0
- package/lib/services/cloudbinary.spec.js.map +1 -0
- package/lib/services/configuration.d.ts +7 -2
- package/lib/services/configuration.js +6 -5
- package/lib/services/configuration.js.map +1 -1
- package/lib/services/configuration.spec.js +3 -2
- package/lib/services/configuration.spec.js.map +1 -1
- package/lib/services/cron.d.ts +5 -6
- package/lib/services/cron.js +5 -12
- package/lib/services/cron.js.map +1 -1
- package/lib/services/cron.spec.js +3 -4
- package/lib/services/cron.spec.js.map +1 -1
- package/lib/services/debugmailer.d.ts +3 -5
- package/lib/services/debugmailer.js +3 -11
- package/lib/services/debugmailer.js.map +1 -1
- package/lib/services/debugmailer.spec.js +1 -1
- package/lib/services/debugmailer.spec.js.map +1 -1
- package/lib/services/echo.d.ts +3 -7
- package/lib/services/echo.js +1 -11
- package/lib/services/echo.js.map +1 -1
- package/lib/services/echo.spec.js +4 -3
- package/lib/services/echo.spec.js.map +1 -1
- package/lib/services/filebinary.d.ts +45 -16
- package/lib/services/filebinary.js +147 -50
- package/lib/services/filebinary.js.map +1 -1
- package/lib/services/filebinary.spec.d.ts +4 -2
- package/lib/services/filebinary.spec.js +50 -12
- package/lib/services/filebinary.spec.js.map +1 -1
- package/lib/services/fileconfiguration.d.ts +1 -5
- package/lib/services/fileconfiguration.js +3 -12
- package/lib/services/fileconfiguration.js.map +1 -1
- package/lib/services/fileconfiguration.spec.js +2 -2
- package/lib/services/fileconfiguration.spec.js.map +1 -1
- package/lib/services/invitationservice.d.ts +28 -4
- package/lib/services/invitationservice.js +9 -6
- package/lib/services/invitationservice.js.map +1 -1
- package/lib/services/invitationservice.spec.js +4 -3
- package/lib/services/invitationservice.spec.js.map +1 -1
- package/lib/services/kubernetesconfiguration.d.ts +3 -5
- package/lib/services/kubernetesconfiguration.js +7 -14
- package/lib/services/kubernetesconfiguration.js.map +1 -1
- package/lib/services/kubernetesconfiguration.spec.js +5 -5
- package/lib/services/kubernetesconfiguration.spec.js.map +1 -1
- package/lib/services/mailer.d.ts +1 -5
- package/lib/services/mailer.js +1 -10
- package/lib/services/mailer.js.map +1 -1
- package/lib/services/mailer.spec.js +3 -3
- package/lib/services/mailer.spec.js.map +1 -1
- package/lib/services/notificationservice.d.ts +2 -0
- package/lib/services/notificationservice.js +2 -0
- package/lib/services/notificationservice.js.map +1 -1
- package/lib/services/notificationservice.spec.js +2 -2
- package/lib/services/notificationservice.spec.js.map +1 -1
- package/lib/services/oauth.d.ts +8 -6
- package/lib/services/oauth.js +30 -14
- package/lib/services/oauth.js.map +1 -1
- package/lib/services/oauth.spec.js +11 -10
- package/lib/services/oauth.spec.js.map +1 -1
- package/lib/services/resource.d.ts +18 -5
- package/lib/services/resource.js +42 -23
- package/lib/services/resource.js.map +1 -1
- package/lib/services/resource.spec.js +4 -4
- package/lib/services/resource.spec.js.map +1 -1
- package/lib/services/service.d.ts +25 -25
- package/lib/services/service.js +21 -25
- package/lib/services/service.js.map +1 -1
- package/lib/services/service.spec.js +2 -2
- package/lib/services/service.spec.js.map +1 -1
- package/lib/services/version.d.ts +2 -5
- package/lib/services/version.js +1 -10
- package/lib/services/version.js.map +1 -1
- package/lib/services/version.spec.js +1 -1
- package/lib/services/version.spec.js.map +1 -1
- package/lib/stores/aggregator.d.ts +3 -5
- package/lib/stores/aggregator.js +3 -10
- package/lib/stores/aggregator.js.map +1 -1
- package/lib/stores/file.d.ts +15 -8
- package/lib/stores/file.js +21 -18
- package/lib/stores/file.js.map +1 -1
- package/lib/stores/file.spec.d.ts +3 -1
- package/lib/stores/file.spec.js +32 -8
- package/lib/stores/file.spec.js.map +1 -1
- package/lib/stores/mapper.d.ts +1 -5
- package/lib/stores/mapper.js +5 -13
- package/lib/stores/mapper.js.map +1 -1
- package/lib/stores/mapper.spec.js +2 -2
- package/lib/stores/mapper.spec.js.map +1 -1
- package/lib/stores/memory.d.ts +5 -9
- package/lib/stores/memory.js +5 -17
- package/lib/stores/memory.js.map +1 -1
- package/lib/stores/memory.spec.d.ts +2 -1
- package/lib/stores/memory.spec.js +36 -4
- package/lib/stores/memory.spec.js.map +1 -1
- package/lib/stores/store.d.ts +142 -29
- package/lib/stores/store.js +451 -82
- package/lib/stores/store.js.map +1 -1
- package/lib/stores/store.spec.d.ts +31 -4
- package/lib/stores/store.spec.js +206 -35
- package/lib/stores/store.spec.js.map +1 -1
- package/lib/stores/webdaql/WebdaQLLexer.d.ts +53 -0
- package/lib/stores/webdaql/WebdaQLLexer.js +290 -0
- package/lib/stores/webdaql/WebdaQLLexer.js.map +1 -0
- package/lib/stores/webdaql/WebdaQLParserLexer.d.ts +53 -0
- package/lib/stores/webdaql/WebdaQLParserLexer.js +290 -0
- package/lib/stores/webdaql/WebdaQLParserLexer.js.map +1 -0
- package/lib/stores/webdaql/WebdaQLParserListener.d.ts +284 -0
- package/lib/stores/webdaql/WebdaQLParserListener.js +4 -0
- package/lib/stores/webdaql/WebdaQLParserListener.js.map +1 -0
- package/lib/stores/webdaql/WebdaQLParserParser.d.ts +301 -0
- package/lib/stores/webdaql/WebdaQLParserParser.js +1781 -0
- package/lib/stores/webdaql/WebdaQLParserParser.js.map +1 -0
- package/lib/stores/webdaql/WebdaQLParserVisitor.d.ts +174 -0
- package/lib/stores/webdaql/WebdaQLParserVisitor.js +4 -0
- package/lib/stores/webdaql/WebdaQLParserVisitor.js.map +1 -0
- package/lib/stores/webdaql/query.d.ts +300 -0
- package/lib/stores/webdaql/query.js +471 -0
- package/lib/stores/webdaql/query.js.map +1 -0
- package/lib/stores/webdaql/query.spec.d.ts +1 -0
- package/lib/stores/webdaql/query.spec.js +136 -0
- package/lib/stores/webdaql/query.spec.js.map +1 -0
- package/lib/test.d.ts +54 -9
- package/lib/test.js +139 -25
- package/lib/test.js.map +1 -1
- package/lib/unpackedapplication.d.ts +66 -0
- package/lib/unpackedapplication.js +219 -0
- package/lib/unpackedapplication.js.map +1 -0
- package/lib/utils/abstractdeployer.spec.js +1 -1
- package/lib/utils/abstractdeployer.spec.js.map +1 -1
- package/lib/utils/context.d.ts +17 -58
- package/lib/utils/context.js +33 -124
- package/lib/utils/context.js.map +1 -1
- package/lib/utils/context.spec.js +52 -28
- package/lib/utils/context.spec.js.map +1 -1
- package/lib/utils/cookie.d.ts +6 -3
- package/lib/utils/cookie.js +9 -5
- package/lib/utils/cookie.js.map +1 -1
- package/lib/utils/cookie.spec.js +5 -5
- package/lib/utils/cookie.spec.js.map +1 -1
- package/lib/utils/httpcontext.d.ts +182 -0
- package/lib/utils/httpcontext.js +325 -0
- package/lib/utils/httpcontext.js.map +1 -0
- package/lib/utils/httpcontext.spec.d.ts +5 -0
- package/lib/utils/httpcontext.spec.js +90 -0
- package/lib/utils/httpcontext.spec.js.map +1 -0
- package/lib/utils/logger.d.ts +18 -5
- package/lib/utils/logger.js +17 -4
- package/lib/utils/logger.js.map +1 -1
- package/lib/utils/logger.spec.js.map +1 -1
- package/lib/utils/serializers.js +5 -1
- package/lib/utils/serializers.js.map +1 -1
- package/lib/utils/serializers.spec.js +3 -3
- package/lib/utils/serializers.spec.js.map +1 -1
- package/lib/utils/waiter.d.ts +1 -1
- package/lib/utils/waiter.js.map +1 -1
- package/lib/utils/waiter.spec.js +2 -2
- package/lib/utils/waiter.spec.js.map +1 -1
- package/package.json +25 -18
- package/test/config-file-no-reload.json +2 -1
- package/test/config-file-reload.json +2 -1
- package/test/config-kube-reload.json +2 -1
- package/test/config-reload.json +1 -1
- package/test/config.json +8 -11
- package/test/config.old.json +1 -1
- package/test/moddas/annotatedservice.js +1 -3
- package/test/moddas/debugmailer.js +2 -7
- package/test/moddas/fakeservice.js +1 -1
- package/test/moddas/voidstore.js +2 -4
- package/test/models/ident.js +1 -1
- package/test/models/task.js +1 -6
- package/webda.module.json +1124 -0
- package/test/config.old-default.json +0 -151
package/lib/services/binary.d.ts
CHANGED
|
@@ -9,20 +9,22 @@ import { Service, ServiceParameters } from "./service";
|
|
|
9
9
|
* Represent basic EventBinary
|
|
10
10
|
*/
|
|
11
11
|
export interface EventBinary {
|
|
12
|
-
object:
|
|
12
|
+
object: BinaryFileInfo;
|
|
13
13
|
service: Binary;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export interface EventBinaryGet extends EventBinary {
|
|
14
|
+
/**
|
|
15
|
+
* In case the Context is known
|
|
16
|
+
*/
|
|
17
|
+
context?: Context;
|
|
19
18
|
}
|
|
20
19
|
export interface EventBinaryUploadSuccess extends EventBinary {
|
|
21
20
|
target: CoreModel;
|
|
22
21
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Sent before metadata are updated to allow alteration of the modification
|
|
24
|
+
*/
|
|
25
|
+
export interface EventBinaryMetadataUpdate extends EventBinaryUploadSuccess {
|
|
26
|
+
target: CoreModel;
|
|
27
|
+
metadata: BinaryMetadata;
|
|
26
28
|
}
|
|
27
29
|
/**
|
|
28
30
|
* Emitted if binary does not exist
|
|
@@ -30,22 +32,42 @@ export interface EventBinaryCreate extends EventBinaryUploadSuccess {
|
|
|
30
32
|
export declare class BinaryNotFoundError extends WebdaError {
|
|
31
33
|
constructor(hash: string, storeName: string);
|
|
32
34
|
}
|
|
33
|
-
|
|
34
|
-
* Represent a file to store
|
|
35
|
-
*/
|
|
36
|
-
export interface BinaryFile {
|
|
35
|
+
export interface BinaryFileInfo {
|
|
37
36
|
/**
|
|
38
|
-
*
|
|
37
|
+
* Hash of the binary
|
|
39
38
|
*/
|
|
40
|
-
|
|
39
|
+
hash?: string;
|
|
41
40
|
/**
|
|
42
|
-
*
|
|
41
|
+
* Will be computed by the service
|
|
42
|
+
*
|
|
43
|
+
* hash of the content prefixed by 'WEBDA'
|
|
44
|
+
*/
|
|
45
|
+
challenge?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Size of the file
|
|
48
|
+
*/
|
|
49
|
+
size: number;
|
|
50
|
+
/**
|
|
51
|
+
* Name of the file
|
|
43
52
|
*/
|
|
44
|
-
|
|
53
|
+
name: string;
|
|
54
|
+
/**
|
|
55
|
+
* Mimetype
|
|
56
|
+
*/
|
|
57
|
+
mimetype: string;
|
|
58
|
+
/**
|
|
59
|
+
* Metadatas stored along with the binary
|
|
60
|
+
*/
|
|
61
|
+
metadata?: BinaryMetadata;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Represent a file to store
|
|
65
|
+
*/
|
|
66
|
+
export declare abstract class BinaryFile implements BinaryFileInfo {
|
|
45
67
|
/**
|
|
46
68
|
* Current name
|
|
47
69
|
*/
|
|
48
|
-
name
|
|
70
|
+
name: string;
|
|
49
71
|
/**
|
|
50
72
|
* Original name
|
|
51
73
|
*/
|
|
@@ -53,11 +75,11 @@ export interface BinaryFile {
|
|
|
53
75
|
/**
|
|
54
76
|
* Size of the binary
|
|
55
77
|
*/
|
|
56
|
-
size
|
|
78
|
+
size: number;
|
|
57
79
|
/**
|
|
58
80
|
* Mimetype of the binary
|
|
59
81
|
*/
|
|
60
|
-
mimetype
|
|
82
|
+
mimetype: string;
|
|
61
83
|
/**
|
|
62
84
|
* Will be computed by the service
|
|
63
85
|
*
|
|
@@ -70,13 +92,61 @@ export interface BinaryFile {
|
|
|
70
92
|
* hash of the content
|
|
71
93
|
*/
|
|
72
94
|
hash?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Metadatas stored along with the binary
|
|
97
|
+
*/
|
|
98
|
+
metadata?: BinaryMetadata;
|
|
99
|
+
constructor(info: BinaryFileInfo);
|
|
100
|
+
/**
|
|
101
|
+
* Retrieve a plain BinaryFileInfo object
|
|
102
|
+
* @returns
|
|
103
|
+
*/
|
|
104
|
+
toBinaryFileInfo(): BinaryFileInfo;
|
|
105
|
+
abstract get(): Promise<Readable>;
|
|
106
|
+
/**
|
|
107
|
+
* Create hashes
|
|
108
|
+
* @param buffer
|
|
109
|
+
* @returns
|
|
110
|
+
*/
|
|
111
|
+
getHashes(): Promise<{
|
|
112
|
+
hash: string;
|
|
113
|
+
challenge: string;
|
|
114
|
+
}>;
|
|
73
115
|
}
|
|
116
|
+
export declare class LocalBinaryFile extends BinaryFile {
|
|
117
|
+
/**
|
|
118
|
+
* Path on the hard drive
|
|
119
|
+
*/
|
|
120
|
+
path: string;
|
|
121
|
+
constructor(filePath: string);
|
|
122
|
+
/**
|
|
123
|
+
* @override
|
|
124
|
+
*/
|
|
125
|
+
get(): Promise<Readable>;
|
|
126
|
+
}
|
|
127
|
+
export declare class MemoryBinaryFile extends BinaryFile {
|
|
128
|
+
/**
|
|
129
|
+
* Content
|
|
130
|
+
*/
|
|
131
|
+
buffer: Buffer;
|
|
132
|
+
constructor(buffer: Buffer, info: BinaryFileInfo);
|
|
133
|
+
/**
|
|
134
|
+
* @override
|
|
135
|
+
*/
|
|
136
|
+
get(): Promise<Readable>;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Define the metadata for a Binary
|
|
140
|
+
*/
|
|
141
|
+
export declare type BinaryMetadata = {
|
|
142
|
+
[key: string]: any;
|
|
143
|
+
};
|
|
74
144
|
/**
|
|
75
145
|
* This is a map used to retrieve binary
|
|
76
146
|
*
|
|
77
147
|
* @class BinaryMap
|
|
78
148
|
*/
|
|
79
|
-
export declare class BinaryMap {
|
|
149
|
+
export declare class BinaryMap extends BinaryFile {
|
|
80
150
|
/**
|
|
81
151
|
* Current context
|
|
82
152
|
*/
|
|
@@ -85,19 +155,7 @@ export declare class BinaryMap {
|
|
|
85
155
|
* Link to the binary store
|
|
86
156
|
*/
|
|
87
157
|
__store: Binary;
|
|
88
|
-
|
|
89
|
-
* Hash of the binary
|
|
90
|
-
*/
|
|
91
|
-
hash: string;
|
|
92
|
-
/**
|
|
93
|
-
* Size of the file
|
|
94
|
-
*/
|
|
95
|
-
size: number;
|
|
96
|
-
/**
|
|
97
|
-
* Mimetype
|
|
98
|
-
*/
|
|
99
|
-
mime: string;
|
|
100
|
-
constructor(service: any, obj: any);
|
|
158
|
+
constructor(service: Binary, obj: BinaryFileInfo);
|
|
101
159
|
/**
|
|
102
160
|
* Prevent all the attributes starting with '__' to be serialized
|
|
103
161
|
* @returns
|
|
@@ -157,10 +215,25 @@ export declare class BinaryParameters extends ServiceParameters {
|
|
|
157
215
|
* Restrict DELETE
|
|
158
216
|
*/
|
|
159
217
|
delete?: boolean;
|
|
218
|
+
/**
|
|
219
|
+
* Restrict update of metadata
|
|
220
|
+
*/
|
|
221
|
+
metadata?: boolean;
|
|
160
222
|
};
|
|
161
223
|
};
|
|
162
|
-
constructor(params: any,
|
|
224
|
+
constructor(params: any, _service: Service);
|
|
163
225
|
}
|
|
226
|
+
export declare type BinaryEvents = {
|
|
227
|
+
/**
|
|
228
|
+
* Emitted when someone download a binary
|
|
229
|
+
*/
|
|
230
|
+
"Binary.Get": EventBinary;
|
|
231
|
+
"Binary.UploadSuccess": EventBinaryUploadSuccess;
|
|
232
|
+
"Binary.MetadataUpdate": EventBinaryMetadataUpdate;
|
|
233
|
+
"Binary.MetadataUpdated": EventBinaryUploadSuccess;
|
|
234
|
+
"Binary.Create": EventBinaryUploadSuccess;
|
|
235
|
+
"Binary.Delete": EventBinary;
|
|
236
|
+
};
|
|
164
237
|
/**
|
|
165
238
|
* This is an abstract service to represent a storage of files
|
|
166
239
|
* The binary allow you to expose this service as HTTP
|
|
@@ -184,7 +257,7 @@ export declare class BinaryParameters extends ServiceParameters {
|
|
|
184
257
|
* @abstract
|
|
185
258
|
* @class Binary
|
|
186
259
|
*/
|
|
187
|
-
declare abstract class Binary<T extends BinaryParameters = BinaryParameters> extends Service<T> implements MappingService<BinaryMap> {
|
|
260
|
+
declare abstract class Binary<T extends BinaryParameters = BinaryParameters, E extends BinaryEvents = BinaryEvents> extends Service<T, E> implements MappingService<BinaryMap> {
|
|
188
261
|
_lowercaseMaps: any;
|
|
189
262
|
/**
|
|
190
263
|
* When you store a binary to be able to retrieve it you need to store the information into another object
|
|
@@ -206,16 +279,14 @@ declare abstract class Binary<T extends BinaryParameters = BinaryParameters> ext
|
|
|
206
279
|
* @param {CoreModel} object The object uuid to get from the store
|
|
207
280
|
* @param {String} property The object property to add the file to
|
|
208
281
|
* @param {Object} file The file by itself
|
|
209
|
-
* @param {Object}
|
|
282
|
+
* @param {Object} metadata to add to the binary object
|
|
210
283
|
* @emits 'binaryCreate'
|
|
211
284
|
*/
|
|
212
|
-
abstract store(object: CoreModel, property: string, file: BinaryFile,
|
|
213
|
-
[key: string]: any;
|
|
214
|
-
}): Promise<void>;
|
|
285
|
+
abstract store(object: CoreModel, property: string, file: BinaryFile, metadata?: BinaryMetadata): Promise<void>;
|
|
215
286
|
/**
|
|
216
287
|
* The store can retrieve how many time a binary has been used
|
|
217
288
|
*/
|
|
218
|
-
abstract getUsageCount(hash:
|
|
289
|
+
abstract getUsageCount(hash: string): Promise<number>;
|
|
219
290
|
/**
|
|
220
291
|
* Delete a binary
|
|
221
292
|
*
|
|
@@ -256,15 +327,6 @@ declare abstract class Binary<T extends BinaryParameters = BinaryParameters> ext
|
|
|
256
327
|
* @returns
|
|
257
328
|
*/
|
|
258
329
|
initModel(obj: any): BinaryMap;
|
|
259
|
-
/**
|
|
260
|
-
* Create hashes
|
|
261
|
-
* @param buffer
|
|
262
|
-
* @returns
|
|
263
|
-
*/
|
|
264
|
-
_getHashes(buffer: Buffer): {
|
|
265
|
-
hash: string;
|
|
266
|
-
challenge: string;
|
|
267
|
-
};
|
|
268
330
|
/**
|
|
269
331
|
* Read a stream to a buffer
|
|
270
332
|
*
|
|
@@ -272,19 +334,17 @@ declare abstract class Binary<T extends BinaryParameters = BinaryParameters> ext
|
|
|
272
334
|
* @returns
|
|
273
335
|
*/
|
|
274
336
|
static streamToBuffer(stream: Readable): Promise<Buffer>;
|
|
275
|
-
/**
|
|
276
|
-
* Update the BinaryFile
|
|
277
|
-
* @param file
|
|
278
|
-
*/
|
|
279
|
-
_prepareInput(file: BinaryFile): void;
|
|
280
337
|
/**
|
|
281
338
|
* Check if a map is defined
|
|
282
339
|
*
|
|
283
340
|
* @param name
|
|
284
341
|
* @param property
|
|
285
342
|
*/
|
|
286
|
-
|
|
287
|
-
|
|
343
|
+
protected checkMap(name: string, property: string): void;
|
|
344
|
+
/**
|
|
345
|
+
* Ensure events are sent correctly after an upload and update the BinaryFileInfo in targetted object
|
|
346
|
+
*/
|
|
347
|
+
uploadSuccess(object: CoreModel, property: string, file: BinaryFileInfo): Promise<void>;
|
|
288
348
|
/**
|
|
289
349
|
* Cascade delete the object
|
|
290
350
|
*
|
|
@@ -306,20 +366,22 @@ declare abstract class Binary<T extends BinaryParameters = BinaryParameters> ext
|
|
|
306
366
|
* @param req
|
|
307
367
|
* @returns
|
|
308
368
|
*/
|
|
309
|
-
_getFile(req: Context):
|
|
369
|
+
_getFile(req: Context): Promise<BinaryFile>;
|
|
310
370
|
/**
|
|
311
|
-
*
|
|
371
|
+
* @override
|
|
312
372
|
*/
|
|
313
373
|
initRoutes(): void;
|
|
374
|
+
/**
|
|
375
|
+
* Init the Binary system routes
|
|
376
|
+
*
|
|
377
|
+
* Making sure parameters.expose exists prior
|
|
378
|
+
*/
|
|
379
|
+
_initRoutes(): void;
|
|
314
380
|
/**
|
|
315
381
|
* Return the name of the service for OpenAPI
|
|
316
382
|
* @returns
|
|
317
383
|
*/
|
|
318
384
|
protected getOperationName(): string;
|
|
319
|
-
/**
|
|
320
|
-
* This is used to allow subclasses to add more route
|
|
321
|
-
*/
|
|
322
|
-
_initRoutes(): boolean;
|
|
323
385
|
/**
|
|
324
386
|
* Based on the request parameter verify it match a known mapping
|
|
325
387
|
* @param ctx
|
|
@@ -331,14 +393,14 @@ declare abstract class Binary<T extends BinaryParameters = BinaryParameters> ext
|
|
|
331
393
|
*
|
|
332
394
|
* @param ctx
|
|
333
395
|
*/
|
|
334
|
-
putRedirectUrl(
|
|
396
|
+
putRedirectUrl(_ctx: Context): Promise<{
|
|
335
397
|
url: string;
|
|
336
398
|
method?: string;
|
|
337
399
|
}>;
|
|
338
400
|
/**
|
|
339
401
|
* Mechanism to add a data based on challenge
|
|
340
402
|
*/
|
|
341
|
-
httpChallenge(ctx: Context): Promise<void>;
|
|
403
|
+
httpChallenge(ctx: Context<BinaryFile>): Promise<void>;
|
|
342
404
|
/**
|
|
343
405
|
* Manage the different routes
|
|
344
406
|
* @param ctx
|