@bikefinder/sdk 0.32.1 → 0.33.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 +13 -1
- package/dist/{chunk-3EMQWFLN.js → chunk-IYM3P32E.js} +60 -11
- package/dist/index.d.ts +6466 -881
- package/dist/index.js +26 -10
- package/dist/schemas.d.ts +6466 -881
- package/dist/schemas.js +11 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -47,6 +47,10 @@ import {
|
|
|
47
47
|
photoUploadInput,
|
|
48
48
|
photoUploadSession,
|
|
49
49
|
photoUploadStartInput,
|
|
50
|
+
positionMethod,
|
|
51
|
+
positionRequest,
|
|
52
|
+
positionRequestInput,
|
|
53
|
+
positionRequestsContract,
|
|
50
54
|
pushContract,
|
|
51
55
|
pushRegistrationInput,
|
|
52
56
|
pushRemovalInput,
|
|
@@ -55,6 +59,7 @@ import {
|
|
|
55
59
|
realtimeTicket,
|
|
56
60
|
staffRealtimeFeed,
|
|
57
61
|
startFirmwareUpdate,
|
|
62
|
+
submitPositionRequestInput,
|
|
58
63
|
subscription,
|
|
59
64
|
subscriptionAllocationContract,
|
|
60
65
|
subscriptionAllocationInput,
|
|
@@ -77,7 +82,7 @@ import {
|
|
|
77
82
|
trackerMemberInput,
|
|
78
83
|
trackerMovementAlertsInput,
|
|
79
84
|
trackerPhotoContract
|
|
80
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-IYM3P32E.js";
|
|
81
86
|
|
|
82
87
|
// ../../src/client/client.ts
|
|
83
88
|
import {
|
|
@@ -328,6 +333,7 @@ async function uploadPhoto(uploads, input, fetch = globalThis.fetch) {
|
|
|
328
333
|
},
|
|
329
334
|
{ signal: input.signal }
|
|
330
335
|
);
|
|
336
|
+
input.signal?.throwIfAborted();
|
|
331
337
|
if (session.status === "published") return { photoId: session.photoId };
|
|
332
338
|
if (Date.parse(session.expiresAt) <= Date.now())
|
|
333
339
|
throw new Error(
|
|
@@ -340,15 +346,20 @@ async function uploadPhoto(uploads, input, fetch = globalThis.fetch) {
|
|
|
340
346
|
throw new TypeError(
|
|
341
347
|
"The photo upload session targets an unexpected storage endpoint."
|
|
342
348
|
);
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
349
|
+
let uploaded;
|
|
350
|
+
try {
|
|
351
|
+
uploaded = await fetch(url, {
|
|
352
|
+
method: "PUT",
|
|
353
|
+
body: input.body,
|
|
354
|
+
credentials: "omit",
|
|
355
|
+
redirect: "error",
|
|
356
|
+
signal: input.signal,
|
|
357
|
+
headers: session.headers
|
|
358
|
+
});
|
|
359
|
+
} catch {
|
|
360
|
+
}
|
|
361
|
+
input.signal?.throwIfAborted();
|
|
362
|
+
if (uploaded && !uploaded.ok && uploaded.status !== 412)
|
|
352
363
|
throw new Error(
|
|
353
364
|
"The private photo upload failed (" + uploaded.status + "). Retry with the same request ID."
|
|
354
365
|
);
|
|
@@ -430,6 +441,10 @@ export {
|
|
|
430
441
|
photoUploadInput,
|
|
431
442
|
photoUploadSession,
|
|
432
443
|
photoUploadStartInput,
|
|
444
|
+
positionMethod,
|
|
445
|
+
positionRequest,
|
|
446
|
+
positionRequestInput,
|
|
447
|
+
positionRequestsContract,
|
|
433
448
|
pushContract,
|
|
434
449
|
pushRegistrationInput,
|
|
435
450
|
pushRemovalInput,
|
|
@@ -438,6 +453,7 @@ export {
|
|
|
438
453
|
realtimeTicket,
|
|
439
454
|
staffRealtimeFeed,
|
|
440
455
|
startFirmwareUpdate,
|
|
456
|
+
submitPositionRequestInput,
|
|
441
457
|
subscription,
|
|
442
458
|
subscriptionAllocationContract,
|
|
443
459
|
subscriptionAllocationInput,
|