lexmount 0.5.11 → 0.5.13
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 +6 -2
- package/dist/index.d.mts +33 -1
- package/dist/index.d.ts +33 -1
- package/dist/index.js +39 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -286,6 +286,12 @@ var SessionInfo = class {
|
|
|
286
286
|
this.projectId = options.projectId;
|
|
287
287
|
this.regionId = options.regionId ?? null;
|
|
288
288
|
this.region_id = this.regionId;
|
|
289
|
+
this.contextId = options.contextId ?? null;
|
|
290
|
+
this.context_id = this.contextId;
|
|
291
|
+
this.contextDescription = options.contextDescription ?? null;
|
|
292
|
+
this.context_description = this.contextDescription;
|
|
293
|
+
this.contextDisplayName = options.contextDisplayName ?? this.contextDescription ?? this.contextId;
|
|
294
|
+
this.context_display_name = this.contextDisplayName;
|
|
289
295
|
this.browserType = options.browserType;
|
|
290
296
|
this.createdAt = options.createdAt;
|
|
291
297
|
this.inspectUrl = options.inspectUrl;
|
|
@@ -506,6 +512,9 @@ var SessionsResource = class {
|
|
|
506
512
|
mode: normalizeContextMode(options.context.mode)
|
|
507
513
|
};
|
|
508
514
|
payload.context = contextPayload;
|
|
515
|
+
if (options.contextDescription !== void 0) {
|
|
516
|
+
payload.context_description = options.contextDescription;
|
|
517
|
+
}
|
|
509
518
|
getLogger().debug(
|
|
510
519
|
`Creating session with context (id=${options.context.id}, mode=${contextPayload.mode})`
|
|
511
520
|
);
|
|
@@ -558,6 +567,9 @@ var SessionsResource = class {
|
|
|
558
567
|
apiKey: this.client.apiKey,
|
|
559
568
|
projectId,
|
|
560
569
|
regionId: createdSession?.regionId ?? this.client.selectedRegion ?? this.client.region ?? null,
|
|
570
|
+
contextId: createdSession?.contextId ?? options.context?.id ?? null,
|
|
571
|
+
contextDescription: createdSession?.contextDescription ?? options.context?.description ?? null,
|
|
572
|
+
contextDisplayName: createdSession?.contextDisplayName ?? options.context?.displayName ?? null,
|
|
561
573
|
browserType: createdSession?.browserType ?? (options.browserMode ?? "normal"),
|
|
562
574
|
createdAt: createdSession?.createdAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
563
575
|
inspectUrl: createdSession?.inspectUrl ?? `${this.client.baseUrl}/inspect?session_id=${sessionId}`,
|
|
@@ -598,6 +610,9 @@ var SessionsResource = class {
|
|
|
598
610
|
apiKey: this.client.apiKey,
|
|
599
611
|
projectId,
|
|
600
612
|
regionId: info.regionId ?? this.client.selectedRegion ?? this.client.region ?? null,
|
|
613
|
+
contextId: info.contextId ?? options.context?.id ?? null,
|
|
614
|
+
contextDescription: info.contextDescription ?? options.context?.description ?? null,
|
|
615
|
+
contextDisplayName: info.contextDisplayName ?? options.context?.displayName ?? null,
|
|
601
616
|
browserType: info.browserType || (options.browserMode ?? "normal"),
|
|
602
617
|
createdAt: info.createdAt,
|
|
603
618
|
inspectUrl: info.inspectUrl,
|
|
@@ -862,6 +877,9 @@ var SessionsResource = class {
|
|
|
862
877
|
apiKey: getString(raw.api_key) ?? this.client.apiKey,
|
|
863
878
|
projectId: getString(raw.project_id) ?? (projectId ?? this.client.projectId),
|
|
864
879
|
regionId: getString(raw.region_id) ?? this.client.selectedRegion ?? this.client.region ?? null,
|
|
880
|
+
contextId: getString(raw.context_id) ?? null,
|
|
881
|
+
contextDescription: getString(raw.context_description) ?? null,
|
|
882
|
+
contextDisplayName: getString(raw.context_display_name) ?? null,
|
|
865
883
|
browserType: getString(raw.browser_type) ?? getString(raw.browser_mode) ?? "normal",
|
|
866
884
|
createdAt: getString(raw.created_at) ?? "",
|
|
867
885
|
inspectUrl: getString(raw.inspect_url) ?? `${this.client.baseUrl}/inspect?session_id=${sessionId}`,
|
|
@@ -1062,6 +1080,10 @@ var ContextInfo = class {
|
|
|
1062
1080
|
this.id = options.id;
|
|
1063
1081
|
this.status = options.status;
|
|
1064
1082
|
this.metadata = options.metadata ?? {};
|
|
1083
|
+
this.regionId = options.regionId ?? null;
|
|
1084
|
+
this.region_id = this.regionId;
|
|
1085
|
+
this.description = options.description ?? null;
|
|
1086
|
+
this.displayName = options.displayName ?? options.description ?? options.id;
|
|
1065
1087
|
this.createdAt = options.createdAt ?? null;
|
|
1066
1088
|
this.updatedAt = options.updatedAt ?? null;
|
|
1067
1089
|
}
|
|
@@ -1116,6 +1138,9 @@ var ContextsResource = class {
|
|
|
1116
1138
|
if (options.metadata) {
|
|
1117
1139
|
payload.metadata = options.metadata;
|
|
1118
1140
|
}
|
|
1141
|
+
if (options.description !== void 0) {
|
|
1142
|
+
payload.description = options.description;
|
|
1143
|
+
}
|
|
1119
1144
|
const response = await this.client._post(url, payload);
|
|
1120
1145
|
if (response.status >= 400) {
|
|
1121
1146
|
this.handleError(response, "create");
|
|
@@ -1132,6 +1157,9 @@ var ContextsResource = class {
|
|
|
1132
1157
|
id: contextId,
|
|
1133
1158
|
status: normalizeContextStatus(result.locked),
|
|
1134
1159
|
metadata: result.metadata ?? options.metadata ?? {},
|
|
1160
|
+
regionId: getString2(result.region_id) ?? null,
|
|
1161
|
+
description: getString2(result.description) ?? null,
|
|
1162
|
+
displayName: getString2(result.display_name) ?? null,
|
|
1135
1163
|
createdAt: parseTimestamp(result.created_at)
|
|
1136
1164
|
});
|
|
1137
1165
|
getLogger().info(`Successfully created context '${context.id}'`);
|
|
@@ -1162,7 +1190,10 @@ var ContextsResource = class {
|
|
|
1162
1190
|
status: normalizeContextStatus(context.locked),
|
|
1163
1191
|
createdAt: parseTimestamp(context.created_at),
|
|
1164
1192
|
updatedAt: parseTimestamp(context.updated_at),
|
|
1165
|
-
metadata: context.metadata ?? {}
|
|
1193
|
+
metadata: context.metadata ?? {},
|
|
1194
|
+
regionId: getString2(context.region_id) ?? null,
|
|
1195
|
+
description: getString2(context.description) ?? null,
|
|
1196
|
+
displayName: getString2(context.display_name) ?? null
|
|
1166
1197
|
});
|
|
1167
1198
|
}) : [];
|
|
1168
1199
|
getLogger().info(`Retrieved ${contexts.length} contexts`);
|
|
@@ -1187,6 +1218,9 @@ var ContextsResource = class {
|
|
|
1187
1218
|
id: getString2(context.context_id) ?? contextId,
|
|
1188
1219
|
status: normalizeContextStatus(context.locked),
|
|
1189
1220
|
metadata: context.metadata ?? {},
|
|
1221
|
+
regionId: getString2(context.region_id) ?? null,
|
|
1222
|
+
description: getString2(context.description) ?? null,
|
|
1223
|
+
displayName: getString2(context.display_name) ?? null,
|
|
1190
1224
|
createdAt: parseTimestamp(context.created_at),
|
|
1191
1225
|
updatedAt: parseTimestamp(context.updated_at)
|
|
1192
1226
|
});
|
|
@@ -1218,6 +1252,9 @@ var ContextsResource = class {
|
|
|
1218
1252
|
id: forkedContextId,
|
|
1219
1253
|
status: normalizeContextStatus(result.locked),
|
|
1220
1254
|
metadata: result.metadata ?? {},
|
|
1255
|
+
regionId: getString2(result.region_id) ?? null,
|
|
1256
|
+
description: getString2(result.description) ?? null,
|
|
1257
|
+
displayName: getString2(result.display_name) ?? null,
|
|
1221
1258
|
createdAt: parseTimestamp(result.created_at),
|
|
1222
1259
|
updatedAt: parseTimestamp(result.updated_at)
|
|
1223
1260
|
});
|
|
@@ -1703,7 +1740,7 @@ var Lexmount = class {
|
|
|
1703
1740
|
};
|
|
1704
1741
|
|
|
1705
1742
|
// src/index.ts
|
|
1706
|
-
var VERSION = "0.5.
|
|
1743
|
+
var VERSION = "0.5.13";
|
|
1707
1744
|
export {
|
|
1708
1745
|
APIError,
|
|
1709
1746
|
AuthenticationError,
|