@sprucelabs/spruce-image-utils 10.0.0 → 10.0.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/build/.spruce/schemas/images/v2022_05_31/sizes.schema.js +9 -9
- package/build/.spruce/schemas/schemas.types.d.ts +90 -90
- package/build/.spruce/schemas/schemas.types.js +4 -0
- package/build/__tests__/support/FakeImageUploader.js +4 -5
- package/build/errors/SpruceError.js +1 -1
- package/build/esm/.spruce/schemas/images/v2022_05_31/sizes.schema.js +9 -9
- package/build/esm/.spruce/schemas/schemas.types.d.ts +90 -90
- package/build/esm/.spruce/schemas/schemas.types.js +4 -0
- package/build/uploading/RemoteImageUploader.js +2 -3
- package/package.json +1 -1
|
@@ -9,34 +9,34 @@ const sizesSchema = {
|
|
|
9
9
|
moduleToImportFromWhenRemote: '@sprucelabs/spruce-image-utils',
|
|
10
10
|
fields: {
|
|
11
11
|
/** uri of small sized image. */
|
|
12
|
-
sUri: {
|
|
12
|
+
'sUri': {
|
|
13
13
|
label: 'uri of small sized image',
|
|
14
14
|
type: 'text',
|
|
15
15
|
isRequired: true,
|
|
16
|
-
options: undefined
|
|
16
|
+
options: undefined
|
|
17
17
|
},
|
|
18
18
|
/** uri of medium sized image. */
|
|
19
|
-
mUri: {
|
|
19
|
+
'mUri': {
|
|
20
20
|
label: 'uri of medium sized image',
|
|
21
21
|
type: 'text',
|
|
22
22
|
isRequired: true,
|
|
23
|
-
options: undefined
|
|
23
|
+
options: undefined
|
|
24
24
|
},
|
|
25
25
|
/** uri of large sized image. */
|
|
26
|
-
lUri: {
|
|
26
|
+
'lUri': {
|
|
27
27
|
label: 'uri of large sized image',
|
|
28
28
|
type: 'text',
|
|
29
29
|
isRequired: true,
|
|
30
|
-
options: undefined
|
|
30
|
+
options: undefined
|
|
31
31
|
},
|
|
32
32
|
/** uri of XL sized image. */
|
|
33
|
-
xlUri: {
|
|
33
|
+
'xlUri': {
|
|
34
34
|
label: 'uri of XL sized image',
|
|
35
35
|
type: 'text',
|
|
36
36
|
isRequired: true,
|
|
37
|
-
options: undefined
|
|
37
|
+
options: undefined
|
|
38
38
|
},
|
|
39
|
-
}
|
|
39
|
+
}
|
|
40
40
|
};
|
|
41
41
|
schema_1.SchemaRegistry.getInstance().trackSchema(sizesSchema);
|
|
42
42
|
exports.default = sizesSchema;
|
|
@@ -5,9 +5,9 @@ import '@sprucelabs/spruce-event-utils';
|
|
|
5
5
|
declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schemas.types' {
|
|
6
6
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
|
7
7
|
interface UploadEmitTarget {
|
|
8
|
-
locationId?: string | undefined | null;
|
|
9
|
-
organizationId?: string | undefined | null;
|
|
10
|
-
filePersonId?: string | undefined | null;
|
|
8
|
+
'locationId'?: string | undefined | null;
|
|
9
|
+
'organizationId'?: string | undefined | null;
|
|
10
|
+
'filePersonId'?: string | undefined | null;
|
|
11
11
|
}
|
|
12
12
|
interface UploadEmitTargetSchema extends SpruceSchema.Schema {
|
|
13
13
|
id: 'uploadEmitTarget';
|
|
@@ -16,17 +16,17 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
16
16
|
name: '';
|
|
17
17
|
fields: {
|
|
18
18
|
/** . */
|
|
19
|
-
locationId: {
|
|
19
|
+
'locationId': {
|
|
20
20
|
type: 'id';
|
|
21
21
|
options: undefined;
|
|
22
22
|
};
|
|
23
23
|
/** . */
|
|
24
|
-
organizationId: {
|
|
24
|
+
'organizationId': {
|
|
25
25
|
type: 'id';
|
|
26
26
|
options: undefined;
|
|
27
27
|
};
|
|
28
28
|
/** . */
|
|
29
|
-
filePersonId: {
|
|
29
|
+
'filePersonId': {
|
|
30
30
|
type: 'text';
|
|
31
31
|
options: undefined;
|
|
32
32
|
};
|
|
@@ -37,8 +37,8 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
37
37
|
}
|
|
38
38
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
|
39
39
|
interface UploadEmitPayload {
|
|
40
|
-
base64Body: string;
|
|
41
|
-
name: string;
|
|
40
|
+
'base64Body': string;
|
|
41
|
+
'name': string;
|
|
42
42
|
}
|
|
43
43
|
interface UploadEmitPayloadSchema extends SpruceSchema.Schema {
|
|
44
44
|
id: 'uploadEmitPayload';
|
|
@@ -47,13 +47,13 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
47
47
|
name: '';
|
|
48
48
|
fields: {
|
|
49
49
|
/** . */
|
|
50
|
-
base64Body: {
|
|
50
|
+
'base64Body': {
|
|
51
51
|
type: 'text';
|
|
52
52
|
isRequired: true;
|
|
53
53
|
options: undefined;
|
|
54
54
|
};
|
|
55
55
|
/** . */
|
|
56
|
-
name: {
|
|
56
|
+
'name': {
|
|
57
57
|
type: 'text';
|
|
58
58
|
isRequired: true;
|
|
59
59
|
options: undefined;
|
|
@@ -66,9 +66,9 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
66
66
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
|
67
67
|
interface UploadEmitTargetAndPayload {
|
|
68
68
|
/** Source. */
|
|
69
|
-
source?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
|
|
70
|
-
target?: SpruceSchemas.Files.v2022_05_13.UploadEmitTarget | undefined | null;
|
|
71
|
-
payload: SpruceSchemas.Files.v2022_05_13.UploadEmitPayload;
|
|
69
|
+
'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
|
|
70
|
+
'target'?: SpruceSchemas.Files.v2022_05_13.UploadEmitTarget | undefined | null;
|
|
71
|
+
'payload': SpruceSchemas.Files.v2022_05_13.UploadEmitPayload;
|
|
72
72
|
}
|
|
73
73
|
interface UploadEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
|
|
74
74
|
id: 'uploadEmitTargetAndPayload';
|
|
@@ -77,7 +77,7 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
77
77
|
name: '';
|
|
78
78
|
fields: {
|
|
79
79
|
/** Source. */
|
|
80
|
-
source: {
|
|
80
|
+
'source': {
|
|
81
81
|
label: 'Source';
|
|
82
82
|
type: 'schema';
|
|
83
83
|
options: {
|
|
@@ -85,14 +85,14 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
85
85
|
};
|
|
86
86
|
};
|
|
87
87
|
/** . */
|
|
88
|
-
target: {
|
|
88
|
+
'target': {
|
|
89
89
|
type: 'schema';
|
|
90
90
|
options: {
|
|
91
91
|
schema: SpruceSchemas.Files.v2022_05_13.UploadEmitTargetSchema;
|
|
92
92
|
};
|
|
93
93
|
};
|
|
94
94
|
/** . */
|
|
95
|
-
payload: {
|
|
95
|
+
'payload': {
|
|
96
96
|
type: 'schema';
|
|
97
97
|
isRequired: true;
|
|
98
98
|
options: {
|
|
@@ -106,9 +106,9 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
106
106
|
}
|
|
107
107
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
|
108
108
|
interface UploadResponsePayload {
|
|
109
|
-
id: string;
|
|
110
|
-
uri: string;
|
|
111
|
-
type: string;
|
|
109
|
+
'id': string;
|
|
110
|
+
'uri': string;
|
|
111
|
+
'type': string;
|
|
112
112
|
}
|
|
113
113
|
interface UploadResponsePayloadSchema extends SpruceSchema.Schema {
|
|
114
114
|
id: 'uploadResponsePayload';
|
|
@@ -117,19 +117,19 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
117
117
|
name: '';
|
|
118
118
|
fields: {
|
|
119
119
|
/** . */
|
|
120
|
-
id: {
|
|
120
|
+
'id': {
|
|
121
121
|
type: 'id';
|
|
122
122
|
isRequired: true;
|
|
123
123
|
options: undefined;
|
|
124
124
|
};
|
|
125
125
|
/** . */
|
|
126
|
-
uri: {
|
|
126
|
+
'uri': {
|
|
127
127
|
type: 'text';
|
|
128
128
|
isRequired: true;
|
|
129
129
|
options: undefined;
|
|
130
130
|
};
|
|
131
131
|
/** . */
|
|
132
|
-
type: {
|
|
132
|
+
'type': {
|
|
133
133
|
type: 'text';
|
|
134
134
|
isRequired: true;
|
|
135
135
|
options: undefined;
|
|
@@ -141,9 +141,9 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
141
141
|
}
|
|
142
142
|
namespace SpruceSchemas.Images.v2022_05_31 {
|
|
143
143
|
interface UploadEmitTarget {
|
|
144
|
-
locationId?: string | undefined | null;
|
|
145
|
-
organizationId?: string | undefined | null;
|
|
146
|
-
imagePersonId?: string | undefined | null;
|
|
144
|
+
'locationId'?: string | undefined | null;
|
|
145
|
+
'organizationId'?: string | undefined | null;
|
|
146
|
+
'imagePersonId'?: string | undefined | null;
|
|
147
147
|
}
|
|
148
148
|
interface UploadEmitTargetSchema extends SpruceSchema.Schema {
|
|
149
149
|
id: 'uploadEmitTarget';
|
|
@@ -152,17 +152,17 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
152
152
|
name: '';
|
|
153
153
|
fields: {
|
|
154
154
|
/** . */
|
|
155
|
-
locationId: {
|
|
155
|
+
'locationId': {
|
|
156
156
|
type: 'id';
|
|
157
157
|
options: undefined;
|
|
158
158
|
};
|
|
159
159
|
/** . */
|
|
160
|
-
organizationId: {
|
|
160
|
+
'organizationId': {
|
|
161
161
|
type: 'id';
|
|
162
162
|
options: undefined;
|
|
163
163
|
};
|
|
164
164
|
/** . */
|
|
165
|
-
imagePersonId: {
|
|
165
|
+
'imagePersonId': {
|
|
166
166
|
type: 'text';
|
|
167
167
|
options: undefined;
|
|
168
168
|
};
|
|
@@ -173,8 +173,8 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
173
173
|
}
|
|
174
174
|
namespace SpruceSchemas.Images.v2022_05_31 {
|
|
175
175
|
interface UploadEmitPayload {
|
|
176
|
-
base64Body: string;
|
|
177
|
-
name: string;
|
|
176
|
+
'base64Body': string;
|
|
177
|
+
'name': string;
|
|
178
178
|
}
|
|
179
179
|
interface UploadEmitPayloadSchema extends SpruceSchema.Schema {
|
|
180
180
|
id: 'uploadEmitPayload';
|
|
@@ -183,13 +183,13 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
183
183
|
name: '';
|
|
184
184
|
fields: {
|
|
185
185
|
/** . */
|
|
186
|
-
base64Body: {
|
|
186
|
+
'base64Body': {
|
|
187
187
|
type: 'text';
|
|
188
188
|
isRequired: true;
|
|
189
189
|
options: undefined;
|
|
190
190
|
};
|
|
191
191
|
/** . */
|
|
192
|
-
name: {
|
|
192
|
+
'name': {
|
|
193
193
|
type: 'text';
|
|
194
194
|
isRequired: true;
|
|
195
195
|
options: undefined;
|
|
@@ -202,9 +202,9 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
202
202
|
namespace SpruceSchemas.Images.v2022_05_31 {
|
|
203
203
|
interface UploadEmitTargetAndPayload {
|
|
204
204
|
/** Source. */
|
|
205
|
-
source?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
|
|
206
|
-
target?: SpruceSchemas.Images.v2022_05_31.UploadEmitTarget | undefined | null;
|
|
207
|
-
payload: SpruceSchemas.Images.v2022_05_31.UploadEmitPayload;
|
|
205
|
+
'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
|
|
206
|
+
'target'?: SpruceSchemas.Images.v2022_05_31.UploadEmitTarget | undefined | null;
|
|
207
|
+
'payload': SpruceSchemas.Images.v2022_05_31.UploadEmitPayload;
|
|
208
208
|
}
|
|
209
209
|
interface UploadEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
|
|
210
210
|
id: 'uploadEmitTargetAndPayload';
|
|
@@ -213,7 +213,7 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
213
213
|
name: '';
|
|
214
214
|
fields: {
|
|
215
215
|
/** Source. */
|
|
216
|
-
source: {
|
|
216
|
+
'source': {
|
|
217
217
|
label: 'Source';
|
|
218
218
|
type: 'schema';
|
|
219
219
|
options: {
|
|
@@ -221,14 +221,14 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
221
221
|
};
|
|
222
222
|
};
|
|
223
223
|
/** . */
|
|
224
|
-
target: {
|
|
224
|
+
'target': {
|
|
225
225
|
type: 'schema';
|
|
226
226
|
options: {
|
|
227
227
|
schema: SpruceSchemas.Images.v2022_05_31.UploadEmitTargetSchema;
|
|
228
228
|
};
|
|
229
229
|
};
|
|
230
230
|
/** . */
|
|
231
|
-
payload: {
|
|
231
|
+
'payload': {
|
|
232
232
|
type: 'schema';
|
|
233
233
|
isRequired: true;
|
|
234
234
|
options: {
|
|
@@ -242,9 +242,9 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
242
242
|
}
|
|
243
243
|
namespace SpruceSchemas.Images.v2022_05_31 {
|
|
244
244
|
interface UploadResponsePayload {
|
|
245
|
-
id: string;
|
|
246
|
-
type: string;
|
|
247
|
-
sizes: SpruceSchemas.Images.v2022_05_31.Sizes;
|
|
245
|
+
'id': string;
|
|
246
|
+
'type': string;
|
|
247
|
+
'sizes': SpruceSchemas.Images.v2022_05_31.Sizes;
|
|
248
248
|
}
|
|
249
249
|
interface UploadResponsePayloadSchema extends SpruceSchema.Schema {
|
|
250
250
|
id: 'uploadResponsePayload';
|
|
@@ -253,19 +253,19 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
253
253
|
name: '';
|
|
254
254
|
fields: {
|
|
255
255
|
/** . */
|
|
256
|
-
id: {
|
|
256
|
+
'id': {
|
|
257
257
|
type: 'id';
|
|
258
258
|
isRequired: true;
|
|
259
259
|
options: undefined;
|
|
260
260
|
};
|
|
261
261
|
/** . */
|
|
262
|
-
type: {
|
|
262
|
+
'type': {
|
|
263
263
|
type: 'text';
|
|
264
264
|
isRequired: true;
|
|
265
265
|
options: undefined;
|
|
266
266
|
};
|
|
267
267
|
/** . */
|
|
268
|
-
sizes: {
|
|
268
|
+
'sizes': {
|
|
269
269
|
type: 'schema';
|
|
270
270
|
isRequired: true;
|
|
271
271
|
options: {
|
|
@@ -279,12 +279,12 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
279
279
|
}
|
|
280
280
|
namespace SpruceSchemas.Images.v2022_05_31 {
|
|
281
281
|
interface UploadEventTarget {
|
|
282
|
-
imagePersonId?: string | undefined | null;
|
|
283
|
-
locationId?: string | undefined | null;
|
|
284
|
-
personId?: string | undefined | null;
|
|
285
|
-
organizationId?: string | undefined | null;
|
|
286
|
-
skillId?: string | undefined | null;
|
|
287
|
-
roleId?: string | undefined | null;
|
|
282
|
+
'imagePersonId'?: string | undefined | null;
|
|
283
|
+
'locationId'?: string | undefined | null;
|
|
284
|
+
'personId'?: string | undefined | null;
|
|
285
|
+
'organizationId'?: string | undefined | null;
|
|
286
|
+
'skillId'?: string | undefined | null;
|
|
287
|
+
'roleId'?: string | undefined | null;
|
|
288
288
|
}
|
|
289
289
|
interface UploadEventTargetSchema extends SpruceSchema.Schema {
|
|
290
290
|
id: 'uploadEventTarget';
|
|
@@ -294,32 +294,32 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
294
294
|
moduleToImportFromWhenRemote: '@sprucelabs/spruce-image-utils';
|
|
295
295
|
fields: {
|
|
296
296
|
/** . */
|
|
297
|
-
imagePersonId: {
|
|
297
|
+
'imagePersonId': {
|
|
298
298
|
type: 'text';
|
|
299
299
|
options: undefined;
|
|
300
300
|
};
|
|
301
301
|
/** . */
|
|
302
|
-
locationId: {
|
|
302
|
+
'locationId': {
|
|
303
303
|
type: 'id';
|
|
304
304
|
options: undefined;
|
|
305
305
|
};
|
|
306
306
|
/** . */
|
|
307
|
-
personId: {
|
|
307
|
+
'personId': {
|
|
308
308
|
type: 'id';
|
|
309
309
|
options: undefined;
|
|
310
310
|
};
|
|
311
311
|
/** . */
|
|
312
|
-
organizationId: {
|
|
312
|
+
'organizationId': {
|
|
313
313
|
type: 'id';
|
|
314
314
|
options: undefined;
|
|
315
315
|
};
|
|
316
316
|
/** . */
|
|
317
|
-
skillId: {
|
|
317
|
+
'skillId': {
|
|
318
318
|
type: 'id';
|
|
319
319
|
options: undefined;
|
|
320
320
|
};
|
|
321
321
|
/** . */
|
|
322
|
-
roleId: {
|
|
322
|
+
'roleId': {
|
|
323
323
|
type: 'id';
|
|
324
324
|
options: undefined;
|
|
325
325
|
};
|
|
@@ -330,13 +330,13 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
330
330
|
}
|
|
331
331
|
namespace SpruceSchemas.Images.v2022_05_31 {
|
|
332
332
|
interface UploadEventSource {
|
|
333
|
-
locationId?: string | undefined | null;
|
|
334
|
-
personId?: string | undefined | null;
|
|
335
|
-
organizationId?: string | undefined | null;
|
|
336
|
-
skillId?: string | undefined | null;
|
|
337
|
-
roleId?: string | undefined | null;
|
|
333
|
+
'locationId'?: string | undefined | null;
|
|
334
|
+
'personId'?: string | undefined | null;
|
|
335
|
+
'organizationId'?: string | undefined | null;
|
|
336
|
+
'skillId'?: string | undefined | null;
|
|
337
|
+
'roleId'?: string | undefined | null;
|
|
338
338
|
/** Proxy token. */
|
|
339
|
-
proxyToken?: string | undefined | null;
|
|
339
|
+
'proxyToken'?: string | undefined | null;
|
|
340
340
|
}
|
|
341
341
|
interface UploadEventSourceSchema extends SpruceSchema.Schema {
|
|
342
342
|
id: 'uploadEventSource';
|
|
@@ -346,32 +346,32 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
346
346
|
moduleToImportFromWhenRemote: '@sprucelabs/spruce-image-utils';
|
|
347
347
|
fields: {
|
|
348
348
|
/** . */
|
|
349
|
-
locationId: {
|
|
349
|
+
'locationId': {
|
|
350
350
|
type: 'id';
|
|
351
351
|
options: undefined;
|
|
352
352
|
};
|
|
353
353
|
/** . */
|
|
354
|
-
personId: {
|
|
354
|
+
'personId': {
|
|
355
355
|
type: 'id';
|
|
356
356
|
options: undefined;
|
|
357
357
|
};
|
|
358
358
|
/** . */
|
|
359
|
-
organizationId: {
|
|
359
|
+
'organizationId': {
|
|
360
360
|
type: 'id';
|
|
361
361
|
options: undefined;
|
|
362
362
|
};
|
|
363
363
|
/** . */
|
|
364
|
-
skillId: {
|
|
364
|
+
'skillId': {
|
|
365
365
|
type: 'id';
|
|
366
366
|
options: undefined;
|
|
367
367
|
};
|
|
368
368
|
/** . */
|
|
369
|
-
roleId: {
|
|
369
|
+
'roleId': {
|
|
370
370
|
type: 'id';
|
|
371
371
|
options: undefined;
|
|
372
372
|
};
|
|
373
373
|
/** Proxy token. */
|
|
374
|
-
proxyToken: {
|
|
374
|
+
'proxyToken': {
|
|
375
375
|
label: 'Proxy token';
|
|
376
376
|
type: 'id';
|
|
377
377
|
options: undefined;
|
|
@@ -384,13 +384,13 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
384
384
|
namespace SpruceSchemas.Images.v2022_05_31 {
|
|
385
385
|
interface Sizes {
|
|
386
386
|
/** uri of small sized image. */
|
|
387
|
-
sUri: string;
|
|
387
|
+
'sUri': string;
|
|
388
388
|
/** uri of medium sized image. */
|
|
389
|
-
mUri: string;
|
|
389
|
+
'mUri': string;
|
|
390
390
|
/** uri of large sized image. */
|
|
391
|
-
lUri: string;
|
|
391
|
+
'lUri': string;
|
|
392
392
|
/** uri of XL sized image. */
|
|
393
|
-
xlUri: string;
|
|
393
|
+
'xlUri': string;
|
|
394
394
|
}
|
|
395
395
|
interface SizesSchema extends SpruceSchema.Schema {
|
|
396
396
|
id: 'sizes';
|
|
@@ -400,28 +400,28 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
400
400
|
moduleToImportFromWhenRemote: '@sprucelabs/spruce-image-utils';
|
|
401
401
|
fields: {
|
|
402
402
|
/** uri of small sized image. */
|
|
403
|
-
sUri: {
|
|
403
|
+
'sUri': {
|
|
404
404
|
label: 'uri of small sized image';
|
|
405
405
|
type: 'text';
|
|
406
406
|
isRequired: true;
|
|
407
407
|
options: undefined;
|
|
408
408
|
};
|
|
409
409
|
/** uri of medium sized image. */
|
|
410
|
-
mUri: {
|
|
410
|
+
'mUri': {
|
|
411
411
|
label: 'uri of medium sized image';
|
|
412
412
|
type: 'text';
|
|
413
413
|
isRequired: true;
|
|
414
414
|
options: undefined;
|
|
415
415
|
};
|
|
416
416
|
/** uri of large sized image. */
|
|
417
|
-
lUri: {
|
|
417
|
+
'lUri': {
|
|
418
418
|
label: 'uri of large sized image';
|
|
419
419
|
type: 'text';
|
|
420
420
|
isRequired: true;
|
|
421
421
|
options: undefined;
|
|
422
422
|
};
|
|
423
423
|
/** uri of XL sized image. */
|
|
424
|
-
xlUri: {
|
|
424
|
+
'xlUri': {
|
|
425
425
|
label: 'uri of XL sized image';
|
|
426
426
|
type: 'text';
|
|
427
427
|
isRequired: true;
|
|
@@ -434,15 +434,15 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
434
434
|
}
|
|
435
435
|
namespace SpruceSchemas.Images.v2022_05_31 {
|
|
436
436
|
interface Image {
|
|
437
|
-
id: string;
|
|
437
|
+
'id': string;
|
|
438
438
|
/** Name. */
|
|
439
|
-
name: string;
|
|
439
|
+
'name': string;
|
|
440
440
|
/** original base 64. */
|
|
441
|
-
originalBase64: string;
|
|
442
|
-
type: string;
|
|
443
|
-
sizes: SpruceSchemas.Images.v2022_05_31.Sizes;
|
|
444
|
-
source: SpruceSchemas.Images.v2022_05_31.UploadEventSource;
|
|
445
|
-
target: SpruceSchemas.Images.v2022_05_31.UploadEventTarget;
|
|
441
|
+
'originalBase64': string;
|
|
442
|
+
'type': string;
|
|
443
|
+
'sizes': SpruceSchemas.Images.v2022_05_31.Sizes;
|
|
444
|
+
'source': SpruceSchemas.Images.v2022_05_31.UploadEventSource;
|
|
445
|
+
'target': SpruceSchemas.Images.v2022_05_31.UploadEventTarget;
|
|
446
446
|
}
|
|
447
447
|
interface ImageSchema extends SpruceSchema.Schema {
|
|
448
448
|
id: 'image';
|
|
@@ -452,33 +452,33 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
452
452
|
moduleToImportFromWhenRemote: '@sprucelabs/spruce-image-utils';
|
|
453
453
|
fields: {
|
|
454
454
|
/** . */
|
|
455
|
-
id: {
|
|
455
|
+
'id': {
|
|
456
456
|
type: 'id';
|
|
457
457
|
isRequired: true;
|
|
458
458
|
options: undefined;
|
|
459
459
|
};
|
|
460
460
|
/** Name. */
|
|
461
|
-
name: {
|
|
461
|
+
'name': {
|
|
462
462
|
label: 'Name';
|
|
463
463
|
type: 'text';
|
|
464
464
|
isRequired: true;
|
|
465
465
|
options: undefined;
|
|
466
466
|
};
|
|
467
467
|
/** original base 64. */
|
|
468
|
-
originalBase64: {
|
|
468
|
+
'originalBase64': {
|
|
469
469
|
label: 'original base 64';
|
|
470
470
|
type: 'text';
|
|
471
471
|
isRequired: true;
|
|
472
472
|
options: undefined;
|
|
473
473
|
};
|
|
474
474
|
/** . */
|
|
475
|
-
type: {
|
|
475
|
+
'type': {
|
|
476
476
|
type: 'text';
|
|
477
477
|
isRequired: true;
|
|
478
478
|
options: undefined;
|
|
479
479
|
};
|
|
480
480
|
/** . */
|
|
481
|
-
sizes: {
|
|
481
|
+
'sizes': {
|
|
482
482
|
type: 'schema';
|
|
483
483
|
isRequired: true;
|
|
484
484
|
options: {
|
|
@@ -486,7 +486,7 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
486
486
|
};
|
|
487
487
|
};
|
|
488
488
|
/** . */
|
|
489
|
-
source: {
|
|
489
|
+
'source': {
|
|
490
490
|
type: 'schema';
|
|
491
491
|
isPrivate: true;
|
|
492
492
|
isRequired: true;
|
|
@@ -495,7 +495,7 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
495
495
|
};
|
|
496
496
|
};
|
|
497
497
|
/** . */
|
|
498
|
-
target: {
|
|
498
|
+
'target': {
|
|
499
499
|
type: 'schema';
|
|
500
500
|
isPrivate: true;
|
|
501
501
|
isRequired: true;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-namespace */
|
|
3
|
+
/* eslint-disable no-redeclare */
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
5
|
+
/* eslint-disable import/order */
|
|
2
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
7
|
require("@sprucelabs/spruce-event-utils");
|
|
@@ -7,9 +7,6 @@ exports.generateUploadedImageValues = void 0;
|
|
|
7
7
|
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
8
8
|
const SpruceError_1 = __importDefault(require("../../errors/SpruceError"));
|
|
9
9
|
class FakeImageUploader {
|
|
10
|
-
static _lastUploadOptions;
|
|
11
|
-
static _isInitialized = false;
|
|
12
|
-
static _shouldThrow = false;
|
|
13
10
|
static set lastUploadOptions(options) {
|
|
14
11
|
test_utils_1.assert.isTrue(this._isInitialized, `You gotta call FakeImageUploader.beforeEach() in your test!`);
|
|
15
12
|
this._lastUploadOptions = options;
|
|
@@ -25,20 +22,22 @@ class FakeImageUploader {
|
|
|
25
22
|
static makeThrowWithInvalidImage() {
|
|
26
23
|
this._shouldThrow = true;
|
|
27
24
|
}
|
|
28
|
-
static fakeUploadedImage;
|
|
29
25
|
async upload(options) {
|
|
26
|
+
var _a;
|
|
30
27
|
if (FakeImageUploader._shouldThrow) {
|
|
31
28
|
throw new SpruceError_1.default({
|
|
32
29
|
code: 'INVALID_IMAGE',
|
|
33
30
|
});
|
|
34
31
|
}
|
|
35
32
|
FakeImageUploader.lastUploadOptions = options;
|
|
36
|
-
return (FakeImageUploader.fakeUploadedImage
|
|
33
|
+
return ((_a = FakeImageUploader.fakeUploadedImage) !== null && _a !== void 0 ? _a : generateUploadedImageValues());
|
|
37
34
|
}
|
|
38
35
|
static setUploadResponse(image) {
|
|
39
36
|
this.fakeUploadedImage = image;
|
|
40
37
|
}
|
|
41
38
|
}
|
|
39
|
+
FakeImageUploader._isInitialized = false;
|
|
40
|
+
FakeImageUploader._shouldThrow = false;
|
|
42
41
|
exports.default = FakeImageUploader;
|
|
43
42
|
function generateUploadedImageValues() {
|
|
44
43
|
return {
|
|
@@ -8,7 +8,7 @@ class SpruceError extends error_1.default {
|
|
|
8
8
|
friendlyMessage() {
|
|
9
9
|
const { options } = this;
|
|
10
10
|
let message;
|
|
11
|
-
switch (options
|
|
11
|
+
switch (options === null || options === void 0 ? void 0 : options.code) {
|
|
12
12
|
case 'EMPTY_BUFFER':
|
|
13
13
|
message = `Empty buffer found - file failed to convert!`;
|
|
14
14
|
break;
|
|
@@ -7,34 +7,34 @@ const sizesSchema = {
|
|
|
7
7
|
moduleToImportFromWhenRemote: '@sprucelabs/spruce-image-utils',
|
|
8
8
|
fields: {
|
|
9
9
|
/** uri of small sized image. */
|
|
10
|
-
sUri: {
|
|
10
|
+
'sUri': {
|
|
11
11
|
label: 'uri of small sized image',
|
|
12
12
|
type: 'text',
|
|
13
13
|
isRequired: true,
|
|
14
|
-
options: undefined
|
|
14
|
+
options: undefined
|
|
15
15
|
},
|
|
16
16
|
/** uri of medium sized image. */
|
|
17
|
-
mUri: {
|
|
17
|
+
'mUri': {
|
|
18
18
|
label: 'uri of medium sized image',
|
|
19
19
|
type: 'text',
|
|
20
20
|
isRequired: true,
|
|
21
|
-
options: undefined
|
|
21
|
+
options: undefined
|
|
22
22
|
},
|
|
23
23
|
/** uri of large sized image. */
|
|
24
|
-
lUri: {
|
|
24
|
+
'lUri': {
|
|
25
25
|
label: 'uri of large sized image',
|
|
26
26
|
type: 'text',
|
|
27
27
|
isRequired: true,
|
|
28
|
-
options: undefined
|
|
28
|
+
options: undefined
|
|
29
29
|
},
|
|
30
30
|
/** uri of XL sized image. */
|
|
31
|
-
xlUri: {
|
|
31
|
+
'xlUri': {
|
|
32
32
|
label: 'uri of XL sized image',
|
|
33
33
|
type: 'text',
|
|
34
34
|
isRequired: true,
|
|
35
|
-
options: undefined
|
|
35
|
+
options: undefined
|
|
36
36
|
},
|
|
37
|
-
}
|
|
37
|
+
}
|
|
38
38
|
};
|
|
39
39
|
SchemaRegistry.getInstance().trackSchema(sizesSchema);
|
|
40
40
|
export default sizesSchema;
|
|
@@ -5,9 +5,9 @@ import '@sprucelabs/spruce-event-utils';
|
|
|
5
5
|
declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schemas.types' {
|
|
6
6
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
|
7
7
|
interface UploadEmitTarget {
|
|
8
|
-
locationId?: string | undefined | null;
|
|
9
|
-
organizationId?: string | undefined | null;
|
|
10
|
-
filePersonId?: string | undefined | null;
|
|
8
|
+
'locationId'?: string | undefined | null;
|
|
9
|
+
'organizationId'?: string | undefined | null;
|
|
10
|
+
'filePersonId'?: string | undefined | null;
|
|
11
11
|
}
|
|
12
12
|
interface UploadEmitTargetSchema extends SpruceSchema.Schema {
|
|
13
13
|
id: 'uploadEmitTarget';
|
|
@@ -16,17 +16,17 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
16
16
|
name: '';
|
|
17
17
|
fields: {
|
|
18
18
|
/** . */
|
|
19
|
-
locationId: {
|
|
19
|
+
'locationId': {
|
|
20
20
|
type: 'id';
|
|
21
21
|
options: undefined;
|
|
22
22
|
};
|
|
23
23
|
/** . */
|
|
24
|
-
organizationId: {
|
|
24
|
+
'organizationId': {
|
|
25
25
|
type: 'id';
|
|
26
26
|
options: undefined;
|
|
27
27
|
};
|
|
28
28
|
/** . */
|
|
29
|
-
filePersonId: {
|
|
29
|
+
'filePersonId': {
|
|
30
30
|
type: 'text';
|
|
31
31
|
options: undefined;
|
|
32
32
|
};
|
|
@@ -37,8 +37,8 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
37
37
|
}
|
|
38
38
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
|
39
39
|
interface UploadEmitPayload {
|
|
40
|
-
base64Body: string;
|
|
41
|
-
name: string;
|
|
40
|
+
'base64Body': string;
|
|
41
|
+
'name': string;
|
|
42
42
|
}
|
|
43
43
|
interface UploadEmitPayloadSchema extends SpruceSchema.Schema {
|
|
44
44
|
id: 'uploadEmitPayload';
|
|
@@ -47,13 +47,13 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
47
47
|
name: '';
|
|
48
48
|
fields: {
|
|
49
49
|
/** . */
|
|
50
|
-
base64Body: {
|
|
50
|
+
'base64Body': {
|
|
51
51
|
type: 'text';
|
|
52
52
|
isRequired: true;
|
|
53
53
|
options: undefined;
|
|
54
54
|
};
|
|
55
55
|
/** . */
|
|
56
|
-
name: {
|
|
56
|
+
'name': {
|
|
57
57
|
type: 'text';
|
|
58
58
|
isRequired: true;
|
|
59
59
|
options: undefined;
|
|
@@ -66,9 +66,9 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
66
66
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
|
67
67
|
interface UploadEmitTargetAndPayload {
|
|
68
68
|
/** Source. */
|
|
69
|
-
source?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
|
|
70
|
-
target?: SpruceSchemas.Files.v2022_05_13.UploadEmitTarget | undefined | null;
|
|
71
|
-
payload: SpruceSchemas.Files.v2022_05_13.UploadEmitPayload;
|
|
69
|
+
'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
|
|
70
|
+
'target'?: SpruceSchemas.Files.v2022_05_13.UploadEmitTarget | undefined | null;
|
|
71
|
+
'payload': SpruceSchemas.Files.v2022_05_13.UploadEmitPayload;
|
|
72
72
|
}
|
|
73
73
|
interface UploadEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
|
|
74
74
|
id: 'uploadEmitTargetAndPayload';
|
|
@@ -77,7 +77,7 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
77
77
|
name: '';
|
|
78
78
|
fields: {
|
|
79
79
|
/** Source. */
|
|
80
|
-
source: {
|
|
80
|
+
'source': {
|
|
81
81
|
label: 'Source';
|
|
82
82
|
type: 'schema';
|
|
83
83
|
options: {
|
|
@@ -85,14 +85,14 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
85
85
|
};
|
|
86
86
|
};
|
|
87
87
|
/** . */
|
|
88
|
-
target: {
|
|
88
|
+
'target': {
|
|
89
89
|
type: 'schema';
|
|
90
90
|
options: {
|
|
91
91
|
schema: SpruceSchemas.Files.v2022_05_13.UploadEmitTargetSchema;
|
|
92
92
|
};
|
|
93
93
|
};
|
|
94
94
|
/** . */
|
|
95
|
-
payload: {
|
|
95
|
+
'payload': {
|
|
96
96
|
type: 'schema';
|
|
97
97
|
isRequired: true;
|
|
98
98
|
options: {
|
|
@@ -106,9 +106,9 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
106
106
|
}
|
|
107
107
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
|
108
108
|
interface UploadResponsePayload {
|
|
109
|
-
id: string;
|
|
110
|
-
uri: string;
|
|
111
|
-
type: string;
|
|
109
|
+
'id': string;
|
|
110
|
+
'uri': string;
|
|
111
|
+
'type': string;
|
|
112
112
|
}
|
|
113
113
|
interface UploadResponsePayloadSchema extends SpruceSchema.Schema {
|
|
114
114
|
id: 'uploadResponsePayload';
|
|
@@ -117,19 +117,19 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
117
117
|
name: '';
|
|
118
118
|
fields: {
|
|
119
119
|
/** . */
|
|
120
|
-
id: {
|
|
120
|
+
'id': {
|
|
121
121
|
type: 'id';
|
|
122
122
|
isRequired: true;
|
|
123
123
|
options: undefined;
|
|
124
124
|
};
|
|
125
125
|
/** . */
|
|
126
|
-
uri: {
|
|
126
|
+
'uri': {
|
|
127
127
|
type: 'text';
|
|
128
128
|
isRequired: true;
|
|
129
129
|
options: undefined;
|
|
130
130
|
};
|
|
131
131
|
/** . */
|
|
132
|
-
type: {
|
|
132
|
+
'type': {
|
|
133
133
|
type: 'text';
|
|
134
134
|
isRequired: true;
|
|
135
135
|
options: undefined;
|
|
@@ -141,9 +141,9 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
141
141
|
}
|
|
142
142
|
namespace SpruceSchemas.Images.v2022_05_31 {
|
|
143
143
|
interface UploadEmitTarget {
|
|
144
|
-
locationId?: string | undefined | null;
|
|
145
|
-
organizationId?: string | undefined | null;
|
|
146
|
-
imagePersonId?: string | undefined | null;
|
|
144
|
+
'locationId'?: string | undefined | null;
|
|
145
|
+
'organizationId'?: string | undefined | null;
|
|
146
|
+
'imagePersonId'?: string | undefined | null;
|
|
147
147
|
}
|
|
148
148
|
interface UploadEmitTargetSchema extends SpruceSchema.Schema {
|
|
149
149
|
id: 'uploadEmitTarget';
|
|
@@ -152,17 +152,17 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
152
152
|
name: '';
|
|
153
153
|
fields: {
|
|
154
154
|
/** . */
|
|
155
|
-
locationId: {
|
|
155
|
+
'locationId': {
|
|
156
156
|
type: 'id';
|
|
157
157
|
options: undefined;
|
|
158
158
|
};
|
|
159
159
|
/** . */
|
|
160
|
-
organizationId: {
|
|
160
|
+
'organizationId': {
|
|
161
161
|
type: 'id';
|
|
162
162
|
options: undefined;
|
|
163
163
|
};
|
|
164
164
|
/** . */
|
|
165
|
-
imagePersonId: {
|
|
165
|
+
'imagePersonId': {
|
|
166
166
|
type: 'text';
|
|
167
167
|
options: undefined;
|
|
168
168
|
};
|
|
@@ -173,8 +173,8 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
173
173
|
}
|
|
174
174
|
namespace SpruceSchemas.Images.v2022_05_31 {
|
|
175
175
|
interface UploadEmitPayload {
|
|
176
|
-
base64Body: string;
|
|
177
|
-
name: string;
|
|
176
|
+
'base64Body': string;
|
|
177
|
+
'name': string;
|
|
178
178
|
}
|
|
179
179
|
interface UploadEmitPayloadSchema extends SpruceSchema.Schema {
|
|
180
180
|
id: 'uploadEmitPayload';
|
|
@@ -183,13 +183,13 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
183
183
|
name: '';
|
|
184
184
|
fields: {
|
|
185
185
|
/** . */
|
|
186
|
-
base64Body: {
|
|
186
|
+
'base64Body': {
|
|
187
187
|
type: 'text';
|
|
188
188
|
isRequired: true;
|
|
189
189
|
options: undefined;
|
|
190
190
|
};
|
|
191
191
|
/** . */
|
|
192
|
-
name: {
|
|
192
|
+
'name': {
|
|
193
193
|
type: 'text';
|
|
194
194
|
isRequired: true;
|
|
195
195
|
options: undefined;
|
|
@@ -202,9 +202,9 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
202
202
|
namespace SpruceSchemas.Images.v2022_05_31 {
|
|
203
203
|
interface UploadEmitTargetAndPayload {
|
|
204
204
|
/** Source. */
|
|
205
|
-
source?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
|
|
206
|
-
target?: SpruceSchemas.Images.v2022_05_31.UploadEmitTarget | undefined | null;
|
|
207
|
-
payload: SpruceSchemas.Images.v2022_05_31.UploadEmitPayload;
|
|
205
|
+
'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
|
|
206
|
+
'target'?: SpruceSchemas.Images.v2022_05_31.UploadEmitTarget | undefined | null;
|
|
207
|
+
'payload': SpruceSchemas.Images.v2022_05_31.UploadEmitPayload;
|
|
208
208
|
}
|
|
209
209
|
interface UploadEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
|
|
210
210
|
id: 'uploadEmitTargetAndPayload';
|
|
@@ -213,7 +213,7 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
213
213
|
name: '';
|
|
214
214
|
fields: {
|
|
215
215
|
/** Source. */
|
|
216
|
-
source: {
|
|
216
|
+
'source': {
|
|
217
217
|
label: 'Source';
|
|
218
218
|
type: 'schema';
|
|
219
219
|
options: {
|
|
@@ -221,14 +221,14 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
221
221
|
};
|
|
222
222
|
};
|
|
223
223
|
/** . */
|
|
224
|
-
target: {
|
|
224
|
+
'target': {
|
|
225
225
|
type: 'schema';
|
|
226
226
|
options: {
|
|
227
227
|
schema: SpruceSchemas.Images.v2022_05_31.UploadEmitTargetSchema;
|
|
228
228
|
};
|
|
229
229
|
};
|
|
230
230
|
/** . */
|
|
231
|
-
payload: {
|
|
231
|
+
'payload': {
|
|
232
232
|
type: 'schema';
|
|
233
233
|
isRequired: true;
|
|
234
234
|
options: {
|
|
@@ -242,9 +242,9 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
242
242
|
}
|
|
243
243
|
namespace SpruceSchemas.Images.v2022_05_31 {
|
|
244
244
|
interface UploadResponsePayload {
|
|
245
|
-
id: string;
|
|
246
|
-
type: string;
|
|
247
|
-
sizes: SpruceSchemas.Images.v2022_05_31.Sizes;
|
|
245
|
+
'id': string;
|
|
246
|
+
'type': string;
|
|
247
|
+
'sizes': SpruceSchemas.Images.v2022_05_31.Sizes;
|
|
248
248
|
}
|
|
249
249
|
interface UploadResponsePayloadSchema extends SpruceSchema.Schema {
|
|
250
250
|
id: 'uploadResponsePayload';
|
|
@@ -253,19 +253,19 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
253
253
|
name: '';
|
|
254
254
|
fields: {
|
|
255
255
|
/** . */
|
|
256
|
-
id: {
|
|
256
|
+
'id': {
|
|
257
257
|
type: 'id';
|
|
258
258
|
isRequired: true;
|
|
259
259
|
options: undefined;
|
|
260
260
|
};
|
|
261
261
|
/** . */
|
|
262
|
-
type: {
|
|
262
|
+
'type': {
|
|
263
263
|
type: 'text';
|
|
264
264
|
isRequired: true;
|
|
265
265
|
options: undefined;
|
|
266
266
|
};
|
|
267
267
|
/** . */
|
|
268
|
-
sizes: {
|
|
268
|
+
'sizes': {
|
|
269
269
|
type: 'schema';
|
|
270
270
|
isRequired: true;
|
|
271
271
|
options: {
|
|
@@ -279,12 +279,12 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
279
279
|
}
|
|
280
280
|
namespace SpruceSchemas.Images.v2022_05_31 {
|
|
281
281
|
interface UploadEventTarget {
|
|
282
|
-
imagePersonId?: string | undefined | null;
|
|
283
|
-
locationId?: string | undefined | null;
|
|
284
|
-
personId?: string | undefined | null;
|
|
285
|
-
organizationId?: string | undefined | null;
|
|
286
|
-
skillId?: string | undefined | null;
|
|
287
|
-
roleId?: string | undefined | null;
|
|
282
|
+
'imagePersonId'?: string | undefined | null;
|
|
283
|
+
'locationId'?: string | undefined | null;
|
|
284
|
+
'personId'?: string | undefined | null;
|
|
285
|
+
'organizationId'?: string | undefined | null;
|
|
286
|
+
'skillId'?: string | undefined | null;
|
|
287
|
+
'roleId'?: string | undefined | null;
|
|
288
288
|
}
|
|
289
289
|
interface UploadEventTargetSchema extends SpruceSchema.Schema {
|
|
290
290
|
id: 'uploadEventTarget';
|
|
@@ -294,32 +294,32 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
294
294
|
moduleToImportFromWhenRemote: '@sprucelabs/spruce-image-utils';
|
|
295
295
|
fields: {
|
|
296
296
|
/** . */
|
|
297
|
-
imagePersonId: {
|
|
297
|
+
'imagePersonId': {
|
|
298
298
|
type: 'text';
|
|
299
299
|
options: undefined;
|
|
300
300
|
};
|
|
301
301
|
/** . */
|
|
302
|
-
locationId: {
|
|
302
|
+
'locationId': {
|
|
303
303
|
type: 'id';
|
|
304
304
|
options: undefined;
|
|
305
305
|
};
|
|
306
306
|
/** . */
|
|
307
|
-
personId: {
|
|
307
|
+
'personId': {
|
|
308
308
|
type: 'id';
|
|
309
309
|
options: undefined;
|
|
310
310
|
};
|
|
311
311
|
/** . */
|
|
312
|
-
organizationId: {
|
|
312
|
+
'organizationId': {
|
|
313
313
|
type: 'id';
|
|
314
314
|
options: undefined;
|
|
315
315
|
};
|
|
316
316
|
/** . */
|
|
317
|
-
skillId: {
|
|
317
|
+
'skillId': {
|
|
318
318
|
type: 'id';
|
|
319
319
|
options: undefined;
|
|
320
320
|
};
|
|
321
321
|
/** . */
|
|
322
|
-
roleId: {
|
|
322
|
+
'roleId': {
|
|
323
323
|
type: 'id';
|
|
324
324
|
options: undefined;
|
|
325
325
|
};
|
|
@@ -330,13 +330,13 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
330
330
|
}
|
|
331
331
|
namespace SpruceSchemas.Images.v2022_05_31 {
|
|
332
332
|
interface UploadEventSource {
|
|
333
|
-
locationId?: string | undefined | null;
|
|
334
|
-
personId?: string | undefined | null;
|
|
335
|
-
organizationId?: string | undefined | null;
|
|
336
|
-
skillId?: string | undefined | null;
|
|
337
|
-
roleId?: string | undefined | null;
|
|
333
|
+
'locationId'?: string | undefined | null;
|
|
334
|
+
'personId'?: string | undefined | null;
|
|
335
|
+
'organizationId'?: string | undefined | null;
|
|
336
|
+
'skillId'?: string | undefined | null;
|
|
337
|
+
'roleId'?: string | undefined | null;
|
|
338
338
|
/** Proxy token. */
|
|
339
|
-
proxyToken?: string | undefined | null;
|
|
339
|
+
'proxyToken'?: string | undefined | null;
|
|
340
340
|
}
|
|
341
341
|
interface UploadEventSourceSchema extends SpruceSchema.Schema {
|
|
342
342
|
id: 'uploadEventSource';
|
|
@@ -346,32 +346,32 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
346
346
|
moduleToImportFromWhenRemote: '@sprucelabs/spruce-image-utils';
|
|
347
347
|
fields: {
|
|
348
348
|
/** . */
|
|
349
|
-
locationId: {
|
|
349
|
+
'locationId': {
|
|
350
350
|
type: 'id';
|
|
351
351
|
options: undefined;
|
|
352
352
|
};
|
|
353
353
|
/** . */
|
|
354
|
-
personId: {
|
|
354
|
+
'personId': {
|
|
355
355
|
type: 'id';
|
|
356
356
|
options: undefined;
|
|
357
357
|
};
|
|
358
358
|
/** . */
|
|
359
|
-
organizationId: {
|
|
359
|
+
'organizationId': {
|
|
360
360
|
type: 'id';
|
|
361
361
|
options: undefined;
|
|
362
362
|
};
|
|
363
363
|
/** . */
|
|
364
|
-
skillId: {
|
|
364
|
+
'skillId': {
|
|
365
365
|
type: 'id';
|
|
366
366
|
options: undefined;
|
|
367
367
|
};
|
|
368
368
|
/** . */
|
|
369
|
-
roleId: {
|
|
369
|
+
'roleId': {
|
|
370
370
|
type: 'id';
|
|
371
371
|
options: undefined;
|
|
372
372
|
};
|
|
373
373
|
/** Proxy token. */
|
|
374
|
-
proxyToken: {
|
|
374
|
+
'proxyToken': {
|
|
375
375
|
label: 'Proxy token';
|
|
376
376
|
type: 'id';
|
|
377
377
|
options: undefined;
|
|
@@ -384,13 +384,13 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
384
384
|
namespace SpruceSchemas.Images.v2022_05_31 {
|
|
385
385
|
interface Sizes {
|
|
386
386
|
/** uri of small sized image. */
|
|
387
|
-
sUri: string;
|
|
387
|
+
'sUri': string;
|
|
388
388
|
/** uri of medium sized image. */
|
|
389
|
-
mUri: string;
|
|
389
|
+
'mUri': string;
|
|
390
390
|
/** uri of large sized image. */
|
|
391
|
-
lUri: string;
|
|
391
|
+
'lUri': string;
|
|
392
392
|
/** uri of XL sized image. */
|
|
393
|
-
xlUri: string;
|
|
393
|
+
'xlUri': string;
|
|
394
394
|
}
|
|
395
395
|
interface SizesSchema extends SpruceSchema.Schema {
|
|
396
396
|
id: 'sizes';
|
|
@@ -400,28 +400,28 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
400
400
|
moduleToImportFromWhenRemote: '@sprucelabs/spruce-image-utils';
|
|
401
401
|
fields: {
|
|
402
402
|
/** uri of small sized image. */
|
|
403
|
-
sUri: {
|
|
403
|
+
'sUri': {
|
|
404
404
|
label: 'uri of small sized image';
|
|
405
405
|
type: 'text';
|
|
406
406
|
isRequired: true;
|
|
407
407
|
options: undefined;
|
|
408
408
|
};
|
|
409
409
|
/** uri of medium sized image. */
|
|
410
|
-
mUri: {
|
|
410
|
+
'mUri': {
|
|
411
411
|
label: 'uri of medium sized image';
|
|
412
412
|
type: 'text';
|
|
413
413
|
isRequired: true;
|
|
414
414
|
options: undefined;
|
|
415
415
|
};
|
|
416
416
|
/** uri of large sized image. */
|
|
417
|
-
lUri: {
|
|
417
|
+
'lUri': {
|
|
418
418
|
label: 'uri of large sized image';
|
|
419
419
|
type: 'text';
|
|
420
420
|
isRequired: true;
|
|
421
421
|
options: undefined;
|
|
422
422
|
};
|
|
423
423
|
/** uri of XL sized image. */
|
|
424
|
-
xlUri: {
|
|
424
|
+
'xlUri': {
|
|
425
425
|
label: 'uri of XL sized image';
|
|
426
426
|
type: 'text';
|
|
427
427
|
isRequired: true;
|
|
@@ -434,15 +434,15 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
434
434
|
}
|
|
435
435
|
namespace SpruceSchemas.Images.v2022_05_31 {
|
|
436
436
|
interface Image {
|
|
437
|
-
id: string;
|
|
437
|
+
'id': string;
|
|
438
438
|
/** Name. */
|
|
439
|
-
name: string;
|
|
439
|
+
'name': string;
|
|
440
440
|
/** original base 64. */
|
|
441
|
-
originalBase64: string;
|
|
442
|
-
type: string;
|
|
443
|
-
sizes: SpruceSchemas.Images.v2022_05_31.Sizes;
|
|
444
|
-
source: SpruceSchemas.Images.v2022_05_31.UploadEventSource;
|
|
445
|
-
target: SpruceSchemas.Images.v2022_05_31.UploadEventTarget;
|
|
441
|
+
'originalBase64': string;
|
|
442
|
+
'type': string;
|
|
443
|
+
'sizes': SpruceSchemas.Images.v2022_05_31.Sizes;
|
|
444
|
+
'source': SpruceSchemas.Images.v2022_05_31.UploadEventSource;
|
|
445
|
+
'target': SpruceSchemas.Images.v2022_05_31.UploadEventTarget;
|
|
446
446
|
}
|
|
447
447
|
interface ImageSchema extends SpruceSchema.Schema {
|
|
448
448
|
id: 'image';
|
|
@@ -452,33 +452,33 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
452
452
|
moduleToImportFromWhenRemote: '@sprucelabs/spruce-image-utils';
|
|
453
453
|
fields: {
|
|
454
454
|
/** . */
|
|
455
|
-
id: {
|
|
455
|
+
'id': {
|
|
456
456
|
type: 'id';
|
|
457
457
|
isRequired: true;
|
|
458
458
|
options: undefined;
|
|
459
459
|
};
|
|
460
460
|
/** Name. */
|
|
461
|
-
name: {
|
|
461
|
+
'name': {
|
|
462
462
|
label: 'Name';
|
|
463
463
|
type: 'text';
|
|
464
464
|
isRequired: true;
|
|
465
465
|
options: undefined;
|
|
466
466
|
};
|
|
467
467
|
/** original base 64. */
|
|
468
|
-
originalBase64: {
|
|
468
|
+
'originalBase64': {
|
|
469
469
|
label: 'original base 64';
|
|
470
470
|
type: 'text';
|
|
471
471
|
isRequired: true;
|
|
472
472
|
options: undefined;
|
|
473
473
|
};
|
|
474
474
|
/** . */
|
|
475
|
-
type: {
|
|
475
|
+
'type': {
|
|
476
476
|
type: 'text';
|
|
477
477
|
isRequired: true;
|
|
478
478
|
options: undefined;
|
|
479
479
|
};
|
|
480
480
|
/** . */
|
|
481
|
-
sizes: {
|
|
481
|
+
'sizes': {
|
|
482
482
|
type: 'schema';
|
|
483
483
|
isRequired: true;
|
|
484
484
|
options: {
|
|
@@ -486,7 +486,7 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
486
486
|
};
|
|
487
487
|
};
|
|
488
488
|
/** . */
|
|
489
|
-
source: {
|
|
489
|
+
'source': {
|
|
490
490
|
type: 'schema';
|
|
491
491
|
isPrivate: true;
|
|
492
492
|
isRequired: true;
|
|
@@ -495,7 +495,7 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
495
495
|
};
|
|
496
496
|
};
|
|
497
497
|
/** . */
|
|
498
|
-
target: {
|
|
498
|
+
'target': {
|
|
499
499
|
type: 'schema';
|
|
500
500
|
isPrivate: true;
|
|
501
501
|
isRequired: true;
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const schema_1 = require("@sprucelabs/schema");
|
|
4
4
|
class RemoteImageUploader {
|
|
5
|
-
client;
|
|
6
|
-
static UploaderClass;
|
|
7
5
|
constructor(client) {
|
|
8
6
|
this.client = client;
|
|
9
7
|
}
|
|
10
8
|
static Uploader(options) {
|
|
9
|
+
var _a;
|
|
11
10
|
const { client } = (0, schema_1.assertOptions)(options, ['client']);
|
|
12
|
-
return new (this.UploaderClass
|
|
11
|
+
return new ((_a = this.UploaderClass) !== null && _a !== void 0 ? _a : this)(client);
|
|
13
12
|
}
|
|
14
13
|
static setClass(Class) {
|
|
15
14
|
this.UploaderClass = Class;
|