assemblyai 4.3.1 → 4.3.3

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +165 -89
  3. package/dist/assemblyai.umd.js +62 -56
  4. package/dist/assemblyai.umd.min.js +1 -1
  5. package/dist/bun.mjs +57 -51
  6. package/dist/deno.mjs +57 -51
  7. package/dist/index.cjs +62 -56
  8. package/dist/index.mjs +62 -56
  9. package/dist/node.cjs +57 -51
  10. package/dist/node.mjs +57 -51
  11. package/dist/services/base.d.ts +1 -1
  12. package/dist/services/files/index.d.ts +2 -2
  13. package/dist/services/index.d.ts +1 -1
  14. package/dist/services/lemur/index.d.ts +1 -1
  15. package/dist/services/realtime/service.d.ts +2 -2
  16. package/dist/services/transcripts/index.d.ts +26 -26
  17. package/dist/types/asyncapi.generated.d.ts +60 -39
  18. package/dist/types/openapi.generated.d.ts +740 -347
  19. package/dist/types/services/index.d.ts +0 -1
  20. package/dist/types/transcripts/index.d.ts +14 -5
  21. package/package.json +26 -25
  22. package/src/polyfills/fs/index.ts +2 -2
  23. package/src/polyfills/fs/node.ts +1 -1
  24. package/src/polyfills/streams/index.ts +2 -2
  25. package/src/services/base.ts +3 -3
  26. package/src/services/files/index.ts +2 -2
  27. package/src/services/index.ts +1 -1
  28. package/src/services/lemur/index.ts +5 -5
  29. package/src/services/realtime/factory.ts +1 -1
  30. package/src/services/realtime/service.ts +7 -8
  31. package/src/services/transcripts/index.ts +59 -63
  32. package/src/types/asyncapi.generated.ts +64 -42
  33. package/src/types/openapi.generated.ts +748 -352
  34. package/src/types/services/index.ts +0 -1
  35. package/src/types/transcripts/index.ts +17 -7
  36. package/dist/types/services/abstractions.d.ts +0 -52
  37. package/src/types/services/abstractions.ts +0 -56
@@ -3,5 +3,4 @@ type BaseServiceParams = {
3
3
  baseUrl?: string;
4
4
  };
5
5
 
6
- export * from "./abstractions";
7
6
  export type { BaseServiceParams };
@@ -1,23 +1,29 @@
1
1
  import { FileUploadParams } from "../files";
2
2
  import { TranscriptParams } from "../openapi.generated";
3
3
 
4
+ /**
5
+ * Options for polling.
6
+ */
4
7
  export type PollingOptions = {
5
8
  /**
6
9
  * The amount of time to wait between polling requests.
7
- * @default 3000 or every 3 seconds
10
+ * @defaultValue 3000 or every 3 seconds
8
11
  */
9
12
  pollingInterval?: number;
10
13
  /**
11
14
  * The maximum amount of time to wait for the transcript to be ready.
12
- * @default -1 which means wait forever
15
+ * @defaultValue -1 which means wait forever
13
16
  */
14
17
  pollingTimeout?: number;
15
18
  };
16
19
 
20
+ /**
21
+ * @deprecated Use `TranscriptService.transcribe` with `TranscribeOptions`.
22
+ */
17
23
  export type CreateTranscriptOptions = {
18
24
  /**
19
25
  * Whether to poll the transcript until it is ready.
20
- * @default true
26
+ * @defaultValue true
21
27
  */
22
28
  poll?: boolean;
23
29
  } & PollingOptions;
@@ -30,10 +36,14 @@ export type AudioToTranscribe = FileUploadParams;
30
36
  /**
31
37
  * The parameters to transcribe an audio file.
32
38
  */
33
- export type TranscribeParams = { audio: AudioToTranscribe } & Omit<
34
- TranscriptParams,
35
- "audio_url"
36
- >;
39
+ export type TranscribeParams =
40
+ | ({
41
+ /**
42
+ * The audio to transcribe. This can be a public URL, a local file path, a readable file stream, or a file buffer.
43
+ */
44
+ audio: AudioToTranscribe;
45
+ } & Omit<TranscriptParams, "audio_url">)
46
+ | TranscriptParams;
37
47
 
