@b3os/sdk 0.0.0-stage → 0.1.0
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/LICENSE +202 -0
- package/README.md +233 -2
- package/dist/cjs/core/client.d.ts +165 -0
- package/dist/cjs/core/client.js +825 -0
- package/dist/cjs/core/client.js.map +1 -0
- package/dist/cjs/core/errors.d.ts +101 -0
- package/dist/cjs/core/errors.js +249 -0
- package/dist/cjs/core/errors.js.map +1 -0
- package/dist/cjs/core/index.d.ts +12 -0
- package/dist/cjs/core/index.js +42 -0
- package/dist/cjs/core/index.js.map +1 -0
- package/dist/cjs/core/jobs.d.ts +31 -0
- package/dist/cjs/core/jobs.js +72 -0
- package/dist/cjs/core/jobs.js.map +1 -0
- package/dist/cjs/core/namespace.d.ts +7 -0
- package/dist/cjs/core/namespace.js +13 -0
- package/dist/cjs/core/namespace.js.map +1 -0
- package/dist/cjs/core/op.d.ts +47 -0
- package/dist/cjs/core/op.js +5 -0
- package/dist/cjs/core/op.js.map +1 -0
- package/dist/cjs/core/promise.d.ts +106 -0
- package/dist/cjs/core/promise.js +200 -0
- package/dist/cjs/core/promise.js.map +1 -0
- package/dist/cjs/core/response.d.ts +54 -0
- package/dist/cjs/core/response.js +92 -0
- package/dist/cjs/core/response.js.map +1 -0
- package/dist/cjs/core/sse.d.ts +79 -0
- package/dist/cjs/core/sse.js +291 -0
- package/dist/cjs/core/sse.js.map +1 -0
- package/dist/cjs/core/timing.d.ts +20 -0
- package/dist/cjs/core/timing.js +96 -0
- package/dist/cjs/core/timing.js.map +1 -0
- package/dist/cjs/core/transport.d.ts +80 -0
- package/dist/cjs/core/transport.js +472 -0
- package/dist/cjs/core/transport.js.map +1 -0
- package/dist/cjs/core/util.d.ts +25 -0
- package/dist/cjs/core/util.js +142 -0
- package/dist/cjs/core/util.js.map +1 -0
- package/dist/cjs/core/ws.d.ts +52 -0
- package/dist/cjs/core/ws.js +181 -0
- package/dist/cjs/core/ws.js.map +1 -0
- package/dist/cjs/generated/client.d.ts +62 -0
- package/dist/cjs/generated/client.js +130 -0
- package/dist/cjs/generated/client.js.map +1 -0
- package/dist/cjs/generated/errors.d.ts +4 -0
- package/dist/cjs/generated/errors.js +160 -0
- package/dist/cjs/generated/errors.js.map +1 -0
- package/dist/cjs/generated/ids.d.ts +114 -0
- package/dist/cjs/generated/ids.js +47 -0
- package/dist/cjs/generated/ids.js.map +1 -0
- package/dist/cjs/generated/jobs.d.ts +10 -0
- package/dist/cjs/generated/jobs.js +24 -0
- package/dist/cjs/generated/jobs.js.map +1 -0
- package/dist/cjs/generated/ns/actions.d.ts +161 -0
- package/dist/cjs/generated/ns/actions.js +304 -0
- package/dist/cjs/generated/ns/actions.js.map +1 -0
- package/dist/cjs/generated/ns/infer.d.ts +190 -0
- package/dist/cjs/generated/ns/infer.js +253 -0
- package/dist/cjs/generated/ns/infer.js.map +1 -0
- package/dist/cjs/generated/ns/keys.d.ts +76 -0
- package/dist/cjs/generated/ns/keys.js +144 -0
- package/dist/cjs/generated/ns/keys.js.map +1 -0
- package/dist/cjs/generated/ns/limits.d.ts +22 -0
- package/dist/cjs/generated/ns/limits.js +32 -0
- package/dist/cjs/generated/ns/limits.js.map +1 -0
- package/dist/cjs/generated/ns/orgs.d.ts +38 -0
- package/dist/cjs/generated/ns/orgs.js +68 -0
- package/dist/cjs/generated/ns/orgs.js.map +1 -0
- package/dist/cjs/generated/ns/projects.d.ts +57 -0
- package/dist/cjs/generated/ns/projects.js +115 -0
- package/dist/cjs/generated/ns/projects.js.map +1 -0
- package/dist/cjs/generated/ns/render.d.ts +159 -0
- package/dist/cjs/generated/ns/render.js +299 -0
- package/dist/cjs/generated/ns/render.js.map +1 -0
- package/dist/cjs/generated/ns/requests.d.ts +36 -0
- package/dist/cjs/generated/ns/requests.js +54 -0
- package/dist/cjs/generated/ns/requests.js.map +1 -0
- package/dist/cjs/generated/ns/routines.d.ts +212 -0
- package/dist/cjs/generated/ns/routines.js +419 -0
- package/dist/cjs/generated/ns/routines.js.map +1 -0
- package/dist/cjs/generated/ns/sandboxes.d.ts +318 -0
- package/dist/cjs/generated/ns/sandboxes.js +549 -0
- package/dist/cjs/generated/ns/sandboxes.js.map +1 -0
- package/dist/cjs/generated/ns/usage.d.ts +30 -0
- package/dist/cjs/generated/ns/usage.js +49 -0
- package/dist/cjs/generated/ns/usage.js.map +1 -0
- package/dist/cjs/generated/ns/vault.d.ts +69 -0
- package/dist/cjs/generated/ns/vault.js +122 -0
- package/dist/cjs/generated/ns/vault.js.map +1 -0
- package/dist/cjs/generated/ns/vision.d.ts +376 -0
- package/dist/cjs/generated/ns/vision.js +736 -0
- package/dist/cjs/generated/ns/vision.js.map +1 -0
- package/dist/cjs/generated/ns/webhooks.d.ts +50 -0
- package/dist/cjs/generated/ns/webhooks.js +91 -0
- package/dist/cjs/generated/ns/webhooks.js.map +1 -0
- package/dist/cjs/generated/types.d.ts +4613 -0
- package/dist/cjs/generated/types.js +4 -0
- package/dist/cjs/generated/types.js.map +1 -0
- package/dist/cjs/index.d.ts +22 -0
- package/dist/cjs/index.js +81 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/webhooks.d.ts +19 -0
- package/dist/cjs/webhooks.js +85 -0
- package/dist/cjs/webhooks.js.map +1 -0
- package/dist/esm/core/client.d.ts +165 -0
- package/dist/esm/core/client.js +821 -0
- package/dist/esm/core/client.js.map +1 -0
- package/dist/esm/core/errors.d.ts +101 -0
- package/dist/esm/core/errors.js +239 -0
- package/dist/esm/core/errors.js.map +1 -0
- package/dist/esm/core/index.d.ts +12 -0
- package/dist/esm/core/index.js +15 -0
- package/dist/esm/core/index.js.map +1 -0
- package/dist/esm/core/jobs.d.ts +31 -0
- package/dist/esm/core/jobs.js +66 -0
- package/dist/esm/core/jobs.js.map +1 -0
- package/dist/esm/core/namespace.d.ts +7 -0
- package/dist/esm/core/namespace.js +9 -0
- package/dist/esm/core/namespace.js.map +1 -0
- package/dist/esm/core/op.d.ts +47 -0
- package/dist/esm/core/op.js +4 -0
- package/dist/esm/core/op.js.map +1 -0
- package/dist/esm/core/promise.d.ts +106 -0
- package/dist/esm/core/promise.js +193 -0
- package/dist/esm/core/promise.js.map +1 -0
- package/dist/esm/core/response.d.ts +54 -0
- package/dist/esm/core/response.js +86 -0
- package/dist/esm/core/response.js.map +1 -0
- package/dist/esm/core/sse.d.ts +79 -0
- package/dist/esm/core/sse.js +286 -0
- package/dist/esm/core/sse.js.map +1 -0
- package/dist/esm/core/timing.d.ts +20 -0
- package/dist/esm/core/timing.js +92 -0
- package/dist/esm/core/timing.js.map +1 -0
- package/dist/esm/core/transport.d.ts +80 -0
- package/dist/esm/core/transport.js +465 -0
- package/dist/esm/core/transport.js.map +1 -0
- package/dist/esm/core/util.d.ts +25 -0
- package/dist/esm/core/util.js +128 -0
- package/dist/esm/core/util.js.map +1 -0
- package/dist/esm/core/ws.d.ts +52 -0
- package/dist/esm/core/ws.js +175 -0
- package/dist/esm/core/ws.js.map +1 -0
- package/dist/esm/generated/client.d.ts +62 -0
- package/dist/esm/generated/client.js +126 -0
- package/dist/esm/generated/client.js.map +1 -0
- package/dist/esm/generated/errors.d.ts +4 -0
- package/dist/esm/generated/errors.js +157 -0
- package/dist/esm/generated/errors.js.map +1 -0
- package/dist/esm/generated/ids.d.ts +114 -0
- package/dist/esm/generated/ids.js +42 -0
- package/dist/esm/generated/ids.js.map +1 -0
- package/dist/esm/generated/jobs.d.ts +10 -0
- package/dist/esm/generated/jobs.js +21 -0
- package/dist/esm/generated/jobs.js.map +1 -0
- package/dist/esm/generated/ns/actions.d.ts +161 -0
- package/dist/esm/generated/ns/actions.js +300 -0
- package/dist/esm/generated/ns/actions.js.map +1 -0
- package/dist/esm/generated/ns/infer.d.ts +190 -0
- package/dist/esm/generated/ns/infer.js +249 -0
- package/dist/esm/generated/ns/infer.js.map +1 -0
- package/dist/esm/generated/ns/keys.d.ts +76 -0
- package/dist/esm/generated/ns/keys.js +140 -0
- package/dist/esm/generated/ns/keys.js.map +1 -0
- package/dist/esm/generated/ns/limits.d.ts +22 -0
- package/dist/esm/generated/ns/limits.js +28 -0
- package/dist/esm/generated/ns/limits.js.map +1 -0
- package/dist/esm/generated/ns/orgs.d.ts +38 -0
- package/dist/esm/generated/ns/orgs.js +64 -0
- package/dist/esm/generated/ns/orgs.js.map +1 -0
- package/dist/esm/generated/ns/projects.d.ts +57 -0
- package/dist/esm/generated/ns/projects.js +111 -0
- package/dist/esm/generated/ns/projects.js.map +1 -0
- package/dist/esm/generated/ns/render.d.ts +159 -0
- package/dist/esm/generated/ns/render.js +295 -0
- package/dist/esm/generated/ns/render.js.map +1 -0
- package/dist/esm/generated/ns/requests.d.ts +36 -0
- package/dist/esm/generated/ns/requests.js +50 -0
- package/dist/esm/generated/ns/requests.js.map +1 -0
- package/dist/esm/generated/ns/routines.d.ts +212 -0
- package/dist/esm/generated/ns/routines.js +415 -0
- package/dist/esm/generated/ns/routines.js.map +1 -0
- package/dist/esm/generated/ns/sandboxes.d.ts +318 -0
- package/dist/esm/generated/ns/sandboxes.js +545 -0
- package/dist/esm/generated/ns/sandboxes.js.map +1 -0
- package/dist/esm/generated/ns/usage.d.ts +30 -0
- package/dist/esm/generated/ns/usage.js +45 -0
- package/dist/esm/generated/ns/usage.js.map +1 -0
- package/dist/esm/generated/ns/vault.d.ts +69 -0
- package/dist/esm/generated/ns/vault.js +118 -0
- package/dist/esm/generated/ns/vault.js.map +1 -0
- package/dist/esm/generated/ns/vision.d.ts +376 -0
- package/dist/esm/generated/ns/vision.js +732 -0
- package/dist/esm/generated/ns/vision.js.map +1 -0
- package/dist/esm/generated/ns/webhooks.d.ts +50 -0
- package/dist/esm/generated/ns/webhooks.js +87 -0
- package/dist/esm/generated/ns/webhooks.js.map +1 -0
- package/dist/esm/generated/types.d.ts +4613 -0
- package/dist/esm/generated/types.js +3 -0
- package/dist/esm/generated/types.js.map +1 -0
- package/dist/esm/index.d.ts +22 -0
- package/dist/esm/index.js +28 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/webhooks.d.ts +19 -0
- package/dist/esm/webhooks.js +79 -0
- package/dist/esm/webhooks.js.map +1 -0
- package/package.json +97 -3
- package/src/core/client.ts +1022 -0
- package/src/core/errors.ts +296 -0
- package/src/core/index.ts +45 -0
- package/src/core/jobs.ts +94 -0
- package/src/core/namespace.ts +10 -0
- package/src/core/op.ts +53 -0
- package/src/core/promise.ts +268 -0
- package/src/core/response.ts +115 -0
- package/src/core/sse.ts +305 -0
- package/src/core/timing.ts +106 -0
- package/src/core/transport.ts +489 -0
- package/src/core/util.ts +138 -0
- package/src/core/ws.ts +215 -0
- package/src/generated/client.ts +143 -0
- package/src/generated/errors.ts +313 -0
- package/src/generated/ids.ts +47 -0
- package/src/generated/jobs.ts +25 -0
- package/src/generated/ns/actions.ts +353 -0
- package/src/generated/ns/infer.ts +332 -0
- package/src/generated/ns/keys.ts +152 -0
- package/src/generated/ns/limits.ts +35 -0
- package/src/generated/ns/orgs.ts +77 -0
- package/src/generated/ns/projects.ts +122 -0
- package/src/generated/ns/render.ts +348 -0
- package/src/generated/ns/requests.ts +61 -0
- package/src/generated/ns/routines.ts +474 -0
- package/src/generated/ns/sandboxes.ts +671 -0
- package/src/generated/ns/usage.ts +56 -0
- package/src/generated/ns/vault.ts +136 -0
- package/src/generated/ns/vision.ts +836 -0
- package/src/generated/ns/webhooks.ts +100 -0
- package/src/generated/types.ts +5131 -0
- package/src/index.ts +30 -0
- package/src/webhooks.ts +100 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Generated by packages/sdk/scripts/generate.mjs from packages/spec/dist. Do not edit; run `pnpm generate`.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.KeysAPI = exports.keysOps = void 0;
|
|
5
|
+
const namespace_ts_1 = require("../../core/namespace.js");
|
|
6
|
+
const listKeysOp = {
|
|
7
|
+
id: "platformListKeys",
|
|
8
|
+
method: "GET",
|
|
9
|
+
path: "/v1/keys",
|
|
10
|
+
edge: true,
|
|
11
|
+
timeoutMs: 10000,
|
|
12
|
+
scope: "platform:read",
|
|
13
|
+
};
|
|
14
|
+
const createKeyOp = {
|
|
15
|
+
id: "platformCreateKey",
|
|
16
|
+
method: "POST",
|
|
17
|
+
path: "/v1/keys",
|
|
18
|
+
body: "json",
|
|
19
|
+
edge: true,
|
|
20
|
+
idem: true,
|
|
21
|
+
timeoutMs: 10000,
|
|
22
|
+
scope: "platform:write",
|
|
23
|
+
};
|
|
24
|
+
const getCurrentKeyOp = {
|
|
25
|
+
id: "platformGetCurrentKey",
|
|
26
|
+
method: "GET",
|
|
27
|
+
path: "/v1/keys/current",
|
|
28
|
+
edge: true,
|
|
29
|
+
timeoutMs: 5000,
|
|
30
|
+
scope: "authenticated",
|
|
31
|
+
};
|
|
32
|
+
const revokeKeyOp = {
|
|
33
|
+
id: "platformRevokeKey",
|
|
34
|
+
method: "DELETE",
|
|
35
|
+
path: "/v1/keys/{key_id}",
|
|
36
|
+
params: ["key_id"],
|
|
37
|
+
edge: true,
|
|
38
|
+
timeoutMs: 10000,
|
|
39
|
+
scope: "platform:write",
|
|
40
|
+
};
|
|
41
|
+
const getKeyOp = {
|
|
42
|
+
id: "platformGetKey",
|
|
43
|
+
method: "GET",
|
|
44
|
+
path: "/v1/keys/{key_id}",
|
|
45
|
+
params: ["key_id"],
|
|
46
|
+
edge: true,
|
|
47
|
+
timeoutMs: 10000,
|
|
48
|
+
scope: "platform:read",
|
|
49
|
+
};
|
|
50
|
+
const updateKeyOp = {
|
|
51
|
+
id: "platformUpdateKey",
|
|
52
|
+
method: "PATCH",
|
|
53
|
+
path: "/v1/keys/{key_id}",
|
|
54
|
+
params: ["key_id"],
|
|
55
|
+
body: "json",
|
|
56
|
+
edge: true,
|
|
57
|
+
timeoutMs: 10000,
|
|
58
|
+
scope: "platform:write",
|
|
59
|
+
};
|
|
60
|
+
/** Descriptors of every keys operation, keyed by method name (for tooling and custom clients). */
|
|
61
|
+
exports.keysOps = {
|
|
62
|
+
listKeys: listKeysOp,
|
|
63
|
+
createKey: createKeyOp,
|
|
64
|
+
getCurrentKey: getCurrentKeyOp,
|
|
65
|
+
revokeKey: revokeKeyOp,
|
|
66
|
+
getKey: getKeyOp,
|
|
67
|
+
updateKey: updateKeyOp,
|
|
68
|
+
};
|
|
69
|
+
/** API keys (`/v1/keys`; served by beta-api.b3os.org). */
|
|
70
|
+
class KeysAPI extends namespace_ts_1.Namespace {
|
|
71
|
+
/**
|
|
72
|
+
* List API keys
|
|
73
|
+
*
|
|
74
|
+
* Lists the organization's API keys and CLI tokens (secrets are never returned), newest first. `kind` tells
|
|
75
|
+
* them apart; revoke a lost CLI token like any key.
|
|
76
|
+
*
|
|
77
|
+
* `GET /v1/keys` · scope `platform:read` · served by beta-api.b3os.org
|
|
78
|
+
*/
|
|
79
|
+
listKeys(params, options) {
|
|
80
|
+
return this._client._list(listKeysOp, { query: params }, options);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Create an API key
|
|
84
|
+
*
|
|
85
|
+
* Creates a key in your project (or `project`, in the same organization). `scopes` and `spend_cap_usd` may not
|
|
86
|
+
* exceed the caller's own, and when the caller expires, `expires_at` must be set and no later than the caller's
|
|
87
|
+
* expiry (`forbidden`, reason `scope_escalation`). The response is the only time `secret` is returned.
|
|
88
|
+
*
|
|
89
|
+
* `POST /v1/keys` · scope `platform:write` · served by beta-api.b3os.org
|
|
90
|
+
*/
|
|
91
|
+
createKey(body, options) {
|
|
92
|
+
return this._client._call(createKeyOp, { body }, options);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Describe the calling credential
|
|
96
|
+
*
|
|
97
|
+
* Returns who is calling: the key or CLI token (or dashboard session, or sandbox), its organization and
|
|
98
|
+
* project, scopes, spend cap and expiry. Any valid credential may call it, whatever its scopes.
|
|
99
|
+
*
|
|
100
|
+
* `GET /v1/keys/current` · scope `authenticated` · served by beta-api.b3os.org
|
|
101
|
+
*/
|
|
102
|
+
getCurrentKey(options) {
|
|
103
|
+
return this._client._call(getCurrentKeyOp, {}, options);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Revoke an API key
|
|
107
|
+
*
|
|
108
|
+
* Revokes the key. The operations the edge answers itself refuse it at once; every other request refuses it
|
|
109
|
+
* within 10 seconds (the edge keeps a key's record at most 10 seconds after reading it from its primary
|
|
110
|
+
* database, and never reads keys from a replica). The edge also pushes the revocation to nodes, so open
|
|
111
|
+
* streams authenticated by it close within 60 seconds. Routines published with it pause their triggers.
|
|
112
|
+
* Returns the revoked key; it stays listed for audit. Changes made with `PATCH /v1/keys/{key_id}` take effect
|
|
113
|
+
* within the same 10 seconds.
|
|
114
|
+
*
|
|
115
|
+
* `DELETE /v1/keys/{key_id}` · scope `platform:write` · served by beta-api.b3os.org
|
|
116
|
+
*/
|
|
117
|
+
revokeKey(keyId, options) {
|
|
118
|
+
return this._client._call(revokeKeyOp, { path: [keyId] }, options);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Get an API key
|
|
122
|
+
*
|
|
123
|
+
* Returns one key's metadata, spend this period and last use. The secret is never returned.
|
|
124
|
+
*
|
|
125
|
+
* `GET /v1/keys/{key_id}` · scope `platform:read` · served by beta-api.b3os.org
|
|
126
|
+
*/
|
|
127
|
+
getKey(keyId, options) {
|
|
128
|
+
return this._client._call(getKeyOp, { path: [keyId] }, options);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Update an API key
|
|
132
|
+
*
|
|
133
|
+
* Renames a key or changes its spend cap, expiry or metadata. Scopes cannot change; create a new key instead.
|
|
134
|
+
* A caller with a spend cap or an expiry cannot set a larger cap or a later (or no) expiry than its own
|
|
135
|
+
* (`forbidden`, reason `scope_escalation`).
|
|
136
|
+
*
|
|
137
|
+
* `PATCH /v1/keys/{key_id}` · scope `platform:write` · served by beta-api.b3os.org
|
|
138
|
+
*/
|
|
139
|
+
updateKey(keyId, body, options) {
|
|
140
|
+
return this._client._call(updateKeyOp, { path: [keyId], body }, options);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
exports.KeysAPI = KeysAPI;
|
|
144
|
+
//# sourceMappingURL=keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../../../../src/generated/ns/keys.ts"],"names":[],"mappings":";AAAA,4GAA4G;;;AAG5G,0DAAoD;AAKpD,MAAM,UAAU,GAAO;IACrB,EAAE,EAAE,kBAAkB;IACtB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,eAAe;CACvB,CAAC;AACF,MAAM,WAAW,GAAO;IACtB,EAAE,EAAE,mBAAmB;IACvB,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,gBAAgB;CACxB,CAAC;AACF,MAAM,eAAe,GAAO;IAC1B,EAAE,EAAE,uBAAuB;IAC3B,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,IAAI;IACf,KAAK,EAAE,eAAe;CACvB,CAAC;AACF,MAAM,WAAW,GAAO;IACtB,EAAE,EAAE,mBAAmB;IACvB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,mBAAmB;IACzB,MAAM,EAAE,CAAC,QAAQ,CAAC;IAClB,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,gBAAgB;CACxB,CAAC;AACF,MAAM,QAAQ,GAAO;IACnB,EAAE,EAAE,gBAAgB;IACpB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,mBAAmB;IACzB,MAAM,E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IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,KAAa,EAAE,OAAwB;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAW,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;;;OAQG;IACH,SAAS,CAAC,KAAa,EAAE,IAA2B,EAAE,OAAwB;QAC5E,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAW,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;IACrF,CAAC;CACF;AA7ED,0BA6EC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { RequestOptions } from "../../core/client.ts";
|
|
2
|
+
import { Namespace } from "../../core/namespace.ts";
|
|
3
|
+
import type { Op } from "../../core/op.ts";
|
|
4
|
+
import type { APIPromise } from "../../core/promise.ts";
|
|
5
|
+
import type * as T from "../types.ts";
|
|
6
|
+
/** Descriptors of every limits operation, keyed by method name (for tooling and custom clients). */
|
|
7
|
+
export declare const limitsOps: {
|
|
8
|
+
readonly getLimits: Op;
|
|
9
|
+
};
|
|
10
|
+
/** Limits that apply to the caller (`/v1/limits`; served by beta-api.b3os.org). */
|
|
11
|
+
export declare class LimitsAPI extends Namespace {
|
|
12
|
+
/**
|
|
13
|
+
* Get your limits
|
|
14
|
+
*
|
|
15
|
+
* Returns every limit that applies to the caller with its current usage: concurrency, rates, quotas and size
|
|
16
|
+
* caps per product, plus the key's spend cap. Any valid credential may call it. The IDs match the `limit`
|
|
17
|
+
* member of `429` and `422` problems.
|
|
18
|
+
*
|
|
19
|
+
* `GET /v1/limits` · scope `authenticated` · served by beta-api.b3os.org
|
|
20
|
+
*/
|
|
21
|
+
getLimits(options?: RequestOptions): APIPromise<T.Limits>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Generated by packages/sdk/scripts/generate.mjs from packages/spec/dist. Do not edit; run `pnpm generate`.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.LimitsAPI = exports.limitsOps = void 0;
|
|
5
|
+
const namespace_ts_1 = require("../../core/namespace.js");
|
|
6
|
+
const getLimitsOp = {
|
|
7
|
+
id: "platformGetLimits",
|
|
8
|
+
method: "GET",
|
|
9
|
+
path: "/v1/limits",
|
|
10
|
+
edge: true,
|
|
11
|
+
timeoutMs: 10000,
|
|
12
|
+
scope: "authenticated",
|
|
13
|
+
};
|
|
14
|
+
/** Descriptors of every limits operation, keyed by method name (for tooling and custom clients). */
|
|
15
|
+
exports.limitsOps = { getLimits: getLimitsOp };
|
|
16
|
+
/** Limits that apply to the caller (`/v1/limits`; served by beta-api.b3os.org). */
|
|
17
|
+
class LimitsAPI extends namespace_ts_1.Namespace {
|
|
18
|
+
/**
|
|
19
|
+
* Get your limits
|
|
20
|
+
*
|
|
21
|
+
* Returns every limit that applies to the caller with its current usage: concurrency, rates, quotas and size
|
|
22
|
+
* caps per product, plus the key's spend cap. Any valid credential may call it. The IDs match the `limit`
|
|
23
|
+
* member of `429` and `422` problems.
|
|
24
|
+
*
|
|
25
|
+
* `GET /v1/limits` · scope `authenticated` · served by beta-api.b3os.org
|
|
26
|
+
*/
|
|
27
|
+
getLimits(options) {
|
|
28
|
+
return this._client._call(getLimitsOp, {}, options);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.LimitsAPI = LimitsAPI;
|
|
32
|
+
//# sourceMappingURL=limits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.js","sourceRoot":"","sources":["../../../../src/generated/ns/limits.ts"],"names":[],"mappings":";AAAA,4GAA4G;;;AAG5G,0DAAoD;AAKpD,MAAM,WAAW,GAAO;IACtB,EAAE,EAAE,mBAAmB;IACvB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,eAAe;CACvB,CAAC;AAEF,oGAAoG;AACvF,QAAA,SAAS,GAAG,EAAE,SAAS,EAAE,WAAW,EAAW,CAAC;AAE7D,mFAAmF;AACnF,MAAa,SAAU,SAAQ,wBAAS;IACtC;;;;;;;;OAQG;IACH,SAAS,CAAC,OAAwB;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAW,WAAW,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;CACF;AAbD,8BAaC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { RequestOptions } from "../../core/client.ts";
|
|
2
|
+
import { Namespace } from "../../core/namespace.ts";
|
|
3
|
+
import type { Op } from "../../core/op.ts";
|
|
4
|
+
import type { APIPromise, ListPromise } from "../../core/promise.ts";
|
|
5
|
+
import type * as T from "../types.ts";
|
|
6
|
+
/** Descriptors of every orgs operation, keyed by method name (for tooling and custom clients). */
|
|
7
|
+
export declare const orgsOps: {
|
|
8
|
+
readonly listOrgs: Op;
|
|
9
|
+
readonly getOrg: Op;
|
|
10
|
+
readonly listMembers: Op;
|
|
11
|
+
};
|
|
12
|
+
/** Organizations and members (`/v1/orgs`; served by beta-api.b3os.org). */
|
|
13
|
+
export declare class OrgsAPI extends Namespace {
|
|
14
|
+
/**
|
|
15
|
+
* List organizations
|
|
16
|
+
*
|
|
17
|
+
* Lists the organizations the caller belongs to (an API key belongs to exactly one).
|
|
18
|
+
*
|
|
19
|
+
* `GET /v1/orgs` · scope `authenticated` · served by beta-api.b3os.org
|
|
20
|
+
*/
|
|
21
|
+
listOrgs(options?: RequestOptions): APIPromise<T.OrganizationList>;
|
|
22
|
+
/**
|
|
23
|
+
* Get an organization
|
|
24
|
+
*
|
|
25
|
+
* Returns one organization the caller belongs to, with the caller's role in it.
|
|
26
|
+
*
|
|
27
|
+
* `GET /v1/orgs/{org_id}` · scope `platform:read` · served by beta-api.b3os.org
|
|
28
|
+
*/
|
|
29
|
+
getOrg(orgId: string, options?: RequestOptions): APIPromise<T.Organization>;
|
|
30
|
+
/**
|
|
31
|
+
* List members
|
|
32
|
+
*
|
|
33
|
+
* Lists the organization's members and their roles.
|
|
34
|
+
*
|
|
35
|
+
* `GET /v1/orgs/{org_id}/members` · scope `platform:read` · served by beta-api.b3os.org
|
|
36
|
+
*/
|
|
37
|
+
listMembers(orgId: string, params?: T.PlatformListMembersParams, options?: RequestOptions): ListPromise<T.MemberList, T.Member>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Generated by packages/sdk/scripts/generate.mjs from packages/spec/dist. Do not edit; run `pnpm generate`.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.OrgsAPI = exports.orgsOps = void 0;
|
|
5
|
+
const namespace_ts_1 = require("../../core/namespace.js");
|
|
6
|
+
const listOrgsOp = {
|
|
7
|
+
id: "platformListOrgs",
|
|
8
|
+
method: "GET",
|
|
9
|
+
path: "/v1/orgs",
|
|
10
|
+
edge: true,
|
|
11
|
+
timeoutMs: 10000,
|
|
12
|
+
scope: "authenticated",
|
|
13
|
+
};
|
|
14
|
+
const getOrgOp = {
|
|
15
|
+
id: "platformGetOrg",
|
|
16
|
+
method: "GET",
|
|
17
|
+
path: "/v1/orgs/{org_id}",
|
|
18
|
+
params: ["org_id"],
|
|
19
|
+
edge: true,
|
|
20
|
+
timeoutMs: 10000,
|
|
21
|
+
scope: "platform:read",
|
|
22
|
+
};
|
|
23
|
+
const listMembersOp = {
|
|
24
|
+
id: "platformListMembers",
|
|
25
|
+
method: "GET",
|
|
26
|
+
path: "/v1/orgs/{org_id}/members",
|
|
27
|
+
params: ["org_id"],
|
|
28
|
+
edge: true,
|
|
29
|
+
timeoutMs: 10000,
|
|
30
|
+
scope: "platform:read",
|
|
31
|
+
};
|
|
32
|
+
/** Descriptors of every orgs operation, keyed by method name (for tooling and custom clients). */
|
|
33
|
+
exports.orgsOps = { listOrgs: listOrgsOp, getOrg: getOrgOp, listMembers: listMembersOp };
|
|
34
|
+
/** Organizations and members (`/v1/orgs`; served by beta-api.b3os.org). */
|
|
35
|
+
class OrgsAPI extends namespace_ts_1.Namespace {
|
|
36
|
+
/**
|
|
37
|
+
* List organizations
|
|
38
|
+
*
|
|
39
|
+
* Lists the organizations the caller belongs to (an API key belongs to exactly one).
|
|
40
|
+
*
|
|
41
|
+
* `GET /v1/orgs` · scope `authenticated` · served by beta-api.b3os.org
|
|
42
|
+
*/
|
|
43
|
+
listOrgs(options) {
|
|
44
|
+
return this._client._call(listOrgsOp, {}, options);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Get an organization
|
|
48
|
+
*
|
|
49
|
+
* Returns one organization the caller belongs to, with the caller's role in it.
|
|
50
|
+
*
|
|
51
|
+
* `GET /v1/orgs/{org_id}` · scope `platform:read` · served by beta-api.b3os.org
|
|
52
|
+
*/
|
|
53
|
+
getOrg(orgId, options) {
|
|
54
|
+
return this._client._call(getOrgOp, { path: [orgId] }, options);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* List members
|
|
58
|
+
*
|
|
59
|
+
* Lists the organization's members and their roles.
|
|
60
|
+
*
|
|
61
|
+
* `GET /v1/orgs/{org_id}/members` · scope `platform:read` · served by beta-api.b3os.org
|
|
62
|
+
*/
|
|
63
|
+
listMembers(orgId, params, options) {
|
|
64
|
+
return this._client._list(listMembersOp, { path: [orgId], query: params }, options);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.OrgsAPI = OrgsAPI;
|
|
68
|
+
//# sourceMappingURL=orgs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orgs.js","sourceRoot":"","sources":["../../../../src/generated/ns/orgs.ts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AAoC,EACpC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAyB,aAAa,EAAE,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9G,CAAC;CACF;AArCD,0BAqCC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { RequestOptions } from "../../core/client.ts";
|
|
2
|
+
import { Namespace } from "../../core/namespace.ts";
|
|
3
|
+
import type { Op } from "../../core/op.ts";
|
|
4
|
+
import type { APIPromise, ListPromise } from "../../core/promise.ts";
|
|
5
|
+
import type * as T from "../types.ts";
|
|
6
|
+
/** Descriptors of every projects operation, keyed by method name (for tooling and custom clients). */
|
|
7
|
+
export declare const projectsOps: {
|
|
8
|
+
readonly listProjects: Op;
|
|
9
|
+
readonly createProject: Op;
|
|
10
|
+
readonly deleteProject: Op;
|
|
11
|
+
readonly getProject: Op;
|
|
12
|
+
readonly updateProject: Op;
|
|
13
|
+
};
|
|
14
|
+
/** Projects (`/v1/projects`; served by beta-api.b3os.org). */
|
|
15
|
+
export declare class ProjectsAPI extends Namespace {
|
|
16
|
+
/**
|
|
17
|
+
* List projects
|
|
18
|
+
*
|
|
19
|
+
* Lists the projects of the caller's organization.
|
|
20
|
+
*
|
|
21
|
+
* `GET /v1/projects` · scope `platform:read` · served by beta-api.b3os.org
|
|
22
|
+
*/
|
|
23
|
+
listProjects(params?: T.PlatformListProjectsParams, options?: RequestOptions): ListPromise<T.ProjectList, T.Project>;
|
|
24
|
+
/**
|
|
25
|
+
* Create a project
|
|
26
|
+
*
|
|
27
|
+
* Creates a project in the caller's organization. Objects, keys, connections and usage are separated per project.
|
|
28
|
+
*
|
|
29
|
+
* `POST /v1/projects` · scope `platform:write` · served by beta-api.b3os.org
|
|
30
|
+
*/
|
|
31
|
+
createProject(body: T.ProjectCreateRequest, options?: RequestOptions): APIPromise<T.Project>;
|
|
32
|
+
/**
|
|
33
|
+
* Delete a project
|
|
34
|
+
*
|
|
35
|
+
* Deletes an empty project: it must have no running sandboxes, open browser sessions or active routines
|
|
36
|
+
* (`project_not_empty`), and may not be the organization's last project (`last_project`). Its keys are revoked.
|
|
37
|
+
*
|
|
38
|
+
* `DELETE /v1/projects/{project_id}` · scope `platform:write` · served by beta-api.b3os.org
|
|
39
|
+
*/
|
|
40
|
+
deleteProject(projectId: string, options?: RequestOptions): APIPromise<T.Deleted>;
|
|
41
|
+
/**
|
|
42
|
+
* Get a project
|
|
43
|
+
*
|
|
44
|
+
* Returns one project of the caller's organization.
|
|
45
|
+
*
|
|
46
|
+
* `GET /v1/projects/{project_id}` · scope `platform:read` · served by beta-api.b3os.org
|
|
47
|
+
*/
|
|
48
|
+
getProject(projectId: string, options?: RequestOptions): APIPromise<T.Project>;
|
|
49
|
+
/**
|
|
50
|
+
* Update a project
|
|
51
|
+
*
|
|
52
|
+
* Renames a project or replaces its metadata.
|
|
53
|
+
*
|
|
54
|
+
* `PATCH /v1/projects/{project_id}` · scope `platform:write` · served by beta-api.b3os.org
|
|
55
|
+
*/
|
|
56
|
+
updateProject(projectId: string, body: T.ProjectUpdateRequest, options?: RequestOptions): APIPromise<T.Project>;
|
|
57
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Generated by packages/sdk/scripts/generate.mjs from packages/spec/dist. Do not edit; run `pnpm generate`.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ProjectsAPI = exports.projectsOps = void 0;
|
|
5
|
+
const namespace_ts_1 = require("../../core/namespace.js");
|
|
6
|
+
const listProjectsOp = {
|
|
7
|
+
id: "platformListProjects",
|
|
8
|
+
method: "GET",
|
|
9
|
+
path: "/v1/projects",
|
|
10
|
+
edge: true,
|
|
11
|
+
timeoutMs: 10000,
|
|
12
|
+
scope: "platform:read",
|
|
13
|
+
};
|
|
14
|
+
const createProjectOp = {
|
|
15
|
+
id: "platformCreateProject",
|
|
16
|
+
method: "POST",
|
|
17
|
+
path: "/v1/projects",
|
|
18
|
+
body: "json",
|
|
19
|
+
edge: true,
|
|
20
|
+
idem: true,
|
|
21
|
+
timeoutMs: 10000,
|
|
22
|
+
scope: "platform:write",
|
|
23
|
+
};
|
|
24
|
+
const deleteProjectOp = {
|
|
25
|
+
id: "platformDeleteProject",
|
|
26
|
+
method: "DELETE",
|
|
27
|
+
path: "/v1/projects/{project_id}",
|
|
28
|
+
params: ["project_id"],
|
|
29
|
+
edge: true,
|
|
30
|
+
timeoutMs: 15000,
|
|
31
|
+
scope: "platform:write",
|
|
32
|
+
};
|
|
33
|
+
const getProjectOp = {
|
|
34
|
+
id: "platformGetProject",
|
|
35
|
+
method: "GET",
|
|
36
|
+
path: "/v1/projects/{project_id}",
|
|
37
|
+
params: ["project_id"],
|
|
38
|
+
edge: true,
|
|
39
|
+
timeoutMs: 10000,
|
|
40
|
+
scope: "platform:read",
|
|
41
|
+
};
|
|
42
|
+
const updateProjectOp = {
|
|
43
|
+
id: "platformUpdateProject",
|
|
44
|
+
method: "PATCH",
|
|
45
|
+
path: "/v1/projects/{project_id}",
|
|
46
|
+
params: ["project_id"],
|
|
47
|
+
body: "json",
|
|
48
|
+
edge: true,
|
|
49
|
+
timeoutMs: 10000,
|
|
50
|
+
scope: "platform:write",
|
|
51
|
+
};
|
|
52
|
+
/** Descriptors of every projects operation, keyed by method name (for tooling and custom clients). */
|
|
53
|
+
exports.projectsOps = {
|
|
54
|
+
listProjects: listProjectsOp,
|
|
55
|
+
createProject: createProjectOp,
|
|
56
|
+
deleteProject: deleteProjectOp,
|
|
57
|
+
getProject: getProjectOp,
|
|
58
|
+
updateProject: updateProjectOp,
|
|
59
|
+
};
|
|
60
|
+
/** Projects (`/v1/projects`; served by beta-api.b3os.org). */
|
|
61
|
+
class ProjectsAPI extends namespace_ts_1.Namespace {
|
|
62
|
+
/**
|
|
63
|
+
* List projects
|
|
64
|
+
*
|
|
65
|
+
* Lists the projects of the caller's organization.
|
|
66
|
+
*
|
|
67
|
+
* `GET /v1/projects` · scope `platform:read` · served by beta-api.b3os.org
|
|
68
|
+
*/
|
|
69
|
+
listProjects(params, options) {
|
|
70
|
+
return this._client._list(listProjectsOp, { query: params }, options);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Create a project
|
|
74
|
+
*
|
|
75
|
+
* Creates a project in the caller's organization. Objects, keys, connections and usage are separated per project.
|
|
76
|
+
*
|
|
77
|
+
* `POST /v1/projects` · scope `platform:write` · served by beta-api.b3os.org
|
|
78
|
+
*/
|
|
79
|
+
createProject(body, options) {
|
|
80
|
+
return this._client._call(createProjectOp, { body }, options);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Delete a project
|
|
84
|
+
*
|
|
85
|
+
* Deletes an empty project: it must have no running sandboxes, open browser sessions or active routines
|
|
86
|
+
* (`project_not_empty`), and may not be the organization's last project (`last_project`). Its keys are revoked.
|
|
87
|
+
*
|
|
88
|
+
* `DELETE /v1/projects/{project_id}` · scope `platform:write` · served by beta-api.b3os.org
|
|
89
|
+
*/
|
|
90
|
+
deleteProject(projectId, options) {
|
|
91
|
+
return this._client._call(deleteProjectOp, { path: [projectId] }, options);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Get a project
|
|
95
|
+
*
|
|
96
|
+
* Returns one project of the caller's organization.
|
|
97
|
+
*
|
|
98
|
+
* `GET /v1/projects/{project_id}` · scope `platform:read` · served by beta-api.b3os.org
|
|
99
|
+
*/
|
|
100
|
+
getProject(projectId, options) {
|
|
101
|
+
return this._client._call(getProjectOp, { path: [projectId] }, options);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Update a project
|
|
105
|
+
*
|
|
106
|
+
* Renames a project or replaces its metadata.
|
|
107
|
+
*
|
|
108
|
+
* `PATCH /v1/projects/{project_id}` · scope `platform:write` · served by beta-api.b3os.org
|
|
109
|
+
*/
|
|
110
|
+
updateProject(projectId, body, options) {
|
|
111
|
+
return this._client._call(updateProjectOp, { path: [projectId], body }, options);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
exports.ProjectsAPI = ProjectsAPI;
|
|
115
|
+
//# sourceMappingURL=projects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../../../../src/generated/ns/projects.ts"],"names":[],"mappings":";AAAA,4GAA4G;;;AAG5G,0DAAoD;AAKpD,MAAM,cAAc,GAAO;IACzB,EAAE,EAAE,sBAAsB;IAC1B,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,eAAe;CACvB,CAAC;AACF,MAAM,eAAe,GAAO;IAC1B,EAAE,EAAE,uBAAuB;IAC3B,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,gBAAgB;CACxB,CAAC;AACF,MAAM,eAAe,GAAO;IAC1B,EAAE,EAAE,uBAAuB;IAC3B,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,2BAA2B;IACjC,MAAM,EAAE,CAAC,YAAY,CAAC;IACtB,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,gBAAgB;CACxB,CAAC;AACF,MAAM,YAAY,GAAO;IACvB,EAAE,EAAE,oBAAoB;IACxB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,2BAA2B;IACjC,MAAM,EAAE,CAAC,YAAY,CAAC;IACtB,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,eAAe;CACvB,CAAC;AACF,MAAM,eAAe,GAAO;IAC1B,EAAE,EAAE,uBAAuB;IAC3B,MAAM,EAAE,OAAO;IACf,IAAI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,CAAY,eAAe,EAAE,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9F,CAAC;CACF;AAxDD,kCAwDC"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import type { RequestOptions, StreamOptions } from "../../core/client.ts";
|
|
2
|
+
import { Namespace } from "../../core/namespace.ts";
|
|
3
|
+
import type { Op } from "../../core/op.ts";
|
|
4
|
+
import type { APIPromise, JobPromise, ListPromise } from "../../core/promise.ts";
|
|
5
|
+
import type { EventStream } from "../../core/sse.ts";
|
|
6
|
+
import type * as T from "../types.ts";
|
|
7
|
+
/** Descriptors of every render operation, keyed by method name (for tooling and custom clients). */
|
|
8
|
+
export declare const renderOps: {
|
|
9
|
+
readonly getArtifact: Op;
|
|
10
|
+
readonly listPresets: Op;
|
|
11
|
+
readonly listScreenshots: Op;
|
|
12
|
+
readonly createScreenshot: Op;
|
|
13
|
+
readonly deleteScreenshot: Op;
|
|
14
|
+
readonly getScreenshot: Op;
|
|
15
|
+
readonly listVideos: Op;
|
|
16
|
+
readonly createVideo: Op;
|
|
17
|
+
readonly deleteVideo: Op;
|
|
18
|
+
readonly getVideo: Op;
|
|
19
|
+
readonly cancelVideo: Op;
|
|
20
|
+
readonly videoEvents: Op;
|
|
21
|
+
readonly restyleVideo: Op;
|
|
22
|
+
readonly getVideoTimeline: Op;
|
|
23
|
+
};
|
|
24
|
+
/** Styled screenshots and product videos (`/v1/render`). */
|
|
25
|
+
export declare class RenderAPI extends Namespace {
|
|
26
|
+
/**
|
|
27
|
+
* Get an artifact
|
|
28
|
+
*
|
|
29
|
+
* Returns an artifact's metadata with a fresh signed URL (valid for 24 hours). The URL needs no credentials and
|
|
30
|
+
* is safe to embed: it works for anyone who has it until `url_expires_at`, and the bytes are always served with
|
|
31
|
+
* `Content-Security-Policy: sandbox` (URL format: `renderGetArtifactContent`).
|
|
32
|
+
*
|
|
33
|
+
* `GET /v1/render/artifacts/{artifact_id}` · scope `render:read` · served by the node
|
|
34
|
+
*/
|
|
35
|
+
getArtifact(artifactId: string, options?: RequestOptions): APIPromise<T.Artifact>;
|
|
36
|
+
/**
|
|
37
|
+
* List style presets
|
|
38
|
+
*
|
|
39
|
+
* Lists the style presets `style` can name (backgrounds, window frames, cursors, caption styles, click effects), with a preview image for each.
|
|
40
|
+
*
|
|
41
|
+
* `GET /v1/render/presets` · scope `render:read` · served by the node
|
|
42
|
+
*/
|
|
43
|
+
listPresets(params?: T.RenderListPresetsParams, options?: RequestOptions): APIPromise<T.PresetList>;
|
|
44
|
+
/**
|
|
45
|
+
* List screenshots
|
|
46
|
+
*
|
|
47
|
+
* Lists screenshots in this project, newest first. Screenshots are kept for 7 days.
|
|
48
|
+
*
|
|
49
|
+
* `GET /v1/render/screenshots` · scope `render:read` · served by the node
|
|
50
|
+
*/
|
|
51
|
+
listScreenshots(params?: T.RenderListScreenshotsParams, options?: RequestOptions): ListPromise<T.ScreenshotList, T.Screenshot>;
|
|
52
|
+
/**
|
|
53
|
+
* Take a screenshot
|
|
54
|
+
*
|
|
55
|
+
* Loads `url` (or renders `html`) in a warm browser, captures the viewport, the full page or one element, and
|
|
56
|
+
* composes it with a style (background, window frame, padding, shadow). Returns JSON with signed artifact
|
|
57
|
+
* URLs, or the image bytes directly when `Accept` is `image/png`, `image/jpeg` or `image/webp`. `variants`
|
|
58
|
+
* adds extra encodings of the same capture. Bills one `render.screenshot` per capture plus one per variant.
|
|
59
|
+
*
|
|
60
|
+
* `POST /v1/render/screenshots` · scope `render:run` · served by the node
|
|
61
|
+
*/
|
|
62
|
+
createScreenshot(body: T.ScreenshotCreateRequest, options: RequestOptions & {
|
|
63
|
+
accept: "image/webp" | "image/png" | "image/jpeg";
|
|
64
|
+
}): APIPromise<Uint8Array>;
|
|
65
|
+
createScreenshot(body: T.ScreenshotCreateRequest, options?: RequestOptions & {
|
|
66
|
+
accept?: "application/json";
|
|
67
|
+
}): APIPromise<T.Screenshot>;
|
|
68
|
+
/**
|
|
69
|
+
* Delete a screenshot
|
|
70
|
+
*
|
|
71
|
+
* Deletes the screenshot and its artifacts. Signed URLs stop working within a minute.
|
|
72
|
+
*
|
|
73
|
+
* `DELETE /v1/render/screenshots/{screenshot_id}` · scope `render:write` · served by the node
|
|
74
|
+
*/
|
|
75
|
+
deleteScreenshot(screenshotId: string, options?: RequestOptions): APIPromise<T.Deleted>;
|
|
76
|
+
/**
|
|
77
|
+
* Get a screenshot
|
|
78
|
+
*
|
|
79
|
+
* Returns the screenshot with fresh signed URLs for its artifacts.
|
|
80
|
+
*
|
|
81
|
+
* `GET /v1/render/screenshots/{screenshot_id}` · scope `render:read` · served by the node
|
|
82
|
+
*/
|
|
83
|
+
getScreenshot(screenshotId: string, options?: RequestOptions): APIPromise<T.Screenshot>;
|
|
84
|
+
/**
|
|
85
|
+
* List videos
|
|
86
|
+
*
|
|
87
|
+
* Lists videos in this project, newest first. Videos and their artifacts are kept for 7 days.
|
|
88
|
+
*
|
|
89
|
+
* `GET /v1/render/videos` · scope `render:read` · served by the node
|
|
90
|
+
*/
|
|
91
|
+
listVideos(params?: T.RenderListVideosParams, options?: RequestOptions): ListPromise<T.VideoList, T.Video>;
|
|
92
|
+
/**
|
|
93
|
+
* Record a video
|
|
94
|
+
*
|
|
95
|
+
* Starts a job that records a scripted demo of `source.url`. Narration (`say`) is synthesized first with
|
|
96
|
+
* `/v1/infer/audio/speech`; the director then places each beat's steps on its narration, plans cursor and
|
|
97
|
+
* camera, records segments in parallel on a virtual clock, composes at the output frame rate and encodes MP4
|
|
98
|
+
* (H.264, BT.709), GIF, poster and captions. Artifacts appear as they finish (`video.artifact` events, poster
|
|
99
|
+
* first). Bills `render.video_s` per second of output.
|
|
100
|
+
*
|
|
101
|
+
* `POST /v1/render/videos` · scope `render:run` · served by the node
|
|
102
|
+
*/
|
|
103
|
+
createVideo(body: T.VideoCreateRequest, options?: RequestOptions): JobPromise<T.Video, T.VideoEvent>;
|
|
104
|
+
/**
|
|
105
|
+
* Delete a video
|
|
106
|
+
*
|
|
107
|
+
* Cancels the job if it is still running, then deletes the video, its artifacts and its archived capture.
|
|
108
|
+
*
|
|
109
|
+
* `DELETE /v1/render/videos/{video_id}` · scope `render:write` · served by the node
|
|
110
|
+
*/
|
|
111
|
+
deleteVideo(videoId: string, options?: RequestOptions): APIPromise<T.Deleted>;
|
|
112
|
+
/**
|
|
113
|
+
* Get a video
|
|
114
|
+
*
|
|
115
|
+
* Returns the video job; once it succeeded, `result.artifacts` lists its files with fresh signed URLs.
|
|
116
|
+
*
|
|
117
|
+
* `GET /v1/render/videos/{video_id}` · scope `render:read` · served by the node
|
|
118
|
+
*/
|
|
119
|
+
getVideo(videoId: string, options?: RequestOptions): APIPromise<T.Video>;
|
|
120
|
+
/**
|
|
121
|
+
* Cancel a video
|
|
122
|
+
*
|
|
123
|
+
* Stops the job. Artifacts already produced are kept; seconds already encoded are billed.
|
|
124
|
+
*
|
|
125
|
+
* `POST /v1/render/videos/{video_id}/cancel` · scope `render:run` · served by the node
|
|
126
|
+
*/
|
|
127
|
+
cancelVideo(videoId: string, options?: RequestOptions): APIPromise<T.Video>;
|
|
128
|
+
/**
|
|
129
|
+
* Stream a video's events
|
|
130
|
+
*
|
|
131
|
+
* Server-sent events for the video job: lifecycle events, `video.phase` as the job moves through voice, plan,
|
|
132
|
+
* capture, compose, encode and upload, and `video.artifact` as each file becomes available. Ends after the
|
|
133
|
+
* terminal event; reconnect with `Last-Event-ID` to resume.
|
|
134
|
+
*
|
|
135
|
+
* `GET /v1/render/videos/{video_id}/events` · scope `render:read` · served by the node
|
|
136
|
+
*/
|
|
137
|
+
videoEvents(videoId: string, options?: StreamOptions): EventStream<T.VideoEvent>;
|
|
138
|
+
/**
|
|
139
|
+
* Restyle a video
|
|
140
|
+
*
|
|
141
|
+
* Starts a job that re-composes the source video's archived raw capture with a new style, captions, output
|
|
142
|
+
* size or formats. No browser runs and narration is reused, so it takes seconds. Camera moves are not
|
|
143
|
+
* changed. The result is a new video (`restyled_from` names the source). The raw capture is kept as long as
|
|
144
|
+
* the source video (7 days).
|
|
145
|
+
*
|
|
146
|
+
* `POST /v1/render/videos/{video_id}/restyle` · scope `render:run` · served by the node
|
|
147
|
+
*/
|
|
148
|
+
restyleVideo(videoId: string, body: T.VideoRestyleRequest, options?: RequestOptions): JobPromise<T.Video, T.VideoEvent>;
|
|
149
|
+
/**
|
|
150
|
+
* Get a video's timeline
|
|
151
|
+
*
|
|
152
|
+
* Returns the compiled timeline of a video that has finished planning: beats, narration with word timings,
|
|
153
|
+
* the timed action list the recorder replayed, cursor path, camera keyframes, captions and style
|
|
154
|
+
* (`timeline.schema.json`). `frames=1` adds the per-frame compositor state (large; for debugging).
|
|
155
|
+
*
|
|
156
|
+
* `GET /v1/render/videos/{video_id}/timeline` · scope `render:read` · served by the node
|
|
157
|
+
*/
|
|
158
|
+
getVideoTimeline(videoId: string, params?: T.RenderGetVideoTimelineParams, options?: RequestOptions): APIPromise<T.RenderTimeline>;
|
|
159
|
+
}
|