assemblyai 4.4.5 → 4.4.7-beta.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.
- package/CHANGELOG.md +4 -0
- package/README.internal.md +100 -0
- package/dist/assemblyai.umd.js +15 -7
- package/dist/assemblyai.umd.min.js +1 -1
- package/dist/browser.mjs +11 -6
- package/dist/bun.mjs +11 -6
- package/dist/deno.mjs +11 -6
- package/dist/index.cjs +15 -7
- package/dist/index.mjs +15 -7
- package/dist/node.cjs +11 -6
- package/dist/node.mjs +11 -6
- package/dist/polyfills/fetch/default.d.ts +1 -0
- package/dist/polyfills/fetch/workerd.d.ts +1 -0
- package/dist/workerd.mjs +689 -0
- package/package.json +7 -3
- package/src/polyfills/fetch/default.ts +3 -0
- package/src/polyfills/fetch/workerd.ts +2 -0
- package/src/services/base.ts +6 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "assemblyai",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.7-beta.0",
|
|
4
4
|
"description": "The AssemblyAI JavaScript SDK provides an easy-to-use interface for interacting with the AssemblyAI API, which supports async and real-time transcription, as well as the latest LeMUR models.",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18"
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"types": "./dist/exports/index.d.ts",
|
|
17
17
|
"default": "./dist/deno.mjs"
|
|
18
18
|
},
|
|
19
|
-
"workerd": "./dist/
|
|
19
|
+
"workerd": "./dist/workerd.mjs",
|
|
20
20
|
"browser": "./dist/browser.mjs",
|
|
21
21
|
"react-native": "./dist/browser.mjs",
|
|
22
22
|
"node": {
|
|
@@ -38,6 +38,10 @@
|
|
|
38
38
|
"./package.json": "./package.json"
|
|
39
39
|
},
|
|
40
40
|
"imports": {
|
|
41
|
+
"#fetch":{
|
|
42
|
+
"workerd": "./src/polyfills/fetch/workerd.ts",
|
|
43
|
+
"default": "./src/polyfills/fetch/default.ts"
|
|
44
|
+
},
|
|
41
45
|
"#fs": {
|
|
42
46
|
"node": "./src/polyfills/fs/node.ts",
|
|
43
47
|
"bun": "./src/polyfills/fs/bun.ts",
|
|
@@ -67,7 +71,7 @@
|
|
|
67
71
|
"url": "git+https://github.com/AssemblyAI/assemblyai-node-sdk.git"
|
|
68
72
|
},
|
|
69
73
|
"publishConfig": {
|
|
70
|
-
"tag": "
|
|
74
|
+
"tag": "beta",
|
|
71
75
|
"access": "public",
|
|
72
76
|
"registry": "https://registry.npmjs.org/"
|
|
73
77
|
},
|
package/src/services/base.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Error as JsonError } from "..";
|
|
1
|
+
import { DEFAULT_FETCH_INIT } from "#fetch";
|
|
2
|
+
import { BaseServiceParams, Error as JsonError } from "..";
|
|
3
3
|
import { buildUserAgent } from "../utils/userAgent";
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -22,13 +22,13 @@ export abstract class BaseService {
|
|
|
22
22
|
input: string,
|
|
23
23
|
init?: RequestInit | undefined,
|
|
24
24
|
): Promise<Response> {
|
|
25
|
-
init = init
|
|
26
|
-
let headers =
|
|
27
|
-
headers = {
|
|
25
|
+
init = { ...DEFAULT_FETCH_INIT, ...init };
|
|
26
|
+
let headers = {
|
|
28
27
|
Authorization: this.params.apiKey,
|
|
29
28
|
"Content-Type": "application/json",
|
|
30
|
-
...init.headers,
|
|
31
29
|
};
|
|
30
|
+
if (DEFAULT_FETCH_INIT?.headers) headers = { ...headers, ...DEFAULT_FETCH_INIT.headers };
|
|
31
|
+
if (init?.headers) headers = { ...headers, ...init.headers };
|
|
32
32
|
|
|
33
33
|
if (this.userAgent) {
|
|
34
34
|
(headers as Record<string, string>)["User-Agent"] = this.userAgent;
|
|
@@ -40,7 +40,6 @@ export abstract class BaseService {
|
|
|
40
40
|
}
|
|
41
41
|
init.headers = headers;
|
|
42
42
|
|
|
43
|
-
init.cache = "no-store";
|
|
44
43
|
if (!input.startsWith("http")) input = this.params.baseUrl + input;
|
|
45
44
|
|
|
46
45
|
const response = await fetch(input, init);
|