wuying-agentbay-sdk 0.1.0 → 0.3.3
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/README.md +124 -61
- package/dist/index.cjs +7848 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +3174 -0
- package/dist/index.d.ts +3174 -0
- package/dist/index.mjs +7864 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +86 -48
- package/dist/src/adb/adb.d.ts +0 -20
- package/dist/src/adb/adb.js +0 -57
- package/dist/src/adb/index.d.ts +0 -1
- package/dist/src/adb/index.js +0 -17
- package/dist/src/agent-bay.d.ts +0 -68
- package/dist/src/agent-bay.js +0 -213
- package/dist/src/api/client.d.ts +0 -191
- package/dist/src/api/client.js +0 -629
- package/dist/src/api/index.d.ts +0 -4
- package/dist/src/api/index.js +0 -26
- package/dist/src/api/models/CallMcpToolRequest.d.ts +0 -21
- package/dist/src/api/models/CallMcpToolRequest.js +0 -71
- package/dist/src/api/models/CallMcpToolResponse.d.ts +0 -19
- package/dist/src/api/models/CallMcpToolResponse.js +0 -68
- package/dist/src/api/models/CallMcpToolResponseBody.d.ts +0 -19
- package/dist/src/api/models/CallMcpToolResponseBody.js +0 -67
- package/dist/src/api/models/CreateMcpSessionRequest.d.ts +0 -19
- package/dist/src/api/models/CreateMcpSessionRequest.js +0 -67
- package/dist/src/api/models/CreateMcpSessionResponse.d.ts +0 -19
- package/dist/src/api/models/CreateMcpSessionResponse.js +0 -68
- package/dist/src/api/models/CreateMcpSessionResponseBody.d.ts +0 -20
- package/dist/src/api/models/CreateMcpSessionResponseBody.js +0 -71
- package/dist/src/api/models/CreateMcpSessionResponseBodyData.d.ts +0 -19
- package/dist/src/api/models/CreateMcpSessionResponseBodyData.js +0 -67
- package/dist/src/api/models/DeleteContextRequest.d.ts +0 -15
- package/dist/src/api/models/DeleteContextRequest.js +0 -59
- package/dist/src/api/models/DeleteContextResponse.d.ts +0 -19
- package/dist/src/api/models/DeleteContextResponse.js +0 -68
- package/dist/src/api/models/DeleteContextResponseBody.d.ts +0 -18
- package/dist/src/api/models/DeleteContextResponseBody.js +0 -65
- package/dist/src/api/models/GetContextRequest.d.ts +0 -16
- package/dist/src/api/models/GetContextRequest.js +0 -61
- package/dist/src/api/models/GetContextResponse.d.ts +0 -19
- package/dist/src/api/models/GetContextResponse.js +0 -68
- package/dist/src/api/models/GetContextResponseBody.d.ts +0 -20
- package/dist/src/api/models/GetContextResponseBody.js +0 -71
- package/dist/src/api/models/GetContextResponseBodyData.d.ts +0 -19
- package/dist/src/api/models/GetContextResponseBodyData.js +0 -67
- package/dist/src/api/models/GetLabelRequest.d.ts +0 -17
- package/dist/src/api/models/GetLabelRequest.js +0 -63
- package/dist/src/api/models/GetLabelResponse.d.ts +0 -19
- package/dist/src/api/models/GetLabelResponse.js +0 -68
- package/dist/src/api/models/GetLabelResponseBody.d.ts +0 -23
- package/dist/src/api/models/GetLabelResponseBody.js +0 -77
- package/dist/src/api/models/GetLabelResponseBodyData.d.ts +0 -14
- package/dist/src/api/models/GetLabelResponseBodyData.js +0 -57
- package/dist/src/api/models/GetLinkRequest.d.ts +0 -15
- package/dist/src/api/models/GetLinkRequest.js +0 -59
- package/dist/src/api/models/GetLinkResponse.d.ts +0 -19
- package/dist/src/api/models/GetLinkResponse.js +0 -68
- package/dist/src/api/models/GetLinkResponseBody.d.ts +0 -19
- package/dist/src/api/models/GetLinkResponseBody.js +0 -67
- package/dist/src/api/models/GetMcpResourceRequest.d.ts +0 -15
- package/dist/src/api/models/GetMcpResourceRequest.js +0 -59
- package/dist/src/api/models/GetMcpResourceResponse.d.ts +0 -19
- package/dist/src/api/models/GetMcpResourceResponse.js +0 -68
- package/dist/src/api/models/GetMcpResourceResponseBody.d.ts +0 -20
- package/dist/src/api/models/GetMcpResourceResponseBody.js +0 -71
- package/dist/src/api/models/GetMcpResourceResponseBodyData.d.ts +0 -17
- package/dist/src/api/models/GetMcpResourceResponseBodyData.js +0 -65
- package/dist/src/api/models/GetMcpResourceResponseBodyDataDesktopInfo.d.ts +0 -18
- package/dist/src/api/models/GetMcpResourceResponseBodyDataDesktopInfo.js +0 -65
- package/dist/src/api/models/ListContextsRequest.d.ts +0 -16
- package/dist/src/api/models/ListContextsRequest.js +0 -61
- package/dist/src/api/models/ListContextsResponse.d.ts +0 -19
- package/dist/src/api/models/ListContextsResponse.js +0 -68
- package/dist/src/api/models/ListContextsResponseBody.d.ts +0 -23
- package/dist/src/api/models/ListContextsResponseBody.js +0 -77
- package/dist/src/api/models/ListContextsResponseBodyData.d.ts +0 -19
- package/dist/src/api/models/ListContextsResponseBodyData.js +0 -67
- package/dist/src/api/models/ListSessionRequest.d.ts +0 -17
- package/dist/src/api/models/ListSessionRequest.js +0 -63
- package/dist/src/api/models/ListSessionResponse.d.ts +0 -19
- package/dist/src/api/models/ListSessionResponse.js +0 -68
- package/dist/src/api/models/ListSessionResponseBody.d.ts +0 -23
- package/dist/src/api/models/ListSessionResponseBody.js +0 -77
- package/dist/src/api/models/ListSessionResponseBodyData.d.ts +0 -14
- package/dist/src/api/models/ListSessionResponseBodyData.js +0 -57
- package/dist/src/api/models/ModifyContextRequest.d.ts +0 -16
- package/dist/src/api/models/ModifyContextRequest.js +0 -61
- package/dist/src/api/models/ModifyContextResponse.d.ts +0 -19
- package/dist/src/api/models/ModifyContextResponse.js +0 -68
- package/dist/src/api/models/ModifyContextResponseBody.d.ts +0 -18
- package/dist/src/api/models/ModifyContextResponseBody.js +0 -65
- package/dist/src/api/models/ReleaseMcpSessionRequest.d.ts +0 -15
- package/dist/src/api/models/ReleaseMcpSessionRequest.js +0 -59
- package/dist/src/api/models/ReleaseMcpSessionResponse.d.ts +0 -19
- package/dist/src/api/models/ReleaseMcpSessionResponse.js +0 -68
- package/dist/src/api/models/ReleaseMcpSessionResponseBody.d.ts +0 -18
- package/dist/src/api/models/ReleaseMcpSessionResponseBody.js +0 -65
- package/dist/src/api/models/SetLabelRequest.d.ts +0 -16
- package/dist/src/api/models/SetLabelRequest.js +0 -61
- package/dist/src/api/models/SetLabelResponse.d.ts +0 -19
- package/dist/src/api/models/SetLabelResponse.js +0 -68
- package/dist/src/api/models/SetLabelResponseBody.d.ts +0 -18
- package/dist/src/api/models/SetLabelResponseBody.js +0 -65
- package/dist/src/api/models/model.d.ts +0 -43
- package/dist/src/api/models/model.js +0 -89
- package/dist/src/application/application.d.ts +0 -88
- package/dist/src/application/application.js +0 -172
- package/dist/src/application/index.d.ts +0 -1
- package/dist/src/application/index.js +0 -17
- package/dist/src/command/command.d.ts +0 -43
- package/dist/src/command/command.js +0 -120
- package/dist/src/command/index.d.ts +0 -1
- package/dist/src/command/index.js +0 -17
- package/dist/src/config.d.ts +0 -15
- package/dist/src/config.js +0 -114
- package/dist/src/context.d.ts +0 -87
- package/dist/src/context.js +0 -208
- package/dist/src/exceptions.d.ts +0 -30
- package/dist/src/exceptions.js +0 -58
- package/dist/src/filesystem/filesystem.d.ts +0 -109
- package/dist/src/filesystem/filesystem.js +0 -245
- package/dist/src/filesystem/index.d.ts +0 -1
- package/dist/src/filesystem/index.js +0 -17
- package/dist/src/index.d.ts +0 -10
- package/dist/src/index.js +0 -32
- package/dist/src/oss/index.d.ts +0 -1
- package/dist/src/oss/index.js +0 -5
- package/dist/src/oss/oss.d.ts +0 -80
- package/dist/src/oss/oss.js +0 -233
- package/dist/src/session.d.ts +0 -99
- package/dist/src/session.js +0 -226
- package/dist/src/ui/index.d.ts +0 -1
- package/dist/src/ui/index.js +0 -17
- package/dist/src/ui/ui.d.ts +0 -95
- package/dist/src/ui/ui.js +0 -206
- package/dist/src/utils/logger.d.ts +0 -15
- package/dist/src/utils/logger.js +0 -48
- package/dist/src/window/index.d.ts +0 -1
- package/dist/src/window/index.js +0 -17
- package/dist/src/window/window.d.ts +0 -109
- package/dist/src/window/window.js +0 -220
- package/dist/tests/agent-bay.test.d.ts +0 -1
- package/dist/tests/agent-bay.test.js +0 -366
- package/dist/tests/integration/context-persistence.test.d.ts +0 -1
- package/dist/tests/integration/context-persistence.test.js +0 -226
- package/dist/tests/integration/context-session.test.d.ts +0 -1
- package/dist/tests/integration/context-session.test.js +0 -223
- package/dist/tests/integration/window-operations.test.d.ts +0 -1
- package/dist/tests/integration/window-operations.test.js +0 -228
- package/dist/tests/unit/adb.test.d.ts +0 -1
- package/dist/tests/unit/adb.test.js +0 -60
- package/dist/tests/unit/agent-bay.test.d.ts +0 -1
- package/dist/tests/unit/agent-bay.test.js +0 -182
- package/dist/tests/unit/application.test.d.ts +0 -1
- package/dist/tests/unit/application.test.js +0 -260
- package/dist/tests/unit/command.test.d.ts +0 -1
- package/dist/tests/unit/command.test.js +0 -252
- package/dist/tests/unit/context.test.d.ts +0 -1
- package/dist/tests/unit/context.test.js +0 -199
- package/dist/tests/unit/filesystem.test.d.ts +0 -1
- package/dist/tests/unit/filesystem.test.js +0 -493
- package/dist/tests/unit/oss.test.d.ts +0 -1
- package/dist/tests/unit/oss.test.js +0 -243
- package/dist/tests/unit/session-labels.test.d.ts +0 -1
- package/dist/tests/unit/session-labels.test.js +0 -138
- package/dist/tests/unit/session-params.test.d.ts +0 -1
- package/dist/tests/unit/session-params.test.js +0 -78
- package/dist/tests/unit/session.test.d.ts +0 -1
- package/dist/tests/unit/session.test.js +0 -204
- package/dist/tests/unit/ui.test.d.ts +0 -1
- package/dist/tests/unit/ui.test.js +0 -158
- package/dist/tests/unit/window.test.d.ts +0 -1
- package/dist/tests/unit/window.test.js +0 -331
- package/dist/tests/utils/test-helpers.d.ts +0 -35
- package/dist/tests/utils/test-helpers.js +0 -79
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const src_1 = require("../../src");
|
|
4
|
-
const test_helpers_1 = require("../utils/test-helpers");
|
|
5
|
-
const logger_1 = require("../../src/utils/logger");
|
|
6
|
-
// Helper function to get OSS credentials from environment variables or use defaults
|
|
7
|
-
function getOssCredentials() {
|
|
8
|
-
const accessKeyId = process.env.OSS_ACCESS_KEY_ID || 'test-access-key-id';
|
|
9
|
-
const accessKeySecret = process.env.OSS_ACCESS_KEY_SECRET || 'test-access-key-secret';
|
|
10
|
-
const securityToken = process.env.OSS_SECURITY_TOKEN || 'test-security-token';
|
|
11
|
-
const endpoint = process.env.OSS_ENDPOINT || 'https://oss-cn-hangzhou.aliyuncs.com';
|
|
12
|
-
const region = process.env.OSS_REGION || 'cn-hangzhou';
|
|
13
|
-
if (!process.env.OSS_ACCESS_KEY_ID) {
|
|
14
|
-
(0, logger_1.log)('OSS_ACCESS_KEY_ID environment variable not set, using default value');
|
|
15
|
-
}
|
|
16
|
-
if (!process.env.OSS_ACCESS_KEY_SECRET) {
|
|
17
|
-
(0, logger_1.log)('OSS_ACCESS_KEY_SECRET environment variable not set, using default value');
|
|
18
|
-
}
|
|
19
|
-
if (!process.env.OSS_SECURITY_TOKEN) {
|
|
20
|
-
(0, logger_1.log)('OSS_SECURITY_TOKEN environment variable not set, using default value');
|
|
21
|
-
}
|
|
22
|
-
if (!process.env.OSS_ENDPOINT) {
|
|
23
|
-
(0, logger_1.log)('OSS_ENDPOINT environment variable not set, using default value');
|
|
24
|
-
}
|
|
25
|
-
if (!process.env.OSS_REGION) {
|
|
26
|
-
(0, logger_1.log)('OSS_REGION environment variable not set, using default value');
|
|
27
|
-
}
|
|
28
|
-
return {
|
|
29
|
-
accessKeyId,
|
|
30
|
-
accessKeySecret,
|
|
31
|
-
securityToken,
|
|
32
|
-
endpoint,
|
|
33
|
-
region
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
// Helper function to check if content has error
|
|
37
|
-
function hasErrorInContent(content) {
|
|
38
|
-
if (!Array.isArray(content)) {
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
if (content.length === 0) {
|
|
42
|
-
return true;
|
|
43
|
-
}
|
|
44
|
-
// Check if first content item has error text
|
|
45
|
-
return content.some(item => item && typeof item === 'object' &&
|
|
46
|
-
item.text && typeof item.text === 'string' &&
|
|
47
|
-
(item.text.includes('error') || item.text.includes('Error')));
|
|
48
|
-
}
|
|
49
|
-
describe('OSS', () => {
|
|
50
|
-
let agentBay;
|
|
51
|
-
let session;
|
|
52
|
-
beforeEach(async () => {
|
|
53
|
-
const apiKey = (0, test_helpers_1.getTestApiKey)();
|
|
54
|
-
agentBay = new src_1.AgentBay({ apiKey });
|
|
55
|
-
// Create a session
|
|
56
|
-
(0, logger_1.log)('Creating a new session for OSS testing...');
|
|
57
|
-
session = await agentBay.create({ imageId: 'code_latest' });
|
|
58
|
-
(0, logger_1.log)(`Session created with ID: ${session.sessionId}`);
|
|
59
|
-
});
|
|
60
|
-
afterEach(async () => {
|
|
61
|
-
// Clean up the session
|
|
62
|
-
(0, logger_1.log)('Cleaning up: Deleting the session...');
|
|
63
|
-
try {
|
|
64
|
-
if (session)
|
|
65
|
-
await agentBay.delete(session);
|
|
66
|
-
}
|
|
67
|
-
catch (error) {
|
|
68
|
-
(0, logger_1.log)(`Warning: Error deleting session: ${error}`);
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
describe('envInit', () => {
|
|
72
|
-
it.only('should initialize OSS environment', async () => {
|
|
73
|
-
if (session.oss) {
|
|
74
|
-
// Get OSS credentials from environment variables
|
|
75
|
-
const { accessKeyId, accessKeySecret, securityToken, endpoint, region } = getOssCredentials();
|
|
76
|
-
(0, logger_1.log)('Initializing OSS environment...');
|
|
77
|
-
try {
|
|
78
|
-
const content = await session.oss.envInit(accessKeyId, accessKeySecret, securityToken, endpoint, region);
|
|
79
|
-
(0, logger_1.log)(`EnvInit content:`, content);
|
|
80
|
-
// Check if content has errors
|
|
81
|
-
expect(content).toBeDefined();
|
|
82
|
-
expect(Array.isArray(content)).toBe(true);
|
|
83
|
-
expect(hasErrorInContent(content)).toBe(false);
|
|
84
|
-
(0, logger_1.log)('OSS environment initialization successful');
|
|
85
|
-
}
|
|
86
|
-
catch (error) {
|
|
87
|
-
(0, logger_1.log)(`OSS environment initialization failed: ${error}`);
|
|
88
|
-
throw error;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
(0, logger_1.log)('Note: OSS interface is nil, skipping OSS test');
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
describe('upload', () => {
|
|
97
|
-
it.only('should upload a file to OSS', async () => {
|
|
98
|
-
if (session.oss && session.filesystem) {
|
|
99
|
-
// First initialize the OSS environment
|
|
100
|
-
const { accessKeyId, accessKeySecret, securityToken, endpoint, region } = getOssCredentials();
|
|
101
|
-
await session.oss.envInit(accessKeyId, accessKeySecret, securityToken, endpoint, region);
|
|
102
|
-
// Create a test file to upload
|
|
103
|
-
const testContent = "This is a test file for OSS upload.";
|
|
104
|
-
const testFilePath = "/tmp/test_oss_upload.txt";
|
|
105
|
-
await session.filesystem.writeFile(testFilePath, testContent);
|
|
106
|
-
(0, logger_1.log)('Uploading file to OSS...');
|
|
107
|
-
const bucket = process.env.OSS_TEST_BUCKET || 'test-bucket';
|
|
108
|
-
const objectKey = 'test-object.txt';
|
|
109
|
-
try {
|
|
110
|
-
const content = await session.oss.upload(bucket, objectKey, testFilePath);
|
|
111
|
-
(0, logger_1.log)(`Upload content:`, content);
|
|
112
|
-
// Check if content has errors
|
|
113
|
-
expect(content).toBeDefined();
|
|
114
|
-
expect(Array.isArray(content)).toBe(true);
|
|
115
|
-
expect(hasErrorInContent(content)).toBe(false);
|
|
116
|
-
(0, logger_1.log)('OSS upload successful');
|
|
117
|
-
}
|
|
118
|
-
catch (error) {
|
|
119
|
-
(0, logger_1.log)(`OSS upload failed: ${error}`);
|
|
120
|
-
throw error;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
(0, logger_1.log)('Note: OSS or FileSystem interface is nil, skipping OSS test');
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
});
|
|
128
|
-
describe('uploadAnonymous', () => {
|
|
129
|
-
it.only('should upload a file anonymously', async () => {
|
|
130
|
-
if (session.oss && session.filesystem) {
|
|
131
|
-
// Create a test file to upload
|
|
132
|
-
const testContent = "This is a test file for OSS anonymous upload.";
|
|
133
|
-
const testFilePath = "/tmp/test_oss_upload_anon.txt";
|
|
134
|
-
await session.filesystem.writeFile(testFilePath, testContent);
|
|
135
|
-
(0, logger_1.log)('Uploading file anonymously...');
|
|
136
|
-
const uploadUrl = process.env.OSS_TEST_UPLOAD_URL || 'https://example.com/upload/test-file.txt';
|
|
137
|
-
try {
|
|
138
|
-
const content = await session.oss.uploadAnonymous(uploadUrl, testFilePath);
|
|
139
|
-
(0, logger_1.log)(`UploadAnonymous content:`, content);
|
|
140
|
-
// Check if content has errors
|
|
141
|
-
expect(content).toBeDefined();
|
|
142
|
-
expect(Array.isArray(content)).toBe(true);
|
|
143
|
-
expect(hasErrorInContent(content)).toBe(false);
|
|
144
|
-
(0, logger_1.log)('OSS anonymous upload successful');
|
|
145
|
-
}
|
|
146
|
-
catch (error) {
|
|
147
|
-
(0, logger_1.log)(`OSS anonymous upload failed: ${error}`);
|
|
148
|
-
throw error;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
(0, logger_1.log)('Note: OSS or FileSystem interface is nil, skipping OSS test');
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
});
|
|
156
|
-
describe('download', () => {
|
|
157
|
-
it.only('should download a file from OSS', async () => {
|
|
158
|
-
if (session.oss && session.filesystem) {
|
|
159
|
-
// First initialize the OSS environment
|
|
160
|
-
const { accessKeyId, accessKeySecret, securityToken, endpoint, region } = getOssCredentials();
|
|
161
|
-
await session.oss.envInit(accessKeyId, accessKeySecret, securityToken, endpoint, region);
|
|
162
|
-
(0, logger_1.log)('Downloading file from OSS...');
|
|
163
|
-
const bucket = process.env.OSS_TEST_BUCKET || 'test-bucket';
|
|
164
|
-
const objectKey = 'test-object.txt';
|
|
165
|
-
const downloadPath = "/tmp/test_oss_download.txt";
|
|
166
|
-
try {
|
|
167
|
-
const content = await session.oss.download(bucket, objectKey, downloadPath);
|
|
168
|
-
(0, logger_1.log)(`Download content:`, content);
|
|
169
|
-
// Check if content has errors
|
|
170
|
-
expect(content).toBeDefined();
|
|
171
|
-
expect(Array.isArray(content)).toBe(true);
|
|
172
|
-
expect(hasErrorInContent(content)).toBe(false);
|
|
173
|
-
(0, logger_1.log)('OSS download successful');
|
|
174
|
-
// Verify the downloaded file exists
|
|
175
|
-
const fileInfo = await session.filesystem.getFileInfo(downloadPath);
|
|
176
|
-
(0, logger_1.log)(`Downloaded file info:`, fileInfo);
|
|
177
|
-
expect(fileInfo).toBeDefined();
|
|
178
|
-
}
|
|
179
|
-
catch (error) {
|
|
180
|
-
(0, logger_1.log)(`OSS download failed: ${error}`);
|
|
181
|
-
throw error;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
else {
|
|
185
|
-
(0, logger_1.log)('Note: OSS or FileSystem interface is nil, skipping OSS test');
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
});
|
|
189
|
-
describe('downloadAnonymous', () => {
|
|
190
|
-
it.only('should download a file anonymously', async () => {
|
|
191
|
-
if (session.oss && session.filesystem) {
|
|
192
|
-
(0, logger_1.log)('Downloading file anonymously...');
|
|
193
|
-
const downloadUrl = process.env.OSS_TEST_DOWNLOAD_URL || 'https://example.com/download/test-file.txt';
|
|
194
|
-
const downloadPath = "/tmp/test_oss_download_anon.txt";
|
|
195
|
-
try {
|
|
196
|
-
const content = await session.oss.downloadAnonymous(downloadUrl, downloadPath);
|
|
197
|
-
(0, logger_1.log)(`DownloadAnonymous content:`, content);
|
|
198
|
-
// Check if content has errors
|
|
199
|
-
expect(content).toBeDefined();
|
|
200
|
-
expect(Array.isArray(content)).toBe(true);
|
|
201
|
-
expect(hasErrorInContent(content)).toBe(false);
|
|
202
|
-
(0, logger_1.log)('OSS anonymous download successful');
|
|
203
|
-
// Verify the downloaded file exists
|
|
204
|
-
const fileInfo = await session.filesystem.getFileInfo(downloadPath);
|
|
205
|
-
(0, logger_1.log)(`Downloaded file info:`, fileInfo);
|
|
206
|
-
expect(fileInfo).toBeDefined();
|
|
207
|
-
}
|
|
208
|
-
catch (error) {
|
|
209
|
-
(0, logger_1.log)(`OSS anonymous download failed: ${error}`);
|
|
210
|
-
throw error;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
else {
|
|
214
|
-
(0, logger_1.log)('Note: OSS or FileSystem interface is nil, skipping OSS test');
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
});
|
|
218
|
-
describe('createClient', () => {
|
|
219
|
-
it.only('should create an OSS client', async () => {
|
|
220
|
-
if (session.oss) {
|
|
221
|
-
// Get OSS credentials from environment variables
|
|
222
|
-
const { accessKeyId, accessKeySecret, endpoint, region } = getOssCredentials();
|
|
223
|
-
(0, logger_1.log)('Creating OSS client...');
|
|
224
|
-
try {
|
|
225
|
-
const content = await session.oss.createClient(accessKeyId, accessKeySecret, endpoint, region);
|
|
226
|
-
(0, logger_1.log)(`CreateClient content:`, content);
|
|
227
|
-
// Check if content has errors
|
|
228
|
-
expect(content).toBeDefined();
|
|
229
|
-
expect(Array.isArray(content)).toBe(true);
|
|
230
|
-
expect(hasErrorInContent(content)).toBe(false);
|
|
231
|
-
(0, logger_1.log)('OSS client creation successful');
|
|
232
|
-
}
|
|
233
|
-
catch (error) {
|
|
234
|
-
(0, logger_1.log)(`OSS client creation failed: ${error}`);
|
|
235
|
-
throw error;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
else {
|
|
239
|
-
(0, logger_1.log)('Note: OSS interface is nil, skipping OSS test');
|
|
240
|
-
}
|
|
241
|
-
});
|
|
242
|
-
});
|
|
243
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const src_1 = require("../../src");
|
|
4
|
-
const test_helpers_1 = require("../utils/test-helpers");
|
|
5
|
-
const logger_1 = require("../../src/utils/logger");
|
|
6
|
-
describe('Session Labels', () => {
|
|
7
|
-
let agentBay;
|
|
8
|
-
let session;
|
|
9
|
-
let self;
|
|
10
|
-
let labels;
|
|
11
|
-
beforeEach(async () => {
|
|
12
|
-
// Create a real AgentBay instance with test API key
|
|
13
|
-
const apiKey = (0, test_helpers_1.getTestApiKey)();
|
|
14
|
-
agentBay = new src_1.AgentBay({ apiKey });
|
|
15
|
-
// Create a real session
|
|
16
|
-
(0, logger_1.log)('Creating a new session for session labels testing...');
|
|
17
|
-
session = await agentBay.create();
|
|
18
|
-
self = { unique_id: (0, test_helpers_1.generateUniqueId)() };
|
|
19
|
-
labels = {
|
|
20
|
-
environment: `testing-${self.unique_id}`,
|
|
21
|
-
version: '1.0.0',
|
|
22
|
-
project: `labels-test-${self.unique_id}`,
|
|
23
|
-
onwer: `test-team-${self.unique_id}`
|
|
24
|
-
};
|
|
25
|
-
});
|
|
26
|
-
afterEach(async () => {
|
|
27
|
-
(0, logger_1.log)('Cleaning up: Deleting the session...');
|
|
28
|
-
try {
|
|
29
|
-
await agentBay.delete(session);
|
|
30
|
-
self = null;
|
|
31
|
-
(0, logger_1.log)('Session successfully deleted');
|
|
32
|
-
}
|
|
33
|
-
catch (error) {
|
|
34
|
-
(0, logger_1.log)(`Warning: Error deleting session: ${error}`);
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
describe('setLabels()', () => {
|
|
38
|
-
it.only('should set labels for a session', async () => {
|
|
39
|
-
(0, logger_1.log)('Testing setLabels...');
|
|
40
|
-
try {
|
|
41
|
-
// Call the method
|
|
42
|
-
await session.setLabels(labels);
|
|
43
|
-
(0, logger_1.log)('Labels set successfully', JSON.stringify(labels));
|
|
44
|
-
// Verify by getting the labels
|
|
45
|
-
const retrievedLabels = await session.getLabels();
|
|
46
|
-
expect(retrievedLabels).toEqual(labels);
|
|
47
|
-
}
|
|
48
|
-
catch (error) {
|
|
49
|
-
(0, logger_1.log)(`Error setting labels: ${error.message}`);
|
|
50
|
-
// Skip test if we can't set labels
|
|
51
|
-
expect(true).toBe(true);
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
describe('getLabels()', () => {
|
|
56
|
-
it.only('should get labels for a session', async () => {
|
|
57
|
-
(0, logger_1.log)('Testing getLabels...');
|
|
58
|
-
try {
|
|
59
|
-
// First set some labels
|
|
60
|
-
await session.setLabels(labels);
|
|
61
|
-
// Then get the labels
|
|
62
|
-
const result = await session.getLabels();
|
|
63
|
-
(0, logger_1.log)(`Retrieved labels: ${JSON.stringify(result)}`);
|
|
64
|
-
// Verify the results
|
|
65
|
-
expect(result).toEqual(labels);
|
|
66
|
-
}
|
|
67
|
-
catch (error) {
|
|
68
|
-
(0, logger_1.log)(`Error getting labels: ${error.message}`);
|
|
69
|
-
// Skip test if we can't get labels
|
|
70
|
-
expect(true).toBe(true);
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
it.only('should return empty object if no labels', async () => {
|
|
74
|
-
(0, logger_1.log)('Testing getLabels with no labels...');
|
|
75
|
-
try {
|
|
76
|
-
// First clear any existing labels
|
|
77
|
-
await session.setLabels({});
|
|
78
|
-
// Then get the labels
|
|
79
|
-
const result = await session.getLabels();
|
|
80
|
-
(0, logger_1.log)('Retrieved labels after clearing');
|
|
81
|
-
// Verify the results - should be empty or close to empty
|
|
82
|
-
expect(Object.keys(result).length).toBeLessThanOrEqual(0);
|
|
83
|
-
}
|
|
84
|
-
catch (error) {
|
|
85
|
-
(0, logger_1.log)(`Error getting empty labels: ${error.message}`);
|
|
86
|
-
// Skip test if we can't get labels
|
|
87
|
-
expect(true).toBe(true);
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
describe('listByLabels()', () => {
|
|
92
|
-
it.only('should list sessions filtered by labels', async () => {
|
|
93
|
-
(0, logger_1.log)('Testing listByLabels...');
|
|
94
|
-
try {
|
|
95
|
-
// First set some unique labels on our session
|
|
96
|
-
await session.setLabels(labels);
|
|
97
|
-
// Then list sessions with those labels
|
|
98
|
-
const sessions = await agentBay.listByLabels(labels);
|
|
99
|
-
(0, logger_1.log)(`Found ${sessions.length} sessions with matching labels`);
|
|
100
|
-
// We should find at least our session
|
|
101
|
-
expect(sessions.length).toBeGreaterThan(0);
|
|
102
|
-
// Check if our session is in the results
|
|
103
|
-
const foundSession = sessions.some(s => s.sessionId === session.sessionId);
|
|
104
|
-
expect(foundSession).toBe(true);
|
|
105
|
-
sessions.forEach(sessionItem => {
|
|
106
|
-
expect(sessionItem).toHaveProperty('sessionId');
|
|
107
|
-
expect(sessionItem.sessionId).toBeTruthy();
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
catch (error) {
|
|
111
|
-
(0, logger_1.log)(`Error listing sessions by labels: ${error.message}`);
|
|
112
|
-
// Skip test if we can't list sessions
|
|
113
|
-
expect(true).toBe(true);
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
it.only('should handle non-matching labels', async () => {
|
|
117
|
-
(0, logger_1.log)('Testing listByLabels with non-matching labels...');
|
|
118
|
-
try {
|
|
119
|
-
// Use a label that shouldn't match any sessions
|
|
120
|
-
const nonMatchingLabels = {
|
|
121
|
-
nonexistent: `label-${(0, test_helpers_1.generateUniqueId)()}`
|
|
122
|
-
};
|
|
123
|
-
const sessions = await agentBay.listByLabels(nonMatchingLabels);
|
|
124
|
-
(0, logger_1.log)(`Found ${sessions.length} sessions with non-matching labels`);
|
|
125
|
-
// There might be some sessions with these labels, but our session shouldn't be among them
|
|
126
|
-
if (sessions.length > 0) {
|
|
127
|
-
const foundOurSession = sessions.some(s => s.sessionId === session.sessionId);
|
|
128
|
-
expect(foundOurSession).toBe(false);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
catch (error) {
|
|
132
|
-
(0, logger_1.log)(`Error listing sessions by non-matching labels: ${error.message}`);
|
|
133
|
-
// Skip test if we can't list sessions
|
|
134
|
-
expect(true).toBe(true);
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
});
|
|
138
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const src_1 = require("../../src");
|
|
4
|
-
const test_helpers_1 = require("../utils/test-helpers");
|
|
5
|
-
const logger_1 = require("../../src/utils/logger");
|
|
6
|
-
describe('Session Parameters', () => {
|
|
7
|
-
let agentBay;
|
|
8
|
-
let session;
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
const apiKey = (0, test_helpers_1.getTestApiKey)();
|
|
11
|
-
agentBay = new src_1.AgentBay({ apiKey });
|
|
12
|
-
});
|
|
13
|
-
afterEach(async () => {
|
|
14
|
-
try {
|
|
15
|
-
if (session) {
|
|
16
|
-
session.delete();
|
|
17
|
-
(0, logger_1.log)('Session deleted sucessfully');
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
catch (error) {
|
|
21
|
-
(0, logger_1.log)(`Error deleting session: ${error}`);
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
describe('create method options', () => {
|
|
25
|
-
it.only('should accept empty options', async () => {
|
|
26
|
-
try {
|
|
27
|
-
session = await agentBay.create();
|
|
28
|
-
}
|
|
29
|
-
catch (error) {
|
|
30
|
-
(0, logger_1.log)(`Error creating session: ${error}`);
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
it.only('should accept contextId option', async () => {
|
|
34
|
-
try {
|
|
35
|
-
const contextId = 'test-context-id';
|
|
36
|
-
session = await agentBay.create({ contextId });
|
|
37
|
-
}
|
|
38
|
-
catch (error) {
|
|
39
|
-
expect(error.message).toMatch(/Failed to create session/);
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
it.only('should accept labels option', async () => {
|
|
43
|
-
try {
|
|
44
|
-
const labels = { username: 'alice', project: 'my-project' };
|
|
45
|
-
session = await agentBay.create({ labels });
|
|
46
|
-
}
|
|
47
|
-
catch (error) {
|
|
48
|
-
(0, logger_1.log)(`Error creating session with labels: ${error}`);
|
|
49
|
-
expect(error.message).toMatch(/Failed to create session/);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
it.only('should accept both contextId and labels options', async () => {
|
|
53
|
-
try {
|
|
54
|
-
const contextId = 'test-context-id';
|
|
55
|
-
const labels = { username: 'alice', project: 'my-project' };
|
|
56
|
-
session = await agentBay.create({ contextId, labels });
|
|
57
|
-
}
|
|
58
|
-
catch (error) {
|
|
59
|
-
(0, logger_1.log)(`Error creating session with contextId and labels: ${error}`);
|
|
60
|
-
expect(error.message).toMatch(/Failed to create session/);
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
describe('session creation with options', () => {
|
|
65
|
-
it.only('should create a session with the specified options', async () => {
|
|
66
|
-
try {
|
|
67
|
-
session = await agentBay.create({
|
|
68
|
-
contextId: 'test-context-id',
|
|
69
|
-
labels: { username: 'alice' }
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
catch (error) {
|
|
73
|
-
(0, logger_1.log)(`Error creating session with options: ${error}`);
|
|
74
|
-
expect(error.message).toMatch(/Failed to create session/);
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const src_1 = require("../../src");
|
|
4
|
-
const test_helpers_1 = require("../utils/test-helpers");
|
|
5
|
-
const logger_1 = require("../../src/utils/logger");
|
|
6
|
-
describe('Session', () => {
|
|
7
|
-
describe('properties', () => {
|
|
8
|
-
let agentBay;
|
|
9
|
-
let session;
|
|
10
|
-
beforeEach(async () => {
|
|
11
|
-
const apiKey = (0, test_helpers_1.getTestApiKey)();
|
|
12
|
-
agentBay = new src_1.AgentBay({ apiKey });
|
|
13
|
-
// Create a session
|
|
14
|
-
(0, logger_1.log)('Creating a new session for session testing...');
|
|
15
|
-
session = await agentBay.create();
|
|
16
|
-
(0, logger_1.log)(`Session created with ID: ${session.sessionId}`);
|
|
17
|
-
});
|
|
18
|
-
afterEach(async () => {
|
|
19
|
-
// Clean up the session
|
|
20
|
-
(0, logger_1.log)('Cleaning up: Deleting the session...');
|
|
21
|
-
try {
|
|
22
|
-
if (session)
|
|
23
|
-
await agentBay.delete(session);
|
|
24
|
-
}
|
|
25
|
-
catch (error) {
|
|
26
|
-
(0, logger_1.log)(`Warning: Error deleting session: ${error}`);
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
it.only('should have valid sessionId', () => {
|
|
30
|
-
expect(session.sessionId).toBeDefined();
|
|
31
|
-
expect(session.sessionId.length).toBeGreaterThan(0);
|
|
32
|
-
});
|
|
33
|
-
it.only('should log resourceUrl', () => {
|
|
34
|
-
// ResourceUrl is optional, so we just log it without checking if it's non-empty
|
|
35
|
-
(0, logger_1.log)(`Session resourceUrl: ${session.resourceUrl}`);
|
|
36
|
-
});
|
|
37
|
-
it.only('should have filesystem, command, and ui properties', () => {
|
|
38
|
-
expect(session.filesystem).toBeDefined();
|
|
39
|
-
expect(session.command).toBeDefined();
|
|
40
|
-
expect(session.ui).toBeDefined();
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
describe('methods', () => {
|
|
44
|
-
let agentBay;
|
|
45
|
-
let session;
|
|
46
|
-
beforeEach(async () => {
|
|
47
|
-
const apiKey = (0, test_helpers_1.getTestApiKey)();
|
|
48
|
-
agentBay = new src_1.AgentBay({ apiKey });
|
|
49
|
-
// Create a session
|
|
50
|
-
(0, logger_1.log)('Creating a new session for session testing...');
|
|
51
|
-
session = await agentBay.create();
|
|
52
|
-
(0, logger_1.log)(`Session created with ID: ${session.sessionId}`);
|
|
53
|
-
});
|
|
54
|
-
afterEach(async () => {
|
|
55
|
-
// Clean up the session
|
|
56
|
-
(0, logger_1.log)('Cleaning up: Deleting the session...');
|
|
57
|
-
try {
|
|
58
|
-
if (session)
|
|
59
|
-
await agentBay.delete(session);
|
|
60
|
-
}
|
|
61
|
-
catch (error) {
|
|
62
|
-
(0, logger_1.log)(`Warning: Error deleting session: ${error}`);
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
it.only('should return the session ID', () => {
|
|
66
|
-
const sessionId = session.getSessionId();
|
|
67
|
-
expect(sessionId).toBe(session.sessionId);
|
|
68
|
-
});
|
|
69
|
-
it.only('should return the API key', () => {
|
|
70
|
-
const apiKey = session.getAPIKey();
|
|
71
|
-
expect(apiKey).toBe(agentBay.getAPIKey());
|
|
72
|
-
});
|
|
73
|
-
it.only('should return the client', () => {
|
|
74
|
-
const client = session.getClient();
|
|
75
|
-
expect(client).toBeDefined();
|
|
76
|
-
});
|
|
77
|
-
it.only('should get link if implemented', async () => {
|
|
78
|
-
// Check if the getLink method exists
|
|
79
|
-
if (typeof session.getLink === 'function') {
|
|
80
|
-
(0, logger_1.log)('Testing session.getLink method...');
|
|
81
|
-
try {
|
|
82
|
-
// First, create a new session with imageId for getLink testing
|
|
83
|
-
// This is consistent with the Go implementation in TestSession_GetLinkMethod
|
|
84
|
-
const linkTestSession = await agentBay.create({ imageId: 'imgc-07if81c4ktj9shiru' });
|
|
85
|
-
(0, logger_1.log)(`Session created with ID: ${linkTestSession.sessionId} for getLink testing`);
|
|
86
|
-
const link = await linkTestSession.getLink();
|
|
87
|
-
(0, logger_1.log)('Session link:', link);
|
|
88
|
-
// Verify the link
|
|
89
|
-
expect(link).toBeDefined();
|
|
90
|
-
// Clean up the session after test
|
|
91
|
-
await agentBay.delete(linkTestSession);
|
|
92
|
-
}
|
|
93
|
-
catch (error) {
|
|
94
|
-
(0, logger_1.log)(`Note: Session link retrieval failed: ${error}`);
|
|
95
|
-
// Don't fail the test if getLink method is not fully implemented
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
(0, logger_1.log)('Note: Session getLink method is not available, skipping test');
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
describe('delete', () => {
|
|
104
|
-
let agentBay;
|
|
105
|
-
beforeEach(async () => {
|
|
106
|
-
agentBay = new src_1.AgentBay({ apiKey: (0, test_helpers_1.getTestApiKey)() });
|
|
107
|
-
});
|
|
108
|
-
it.only('should delete the session', async () => {
|
|
109
|
-
// Create a new session specifically for this test
|
|
110
|
-
(0, logger_1.log)('Creating a new session for delete testing...');
|
|
111
|
-
const testSession = await agentBay.create();
|
|
112
|
-
(0, logger_1.log)(`Session created with ID: ${testSession.sessionId}`);
|
|
113
|
-
// Test delete method
|
|
114
|
-
(0, logger_1.log)('Testing session.delete method...');
|
|
115
|
-
try {
|
|
116
|
-
if (testSession)
|
|
117
|
-
await testSession.delete();
|
|
118
|
-
// Verify the session was deleted by checking it's not in the list
|
|
119
|
-
const sessions = agentBay.list();
|
|
120
|
-
const stillExists = sessions.some(s => s.sessionId === testSession.sessionId);
|
|
121
|
-
expect(stillExists).toBe(false);
|
|
122
|
-
}
|
|
123
|
-
catch (error) {
|
|
124
|
-
(0, logger_1.log)(`Note: Session deletion failed: ${error}`);
|
|
125
|
-
// Clean up if the test failed
|
|
126
|
-
try {
|
|
127
|
-
if (testSession)
|
|
128
|
-
await agentBay.delete(testSession);
|
|
129
|
-
}
|
|
130
|
-
catch {
|
|
131
|
-
// Ignore cleanup errors
|
|
132
|
-
}
|
|
133
|
-
throw error;
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
describe('info', () => {
|
|
138
|
-
let agentBay;
|
|
139
|
-
let session;
|
|
140
|
-
beforeEach(async () => {
|
|
141
|
-
const apiKey = (0, test_helpers_1.getTestApiKey)();
|
|
142
|
-
agentBay = new src_1.AgentBay({ apiKey });
|
|
143
|
-
// Create a session
|
|
144
|
-
(0, logger_1.log)('Creating a new session for session testing...');
|
|
145
|
-
session = await agentBay.create();
|
|
146
|
-
(0, logger_1.log)(`Session created with ID: ${session.sessionId}`);
|
|
147
|
-
});
|
|
148
|
-
afterEach(async () => {
|
|
149
|
-
// Clean up the session
|
|
150
|
-
(0, logger_1.log)('Cleaning up: Deleting the session...');
|
|
151
|
-
try {
|
|
152
|
-
if (session)
|
|
153
|
-
await agentBay.delete(session);
|
|
154
|
-
}
|
|
155
|
-
catch (error) {
|
|
156
|
-
(0, logger_1.log)(`Warning: Error deleting session: ${error}`);
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
it.only('should get session info if implemented', async () => {
|
|
160
|
-
// Check if the info method exists
|
|
161
|
-
if (typeof session.info === 'function') {
|
|
162
|
-
(0, logger_1.log)('Testing session.info method...');
|
|
163
|
-
try {
|
|
164
|
-
const sessionInfo = await session.info();
|
|
165
|
-
(0, logger_1.log)('Session info:', sessionInfo);
|
|
166
|
-
// Verify the session info
|
|
167
|
-
expect(sessionInfo).toBeDefined();
|
|
168
|
-
// Check SessionId field
|
|
169
|
-
expect(sessionInfo.sessionId).toBeDefined();
|
|
170
|
-
expect(sessionInfo.sessionId).toBe(session.sessionId);
|
|
171
|
-
// Check ResourceUrl field
|
|
172
|
-
if (sessionInfo.resourceUrl) {
|
|
173
|
-
(0, logger_1.log)(`Session ResourceUrl from Info: ${sessionInfo.resourceUrl}`);
|
|
174
|
-
// Extract resourceId from URL if possible
|
|
175
|
-
const resourceId = (0, test_helpers_1.extractResourceId)(sessionInfo.resourceUrl);
|
|
176
|
-
if (resourceId) {
|
|
177
|
-
(0, logger_1.log)(`Extracted ResourceId: ${resourceId}`);
|
|
178
|
-
}
|
|
179
|
-
// Verify that session.resourceUrl was updated with the value from the API response
|
|
180
|
-
expect(session.resourceUrl).toBe(sessionInfo.resourceUrl);
|
|
181
|
-
}
|
|
182
|
-
// Log other fields (these may be empty depending on the API response)
|
|
183
|
-
if (sessionInfo.appId)
|
|
184
|
-
(0, logger_1.log)(`AppId: ${sessionInfo.appId}`);
|
|
185
|
-
if (sessionInfo.authCode)
|
|
186
|
-
(0, logger_1.log)(`AuthCode: ${sessionInfo.authCode}`);
|
|
187
|
-
if (sessionInfo.connectionProperties)
|
|
188
|
-
(0, logger_1.log)(`ConnectionProperties: ${sessionInfo.connectionProperties}`);
|
|
189
|
-
if (sessionInfo.resourceId)
|
|
190
|
-
(0, logger_1.log)(`ResourceId: ${sessionInfo.resourceId}`);
|
|
191
|
-
if (sessionInfo.resourceType)
|
|
192
|
-
(0, logger_1.log)(`ResourceType: ${sessionInfo.resourceType}`);
|
|
193
|
-
}
|
|
194
|
-
catch (error) {
|
|
195
|
-
(0, logger_1.log)(`Note: Session info retrieval failed: ${error}`);
|
|
196
|
-
// Don't fail the test if info method is not fully implemented
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
else {
|
|
200
|
-
(0, logger_1.log)('Note: Session info method is not available, skipping info test');
|
|
201
|
-
}
|
|
202
|
-
});
|
|
203
|
-
});
|
|
204
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|