skybridge 0.18.0 → 0.19.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-files.js","sourceRoot":"","sources":["../../../src/web/hooks/use-files.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,QAAQ;IACtB,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU;QAChC,
|
|
1
|
+
{"version":3,"file":"use-files.js","sourceRoot":"","sources":["../../../src/web/hooks/use-files.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,QAAQ;IACtB,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU;QAChC,cAAc,EAAE,MAAM,CAAC,MAAM,CAAC,kBAAkB;KACjD,CAAC;AACJ,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { renderHook } from "@testing-library/react";
|
|
2
2
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
3
3
|
import { useFiles } from "./use-files.js";
|
|
4
|
-
describe("
|
|
4
|
+
describe("useFiles", () => {
|
|
5
5
|
const OpenaiMock = {
|
|
6
6
|
uploadFile: vi.fn(),
|
|
7
|
-
|
|
7
|
+
getFileDownloadUrl: vi.fn(),
|
|
8
8
|
};
|
|
9
9
|
beforeEach(() => {
|
|
10
10
|
vi.stubGlobal("openai", OpenaiMock);
|
|
@@ -22,8 +22,8 @@ describe("useLocale", () => {
|
|
|
22
22
|
it("should download a file from ChatGPT", () => {
|
|
23
23
|
const fileId = "123";
|
|
24
24
|
const { result } = renderHook(() => useFiles());
|
|
25
|
-
result.current.
|
|
26
|
-
expect(OpenaiMock.
|
|
25
|
+
result.current.getDownloadUrl({ fileId });
|
|
26
|
+
expect(OpenaiMock.getFileDownloadUrl).toHaveBeenCalledWith({ fileId });
|
|
27
27
|
});
|
|
28
28
|
});
|
|
29
29
|
//# sourceMappingURL=use-files.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-files.test.js","sourceRoot":"","sources":["../../../src/web/hooks/use-files.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"use-files.test.js","sourceRoot":"","sources":["../../../src/web/hooks/use-files.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,MAAM,UAAU,GAAG;QACjB,UAAU,EAAE,EAAE,CAAC,EAAE,EAAE;QACnB,kBAAkB,EAAE,EAAE,CAAC,EAAE,EAAE;KAC5B,CAAC;IAEF,UAAU,CAAC,GAAG,EAAE;QACd,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,EAAE,CAAC,gBAAgB,EAAE,CAAC;QACtB,EAAE,CAAC,aAAa,EAAE,CAAC;IACrB,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;IAE3C,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;QACzC,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;QAEhD,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACjC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;QAC7C,MAAM,MAAM,GAAG,KAAK,CAAC;QACrB,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;QAEhD,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QAC1C,MAAM,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/web/types.d.ts
CHANGED
|
@@ -110,7 +110,7 @@ export type OpenAiMethods<WidgetState extends UnknownObject = UnknownObject> = {
|
|
|
110
110
|
* Downloads a file from the host that was previously uploaded.
|
|
111
111
|
* Only files uploaded by the same connector instance can be downloaded.
|
|
112
112
|
*/
|
|
113
|
-
|
|
113
|
+
getFileDownloadUrl: (file: FileMetadata) => Promise<{
|
|
114
114
|
downloadUrl: string;
|
|
115
115
|
}>;
|
|
116
116
|
};
|