@deepraxis/sdk 0.2.0-dev.6528e7c → 0.2.0-dev.826472f
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/METHODS.md +35 -1
- package/dist/generated/index.d.ts +2 -2
- package/dist/generated/index.js +1 -1
- package/dist/generated/sdk.gen.d.ts +51 -3
- package/dist/generated/sdk.gen.js +113 -2
- package/dist/generated/types.gen.d.ts +1473 -410
- package/dist/helpers/browser-actions.d.ts +2 -0
- package/dist/helpers/browser-actions.js +5 -1
- package/dist/helpers/browser-connect-error.d.ts +7 -1
- package/dist/helpers/browser-connect-error.js +12 -1
- package/dist/helpers/browser-connect.d.ts +1 -1
- package/dist/helpers/browser-connect.js +16 -5
- package/dist/helpers/browser-decisions.d.ts +3 -0
- package/dist/helpers/browser-decisions.js +5 -0
- package/dist/helpers/browser-documentation.d.ts +1 -1
- package/dist/helpers/browser-documentation.js +3 -0
- package/dist/operations.generated.js +257 -2
- package/dist/resources.generated.d.ts +56 -0
- package/dist/resources.generated.js +20 -0
- package/package.json +1 -1
|
@@ -1210,7 +1210,7 @@ export const browserListSessions = (options) => (options?.client ?? client).get(
|
|
|
1210
1210
|
/**
|
|
1211
1211
|
* 创建浏览器会话
|
|
1212
1212
|
*
|
|
1213
|
-
* 创建云端 Chrome,返回自带凭证的 connectUrl
|
|
1213
|
+
* 创建云端 Chrome,返回自带凭证的 connectUrl;带 name 时按名字幂等:本账户已有同名且 RUNNING(未在释放中)、挂载的登录态与本次相同(都没挂也算相同)的会话,就直接返回这个会话(HTTP 200,reused=true,不新开、不计费),同名但登录态不同返回 409 SESSION_NAME_IN_USE(消息写明已有会话的 id),同名会话已在释放或已结束则新开;不带 name 时每次都新开(HTTP 201,reused=false)。同一件事请固定一个会话名并复用,不要每步新开再关闭:频繁新开会话对网站来说像同一账号不断换新设备登录,容易触发风控。persist 写入租约仍只属于这一个会话。它是一条完整 CDP 连接,真指针事件(触摸、拖拽、按坐标点击)从那里发送,页面动作接口只做按 ref 的语义动作。API 会话默认断开后结束;最长 6 小时。运行中服务每 60 秒做一次健康检查(Browser.getVersion,超时 10 秒),连续 2 次失败即以 closeReason=watchdog 结束会话,keepAlive=true 也不豁免;该事件记录判据读数。
|
|
1214
1214
|
*/
|
|
1215
1215
|
export const browserCreateSession = (options) => (options.client ?? client).post({
|
|
1216
1216
|
security: [{
|
|
@@ -1445,6 +1445,99 @@ export const browserUpdateContext = (options) => (options.client ?? client).put(
|
|
|
1445
1445
|
...options.headers
|
|
1446
1446
|
}
|
|
1447
1447
|
});
|
|
1448
|
+
/**
|
|
1449
|
+
* 创建浏览器配对码
|
|
1450
|
+
*
|
|
1451
|
+
* 为一个要接入的 Chrome 或 Edge 创建 8 位配对码,一次性、10 分钟有效;把它交给用户,由用户在浏览器扩展里输入或由 Console 直接交给扩展,用户点「允许」后配对完成。需要组织已开通 BYOB,否则返回 501 PROVIDER_UNSUPPORTED。
|
|
1452
|
+
*/
|
|
1453
|
+
export const browserCreateByobPairing = (options) => (options?.client ?? client).post({
|
|
1454
|
+
security: [{
|
|
1455
|
+
key: 'BrowserBearer',
|
|
1456
|
+
scheme: 'bearer',
|
|
1457
|
+
type: 'http'
|
|
1458
|
+
}],
|
|
1459
|
+
url: '/browser/v1/byob/pairings',
|
|
1460
|
+
...options
|
|
1461
|
+
});
|
|
1462
|
+
/**
|
|
1463
|
+
* 列出自带浏览器
|
|
1464
|
+
*
|
|
1465
|
+
* 分页列出当前组织已配对且未断开的自带浏览器,按 ID 升序。将 nextCursor 原样传入读取下一页,直到其为 null。
|
|
1466
|
+
*/
|
|
1467
|
+
export const browserListByobBrowsers = (options) => (options?.client ?? client).get({
|
|
1468
|
+
security: [{
|
|
1469
|
+
key: 'BrowserBearer',
|
|
1470
|
+
scheme: 'bearer',
|
|
1471
|
+
type: 'http'
|
|
1472
|
+
}],
|
|
1473
|
+
url: '/browser/v1/byob/browsers',
|
|
1474
|
+
...options
|
|
1475
|
+
});
|
|
1476
|
+
/**
|
|
1477
|
+
* 读取自带浏览器
|
|
1478
|
+
*
|
|
1479
|
+
* 读取当前组织的指定自带浏览器,包括已断开的(revoked_at 不为 null)。不存在或不属于当前组织时返回 404 BROWSER_NOT_FOUND。
|
|
1480
|
+
*/
|
|
1481
|
+
export const browserGetByobBrowser = (options) => (options.client ?? client).get({
|
|
1482
|
+
security: [{
|
|
1483
|
+
key: 'BrowserBearer',
|
|
1484
|
+
scheme: 'bearer',
|
|
1485
|
+
type: 'http'
|
|
1486
|
+
}],
|
|
1487
|
+
url: '/browser/v1/byob/browsers/{browser_id}',
|
|
1488
|
+
...options
|
|
1489
|
+
});
|
|
1490
|
+
/**
|
|
1491
|
+
* 更新自带浏览器的名称、授权智能体与允许站点
|
|
1492
|
+
*
|
|
1493
|
+
* 更新自带浏览器的名称、授权智能体或允许站点,只改请求里出现的字段;granted_agents 和 allowed_sites 整体替换原列表。已断开的浏览器返回 410 BROWSER_REVOKED,需要重新配对。
|
|
1494
|
+
*/
|
|
1495
|
+
export const browserUpdateByobBrowser = (options) => (options.client ?? client).patch({
|
|
1496
|
+
security: [{
|
|
1497
|
+
key: 'BrowserBearer',
|
|
1498
|
+
scheme: 'bearer',
|
|
1499
|
+
type: 'http'
|
|
1500
|
+
}],
|
|
1501
|
+
url: '/browser/v1/byob/browsers/{browser_id}',
|
|
1502
|
+
...options,
|
|
1503
|
+
headers: {
|
|
1504
|
+
'Content-Type': 'application/json',
|
|
1505
|
+
...options.headers
|
|
1506
|
+
}
|
|
1507
|
+
});
|
|
1508
|
+
/**
|
|
1509
|
+
* 断开自带浏览器
|
|
1510
|
+
*
|
|
1511
|
+
* 断开自带浏览器:撤销它的授权,之后没有任何智能体能再驱动它,要用必须重新配对。可重复调用,结果相同;功能开关关闭时也能断开。
|
|
1512
|
+
*/
|
|
1513
|
+
export const browserDisconnectByobBrowser = (options) => (options.client ?? client).post({
|
|
1514
|
+
security: [{
|
|
1515
|
+
key: 'BrowserBearer',
|
|
1516
|
+
scheme: 'bearer',
|
|
1517
|
+
type: 'http'
|
|
1518
|
+
}],
|
|
1519
|
+
url: '/browser/v1/byob/browsers/{browser_id}/disconnect',
|
|
1520
|
+
...options
|
|
1521
|
+
});
|
|
1522
|
+
/**
|
|
1523
|
+
* 读取浏览器配对授权页信息
|
|
1524
|
+
*
|
|
1525
|
+
* 扩展的授权页读取配对码对应的组织与发起人,让用户确认后再点「允许」。不需要 API Key,配对码就是凭证;码不存在、已过期、已使用一律返回 404 PAIRING_NOT_FOUND,不区分原因。
|
|
1526
|
+
*/
|
|
1527
|
+
export const browserReadByobPairing = (options) => (options.client ?? client).get({ url: '/browser/v1/byob/pairings/{code}', ...options });
|
|
1528
|
+
/**
|
|
1529
|
+
* 认领浏览器配对码
|
|
1530
|
+
*
|
|
1531
|
+
* 用户点「允许」后,扩展用配对码认领一次,登记这个浏览器并取得 browser_id 和要拨入的 link_url。不需要 API Key,配对码就是凭证,只能使用一次;码不存在、已过期、已使用一律返回 404 PAIRING_NOT_FOUND。请求体不合格时返回 400 且不消耗配对码。
|
|
1532
|
+
*/
|
|
1533
|
+
export const browserClaimByobPairing = (options) => (options.client ?? client).post({
|
|
1534
|
+
url: '/browser/v1/byob/pairings/{code}/claim',
|
|
1535
|
+
...options,
|
|
1536
|
+
headers: {
|
|
1537
|
+
'Content-Type': 'application/json',
|
|
1538
|
+
...options.headers
|
|
1539
|
+
}
|
|
1540
|
+
});
|
|
1448
1541
|
/**
|
|
1449
1542
|
* 连接云端浏览器
|
|
1450
1543
|
*
|
|
@@ -12028,10 +12121,28 @@ export const devopsChangesMarkLastSlice = (options) => (options.client ?? client
|
|
|
12028
12121
|
...options.headers
|
|
12029
12122
|
}
|
|
12030
12123
|
});
|
|
12124
|
+
/**
|
|
12125
|
+
* Open a new slice
|
|
12126
|
+
*
|
|
12127
|
+
* Open one more slice of a change: another pull request on the same change, developed beside the ones already open. Use it when a second piece of the change can be built in parallel; for the change's first pull request there is nothing to open — work on the branch `praxis devops change checkout` gave you. The call cuts the next slice branch, named <id>--<n> where n is one more than the highest slice number the change's pull requests and its workspace already hold (so two calls give two different slices), and gives it its own git worktree in the change's workspace. If the change has no live workspace one is opened. Everything after that is automatic: the branch name, the worktree, removing the worktree once its pull request merges, and restacking a slice cut from another onto the default branch when that slice merges. A restack that conflicts is aborted and reported with the conflicting files; resolve those by hand on the slice branch, nothing is resolved for you. Without from the slice is cut from the default branch; with from set to another branch of the same change it is cut from that slice (the right choice when it builds on it). An abandoned change is refused with INVALID_ARGUMENT. The change id is the branch name <type>/<slug>; give it as it comes back — the SDK and the CLI encode the slash themselves. The workspace may still be starting when the call returns: directory is the path the worktree will have once it is available, and exists at once when the workspace is already running. From a terminal: `praxis devops changes slice <change>`.
|
|
12128
|
+
*/
|
|
12129
|
+
export const devopsChangesSlicesCreate = (options) => (options.client ?? client).post({
|
|
12130
|
+
security: [{
|
|
12131
|
+
key: 'devops-bearerAuth',
|
|
12132
|
+
scheme: 'bearer',
|
|
12133
|
+
type: 'http'
|
|
12134
|
+
}],
|
|
12135
|
+
url: '/devops/v1/projects/{project}/changes/{change}/slices',
|
|
12136
|
+
...options,
|
|
12137
|
+
headers: {
|
|
12138
|
+
'Content-Type': 'application/json',
|
|
12139
|
+
...options.headers
|
|
12140
|
+
}
|
|
12141
|
+
});
|
|
12031
12142
|
/**
|
|
12032
12143
|
* Open a change's pull request
|
|
12033
12144
|
*
|
|
12034
|
-
* Open the pull request for a change: its branch into the project's default branch, opened by DevOps's own GitHub App. A cloud workspace holds no GitHub credential, so this is how work pushed with the unit push becomes a pull request; `praxis devops change pr` calls it from the workspace. Push first: a branch with no commits beyond the default branch is refused with PULL_REQUEST_REFUSED and GitHub's words. A branch that already has an open pull request answers that one with created=false, so calling again is safe; when the call passes a title or a body, those fields are written onto that pull request (GitHub PATCH /pulls/{number}) and the answer says updated=true, while a field not passed is left as it is — which is how a wrong or missing description is corrected, and how the merge gate's exposure-declared check is re-evaluated from the new body. Only an open pull request can be rewritten: once it is merged or closed its head branch is usually deleted with it, so a call that names a title or a body is refused with PULL_REQUEST_NOT_OPEN, naming that pull request and the branch, instead of trying to open a second one. The pull request then appears on the change and runs its merge gate as usual. The id is the branch name; give it as it comes back (fix/expired-links) — the SDK and the CLI encode the slash themselves, and only a hand-written HTTP request sends fix%2Fexpired-links.
|
|
12145
|
+
* Open the pull request for a change: its branch into the project's default branch, opened by DevOps's own GitHub App. A cloud workspace holds no GitHub credential, so this is how work pushed with the unit push becomes a pull request; `praxis devops change pr` calls it from the workspace. Push first: a branch with no commits beyond the default branch is refused with PULL_REQUEST_REFUSED and GitHub's words. A branch that already has an open pull request answers that one with created=false, so calling again is safe; when the call passes a title or a body, those fields are written onto that pull request (GitHub PATCH /pulls/{number}) and the answer says updated=true, while a field not passed is left as it is — which is how a wrong or missing description is corrected, and how the merge gate's exposure-declared check is re-evaluated from the new body. Only an open pull request can be rewritten: once it is merged or closed its head branch is usually deleted with it, so a call that names a title or a body is refused with PULL_REQUEST_NOT_OPEN, naming that pull request and the branch, instead of trying to open a second one. The pull request then appears on the change and runs its merge gate as usual. For a later slice opened with `slices.create`, pass head set to that slice's branch (<id>--<n>): the pull request is opened from it instead of the change's own branch, and a branch that belongs to another change is refused with INVALID_ARGUMENT. The id is the branch name; give it as it comes back (fix/expired-links) — the SDK and the CLI encode the slash themselves, and only a hand-written HTTP request sends fix%2Fexpired-links.
|
|
12035
12146
|
*/
|
|
12036
12147
|
export const devopsChangesOpenPullRequest = (options) => (options.client ?? client).post({
|
|
12037
12148
|
security: [{
|