grist-widget-sdk 0.6.0 → 0.6.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/CHANGELOG.md +8 -0
- package/dist/app.cjs +5 -1
- package/dist/app.cjs.map +1 -1
- package/dist/app.js +2 -2
- package/dist/{chunk-DKCRFNAW.js → chunk-JJ23G6RR.js} +6 -2
- package/dist/chunk-JJ23G6RR.js.map +1 -0
- package/dist/{chunk-TUPCTWE5.js → chunk-KHOPLBCJ.js} +2 -2
- package/dist/emulator/testing.cjs +5 -1
- package/dist/emulator/testing.cjs.map +1 -1
- package/dist/emulator/testing.js +2 -2
- package/dist/index.cjs +5 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-DKCRFNAW.js.map +0 -1
- /package/dist/{chunk-TUPCTWE5.js.map → chunk-KHOPLBCJ.js.map} +0 -0
package/dist/emulator/testing.js
CHANGED
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
GristWidgetApp,
|
|
3
3
|
entryProps,
|
|
4
4
|
isGristWidgetEntry
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-KHOPLBCJ.js";
|
|
6
6
|
import {
|
|
7
7
|
encodeGristCell,
|
|
8
8
|
isGristWidget,
|
|
9
9
|
resetGristForTests
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-JJ23G6RR.js";
|
|
11
11
|
import {
|
|
12
12
|
createGristEmulator,
|
|
13
13
|
presets
|
package/dist/index.cjs
CHANGED
|
@@ -612,8 +612,12 @@ async function getAttachmentDownloadUrl(docApi, attachmentId, options) {
|
|
|
612
612
|
if (!getAccessToken) {
|
|
613
613
|
throw new Error("getAccessToken is not available on docApi");
|
|
614
614
|
}
|
|
615
|
+
const id = String(attachmentId).trim();
|
|
616
|
+
if (!/^[1-9]\d*$/.test(id)) {
|
|
617
|
+
throw new Error(`getAttachmentDownloadUrl: "${attachmentId}" is not an attachment id (a positive integer).`);
|
|
618
|
+
}
|
|
615
619
|
const { token, baseUrl } = await getAccessToken({ readOnly: options?.readOnly ?? false });
|
|
616
|
-
return `${baseUrl}/attachments/${
|
|
620
|
+
return `${baseUrl}/attachments/${id}/download?auth=${encodeURIComponent(token)}`;
|
|
617
621
|
}
|
|
618
622
|
async function fetchBytesFromSignedAttachmentUrl(url) {
|
|
619
623
|
const response = await fetch(url);
|