@machhub-dev/sdk-ts 1.0.11 → 1.0.12
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.
|
@@ -33,5 +33,5 @@ export declare class Collection {
|
|
|
33
33
|
create(data: Record<string, any>): Promise<any>;
|
|
34
34
|
update(id: string, data: Record<string, any>): Promise<any>;
|
|
35
35
|
delete(id: string): Promise<any>;
|
|
36
|
-
getFile(fileName: string, fieldName: string): Promise<Blob>;
|
|
36
|
+
getFile(fileName: string, fieldName: string, recordID: string): Promise<Blob>;
|
|
37
37
|
}
|
|
@@ -146,12 +146,13 @@ class Collection {
|
|
|
146
146
|
throw new CollectionError('delete', this.collectionName, error);
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
-
async getFile(fileName, fieldName) {
|
|
149
|
+
async getFile(fileName, fieldName, recordID) {
|
|
150
150
|
try {
|
|
151
151
|
return await this.httpService.request.withJSON({
|
|
152
152
|
fileName,
|
|
153
153
|
collectionName: this.collectionName,
|
|
154
|
-
fieldName
|
|
154
|
+
fieldName,
|
|
155
|
+
recordID
|
|
155
156
|
}).patch("file");
|
|
156
157
|
}
|
|
157
158
|
catch (error) {
|
|
@@ -33,5 +33,5 @@ export declare class Collection {
|
|
|
33
33
|
create(data: Record<string, any>): Promise<any>;
|
|
34
34
|
update(id: string, data: Record<string, any>): Promise<any>;
|
|
35
35
|
delete(id: string): Promise<any>;
|
|
36
|
-
getFile(fileName: string, fieldName: string): Promise<Blob>;
|
|
36
|
+
getFile(fileName: string, fieldName: string, recordID: string): Promise<Blob>;
|
|
37
37
|
}
|
|
@@ -142,12 +142,13 @@ export class Collection {
|
|
|
142
142
|
throw new CollectionError('delete', this.collectionName, error);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
async getFile(fileName, fieldName) {
|
|
145
|
+
async getFile(fileName, fieldName, recordID) {
|
|
146
146
|
try {
|
|
147
147
|
return await this.httpService.request.withJSON({
|
|
148
148
|
fileName,
|
|
149
149
|
collectionName: this.collectionName,
|
|
150
|
-
fieldName
|
|
150
|
+
fieldName,
|
|
151
|
+
recordID
|
|
151
152
|
}).patch("file");
|
|
152
153
|
}
|
|
153
154
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -170,12 +170,13 @@ export class Collection {
|
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
async getFile(fileName: string, fieldName: string): Promise<Blob> {
|
|
173
|
+
async getFile(fileName: string, fieldName: string, recordID: string): Promise<Blob> {
|
|
174
174
|
try {
|
|
175
175
|
return await this.httpService.request.withJSON({
|
|
176
176
|
fileName,
|
|
177
177
|
collectionName: this.collectionName,
|
|
178
|
-
fieldName
|
|
178
|
+
fieldName,
|
|
179
|
+
recordID
|
|
179
180
|
}).patch("file");
|
|
180
181
|
} catch (error) {
|
|
181
182
|
throw new CollectionError('getFile', this.collectionName, error as Error);
|