Skip to content

Commit 70fd2ae

Browse files
committed
feat: support update credentials
Signed-off-by: Kevin Cui <bh@bugs.cc>
1 parent a5a9ad3 commit 70fd2ae

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
"import": "./dist/operator/*.mjs"
3737
}
3838
},
39+
"files": [
40+
"dist",
41+
"src"
42+
],
3943
"module": "src/index.ts",
4044
"scripts": {
4145
"build": "tsdown",

src/client.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,17 @@ import { Request } from "./request";
33

44
export class Client {
55
public request: Request;
6-
public constructor(public readonly config: ClientConfig) {
6+
public constructor(private config: ClientConfig) {
77
this.request = new Request(config);
88
}
9+
10+
public async updateCredentials(accessKeyID: string, accessKeySecret: string, stsToken?: string) {
11+
this.config = {
12+
...this.config,
13+
accessKeyID,
14+
accessKeySecret,
15+
stsToken,
16+
};
17+
this.request = new Request(this.config);
18+
}
919
}

0 commit comments

Comments
 (0)