@awsesh/core 1.0.0-alpha.202512230737
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/client.d.ts +15 -0
- package/credentials.d.ts +10 -0
- package/index.d.ts +58 -0
- package/index.js +20333 -0
- package/package.json +23 -0
- package/sessions.d.ts +15 -0
- package/storage.d.ts +14 -0
- package/types.d.ts +63 -0
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@awsesh/core",
|
|
3
|
+
"version": "1.0.0-alpha.202512230737",
|
|
4
|
+
"description": "AWS SSO session management SDK",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./index.js",
|
|
7
|
+
"types": "./index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./index.js",
|
|
11
|
+
"types": "./index.d.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@aws-sdk/client-sso": "^3.701.0",
|
|
16
|
+
"@aws-sdk/client-sso-oidc": "^3.701.0"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/elva-labs/awsesh.git"
|
|
22
|
+
}
|
|
23
|
+
}
|
package/sessions.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SSOSession } from "./types";
|
|
2
|
+
export interface SessionsOptions {
|
|
3
|
+
dir: string;
|
|
4
|
+
}
|
|
5
|
+
export declare namespace Sessions {
|
|
6
|
+
function create(options: SessionsOptions): {
|
|
7
|
+
list(): Promise<SSOSession[]>;
|
|
8
|
+
load(name: string): Promise<SSOSession | undefined>;
|
|
9
|
+
save(session: SSOSession): Promise<void>;
|
|
10
|
+
remove(name: string): Promise<void>;
|
|
11
|
+
exists(name: string): Promise<boolean>;
|
|
12
|
+
count(): Promise<number>;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export type Sessions = ReturnType<typeof Sessions.create>;
|
package/storage.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface StorageOptions {
|
|
2
|
+
dir: string;
|
|
3
|
+
}
|
|
4
|
+
export declare namespace Storage {
|
|
5
|
+
function create(options: StorageOptions): {
|
|
6
|
+
read<T>(key: string): Promise<T | undefined>;
|
|
7
|
+
write<T>(key: string, value: T): Promise<void>;
|
|
8
|
+
update<T>(key: string, fn: (existing: T) => T): Promise<T>;
|
|
9
|
+
remove(key: string): Promise<void>;
|
|
10
|
+
list(prefix: string): Promise<string[]>;
|
|
11
|
+
exists(key: string): Promise<boolean>;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export type Storage = ReturnType<typeof Storage.create>;
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export interface AwseshOptions {
|
|
2
|
+
configDir: string;
|
|
3
|
+
dataDir: string;
|
|
4
|
+
awsDir: string;
|
|
5
|
+
}
|
|
6
|
+
export interface SSOSession {
|
|
7
|
+
name: string;
|
|
8
|
+
startUrl: string;
|
|
9
|
+
ssoRegion: string;
|
|
10
|
+
defaultRegion: string;
|
|
11
|
+
isChina?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface SSOLoginInfo {
|
|
14
|
+
verificationUri: string;
|
|
15
|
+
verificationUriComplete: string;
|
|
16
|
+
userCode: string;
|
|
17
|
+
deviceCode: string;
|
|
18
|
+
interval: number;
|
|
19
|
+
clientId: string;
|
|
20
|
+
clientSecret: string;
|
|
21
|
+
expiresAt: Date;
|
|
22
|
+
startUrl: string;
|
|
23
|
+
}
|
|
24
|
+
export interface TokenCache {
|
|
25
|
+
token: string;
|
|
26
|
+
expiresAt: Date;
|
|
27
|
+
startUrl: string;
|
|
28
|
+
}
|
|
29
|
+
export interface TokenResult {
|
|
30
|
+
token: string;
|
|
31
|
+
expiresAt: Date;
|
|
32
|
+
}
|
|
33
|
+
export interface Account {
|
|
34
|
+
accountId: string;
|
|
35
|
+
name: string;
|
|
36
|
+
roles: string[];
|
|
37
|
+
rolesLoaded: boolean;
|
|
38
|
+
region?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface AccountCache {
|
|
41
|
+
accounts: Account[];
|
|
42
|
+
lastUpdated: number;
|
|
43
|
+
}
|
|
44
|
+
export interface RoleCredentials {
|
|
45
|
+
accessKeyId: string;
|
|
46
|
+
secretAccessKey: string;
|
|
47
|
+
sessionToken: string;
|
|
48
|
+
expiration: Date;
|
|
49
|
+
}
|
|
50
|
+
export interface LastSelected {
|
|
51
|
+
session?: string;
|
|
52
|
+
account?: string;
|
|
53
|
+
role?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface ActiveCredential {
|
|
56
|
+
profileName: string;
|
|
57
|
+
accountId: string;
|
|
58
|
+
accountName: string;
|
|
59
|
+
roleName: string;
|
|
60
|
+
sessionName: string;
|
|
61
|
+
expiration: string;
|
|
62
|
+
isDefault: boolean;
|
|
63
|
+
}
|