@madewithremy/admin 0.1.63 → 0.1.64
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 +15 -0
- package/dist/http.d.ts +1 -1
- package/dist/index.js +79 -65
- package/dist/index.js.map +2 -2
- package/dist/ops/dataSources.d.ts +15 -7
- package/dist/ops/domains.d.ts +4 -2
- package/dist/ops/infra.d.ts +29 -21
- package/dist/ops/issues.d.ts +3 -1
- package/dist/ops/releases.d.ts +4 -2
- package/dist/output.d.ts +1 -1
- package/dist/parseJsonConfig.d.ts +1 -1
- package/dist/poll.d.ts +1 -1
- package/dist/prod.js +472 -407
- package/dist/types/infra.d.ts +60 -16
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,21 @@ What changed in `@madewithremy/admin`, newest first, each version under its own
|
|
|
4
4
|
|
|
5
5
|
Versions before 0.1.44 aren't recorded here.
|
|
6
6
|
|
|
7
|
+
## 0.1.64
|
|
8
|
+
|
|
9
|
+
### New
|
|
10
|
+
|
|
11
|
+
- `infra` leases a second kind, `database`: a database server of the app's own for databases past the shared pool's limit (`database.xs`, `database.small`, `database.medium`, `database.large` in `infra list`, from 10 to 100 GB per database). It takes the app's live databases as it becomes active, and its queries are routed there with nothing in the app changing. `infra --help` says how it backs up, parks and resizes.
|
|
12
|
+
- `infra get` carries `databases` for a database server: each database's size against its limit, whether it has writes its hourly backup hasn't had, and its last backup.
|
|
13
|
+
- `infra provision` refuses a second database server for an app that has one not yet destroyed, with `database_server_exists` (422). Resize the one it has instead.
|
|
14
|
+
- `infra destroy` refuses a database server while a database on it is too large for the shared pool to take back, with `resource_holds_large_databases` (422). The check reads each database's file and its backup: delete rows, compact with `VACUUM`, and destroy after the next hourly backup.
|
|
15
|
+
|
|
16
|
+
### Changed behavior
|
|
17
|
+
|
|
18
|
+
- Seven SDK methods have names that say what they do: `dataSources.rm` is `deleteDocument`, `rmWhere` is `deleteDocumentsWhere`, `rmWhereAll` is `deleteAllDocumentsWhere` and `drop` is `dropPipelineVersion`; `issues.filed` is `listFiled`, `domains.owned` is `listOwned` and `releases.byCommit` is `getByCommit`. The old names still work, marked deprecated, and will go in a later release. Check for: a script that calls one of the old names, to move it to the new one.
|
|
19
|
+
- An offering's and a resource's `kind` can be `database`, and an offering's `capacity` is then `{ maxDatabaseGiB, vcpu, memoryGiB }` rather than retrieval's disk, memory and chunks. A resource's `footprint` is null for a database server. Check for: a script that reads `capacity.chunksByDimensions` or `footprint` without checking `kind`.
|
|
20
|
+
- A hibernated resource's price is zero, as it already was; the help no longer says billing drops to a retained-storage rate.
|
|
21
|
+
|
|
7
22
|
## 0.1.63
|
|
8
23
|
|
|
9
24
|
### New
|
package/dist/http.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export declare function isTransientError(err: unknown): boolean;
|
|
|
26
26
|
/** The raw Lighthouse report is a large artifact pulled from object storage. */
|
|
27
27
|
export declare const REPORT_TIMEOUT_MS = 60000;
|
|
28
28
|
/** Percent-encode one URL path segment. */
|
|
29
|
-
export declare function
|
|
29
|
+
export declare function encodePathSegment(value: string | number): string;
|
|
30
30
|
/**
|
|
31
31
|
* Query string ('' or '?a=1&b=2') from a params object; undefined/null values
|
|
32
32
|
* are skipped. The ops-side counterpart of the CLI's Args.query().
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var SIDECAR_URL = process.env["REMY_SIDECAR_URL"] || "http://127.0.0.1:4388";
|
|
|
14
14
|
|
|
15
15
|
// src/parseJsonConfig.ts
|
|
16
16
|
import JSON5 from "json5";
|
|
17
|
-
function
|
|
17
|
+
function errorMessage(err) {
|
|
18
18
|
return err instanceof Error ? err.message : String(err);
|
|
19
19
|
}
|
|
20
20
|
function parseJsonConfig(raw) {
|
|
@@ -22,7 +22,7 @@ function parseJsonConfig(raw) {
|
|
|
22
22
|
try {
|
|
23
23
|
return { ok: true, value: JSON.parse(raw), repaired: false };
|
|
24
24
|
} catch (err) {
|
|
25
|
-
strictError =
|
|
25
|
+
strictError = errorMessage(err);
|
|
26
26
|
}
|
|
27
27
|
try {
|
|
28
28
|
return {
|
|
@@ -32,7 +32,7 @@ function parseJsonConfig(raw) {
|
|
|
32
32
|
error: strictError
|
|
33
33
|
};
|
|
34
34
|
} catch (err) {
|
|
35
|
-
return { ok: false, error:
|
|
35
|
+
return { ok: false, error: errorMessage(err), notFound: false };
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -94,7 +94,7 @@ function isTransientError(err) {
|
|
|
94
94
|
return err instanceof TypeError;
|
|
95
95
|
}
|
|
96
96
|
var REPORT_TIMEOUT_MS = 6e4;
|
|
97
|
-
function
|
|
97
|
+
function encodePathSegment(value) {
|
|
98
98
|
return encodeURIComponent(String(value));
|
|
99
99
|
}
|
|
100
100
|
function qs(params) {
|
|
@@ -229,7 +229,7 @@ function threadsGet(ctx, threadId) {
|
|
|
229
229
|
return call(
|
|
230
230
|
ctx,
|
|
231
231
|
"GET",
|
|
232
|
-
`/_internal/v2/apps/${ctx.appId}/agent-threads/${
|
|
232
|
+
`/_internal/v2/apps/${ctx.appId}/agent-threads/${encodePathSegment(threadId)}`
|
|
233
233
|
);
|
|
234
234
|
}
|
|
235
235
|
|
|
@@ -250,7 +250,7 @@ function get(ctx, traceId) {
|
|
|
250
250
|
return call(
|
|
251
251
|
ctx,
|
|
252
252
|
"GET",
|
|
253
|
-
`/_internal/v2/apps/${ctx.appId}/task-traces/${
|
|
253
|
+
`/_internal/v2/apps/${ctx.appId}/task-traces/${encodePathSegment(traceId)}`
|
|
254
254
|
);
|
|
255
255
|
}
|
|
256
256
|
|
|
@@ -332,7 +332,7 @@ function crawlers(ctx, params) {
|
|
|
332
332
|
return call(
|
|
333
333
|
ctx,
|
|
334
334
|
"GET",
|
|
335
|
-
`/_internal/v2/apps/${ctx.appId}/insights/crawlers/${
|
|
335
|
+
`/_internal/v2/apps/${ctx.appId}/insights/crawlers/${encodePathSegment(kind)}${qs(rest)}`
|
|
336
336
|
);
|
|
337
337
|
}
|
|
338
338
|
|
|
@@ -413,14 +413,14 @@ function occurrences(ctx, fingerprint, params = {}) {
|
|
|
413
413
|
return call(
|
|
414
414
|
ctx,
|
|
415
415
|
"GET",
|
|
416
|
-
`/_internal/v2/apps/${ctx.appId}/frontend-errors/${
|
|
416
|
+
`/_internal/v2/apps/${ctx.appId}/frontend-errors/${encodePathSegment(fingerprint)}/events${qs(params)}`
|
|
417
417
|
);
|
|
418
418
|
}
|
|
419
419
|
function get2(ctx, eventId) {
|
|
420
420
|
return call(
|
|
421
421
|
ctx,
|
|
422
422
|
"GET",
|
|
423
|
-
`/_internal/v2/apps/${ctx.appId}/frontend-errors/events/${
|
|
423
|
+
`/_internal/v2/apps/${ctx.appId}/frontend-errors/events/${encodePathSegment(eventId)}`
|
|
424
424
|
);
|
|
425
425
|
}
|
|
426
426
|
function stats(ctx, params = {}) {
|
|
@@ -448,7 +448,7 @@ function run(ctx, route) {
|
|
|
448
448
|
return call(
|
|
449
449
|
ctx,
|
|
450
450
|
"POST",
|
|
451
|
-
`/_internal/v2/apps/${ctx.appId}/cron/${
|
|
451
|
+
`/_internal/v2/apps/${ctx.appId}/cron/${encodePathSegment(route)}/run`
|
|
452
452
|
);
|
|
453
453
|
}
|
|
454
454
|
|
|
@@ -508,10 +508,14 @@ __export(dataSources_exports, {
|
|
|
508
508
|
configSet: () => configSet,
|
|
509
509
|
count: () => count,
|
|
510
510
|
create: () => create,
|
|
511
|
+
deleteAllDocumentsWhere: () => deleteAllDocumentsWhere,
|
|
512
|
+
deleteDocument: () => deleteDocument,
|
|
513
|
+
deleteDocumentsWhere: () => deleteDocumentsWhere,
|
|
511
514
|
deleteSource: () => deleteSource,
|
|
512
515
|
dictionary: () => dictionary,
|
|
513
516
|
documents: () => documents,
|
|
514
517
|
drop: () => drop,
|
|
518
|
+
dropPipelineVersion: () => dropPipelineVersion,
|
|
515
519
|
entities: () => entities,
|
|
516
520
|
link: () => link,
|
|
517
521
|
list: () => list5,
|
|
@@ -584,7 +588,7 @@ async function pollUntil(read, isSettled, options) {
|
|
|
584
588
|
function elapsedSeconds(start2) {
|
|
585
589
|
return Math.round((Date.now() - start2) / 1e3);
|
|
586
590
|
}
|
|
587
|
-
function
|
|
591
|
+
function timeoutMessage(timeoutMs, still) {
|
|
588
592
|
return `Timed out after ${Math.round(timeoutMs / 1e3)}s ${still}`;
|
|
589
593
|
}
|
|
590
594
|
|
|
@@ -741,7 +745,7 @@ async function waitForIngest(ctx, params) {
|
|
|
741
745
|
return {
|
|
742
746
|
status: "timeout",
|
|
743
747
|
documents: tracked.map(summarize),
|
|
744
|
-
error:
|
|
748
|
+
error: timeoutMessage(
|
|
745
749
|
timeoutMs,
|
|
746
750
|
`with ${pendingOf(tracked).length} document(s) still processing`
|
|
747
751
|
)
|
|
@@ -785,7 +789,7 @@ async function waitForCandidate(ctx, params) {
|
|
|
785
789
|
status: "timeout",
|
|
786
790
|
counts,
|
|
787
791
|
documents: failed,
|
|
788
|
-
error:
|
|
792
|
+
error: timeoutMessage(
|
|
789
793
|
timeoutMs,
|
|
790
794
|
`with ${counts?.processing ?? 0} document(s) still building`
|
|
791
795
|
)
|
|
@@ -984,7 +988,7 @@ async function waitForMove(ctx, params) {
|
|
|
984
988
|
return {
|
|
985
989
|
status: "timeout",
|
|
986
990
|
source,
|
|
987
|
-
error:
|
|
991
|
+
error: timeoutMessage(
|
|
988
992
|
timeoutMs,
|
|
989
993
|
`with ${migration.copied}/${migration.total} documents copied`
|
|
990
994
|
)
|
|
@@ -1018,7 +1022,7 @@ function promote(ctx, params) {
|
|
|
1018
1022
|
}
|
|
1019
1023
|
);
|
|
1020
1024
|
}
|
|
1021
|
-
function
|
|
1025
|
+
function dropPipelineVersion(ctx, params) {
|
|
1022
1026
|
return call(
|
|
1023
1027
|
ctx,
|
|
1024
1028
|
"POST",
|
|
@@ -1029,7 +1033,7 @@ function drop(ctx, params) {
|
|
|
1029
1033
|
}
|
|
1030
1034
|
);
|
|
1031
1035
|
}
|
|
1032
|
-
function
|
|
1036
|
+
function deleteDocument(ctx, params) {
|
|
1033
1037
|
return call(
|
|
1034
1038
|
ctx,
|
|
1035
1039
|
"POST",
|
|
@@ -1040,7 +1044,7 @@ function rm(ctx, params) {
|
|
|
1040
1044
|
}
|
|
1041
1045
|
);
|
|
1042
1046
|
}
|
|
1043
|
-
function
|
|
1047
|
+
function deleteDocumentsWhere(ctx, params) {
|
|
1044
1048
|
return call(
|
|
1045
1049
|
ctx,
|
|
1046
1050
|
"POST",
|
|
@@ -1048,10 +1052,10 @@ function rmWhere(ctx, params) {
|
|
|
1048
1052
|
{ slug: params.slug, filter: params.filter }
|
|
1049
1053
|
);
|
|
1050
1054
|
}
|
|
1051
|
-
async function
|
|
1055
|
+
async function deleteAllDocumentsWhere(ctx, params) {
|
|
1052
1056
|
let deleted = 0;
|
|
1053
1057
|
while (true) {
|
|
1054
|
-
const page = await
|
|
1058
|
+
const page = await deleteDocumentsWhere(ctx, params);
|
|
1055
1059
|
deleted += page.deleted;
|
|
1056
1060
|
if (page.remaining === 0 || page.deleted === 0) {
|
|
1057
1061
|
return { deleted };
|
|
@@ -1130,6 +1134,10 @@ function link(ctx, params) {
|
|
|
1130
1134
|
text: params.text
|
|
1131
1135
|
});
|
|
1132
1136
|
}
|
|
1137
|
+
var rm = deleteDocument;
|
|
1138
|
+
var rmWhere = deleteDocumentsWhere;
|
|
1139
|
+
var rmWhereAll = deleteAllDocumentsWhere;
|
|
1140
|
+
var drop = dropPipelineVersion;
|
|
1133
1141
|
|
|
1134
1142
|
// src/ops/dataSourceJobs.ts
|
|
1135
1143
|
var dataSourceJobs_exports = {};
|
|
@@ -1263,7 +1271,7 @@ async function settle(ctx, params, isSettled) {
|
|
|
1263
1271
|
return {
|
|
1264
1272
|
status: "timeout",
|
|
1265
1273
|
job,
|
|
1266
|
-
error:
|
|
1274
|
+
error: timeoutMessage(timeoutMs, `; job is still ${job.state}`)
|
|
1267
1275
|
};
|
|
1268
1276
|
}
|
|
1269
1277
|
if (job.state === "failed" || job.state === "cancelled") {
|
|
@@ -1437,7 +1445,7 @@ async function waitForHydration(ctx, params) {
|
|
|
1437
1445
|
return {
|
|
1438
1446
|
status: "timeout",
|
|
1439
1447
|
source,
|
|
1440
|
-
error:
|
|
1448
|
+
error: timeoutMessage(
|
|
1441
1449
|
timeoutMs,
|
|
1442
1450
|
`with ${hydration.copied}/${hydration.total} documents loaded`
|
|
1443
1451
|
)
|
|
@@ -1574,7 +1582,7 @@ async function waitForRun(ctx, params) {
|
|
|
1574
1582
|
return {
|
|
1575
1583
|
status: "timeout",
|
|
1576
1584
|
run: run3,
|
|
1577
|
-
error:
|
|
1585
|
+
error: timeoutMessage(
|
|
1578
1586
|
timeoutMs,
|
|
1579
1587
|
`; run is ${run3.state} (${run3.completed}/${run3.total})`
|
|
1580
1588
|
)
|
|
@@ -1602,7 +1610,7 @@ async function waitForSet(ctx, params) {
|
|
|
1602
1610
|
return {
|
|
1603
1611
|
status: "timeout",
|
|
1604
1612
|
set: set3,
|
|
1605
|
-
error:
|
|
1613
|
+
error: timeoutMessage(timeoutMs, `; set is still ${set3.state}`)
|
|
1606
1614
|
};
|
|
1607
1615
|
}
|
|
1608
1616
|
if (set3.state === "failed") {
|
|
@@ -1765,6 +1773,7 @@ __export(releases_exports, {
|
|
|
1765
1773
|
byCommit: () => byCommit,
|
|
1766
1774
|
dashboardLive: () => dashboardLive,
|
|
1767
1775
|
get: () => get5,
|
|
1776
|
+
getByCommit: () => getByCommit,
|
|
1768
1777
|
list: () => list7,
|
|
1769
1778
|
primaryUrl: () => primaryUrl,
|
|
1770
1779
|
waitForCommit: () => waitForCommit
|
|
@@ -1780,14 +1789,14 @@ function get5(ctx, releaseId) {
|
|
|
1780
1789
|
return call(
|
|
1781
1790
|
ctx,
|
|
1782
1791
|
"GET",
|
|
1783
|
-
`/_internal/v2/apps/${ctx.appId}/releases/${
|
|
1792
|
+
`/_internal/v2/apps/${ctx.appId}/releases/${encodePathSegment(releaseId)}`
|
|
1784
1793
|
);
|
|
1785
1794
|
}
|
|
1786
|
-
function
|
|
1795
|
+
function getByCommit(ctx, commitSha) {
|
|
1787
1796
|
return tryCall(
|
|
1788
1797
|
ctx,
|
|
1789
1798
|
"GET",
|
|
1790
|
-
`/_internal/v2/apps/${ctx.appId}/releases/by-commit/${
|
|
1799
|
+
`/_internal/v2/apps/${ctx.appId}/releases/by-commit/${encodePathSegment(commitSha)}`
|
|
1791
1800
|
);
|
|
1792
1801
|
}
|
|
1793
1802
|
async function dashboardLive(ctx) {
|
|
@@ -1844,7 +1853,7 @@ async function waitForCommit(ctx, params) {
|
|
|
1844
1853
|
const start2 = Date.now();
|
|
1845
1854
|
let release;
|
|
1846
1855
|
while (true) {
|
|
1847
|
-
const r = await
|
|
1856
|
+
const r = await getByCommit(ctx, commitSha);
|
|
1848
1857
|
if (r.ok) {
|
|
1849
1858
|
release = r.body;
|
|
1850
1859
|
break;
|
|
@@ -1894,12 +1903,13 @@ async function waitForCommit(ctx, params) {
|
|
|
1894
1903
|
`${release.status}\u2026 (${Math.round((Date.now() - start2) / 1e3)}s)`
|
|
1895
1904
|
);
|
|
1896
1905
|
await sleep(POLL_MS4);
|
|
1897
|
-
const r = await
|
|
1906
|
+
const r = await getByCommit(ctx, commitSha);
|
|
1898
1907
|
if (r.ok) {
|
|
1899
1908
|
release = r.body;
|
|
1900
1909
|
}
|
|
1901
1910
|
}
|
|
1902
1911
|
}
|
|
1912
|
+
var byCommit = getByCommit;
|
|
1903
1913
|
|
|
1904
1914
|
// src/ops/diagnostics.ts
|
|
1905
1915
|
async function getLiveReleaseId(ctx) {
|
|
@@ -1910,7 +1920,7 @@ function getRelease(ctx, releaseId) {
|
|
|
1910
1920
|
return call(
|
|
1911
1921
|
ctx,
|
|
1912
1922
|
"GET",
|
|
1913
|
-
`/_internal/v2/apps/${ctx.appId}/releases/${
|
|
1923
|
+
`/_internal/v2/apps/${ctx.appId}/releases/${encodePathSegment(releaseId)}`
|
|
1914
1924
|
);
|
|
1915
1925
|
}
|
|
1916
1926
|
async function fetchReport(url) {
|
|
@@ -1941,6 +1951,7 @@ __export(domains_exports, {
|
|
|
1941
1951
|
findHostname: () => findHostname,
|
|
1942
1952
|
findOwned: () => findOwned,
|
|
1943
1953
|
get: () => get6,
|
|
1954
|
+
listOwned: () => listOwned,
|
|
1944
1955
|
owned: () => owned,
|
|
1945
1956
|
quote: () => quote,
|
|
1946
1957
|
search: () => search2,
|
|
@@ -2012,7 +2023,7 @@ async function customRemove(ctx, hostname) {
|
|
|
2012
2023
|
return call(
|
|
2013
2024
|
ctx,
|
|
2014
2025
|
"POST",
|
|
2015
|
-
`/_internal/v2/apps/${ctx.appId}/settings/custom-domains/${
|
|
2026
|
+
`/_internal/v2/apps/${ctx.appId}/settings/custom-domains/${encodePathSegment(id)}/delete`
|
|
2016
2027
|
);
|
|
2017
2028
|
}
|
|
2018
2029
|
async function customRetry(ctx, hostname) {
|
|
@@ -2020,7 +2031,7 @@ async function customRetry(ctx, hostname) {
|
|
|
2020
2031
|
return call(
|
|
2021
2032
|
ctx,
|
|
2022
2033
|
"POST",
|
|
2023
|
-
`/_internal/v2/apps/${ctx.appId}/settings/custom-domains/${
|
|
2034
|
+
`/_internal/v2/apps/${ctx.appId}/settings/custom-domains/${encodePathSegment(id)}/retry`
|
|
2024
2035
|
);
|
|
2025
2036
|
}
|
|
2026
2037
|
var REGISTERED = (ctx) => `/_internal/v2/apps/${ctx.appId}/settings/registered-domains`;
|
|
@@ -2048,12 +2059,12 @@ function buy(ctx, params) {
|
|
|
2048
2059
|
{ name: params.name, expectedPrice: params.price, acceptTerms: true }
|
|
2049
2060
|
);
|
|
2050
2061
|
}
|
|
2051
|
-
function
|
|
2062
|
+
function listOwned(ctx) {
|
|
2052
2063
|
return call(ctx, "GET", REGISTERED(ctx));
|
|
2053
2064
|
}
|
|
2054
2065
|
async function findOwned(ctx, name) {
|
|
2055
2066
|
const wanted = name.toLowerCase();
|
|
2056
|
-
const { domains } = await
|
|
2067
|
+
const { domains } = await listOwned(ctx);
|
|
2057
2068
|
const domain = domains.find(
|
|
2058
2069
|
(d) => d.name === wanted && (d.status === "active" || d.status === "expired" || d.status === "pending")
|
|
2059
2070
|
);
|
|
@@ -2082,7 +2093,7 @@ async function zone(ctx, name) {
|
|
|
2082
2093
|
return call(
|
|
2083
2094
|
ctx,
|
|
2084
2095
|
"GET",
|
|
2085
|
-
`${REGISTERED(ctx)}/${
|
|
2096
|
+
`${REGISTERED(ctx)}/${encodePathSegment(domain.id)}/records`
|
|
2086
2097
|
);
|
|
2087
2098
|
}
|
|
2088
2099
|
async function zoneAdd(ctx, name, record) {
|
|
@@ -2090,7 +2101,7 @@ async function zoneAdd(ctx, name, record) {
|
|
|
2090
2101
|
return call(
|
|
2091
2102
|
ctx,
|
|
2092
2103
|
"POST",
|
|
2093
|
-
`${REGISTERED(ctx)}/${
|
|
2104
|
+
`${REGISTERED(ctx)}/${encodePathSegment(domain.id)}/records`,
|
|
2094
2105
|
{ ...record }
|
|
2095
2106
|
);
|
|
2096
2107
|
}
|
|
@@ -2099,7 +2110,7 @@ async function zoneUpdate(ctx, name, recordId, record) {
|
|
|
2099
2110
|
return call(
|
|
2100
2111
|
ctx,
|
|
2101
2112
|
"POST",
|
|
2102
|
-
`${REGISTERED(ctx)}/${
|
|
2113
|
+
`${REGISTERED(ctx)}/${encodePathSegment(domain.id)}/records/${encodePathSegment(recordId)}`,
|
|
2103
2114
|
{ ...record }
|
|
2104
2115
|
);
|
|
2105
2116
|
}
|
|
@@ -2108,9 +2119,10 @@ async function zoneDelete(ctx, name, recordId) {
|
|
|
2108
2119
|
return call(
|
|
2109
2120
|
ctx,
|
|
2110
2121
|
"POST",
|
|
2111
|
-
`${REGISTERED(ctx)}/${
|
|
2122
|
+
`${REGISTERED(ctx)}/${encodePathSegment(domain.id)}/records/${encodePathSegment(recordId)}/delete`
|
|
2112
2123
|
);
|
|
2113
2124
|
}
|
|
2125
|
+
var owned = listOwned;
|
|
2114
2126
|
|
|
2115
2127
|
// src/ops/email.ts
|
|
2116
2128
|
var email_exports = {};
|
|
@@ -2167,7 +2179,7 @@ function get7(ctx, messageId) {
|
|
|
2167
2179
|
return call(
|
|
2168
2180
|
ctx,
|
|
2169
2181
|
"GET",
|
|
2170
|
-
`/_internal/v2/apps/${ctx.appId}/outbound-email/messages/${
|
|
2182
|
+
`/_internal/v2/apps/${ctx.appId}/outbound-email/messages/${encodePathSegment(messageId)}`
|
|
2171
2183
|
);
|
|
2172
2184
|
}
|
|
2173
2185
|
function stats2(ctx, params = {}) {
|
|
@@ -2195,7 +2207,7 @@ function batch2(ctx, batchId) {
|
|
|
2195
2207
|
return call(
|
|
2196
2208
|
ctx,
|
|
2197
2209
|
"GET",
|
|
2198
|
-
`/_internal/v2/apps/${ctx.appId}/outbound-email/batches/${
|
|
2210
|
+
`/_internal/v2/apps/${ctx.appId}/outbound-email/batches/${encodePathSegment(batchId)}`
|
|
2199
2211
|
);
|
|
2200
2212
|
}
|
|
2201
2213
|
function suppressions(ctx, params = {}) {
|
|
@@ -2246,7 +2258,7 @@ async function verifyDomain(ctx, direction, domain) {
|
|
|
2246
2258
|
return call(
|
|
2247
2259
|
ctx,
|
|
2248
2260
|
"POST",
|
|
2249
|
-
`${domainsPath(ctx, direction)}/${
|
|
2261
|
+
`${domainsPath(ctx, direction)}/${encodePathSegment(id)}/retry`
|
|
2250
2262
|
);
|
|
2251
2263
|
}
|
|
2252
2264
|
async function removeDomain(ctx, direction, domain) {
|
|
@@ -2254,7 +2266,7 @@ async function removeDomain(ctx, direction, domain) {
|
|
|
2254
2266
|
return call(
|
|
2255
2267
|
ctx,
|
|
2256
2268
|
"POST",
|
|
2257
|
-
`${domainsPath(ctx, direction)}/${
|
|
2269
|
+
`${domainsPath(ctx, direction)}/${encodePathSegment(id)}/delete`
|
|
2258
2270
|
);
|
|
2259
2271
|
}
|
|
2260
2272
|
|
|
@@ -2468,7 +2480,7 @@ async function waitForPhase(ctx, params) {
|
|
|
2468
2480
|
return {
|
|
2469
2481
|
status: "timeout",
|
|
2470
2482
|
resource,
|
|
2471
|
-
error:
|
|
2483
|
+
error: timeoutMessage(timeoutMs, `; resource is still ${resource.phase}`)
|
|
2472
2484
|
};
|
|
2473
2485
|
}
|
|
2474
2486
|
if (arrived(resource)) {
|
|
@@ -2492,6 +2504,7 @@ __export(issues_exports, {
|
|
|
2492
2504
|
filed: () => filed,
|
|
2493
2505
|
get: () => get9,
|
|
2494
2506
|
list: () => list10,
|
|
2507
|
+
listFiled: () => listFiled,
|
|
2495
2508
|
reopen: () => reopen
|
|
2496
2509
|
});
|
|
2497
2510
|
function authorship(ctx) {
|
|
@@ -2513,7 +2526,7 @@ function list10(ctx, params = {}) {
|
|
|
2513
2526
|
`/_internal/v2/apps/${ctx.appId}/issues${listQuery(params)}`
|
|
2514
2527
|
);
|
|
2515
2528
|
}
|
|
2516
|
-
function
|
|
2529
|
+
function listFiled(ctx, params = {}) {
|
|
2517
2530
|
return call(
|
|
2518
2531
|
ctx,
|
|
2519
2532
|
"GET",
|
|
@@ -2524,7 +2537,7 @@ function get9(ctx, number) {
|
|
|
2524
2537
|
return call(
|
|
2525
2538
|
ctx,
|
|
2526
2539
|
"GET",
|
|
2527
|
-
`/_internal/v2/apps/${ctx.appId}/issues/${
|
|
2540
|
+
`/_internal/v2/apps/${ctx.appId}/issues/${encodePathSegment(number)}`
|
|
2528
2541
|
);
|
|
2529
2542
|
}
|
|
2530
2543
|
function create2(ctx, params) {
|
|
@@ -2553,7 +2566,7 @@ function comment(ctx, number, body) {
|
|
|
2553
2566
|
return call(
|
|
2554
2567
|
ctx,
|
|
2555
2568
|
"POST",
|
|
2556
|
-
`/_internal/v2/apps/${ctx.appId}/issues/${
|
|
2569
|
+
`/_internal/v2/apps/${ctx.appId}/issues/${encodePathSegment(number)}/comments`,
|
|
2557
2570
|
{ body, authorKind: "agent", ...authorship(ctx) }
|
|
2558
2571
|
);
|
|
2559
2572
|
}
|
|
@@ -2569,7 +2582,7 @@ function close(ctx, number, comment2) {
|
|
|
2569
2582
|
return call(
|
|
2570
2583
|
ctx,
|
|
2571
2584
|
"POST",
|
|
2572
|
-
`/_internal/v2/apps/${ctx.appId}/issues/${
|
|
2585
|
+
`/_internal/v2/apps/${ctx.appId}/issues/${encodePathSegment(number)}/update`,
|
|
2573
2586
|
requestBody
|
|
2574
2587
|
);
|
|
2575
2588
|
}
|
|
@@ -2577,7 +2590,7 @@ function reopen(ctx, number) {
|
|
|
2577
2590
|
return call(
|
|
2578
2591
|
ctx,
|
|
2579
2592
|
"POST",
|
|
2580
|
-
`/_internal/v2/apps/${ctx.appId}/issues/${
|
|
2593
|
+
`/_internal/v2/apps/${ctx.appId}/issues/${encodePathSegment(number)}/update`,
|
|
2581
2594
|
{ status: "open", authorKind: "agent", ...authorship(ctx) }
|
|
2582
2595
|
);
|
|
2583
2596
|
}
|
|
@@ -2601,7 +2614,7 @@ function edit(ctx, number, params) {
|
|
|
2601
2614
|
return call(
|
|
2602
2615
|
ctx,
|
|
2603
2616
|
"POST",
|
|
2604
|
-
`/_internal/v2/apps/${ctx.appId}/issues/${
|
|
2617
|
+
`/_internal/v2/apps/${ctx.appId}/issues/${encodePathSegment(number)}/update`,
|
|
2605
2618
|
requestBody
|
|
2606
2619
|
);
|
|
2607
2620
|
}
|
|
@@ -2609,9 +2622,10 @@ function del(ctx, number) {
|
|
|
2609
2622
|
return call(
|
|
2610
2623
|
ctx,
|
|
2611
2624
|
"POST",
|
|
2612
|
-
`/_internal/v2/apps/${ctx.appId}/issues/${
|
|
2625
|
+
`/_internal/v2/apps/${ctx.appId}/issues/${encodePathSegment(number)}/delete`
|
|
2613
2626
|
);
|
|
2614
2627
|
}
|
|
2628
|
+
var filed = listFiled;
|
|
2615
2629
|
|
|
2616
2630
|
// src/ops/jewels.ts
|
|
2617
2631
|
var jewels_exports = {};
|
|
@@ -2656,7 +2670,7 @@ function pair(ctx, pairId) {
|
|
|
2656
2670
|
return call(
|
|
2657
2671
|
ctx,
|
|
2658
2672
|
"GET",
|
|
2659
|
-
`/_internal/v2/apps/${ctx.appId}/jewels/pairs/${
|
|
2673
|
+
`/_internal/v2/apps/${ctx.appId}/jewels/pairs/${encodePathSegment(pairId)}`
|
|
2660
2674
|
);
|
|
2661
2675
|
}
|
|
2662
2676
|
function queue(ctx, params = {}) {
|
|
@@ -2686,7 +2700,7 @@ function dryrun(ctx, params) {
|
|
|
2686
2700
|
return call(
|
|
2687
2701
|
ctx,
|
|
2688
2702
|
"POST",
|
|
2689
|
-
`/_internal/v2/apps/${ctx.appId}/jewels/${
|
|
2703
|
+
`/_internal/v2/apps/${ctx.appId}/jewels/${encodePathSegment(params.methodId)}/dryrun`,
|
|
2690
2704
|
{ subject: params.subject },
|
|
2691
2705
|
JEWEL_RUN_TIMEOUT_MS
|
|
2692
2706
|
);
|
|
@@ -2720,14 +2734,14 @@ function getRun2(ctx, runId) {
|
|
|
2720
2734
|
return call(
|
|
2721
2735
|
ctx,
|
|
2722
2736
|
"GET",
|
|
2723
|
-
`/_internal/v2/apps/${ctx.appId}/jewels/training-runs/${
|
|
2737
|
+
`/_internal/v2/apps/${ctx.appId}/jewels/training-runs/${encodePathSegment(runId)}`
|
|
2724
2738
|
);
|
|
2725
2739
|
}
|
|
2726
2740
|
function grade(ctx, runId) {
|
|
2727
2741
|
return call(
|
|
2728
2742
|
ctx,
|
|
2729
2743
|
"POST",
|
|
2730
|
-
`/_internal/v2/apps/${ctx.appId}/jewels/training-runs/${
|
|
2744
|
+
`/_internal/v2/apps/${ctx.appId}/jewels/training-runs/${encodePathSegment(runId)}/grade`,
|
|
2731
2745
|
void 0,
|
|
2732
2746
|
JEWEL_RUN_TIMEOUT_MS
|
|
2733
2747
|
);
|
|
@@ -2756,7 +2770,7 @@ async function list11(ctx) {
|
|
|
2756
2770
|
function invoke(ctx, params) {
|
|
2757
2771
|
const { methodId, input, impersonate } = params;
|
|
2758
2772
|
const useImpersonate = impersonate !== void 0 && (impersonate.roles !== void 0 || impersonate.userId !== void 0);
|
|
2759
|
-
const apiPath = useImpersonate ? `/_internal/v2/apps/${ctx.appId}/methods/${
|
|
2773
|
+
const apiPath = useImpersonate ? `/_internal/v2/apps/${ctx.appId}/methods/${encodePathSegment(methodId)}/invoke-as` : `/_internal/v2/apps/${ctx.appId}/methods/${encodePathSegment(methodId)}/invoke`;
|
|
2760
2774
|
const body = useImpersonate ? { input, impersonate } : { input };
|
|
2761
2775
|
return call(
|
|
2762
2776
|
ctx,
|
|
@@ -2827,7 +2841,7 @@ function revoke(ctx, shareId) {
|
|
|
2827
2841
|
return call(
|
|
2828
2842
|
ctx,
|
|
2829
2843
|
"POST",
|
|
2830
|
-
`/_internal/v2/apps/${ctx.appId}/preview/shares/${
|
|
2844
|
+
`/_internal/v2/apps/${ctx.appId}/preview/shares/${encodePathSegment(shareId)}/revoke`
|
|
2831
2845
|
);
|
|
2832
2846
|
}
|
|
2833
2847
|
|
|
@@ -3007,7 +3021,7 @@ function get10(ctx, requestId) {
|
|
|
3007
3021
|
return call(
|
|
3008
3022
|
ctx,
|
|
3009
3023
|
"GET",
|
|
3010
|
-
`/_internal/v2/apps/${ctx.appId}/requests/${
|
|
3024
|
+
`/_internal/v2/apps/${ctx.appId}/requests/${encodePathSegment(requestId)}`
|
|
3011
3025
|
);
|
|
3012
3026
|
}
|
|
3013
3027
|
function statsSummary(ctx, params = {}) {
|
|
@@ -3021,7 +3035,7 @@ function statsForMethod(ctx, methodId, params = {}) {
|
|
|
3021
3035
|
return call(
|
|
3022
3036
|
ctx,
|
|
3023
3037
|
"GET",
|
|
3024
|
-
`/_internal/v2/apps/${ctx.appId}/metrics/methods/${
|
|
3038
|
+
`/_internal/v2/apps/${ctx.appId}/metrics/methods/${encodePathSegment(methodId)}${qs(params)}`
|
|
3025
3039
|
);
|
|
3026
3040
|
}
|
|
3027
3041
|
|
|
@@ -3050,7 +3064,7 @@ function set2(ctx, key, params) {
|
|
|
3050
3064
|
return call(
|
|
3051
3065
|
ctx,
|
|
3052
3066
|
"PUT",
|
|
3053
|
-
`/_internal/v2/apps/${ctx.appId}/secrets/${
|
|
3067
|
+
`/_internal/v2/apps/${ctx.appId}/secrets/${encodePathSegment(key)}`,
|
|
3054
3068
|
body
|
|
3055
3069
|
);
|
|
3056
3070
|
}
|
|
@@ -3058,7 +3072,7 @@ function del2(ctx, key) {
|
|
|
3058
3072
|
return call(
|
|
3059
3073
|
ctx,
|
|
3060
3074
|
"DELETE",
|
|
3061
|
-
`/_internal/v2/apps/${ctx.appId}/secrets/${
|
|
3075
|
+
`/_internal/v2/apps/${ctx.appId}/secrets/${encodePathSegment(key)}`
|
|
3062
3076
|
);
|
|
3063
3077
|
}
|
|
3064
3078
|
|
|
@@ -3116,7 +3130,7 @@ function setRole(ctx, userId, role) {
|
|
|
3116
3130
|
return call(
|
|
3117
3131
|
ctx,
|
|
3118
3132
|
"POST",
|
|
3119
|
-
`/_internal/v2/apps/${ctx.appId}/users/${
|
|
3133
|
+
`/_internal/v2/apps/${ctx.appId}/users/${encodePathSegment(userId)}/roles`,
|
|
3120
3134
|
{ roles: [role] }
|
|
3121
3135
|
);
|
|
3122
3136
|
}
|
|
@@ -3124,14 +3138,14 @@ function createApiKey(ctx, userId) {
|
|
|
3124
3138
|
return call(
|
|
3125
3139
|
ctx,
|
|
3126
3140
|
"POST",
|
|
3127
|
-
`/_internal/v2/apps/${ctx.appId}/users/${
|
|
3141
|
+
`/_internal/v2/apps/${ctx.appId}/users/${encodePathSegment(userId)}/api-key`
|
|
3128
3142
|
);
|
|
3129
3143
|
}
|
|
3130
3144
|
function revokeApiKey(ctx, userId) {
|
|
3131
3145
|
return call(
|
|
3132
3146
|
ctx,
|
|
3133
3147
|
"DELETE",
|
|
3134
|
-
`/_internal/v2/apps/${ctx.appId}/users/${
|
|
3148
|
+
`/_internal/v2/apps/${ctx.appId}/users/${encodePathSegment(userId)}/api-key`
|
|
3135
3149
|
);
|
|
3136
3150
|
}
|
|
3137
3151
|
|
|
@@ -3205,7 +3219,7 @@ async function numbersRelease(ctx, e164) {
|
|
|
3205
3219
|
return call(
|
|
3206
3220
|
ctx,
|
|
3207
3221
|
"POST",
|
|
3208
|
-
`/_internal/v2/apps/${ctx.appId}/settings/voice-phone-numbers/${
|
|
3222
|
+
`/_internal/v2/apps/${ctx.appId}/settings/voice-phone-numbers/${encodePathSegment(id)}/release`
|
|
3209
3223
|
);
|
|
3210
3224
|
}
|
|
3211
3225
|
async function numbersSetName(ctx, e164, displayName) {
|
|
@@ -3213,7 +3227,7 @@ async function numbersSetName(ctx, e164, displayName) {
|
|
|
3213
3227
|
return call(
|
|
3214
3228
|
ctx,
|
|
3215
3229
|
"POST",
|
|
3216
|
-
`/_internal/v2/apps/${ctx.appId}/settings/voice-phone-numbers/${
|
|
3230
|
+
`/_internal/v2/apps/${ctx.appId}/settings/voice-phone-numbers/${encodePathSegment(id)}/display-name`,
|
|
3217
3231
|
{ displayName }
|
|
3218
3232
|
);
|
|
3219
3233
|
}
|
|
@@ -3228,7 +3242,7 @@ function sessionsGet(ctx, sessionId) {
|
|
|
3228
3242
|
return call(
|
|
3229
3243
|
ctx,
|
|
3230
3244
|
"GET",
|
|
3231
|
-
`/_internal/v2/apps/${ctx.appId}/voice-sessions/${
|
|
3245
|
+
`/_internal/v2/apps/${ctx.appId}/voice-sessions/${encodePathSegment(sessionId)}`
|
|
3232
3246
|
);
|
|
3233
3247
|
}
|
|
3234
3248
|
function settingsGet(ctx) {
|