assemblyai
Advanced tools
Comparing version 2.0.1 to 2.0.2-beta
@@ -1,4 +0,4 @@ | ||
import AssemblyAI from "./services"; | ||
import { AssemblyAI } from "./services"; | ||
export * from "./services"; | ||
export type * from "./types"; | ||
export default AssemblyAI; |
@@ -167,2 +167,3 @@ import axios, { isAxiosError } from 'axios'; | ||
} | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
on(event, listener) { | ||
@@ -172,3 +173,3 @@ this.listeners[event] = listener; | ||
connect() { | ||
return new Promise((resolve, _) => { | ||
return new Promise((resolve) => { | ||
if (this.socket) { | ||
@@ -256,3 +257,3 @@ throw new Error("Already connected"); | ||
if (waitForSessionTermination) { | ||
const sessionTerminatedPromise = new Promise((resolve, _) => { | ||
const sessionTerminatedPromise = new Promise((resolve) => { | ||
this.sessionTerminatedResolve = resolve; | ||
@@ -327,2 +328,3 @@ }); | ||
const startTime = Date.now(); | ||
// eslint-disable-next-line no-constant-condition | ||
while (true) { | ||
@@ -477,2 +479,16 @@ const transcript = yield this.get(transcriptId); | ||
export { FileService, LemurService, RealtimeService, RealtimeServiceFactory, TranscriptService, AssemblyAI as default }; | ||
var services = /*#__PURE__*/Object.freeze({ | ||
__proto__: null, | ||
AssemblyAI: AssemblyAI, | ||
FileService: FileService, | ||
LemurService: LemurService, | ||
RealtimeService: RealtimeService, | ||
RealtimeServiceFactory: RealtimeServiceFactory, | ||
TranscriptService: TranscriptService | ||
}); | ||
class AssemblyAIExports extends AssemblyAI { | ||
} | ||
module.exports = Object.assign(AssemblyAIExports, services); | ||
export { AssemblyAI, FileService, LemurService, RealtimeService, RealtimeServiceFactory, TranscriptService, AssemblyAI as default }; |
@@ -171,2 +171,3 @@ 'use strict'; | ||
} | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
on(event, listener) { | ||
@@ -176,3 +177,3 @@ this.listeners[event] = listener; | ||
connect() { | ||
return new Promise((resolve, _) => { | ||
return new Promise((resolve) => { | ||
if (this.socket) { | ||
@@ -260,3 +261,3 @@ throw new Error("Already connected"); | ||
if (waitForSessionTermination) { | ||
const sessionTerminatedPromise = new Promise((resolve, _) => { | ||
const sessionTerminatedPromise = new Promise((resolve) => { | ||
this.sessionTerminatedResolve = resolve; | ||
@@ -331,2 +332,3 @@ }); | ||
const startTime = Date.now(); | ||
// eslint-disable-next-line no-constant-condition | ||
while (true) { | ||
@@ -481,2 +483,17 @@ const transcript = yield this.get(transcriptId); | ||
var services = /*#__PURE__*/Object.freeze({ | ||
__proto__: null, | ||
AssemblyAI: AssemblyAI, | ||
FileService: FileService, | ||
LemurService: LemurService, | ||
RealtimeService: RealtimeService, | ||
RealtimeServiceFactory: RealtimeServiceFactory, | ||
TranscriptService: TranscriptService | ||
}); | ||
class AssemblyAIExports extends AssemblyAI { | ||
} | ||
module.exports = Object.assign(AssemblyAIExports, services); | ||
exports.AssemblyAI = AssemblyAI; | ||
exports.FileService = FileService; | ||
@@ -483,0 +500,0 @@ exports.LemurService = LemurService; |
@@ -5,3 +5,3 @@ import { AxiosInstance } from "axios"; | ||
*/ | ||
declare abstract class BaseService { | ||
export declare abstract class BaseService { | ||
protected client: AxiosInstance; | ||
@@ -14,2 +14,1 @@ /** | ||
} | ||
export default BaseService; |
@@ -1,3 +0,3 @@ | ||
import BaseService from "@/services/base"; | ||
export default class FileService extends BaseService { | ||
import { BaseService } from "@/services/base"; | ||
export declare class FileService extends BaseService { | ||
/** | ||
@@ -4,0 +4,0 @@ * Upload a local file to AssemblyAI. |
import { BaseServiceParams } from "@/types"; | ||
import LemurService from "./lemur"; | ||
import { LemurService } from "./lemur"; | ||
import { RealtimeService, RealtimeServiceFactory } from "./realtime"; | ||
import TranscriptService from "./transcripts"; | ||
import FileService from "./files"; | ||
export default class AssemblyAI { | ||
import { TranscriptService } from "./transcripts"; | ||
import { FileService } from "./files"; | ||
declare class AssemblyAI { | ||
/** | ||
@@ -29,2 +29,2 @@ * The files service. | ||
} | ||
export { LemurService, RealtimeServiceFactory, RealtimeService, TranscriptService, FileService, }; | ||
export { AssemblyAI, LemurService, RealtimeServiceFactory, RealtimeService, TranscriptService, FileService, }; |
import { LemurSummaryParameters, LemurActionItemsParameters, LemurQuestionAnswerParameters, LemurTaskParameters, LemurSummaryResponse, LemurQuestionAnswerResponse, LemurActionItemsResponse, LemurTaskResponse } from "@/types"; | ||
import BaseService from "@/services/base"; | ||
export default class LemurService extends BaseService { | ||
import { BaseService } from "@/services/base"; | ||
export declare class LemurService extends BaseService { | ||
summary(params: LemurSummaryParameters): Promise<LemurSummaryResponse>; | ||
@@ -5,0 +5,0 @@ questionAnswer(params: LemurQuestionAnswerParameters): Promise<LemurQuestionAnswerResponse>; |
@@ -1,6 +0,6 @@ | ||
import BaseService from "@/services/base"; | ||
import { BaseService } from "@/services/base"; | ||
import { ParagraphsResponse, SentencesResponse, Transcript, TranscriptList, CreateTranscriptParameters, CreateTranscriptOptions, Createable, Deletable, Listable, Retrieveable, SubtitleFormat, RedactedAudioResponse } from "@/types"; | ||
import { AxiosInstance } from "axios"; | ||
import FileService from "../files"; | ||
export default class TranscriptService extends BaseService implements Createable<Transcript, CreateTranscriptParameters, CreateTranscriptOptions>, Retrieveable<Transcript>, Deletable<Transcript>, Listable<TranscriptList> { | ||
import { FileService } from "../files"; | ||
export declare class TranscriptService extends BaseService implements Createable<Transcript, CreateTranscriptParameters, CreateTranscriptOptions>, Retrieveable<Transcript>, Deletable<Transcript>, Listable<TranscriptList> { | ||
private files; | ||
@@ -7,0 +7,0 @@ constructor(client: AxiosInstance, files: FileService); |
@@ -6,3 +6,3 @@ /** | ||
*/ | ||
interface Createable<T, Parameters, Options = Record<string, any>> { | ||
interface Createable<T, Parameters, Options = Record<string, unknown>> { | ||
/** | ||
@@ -9,0 +9,0 @@ * Create a new resource. |
@@ -1,1 +0,1 @@ | ||
export { default as RealtimeError, RealtimeErrorType, RealtimeErrorMessages, } from "./realtime"; | ||
export { RealtimeError, RealtimeErrorType, RealtimeErrorMessages, } from "./realtime"; |
@@ -22,3 +22,2 @@ declare enum RealtimeErrorType { | ||
} | ||
export { RealtimeErrorType, RealtimeErrorMessages }; | ||
export default RealtimeError; | ||
export { RealtimeError, RealtimeErrorType, RealtimeErrorMessages }; |
{ | ||
"name": "assemblyai", | ||
"version": "2.0.1", | ||
"version": "2.0.2-beta", | ||
"description": "The AssemblyAI Node.js 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.", | ||
@@ -14,3 +14,3 @@ "main": "dist/index.js", | ||
"publishConfig": { | ||
"tag": "latest", | ||
"tag": "beta", | ||
"access": "public", | ||
@@ -22,3 +22,3 @@ "registry": "https://registry.npmjs.org/" | ||
"clean": "rimraf dist", | ||
"lint": "tslint -p tsconfig.json", | ||
"lint": "eslint -c .eslintrc.json 'src/**/*'", | ||
"test": "pnpm lint && pnpm test:unit", | ||
@@ -50,4 +50,5 @@ "test:unit": "jest --config jest.config.rollup.ts", | ||
"@types/ws": "^8.5.5", | ||
"@typescript-eslint/eslint-plugin": "^6.7.5", | ||
"dotenv": "^16.3.1", | ||
"eslint": "^8.43.0", | ||
"eslint": "^8.48.0", | ||
"i": "^0.3.7", | ||
@@ -69,3 +70,2 @@ "jest": "^29.5.0", | ||
"tslib": "^2.5.3", | ||
"tslint": "^6.1.3", | ||
"typescript": "^5.2.2" | ||
@@ -72,0 +72,0 @@ }, |
@@ -5,2 +5,11 @@ <img src="https://github.com/AssemblyAI/assemblyai-node-sdk/blob/main/assemblyai.png?raw=true" width="500"/> | ||
[![npm](https://img.shields.io/npm/v/assemblyai)](https://www.npmjs.com/package/assemblyai) | ||
[![Test](https://github.com/AssemblyAI/assemblyai-node-sdk/actions/workflows/test.yml/badge.svg)](https://github.com/AssemblyAI/assemblyai-node-sdk/actions/workflows/test.yml) | ||
[![GitHub License](https://img.shields.io/github/license/AssemblyAI/assemblyai-node-sdk)](https://github.com/AssemblyAI/assemblyai-node-sdk/blob/master/LICENSE) | ||
[![AssemblyAI Twitter](https://img.shields.io/twitter/follow/AssemblyAI?label=%40AssemblyAI&style=social)](https://twitter.com/AssemblyAI) | ||
[![AssemblyAI YouTube](https://img.shields.io/youtube/channel/subscribers/UCtatfZMf-8EkIwASXM4ts0A)](https://www.youtube.com/@AssemblyAI) | ||
[![Discord](https://img.shields.io/discord/875120158014853141?logo=discord&label=Discord&link=https%3A%2F%2Fdiscord.com%2Fchannels%2F875120158014853141&style=social) | ||
](https://discord.gg/5aQNZyq3) | ||
# AssemblyAI Node.js SDK | ||
@@ -7,0 +16,0 @@ |
@@ -1,5 +0,7 @@ | ||
import AssemblyAI from "./services"; | ||
import * as services from "./services"; | ||
import { AssemblyAI } from "./services"; | ||
export * from "./services"; | ||
export type * from "./types"; | ||
export default AssemblyAI; | ||
class AssemblyAIExports extends AssemblyAI {} | ||
module.exports = Object.assign(AssemblyAIExports, services); |
@@ -6,3 +6,3 @@ import { AxiosInstance } from "axios"; | ||
*/ | ||
abstract class BaseService { | ||
export abstract class BaseService { | ||
/** | ||
@@ -14,3 +14,1 @@ * Create a new service. | ||
} | ||
export default BaseService; |
import { readFile } from "fs/promises"; | ||
import BaseService from "@/services/base"; | ||
import { BaseService } from "@/services/base"; | ||
import { UploadedFile } from "@/types"; | ||
export default class FileService extends BaseService { | ||
export class FileService extends BaseService { | ||
/** | ||
@@ -7,0 +7,0 @@ * Upload a local file to AssemblyAI. |
import { createAxiosClient } from "@/utils/axios"; | ||
import { BaseServiceParams } from "@/types"; | ||
import LemurService from "./lemur"; | ||
import { LemurService } from "./lemur"; | ||
import { RealtimeService, RealtimeServiceFactory } from "./realtime"; | ||
import TranscriptService from "./transcripts"; | ||
import FileService from "./files"; | ||
import { TranscriptService } from "./transcripts"; | ||
import { FileService } from "./files"; | ||
export default class AssemblyAI { | ||
class AssemblyAI { | ||
/** | ||
@@ -44,2 +44,3 @@ * The files service. | ||
export { | ||
AssemblyAI, | ||
LemurService, | ||
@@ -46,0 +47,0 @@ RealtimeServiceFactory, |
@@ -11,5 +11,5 @@ import { | ||
} from "@/types"; | ||
import BaseService from "@/services/base"; | ||
import { BaseService } from "@/services/base"; | ||
export default class LemurService extends BaseService { | ||
export class LemurService extends BaseService { | ||
async summary(params: LemurSummaryParameters): Promise<LemurSummaryResponse> { | ||
@@ -16,0 +16,0 @@ const { data } = await this.client.post<LemurSummaryResponse>( |
@@ -78,2 +78,3 @@ import WebSocket from "ws"; | ||
on(event: "close", listener: (code: number, reason: string) => void): void; | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
on(event: RealtimeEvents, listener: (...args: any[]) => void) { | ||
@@ -84,3 +85,3 @@ this.listeners[event] = listener; | ||
connect() { | ||
return new Promise<SessionBeginsEventData>((resolve, _) => { | ||
return new Promise<SessionBeginsEventData>((resolve) => { | ||
if (this.socket) { | ||
@@ -170,3 +171,3 @@ throw new Error("Already connected"); | ||
if (waitForSessionTermination) { | ||
const sessionTerminatedPromise = new Promise<void>((resolve, _) => { | ||
const sessionTerminatedPromise = new Promise<void>((resolve) => { | ||
this.sessionTerminatedResolve = resolve; | ||
@@ -173,0 +174,0 @@ }); |
@@ -1,2 +0,2 @@ | ||
import BaseService from "@/services/base"; | ||
import { BaseService } from "@/services/base"; | ||
import { | ||
@@ -17,5 +17,5 @@ ParagraphsResponse, | ||
import { AxiosInstance } from "axios"; | ||
import FileService from "../files"; | ||
import { FileService } from "../files"; | ||
export default class TranscriptService | ||
export class TranscriptService | ||
extends BaseService | ||
@@ -62,2 +62,3 @@ implements | ||
const startTime = Date.now(); | ||
// eslint-disable-next-line no-constant-condition | ||
while (true) { | ||
@@ -64,0 +65,0 @@ const transcript = await this.get(transcriptId); |
@@ -6,3 +6,3 @@ /** | ||
*/ | ||
interface Createable<T, Parameters, Options = Record<string, any>> { | ||
interface Createable<T, Parameters, Options = Record<string, unknown>> { | ||
/** | ||
@@ -9,0 +9,0 @@ * Create a new resource. |
export { | ||
default as RealtimeError, | ||
RealtimeError, | ||
RealtimeErrorType, | ||
RealtimeErrorMessages, | ||
} from "./realtime"; |
@@ -44,3 +44,2 @@ enum RealtimeErrorType { | ||
export { RealtimeErrorType, RealtimeErrorMessages }; | ||
export default RealtimeError; | ||
export { RealtimeError, RealtimeErrorType, RealtimeErrorMessages }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
156630
3569
235
1