@scalemule/sdk 0.0.77 → 0.0.78
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/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -16
- package/dist/index.mjs +2 -16
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -8414,6 +8414,7 @@ declare class AgentSessionsService extends ServiceModule {
|
|
|
8414
8414
|
listArtifacts(sessionId: string, options?: RequestOptions): Promise<ApiResponse<SessionArtifact[]>>;
|
|
8415
8415
|
}
|
|
8416
8416
|
|
|
8417
|
+
/** Browser capture shared by applications. Capture starts only on a user gesture. */
|
|
8417
8418
|
declare function prepareCommunityMapAttachment(file: File): Promise<File>;
|
|
8418
8419
|
interface MediaCaptureSession {
|
|
8419
8420
|
stream: MediaStream;
|
package/dist/index.d.ts
CHANGED
|
@@ -8414,6 +8414,7 @@ declare class AgentSessionsService extends ServiceModule {
|
|
|
8414
8414
|
listArtifacts(sessionId: string, options?: RequestOptions): Promise<ApiResponse<SessionArtifact[]>>;
|
|
8415
8415
|
}
|
|
8416
8416
|
|
|
8417
|
+
/** Browser capture shared by applications. Capture starts only on a user gesture. */
|
|
8417
8418
|
declare function prepareCommunityMapAttachment(file: File): Promise<File>;
|
|
8418
8419
|
interface MediaCaptureSession {
|
|
8419
8420
|
stream: MediaStream;
|
package/dist/index.js
CHANGED
|
@@ -240,6 +240,7 @@ async function maybeCompressImage(file, userConfig, sessionId, telemetry) {
|
|
|
240
240
|
maxWidthOrHeight: Math.max(config.maxWidth, config.maxHeight),
|
|
241
241
|
initialQuality: config.quality,
|
|
242
242
|
useWebWorker: true,
|
|
243
|
+
preserveExif: true,
|
|
243
244
|
fileType: type === "image/png" ? "image/webp" : void 0
|
|
244
245
|
});
|
|
245
246
|
if (compressed.size >= file.size * 0.95) {
|
|
@@ -9313,7 +9314,6 @@ var AgentSessionsService = class extends ServiceModule {
|
|
|
9313
9314
|
};
|
|
9314
9315
|
|
|
9315
9316
|
// src/browser-capture.ts
|
|
9316
|
-
init_upload_compression();
|
|
9317
9317
|
async function prepareCommunityMapAttachment(file) {
|
|
9318
9318
|
const types = [
|
|
9319
9319
|
"image/jpeg",
|
|
@@ -9335,21 +9335,7 @@ async function prepareCommunityMapAttachment(file) {
|
|
|
9335
9335
|
);
|
|
9336
9336
|
if (!file.size || file.size > 25 * 1024 * 1024)
|
|
9337
9337
|
throw new Error("Choose a file up to 25 MiB. Record a shorter clip if needed.");
|
|
9338
|
-
|
|
9339
|
-
const compressed = await maybeCompressImage(
|
|
9340
|
-
file,
|
|
9341
|
-
{ maxWidth: 2400, maxHeight: 2400, maxSizeMB: 2, quality: 0.82 },
|
|
9342
|
-
"community-capture",
|
|
9343
|
-
null
|
|
9344
|
-
);
|
|
9345
|
-
const result = compressed ? new File(
|
|
9346
|
-
[compressed],
|
|
9347
|
-
file.name.replace(/\.[^.]+$/, "") + (compressed.type === "image/webp" ? ".webp" : ".jpg"),
|
|
9348
|
-
{ type: compressed.type, lastModified: file.lastModified }
|
|
9349
|
-
) : file;
|
|
9350
|
-
if (result.size > 8 * 1024 * 1024)
|
|
9351
|
-
throw new Error("This photo is too large. Choose a photo up to 8 MiB or use a smaller camera setting.");
|
|
9352
|
-
return result;
|
|
9338
|
+
return file;
|
|
9353
9339
|
}
|
|
9354
9340
|
async function startMediaCapture(kind, signal) {
|
|
9355
9341
|
const candidates = kind === "video" ? ["video/mp4;codecs=h264,aac", "video/mp4", "video/webm;codecs=vp8,opus", "video/webm"] : ["audio/mp4", "audio/webm;codecs=opus", "audio/ogg;codecs=opus", "audio/webm"];
|
package/dist/index.mjs
CHANGED
|
@@ -218,6 +218,7 @@ async function maybeCompressImage(file, userConfig, sessionId, telemetry) {
|
|
|
218
218
|
maxWidthOrHeight: Math.max(config.maxWidth, config.maxHeight),
|
|
219
219
|
initialQuality: config.quality,
|
|
220
220
|
useWebWorker: true,
|
|
221
|
+
preserveExif: true,
|
|
221
222
|
fileType: type === "image/png" ? "image/webp" : void 0
|
|
222
223
|
});
|
|
223
224
|
if (compressed.size >= file.size * 0.95) {
|
|
@@ -9177,7 +9178,6 @@ var AgentSessionsService = class extends ServiceModule {
|
|
|
9177
9178
|
};
|
|
9178
9179
|
|
|
9179
9180
|
// src/browser-capture.ts
|
|
9180
|
-
init_upload_compression();
|
|
9181
9181
|
async function prepareCommunityMapAttachment(file) {
|
|
9182
9182
|
const types = [
|
|
9183
9183
|
"image/jpeg",
|
|
@@ -9199,21 +9199,7 @@ async function prepareCommunityMapAttachment(file) {
|
|
|
9199
9199
|
);
|
|
9200
9200
|
if (!file.size || file.size > 25 * 1024 * 1024)
|
|
9201
9201
|
throw new Error("Choose a file up to 25 MiB. Record a shorter clip if needed.");
|
|
9202
|
-
|
|
9203
|
-
const compressed = await maybeCompressImage(
|
|
9204
|
-
file,
|
|
9205
|
-
{ maxWidth: 2400, maxHeight: 2400, maxSizeMB: 2, quality: 0.82 },
|
|
9206
|
-
"community-capture",
|
|
9207
|
-
null
|
|
9208
|
-
);
|
|
9209
|
-
const result = compressed ? new File(
|
|
9210
|
-
[compressed],
|
|
9211
|
-
file.name.replace(/\.[^.]+$/, "") + (compressed.type === "image/webp" ? ".webp" : ".jpg"),
|
|
9212
|
-
{ type: compressed.type, lastModified: file.lastModified }
|
|
9213
|
-
) : file;
|
|
9214
|
-
if (result.size > 8 * 1024 * 1024)
|
|
9215
|
-
throw new Error("This photo is too large. Choose a photo up to 8 MiB or use a smaller camera setting.");
|
|
9216
|
-
return result;
|
|
9202
|
+
return file;
|
|
9217
9203
|
}
|
|
9218
9204
|
async function startMediaCapture(kind, signal) {
|
|
9219
9205
|
const candidates = kind === "video" ? ["video/mp4;codecs=h264,aac", "video/mp4", "video/webm;codecs=vp8,opus", "video/webm"] : ["audio/mp4", "audio/webm;codecs=opus", "audio/ogg;codecs=opus", "audio/webm"];
|