@sprucelabs/spruce-image-utils 12.0.45 → 12.1.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/README.md
CHANGED
|
@@ -17,6 +17,7 @@ export type UploadedImage = SpruceSchemas.Images.v2022_05_31.UploadResponsePaylo
|
|
|
17
17
|
export interface ImageUploadOptions {
|
|
18
18
|
base64: string;
|
|
19
19
|
name: string;
|
|
20
|
+
organizationId?: string;
|
|
20
21
|
}
|
|
21
22
|
type ImageUploaderConstructor = new () => ImageUploader;
|
|
22
23
|
export {};
|
|
@@ -22,8 +22,14 @@ export default class RemoteImageUploader {
|
|
|
22
22
|
}
|
|
23
23
|
upload(options) {
|
|
24
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
const { base64, name } = assertOptions(options, [
|
|
25
|
+
const { base64, name, organizationId } = assertOptions(options, [
|
|
26
|
+
'base64',
|
|
27
|
+
'name',
|
|
28
|
+
]);
|
|
26
29
|
const [image] = yield this.client.emitAndFlattenResponses('images.upload::v2022_05_31', {
|
|
30
|
+
target: {
|
|
31
|
+
organizationId,
|
|
32
|
+
},
|
|
27
33
|
payload: {
|
|
28
34
|
base64Body: base64,
|
|
29
35
|
name,
|
|
@@ -17,6 +17,7 @@ export type UploadedImage = SpruceSchemas.Images.v2022_05_31.UploadResponsePaylo
|
|
|
17
17
|
export interface ImageUploadOptions {
|
|
18
18
|
base64: string;
|
|
19
19
|
name: string;
|
|
20
|
+
organizationId?: string;
|
|
20
21
|
}
|
|
21
22
|
type ImageUploaderConstructor = new () => ImageUploader;
|
|
22
23
|
export {};
|
|
@@ -13,8 +13,14 @@ class RemoteImageUploader {
|
|
|
13
13
|
this.UploaderClass = Class;
|
|
14
14
|
}
|
|
15
15
|
async upload(options) {
|
|
16
|
-
const { base64, name } = (0, schema_1.assertOptions)(options, [
|
|
16
|
+
const { base64, name, organizationId } = (0, schema_1.assertOptions)(options, [
|
|
17
|
+
'base64',
|
|
18
|
+
'name',
|
|
19
|
+
]);
|
|
17
20
|
const [image] = await this.client.emitAndFlattenResponses('images.upload::v2022_05_31', {
|
|
21
|
+
target: {
|
|
22
|
+
organizationId,
|
|
23
|
+
},
|
|
18
24
|
payload: {
|
|
19
25
|
base64Body: base64,
|
|
20
26
|
name,
|