@translated/lara 1.2.0 → 1.2.2
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/lib/crypto/browser-crypto.d.ts +11 -1
- package/lib/crypto/node-crypto.d.ts +6 -1
- package/lib/crypto/portable-crypto.d.ts +5 -1
- package/lib/net/browser-client.d.ts +7 -1
- package/lib/net/client.d.ts +26 -0
- package/lib/net/node-client.d.ts +8 -1
- package/lib/sdk-version.d.ts +1 -1
- package/lib/sdk-version.js +1 -1
- package/lib/translator/translator.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { PortableCrypto } from "./portable-crypto";
|
|
2
|
+
/** @internal */
|
|
3
|
+
export declare class BrowserCrypto implements PortableCrypto {
|
|
4
|
+
private readonly subtle;
|
|
5
|
+
constructor();
|
|
6
|
+
/**
|
|
7
|
+
* MD5 in browser is not supported, so we use SHA-256 instead and return the first 16 bytes
|
|
8
|
+
*/
|
|
9
|
+
digest(data: string): Promise<string>;
|
|
10
|
+
hmac(key: string, data: string): Promise<string>;
|
|
11
|
+
}
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { BaseURL, ClientResponse, LaraClient } from "./client";
|
|
2
|
+
/** @internal */
|
|
3
|
+
export declare class BrowserLaraClient extends LaraClient {
|
|
4
|
+
private readonly baseUrl;
|
|
5
|
+
constructor(baseUrl: BaseURL, accessKeyId: string, accessKeySecret: string);
|
|
6
|
+
protected send(path: string, headers: Record<string, string>, body?: Record<string, any>): Promise<ClientResponse>;
|
|
7
|
+
}
|
package/lib/net/client.d.ts
CHANGED
|
@@ -1 +1,27 @@
|
|
|
1
|
+
type HttpMethod = "GET" | "POST" | "PUT" | "DELETE";
|
|
2
|
+
/** @internal */
|
|
3
|
+
export type BaseURL = {
|
|
4
|
+
secure: boolean;
|
|
5
|
+
hostname: string;
|
|
6
|
+
port: number;
|
|
7
|
+
};
|
|
8
|
+
/** @internal */
|
|
9
|
+
export type ClientResponse = {
|
|
10
|
+
statusCode: number;
|
|
11
|
+
body: any;
|
|
12
|
+
};
|
|
13
|
+
/** @internal */
|
|
14
|
+
export declare abstract class LaraClient {
|
|
15
|
+
private readonly crypto;
|
|
16
|
+
private readonly accessKeyId;
|
|
17
|
+
private readonly accessKeySecret;
|
|
18
|
+
protected constructor(accessKeyId: string, accessKeySecret: string);
|
|
19
|
+
get<T>(path: string, params?: Record<string, any>): Promise<T>;
|
|
20
|
+
delete<T>(path: string, params?: Record<string, any>): Promise<T>;
|
|
21
|
+
post<T>(path: string, body?: Record<string, any>, files?: Record<string, string>): Promise<T>;
|
|
22
|
+
put<T>(path: string, body?: Record<string, any>, files?: Record<string, string>): Promise<T>;
|
|
23
|
+
protected request<T>(method: HttpMethod, path: string, body?: Record<string, any>, files?: Record<string, any>): Promise<T>;
|
|
24
|
+
private sign;
|
|
25
|
+
protected abstract send(path: string, headers: Record<string, string>, body?: Record<string, any>): Promise<ClientResponse>;
|
|
26
|
+
}
|
|
1
27
|
export {};
|
package/lib/net/node-client.d.ts
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { BaseURL, ClientResponse, LaraClient } from "./client";
|
|
2
|
+
/** @internal */
|
|
3
|
+
export declare class NodeLaraClient extends LaraClient {
|
|
4
|
+
private readonly baseUrl;
|
|
5
|
+
private readonly agent;
|
|
6
|
+
constructor(baseUrl: BaseURL, accessKeyId: string, accessKeySecret: string);
|
|
7
|
+
protected send(path: string, headers: Record<string, string>, body?: Record<string, any>): Promise<ClientResponse>;
|
|
8
|
+
}
|
package/lib/sdk-version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.2.
|
|
1
|
+
export declare const version = "1.2.2";
|
package/lib/sdk-version.js
CHANGED
|
@@ -33,7 +33,7 @@ export type TranslateOptions = {
|
|
|
33
33
|
cacheTTLSeconds?: number;
|
|
34
34
|
};
|
|
35
35
|
export declare class Translator {
|
|
36
|
-
|
|
36
|
+
protected readonly client: LaraClient;
|
|
37
37
|
readonly memories: Memories;
|
|
38
38
|
constructor(credentials: Credentials, options?: TranslatorOptions);
|
|
39
39
|
getLanguages(): Promise<string[]>;
|