@silexpert/core 1.1.238 → 1.1.239
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/dist/cjs/api/resources/FIle.d.ts +2 -1
- package/dist/cjs/api/resources/FIle.d.ts.map +1 -1
- package/dist/cjs/api/resources/FIle.js +3 -0
- package/dist/cjs/api/resources/FIle.js.map +1 -1
- package/dist/mjs/api/resources/FIle.d.ts +2 -1
- package/dist/mjs/api/resources/FIle.d.ts.map +1 -1
- package/dist/mjs/api/resources/FIle.js +3 -0
- package/dist/mjs/api/resources/FIle.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/FIle.ts +5 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Resource } from '../Resource';
|
|
3
|
-
import { ReadFile, CreateFile } from '../../types';
|
|
3
|
+
import { ReadFile, CreateFile, IFile } from '../../types';
|
|
4
4
|
export declare class File extends Resource {
|
|
5
5
|
upload(params: Omit<CreateFile, 'file'>, file: File): Promise<ReadFile>;
|
|
6
6
|
get(id: number, idSociety: number): Promise<ReadFile>;
|
|
7
7
|
getBuffer(idSociety: number, id: number): Promise<Buffer>;
|
|
8
|
+
update(id: number, payload: Partial<IFile>): Promise<IFile>;
|
|
8
9
|
}
|
|
9
10
|
//# sourceMappingURL=FIle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FIle.d.ts","sourceRoot":"","sources":["../../../../ts/api/resources/FIle.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACL,QAAQ,EACR,UAAU,
|
|
1
|
+
{"version":3,"file":"FIle.d.ts","sourceRoot":"","sources":["../../../../ts/api/resources/FIle.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACL,QAAQ,EACR,UAAU,EACV,KAAK,EACN,MAAM,aAAa,CAAC;AAErB,qBAAa,IAAK,SAAQ,QAAQ;IAChC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC;IAcvE,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAIrD,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAIzD,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC;CAG5D"}
|
|
@@ -20,6 +20,9 @@ class File extends Resource_1.Resource {
|
|
|
20
20
|
getBuffer(idSociety, id) {
|
|
21
21
|
return this.axios.$get(`societies/${idSociety}/files/${id}/buffer`, { responseType: 'blob' });
|
|
22
22
|
}
|
|
23
|
+
update(id, payload) {
|
|
24
|
+
return this.axios.$patch(`files/${id}`, payload);
|
|
25
|
+
}
|
|
23
26
|
}
|
|
24
27
|
exports.File = File;
|
|
25
28
|
//# sourceMappingURL=FIle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FIle.js","sourceRoot":"","sources":["../../../../ts/api/resources/FIle.ts"],"names":[],"mappings":";;;AAAA,0CAAuC;
|
|
1
|
+
{"version":3,"file":"FIle.js","sourceRoot":"","sources":["../../../../ts/api/resources/FIle.ts"],"names":[],"mappings":";;;AAAA,0CAAuC;AAOvC,MAAa,IAAK,SAAQ,mBAAQ;IAChC,MAAM,CAAC,MAAgC,EAAE,IAAU;QACjD,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;QAEhC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;YAC9C,IAAI,KAAK,EAAE;gBACT,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;aAClC;QACH,CAAC,CAAC,CAAC;QAEH,aAAa;QACb,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC9B,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,qBAAqB,EAAE,EAAE,CAAC,CAAC;IACrG,CAAC;IAED,GAAG,CAAC,EAAU,EAAE,SAAiB;QAC/B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,SAAS,UAAU,EAAE,EAAE,CAAC,CAAC;IAC/D,CAAC;IAED,SAAS,CAAC,SAAiB,EAAE,EAAU;QACrC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,SAAS,UAAU,EAAE,SAAS,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC;IAChG,CAAC;IAED,MAAM,CAAC,EAAU,EAAE,OAAuB;QACxC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;CACF;AA1BD,oBA0BC","sourcesContent":["import { Resource } from '../Resource';\nimport {\n ReadFile,\n CreateFile,\n IFile,\n} from '../../types';\n\nexport class File extends Resource {\n upload(params: Omit<CreateFile, 'file'>, file: File): Promise<ReadFile> {\n const formData = new FormData();\n \n Object.entries(params).forEach(([key, value]) => {\n if (value) {\n formData.append(key, `${value}`);\n }\n });\n\n // @ts-ignore\n formData.append('file', file);\n return this.axios.$post('files', formData, { headers: { 'Content-Type': 'multipart/form-data' } });\n }\n\n get(id: number, idSociety: number): Promise<ReadFile> {\n return this.axios.$get(`societies/${idSociety}/files/${id}`);\n }\n\n getBuffer(idSociety: number, id: number): Promise<Buffer> {\n return this.axios.$get(`societies/${idSociety}/files/${id}/buffer`, { responseType: 'blob' });\n }\n\n update(id: number, payload: Partial<IFile>): Promise<IFile> {\n return this.axios.$patch(`files/${id}`, payload);\n }\n}"]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Resource } from '../Resource';
|
|
3
|
-
import { ReadFile, CreateFile } from '../../types';
|
|
3
|
+
import { ReadFile, CreateFile, IFile } from '../../types';
|
|
4
4
|
export declare class File extends Resource {
|
|
5
5
|
upload(params: Omit<CreateFile, 'file'>, file: File): Promise<ReadFile>;
|
|
6
6
|
get(id: number, idSociety: number): Promise<ReadFile>;
|
|
7
7
|
getBuffer(idSociety: number, id: number): Promise<Buffer>;
|
|
8
|
+
update(id: number, payload: Partial<IFile>): Promise<IFile>;
|
|
8
9
|
}
|
|
9
10
|
//# sourceMappingURL=FIle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FIle.d.ts","sourceRoot":"","sources":["../../../../ts/api/resources/FIle.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACL,QAAQ,EACR,UAAU,
|
|
1
|
+
{"version":3,"file":"FIle.d.ts","sourceRoot":"","sources":["../../../../ts/api/resources/FIle.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACL,QAAQ,EACR,UAAU,EACV,KAAK,EACN,MAAM,aAAa,CAAC;AAErB,qBAAa,IAAK,SAAQ,QAAQ;IAChC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC;IAcvE,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAIrD,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAIzD,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC;CAG5D"}
|
|
@@ -17,5 +17,8 @@ export class File extends Resource {
|
|
|
17
17
|
getBuffer(idSociety, id) {
|
|
18
18
|
return this.axios.$get(`societies/${idSociety}/files/${id}/buffer`, { responseType: 'blob' });
|
|
19
19
|
}
|
|
20
|
+
update(id, payload) {
|
|
21
|
+
return this.axios.$patch(`files/${id}`, payload);
|
|
22
|
+
}
|
|
20
23
|
}
|
|
21
24
|
//# sourceMappingURL=FIle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FIle.js","sourceRoot":"","sources":["../../../../ts/api/resources/FIle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"FIle.js","sourceRoot":"","sources":["../../../../ts/api/resources/FIle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAOvC,MAAM,OAAO,IAAK,SAAQ,QAAQ;IAChC,MAAM,CAAC,MAAgC,EAAE,IAAU;QACjD,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;QAEhC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;YAC9C,IAAI,KAAK,EAAE;gBACT,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;aAClC;QACH,CAAC,CAAC,CAAC;QAEH,aAAa;QACb,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC9B,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,qBAAqB,EAAE,EAAE,CAAC,CAAC;IACrG,CAAC;IAED,GAAG,CAAC,EAAU,EAAE,SAAiB;QAC/B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,SAAS,UAAU,EAAE,EAAE,CAAC,CAAC;IAC/D,CAAC;IAED,SAAS,CAAC,SAAiB,EAAE,EAAU;QACrC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,SAAS,UAAU,EAAE,SAAS,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC;IAChG,CAAC;IAED,MAAM,CAAC,EAAU,EAAE,OAAuB;QACxC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;CACF","sourcesContent":["import { Resource } from '../Resource';\nimport {\n ReadFile,\n CreateFile,\n IFile,\n} from '../../types';\n\nexport class File extends Resource {\n upload(params: Omit<CreateFile, 'file'>, file: File): Promise<ReadFile> {\n const formData = new FormData();\n \n Object.entries(params).forEach(([key, value]) => {\n if (value) {\n formData.append(key, `${value}`);\n }\n });\n\n // @ts-ignore\n formData.append('file', file);\n return this.axios.$post('files', formData, { headers: { 'Content-Type': 'multipart/form-data' } });\n }\n\n get(id: number, idSociety: number): Promise<ReadFile> {\n return this.axios.$get(`societies/${idSociety}/files/${id}`);\n }\n\n getBuffer(idSociety: number, id: number): Promise<Buffer> {\n return this.axios.$get(`societies/${idSociety}/files/${id}/buffer`, { responseType: 'blob' });\n }\n\n update(id: number, payload: Partial<IFile>): Promise<IFile> {\n return this.axios.$patch(`files/${id}`, payload);\n }\n}"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silexpert/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.239",
|
|
4
4
|
"description": "Silex Core perform HTTP Request and object binding. Silex core helps developers to retrieve and return formatted object",
|
|
5
5
|
"homepage": "https://gitlab.compta-clementine.fr/dev/silex-api",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
package/ts/api/resources/FIle.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Resource } from '../Resource';
|
|
|
2
2
|
import {
|
|
3
3
|
ReadFile,
|
|
4
4
|
CreateFile,
|
|
5
|
+
IFile,
|
|
5
6
|
} from '../../types';
|
|
6
7
|
|
|
7
8
|
export class File extends Resource {
|
|
@@ -26,4 +27,8 @@ export class File extends Resource {
|
|
|
26
27
|
getBuffer(idSociety: number, id: number): Promise<Buffer> {
|
|
27
28
|
return this.axios.$get(`societies/${idSociety}/files/${id}/buffer`, { responseType: 'blob' });
|
|
28
29
|
}
|
|
30
|
+
|
|
31
|
+
update(id: number, payload: Partial<IFile>): Promise<IFile> {
|
|
32
|
+
return this.axios.$patch(`files/${id}`, payload);
|
|
33
|
+
}
|
|
29
34
|
}
|