@langchain/google-gauth 0.0.12 → 0.0.14
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/dist/auth.cjs +12 -3
- package/dist/auth.d.ts +6 -1
- package/dist/auth.js +11 -3
- package/package.json +2 -2
package/dist/auth.cjs
CHANGED
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GAuthClient = void 0;
|
|
3
|
+
exports.GAuthClient = exports.NodeJsonStream = void 0;
|
|
4
4
|
const google_common_1 = require("@langchain/google-common");
|
|
5
5
|
const google_auth_library_1 = require("google-auth-library");
|
|
6
6
|
class NodeJsonStream extends google_common_1.JsonStream {
|
|
7
7
|
constructor(data) {
|
|
8
8
|
super();
|
|
9
|
-
|
|
10
|
-
data.on("
|
|
9
|
+
const decoder = new TextDecoder("utf-8");
|
|
10
|
+
data.on("data", (data) => {
|
|
11
|
+
const text = decoder.decode(data, { stream: true });
|
|
12
|
+
this.appendBuffer(text);
|
|
13
|
+
});
|
|
14
|
+
data.on("end", () => {
|
|
15
|
+
const rest = decoder.decode();
|
|
16
|
+
this.appendBuffer(rest);
|
|
17
|
+
this.closeBuffer();
|
|
18
|
+
});
|
|
11
19
|
}
|
|
12
20
|
}
|
|
21
|
+
exports.NodeJsonStream = NodeJsonStream;
|
|
13
22
|
class GAuthClient {
|
|
14
23
|
constructor(fields) {
|
|
15
24
|
Object.defineProperty(this, "gauth", {
|
package/dist/auth.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
+
import { Readable } from "stream";
|
|
3
|
+
import { GoogleAbstractedClient, GoogleAbstractedClientOps, GoogleBaseLLMInput, JsonStream } from "@langchain/google-common";
|
|
2
4
|
import { GoogleAuth, GoogleAuthOptions } from "google-auth-library";
|
|
5
|
+
export declare class NodeJsonStream extends JsonStream {
|
|
6
|
+
constructor(data: Readable);
|
|
7
|
+
}
|
|
3
8
|
export declare class GAuthClient implements GoogleAbstractedClient {
|
|
4
9
|
gauth: GoogleAuth;
|
|
5
10
|
constructor(fields?: GoogleBaseLLMInput<GoogleAuthOptions>);
|
package/dist/auth.js
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { ensureAuthOptionScopes, JsonStream, } from "@langchain/google-common";
|
|
2
2
|
import { GoogleAuth } from "google-auth-library";
|
|
3
|
-
class NodeJsonStream extends JsonStream {
|
|
3
|
+
export class NodeJsonStream extends JsonStream {
|
|
4
4
|
constructor(data) {
|
|
5
5
|
super();
|
|
6
|
-
|
|
7
|
-
data.on("
|
|
6
|
+
const decoder = new TextDecoder("utf-8");
|
|
7
|
+
data.on("data", (data) => {
|
|
8
|
+
const text = decoder.decode(data, { stream: true });
|
|
9
|
+
this.appendBuffer(text);
|
|
10
|
+
});
|
|
11
|
+
data.on("end", () => {
|
|
12
|
+
const rest = decoder.decode();
|
|
13
|
+
this.appendBuffer(rest);
|
|
14
|
+
this.closeBuffer();
|
|
15
|
+
});
|
|
8
16
|
}
|
|
9
17
|
}
|
|
10
18
|
export class GAuthClient {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langchain/google-gauth",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"description": "Google auth based authentication support for Google services",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"license": "MIT",
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@langchain/core": "~0.1.56",
|
|
43
|
-
"@langchain/google-common": "~0.0.
|
|
43
|
+
"@langchain/google-common": "~0.0.13",
|
|
44
44
|
"google-auth-library": "^8.9.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|