@awsesh/core 1.0.0-beta.202601210751 → 1.0.0-beta.202601241025
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/index.d.ts +5 -0
- package/index.js +18 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -57,6 +57,11 @@ export declare function createAwsesh(options: AwseshOptions): {
|
|
|
57
57
|
save: (sessionName: string, accountId: string, roleName: string) => Promise<void>;
|
|
58
58
|
getAll: (sessionName: string) => Promise<Record<string, string>>;
|
|
59
59
|
};
|
|
60
|
+
preferredRegions: {
|
|
61
|
+
get: (sessionName: string, accountId: string) => Promise<string | undefined>;
|
|
62
|
+
save: (sessionName: string, accountId: string, region: string) => Promise<void>;
|
|
63
|
+
getAll: (sessionName: string) => Promise<Record<string, string>>;
|
|
64
|
+
};
|
|
60
65
|
credentials: {
|
|
61
66
|
write: (profileName: string, creds: RoleCredentials, region?: string) => Promise<void>;
|
|
62
67
|
removeProfile: (profileName: string) => Promise<void>;
|
package/index.js
CHANGED
|
@@ -20374,6 +20374,24 @@ function createAwsesh(options) {
|
|
|
20374
20374
|
return data?.[sessionName] ?? {};
|
|
20375
20375
|
}
|
|
20376
20376
|
},
|
|
20377
|
+
preferredRegions: {
|
|
20378
|
+
get: async (sessionName, accountId) => {
|
|
20379
|
+
const data = await storage.read("preference/preferred-regions");
|
|
20380
|
+
return data?.[sessionName]?.[accountId];
|
|
20381
|
+
},
|
|
20382
|
+
save: async (sessionName, accountId, region) => {
|
|
20383
|
+
await storage.update("preference/preferred-regions", (draft) => {
|
|
20384
|
+
if (!draft[sessionName])
|
|
20385
|
+
draft[sessionName] = {};
|
|
20386
|
+
draft[sessionName][accountId] = region;
|
|
20387
|
+
return draft;
|
|
20388
|
+
});
|
|
20389
|
+
},
|
|
20390
|
+
getAll: async (sessionName) => {
|
|
20391
|
+
const data = await storage.read("preference/preferred-regions");
|
|
20392
|
+
return data?.[sessionName] ?? {};
|
|
20393
|
+
}
|
|
20394
|
+
},
|
|
20377
20395
|
credentials: {
|
|
20378
20396
|
write: async (profileName, creds, region) => {
|
|
20379
20397
|
await Credentials.write({
|