@sprucelabs/spruce-image-utils 12.0.46 → 12.1.1

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
@@ -2,3 +2,4 @@
2
2
 
3
3
  ## Useful links
4
4
  * [Spruce Developer Documentation: https://developer.spruce.ai](https://developer.spruce.ai)
5
+
@@ -3,6 +3,125 @@ import { default as SchemaEntity } from '@sprucelabs/schema';
3
3
  import * as SpruceSchema from '@sprucelabs/schema';
4
4
  import '@sprucelabs/spruce-event-utils';
5
5
  declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schemas.types' {
6
+ namespace SpruceSchemas.Files.v2022_05_13 {
7
+ interface SaveSettingsEmitTarget {
8
+ 'organizationId': string;
9
+ }
10
+ interface SaveSettingsEmitTargetSchema extends SpruceSchema.Schema {
11
+ id: 'saveSettingsEmitTarget';
12
+ version: 'v2022_05_13';
13
+ namespace: 'Files';
14
+ name: '';
15
+ fields: {
16
+ /** . */
17
+ 'organizationId': {
18
+ type: 'id';
19
+ isRequired: true;
20
+ options: undefined;
21
+ };
22
+ };
23
+ }
24
+ interface SaveSettingsEmitTargetEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitTargetSchema> {
25
+ }
26
+ }
27
+ namespace SpruceSchemas.Files.v2022_05_13 {
28
+ interface SaveSettingsEmitPayload {
29
+ 'awsAccessKeyId': string;
30
+ 'awsSecretAccessKey': string;
31
+ 'awsS3Bucket': string;
32
+ }
33
+ interface SaveSettingsEmitPayloadSchema extends SpruceSchema.Schema {
34
+ id: 'saveSettingsEmitPayload';
35
+ version: 'v2022_05_13';
36
+ namespace: 'Files';
37
+ name: '';
38
+ fields: {
39
+ /** . */
40
+ 'awsAccessKeyId': {
41
+ type: 'id';
42
+ isRequired: true;
43
+ options: undefined;
44
+ };
45
+ /** . */
46
+ 'awsSecretAccessKey': {
47
+ type: 'text';
48
+ isRequired: true;
49
+ options: undefined;
50
+ };
51
+ /** . */
52
+ 'awsS3Bucket': {
53
+ type: 'text';
54
+ isRequired: true;
55
+ options: undefined;
56
+ };
57
+ };
58
+ }
59
+ interface SaveSettingsEmitPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitPayloadSchema> {
60
+ }
61
+ }
62
+ namespace SpruceSchemas.Files.v2022_05_13 {
63
+ interface SaveSettingsEmitTargetAndPayload {
64
+ /** Source. */
65
+ 'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
66
+ 'target': SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitTarget;
67
+ 'payload': SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitPayload;
68
+ }
69
+ interface SaveSettingsEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
70
+ id: 'saveSettingsEmitTargetAndPayload';
71
+ version: 'v2022_05_13';
72
+ namespace: 'Files';
73
+ name: '';
74
+ fields: {
75
+ /** Source. */
76
+ 'source': {
77
+ label: 'Source';
78
+ type: 'schema';
79
+ options: {
80
+ schema: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSourceSchema;
81
+ };
82
+ };
83
+ /** . */
84
+ 'target': {
85
+ type: 'schema';
86
+ isRequired: true;
87
+ options: {
88
+ schema: SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitTargetSchema;
89
+ };
90
+ };
91
+ /** . */
92
+ 'payload': {
93
+ type: 'schema';
94
+ isRequired: true;
95
+ options: {
96
+ schema: SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitPayloadSchema;
97
+ };
98
+ };
99
+ };
100
+ }
101
+ interface SaveSettingsEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitTargetAndPayloadSchema> {
102
+ }
103
+ }
104
+ namespace SpruceSchemas.Files.v2022_05_13 {
105
+ interface SaveSettingsResponsePayload {
106
+ 'wasSuccessful': boolean;
107
+ }
108
+ interface SaveSettingsResponsePayloadSchema extends SpruceSchema.Schema {
109
+ id: 'saveSettingsResponsePayload';
110
+ version: 'v2022_05_13';
111
+ namespace: 'Files';
112
+ name: '';
113
+ fields: {
114
+ /** . */
115
+ 'wasSuccessful': {
116
+ type: 'boolean';
117
+ isRequired: true;
118
+ options: undefined;
119
+ };
120
+ };
121
+ }
122
+ interface SaveSettingsResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveSettingsResponsePayloadSchema> {
123
+ }
124
+ }
6
125
  namespace SpruceSchemas.Files.v2022_05_13 {
7
126
  interface UploadEmitTarget {
8
127
  'locationId'?: string | undefined | null;
@@ -3,6 +3,125 @@ import { default as SchemaEntity } from '@sprucelabs/schema';
3
3
  import * as SpruceSchema from '@sprucelabs/schema';
4
4
  import '@sprucelabs/spruce-event-utils';
5
5
  declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schemas.types' {
6
+ namespace SpruceSchemas.Files.v2022_05_13 {
7
+ interface SaveSettingsEmitTarget {
8
+ 'organizationId': string;
9
+ }
10
+ interface SaveSettingsEmitTargetSchema extends SpruceSchema.Schema {
11
+ id: 'saveSettingsEmitTarget';
12
+ version: 'v2022_05_13';
13
+ namespace: 'Files';
14
+ name: '';
15
+ fields: {
16
+ /** . */
17
+ 'organizationId': {
18
+ type: 'id';
19
+ isRequired: true;
20
+ options: undefined;
21
+ };
22
+ };
23
+ }
24
+ interface SaveSettingsEmitTargetEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitTargetSchema> {
25
+ }
26
+ }
27
+ namespace SpruceSchemas.Files.v2022_05_13 {
28
+ interface SaveSettingsEmitPayload {
29
+ 'awsAccessKeyId': string;
30
+ 'awsSecretAccessKey': string;
31
+ 'awsS3Bucket': string;
32
+ }
33
+ interface SaveSettingsEmitPayloadSchema extends SpruceSchema.Schema {
34
+ id: 'saveSettingsEmitPayload';
35
+ version: 'v2022_05_13';
36
+ namespace: 'Files';
37
+ name: '';
38
+ fields: {
39
+ /** . */
40
+ 'awsAccessKeyId': {
41
+ type: 'id';
42
+ isRequired: true;
43
+ options: undefined;
44
+ };
45
+ /** . */
46
+ 'awsSecretAccessKey': {
47
+ type: 'text';
48
+ isRequired: true;
49
+ options: undefined;
50
+ };
51
+ /** . */
52
+ 'awsS3Bucket': {
53
+ type: 'text';
54
+ isRequired: true;
55
+ options: undefined;
56
+ };
57
+ };
58
+ }
59
+ interface SaveSettingsEmitPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitPayloadSchema> {
60
+ }
61
+ }
62
+ namespace SpruceSchemas.Files.v2022_05_13 {
63
+ interface SaveSettingsEmitTargetAndPayload {
64
+ /** Source. */
65
+ 'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
66
+ 'target': SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitTarget;
67
+ 'payload': SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitPayload;
68
+ }
69
+ interface SaveSettingsEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
70
+ id: 'saveSettingsEmitTargetAndPayload';
71
+ version: 'v2022_05_13';
72
+ namespace: 'Files';
73
+ name: '';
74
+ fields: {
75
+ /** Source. */
76
+ 'source': {
77
+ label: 'Source';
78
+ type: 'schema';
79
+ options: {
80
+ schema: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSourceSchema;
81
+ };
82
+ };
83
+ /** . */
84
+ 'target': {
85
+ type: 'schema';
86
+ isRequired: true;
87
+ options: {
88
+ schema: SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitTargetSchema;
89
+ };
90
+ };
91
+ /** . */
92
+ 'payload': {
93
+ type: 'schema';
94
+ isRequired: true;
95
+ options: {
96
+ schema: SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitPayloadSchema;
97
+ };
98
+ };
99
+ };
100
+ }
101
+ interface SaveSettingsEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitTargetAndPayloadSchema> {
102
+ }
103
+ }
104
+ namespace SpruceSchemas.Files.v2022_05_13 {
105
+ interface SaveSettingsResponsePayload {
106
+ 'wasSuccessful': boolean;
107
+ }
108
+ interface SaveSettingsResponsePayloadSchema extends SpruceSchema.Schema {
109
+ id: 'saveSettingsResponsePayload';
110
+ version: 'v2022_05_13';
111
+ namespace: 'Files';
112
+ name: '';
113
+ fields: {
114
+ /** . */
115
+ 'wasSuccessful': {
116
+ type: 'boolean';
117
+ isRequired: true;
118
+ options: undefined;
119
+ };
120
+ };
121
+ }
122
+ interface SaveSettingsResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveSettingsResponsePayloadSchema> {
123
+ }
124
+ }
6
125
  namespace SpruceSchemas.Files.v2022_05_13 {
7
126
  interface UploadEmitTarget {
8
127
  'locationId'?: string | undefined | null;
@@ -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, ['base64', 'name']);
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, ['base64', 'name']);
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,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sprucelabs/spruce-image-utils",
3
3
  "description": "Support for working with images and Sprucebot. 📈",
4
- "version": "12.0.46",
4
+ "version": "12.1.1",
5
5
  "skill": {
6
6
  "namespace": "images"
7
7
  },