38
48
  /**
39
49
  * The parameters to start the transcription of an audio file.
@@ -1,52 +0,0 @@
1
- /**
2
- * Interface for classes that can create resources.
3
- * @template T The type of the resource.
4
- * @template Params The type of the parameters required to create the resource.
5
- */
6
- interface Createable<T, Params, Options = Record<string, unknown>> {
7
- /**
8
- * Create a new resource.
9
- * @param params The parameters of the new resource.
10
- * @param options The options used for creating the new resource.
11
- * @return A promise that resolves to the newly created resource.
12
- */
13
- create(params: Params, options?: Options): Promise<T>;
14
- }
15
- /**
16
- * Interface for classes that can retrieve resources.
17
- * @template T The type of the resource.
18
- * @template Id The type of the resource's identifier. Defaults to string.
19
- */
20
- interface Retrieveable<T, Id = string> {
21
- /**
22
- * Get a resource.
23
- * @param id The identifier of the resource to retrieve.
24
- * @return A promise that resolves to the retrieved resource.
25
- */
26
- get(id: Id): Promise<T>;
27
- }
28
- /**
29
- * Interface for classes that can delete resources.
30
- * @template T The type of the resource.
31
- * @template Id The type of the resource's identifier. Defaults to string.
32
- */
33
- interface Deletable<T, Id = string> {
34
- /**
35
- * Delete a resource.
36
- * @param id The identifier of the resource to delete.
37
- * @return A promise that resolves to a boolean indicating whether the deletion was successful.
38
- */
39
- delete(id: Id): Promise<T>;
40
- }
41
- /**
42
- * Interface for classes that can list resources.
43
- * @template T The type of the resource.
44
- */
45
- interface Listable<T, Page = string> {
46
- /**
47
- * List all resources.
48
- * @return A promise that resolves to an array of resources.
49
- */
50
- list(page?: Page): Promise<T>;
51
- }
52
- export type { Createable, Retrieveable, Deletable, Listable };
@@ -1,56 +0,0 @@
1
- /**
2
- * Interface for classes that can create resources.
3
- * @template T The type of the resource.
4
- * @template Params The type of the parameters required to create the resource.
5
- */
6
- interface Createable<T, Params, Options = Record<string, unknown>> {
7
- /**
8
- * Create a new resource.
9
- * @param params The parameters of the new resource.
10
- * @param options The options used for creating the new resource.
11
- * @return A promise that resolves to the newly created resource.
12
- */
13
- create(params: Params, options?: Options): Promise<T>;
14
- }
15
-
16
- /**
17
- * Interface for classes that can retrieve resources.
18
- * @template T The type of the resource.
19
- * @template Id The type of the resource's identifier. Defaults to string.
20
- */
21
- interface Retrieveable<T, Id = string> {
22
- /**
23
- * Get a resource.
24
- * @param id The identifier of the resource to retrieve.
25
- * @return A promise that resolves to the retrieved resource.
26
- */
27
- get(id: Id): Promise<T>;
28
- }
29
-
30
- /**
31
- * Interface for classes that can delete resources.
32
- * @template T The type of the resource.
33
- * @template Id The type of the resource's identifier. Defaults to string.
34
- */
35
- interface Deletable<T, Id = string> {
36
- /**
37
- * Delete a resource.
38
- * @param id The identifier of the resource to delete.
39
- * @return A promise that resolves to a boolean indicating whether the deletion was successful.
40
- */
41
- delete(id: Id): Promise<T>;
42
- }
43
-
44
- /**
45
- * Interface for classes that can list resources.
46
- * @template T The type of the resource.
47
- */
48
- interface Listable<T, Page = string> {
49
- /**
50
- * List all resources.
51
- * @return A promise that resolves to an array of resources.
52
- */
53
- list(page?: Page): Promise<T>;
54
- }
55
-
56
- export type { Createable, Retrieveable, Deletable, Listable };