@limitry/cli 1.0.0-rc.11 → 1.0.0-rc.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/CHANGELOG.md +84 -0
- package/README.md +1 -1
- package/dist/limitry.mjs +520 -260
- package/package.json +3 -3
package/dist/limitry.mjs
CHANGED
|
@@ -31,7 +31,7 @@ var brand_default = {
|
|
|
31
31
|
devDomain: "limitry.dev",
|
|
32
32
|
labs: ["lab"],
|
|
33
33
|
discordInvite: "https://discord.gg/Nb6QFd6ER4",
|
|
34
|
-
summary: "Limitry is the limits, credits and budgets layer for
|
|
34
|
+
summary: "Limitry is the limits, credits and budgets layer for the software you build: give each of your users, teams, tenants, API keys or agents an allowance, and before any costly action one call tells your code whether it may happen.",
|
|
35
35
|
expectedAssets: [
|
|
36
36
|
"logo.svg",
|
|
37
37
|
"logo-dark.svg",
|
|
@@ -42,25 +42,45 @@ var brand_default = {
|
|
|
42
42
|
"apple-touch-icon.png"
|
|
43
43
|
],
|
|
44
44
|
colors: {
|
|
45
|
-
brand: "#
|
|
46
|
-
brandForeground: "#
|
|
47
|
-
brandDark: "#
|
|
48
|
-
brandDarkForeground: "#
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
45
|
+
brand: "#1E4D8C",
|
|
46
|
+
brandForeground: "#FFFFFF",
|
|
47
|
+
brandDark: "#7FB2FF",
|
|
48
|
+
brandDarkForeground: "#0B1F3A",
|
|
49
|
+
paper: "#F6F8FB",
|
|
50
|
+
paperDark: "#07121F",
|
|
51
|
+
surface: "#FFFFFF",
|
|
52
|
+
surfaceDark: "#0D1D31",
|
|
53
|
+
mist: "#DCEBFF",
|
|
54
|
+
mistDark: "#0F2645",
|
|
55
|
+
text: "#0B1F3A",
|
|
56
|
+
textDark: "#EAF1FB",
|
|
57
|
+
muted: "#4A5B73",
|
|
58
|
+
mutedDark: "#A3B6CE",
|
|
59
|
+
line: "#DCE4EE",
|
|
60
|
+
lineDark: "#1C3352",
|
|
61
|
+
sky: "#7FB2FF",
|
|
62
|
+
cobalt: "#1E4D8C",
|
|
63
|
+
cobaltDark: "#7FB2FF",
|
|
64
|
+
cobaltHover: "#173E73",
|
|
65
|
+
cobaltHoverDark: "#A8CBFF",
|
|
66
|
+
deep: "#0B1F3A",
|
|
67
|
+
deepDark: "#0F2645",
|
|
68
|
+
focus: "#4F86D6",
|
|
69
|
+
held: "#E8A33D",
|
|
70
|
+
refused: "#CE2C31",
|
|
71
|
+
refusedDark: "#FF6369"
|
|
55
72
|
},
|
|
56
73
|
fonts: {
|
|
57
|
-
display: "
|
|
58
|
-
body: "
|
|
74
|
+
display: "Manrope Variable",
|
|
75
|
+
body: "Manrope Variable",
|
|
76
|
+
code: "JetBrains Mono Variable"
|
|
59
77
|
},
|
|
60
78
|
layout: {
|
|
61
|
-
radius: "
|
|
79
|
+
radius: "10px",
|
|
80
|
+
radiusControl: "8px",
|
|
81
|
+
logoHeight: "29px",
|
|
62
82
|
gutter: "1.5rem",
|
|
63
|
-
contentWidth: "
|
|
83
|
+
contentWidth: "72rem",
|
|
64
84
|
readableWidth: "42rem",
|
|
65
85
|
sectionGap: "2rem",
|
|
66
86
|
navGap: "1.5rem",
|
|
@@ -72,12 +92,14 @@ var brand_default = {
|
|
|
72
92
|
name: "test",
|
|
73
93
|
keyPrefix: "lim_test_",
|
|
74
94
|
readOnlyWorkspace: true,
|
|
75
|
-
|
|
95
|
+
agentLabel: "Practice data your developers use",
|
|
96
|
+
description: "Use test to build and try things. Test checks aren't billed."
|
|
76
97
|
},
|
|
77
98
|
{
|
|
78
99
|
name: "live",
|
|
79
100
|
keyPrefix: "lim_live_",
|
|
80
|
-
|
|
101
|
+
agentLabel: "Your real customers",
|
|
102
|
+
description: "Use live in production. Live checks count toward your plan."
|
|
81
103
|
}
|
|
82
104
|
],
|
|
83
105
|
environmentsDocs: "/docs/test-and-live/",
|
|
@@ -86,7 +108,10 @@ var brand_default = {
|
|
|
86
108
|
providerOrder: ["github", "google"],
|
|
87
109
|
emailSignUp: "button"
|
|
88
110
|
},
|
|
89
|
-
devPortOffset: 100
|
|
111
|
+
devPortOffset: 100,
|
|
112
|
+
social: {
|
|
113
|
+
background: "#F6F8FB"
|
|
114
|
+
}
|
|
90
115
|
};
|
|
91
116
|
|
|
92
117
|
// src/brand/index.ts
|
|
@@ -163,11 +188,11 @@ function resolveProductFeatures(features) {
|
|
|
163
188
|
guests: teams && on("guests"),
|
|
164
189
|
/** The public `/v1` API: its router, the OpenAPI spec and reference, SDK and CLI publishing. */
|
|
165
190
|
publicApi,
|
|
166
|
-
/** Workspace API keys: Settings →
|
|
191
|
+
/** Workspace API keys: Settings → Developers, `/internal/workspace/api-keys`, `sk_` authentication on `/v1`. */
|
|
167
192
|
apiKeys: publicApi && on("apiKeys"),
|
|
168
193
|
/** Personal access tokens: Account → API tokens, `/internal/account/pats`, `/v1/user/*`, `pat_` authentication, the CLI's sign-in. */
|
|
169
194
|
personalTokens: publicApi && on("personalTokens"),
|
|
170
|
-
/** Outgoing webhooks: Settings →
|
|
195
|
+
/** Outgoing webhooks: Settings → Developers, `/internal/workspace/webhooks`, the admin tab, queued deliveries. */
|
|
171
196
|
webhooks: on("webhooks"),
|
|
172
197
|
/** Billing: Settings → Billing, the Stripe plugin, the admin Billing surfaces, the site's pricing page; a free product. */
|
|
173
198
|
billing: on("billing"),
|
|
@@ -185,7 +210,8 @@ function resolveProductEnvironments(environments, defaultEnvironment, docs) {
|
|
|
185
210
|
name: env.name,
|
|
186
211
|
keyPrefix: env.keyPrefix,
|
|
187
212
|
readOnlyWorkspace: env.readOnlyWorkspace ?? false,
|
|
188
|
-
description: env.description ?? ""
|
|
213
|
+
description: env.description ?? "",
|
|
214
|
+
agentLabel: env.agentLabel ?? env.description ?? ""
|
|
189
215
|
}));
|
|
190
216
|
const names = new Set(list.map((env) => env.name));
|
|
191
217
|
const prefixes = new Set(list.map((env) => env.keyPrefix));
|
|
@@ -735,7 +761,7 @@ __export(product_exports, {
|
|
|
735
761
|
Unavailable: () => Unavailable,
|
|
736
762
|
createLimits: () => createLimits,
|
|
737
763
|
productMethods: () => productMethods,
|
|
738
|
-
productRetry: () =>
|
|
764
|
+
productRetry: () => productRetry2
|
|
739
765
|
});
|
|
740
766
|
|
|
741
767
|
// node_modules/@limitry/sdk/dist/retry.js
|
|
@@ -745,7 +771,7 @@ var DEFAULT_MAX_RETRIES = 2;
|
|
|
745
771
|
var MAX_WAIT_MS = 2e4;
|
|
746
772
|
var MAX_BASE_KEY = 200;
|
|
747
773
|
var PRODUCT_RETRY_HEADER = "x-sdk-product-retry";
|
|
748
|
-
var
|
|
774
|
+
var productRetry = () => "productRetry" in product_exports ? Reflect.get(product_exports, "productRetry") ?? null : null;
|
|
749
775
|
var wait = (ms) => new Promise((done) => setTimeout(done, ms));
|
|
750
776
|
function backoff(attempt) {
|
|
751
777
|
const base = Math.min(500 * 2 ** attempt, 8e3);
|
|
@@ -787,7 +813,7 @@ function withoutProductRetryHeader(fetch2) {
|
|
|
787
813
|
function withRetries(fetch2, options = {}) {
|
|
788
814
|
const maxRetries = options.maxRetries ?? DEFAULT_MAX_RETRIES;
|
|
789
815
|
const sleep = options.sleep ?? wait;
|
|
790
|
-
const later = options.product === void 0 ?
|
|
816
|
+
const later = options.product === void 0 ? productRetry() : options.product;
|
|
791
817
|
return async (request) => {
|
|
792
818
|
let returnLater;
|
|
793
819
|
[request, returnLater] = takeProductRetryHeader(request);
|
|
@@ -1141,8 +1167,8 @@ function createLimits(client, options = {}, internals = {}) {
|
|
|
1141
1167
|
async function reserveOnce(request, fn, body, idempotencyKey, before) {
|
|
1142
1168
|
const reserved = request.cost ?? 1;
|
|
1143
1169
|
const decision = await check(body, idempotencyKey);
|
|
1144
|
-
const
|
|
1145
|
-
// Checked even
|
|
1170
|
+
const uncounted = {
|
|
1171
|
+
// Checked even uncounted: the mistake shows whether or not
|
|
1146
1172
|
// Limitry answered.
|
|
1147
1173
|
cost: (units) => void checkedCost(units),
|
|
1148
1174
|
extend: async () => {
|
|
@@ -1157,7 +1183,7 @@ function createLimits(client, options = {}, internals = {}) {
|
|
|
1157
1183
|
throw new Unavailable();
|
|
1158
1184
|
}
|
|
1159
1185
|
try {
|
|
1160
|
-
return await fn(
|
|
1186
|
+
return await fn(uncounted);
|
|
1161
1187
|
} finally {
|
|
1162
1188
|
await unheard();
|
|
1163
1189
|
}
|
|
@@ -1207,7 +1233,7 @@ var productMethods = (client) => {
|
|
|
1207
1233
|
standing: limits.standing
|
|
1208
1234
|
};
|
|
1209
1235
|
};
|
|
1210
|
-
var
|
|
1236
|
+
var productRetry2 = movingRetry();
|
|
1211
1237
|
|
|
1212
1238
|
// node_modules/@limitry/sdk/dist/resources.js
|
|
1213
1239
|
async function call(client, op, pathParams, input, options = {}, content) {
|
|
@@ -1265,7 +1291,7 @@ function resources(client) {
|
|
|
1265
1291
|
),
|
|
1266
1292
|
list: (
|
|
1267
1293
|
/** List a balance's credits */
|
|
1268
|
-
(limitId, options) => call(client, { "method": "get", "path": "/limits/{limitId}/credits", "query": [], "hasBody": false }, { "limitId": limitId },
|
|
1294
|
+
(limitId, input, options) => call(client, { "method": "get", "path": "/limits/{limitId}/credits", "query": ["limit", "cursor", "before", "subjectId"], "hasBody": false }, { "limitId": limitId }, input, options)
|
|
1269
1295
|
)
|
|
1270
1296
|
},
|
|
1271
1297
|
get: (
|
|
@@ -1365,7 +1391,7 @@ function resources(client) {
|
|
|
1365
1391
|
auditEvents: {
|
|
1366
1392
|
list: (
|
|
1367
1393
|
/** List workspace audit events */
|
|
1368
|
-
(input, options) => call(client, { "method": "get", "path": "/workspace/audit-events", "query": ["limit", "cursor"], "hasBody": false }, {}, input, options)
|
|
1394
|
+
(input, options) => call(client, { "method": "get", "path": "/workspace/audit-events", "query": ["limit", "cursor", "before", "action", "actor"], "hasBody": false }, {}, input, options)
|
|
1369
1395
|
)
|
|
1370
1396
|
},
|
|
1371
1397
|
eventTypes: {
|
|
@@ -1403,7 +1429,7 @@ function resources(client) {
|
|
|
1403
1429
|
webhookDeliveries: {
|
|
1404
1430
|
list: (
|
|
1405
1431
|
/** List an endpoint's deliveries */
|
|
1406
|
-
(endpointId, input, options) => call(client, { "method": "get", "path": "/workspace/webhook-endpoints/{endpointId}/deliveries", "query": ["limit", "cursor"], "hasBody": false }, { "endpointId": endpointId }, input, options)
|
|
1432
|
+
(endpointId, input, options) => call(client, { "method": "get", "path": "/workspace/webhook-endpoints/{endpointId}/deliveries", "query": ["limit", "cursor", "before", "status"], "hasBody": false }, { "endpointId": endpointId }, input, options)
|
|
1407
1433
|
),
|
|
1408
1434
|
redeliver: (
|
|
1409
1435
|
/** Redeliver an event */
|
|
@@ -1515,10 +1541,11 @@ async function verifyWebhook(body, headers, secret, options = {}) {
|
|
|
1515
1541
|
|
|
1516
1542
|
// node_modules/@limitry/sdk/dist/index.js
|
|
1517
1543
|
var API_KEY_ENV = `${brand2.identifier.toUpperCase()}_API_KEY`;
|
|
1544
|
+
var TOKEN_ENV = `${brand2.identifier.toUpperCase()}_TOKEN`;
|
|
1518
1545
|
var DEFAULT_API = `https://api.${brand2.domain}`;
|
|
1519
1546
|
function createClient2(options = {}) {
|
|
1520
1547
|
const client = createBaseClient(options);
|
|
1521
|
-
const extend = productMethods;
|
|
1548
|
+
const extend = Reflect.get(product_exports, "productMethods");
|
|
1522
1549
|
if (!extend)
|
|
1523
1550
|
return client;
|
|
1524
1551
|
const methods = extend(client);
|
|
@@ -1530,9 +1557,12 @@ function createClient2(options = {}) {
|
|
|
1530
1557
|
return Object.assign(client, methods);
|
|
1531
1558
|
}
|
|
1532
1559
|
function createBaseClient(options) {
|
|
1533
|
-
|
|
1560
|
+
if (options.apiKey && options.token) {
|
|
1561
|
+
throw new Error(`${brand2.productName}: pass apiKey or token, not both.`);
|
|
1562
|
+
}
|
|
1563
|
+
const token = options.apiKey || options.token || credentialFromEnvironment();
|
|
1534
1564
|
if (!token) {
|
|
1535
|
-
throw new Error(`${brand2.productName}: no API key. Pass {
|
|
1565
|
+
throw new Error(`${brand2.productName}: no API key. Pass { apiKey } or set ${API_KEY_ENV}.`);
|
|
1536
1566
|
}
|
|
1537
1567
|
const origin = withoutTrailingSlashes(options.api ?? DEFAULT_API);
|
|
1538
1568
|
const send = options.fetch ?? ((request) => fetch(request));
|
|
@@ -1556,9 +1586,10 @@ function createBaseClient(options) {
|
|
|
1556
1586
|
webhooks: { verify: verifyWebhook }
|
|
1557
1587
|
});
|
|
1558
1588
|
}
|
|
1559
|
-
function
|
|
1589
|
+
function credentialFromEnvironment() {
|
|
1560
1590
|
const runtime = globalThis;
|
|
1561
|
-
|
|
1591
|
+
const env = runtime.process?.env;
|
|
1592
|
+
return env?.[API_KEY_ENV] || env?.[TOKEN_ENV] || void 0;
|
|
1562
1593
|
}
|
|
1563
1594
|
function unwrap(result) {
|
|
1564
1595
|
if (result.error !== void 0 || !result.response.ok) {
|
|
@@ -5013,14 +5044,14 @@ function browserLogin(options) {
|
|
|
5013
5044
|
send(
|
|
5014
5045
|
200,
|
|
5015
5046
|
"You are signed in",
|
|
5016
|
-
"Return to your terminal
|
|
5047
|
+
"Return to your terminal. You can close this tab."
|
|
5017
5048
|
);
|
|
5018
5049
|
finish(() => resolve2(token));
|
|
5019
5050
|
});
|
|
5020
5051
|
const timer = setTimeout(
|
|
5021
5052
|
() => finish(
|
|
5022
5053
|
() => reject(
|
|
5023
|
-
new Error("timed out waiting for the browser
|
|
5054
|
+
new Error("timed out waiting for the browser. Run login again.")
|
|
5024
5055
|
)
|
|
5025
5056
|
),
|
|
5026
5057
|
options.timeoutMs ?? 5 * 60 * 1e3
|
|
@@ -5074,7 +5105,7 @@ function readConfig(homeDir) {
|
|
|
5074
5105
|
try {
|
|
5075
5106
|
return JSON.parse(readFileSync(path2, "utf8"));
|
|
5076
5107
|
} catch {
|
|
5077
|
-
throw new Error(`${path2} is not valid JSON
|
|
5108
|
+
throw new Error(`${path2} is not valid JSON. Fix or delete it.`);
|
|
5078
5109
|
}
|
|
5079
5110
|
}
|
|
5080
5111
|
function writeConfig(homeDir, config2) {
|
|
@@ -5153,7 +5184,9 @@ function writeEnvVar(path2, name, value) {
|
|
|
5153
5184
|
}
|
|
5154
5185
|
var approvals = (program2, ctx) => {
|
|
5155
5186
|
const workspace2 = program2.commands.find((c) => c.name() === "workspace") ?? program2.command("workspace");
|
|
5156
|
-
const group = workspace2.command("approval-requests").description(
|
|
5187
|
+
const group = workspace2.command("approval-requests").description(
|
|
5188
|
+
"Ask a person to approve an action, and collect what it creates"
|
|
5189
|
+
);
|
|
5157
5190
|
group.command("redeem <request-id>").description(
|
|
5158
5191
|
"Collect an approved secret once, into an env file (never printed)"
|
|
5159
5192
|
).requiredOption(
|
|
@@ -5184,7 +5217,7 @@ var approvals = (program2, ctx) => {
|
|
|
5184
5217
|
}
|
|
5185
5218
|
if (request.status !== "approved") {
|
|
5186
5219
|
throw new Error(
|
|
5187
|
-
request.status === "pending" ? `Not approved yet
|
|
5220
|
+
request.status === "pending" ? `Not approved yet. Ask a person to approve it: ${request.approveUrl}` : `This request is ${request.status}; nothing to collect.`
|
|
5188
5221
|
);
|
|
5189
5222
|
}
|
|
5190
5223
|
const redeemed = await call3(
|
|
@@ -5226,7 +5259,7 @@ async function saveToken(ctx, token, api2) {
|
|
|
5226
5259
|
writeConfig(ctx.io.homeDir, previous);
|
|
5227
5260
|
const reason = error instanceof Error ? error.message : String(error);
|
|
5228
5261
|
throw new Error(
|
|
5229
|
-
`could not verify the token (${reason})
|
|
5262
|
+
`could not verify the token (${reason}). Nothing was saved.`,
|
|
5230
5263
|
{ cause: error }
|
|
5231
5264
|
);
|
|
5232
5265
|
}
|
|
@@ -5234,7 +5267,7 @@ async function saveToken(ctx, token, api2) {
|
|
|
5234
5267
|
`Logged in. Token stored in ${configPath(ctx.io.homeDir)} (0600).`
|
|
5235
5268
|
);
|
|
5236
5269
|
ctx.io.stdout(
|
|
5237
|
-
`Hello ${user.name} <${user.email}
|
|
5270
|
+
`Hello ${user.name} <${user.email}>. You have ${user.workspaces.length} workspace(s).`
|
|
5238
5271
|
);
|
|
5239
5272
|
if (!config2.workspace && user.workspaces.length === 1) {
|
|
5240
5273
|
config2.workspace = user.workspaces[0].slug;
|
|
@@ -5246,7 +5279,7 @@ async function saveToken(ctx, token, api2) {
|
|
|
5246
5279
|
}
|
|
5247
5280
|
var login = (program2, ctx) => {
|
|
5248
5281
|
program2.command("login").description(
|
|
5249
|
-
"Sign in through the browser
|
|
5282
|
+
"Sign in through the browser, or store a personal access token with --token"
|
|
5250
5283
|
).option("--token <pat>", "a personal access token (CI, servers)").option("--api <origin>", `API origin (default ${DEFAULT_API})`).option("--web <origin>", "web app origin for the browser sign-in").action(async (options) => {
|
|
5251
5284
|
if (!productFeatures.personalTokens) {
|
|
5252
5285
|
throw new Error(
|
|
@@ -5268,7 +5301,7 @@ var login = (program2, ctx) => {
|
|
|
5268
5301
|
const webOrigin = options.web ?? webOriginFor(api2);
|
|
5269
5302
|
if (!webOrigin) {
|
|
5270
5303
|
throw new Error(
|
|
5271
|
-
`cannot tell the web app's address from ${api2}
|
|
5304
|
+
`cannot tell the web app's address from ${api2}. Pass --web <origin>.`
|
|
5272
5305
|
);
|
|
5273
5306
|
}
|
|
5274
5307
|
const token = await browserLogin({
|
|
@@ -5295,13 +5328,13 @@ var logout = (program2, ctx) => {
|
|
|
5295
5328
|
).catch(() => null);
|
|
5296
5329
|
if (revoked && !revoked.ok && revoked.status !== 401) {
|
|
5297
5330
|
ctx.io.stderr(
|
|
5298
|
-
`Could not revoke the token (HTTP ${revoked.status})
|
|
5331
|
+
`Could not revoke the token (HTTP ${revoked.status}). Revoke it under Account \u2192 Personal access tokens.`
|
|
5299
5332
|
);
|
|
5300
5333
|
}
|
|
5301
5334
|
}
|
|
5302
5335
|
delete config2.token;
|
|
5303
5336
|
writeConfig(ctx.io.homeDir, config2);
|
|
5304
|
-
ctx.io.stdout("Logged out
|
|
5337
|
+
ctx.io.stdout("Logged out. The token is revoked and forgotten.");
|
|
5305
5338
|
});
|
|
5306
5339
|
};
|
|
5307
5340
|
async function printWorkspaces(ctx, asJson) {
|
|
@@ -5324,13 +5357,13 @@ async function printWorkspaces(ctx, asJson) {
|
|
|
5324
5357
|
);
|
|
5325
5358
|
}
|
|
5326
5359
|
var whoami = (program2, ctx) => {
|
|
5327
|
-
program2.command("whoami").description("
|
|
5360
|
+
program2.command("whoami").description("Show who the token acts as and which workspaces it can use").option("--json", "machine-readable output").action(
|
|
5328
5361
|
(options) => printWorkspaces(ctx, options.json === true)
|
|
5329
5362
|
);
|
|
5330
5363
|
};
|
|
5331
5364
|
var workspace = (program2, ctx) => {
|
|
5332
5365
|
const group = program2.command("workspace").description(
|
|
5333
|
-
"
|
|
5366
|
+
"Work with your workspaces and the current one's members, webhooks, approvals and usage"
|
|
5334
5367
|
);
|
|
5335
5368
|
group.command("list", { isDefault: true }).description("List the workspaces the token can act in").option("--json", "machine-readable output").action(
|
|
5336
5369
|
(options) => printWorkspaces(ctx, options.json === true)
|
|
@@ -5347,7 +5380,7 @@ var workspace = (program2, ctx) => {
|
|
|
5347
5380
|
});
|
|
5348
5381
|
};
|
|
5349
5382
|
var environment = (program2, ctx) => {
|
|
5350
|
-
const group = program2.command("environment").description("
|
|
5383
|
+
const group = program2.command("environment").description("Choose the environment commands act in");
|
|
5351
5384
|
group.command("list", { isDefault: true }).description("Show the environment commands act in").action(() => {
|
|
5352
5385
|
const { environment: current, environmentSource } = ctx.settings();
|
|
5353
5386
|
const from = environmentSource ? `(from ${{ flag: "--environment", env: environmentEnvVar(), config: "config" }[environmentSource]})` : null;
|
|
@@ -5361,14 +5394,14 @@ var environment = (program2, ctx) => {
|
|
|
5361
5394
|
return;
|
|
5362
5395
|
}
|
|
5363
5396
|
ctx.io.stdout(
|
|
5364
|
-
current ? `${current} ${from}` : "None set
|
|
5397
|
+
current ? `${current} ${from}` : "None set. The API acts in the workspace's default."
|
|
5365
5398
|
);
|
|
5366
5399
|
});
|
|
5367
5400
|
group.command("use <name>").description("Make <name> the default environment for commands").action((name) => {
|
|
5368
5401
|
const declared = productEnvironments.list.map((env) => env.name);
|
|
5369
5402
|
if (declared.length > 0 && !declared.includes(name)) {
|
|
5370
5403
|
throw new Error(
|
|
5371
|
-
`unknown environment '${name}'
|
|
5404
|
+
`unknown environment '${name}'. ${brand.productName}'s environments are ${declared.join(", ")}.`
|
|
5372
5405
|
);
|
|
5373
5406
|
}
|
|
5374
5407
|
const config2 = readConfig(ctx.io.homeDir);
|
|
@@ -5377,7 +5410,7 @@ var environment = (program2, ctx) => {
|
|
|
5377
5410
|
ctx.io.stdout(`Default environment: ${name}`);
|
|
5378
5411
|
});
|
|
5379
5412
|
group.command("unset").description(
|
|
5380
|
-
"Forget the default environment
|
|
5413
|
+
"Forget the default environment and go back to the product's default"
|
|
5381
5414
|
).action(() => {
|
|
5382
5415
|
const config2 = readConfig(ctx.io.homeDir);
|
|
5383
5416
|
delete config2.environment;
|
|
@@ -5386,7 +5419,7 @@ var environment = (program2, ctx) => {
|
|
|
5386
5419
|
});
|
|
5387
5420
|
};
|
|
5388
5421
|
var api = (program2, ctx) => {
|
|
5389
|
-
program2.command("api <method> <path>").description("Call any endpoint
|
|
5422
|
+
program2.command("api <method> <path>").description("Call any API endpoint directly, in the selected workspace").option("--data <json>", "JSON request body").option("--workspace <slug>", "act in this workspace for one call").action(
|
|
5390
5423
|
async (method, path2, options) => {
|
|
5391
5424
|
if (!path2.startsWith("/")) {
|
|
5392
5425
|
throw new Error("usage: api <method> </v1/...> [--data '<json>']");
|
|
@@ -5406,7 +5439,7 @@ var api = (program2, ctx) => {
|
|
|
5406
5439
|
);
|
|
5407
5440
|
};
|
|
5408
5441
|
var config = (program2, ctx) => {
|
|
5409
|
-
program2.command("config").description("Show the
|
|
5442
|
+
program2.command("config").description("Show the settings in effect, with the token hidden").action(() => {
|
|
5410
5443
|
const settings = ctx.settings();
|
|
5411
5444
|
ctx.io.stdout(
|
|
5412
5445
|
json({
|
|
@@ -5487,14 +5520,14 @@ var OPERATIONS = [
|
|
|
5487
5520
|
"idempotentHint": false
|
|
5488
5521
|
}
|
|
5489
5522
|
},
|
|
5490
|
-
"description": "Asks whether `subject` may do `action` at `cost`, given every enabled limit that applies
|
|
5523
|
+
"description": "Asks whether `subject` may do `action` at `cost`, given every enabled limit that applies. In `consume` mode, it also counts the use. Every decision returns 200, whether it's allowed or refused, so read `allowed`. `limits` shows what's left on each limit, and `retryAfterSeconds` says when to try again. With an `Idempotency-Key` header, a retried check gets the same decision for an hour and counts only once. We cache its API key check briefly for speed. A revoked key can keep working here for up to 60 seconds.",
|
|
5491
5524
|
"fields": [
|
|
5492
5525
|
{
|
|
5493
5526
|
"name": "subject",
|
|
5494
5527
|
"in": "body",
|
|
5495
5528
|
"type": "json",
|
|
5496
5529
|
"required": true,
|
|
5497
|
-
"description": 'Who is acting, as `{"kind": "user", "id": "usr_123"}`.',
|
|
5530
|
+
"description": 'Who is acting, such as `{"kind": "user", "id": "usr_123"}`.',
|
|
5498
5531
|
"example": {
|
|
5499
5532
|
"kind": "user",
|
|
5500
5533
|
"id": "usr_123"
|
|
@@ -5506,20 +5539,20 @@ var OPERATIONS = [
|
|
|
5506
5539
|
"type": "string",
|
|
5507
5540
|
"minLength": 1,
|
|
5508
5541
|
"maxLength": 100,
|
|
5509
|
-
"description": "Your own label for who is acting
|
|
5542
|
+
"description": "Your own label for who is acting, such as user, apikey or agent."
|
|
5510
5543
|
},
|
|
5511
5544
|
"id": {
|
|
5512
5545
|
"type": "string",
|
|
5513
5546
|
"minLength": 1,
|
|
5514
5547
|
"maxLength": 200,
|
|
5515
|
-
"description": "
|
|
5548
|
+
"description": "The subject's ID in your product."
|
|
5516
5549
|
}
|
|
5517
5550
|
},
|
|
5518
5551
|
"required": [
|
|
5519
5552
|
"kind",
|
|
5520
5553
|
"id"
|
|
5521
5554
|
],
|
|
5522
|
-
"description": 'Who is acting, as `{"kind": "user", "id": "usr_123"}`.'
|
|
5555
|
+
"description": 'Who is acting, such as `{"kind": "user", "id": "usr_123"}`.'
|
|
5523
5556
|
}
|
|
5524
5557
|
},
|
|
5525
5558
|
{
|
|
@@ -5527,13 +5560,7 @@ var OPERATIONS = [
|
|
|
5527
5560
|
"in": "body",
|
|
5528
5561
|
"type": "json",
|
|
5529
5562
|
"required": false,
|
|
5530
|
-
"description": "Shared subjects
|
|
5531
|
-
"example": [
|
|
5532
|
-
{
|
|
5533
|
-
"kind": "team",
|
|
5534
|
-
"id": "team_42"
|
|
5535
|
-
}
|
|
5536
|
-
],
|
|
5563
|
+
"description": "Shared subjects the check also draws from, such as a team's, an organization's or a project's pool. Send at most 4. Every limit on every subject must fit, and Limitry charges either all of them or none.",
|
|
5537
5564
|
"schema": {
|
|
5538
5565
|
"type": "array",
|
|
5539
5566
|
"items": {
|
|
@@ -5556,7 +5583,7 @@ var OPERATIONS = [
|
|
|
5556
5583
|
]
|
|
5557
5584
|
},
|
|
5558
5585
|
"maxItems": 4,
|
|
5559
|
-
"description": "Shared subjects
|
|
5586
|
+
"description": "Shared subjects the check also draws from, such as a team's, an organization's or a project's pool. Send at most 4. Every limit on every subject must fit, and Limitry charges either all of them or none."
|
|
5560
5587
|
}
|
|
5561
5588
|
},
|
|
5562
5589
|
{
|
|
@@ -5578,13 +5605,13 @@ var OPERATIONS = [
|
|
|
5578
5605
|
"in": "body",
|
|
5579
5606
|
"type": "number",
|
|
5580
5607
|
"required": false,
|
|
5581
|
-
"description": "
|
|
5608
|
+
"description": "The units the action would use. Default: 1.",
|
|
5582
5609
|
"example": 5,
|
|
5583
5610
|
"schema": {
|
|
5584
5611
|
"type": "integer",
|
|
5585
5612
|
"minimum": 1,
|
|
5586
5613
|
"maximum": 1e9,
|
|
5587
|
-
"description": "
|
|
5614
|
+
"description": "The units the action would use. Default: 1."
|
|
5588
5615
|
}
|
|
5589
5616
|
},
|
|
5590
5617
|
{
|
|
@@ -5592,8 +5619,7 @@ var OPERATIONS = [
|
|
|
5592
5619
|
"in": "body",
|
|
5593
5620
|
"type": "string",
|
|
5594
5621
|
"required": false,
|
|
5595
|
-
"description": "`consume`
|
|
5596
|
-
"example": "consume",
|
|
5622
|
+
"description": "How the check counts. `consume` decides and counts, and is the default. `preview` decides without counting anything. `reserve` decides and holds `cost`, your estimate, until you commit the actual amount or release it. The response's `reservation` names what it holds. Only a reservation takes a slot of a `concurrent` limit.",
|
|
5597
5623
|
"schema": {
|
|
5598
5624
|
"type": "string",
|
|
5599
5625
|
"enum": [
|
|
@@ -5601,7 +5627,7 @@ var OPERATIONS = [
|
|
|
5601
5627
|
"preview",
|
|
5602
5628
|
"reserve"
|
|
5603
5629
|
],
|
|
5604
|
-
"description": "`consume`
|
|
5630
|
+
"description": "How the check counts. `consume` decides and counts, and is the default. `preview` decides without counting anything. `reserve` decides and holds `cost`, your estimate, until you commit the actual amount or release it. The response's `reservation` names what it holds. Only a reservation takes a slot of a `concurrent` limit."
|
|
5605
5631
|
}
|
|
5606
5632
|
},
|
|
5607
5633
|
{
|
|
@@ -5609,18 +5635,18 @@ var OPERATIONS = [
|
|
|
5609
5635
|
"in": "body",
|
|
5610
5636
|
"type": "number",
|
|
5611
5637
|
"required": false,
|
|
5612
|
-
"description": "With `reserve
|
|
5613
|
-
"example": 300,
|
|
5638
|
+
"description": "With `reserve`, how many seconds the reservation lasts before it releases itself. Default: 300. At most 3600.",
|
|
5614
5639
|
"schema": {
|
|
5615
5640
|
"type": "integer",
|
|
5616
5641
|
"minimum": 1,
|
|
5617
5642
|
"maximum": 3600,
|
|
5618
|
-
"description": "With `reserve
|
|
5643
|
+
"description": "With `reserve`, how many seconds the reservation lasts before it releases itself. Default: 300. At most 3600."
|
|
5619
5644
|
}
|
|
5620
5645
|
}
|
|
5621
5646
|
],
|
|
5622
5647
|
"hasBody": true,
|
|
5623
5648
|
"workspace": true,
|
|
5649
|
+
"acceptsApiKey": true,
|
|
5624
5650
|
"scope": "checks:write"
|
|
5625
5651
|
},
|
|
5626
5652
|
{
|
|
@@ -5644,21 +5670,24 @@ var OPERATIONS = [
|
|
|
5644
5670
|
"idempotentHint": false
|
|
5645
5671
|
}
|
|
5646
5672
|
},
|
|
5647
|
-
"description": "
|
|
5673
|
+
"description": "Archives a limit, so checks stop enforcing it at once and it leaves the list. Archiving erases nothing. Limitry keeps the limit's usage history and credits, and `POST /v1/limits/{limitId}/restore` brings it back. With a personal access token, only owners and admins can call this. A workspace API key with this scope can.",
|
|
5648
5674
|
"fields": [
|
|
5649
5675
|
{
|
|
5650
5676
|
"name": "limitId",
|
|
5651
5677
|
"in": "path",
|
|
5652
5678
|
"type": "string",
|
|
5653
5679
|
"required": true,
|
|
5654
|
-
"
|
|
5680
|
+
"description": "The limit's ID.",
|
|
5681
|
+
"example": "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34",
|
|
5655
5682
|
"schema": {
|
|
5656
|
-
"type": "string"
|
|
5683
|
+
"type": "string",
|
|
5684
|
+
"description": "The limit's ID."
|
|
5657
5685
|
}
|
|
5658
5686
|
}
|
|
5659
5687
|
],
|
|
5660
5688
|
"hasBody": false,
|
|
5661
5689
|
"workspace": true,
|
|
5690
|
+
"acceptsApiKey": true,
|
|
5662
5691
|
"scope": "limits:write"
|
|
5663
5692
|
},
|
|
5664
5693
|
{
|
|
@@ -5680,20 +5709,20 @@ var OPERATIONS = [
|
|
|
5680
5709
|
"idempotentHint": false
|
|
5681
5710
|
}
|
|
5682
5711
|
},
|
|
5683
|
-
"description": "
|
|
5712
|
+
"description": "Creates a limit on how much a subject may use per window, such as 200 cents a month for every `user`. You only need to send `subject.kind`, `amount` and `window`. `action` defaults to every action (`*`), `unit` to units, and `name` to the sentence the limit reads as. The next check enforces the new limit. You can't change a limit's subject, action, unit, window, every, start or rolling after you create it. With a personal access token, only owners and admins can call this. A workspace API key with this scope can.",
|
|
5684
5713
|
"fields": [
|
|
5685
5714
|
{
|
|
5686
5715
|
"name": "name",
|
|
5687
5716
|
"in": "body",
|
|
5688
5717
|
"type": "string",
|
|
5689
5718
|
"required": false,
|
|
5690
|
-
"description": `
|
|
5719
|
+
"description": `The limit's name, unique among the environment's active limits. By default, it's the sentence the limit reads as, such as "200 cents per user per month". If another limit already has that name, you get a 409, so send a name of your own.`,
|
|
5691
5720
|
"example": "AI budget",
|
|
5692
5721
|
"schema": {
|
|
5693
5722
|
"type": "string",
|
|
5694
5723
|
"minLength": 1,
|
|
5695
5724
|
"maxLength": 100,
|
|
5696
|
-
"description": `
|
|
5725
|
+
"description": `The limit's name, unique among the environment's active limits. By default, it's the sentence the limit reads as, such as "200 cents per user per month". If another limit already has that name, you get a 409, so send a name of your own.`
|
|
5697
5726
|
}
|
|
5698
5727
|
},
|
|
5699
5728
|
{
|
|
@@ -5701,7 +5730,7 @@ var OPERATIONS = [
|
|
|
5701
5730
|
"in": "body",
|
|
5702
5731
|
"type": "json",
|
|
5703
5732
|
"required": true,
|
|
5704
|
-
"description": 'Who
|
|
5733
|
+
"description": 'Who the limit applies to. `{"kind": "user"}` covers every user, and `{"kind": "user", "id": "usr_123"}` covers one.',
|
|
5705
5734
|
"example": {
|
|
5706
5735
|
"kind": "user"
|
|
5707
5736
|
},
|
|
@@ -5712,7 +5741,7 @@ var OPERATIONS = [
|
|
|
5712
5741
|
"type": "string",
|
|
5713
5742
|
"minLength": 1,
|
|
5714
5743
|
"maxLength": 100,
|
|
5715
|
-
"description": "Your own label for who
|
|
5744
|
+
"description": "Your own label for who the limit applies to, such as user, team or apikey."
|
|
5716
5745
|
},
|
|
5717
5746
|
"id": {
|
|
5718
5747
|
"type": [
|
|
@@ -5721,13 +5750,13 @@ var OPERATIONS = [
|
|
|
5721
5750
|
],
|
|
5722
5751
|
"minLength": 1,
|
|
5723
5752
|
"maxLength": 100,
|
|
5724
|
-
"description": "One subject
|
|
5753
|
+
"description": "One subject's ID. Leave it out, or send null, to cover every subject of the kind. A limit for one subject replaces the kind's limits that have the same action and window."
|
|
5725
5754
|
}
|
|
5726
5755
|
},
|
|
5727
5756
|
"required": [
|
|
5728
5757
|
"kind"
|
|
5729
5758
|
],
|
|
5730
|
-
"description": 'Who
|
|
5759
|
+
"description": 'Who the limit applies to. `{"kind": "user"}` covers every user, and `{"kind": "user", "id": "usr_123"}` covers one.'
|
|
5731
5760
|
}
|
|
5732
5761
|
},
|
|
5733
5762
|
{
|
|
@@ -5777,7 +5806,7 @@ var OPERATIONS = [
|
|
|
5777
5806
|
"in": "body",
|
|
5778
5807
|
"type": "string",
|
|
5779
5808
|
"required": true,
|
|
5780
|
-
"description": "`minute`, `hour`, `day`, `week`, `month`
|
|
5809
|
+
"description": "The kind of period. `minute`, `hour`, `day`, `week`, `month` and `year` count a period of `every` windows, which resets where `start` says, or rolls when `rolling` is true. `total` is a balance that never resets, and credits raise it. `concurrent` allows at most `amount` open reservations at once.",
|
|
5781
5810
|
"example": "month",
|
|
5782
5811
|
"schema": {
|
|
5783
5812
|
"type": "string",
|
|
@@ -5791,7 +5820,7 @@ var OPERATIONS = [
|
|
|
5791
5820
|
"total",
|
|
5792
5821
|
"concurrent"
|
|
5793
5822
|
],
|
|
5794
|
-
"description": "`minute`, `hour`, `day`, `week`, `month`
|
|
5823
|
+
"description": "The kind of period. `minute`, `hour`, `day`, `week`, `month` and `year` count a period of `every` windows, which resets where `start` says, or rolls when `rolling` is true. `total` is a balance that never resets, and credits raise it. `concurrent` allows at most `amount` open reservations at once."
|
|
5795
5824
|
}
|
|
5796
5825
|
},
|
|
5797
5826
|
{
|
|
@@ -5799,13 +5828,13 @@ var OPERATIONS = [
|
|
|
5799
5828
|
"in": "body",
|
|
5800
5829
|
"type": "number",
|
|
5801
5830
|
"required": false,
|
|
5802
|
-
"description": 'How many `window` units
|
|
5831
|
+
"description": 'How many `window` units one period lasts. For example, `window: "month", every: 3` is a quarter, and `window: "hour", every: 5` is five hours. Default: 1.',
|
|
5803
5832
|
"example": 1,
|
|
5804
5833
|
"schema": {
|
|
5805
5834
|
"type": "integer",
|
|
5806
5835
|
"minimum": 1,
|
|
5807
5836
|
"maximum": 1e3,
|
|
5808
|
-
"description": 'How many `window` units
|
|
5837
|
+
"description": 'How many `window` units one period lasts. For example, `window: "month", every: 3` is a quarter, and `window: "hour", every: 5` is five hours. Default: 1.'
|
|
5809
5838
|
}
|
|
5810
5839
|
},
|
|
5811
5840
|
{
|
|
@@ -5813,7 +5842,7 @@ var OPERATIONS = [
|
|
|
5813
5842
|
"in": "body",
|
|
5814
5843
|
"type": "string",
|
|
5815
5844
|
"required": false,
|
|
5816
|
-
"description": "Where
|
|
5845
|
+
"description": "Where each period begins. `calendar` uses UTC boundaries: midnight, Monday, the 1st or 1 January. `billing_date` counts from the subject's billing date. You set it with `subjects.update`. An annual plan can then still reset monthly. Until a subject has a billing date, its first check stands in for it. `first_use` starts a period at the first check after the previous one ended. Default: calendar.",
|
|
5817
5846
|
"example": "calendar",
|
|
5818
5847
|
"schema": {
|
|
5819
5848
|
"type": "string",
|
|
@@ -5822,7 +5851,7 @@ var OPERATIONS = [
|
|
|
5822
5851
|
"billing_date",
|
|
5823
5852
|
"first_use"
|
|
5824
5853
|
],
|
|
5825
|
-
"description": "Where
|
|
5854
|
+
"description": "Where each period begins. `calendar` uses UTC boundaries: midnight, Monday, the 1st or 1 January. `billing_date` counts from the subject's billing date. You set it with `subjects.update`. An annual plan can then still reset monthly. Until a subject has a billing date, its first check stands in for it. `first_use` starts a period at the first check after the previous one ended. Default: calendar."
|
|
5826
5855
|
}
|
|
5827
5856
|
},
|
|
5828
5857
|
{
|
|
@@ -5830,10 +5859,10 @@ var OPERATIONS = [
|
|
|
5830
5859
|
"in": "body",
|
|
5831
5860
|
"type": "boolean",
|
|
5832
5861
|
"required": false,
|
|
5833
|
-
"description": "
|
|
5862
|
+
"description": "Whether to count the last `every` windows up to the moment of each check, rather than fixed periods. Only `minute`, `hour` and `day` limits can roll. Default: false.",
|
|
5834
5863
|
"schema": {
|
|
5835
5864
|
"type": "boolean",
|
|
5836
|
-
"description": "
|
|
5865
|
+
"description": "Whether to count the last `every` windows up to the moment of each check, rather than fixed periods. Only `minute`, `hour` and `day` limits can roll. Default: false."
|
|
5837
5866
|
}
|
|
5838
5867
|
},
|
|
5839
5868
|
{
|
|
@@ -5841,10 +5870,10 @@ var OPERATIONS = [
|
|
|
5841
5870
|
"in": "body",
|
|
5842
5871
|
"type": "boolean",
|
|
5843
5872
|
"required": false,
|
|
5844
|
-
"description": "Whether checks enforce
|
|
5873
|
+
"description": "Whether checks enforce the limit. Default: true.",
|
|
5845
5874
|
"schema": {
|
|
5846
5875
|
"type": "boolean",
|
|
5847
|
-
"description": "Whether checks enforce
|
|
5876
|
+
"description": "Whether checks enforce the limit. Default: true."
|
|
5848
5877
|
}
|
|
5849
5878
|
},
|
|
5850
5879
|
{
|
|
@@ -5852,19 +5881,20 @@ var OPERATIONS = [
|
|
|
5852
5881
|
"in": "body",
|
|
5853
5882
|
"type": "string",
|
|
5854
5883
|
"required": false,
|
|
5855
|
-
"description": "What your code should do when
|
|
5884
|
+
"description": "What your code should do when it can't reach Limitry. `open` allows and `closed` refuses. Default: open.",
|
|
5856
5885
|
"schema": {
|
|
5857
5886
|
"type": "string",
|
|
5858
5887
|
"enum": [
|
|
5859
5888
|
"open",
|
|
5860
5889
|
"closed"
|
|
5861
5890
|
],
|
|
5862
|
-
"description": "What your code should do when
|
|
5891
|
+
"description": "What your code should do when it can't reach Limitry. `open` allows and `closed` refuses. Default: open."
|
|
5863
5892
|
}
|
|
5864
5893
|
}
|
|
5865
5894
|
],
|
|
5866
5895
|
"hasBody": true,
|
|
5867
5896
|
"workspace": true,
|
|
5897
|
+
"acceptsApiKey": true,
|
|
5868
5898
|
"scope": "limits:write"
|
|
5869
5899
|
},
|
|
5870
5900
|
{
|
|
@@ -5883,16 +5913,18 @@ var OPERATIONS = [
|
|
|
5883
5913
|
"exposed": false,
|
|
5884
5914
|
"reason": "Adding credits gives value away; an agent asks a person (limit.credit approval)"
|
|
5885
5915
|
},
|
|
5886
|
-
"description": "Adds `amount` credits to one subject's balance
|
|
5916
|
+
"description": "Adds `amount` credits to one subject's balance, on a limit whose window is `total`. A negative `amount` takes credits back, such as after a refund or a chargeback, and needs a `note` saying why. The balance can go below zero, and Limitry then refuses checks until you add more credits. Owners, admins and workspace API keys can add credits. An agent asks a person instead, through the `limit.credit` approval. Limitry keeps a credit's `Idempotency-Key` forever, so never reuse one for a new credit.",
|
|
5887
5917
|
"fields": [
|
|
5888
5918
|
{
|
|
5889
5919
|
"name": "limitId",
|
|
5890
5920
|
"in": "path",
|
|
5891
5921
|
"type": "string",
|
|
5892
5922
|
"required": true,
|
|
5893
|
-
"
|
|
5923
|
+
"description": "The limit's ID.",
|
|
5924
|
+
"example": "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34",
|
|
5894
5925
|
"schema": {
|
|
5895
|
-
"type": "string"
|
|
5926
|
+
"type": "string",
|
|
5927
|
+
"description": "The limit's ID."
|
|
5896
5928
|
}
|
|
5897
5929
|
},
|
|
5898
5930
|
{
|
|
@@ -5900,7 +5932,7 @@ var OPERATIONS = [
|
|
|
5900
5932
|
"in": "body",
|
|
5901
5933
|
"type": "json",
|
|
5902
5934
|
"required": true,
|
|
5903
|
-
"description": 'Who gets the credits, as `{"kind": "team", "id": "team_42"}`.',
|
|
5935
|
+
"description": 'Who gets the credits, such as `{"kind": "team", "id": "team_42"}`.',
|
|
5904
5936
|
"example": {
|
|
5905
5937
|
"kind": "team",
|
|
5906
5938
|
"id": "team_42"
|
|
@@ -5923,7 +5955,7 @@ var OPERATIONS = [
|
|
|
5923
5955
|
"kind",
|
|
5924
5956
|
"id"
|
|
5925
5957
|
],
|
|
5926
|
-
"description": 'Who gets the credits, as `{"kind": "team", "id": "team_42"}`.'
|
|
5958
|
+
"description": 'Who gets the credits, such as `{"kind": "team", "id": "team_42"}`.'
|
|
5927
5959
|
}
|
|
5928
5960
|
},
|
|
5929
5961
|
{
|
|
@@ -5931,11 +5963,11 @@ var OPERATIONS = [
|
|
|
5931
5963
|
"in": "body",
|
|
5932
5964
|
"type": "number",
|
|
5933
5965
|
"required": true,
|
|
5934
|
-
"description": "
|
|
5966
|
+
"description": "The credits to add, or a negative number to take them back. It can't be 0.",
|
|
5935
5967
|
"example": 5e3,
|
|
5936
5968
|
"schema": {
|
|
5937
5969
|
"type": "integer",
|
|
5938
|
-
"description": "
|
|
5970
|
+
"description": "The credits to add, or a negative number to take them back. It can't be 0."
|
|
5939
5971
|
}
|
|
5940
5972
|
},
|
|
5941
5973
|
{
|
|
@@ -5943,17 +5975,18 @@ var OPERATIONS = [
|
|
|
5943
5975
|
"in": "body",
|
|
5944
5976
|
"type": "string",
|
|
5945
5977
|
"required": false,
|
|
5946
|
-
"description": "
|
|
5978
|
+
"description": "Why the balance changed. It's required when `amount` is negative.",
|
|
5947
5979
|
"example": "October credits",
|
|
5948
5980
|
"schema": {
|
|
5949
5981
|
"type": "string",
|
|
5950
5982
|
"maxLength": 200,
|
|
5951
|
-
"description": "
|
|
5983
|
+
"description": "Why the balance changed. It's required when `amount` is negative."
|
|
5952
5984
|
}
|
|
5953
5985
|
}
|
|
5954
5986
|
],
|
|
5955
5987
|
"hasBody": true,
|
|
5956
5988
|
"workspace": true,
|
|
5989
|
+
"acceptsApiKey": true,
|
|
5957
5990
|
"scope": "limits:write"
|
|
5958
5991
|
},
|
|
5959
5992
|
{
|
|
@@ -5977,21 +6010,77 @@ var OPERATIONS = [
|
|
|
5977
6010
|
"idempotentHint": true
|
|
5978
6011
|
}
|
|
5979
6012
|
},
|
|
5980
|
-
"description": "
|
|
6013
|
+
"description": "Lists the credits added to subjects' balances on this limit, including any taken back, newest first. Page through them with the opaque `nextCursor`. `before` starts from a moment, and `subjectId` keeps one subject's credits.",
|
|
5981
6014
|
"fields": [
|
|
5982
6015
|
{
|
|
5983
6016
|
"name": "limitId",
|
|
5984
6017
|
"in": "path",
|
|
5985
6018
|
"type": "string",
|
|
5986
6019
|
"required": true,
|
|
5987
|
-
"
|
|
6020
|
+
"description": "The limit's ID.",
|
|
6021
|
+
"example": "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34",
|
|
6022
|
+
"schema": {
|
|
6023
|
+
"type": "string",
|
|
6024
|
+
"description": "The limit's ID."
|
|
6025
|
+
}
|
|
6026
|
+
},
|
|
6027
|
+
{
|
|
6028
|
+
"name": "limit",
|
|
6029
|
+
"in": "query",
|
|
6030
|
+
"type": "number",
|
|
6031
|
+
"required": false,
|
|
6032
|
+
"description": "Items per page, 1\u2013100 (default 25).",
|
|
6033
|
+
"example": 25,
|
|
6034
|
+
"schema": {
|
|
6035
|
+
"type": "integer",
|
|
6036
|
+
"minimum": 1,
|
|
6037
|
+
"maximum": 100,
|
|
6038
|
+
"default": 25,
|
|
6039
|
+
"description": "Items per page, 1\u2013100 (default 25)."
|
|
6040
|
+
}
|
|
6041
|
+
},
|
|
6042
|
+
{
|
|
6043
|
+
"name": "cursor",
|
|
6044
|
+
"in": "query",
|
|
6045
|
+
"type": "string",
|
|
6046
|
+
"required": false,
|
|
6047
|
+
"description": "Opaque token from a previous page's nextCursor.",
|
|
6048
|
+
"schema": {
|
|
6049
|
+
"type": "string",
|
|
6050
|
+
"description": "Opaque token from a previous page's nextCursor."
|
|
6051
|
+
}
|
|
6052
|
+
},
|
|
6053
|
+
{
|
|
6054
|
+
"name": "before",
|
|
6055
|
+
"in": "query",
|
|
6056
|
+
"type": "string",
|
|
6057
|
+
"required": false,
|
|
6058
|
+
"description": "Start from this moment: items older than it, newest first. Ignored with `cursor`, which already says where to go on.",
|
|
6059
|
+
"example": "2026-11-01T00:00:00.000Z",
|
|
6060
|
+
"schema": {
|
|
6061
|
+
"type": "string",
|
|
6062
|
+
"format": "date-time",
|
|
6063
|
+
"description": "Start from this moment: items older than it, newest first. Ignored with `cursor`, which already says where to go on."
|
|
6064
|
+
}
|
|
6065
|
+
},
|
|
6066
|
+
{
|
|
6067
|
+
"name": "subjectId",
|
|
6068
|
+
"in": "query",
|
|
6069
|
+
"type": "string",
|
|
6070
|
+
"required": false,
|
|
6071
|
+
"description": "Only the credits for this subject.",
|
|
6072
|
+
"example": "team_42",
|
|
5988
6073
|
"schema": {
|
|
5989
|
-
"type": "string"
|
|
6074
|
+
"type": "string",
|
|
6075
|
+
"minLength": 1,
|
|
6076
|
+
"maxLength": 200,
|
|
6077
|
+
"description": "Only the credits for this subject."
|
|
5990
6078
|
}
|
|
5991
6079
|
}
|
|
5992
6080
|
],
|
|
5993
6081
|
"hasBody": false,
|
|
5994
6082
|
"workspace": true,
|
|
6083
|
+
"acceptsApiKey": true,
|
|
5995
6084
|
"scope": "limits:read"
|
|
5996
6085
|
},
|
|
5997
6086
|
{
|
|
@@ -6015,21 +6104,24 @@ var OPERATIONS = [
|
|
|
6015
6104
|
"idempotentHint": true
|
|
6016
6105
|
}
|
|
6017
6106
|
},
|
|
6018
|
-
"description": "
|
|
6107
|
+
"description": "Returns one limit, with who it applies to, its action, its amount and its window.",
|
|
6019
6108
|
"fields": [
|
|
6020
6109
|
{
|
|
6021
6110
|
"name": "limitId",
|
|
6022
6111
|
"in": "path",
|
|
6023
6112
|
"type": "string",
|
|
6024
6113
|
"required": true,
|
|
6025
|
-
"
|
|
6114
|
+
"description": "The limit's ID.",
|
|
6115
|
+
"example": "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34",
|
|
6026
6116
|
"schema": {
|
|
6027
|
-
"type": "string"
|
|
6117
|
+
"type": "string",
|
|
6118
|
+
"description": "The limit's ID."
|
|
6028
6119
|
}
|
|
6029
6120
|
}
|
|
6030
6121
|
],
|
|
6031
6122
|
"hasBody": false,
|
|
6032
6123
|
"workspace": true,
|
|
6124
|
+
"acceptsApiKey": true,
|
|
6033
6125
|
"scope": "limits:read"
|
|
6034
6126
|
},
|
|
6035
6127
|
{
|
|
@@ -6051,7 +6143,7 @@ var OPERATIONS = [
|
|
|
6051
6143
|
"idempotentHint": true
|
|
6052
6144
|
}
|
|
6053
6145
|
},
|
|
6054
|
-
"description": "
|
|
6146
|
+
"description": "Lists this environment's active limits, newest first. With `archived=true`, it lists the archived ones instead. Filter by `subjectKind` and `action`, and page through the results with the opaque `nextCursor` token.",
|
|
6055
6147
|
"fields": [
|
|
6056
6148
|
{
|
|
6057
6149
|
"name": "limit",
|
|
@@ -6084,12 +6176,12 @@ var OPERATIONS = [
|
|
|
6084
6176
|
"in": "query",
|
|
6085
6177
|
"type": "string",
|
|
6086
6178
|
"required": false,
|
|
6087
|
-
"description": "Only this kind.",
|
|
6179
|
+
"description": "Only limits for this subject kind.",
|
|
6088
6180
|
"schema": {
|
|
6089
6181
|
"type": "string",
|
|
6090
6182
|
"minLength": 1,
|
|
6091
6183
|
"maxLength": 100,
|
|
6092
|
-
"description": "Only this kind."
|
|
6184
|
+
"description": "Only limits for this subject kind."
|
|
6093
6185
|
}
|
|
6094
6186
|
},
|
|
6095
6187
|
{
|
|
@@ -6097,12 +6189,12 @@ var OPERATIONS = [
|
|
|
6097
6189
|
"in": "query",
|
|
6098
6190
|
"type": "string",
|
|
6099
6191
|
"required": false,
|
|
6100
|
-
"description": "Only this action.",
|
|
6192
|
+
"description": "Only limits for this action.",
|
|
6101
6193
|
"schema": {
|
|
6102
6194
|
"type": "string",
|
|
6103
6195
|
"minLength": 1,
|
|
6104
6196
|
"maxLength": 100,
|
|
6105
|
-
"description": "Only this action."
|
|
6197
|
+
"description": "Only limits for this action."
|
|
6106
6198
|
}
|
|
6107
6199
|
},
|
|
6108
6200
|
{
|
|
@@ -6110,19 +6202,20 @@ var OPERATIONS = [
|
|
|
6110
6202
|
"in": "query",
|
|
6111
6203
|
"type": "string",
|
|
6112
6204
|
"required": false,
|
|
6113
|
-
"description": "`true
|
|
6205
|
+
"description": "Send `true` to list the archived limits instead.",
|
|
6114
6206
|
"schema": {
|
|
6115
6207
|
"type": "string",
|
|
6116
6208
|
"enum": [
|
|
6117
6209
|
"true",
|
|
6118
6210
|
"false"
|
|
6119
6211
|
],
|
|
6120
|
-
"description": "`true
|
|
6212
|
+
"description": "Send `true` to list the archived limits instead."
|
|
6121
6213
|
}
|
|
6122
6214
|
}
|
|
6123
6215
|
],
|
|
6124
6216
|
"hasBody": false,
|
|
6125
6217
|
"workspace": true,
|
|
6218
|
+
"acceptsApiKey": true,
|
|
6126
6219
|
"scope": "limits:read"
|
|
6127
6220
|
},
|
|
6128
6221
|
{
|
|
@@ -6146,21 +6239,24 @@ var OPERATIONS = [
|
|
|
6146
6239
|
"idempotentHint": false
|
|
6147
6240
|
}
|
|
6148
6241
|
},
|
|
6149
|
-
"description": "Brings an archived limit back
|
|
6242
|
+
"description": "Brings an archived limit back. Checks enforce it again if it's enabled. The API refuses it while an active limit has the same name. With a personal access token, only owners and admins can call this. A workspace API key with this scope can.",
|
|
6150
6243
|
"fields": [
|
|
6151
6244
|
{
|
|
6152
6245
|
"name": "limitId",
|
|
6153
6246
|
"in": "path",
|
|
6154
6247
|
"type": "string",
|
|
6155
6248
|
"required": true,
|
|
6156
|
-
"
|
|
6249
|
+
"description": "The limit's ID.",
|
|
6250
|
+
"example": "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34",
|
|
6157
6251
|
"schema": {
|
|
6158
|
-
"type": "string"
|
|
6252
|
+
"type": "string",
|
|
6253
|
+
"description": "The limit's ID."
|
|
6159
6254
|
}
|
|
6160
6255
|
}
|
|
6161
6256
|
],
|
|
6162
6257
|
"hasBody": false,
|
|
6163
6258
|
"workspace": true,
|
|
6259
|
+
"acceptsApiKey": true,
|
|
6164
6260
|
"scope": "limits:write"
|
|
6165
6261
|
},
|
|
6166
6262
|
{
|
|
@@ -6183,14 +6279,14 @@ var OPERATIONS = [
|
|
|
6183
6279
|
"idempotentHint": false
|
|
6184
6280
|
}
|
|
6185
6281
|
},
|
|
6186
|
-
"description": "Makes the environment's limits match `limits`, by name
|
|
6282
|
+
"description": "Makes the environment's limits match the list in `limits`, pairing them up by name. It creates the limits that are missing and changes the ones that differ, where an omitted field means its default. With `archiveMissing`, it also archives the active limits the list doesn't name. Running it twice changes nothing the second time. Limitry checks the whole list before writing anything. If any entry has a problem, nothing changes, and the 400 lists each problem in `details`. Otherwise Limitry writes every change at once. You can't change a limit's subject, action, unit, window, every, start or rolling under the same name, so rename the entry to do that. With `preview`, it returns what it would do without writing anything. This is the call behind `limitry sync`, for keeping your limits in a file in your repository. With a personal access token, only owners and admins can call this. A workspace API key with this scope can.",
|
|
6187
6283
|
"fields": [
|
|
6188
6284
|
{
|
|
6189
6285
|
"name": "limits",
|
|
6190
6286
|
"in": "body",
|
|
6191
6287
|
"type": "json",
|
|
6192
6288
|
"required": true,
|
|
6193
|
-
"description": "Every limit you want, each described
|
|
6289
|
+
"description": "Every limit you want, each described in full. An omitted field takes its default, as on create. A sync matches limits by name, so each name must be unique in the list. You can't change a limit's subject, action, unit, window, every, start or rolling under the same name. To change one of them, rename the entry, which creates a new limit. The list holds at most 200 limits.",
|
|
6194
6290
|
"example": [
|
|
6195
6291
|
{
|
|
6196
6292
|
"name": "AI budget",
|
|
@@ -6218,7 +6314,7 @@ var OPERATIONS = [
|
|
|
6218
6314
|
"minLength": 1,
|
|
6219
6315
|
"maxLength": 100,
|
|
6220
6316
|
"example": "AI budget",
|
|
6221
|
-
"description": "The limit's name
|
|
6317
|
+
"description": "The limit's name. A sync matches limits by name, so each name appears once in the list."
|
|
6222
6318
|
}
|
|
6223
6319
|
},
|
|
6224
6320
|
"required": [
|
|
@@ -6228,7 +6324,7 @@ var OPERATIONS = [
|
|
|
6228
6324
|
]
|
|
6229
6325
|
},
|
|
6230
6326
|
"maxItems": 200,
|
|
6231
|
-
"description": "Every limit you want, each described
|
|
6327
|
+
"description": "Every limit you want, each described in full. An omitted field takes its default, as on create. A sync matches limits by name, so each name must be unique in the list. You can't change a limit's subject, action, unit, window, every, start or rolling under the same name. To change one of them, rename the entry, which creates a new limit. The list holds at most 200 limits."
|
|
6232
6328
|
}
|
|
6233
6329
|
},
|
|
6234
6330
|
{
|
|
@@ -6236,10 +6332,10 @@ var OPERATIONS = [
|
|
|
6236
6332
|
"in": "body",
|
|
6237
6333
|
"type": "boolean",
|
|
6238
6334
|
"required": false,
|
|
6239
|
-
"description": "
|
|
6335
|
+
"description": "Whether to archive the environment's active limits whose names aren't in `limits`. You can restore them later. Default: false, which leaves them alone.",
|
|
6240
6336
|
"schema": {
|
|
6241
6337
|
"type": "boolean",
|
|
6242
|
-
"description": "
|
|
6338
|
+
"description": "Whether to archive the environment's active limits whose names aren't in `limits`. You can restore them later. Default: false, which leaves them alone."
|
|
6243
6339
|
}
|
|
6244
6340
|
},
|
|
6245
6341
|
{
|
|
@@ -6247,15 +6343,16 @@ var OPERATIONS = [
|
|
|
6247
6343
|
"in": "body",
|
|
6248
6344
|
"type": "boolean",
|
|
6249
6345
|
"required": false,
|
|
6250
|
-
"description": "
|
|
6346
|
+
"description": "Whether to report what the sync would do without changing anything. Default: false.",
|
|
6251
6347
|
"schema": {
|
|
6252
6348
|
"type": "boolean",
|
|
6253
|
-
"description": "
|
|
6349
|
+
"description": "Whether to report what the sync would do without changing anything. Default: false."
|
|
6254
6350
|
}
|
|
6255
6351
|
}
|
|
6256
6352
|
],
|
|
6257
6353
|
"hasBody": true,
|
|
6258
6354
|
"workspace": true,
|
|
6355
|
+
"acceptsApiKey": true,
|
|
6259
6356
|
"scope": "limits:write"
|
|
6260
6357
|
},
|
|
6261
6358
|
{
|
|
@@ -6279,16 +6376,18 @@ var OPERATIONS = [
|
|
|
6279
6376
|
"idempotentHint": false
|
|
6280
6377
|
}
|
|
6281
6378
|
},
|
|
6282
|
-
"description": "Changes a limit's name, amount, fail mode or whether it
|
|
6379
|
+
"description": "Changes a limit's name, amount, fail mode or whether it's enabled. Checks use the new rule at once. You can't change a limit's subject, action, unit, window, every, start or rolling, and a request that tries gets a 400. To count something different, create a new limit and archive this one. With a personal access token, only owners and admins can call this. A workspace API key with this scope can.",
|
|
6283
6380
|
"fields": [
|
|
6284
6381
|
{
|
|
6285
6382
|
"name": "limitId",
|
|
6286
6383
|
"in": "path",
|
|
6287
6384
|
"type": "string",
|
|
6288
6385
|
"required": true,
|
|
6289
|
-
"
|
|
6386
|
+
"description": "The limit's ID.",
|
|
6387
|
+
"example": "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34",
|
|
6290
6388
|
"schema": {
|
|
6291
|
-
"type": "string"
|
|
6389
|
+
"type": "string",
|
|
6390
|
+
"description": "The limit's ID."
|
|
6292
6391
|
}
|
|
6293
6392
|
},
|
|
6294
6393
|
{
|
|
@@ -6324,10 +6423,10 @@ var OPERATIONS = [
|
|
|
6324
6423
|
"in": "body",
|
|
6325
6424
|
"type": "boolean",
|
|
6326
6425
|
"required": false,
|
|
6327
|
-
"description": "Whether checks enforce
|
|
6426
|
+
"description": "Whether checks enforce the limit.",
|
|
6328
6427
|
"schema": {
|
|
6329
6428
|
"type": "boolean",
|
|
6330
|
-
"description": "Whether checks enforce
|
|
6429
|
+
"description": "Whether checks enforce the limit."
|
|
6331
6430
|
}
|
|
6332
6431
|
},
|
|
6333
6432
|
{
|
|
@@ -6335,14 +6434,14 @@ var OPERATIONS = [
|
|
|
6335
6434
|
"in": "body",
|
|
6336
6435
|
"type": "string",
|
|
6337
6436
|
"required": false,
|
|
6338
|
-
"description": "What your code should do when
|
|
6437
|
+
"description": "What your code should do when it can't reach Limitry. `open` allows and `closed` refuses.",
|
|
6339
6438
|
"schema": {
|
|
6340
6439
|
"type": "string",
|
|
6341
6440
|
"enum": [
|
|
6342
6441
|
"open",
|
|
6343
6442
|
"closed"
|
|
6344
6443
|
],
|
|
6345
|
-
"description": "What your code should do when
|
|
6444
|
+
"description": "What your code should do when it can't reach Limitry. `open` allows and `closed` refuses."
|
|
6346
6445
|
}
|
|
6347
6446
|
},
|
|
6348
6447
|
{
|
|
@@ -6350,7 +6449,7 @@ var OPERATIONS = [
|
|
|
6350
6449
|
"in": "body",
|
|
6351
6450
|
"type": "json",
|
|
6352
6451
|
"required": false,
|
|
6353
|
-
"description": "Who
|
|
6452
|
+
"description": "Who the limit applies to. You set it when you create the limit. To change it later, create a new limit and archive this one.",
|
|
6354
6453
|
"example": {
|
|
6355
6454
|
"kind": "user"
|
|
6356
6455
|
},
|
|
@@ -6361,7 +6460,7 @@ var OPERATIONS = [
|
|
|
6361
6460
|
"type": "string",
|
|
6362
6461
|
"minLength": 1,
|
|
6363
6462
|
"maxLength": 100,
|
|
6364
|
-
"description": "Your own label for who
|
|
6463
|
+
"description": "Your own label for who the limit applies to, such as user, team or apikey."
|
|
6365
6464
|
},
|
|
6366
6465
|
"id": {
|
|
6367
6466
|
"type": [
|
|
@@ -6370,10 +6469,10 @@ var OPERATIONS = [
|
|
|
6370
6469
|
],
|
|
6371
6470
|
"minLength": 1,
|
|
6372
6471
|
"maxLength": 100,
|
|
6373
|
-
"description": "One subject
|
|
6472
|
+
"description": "One subject's ID. Leave it out, or send null, to cover every subject of the kind. A limit for one subject replaces the kind's limits that have the same action and window."
|
|
6374
6473
|
}
|
|
6375
6474
|
},
|
|
6376
|
-
"description": "Who
|
|
6475
|
+
"description": "Who the limit applies to. You set it when you create the limit. To change it later, create a new limit and archive this one."
|
|
6377
6476
|
}
|
|
6378
6477
|
},
|
|
6379
6478
|
{
|
|
@@ -6381,12 +6480,12 @@ var OPERATIONS = [
|
|
|
6381
6480
|
"in": "body",
|
|
6382
6481
|
"type": "string",
|
|
6383
6482
|
"required": false,
|
|
6384
|
-
"description": "The action.
|
|
6483
|
+
"description": "The action the limit applies to. You set it when you create the limit. To change it later, create a new limit and archive this one.",
|
|
6385
6484
|
"schema": {
|
|
6386
6485
|
"type": "string",
|
|
6387
6486
|
"minLength": 1,
|
|
6388
6487
|
"maxLength": 100,
|
|
6389
|
-
"description": "The action.
|
|
6488
|
+
"description": "The action the limit applies to. You set it when you create the limit. To change it later, create a new limit and archive this one."
|
|
6390
6489
|
}
|
|
6391
6490
|
},
|
|
6392
6491
|
{
|
|
@@ -6394,12 +6493,12 @@ var OPERATIONS = [
|
|
|
6394
6493
|
"in": "body",
|
|
6395
6494
|
"type": "string",
|
|
6396
6495
|
"required": false,
|
|
6397
|
-
"description": "What the amount counts.
|
|
6496
|
+
"description": "What the amount counts. You set it when you create the limit. To change it later, create a new limit and archive this one.",
|
|
6398
6497
|
"schema": {
|
|
6399
6498
|
"type": "string",
|
|
6400
6499
|
"minLength": 1,
|
|
6401
6500
|
"maxLength": 40,
|
|
6402
|
-
"description": "What the amount counts.
|
|
6501
|
+
"description": "What the amount counts. You set it when you create the limit. To change it later, create a new limit and archive this one."
|
|
6403
6502
|
}
|
|
6404
6503
|
},
|
|
6405
6504
|
{
|
|
@@ -6407,7 +6506,7 @@ var OPERATIONS = [
|
|
|
6407
6506
|
"in": "body",
|
|
6408
6507
|
"type": "string",
|
|
6409
6508
|
"required": false,
|
|
6410
|
-
"description": "The
|
|
6509
|
+
"description": "The kind of period. You set it when you create the limit. To change it later, create a new limit and archive this one.",
|
|
6411
6510
|
"schema": {
|
|
6412
6511
|
"type": "string",
|
|
6413
6512
|
"enum": [
|
|
@@ -6420,7 +6519,7 @@ var OPERATIONS = [
|
|
|
6420
6519
|
"total",
|
|
6421
6520
|
"concurrent"
|
|
6422
6521
|
],
|
|
6423
|
-
"description": "The
|
|
6522
|
+
"description": "The kind of period. You set it when you create the limit. To change it later, create a new limit and archive this one."
|
|
6424
6523
|
}
|
|
6425
6524
|
},
|
|
6426
6525
|
{
|
|
@@ -6428,12 +6527,12 @@ var OPERATIONS = [
|
|
|
6428
6527
|
"in": "body",
|
|
6429
6528
|
"type": "number",
|
|
6430
6529
|
"required": false,
|
|
6431
|
-
"description": "How many windows
|
|
6530
|
+
"description": "How many windows one period lasts. You set it when you create the limit. To change it later, create a new limit and archive this one.",
|
|
6432
6531
|
"schema": {
|
|
6433
6532
|
"type": "integer",
|
|
6434
6533
|
"minimum": 1,
|
|
6435
6534
|
"maximum": 1e3,
|
|
6436
|
-
"description": "How many windows
|
|
6535
|
+
"description": "How many windows one period lasts. You set it when you create the limit. To change it later, create a new limit and archive this one."
|
|
6437
6536
|
}
|
|
6438
6537
|
},
|
|
6439
6538
|
{
|
|
@@ -6441,7 +6540,7 @@ var OPERATIONS = [
|
|
|
6441
6540
|
"in": "body",
|
|
6442
6541
|
"type": "string",
|
|
6443
6542
|
"required": false,
|
|
6444
|
-
"description": "Where
|
|
6543
|
+
"description": "Where each period begins. You set it when you create the limit. To change it later, create a new limit and archive this one.",
|
|
6445
6544
|
"schema": {
|
|
6446
6545
|
"type": "string",
|
|
6447
6546
|
"enum": [
|
|
@@ -6449,7 +6548,7 @@ var OPERATIONS = [
|
|
|
6449
6548
|
"billing_date",
|
|
6450
6549
|
"first_use"
|
|
6451
6550
|
],
|
|
6452
|
-
"description": "Where
|
|
6551
|
+
"description": "Where each period begins. You set it when you create the limit. To change it later, create a new limit and archive this one."
|
|
6453
6552
|
}
|
|
6454
6553
|
},
|
|
6455
6554
|
{
|
|
@@ -6457,15 +6556,16 @@ var OPERATIONS = [
|
|
|
6457
6556
|
"in": "body",
|
|
6458
6557
|
"type": "boolean",
|
|
6459
6558
|
"required": false,
|
|
6460
|
-
"description": "Whether
|
|
6559
|
+
"description": "Whether the limit counts the last windows up to each check. You set it when you create the limit. To change it later, create a new limit and archive this one.",
|
|
6461
6560
|
"schema": {
|
|
6462
6561
|
"type": "boolean",
|
|
6463
|
-
"description": "Whether
|
|
6562
|
+
"description": "Whether the limit counts the last windows up to each check. You set it when you create the limit. To change it later, create a new limit and archive this one."
|
|
6464
6563
|
}
|
|
6465
6564
|
}
|
|
6466
6565
|
],
|
|
6467
6566
|
"hasBody": true,
|
|
6468
6567
|
"workspace": true,
|
|
6568
|
+
"acceptsApiKey": true,
|
|
6469
6569
|
"scope": "limits:write"
|
|
6470
6570
|
},
|
|
6471
6571
|
{
|
|
@@ -6489,15 +6589,17 @@ var OPERATIONS = [
|
|
|
6489
6589
|
"idempotentHint": false
|
|
6490
6590
|
}
|
|
6491
6591
|
},
|
|
6492
|
-
"description": "Commits a reservation with the
|
|
6592
|
+
"description": "Commits a reservation with the amount actually used (`cost`). If `cost` is less than the amount reserved, the rest goes back at once. If it's more, Limitry charges the whole `cost`, since the work happened. A commit up to 24 hours after the reservation expired still charges `cost`. Repeating a commit with the same `cost` returns the same result, and a different `cost` gets a 400. We cache its API key check briefly for speed. A revoked key can keep working here for up to 60 seconds.",
|
|
6493
6593
|
"fields": [
|
|
6494
6594
|
{
|
|
6495
6595
|
"name": "reservationId",
|
|
6496
6596
|
"in": "path",
|
|
6497
6597
|
"type": "string",
|
|
6498
6598
|
"required": true,
|
|
6599
|
+
"description": "The reservation's ID.",
|
|
6499
6600
|
"schema": {
|
|
6500
|
-
"type": "string"
|
|
6601
|
+
"type": "string",
|
|
6602
|
+
"description": "The reservation's ID."
|
|
6501
6603
|
}
|
|
6502
6604
|
},
|
|
6503
6605
|
{
|
|
@@ -6516,6 +6618,7 @@ var OPERATIONS = [
|
|
|
6516
6618
|
],
|
|
6517
6619
|
"hasBody": true,
|
|
6518
6620
|
"workspace": true,
|
|
6621
|
+
"acceptsApiKey": true,
|
|
6519
6622
|
"scope": "checks:write"
|
|
6520
6623
|
},
|
|
6521
6624
|
{
|
|
@@ -6539,15 +6642,17 @@ var OPERATIONS = [
|
|
|
6539
6642
|
"idempotentHint": false
|
|
6540
6643
|
}
|
|
6541
6644
|
},
|
|
6542
|
-
"description": "Keeps a reservation for longer work
|
|
6645
|
+
"description": "Keeps a reservation open for longer work, so it expires `ttlSeconds` from now. Call it again as a heartbeat while the work runs. You can only extend a reservation that's still held. We cache its API key check briefly for speed. A revoked key can keep working here for up to 60 seconds.",
|
|
6543
6646
|
"fields": [
|
|
6544
6647
|
{
|
|
6545
6648
|
"name": "reservationId",
|
|
6546
6649
|
"in": "path",
|
|
6547
6650
|
"type": "string",
|
|
6548
6651
|
"required": true,
|
|
6652
|
+
"description": "The reservation's ID.",
|
|
6549
6653
|
"schema": {
|
|
6550
|
-
"type": "string"
|
|
6654
|
+
"type": "string",
|
|
6655
|
+
"description": "The reservation's ID."
|
|
6551
6656
|
}
|
|
6552
6657
|
},
|
|
6553
6658
|
{
|
|
@@ -6555,18 +6660,19 @@ var OPERATIONS = [
|
|
|
6555
6660
|
"in": "body",
|
|
6556
6661
|
"type": "number",
|
|
6557
6662
|
"required": false,
|
|
6558
|
-
"description": "Seconds from now. Default 300.",
|
|
6663
|
+
"description": "Seconds from now until the reservation expires. Default: 300. At most 3600.",
|
|
6559
6664
|
"example": 600,
|
|
6560
6665
|
"schema": {
|
|
6561
6666
|
"type": "integer",
|
|
6562
6667
|
"minimum": 1,
|
|
6563
6668
|
"maximum": 3600,
|
|
6564
|
-
"description": "Seconds from now. Default 300."
|
|
6669
|
+
"description": "Seconds from now until the reservation expires. Default: 300. At most 3600."
|
|
6565
6670
|
}
|
|
6566
6671
|
}
|
|
6567
6672
|
],
|
|
6568
6673
|
"hasBody": true,
|
|
6569
6674
|
"workspace": true,
|
|
6675
|
+
"acceptsApiKey": true,
|
|
6570
6676
|
"scope": "checks:write"
|
|
6571
6677
|
},
|
|
6572
6678
|
{
|
|
@@ -6590,20 +6696,23 @@ var OPERATIONS = [
|
|
|
6590
6696
|
"idempotentHint": false
|
|
6591
6697
|
}
|
|
6592
6698
|
},
|
|
6593
|
-
"description": "Gives the whole reservation back
|
|
6699
|
+
"description": "Gives the whole reservation back, because the work didn't happen. Repeating a release within 24 hours returns the same result. You can't release a reservation you've already committed. We cache its API key check briefly for speed. A revoked key can keep working here for up to 60 seconds.",
|
|
6594
6700
|
"fields": [
|
|
6595
6701
|
{
|
|
6596
6702
|
"name": "reservationId",
|
|
6597
6703
|
"in": "path",
|
|
6598
6704
|
"type": "string",
|
|
6599
6705
|
"required": true,
|
|
6706
|
+
"description": "The reservation's ID.",
|
|
6600
6707
|
"schema": {
|
|
6601
|
-
"type": "string"
|
|
6708
|
+
"type": "string",
|
|
6709
|
+
"description": "The reservation's ID."
|
|
6602
6710
|
}
|
|
6603
6711
|
}
|
|
6604
6712
|
],
|
|
6605
6713
|
"hasBody": false,
|
|
6606
6714
|
"workspace": true,
|
|
6715
|
+
"acceptsApiKey": true,
|
|
6607
6716
|
"scope": "checks:write"
|
|
6608
6717
|
},
|
|
6609
6718
|
{
|
|
@@ -6628,18 +6737,20 @@ var OPERATIONS = [
|
|
|
6628
6737
|
"idempotentHint": true
|
|
6629
6738
|
}
|
|
6630
6739
|
},
|
|
6631
|
-
"description": "
|
|
6740
|
+
"description": "Returns a subject's billing date, the day its `billing_date` limits start each new period. A subject is one of yours, such as a user, a team or an agent. It exists once a check names it.",
|
|
6632
6741
|
"fields": [
|
|
6633
6742
|
{
|
|
6634
6743
|
"name": "subjectKind",
|
|
6635
6744
|
"in": "path",
|
|
6636
6745
|
"type": "string",
|
|
6637
6746
|
"required": true,
|
|
6747
|
+
"description": "The subject kind's ID.",
|
|
6638
6748
|
"example": "team",
|
|
6639
6749
|
"schema": {
|
|
6640
6750
|
"type": "string",
|
|
6641
6751
|
"minLength": 1,
|
|
6642
|
-
"maxLength": 100
|
|
6752
|
+
"maxLength": 100,
|
|
6753
|
+
"description": "The subject kind's ID."
|
|
6643
6754
|
}
|
|
6644
6755
|
},
|
|
6645
6756
|
{
|
|
@@ -6647,16 +6758,19 @@ var OPERATIONS = [
|
|
|
6647
6758
|
"in": "path",
|
|
6648
6759
|
"type": "string",
|
|
6649
6760
|
"required": true,
|
|
6761
|
+
"description": "The subject's ID.",
|
|
6650
6762
|
"example": "team_42",
|
|
6651
6763
|
"schema": {
|
|
6652
6764
|
"type": "string",
|
|
6653
6765
|
"minLength": 1,
|
|
6654
|
-
"maxLength": 200
|
|
6766
|
+
"maxLength": 200,
|
|
6767
|
+
"description": "The subject's ID."
|
|
6655
6768
|
}
|
|
6656
6769
|
}
|
|
6657
6770
|
],
|
|
6658
6771
|
"hasBody": false,
|
|
6659
6772
|
"workspace": true,
|
|
6773
|
+
"acceptsApiKey": true,
|
|
6660
6774
|
"scope": "limits:read"
|
|
6661
6775
|
},
|
|
6662
6776
|
{
|
|
@@ -6681,18 +6795,20 @@ var OPERATIONS = [
|
|
|
6681
6795
|
"idempotentHint": false
|
|
6682
6796
|
}
|
|
6683
6797
|
},
|
|
6684
|
-
"description": "Resets one limit on a subject
|
|
6798
|
+
"description": "Resets one limit on a subject now, or every limit on it. Send `limitId` for one limit, or `{}` for all of them. Use it for goodwill, a promotion or support. The schedule doesn't move, so the next reset still happens when it normally would. A balance goes back to its amount, and the reset skips concurrent limits. With an Idempotency-Key, a repeated request resets only once. With a personal access token, only owners and admins can call this. A workspace API key with this scope can.",
|
|
6685
6799
|
"fields": [
|
|
6686
6800
|
{
|
|
6687
6801
|
"name": "subjectKind",
|
|
6688
6802
|
"in": "path",
|
|
6689
6803
|
"type": "string",
|
|
6690
6804
|
"required": true,
|
|
6805
|
+
"description": "The subject kind's ID.",
|
|
6691
6806
|
"example": "team",
|
|
6692
6807
|
"schema": {
|
|
6693
6808
|
"type": "string",
|
|
6694
6809
|
"minLength": 1,
|
|
6695
|
-
"maxLength": 100
|
|
6810
|
+
"maxLength": 100,
|
|
6811
|
+
"description": "The subject kind's ID."
|
|
6696
6812
|
}
|
|
6697
6813
|
},
|
|
6698
6814
|
{
|
|
@@ -6700,11 +6816,13 @@ var OPERATIONS = [
|
|
|
6700
6816
|
"in": "path",
|
|
6701
6817
|
"type": "string",
|
|
6702
6818
|
"required": true,
|
|
6819
|
+
"description": "The subject's ID.",
|
|
6703
6820
|
"example": "team_42",
|
|
6704
6821
|
"schema": {
|
|
6705
6822
|
"type": "string",
|
|
6706
6823
|
"minLength": 1,
|
|
6707
|
-
"maxLength": 200
|
|
6824
|
+
"maxLength": 200,
|
|
6825
|
+
"description": "The subject's ID."
|
|
6708
6826
|
}
|
|
6709
6827
|
},
|
|
6710
6828
|
{
|
|
@@ -6712,16 +6830,17 @@ var OPERATIONS = [
|
|
|
6712
6830
|
"in": "body",
|
|
6713
6831
|
"type": "string",
|
|
6714
6832
|
"required": false,
|
|
6715
|
-
"description": "
|
|
6716
|
-
"example": "
|
|
6833
|
+
"description": "The one limit to reset. Default: every limit on the subject.",
|
|
6834
|
+
"example": "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34",
|
|
6717
6835
|
"schema": {
|
|
6718
6836
|
"type": "string",
|
|
6719
|
-
"description": "
|
|
6837
|
+
"description": "The one limit to reset. Default: every limit on the subject."
|
|
6720
6838
|
}
|
|
6721
6839
|
}
|
|
6722
6840
|
],
|
|
6723
6841
|
"hasBody": true,
|
|
6724
6842
|
"workspace": true,
|
|
6843
|
+
"acceptsApiKey": true,
|
|
6725
6844
|
"scope": "limits:write"
|
|
6726
6845
|
},
|
|
6727
6846
|
{
|
|
@@ -6746,18 +6865,20 @@ var OPERATIONS = [
|
|
|
6746
6865
|
"idempotentHint": false
|
|
6747
6866
|
}
|
|
6748
6867
|
},
|
|
6749
|
-
"description": "Sets
|
|
6868
|
+
"description": "Sets the date a subject's `billing_date` limits count their periods from. Usually this is the subscription's start date, set from your billing system's webhook. The subject's allowance then resets on its own billing day, and a monthly limit still resets monthly on an annual plan. With a personal access token, only owners and admins can call this. A workspace API key with this scope can.",
|
|
6750
6869
|
"fields": [
|
|
6751
6870
|
{
|
|
6752
6871
|
"name": "subjectKind",
|
|
6753
6872
|
"in": "path",
|
|
6754
6873
|
"type": "string",
|
|
6755
6874
|
"required": true,
|
|
6875
|
+
"description": "The subject kind's ID.",
|
|
6756
6876
|
"example": "team",
|
|
6757
6877
|
"schema": {
|
|
6758
6878
|
"type": "string",
|
|
6759
6879
|
"minLength": 1,
|
|
6760
|
-
"maxLength": 100
|
|
6880
|
+
"maxLength": 100,
|
|
6881
|
+
"description": "The subject kind's ID."
|
|
6761
6882
|
}
|
|
6762
6883
|
},
|
|
6763
6884
|
{
|
|
@@ -6765,11 +6886,13 @@ var OPERATIONS = [
|
|
|
6765
6886
|
"in": "path",
|
|
6766
6887
|
"type": "string",
|
|
6767
6888
|
"required": true,
|
|
6889
|
+
"description": "The subject's ID.",
|
|
6768
6890
|
"example": "team_42",
|
|
6769
6891
|
"schema": {
|
|
6770
6892
|
"type": "string",
|
|
6771
6893
|
"minLength": 1,
|
|
6772
|
-
"maxLength": 200
|
|
6894
|
+
"maxLength": 200,
|
|
6895
|
+
"description": "The subject's ID."
|
|
6773
6896
|
}
|
|
6774
6897
|
},
|
|
6775
6898
|
{
|
|
@@ -6777,17 +6900,18 @@ var OPERATIONS = [
|
|
|
6777
6900
|
"in": "body",
|
|
6778
6901
|
"type": "string",
|
|
6779
6902
|
"required": true,
|
|
6780
|
-
"description": "The date and time
|
|
6903
|
+
"description": "The date and time the subject's periods start from, in ISO 8601, such as a subscription's start.",
|
|
6781
6904
|
"example": "2026-03-17T14:30:00Z",
|
|
6782
6905
|
"schema": {
|
|
6783
6906
|
"type": "string",
|
|
6784
6907
|
"format": "date-time",
|
|
6785
|
-
"description": "The date and time
|
|
6908
|
+
"description": "The date and time the subject's periods start from, in ISO 8601, such as a subscription's start."
|
|
6786
6909
|
}
|
|
6787
6910
|
}
|
|
6788
6911
|
],
|
|
6789
6912
|
"hasBody": true,
|
|
6790
6913
|
"workspace": true,
|
|
6914
|
+
"acceptsApiKey": true,
|
|
6791
6915
|
"scope": "limits:write"
|
|
6792
6916
|
},
|
|
6793
6917
|
{
|
|
@@ -6809,18 +6933,18 @@ var OPERATIONS = [
|
|
|
6809
6933
|
"idempotentHint": true
|
|
6810
6934
|
}
|
|
6811
6935
|
},
|
|
6812
|
-
"description": "
|
|
6936
|
+
"description": "Returns one limit's usage over time: the units used, and the checks allowed and refused. It covers every subject, or one subject named in `subject` as `kind:id`. Usage comes in hourly or daily buckets in UTC, and the response includes every bucket in the range. It can be up to about a minute behind live checks. By default, it covers the last 30 days, by day. A request returns at most 2,000 buckets. Usage older than your plan's history isn't returned.",
|
|
6813
6937
|
"fields": [
|
|
6814
6938
|
{
|
|
6815
6939
|
"name": "limitId",
|
|
6816
6940
|
"in": "query",
|
|
6817
6941
|
"type": "string",
|
|
6818
6942
|
"required": true,
|
|
6819
|
-
"description": "The limit.",
|
|
6820
|
-
"example": "
|
|
6943
|
+
"description": "The limit's ID.",
|
|
6944
|
+
"example": "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34",
|
|
6821
6945
|
"schema": {
|
|
6822
6946
|
"type": "string",
|
|
6823
|
-
"description": "The limit."
|
|
6947
|
+
"description": "The limit's ID."
|
|
6824
6948
|
}
|
|
6825
6949
|
},
|
|
6826
6950
|
{
|
|
@@ -6828,13 +6952,13 @@ var OPERATIONS = [
|
|
|
6828
6952
|
"in": "query",
|
|
6829
6953
|
"type": "string",
|
|
6830
6954
|
"required": false,
|
|
6831
|
-
"description": "One subject
|
|
6955
|
+
"description": "One subject, as `kind:id`, to see its usage instead of every subject's.",
|
|
6832
6956
|
"example": "user:usr_123",
|
|
6833
6957
|
"schema": {
|
|
6834
6958
|
"type": "string",
|
|
6835
6959
|
"minLength": 3,
|
|
6836
6960
|
"maxLength": 301,
|
|
6837
|
-
"description": "One subject
|
|
6961
|
+
"description": "One subject, as `kind:id`, to see its usage instead of every subject's."
|
|
6838
6962
|
}
|
|
6839
6963
|
},
|
|
6840
6964
|
{
|
|
@@ -6842,12 +6966,12 @@ var OPERATIONS = [
|
|
|
6842
6966
|
"in": "query",
|
|
6843
6967
|
"type": "string",
|
|
6844
6968
|
"required": false,
|
|
6845
|
-
"description": "
|
|
6969
|
+
"description": "The start of the range, in ISO 8601. Default: 30 days before `to`.",
|
|
6846
6970
|
"example": "2026-10-01T00:00:00Z",
|
|
6847
6971
|
"schema": {
|
|
6848
6972
|
"type": "string",
|
|
6849
6973
|
"format": "date-time",
|
|
6850
|
-
"description": "
|
|
6974
|
+
"description": "The start of the range, in ISO 8601. Default: 30 days before `to`."
|
|
6851
6975
|
}
|
|
6852
6976
|
},
|
|
6853
6977
|
{
|
|
@@ -6855,12 +6979,12 @@ var OPERATIONS = [
|
|
|
6855
6979
|
"in": "query",
|
|
6856
6980
|
"type": "string",
|
|
6857
6981
|
"required": false,
|
|
6858
|
-
"description": "
|
|
6982
|
+
"description": "The end of the range, in ISO 8601. Default: now.",
|
|
6859
6983
|
"example": "2026-10-31T00:00:00Z",
|
|
6860
6984
|
"schema": {
|
|
6861
6985
|
"type": "string",
|
|
6862
6986
|
"format": "date-time",
|
|
6863
|
-
"description": "
|
|
6987
|
+
"description": "The end of the range, in ISO 8601. Default: now."
|
|
6864
6988
|
}
|
|
6865
6989
|
},
|
|
6866
6990
|
{
|
|
@@ -6868,7 +6992,7 @@ var OPERATIONS = [
|
|
|
6868
6992
|
"in": "query",
|
|
6869
6993
|
"type": "string",
|
|
6870
6994
|
"required": false,
|
|
6871
|
-
"description": "
|
|
6995
|
+
"description": "Whether each bucket is an `hour` or a `day`, in UTC. Default: day.",
|
|
6872
6996
|
"schema": {
|
|
6873
6997
|
"type": "string",
|
|
6874
6998
|
"enum": [
|
|
@@ -6876,12 +7000,13 @@ var OPERATIONS = [
|
|
|
6876
7000
|
"day"
|
|
6877
7001
|
],
|
|
6878
7002
|
"default": "day",
|
|
6879
|
-
"description": "
|
|
7003
|
+
"description": "Whether each bucket is an `hour` or a `day`, in UTC. Default: day."
|
|
6880
7004
|
}
|
|
6881
7005
|
}
|
|
6882
7006
|
],
|
|
6883
7007
|
"hasBody": false,
|
|
6884
7008
|
"workspace": true,
|
|
7009
|
+
"acceptsApiKey": true,
|
|
6885
7010
|
"scope": "limits:read"
|
|
6886
7011
|
},
|
|
6887
7012
|
{
|
|
@@ -6903,20 +7028,20 @@ var OPERATIONS = [
|
|
|
6903
7028
|
"idempotentHint": true
|
|
6904
7029
|
}
|
|
6905
7030
|
},
|
|
6906
|
-
"description": "
|
|
7031
|
+
"description": "Returns where one subject stands on every enabled limit, exact as of now. It covers the subject's own limits and the limits on its shared subjects. Name the subject as `kind:id`, such as `user:usr_123`, and list its shared subjects in `shared`, such as `team:team_42`. Each limit shows what's used, what's left and when it resets. Use it to show your users where they stand. Call it from your server with your key, never from a browser. It isn't a check, so it counts nothing. A subject with no limits returns an empty `limits` list.",
|
|
6907
7032
|
"fields": [
|
|
6908
7033
|
{
|
|
6909
7034
|
"name": "subject",
|
|
6910
7035
|
"in": "query",
|
|
6911
7036
|
"type": "string",
|
|
6912
7037
|
"required": true,
|
|
6913
|
-
"description": "The subject, as `kind:id
|
|
7038
|
+
"description": "The subject, written as `kind:id` exactly as your checks send it.",
|
|
6914
7039
|
"example": "user:usr_123",
|
|
6915
7040
|
"schema": {
|
|
6916
7041
|
"type": "string",
|
|
6917
7042
|
"minLength": 3,
|
|
6918
7043
|
"maxLength": 301,
|
|
6919
|
-
"description": "The subject, as `kind:id
|
|
7044
|
+
"description": "The subject, written as `kind:id` exactly as your checks send it."
|
|
6920
7045
|
}
|
|
6921
7046
|
},
|
|
6922
7047
|
{
|
|
@@ -6924,16 +7049,17 @@ var OPERATIONS = [
|
|
|
6924
7049
|
"in": "query",
|
|
6925
7050
|
"type": "string",
|
|
6926
7051
|
"required": false,
|
|
6927
|
-
"description": "Shared subjects to include, comma-separated `kind:id`
|
|
7052
|
+
"description": "Shared subjects to include, as comma-separated `kind:id` pairs. Send up to 4.",
|
|
6928
7053
|
"example": "team:team_42",
|
|
6929
7054
|
"schema": {
|
|
6930
7055
|
"type": "string",
|
|
6931
|
-
"description": "Shared subjects to include, comma-separated `kind:id`
|
|
7056
|
+
"description": "Shared subjects to include, as comma-separated `kind:id` pairs. Send up to 4."
|
|
6932
7057
|
}
|
|
6933
7058
|
}
|
|
6934
7059
|
],
|
|
6935
7060
|
"hasBody": false,
|
|
6936
7061
|
"workspace": true,
|
|
7062
|
+
"acceptsApiKey": true,
|
|
6937
7063
|
"scope": "limits:read"
|
|
6938
7064
|
},
|
|
6939
7065
|
{
|
|
@@ -6955,18 +7081,18 @@ var OPERATIONS = [
|
|
|
6955
7081
|
"idempotentHint": true
|
|
6956
7082
|
}
|
|
6957
7083
|
},
|
|
6958
|
-
"description": "
|
|
7084
|
+
"description": "Lists a limit's subjects in its current window, most used first. Each one shows the units used, what's left and how many checks the limit refused. The amounts are exact, but a subject first checked in the last minute may not appear yet. For a `concurrent` limit, it lists the slots each subject holds now, among the subjects checked in the last hour.",
|
|
6959
7085
|
"fields": [
|
|
6960
7086
|
{
|
|
6961
7087
|
"name": "limitId",
|
|
6962
7088
|
"in": "query",
|
|
6963
7089
|
"type": "string",
|
|
6964
7090
|
"required": true,
|
|
6965
|
-
"description": "The limit.",
|
|
6966
|
-
"example": "
|
|
7091
|
+
"description": "The limit's ID.",
|
|
7092
|
+
"example": "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34",
|
|
6967
7093
|
"schema": {
|
|
6968
7094
|
"type": "string",
|
|
6969
|
-
"description": "The limit."
|
|
7095
|
+
"description": "The limit's ID."
|
|
6970
7096
|
}
|
|
6971
7097
|
},
|
|
6972
7098
|
{
|
|
@@ -6974,18 +7100,19 @@ var OPERATIONS = [
|
|
|
6974
7100
|
"in": "query",
|
|
6975
7101
|
"type": "number",
|
|
6976
7102
|
"required": false,
|
|
6977
|
-
"description": "How many subjects
|
|
7103
|
+
"description": "How many subjects to list. Default: 50. The response holds at most 50, or 25 for a `concurrent` limit, even if you ask for more.",
|
|
6978
7104
|
"schema": {
|
|
6979
7105
|
"type": "integer",
|
|
6980
7106
|
"minimum": 1,
|
|
6981
7107
|
"maximum": 200,
|
|
6982
7108
|
"default": 50,
|
|
6983
|
-
"description": "How many subjects
|
|
7109
|
+
"description": "How many subjects to list. Default: 50. The response holds at most 50, or 25 for a `concurrent` limit, even if you ask for more."
|
|
6984
7110
|
}
|
|
6985
7111
|
}
|
|
6986
7112
|
],
|
|
6987
7113
|
"hasBody": false,
|
|
6988
7114
|
"workspace": true,
|
|
7115
|
+
"acceptsApiKey": true,
|
|
6989
7116
|
"scope": "limits:read"
|
|
6990
7117
|
},
|
|
6991
7118
|
{
|
|
@@ -7000,12 +7127,13 @@ var OPERATIONS = [
|
|
|
7000
7127
|
},
|
|
7001
7128
|
"mcp": {
|
|
7002
7129
|
"exposed": false,
|
|
7003
|
-
"reason": "
|
|
7130
|
+
"reason": "Only a personal access token can call this. An agent's connection acts in one workspace, which workspace_get returns."
|
|
7004
7131
|
},
|
|
7005
|
-
"description": 'Returns the user the personal access token belongs to,
|
|
7132
|
+
"description": 'Returns the user the personal access token belongs to, and their workspace memberships. Use it as a smoke test for an integration ("who am I?").',
|
|
7006
7133
|
"fields": [],
|
|
7007
7134
|
"hasBody": false,
|
|
7008
|
-
"workspace": false
|
|
7135
|
+
"workspace": false,
|
|
7136
|
+
"acceptsApiKey": false
|
|
7009
7137
|
},
|
|
7010
7138
|
{
|
|
7011
7139
|
"operationId": "user.revokeToken",
|
|
@@ -7019,12 +7147,13 @@ var OPERATIONS = [
|
|
|
7019
7147
|
},
|
|
7020
7148
|
"mcp": {
|
|
7021
7149
|
"exposed": false,
|
|
7022
|
-
"reason": "Revokes a person's own credential
|
|
7150
|
+
"reason": "Revokes a person's own credential. Agents connect through OAuth and never use personal tokens."
|
|
7023
7151
|
},
|
|
7024
|
-
"description": "Revokes the personal access token
|
|
7152
|
+
"description": "Revokes the personal access token that makes the request. Use it to sign out from a script or the CLI (`logout`). The token stops working immediately. Your other tokens keep working.",
|
|
7025
7153
|
"fields": [],
|
|
7026
7154
|
"hasBody": false,
|
|
7027
|
-
"workspace": false
|
|
7155
|
+
"workspace": false,
|
|
7156
|
+
"acceptsApiKey": false
|
|
7028
7157
|
},
|
|
7029
7158
|
{
|
|
7030
7159
|
"operationId": "workspace.approvalActions.list",
|
|
@@ -7045,10 +7174,11 @@ var OPERATIONS = [
|
|
|
7045
7174
|
"idempotentHint": true
|
|
7046
7175
|
}
|
|
7047
7176
|
},
|
|
7048
|
-
"description": "
|
|
7177
|
+
"description": "Lists the actions a credential can't take itself but can ask a person to approve. Each action comes with its input as a JSON Schema, who can approve it and whether it creates a secret.",
|
|
7049
7178
|
"fields": [],
|
|
7050
7179
|
"hasBody": false,
|
|
7051
7180
|
"workspace": true,
|
|
7181
|
+
"acceptsApiKey": true,
|
|
7052
7182
|
"scope": "workspace.approvals:read"
|
|
7053
7183
|
},
|
|
7054
7184
|
{
|
|
@@ -7070,7 +7200,7 @@ var OPERATIONS = [
|
|
|
7070
7200
|
"idempotentHint": false
|
|
7071
7201
|
}
|
|
7072
7202
|
},
|
|
7073
|
-
"description": "
|
|
7203
|
+
"description": "Creates a request for an action you can't take yourself and notifies everyone who can approve it. The actions you can ask for are in approval-actions. Show the person `approveUrl` and why you need the action. Then check the request until a person decides. A request expires after 24 hours. A personal access token or an app a person connected can ask. A workspace API key can't.",
|
|
7074
7204
|
"fields": [
|
|
7075
7205
|
{
|
|
7076
7206
|
"name": "action",
|
|
@@ -7089,7 +7219,7 @@ var OPERATIONS = [
|
|
|
7089
7219
|
"in": "body",
|
|
7090
7220
|
"type": "json",
|
|
7091
7221
|
"required": true,
|
|
7092
|
-
"description": "The action's input
|
|
7222
|
+
"description": "The action's input. It must match the action's JSON Schema.",
|
|
7093
7223
|
"example": {
|
|
7094
7224
|
"name": "acme-web",
|
|
7095
7225
|
"scopes": [
|
|
@@ -7099,7 +7229,7 @@ var OPERATIONS = [
|
|
|
7099
7229
|
"schema": {
|
|
7100
7230
|
"type": "object",
|
|
7101
7231
|
"additionalProperties": {},
|
|
7102
|
-
"description": "The action's input
|
|
7232
|
+
"description": "The action's input. It must match the action's JSON Schema."
|
|
7103
7233
|
}
|
|
7104
7234
|
},
|
|
7105
7235
|
{
|
|
@@ -7107,17 +7237,19 @@ var OPERATIONS = [
|
|
|
7107
7237
|
"in": "body",
|
|
7108
7238
|
"type": "string",
|
|
7109
7239
|
"required": true,
|
|
7110
|
-
"description": "Why
|
|
7240
|
+
"description": "Why you need the action. The person reads it before deciding.",
|
|
7241
|
+
"example": "A key for the deploy pipeline.",
|
|
7111
7242
|
"schema": {
|
|
7112
7243
|
"type": "string",
|
|
7113
7244
|
"minLength": 1,
|
|
7114
7245
|
"maxLength": 500,
|
|
7115
|
-
"description": "Why
|
|
7246
|
+
"description": "Why you need the action. The person reads it before deciding."
|
|
7116
7247
|
}
|
|
7117
7248
|
}
|
|
7118
7249
|
],
|
|
7119
7250
|
"hasBody": true,
|
|
7120
7251
|
"workspace": true,
|
|
7252
|
+
"acceptsApiKey": false,
|
|
7121
7253
|
"scope": "workspace.approvals:write"
|
|
7122
7254
|
},
|
|
7123
7255
|
{
|
|
@@ -7141,7 +7273,7 @@ var OPERATIONS = [
|
|
|
7141
7273
|
"idempotentHint": true
|
|
7142
7274
|
}
|
|
7143
7275
|
},
|
|
7144
|
-
"description": "
|
|
7276
|
+
"description": "Returns an approval request you created, with its status. A `pending` request is waiting for a person to decide. A `completed` request's action ran, and `result` holds the outcome. An `approved` request is waiting for the CLI to redeem it. A request can also be `denied`, `failed` or `expired`.",
|
|
7145
7277
|
"fields": [
|
|
7146
7278
|
{
|
|
7147
7279
|
"name": "requestId",
|
|
@@ -7149,6 +7281,7 @@ var OPERATIONS = [
|
|
|
7149
7281
|
"type": "string",
|
|
7150
7282
|
"required": true,
|
|
7151
7283
|
"description": "The request's id.",
|
|
7284
|
+
"example": "apr_7c2e\u2026",
|
|
7152
7285
|
"schema": {
|
|
7153
7286
|
"type": "string",
|
|
7154
7287
|
"description": "The request's id."
|
|
@@ -7157,6 +7290,7 @@ var OPERATIONS = [
|
|
|
7157
7290
|
],
|
|
7158
7291
|
"hasBody": false,
|
|
7159
7292
|
"workspace": true,
|
|
7293
|
+
"acceptsApiKey": true,
|
|
7160
7294
|
"scope": "workspace.approvals:read"
|
|
7161
7295
|
},
|
|
7162
7296
|
{
|
|
@@ -7173,9 +7307,9 @@ var OPERATIONS = [
|
|
|
7173
7307
|
},
|
|
7174
7308
|
"mcp": {
|
|
7175
7309
|
"exposed": false,
|
|
7176
|
-
"reason": "Returns a secret
|
|
7310
|
+
"reason": "Returns a secret. Secrets never enter an agent's conversation. The CLI writes them to a file instead."
|
|
7177
7311
|
},
|
|
7178
|
-
"description": "Runs an approved
|
|
7312
|
+
"description": "Runs an approved action that creates a secret, and returns the secret. The action runs only once. Only the personal access token that asked can redeem it. The CLI writes the secret to a file without printing it.",
|
|
7179
7313
|
"fields": [
|
|
7180
7314
|
{
|
|
7181
7315
|
"name": "requestId",
|
|
@@ -7183,6 +7317,7 @@ var OPERATIONS = [
|
|
|
7183
7317
|
"type": "string",
|
|
7184
7318
|
"required": true,
|
|
7185
7319
|
"description": "The request's id.",
|
|
7320
|
+
"example": "apr_7c2e\u2026",
|
|
7186
7321
|
"schema": {
|
|
7187
7322
|
"type": "string",
|
|
7188
7323
|
"description": "The request's id."
|
|
@@ -7191,6 +7326,7 @@ var OPERATIONS = [
|
|
|
7191
7326
|
],
|
|
7192
7327
|
"hasBody": false,
|
|
7193
7328
|
"workspace": true,
|
|
7329
|
+
"acceptsApiKey": false,
|
|
7194
7330
|
"scope": "workspace.approvals:write"
|
|
7195
7331
|
},
|
|
7196
7332
|
{
|
|
@@ -7212,7 +7348,7 @@ var OPERATIONS = [
|
|
|
7212
7348
|
"idempotentHint": true
|
|
7213
7349
|
}
|
|
7214
7350
|
},
|
|
7215
|
-
"description": "
|
|
7351
|
+
"description": "Lists the workspace's audit events, newest first. Paginate with the opaque `nextCursor` token. `limit` takes 1 to 100 and defaults to 25. `before` starts from a moment. `action` keeps one kind of event, and `actor` what one person, key or token did. With a personal access token, only workspace owners can call this, as with the audit page in the app. A workspace API key always can, because it acts as the workspace itself.",
|
|
7216
7352
|
"fields": [
|
|
7217
7353
|
{
|
|
7218
7354
|
"name": "limit",
|
|
@@ -7239,10 +7375,50 @@ var OPERATIONS = [
|
|
|
7239
7375
|
"type": "string",
|
|
7240
7376
|
"description": "Opaque token from a previous page's nextCursor."
|
|
7241
7377
|
}
|
|
7378
|
+
},
|
|
7379
|
+
{
|
|
7380
|
+
"name": "before",
|
|
7381
|
+
"in": "query",
|
|
7382
|
+
"type": "string",
|
|
7383
|
+
"required": false,
|
|
7384
|
+
"description": "Start from this moment: items older than it, newest first. Ignored with `cursor`, which already says where to go on.",
|
|
7385
|
+
"example": "2026-11-01T00:00:00.000Z",
|
|
7386
|
+
"schema": {
|
|
7387
|
+
"type": "string",
|
|
7388
|
+
"format": "date-time",
|
|
7389
|
+
"description": "Start from this moment: items older than it, newest first. Ignored with `cursor`, which already says where to go on."
|
|
7390
|
+
}
|
|
7391
|
+
},
|
|
7392
|
+
{
|
|
7393
|
+
"name": "action",
|
|
7394
|
+
"in": "query",
|
|
7395
|
+
"type": "string",
|
|
7396
|
+
"required": false,
|
|
7397
|
+
"description": "Only events of this action.",
|
|
7398
|
+
"example": "workspace.member_invited",
|
|
7399
|
+
"schema": {
|
|
7400
|
+
"type": "string",
|
|
7401
|
+
"maxLength": 100,
|
|
7402
|
+
"description": "Only events of this action."
|
|
7403
|
+
}
|
|
7404
|
+
},
|
|
7405
|
+
{
|
|
7406
|
+
"name": "actor",
|
|
7407
|
+
"in": "query",
|
|
7408
|
+
"type": "string",
|
|
7409
|
+
"required": false,
|
|
7410
|
+
"description": "Only what one person did (`user:` and the item's `actor.id`), or one key or token (`credential:` and the item's `credential.id`).",
|
|
7411
|
+
"example": "user:usr_k3TAiF2ZP5sQ",
|
|
7412
|
+
"schema": {
|
|
7413
|
+
"type": "string",
|
|
7414
|
+
"pattern": "^(user|credential):[\\w-]+$",
|
|
7415
|
+
"description": "Only what one person did (`user:` and the item's `actor.id`), or one key or token (`credential:` and the item's `credential.id`)."
|
|
7416
|
+
}
|
|
7242
7417
|
}
|
|
7243
7418
|
],
|
|
7244
7419
|
"hasBody": false,
|
|
7245
7420
|
"workspace": true,
|
|
7421
|
+
"acceptsApiKey": true,
|
|
7246
7422
|
"scope": "workspace.audit:read"
|
|
7247
7423
|
},
|
|
7248
7424
|
{
|
|
@@ -7264,10 +7440,11 @@ var OPERATIONS = [
|
|
|
7264
7440
|
"idempotentHint": true
|
|
7265
7441
|
}
|
|
7266
7442
|
},
|
|
7267
|
-
"description": "
|
|
7443
|
+
"description": "Lists every workspace event a webhook endpoint can subscribe to, and what each one means. Pass some as `eventTypes` when you add an endpoint. An endpoint without a list receives every event.",
|
|
7268
7444
|
"fields": [],
|
|
7269
7445
|
"hasBody": false,
|
|
7270
7446
|
"workspace": true,
|
|
7447
|
+
"acceptsApiKey": true,
|
|
7271
7448
|
"scope": "workspace.webhooks:read"
|
|
7272
7449
|
},
|
|
7273
7450
|
{
|
|
@@ -7289,10 +7466,11 @@ var OPERATIONS = [
|
|
|
7289
7466
|
"idempotentHint": true
|
|
7290
7467
|
}
|
|
7291
7468
|
},
|
|
7292
|
-
"description":
|
|
7469
|
+
"description": 'Returns the workspace the credential acts in. For an API key, that is the key\'s own workspace. For a personal access token, it is the one named in `X-Workspace`. Use it as a smoke test for an integration ("who am I?").',
|
|
7293
7470
|
"fields": [],
|
|
7294
7471
|
"hasBody": false,
|
|
7295
7472
|
"workspace": true,
|
|
7473
|
+
"acceptsApiKey": true,
|
|
7296
7474
|
"scope": "workspace:read"
|
|
7297
7475
|
},
|
|
7298
7476
|
{
|
|
@@ -7314,7 +7492,7 @@ var OPERATIONS = [
|
|
|
7314
7492
|
"idempotentHint": true
|
|
7315
7493
|
}
|
|
7316
7494
|
},
|
|
7317
|
-
"description": "
|
|
7495
|
+
"description": "Lists the invitations that are not yet accepted, declined or expired, newest first. With a personal credential, only owners and admins can call this, as in the app. A workspace API key always can. Paginate with the opaque `nextCursor`.",
|
|
7318
7496
|
"fields": [
|
|
7319
7497
|
{
|
|
7320
7498
|
"name": "limit",
|
|
@@ -7345,6 +7523,7 @@ var OPERATIONS = [
|
|
|
7345
7523
|
],
|
|
7346
7524
|
"hasBody": false,
|
|
7347
7525
|
"workspace": true,
|
|
7526
|
+
"acceptsApiKey": true,
|
|
7348
7527
|
"scope": "workspace.members:read"
|
|
7349
7528
|
},
|
|
7350
7529
|
{
|
|
@@ -7366,7 +7545,7 @@ var OPERATIONS = [
|
|
|
7366
7545
|
"idempotentHint": true
|
|
7367
7546
|
}
|
|
7368
7547
|
},
|
|
7369
|
-
"description": "
|
|
7548
|
+
"description": "Lists the workspace's members and their roles, newest first. Paginate with the opaque `nextCursor`. `limit` takes 1 to 100 and defaults to 25. Invite members, remove them and give them roles in the app.",
|
|
7370
7549
|
"fields": [
|
|
7371
7550
|
{
|
|
7372
7551
|
"name": "limit",
|
|
@@ -7397,6 +7576,7 @@ var OPERATIONS = [
|
|
|
7397
7576
|
],
|
|
7398
7577
|
"hasBody": false,
|
|
7399
7578
|
"workspace": true,
|
|
7579
|
+
"acceptsApiKey": true,
|
|
7400
7580
|
"scope": "workspace.members:read"
|
|
7401
7581
|
},
|
|
7402
7582
|
{
|
|
@@ -7418,7 +7598,7 @@ var OPERATIONS = [
|
|
|
7418
7598
|
"idempotentHint": true
|
|
7419
7599
|
}
|
|
7420
7600
|
},
|
|
7421
|
-
"description": "
|
|
7601
|
+
"description": "Lists the workspace's teams and their members' user ids, newest first. Paginate with the opaque `nextCursor`. `limit` takes 1 to 100 and defaults to 25. Create teams and add members to them in the app.",
|
|
7422
7602
|
"fields": [
|
|
7423
7603
|
{
|
|
7424
7604
|
"name": "limit",
|
|
@@ -7449,6 +7629,7 @@ var OPERATIONS = [
|
|
|
7449
7629
|
],
|
|
7450
7630
|
"hasBody": false,
|
|
7451
7631
|
"workspace": true,
|
|
7632
|
+
"acceptsApiKey": true,
|
|
7452
7633
|
"scope": "workspace.teams:read"
|
|
7453
7634
|
},
|
|
7454
7635
|
{
|
|
@@ -7470,10 +7651,11 @@ var OPERATIONS = [
|
|
|
7470
7651
|
"idempotentHint": true
|
|
7471
7652
|
}
|
|
7472
7653
|
},
|
|
7473
|
-
"description": "
|
|
7654
|
+
"description": "Returns what the workspace used this period, with one entry for each thing its plan counts. Each entry has the plan's limit, or null when there is no limit. A period is one month from the workspace's billing date. That date comes from its subscription or, without one, from the day you created the workspace. On an annual plan, the counts still reset every month from the subscription's start.",
|
|
7474
7655
|
"fields": [],
|
|
7475
7656
|
"hasBody": false,
|
|
7476
7657
|
"workspace": true,
|
|
7658
|
+
"acceptsApiKey": true,
|
|
7477
7659
|
"scope": "workspace:read"
|
|
7478
7660
|
},
|
|
7479
7661
|
{
|
|
@@ -7497,16 +7679,18 @@ var OPERATIONS = [
|
|
|
7497
7679
|
"idempotentHint": true
|
|
7498
7680
|
}
|
|
7499
7681
|
},
|
|
7500
|
-
"description": "
|
|
7682
|
+
"description": "Lists one endpoint's delivery history, newest first. Each entry shows the event's status, attempts and last HTTP status. Payloads aren't included. We keep the history for 30 days. Paginate with the opaque `nextCursor`. `before` starts from a moment, and `status` keeps one kind of delivery. With a personal access token, only workspace owners can call this. A workspace API key with this scope can.",
|
|
7501
7683
|
"fields": [
|
|
7502
7684
|
{
|
|
7503
7685
|
"name": "endpointId",
|
|
7504
7686
|
"in": "path",
|
|
7505
7687
|
"type": "string",
|
|
7506
7688
|
"required": true,
|
|
7689
|
+
"description": "The endpoint's ID.",
|
|
7507
7690
|
"example": "we_3f0c\u2026",
|
|
7508
7691
|
"schema": {
|
|
7509
|
-
"type": "string"
|
|
7692
|
+
"type": "string",
|
|
7693
|
+
"description": "The endpoint's ID."
|
|
7510
7694
|
}
|
|
7511
7695
|
},
|
|
7512
7696
|
{
|
|
@@ -7534,10 +7718,41 @@ var OPERATIONS = [
|
|
|
7534
7718
|
"type": "string",
|
|
7535
7719
|
"description": "Opaque token from a previous page's nextCursor."
|
|
7536
7720
|
}
|
|
7721
|
+
},
|
|
7722
|
+
{
|
|
7723
|
+
"name": "before",
|
|
7724
|
+
"in": "query",
|
|
7725
|
+
"type": "string",
|
|
7726
|
+
"required": false,
|
|
7727
|
+
"description": "Start from this moment: items older than it, newest first. Ignored with `cursor`, which already says where to go on.",
|
|
7728
|
+
"example": "2026-11-01T00:00:00.000Z",
|
|
7729
|
+
"schema": {
|
|
7730
|
+
"type": "string",
|
|
7731
|
+
"format": "date-time",
|
|
7732
|
+
"description": "Start from this moment: items older than it, newest first. Ignored with `cursor`, which already says where to go on."
|
|
7733
|
+
}
|
|
7734
|
+
},
|
|
7735
|
+
{
|
|
7736
|
+
"name": "status",
|
|
7737
|
+
"in": "query",
|
|
7738
|
+
"type": "string",
|
|
7739
|
+
"required": false,
|
|
7740
|
+
"description": "Only deliveries with this status.",
|
|
7741
|
+
"example": "failed",
|
|
7742
|
+
"schema": {
|
|
7743
|
+
"type": "string",
|
|
7744
|
+
"enum": [
|
|
7745
|
+
"pending",
|
|
7746
|
+
"delivered",
|
|
7747
|
+
"failed"
|
|
7748
|
+
],
|
|
7749
|
+
"description": "Only deliveries with this status."
|
|
7750
|
+
}
|
|
7537
7751
|
}
|
|
7538
7752
|
],
|
|
7539
7753
|
"hasBody": false,
|
|
7540
7754
|
"workspace": true,
|
|
7755
|
+
"acceptsApiKey": true,
|
|
7541
7756
|
"scope": "workspace.webhooks:read"
|
|
7542
7757
|
},
|
|
7543
7758
|
{
|
|
@@ -7562,16 +7777,18 @@ var OPERATIONS = [
|
|
|
7562
7777
|
"idempotentHint": false
|
|
7563
7778
|
}
|
|
7564
7779
|
},
|
|
7565
|
-
"description": "Sends a recorded delivery's event again, as a new delivery
|
|
7780
|
+
"description": "Sends a recorded delivery's event again, as a new delivery. The new delivery gets its own history entry. The event id stays the same, so receivers can deduplicate. Redelivery only works on an enabled endpoint. With a personal access token, only workspace owners can call this. A workspace API key with this scope can.",
|
|
7566
7781
|
"fields": [
|
|
7567
7782
|
{
|
|
7568
7783
|
"name": "endpointId",
|
|
7569
7784
|
"in": "path",
|
|
7570
7785
|
"type": "string",
|
|
7571
7786
|
"required": true,
|
|
7787
|
+
"description": "The endpoint's ID.",
|
|
7572
7788
|
"example": "we_3f0c\u2026",
|
|
7573
7789
|
"schema": {
|
|
7574
|
-
"type": "string"
|
|
7790
|
+
"type": "string",
|
|
7791
|
+
"description": "The endpoint's ID."
|
|
7575
7792
|
}
|
|
7576
7793
|
},
|
|
7577
7794
|
{
|
|
@@ -7579,14 +7796,17 @@ var OPERATIONS = [
|
|
|
7579
7796
|
"in": "path",
|
|
7580
7797
|
"type": "string",
|
|
7581
7798
|
"required": true,
|
|
7799
|
+
"description": "The delivery's ID.",
|
|
7582
7800
|
"example": "del_8a1b\u2026",
|
|
7583
7801
|
"schema": {
|
|
7584
|
-
"type": "string"
|
|
7802
|
+
"type": "string",
|
|
7803
|
+
"description": "The delivery's ID."
|
|
7585
7804
|
}
|
|
7586
7805
|
}
|
|
7587
7806
|
],
|
|
7588
7807
|
"hasBody": false,
|
|
7589
7808
|
"workspace": true,
|
|
7809
|
+
"acceptsApiKey": true,
|
|
7590
7810
|
"scope": "workspace.webhooks:write"
|
|
7591
7811
|
},
|
|
7592
7812
|
{
|
|
@@ -7601,22 +7821,22 @@ var OPERATIONS = [
|
|
|
7601
7821
|
},
|
|
7602
7822
|
"mcp": {
|
|
7603
7823
|
"exposed": false,
|
|
7604
|
-
"reason": "Changes where workspace data is sent. A person configures webhook endpoints (Settings \u2192
|
|
7824
|
+
"reason": "Changes where workspace data is sent. A person configures webhook endpoints (Settings \u2192 Developers in the app)."
|
|
7605
7825
|
},
|
|
7606
|
-
"description": "Registers an
|
|
7826
|
+
"description": "Registers an HTTPS URL to receive the workspace's events. Deliveries use the same signature format as Svix. The response includes the endpoint's signing secret (`whsec_\u2026`). You see it only once, so store it to verify deliveries. The API refuses private hosts and hosts without HTTPS. A workspace can have at most 10 endpoints. With a personal access token, only workspace owners can call this. A workspace API key with this scope can.",
|
|
7607
7827
|
"fields": [
|
|
7608
7828
|
{
|
|
7609
7829
|
"name": "url",
|
|
7610
7830
|
"in": "body",
|
|
7611
7831
|
"type": "string",
|
|
7612
7832
|
"required": true,
|
|
7613
|
-
"description": "The
|
|
7833
|
+
"description": "The HTTPS URL that receives the events.",
|
|
7614
7834
|
"example": "https://example.com/hooks",
|
|
7615
7835
|
"schema": {
|
|
7616
7836
|
"type": "string",
|
|
7617
7837
|
"minLength": 1,
|
|
7618
7838
|
"maxLength": 2048,
|
|
7619
|
-
"description": "The
|
|
7839
|
+
"description": "The HTTPS URL that receives the events."
|
|
7620
7840
|
}
|
|
7621
7841
|
},
|
|
7622
7842
|
{
|
|
@@ -7636,7 +7856,7 @@ var OPERATIONS = [
|
|
|
7636
7856
|
"in": "body",
|
|
7637
7857
|
"type": "json",
|
|
7638
7858
|
"required": false,
|
|
7639
|
-
"description": "
|
|
7859
|
+
"description": "Send only these event types, from event-types. Leave it out for every event.",
|
|
7640
7860
|
"example": [
|
|
7641
7861
|
"workspace.member.joined"
|
|
7642
7862
|
],
|
|
@@ -7646,12 +7866,13 @@ var OPERATIONS = [
|
|
|
7646
7866
|
"type": "string"
|
|
7647
7867
|
},
|
|
7648
7868
|
"maxItems": 100,
|
|
7649
|
-
"description": "
|
|
7869
|
+
"description": "Send only these event types, from event-types. Leave it out for every event."
|
|
7650
7870
|
}
|
|
7651
7871
|
}
|
|
7652
7872
|
],
|
|
7653
7873
|
"hasBody": true,
|
|
7654
7874
|
"workspace": true,
|
|
7875
|
+
"acceptsApiKey": true,
|
|
7655
7876
|
"scope": "workspace.webhooks:write"
|
|
7656
7877
|
},
|
|
7657
7878
|
{
|
|
@@ -7668,23 +7889,26 @@ var OPERATIONS = [
|
|
|
7668
7889
|
},
|
|
7669
7890
|
"mcp": {
|
|
7670
7891
|
"exposed": false,
|
|
7671
|
-
"reason": "Changes where workspace data is sent. A person configures webhook endpoints (Settings \u2192
|
|
7892
|
+
"reason": "Changes where workspace data is sent. A person configures webhook endpoints (Settings \u2192 Developers in the app)."
|
|
7672
7893
|
},
|
|
7673
|
-
"description": "
|
|
7894
|
+
"description": "Deletes the endpoint and its signing secret. All deliveries to the endpoint stop. Its delivery history goes with it. With a personal access token, only workspace owners can call this. A workspace API key with this scope can.",
|
|
7674
7895
|
"fields": [
|
|
7675
7896
|
{
|
|
7676
7897
|
"name": "endpointId",
|
|
7677
7898
|
"in": "path",
|
|
7678
7899
|
"type": "string",
|
|
7679
7900
|
"required": true,
|
|
7901
|
+
"description": "The endpoint's ID.",
|
|
7680
7902
|
"example": "we_3f0c\u2026",
|
|
7681
7903
|
"schema": {
|
|
7682
|
-
"type": "string"
|
|
7904
|
+
"type": "string",
|
|
7905
|
+
"description": "The endpoint's ID."
|
|
7683
7906
|
}
|
|
7684
7907
|
}
|
|
7685
7908
|
],
|
|
7686
7909
|
"hasBody": false,
|
|
7687
7910
|
"workspace": true,
|
|
7911
|
+
"acceptsApiKey": true,
|
|
7688
7912
|
"scope": "workspace.webhooks:write"
|
|
7689
7913
|
},
|
|
7690
7914
|
{
|
|
@@ -7701,23 +7925,26 @@ var OPERATIONS = [
|
|
|
7701
7925
|
},
|
|
7702
7926
|
"mcp": {
|
|
7703
7927
|
"exposed": false,
|
|
7704
|
-
"reason": "Changes where workspace data is sent. A person configures webhook endpoints (Settings \u2192
|
|
7928
|
+
"reason": "Changes where workspace data is sent. A person configures webhook endpoints (Settings \u2192 Developers in the app)."
|
|
7705
7929
|
},
|
|
7706
|
-
"description": "Resumes deliveries to an endpoint that
|
|
7930
|
+
"description": "Resumes deliveries to an endpoint that stopped after repeated failures. The endpoint keeps its signing secret. Its failure count resets. With a personal access token, only workspace owners can call this. A workspace API key with this scope can.",
|
|
7707
7931
|
"fields": [
|
|
7708
7932
|
{
|
|
7709
7933
|
"name": "endpointId",
|
|
7710
7934
|
"in": "path",
|
|
7711
7935
|
"type": "string",
|
|
7712
7936
|
"required": true,
|
|
7937
|
+
"description": "The endpoint's ID.",
|
|
7713
7938
|
"example": "we_3f0c\u2026",
|
|
7714
7939
|
"schema": {
|
|
7715
|
-
"type": "string"
|
|
7940
|
+
"type": "string",
|
|
7941
|
+
"description": "The endpoint's ID."
|
|
7716
7942
|
}
|
|
7717
7943
|
}
|
|
7718
7944
|
],
|
|
7719
7945
|
"hasBody": false,
|
|
7720
7946
|
"workspace": true,
|
|
7947
|
+
"acceptsApiKey": true,
|
|
7721
7948
|
"scope": "workspace.webhooks:write"
|
|
7722
7949
|
},
|
|
7723
7950
|
{
|
|
@@ -7741,21 +7968,24 @@ var OPERATIONS = [
|
|
|
7741
7968
|
"idempotentHint": true
|
|
7742
7969
|
}
|
|
7743
7970
|
},
|
|
7744
|
-
"description": "
|
|
7971
|
+
"description": "Returns one endpoint without its signing secret. It shows whether the endpoint is on, its consecutive failures and its last delivery status. With a personal access token, only workspace owners can call this. A workspace API key with this scope can.",
|
|
7745
7972
|
"fields": [
|
|
7746
7973
|
{
|
|
7747
7974
|
"name": "endpointId",
|
|
7748
7975
|
"in": "path",
|
|
7749
7976
|
"type": "string",
|
|
7750
7977
|
"required": true,
|
|
7978
|
+
"description": "The endpoint's ID.",
|
|
7751
7979
|
"example": "we_3f0c\u2026",
|
|
7752
7980
|
"schema": {
|
|
7753
|
-
"type": "string"
|
|
7981
|
+
"type": "string",
|
|
7982
|
+
"description": "The endpoint's ID."
|
|
7754
7983
|
}
|
|
7755
7984
|
}
|
|
7756
7985
|
],
|
|
7757
7986
|
"hasBody": false,
|
|
7758
7987
|
"workspace": true,
|
|
7988
|
+
"acceptsApiKey": true,
|
|
7759
7989
|
"scope": "workspace.webhooks:read"
|
|
7760
7990
|
},
|
|
7761
7991
|
{
|
|
@@ -7777,10 +8007,11 @@ var OPERATIONS = [
|
|
|
7777
8007
|
"idempotentHint": true
|
|
7778
8008
|
}
|
|
7779
8009
|
},
|
|
7780
|
-
"description": "
|
|
8010
|
+
"description": "Lists the workspace's outgoing webhook endpoints, newest first. The list leaves out their signing secrets. A workspace has at most 10 endpoints, so the list is a single page. Its `nextCursor` is null. With a personal access token, only workspace owners can call this. A workspace API key with this scope can.",
|
|
7781
8011
|
"fields": [],
|
|
7782
8012
|
"hasBody": false,
|
|
7783
8013
|
"workspace": true,
|
|
8014
|
+
"acceptsApiKey": true,
|
|
7784
8015
|
"scope": "workspace.webhooks:read"
|
|
7785
8016
|
},
|
|
7786
8017
|
{
|
|
@@ -7804,21 +8035,24 @@ var OPERATIONS = [
|
|
|
7804
8035
|
"idempotentHint": false
|
|
7805
8036
|
}
|
|
7806
8037
|
},
|
|
7807
|
-
"description": "Sends a `ping` event to the endpoint, signed like every delivery
|
|
8038
|
+
"description": "Sends a `ping` event to the endpoint, signed like every delivery. Use it to check that an integration verifies and accepts deliveries. With a personal access token, only workspace owners can call this. A workspace API key with this scope can.",
|
|
7808
8039
|
"fields": [
|
|
7809
8040
|
{
|
|
7810
8041
|
"name": "endpointId",
|
|
7811
8042
|
"in": "path",
|
|
7812
8043
|
"type": "string",
|
|
7813
8044
|
"required": true,
|
|
8045
|
+
"description": "The endpoint's ID.",
|
|
7814
8046
|
"example": "we_3f0c\u2026",
|
|
7815
8047
|
"schema": {
|
|
7816
|
-
"type": "string"
|
|
8048
|
+
"type": "string",
|
|
8049
|
+
"description": "The endpoint's ID."
|
|
7817
8050
|
}
|
|
7818
8051
|
}
|
|
7819
8052
|
],
|
|
7820
8053
|
"hasBody": false,
|
|
7821
8054
|
"workspace": true,
|
|
8055
|
+
"acceptsApiKey": true,
|
|
7822
8056
|
"scope": "workspace.webhooks:write"
|
|
7823
8057
|
},
|
|
7824
8058
|
{
|
|
@@ -7835,18 +8069,20 @@ var OPERATIONS = [
|
|
|
7835
8069
|
},
|
|
7836
8070
|
"mcp": {
|
|
7837
8071
|
"exposed": false,
|
|
7838
|
-
"reason": "Changes where workspace data is sent. A person configures webhook endpoints (Settings \u2192
|
|
8072
|
+
"reason": "Changes where workspace data is sent. A person configures webhook endpoints (Settings \u2192 Developers in the app)."
|
|
7839
8073
|
},
|
|
7840
|
-
"description": "Changes an endpoint's URL, description or event types in place
|
|
8074
|
+
"description": "Changes an endpoint's URL, description or event types in place. Only the fields you send change. The endpoint keeps its signing secret, so receivers keep verifying deliveries. A new URL must pass the same checks as on create. It must use HTTPS and can't be a private host. With a personal access token, only workspace owners can call this. A workspace API key with this scope can.",
|
|
7841
8075
|
"fields": [
|
|
7842
8076
|
{
|
|
7843
8077
|
"name": "endpointId",
|
|
7844
8078
|
"in": "path",
|
|
7845
8079
|
"type": "string",
|
|
7846
8080
|
"required": true,
|
|
8081
|
+
"description": "The endpoint's ID.",
|
|
7847
8082
|
"example": "we_3f0c\u2026",
|
|
7848
8083
|
"schema": {
|
|
7849
|
-
"type": "string"
|
|
8084
|
+
"type": "string",
|
|
8085
|
+
"description": "The endpoint's ID."
|
|
7850
8086
|
}
|
|
7851
8087
|
},
|
|
7852
8088
|
{
|
|
@@ -7854,13 +8090,13 @@ var OPERATIONS = [
|
|
|
7854
8090
|
"in": "body",
|
|
7855
8091
|
"type": "string",
|
|
7856
8092
|
"required": false,
|
|
7857
|
-
"description": "The
|
|
8093
|
+
"description": "The HTTPS URL that receives the events.",
|
|
7858
8094
|
"example": "https://example.com/hooks",
|
|
7859
8095
|
"schema": {
|
|
7860
8096
|
"type": "string",
|
|
7861
8097
|
"minLength": 1,
|
|
7862
8098
|
"maxLength": 2048,
|
|
7863
|
-
"description": "The
|
|
8099
|
+
"description": "The HTTPS URL that receives the events."
|
|
7864
8100
|
}
|
|
7865
8101
|
},
|
|
7866
8102
|
{
|
|
@@ -7868,14 +8104,14 @@ var OPERATIONS = [
|
|
|
7868
8104
|
"in": "body",
|
|
7869
8105
|
"type": "string",
|
|
7870
8106
|
"required": false,
|
|
7871
|
-
"description": "A note for people managing the endpoint
|
|
8107
|
+
"description": "A note for people managing the endpoint. Null clears it.",
|
|
7872
8108
|
"schema": {
|
|
7873
8109
|
"type": [
|
|
7874
8110
|
"string",
|
|
7875
8111
|
"null"
|
|
7876
8112
|
],
|
|
7877
8113
|
"maxLength": 200,
|
|
7878
|
-
"description": "A note for people managing the endpoint
|
|
8114
|
+
"description": "A note for people managing the endpoint. Null clears it."
|
|
7879
8115
|
}
|
|
7880
8116
|
},
|
|
7881
8117
|
{
|
|
@@ -7883,7 +8119,7 @@ var OPERATIONS = [
|
|
|
7883
8119
|
"in": "body",
|
|
7884
8120
|
"type": "json",
|
|
7885
8121
|
"required": false,
|
|
7886
|
-
"description": "
|
|
8122
|
+
"description": "Send only these event types, from event-types. Null or an empty list means every event.",
|
|
7887
8123
|
"example": [
|
|
7888
8124
|
"workspace.member.joined"
|
|
7889
8125
|
],
|
|
@@ -7896,12 +8132,13 @@ var OPERATIONS = [
|
|
|
7896
8132
|
"type": "string"
|
|
7897
8133
|
},
|
|
7898
8134
|
"maxItems": 100,
|
|
7899
|
-
"description": "
|
|
8135
|
+
"description": "Send only these event types, from event-types. Null or an empty list means every event."
|
|
7900
8136
|
}
|
|
7901
8137
|
}
|
|
7902
8138
|
],
|
|
7903
8139
|
"hasBody": true,
|
|
7904
8140
|
"workspace": true,
|
|
8141
|
+
"acceptsApiKey": true,
|
|
7905
8142
|
"scope": "workspace.webhooks:write"
|
|
7906
8143
|
}
|
|
7907
8144
|
];
|
|
@@ -7986,14 +8223,15 @@ ${op.description}`);
|
|
|
7986
8223
|
if (op.workspace) {
|
|
7987
8224
|
command.option("--workspace <slug>", "act in this workspace for one call");
|
|
7988
8225
|
}
|
|
7989
|
-
if (op.cli.confirm)
|
|
8226
|
+
if (op.cli.confirm)
|
|
8227
|
+
command.option("--yes", "confirm an operation that cannot be undone");
|
|
7990
8228
|
command.option("--json", "machine-readable output");
|
|
7991
8229
|
command.action(async (...input) => {
|
|
7992
8230
|
const values = input.slice(0, op.cli.args.length);
|
|
7993
8231
|
const options = input[op.cli.args.length];
|
|
7994
8232
|
if (op.cli.confirm && !options.yes) {
|
|
7995
8233
|
throw new Error(
|
|
7996
|
-
`${op.summary} cannot be undone
|
|
8234
|
+
`${op.summary} cannot be undone. Run it again with --yes to confirm.`
|
|
7997
8235
|
);
|
|
7998
8236
|
}
|
|
7999
8237
|
const args = Object.fromEntries(
|
|
@@ -8196,6 +8434,9 @@ Shortcut: \`${brand.name} sync\`, the same command.`
|
|
|
8196
8434
|
};
|
|
8197
8435
|
function syncCommand(command, ctx, description, more) {
|
|
8198
8436
|
command.description(description).argument("[file]", "the file to read", "limitry.json").option("--preview", "show what would change, and change nothing").option("--limits <json>", "the limits as a JSON array, instead of a file").option(
|
|
8437
|
+
"--data <json>",
|
|
8438
|
+
"the whole JSON body, as every command takes, instead of a file"
|
|
8439
|
+
).option(
|
|
8199
8440
|
"--archive-missing",
|
|
8200
8441
|
"archive active limits the file doesn't name (restorable)"
|
|
8201
8442
|
).option("--workspace <slug>", "act in this workspace for one call").option("--json", "machine-readable output").addHelpText(
|
|
@@ -8203,12 +8444,13 @@ function syncCommand(command, ctx, description, more) {
|
|
|
8203
8444
|
'\nThe file: { "limits": [ { "name": "AI budget", "subject": { "kind": "user" }, "action": "ai-call", "amount": 200, "unit": "cents", "window": "month" } ] }\nEach limit is described whole: a field left out is its default, as on `limits create`. Names are the key.\nWhat a limit counts (subject, action, unit, window, every, start, rolling) is fixed: to change it, give the entry a new name.' + more
|
|
8204
8445
|
).action(
|
|
8205
8446
|
async (file, options) => {
|
|
8206
|
-
const
|
|
8447
|
+
const data = options.data === void 0 ? {} : parseData(options.data);
|
|
8448
|
+
const limits = options.limits !== void 0 ? parseLimits(options.limits, "--limits") : data.limits !== void 0 ? limitsIn(data.limits) : readLimitsFile(file);
|
|
8207
8449
|
const result = await ctx.client({ workspace: options.workspace }).limits.sync(
|
|
8208
8450
|
{
|
|
8209
8451
|
limits,
|
|
8210
|
-
archiveMissing: options.archiveMissing ??
|
|
8211
|
-
preview: options.preview ??
|
|
8452
|
+
archiveMissing: options.archiveMissing ?? data.archiveMissing === true,
|
|
8453
|
+
preview: options.preview ?? data.preview === true
|
|
8212
8454
|
},
|
|
8213
8455
|
{ idempotencyKey: crypto.randomUUID() }
|
|
8214
8456
|
);
|
|
@@ -8256,6 +8498,24 @@ function parseLimits(text, flag2) {
|
|
|
8256
8498
|
}
|
|
8257
8499
|
return parsed;
|
|
8258
8500
|
}
|
|
8501
|
+
function parseData(text) {
|
|
8502
|
+
let parsed;
|
|
8503
|
+
try {
|
|
8504
|
+
parsed = JSON.parse(text);
|
|
8505
|
+
} catch (error) {
|
|
8506
|
+
throw new Error("--data must be a JSON object", { cause: error });
|
|
8507
|
+
}
|
|
8508
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
8509
|
+
throw new Error("--data must be a JSON object");
|
|
8510
|
+
}
|
|
8511
|
+
return parsed;
|
|
8512
|
+
}
|
|
8513
|
+
function limitsIn(value) {
|
|
8514
|
+
if (!Array.isArray(value)) {
|
|
8515
|
+
throw new Error("--data's limits must be a JSON array of limits");
|
|
8516
|
+
}
|
|
8517
|
+
return value;
|
|
8518
|
+
}
|
|
8259
8519
|
var show = (value) => typeof value === "string" ? value : JSON.stringify(value);
|
|
8260
8520
|
function summary(result) {
|
|
8261
8521
|
const dry = result.preview;
|
|
@@ -8299,7 +8559,7 @@ function tokenEnvVar() {
|
|
|
8299
8559
|
function build(io) {
|
|
8300
8560
|
let actedIn = null;
|
|
8301
8561
|
let sending;
|
|
8302
|
-
const program2 = new Command().name(brand.name).description(
|
|
8562
|
+
const program2 = new Command().name(brand.name).description(`The ${brand.productName} CLI`).version("1.0.0-rc.13").addHelpText(
|
|
8303
8563
|
"after",
|
|
8304
8564
|
`
|
|
8305
8565
|
Token: \`${brand.name} login\` stores it in ~/.config/${brand.name}/; ${tokenEnvVar()} overrides.
|
|
@@ -8323,7 +8583,7 @@ Environment: --environment, else ${environmentEnvVar()}, else \`${brand.name} en
|
|
|
8323
8583
|
const settings = ctx.settings();
|
|
8324
8584
|
if (!settings.token) {
|
|
8325
8585
|
throw new Error(
|
|
8326
|
-
`not logged in
|
|
8586
|
+
`not logged in. Run \`${brand.name} login\` or set ${tokenEnvVar()}.`
|
|
8327
8587
|
);
|
|
8328
8588
|
}
|
|
8329
8589
|
if (!settings.token.startsWith("pat_")) {
|
|
@@ -8342,7 +8602,7 @@ Environment: --environment, else ${environmentEnvVar()}, else \`${brand.name} en
|
|
|
8342
8602
|
const workspace2 = options.workspace === false ? void 0 : options.workspace ?? settings.workspace;
|
|
8343
8603
|
if (options.workspace !== false && !workspace2) {
|
|
8344
8604
|
throw new Error(
|
|
8345
|
-
`no workspace selected
|
|
8605
|
+
`no workspace selected. Run \`${brand.name} workspace use <slug>\` or pass --workspace <slug>.`
|
|
8346
8606
|
);
|
|
8347
8607
|
}
|
|
8348
8608
|
return {
|