@madewithremy/admin 0.1.37 → 0.1.39
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/dist/index.d.ts +450 -118
- package/dist/index.js +106 -7
- package/dist/index.js.map +1 -1
- package/dist/prod.js +307 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -105,20 +105,20 @@ function seg(value) {
|
|
|
105
105
|
return encodeURIComponent(String(value));
|
|
106
106
|
}
|
|
107
107
|
function qs(params) {
|
|
108
|
-
const
|
|
108
|
+
const search3 = new URLSearchParams();
|
|
109
109
|
for (const [key, value] of Object.entries(params)) {
|
|
110
110
|
if (value === void 0 || value === null) {
|
|
111
111
|
continue;
|
|
112
112
|
}
|
|
113
113
|
if (Array.isArray(value)) {
|
|
114
114
|
for (const entry of value) {
|
|
115
|
-
|
|
115
|
+
search3.append(key, String(entry));
|
|
116
116
|
}
|
|
117
117
|
continue;
|
|
118
118
|
}
|
|
119
|
-
|
|
119
|
+
search3.set(key, String(value));
|
|
120
120
|
}
|
|
121
|
-
const text =
|
|
121
|
+
const text = search3.toString();
|
|
122
122
|
return text ? `?${text}` : "";
|
|
123
123
|
}
|
|
124
124
|
function authHeaders(ctx) {
|
|
@@ -1788,15 +1788,26 @@ async function fetchReport(url) {
|
|
|
1788
1788
|
// src/ops/domains.ts
|
|
1789
1789
|
var domains_exports = {};
|
|
1790
1790
|
__export(domains_exports, {
|
|
1791
|
+
buy: () => buy,
|
|
1791
1792
|
check: () => check,
|
|
1793
|
+
contactGet: () => contactGet,
|
|
1794
|
+
contactSet: () => contactSet,
|
|
1792
1795
|
customAdd: () => customAdd,
|
|
1793
1796
|
customCheck: () => customCheck,
|
|
1794
1797
|
customList: () => customList,
|
|
1795
1798
|
customRemove: () => customRemove,
|
|
1796
1799
|
customRetry: () => customRetry,
|
|
1797
1800
|
findHostname: () => findHostname,
|
|
1801
|
+
findOwned: () => findOwned,
|
|
1798
1802
|
get: () => get6,
|
|
1799
|
-
|
|
1803
|
+
owned: () => owned,
|
|
1804
|
+
quote: () => quote,
|
|
1805
|
+
search: () => search2,
|
|
1806
|
+
set: () => set,
|
|
1807
|
+
zone: () => zone,
|
|
1808
|
+
zoneAdd: () => zoneAdd,
|
|
1809
|
+
zoneDelete: () => zoneDelete,
|
|
1810
|
+
zoneUpdate: () => zoneUpdate
|
|
1800
1811
|
});
|
|
1801
1812
|
function get6(ctx) {
|
|
1802
1813
|
return call(
|
|
@@ -1871,6 +1882,94 @@ async function customRetry(ctx, hostname) {
|
|
|
1871
1882
|
`/_internal/v2/apps/${ctx.appId}/settings/custom-domains/${seg(id)}/retry`
|
|
1872
1883
|
);
|
|
1873
1884
|
}
|
|
1885
|
+
var REGISTERED = (ctx) => `/_internal/v2/apps/${ctx.appId}/settings/registered-domains`;
|
|
1886
|
+
function search2(ctx, query3) {
|
|
1887
|
+
return call(
|
|
1888
|
+
ctx,
|
|
1889
|
+
"POST",
|
|
1890
|
+
`${REGISTERED(ctx)}/search`,
|
|
1891
|
+
{ query: query3 }
|
|
1892
|
+
);
|
|
1893
|
+
}
|
|
1894
|
+
function quote(ctx, name) {
|
|
1895
|
+
return call(
|
|
1896
|
+
ctx,
|
|
1897
|
+
"POST",
|
|
1898
|
+
`${REGISTERED(ctx)}/quote`,
|
|
1899
|
+
{ name }
|
|
1900
|
+
);
|
|
1901
|
+
}
|
|
1902
|
+
function buy(ctx, params) {
|
|
1903
|
+
return call(
|
|
1904
|
+
ctx,
|
|
1905
|
+
"POST",
|
|
1906
|
+
`${REGISTERED(ctx)}/purchase`,
|
|
1907
|
+
{ name: params.name, expectedPrice: params.price, acceptTerms: true }
|
|
1908
|
+
);
|
|
1909
|
+
}
|
|
1910
|
+
function owned(ctx) {
|
|
1911
|
+
return call(ctx, "GET", REGISTERED(ctx));
|
|
1912
|
+
}
|
|
1913
|
+
async function findOwned(ctx, name) {
|
|
1914
|
+
const wanted = name.toLowerCase();
|
|
1915
|
+
const { domains } = await owned(ctx);
|
|
1916
|
+
const domain = domains.find(
|
|
1917
|
+
(d) => d.name === wanted && (d.status === "active" || d.status === "expired" || d.status === "pending")
|
|
1918
|
+
);
|
|
1919
|
+
if (!domain) {
|
|
1920
|
+
throw new Error(`No domain "${name}" in this workspace`);
|
|
1921
|
+
}
|
|
1922
|
+
return domain;
|
|
1923
|
+
}
|
|
1924
|
+
function contactGet(ctx) {
|
|
1925
|
+
return call(
|
|
1926
|
+
ctx,
|
|
1927
|
+
"GET",
|
|
1928
|
+
`${REGISTERED(ctx)}/contact`
|
|
1929
|
+
);
|
|
1930
|
+
}
|
|
1931
|
+
function contactSet(ctx, contact) {
|
|
1932
|
+
return call(
|
|
1933
|
+
ctx,
|
|
1934
|
+
"POST",
|
|
1935
|
+
`${REGISTERED(ctx)}/contact`,
|
|
1936
|
+
{ ...contact }
|
|
1937
|
+
);
|
|
1938
|
+
}
|
|
1939
|
+
async function zone(ctx, name) {
|
|
1940
|
+
const domain = await findOwned(ctx, name);
|
|
1941
|
+
return call(
|
|
1942
|
+
ctx,
|
|
1943
|
+
"GET",
|
|
1944
|
+
`${REGISTERED(ctx)}/${seg(domain.id)}/records`
|
|
1945
|
+
);
|
|
1946
|
+
}
|
|
1947
|
+
async function zoneAdd(ctx, name, record) {
|
|
1948
|
+
const domain = await findOwned(ctx, name);
|
|
1949
|
+
return call(
|
|
1950
|
+
ctx,
|
|
1951
|
+
"POST",
|
|
1952
|
+
`${REGISTERED(ctx)}/${seg(domain.id)}/records`,
|
|
1953
|
+
{ ...record }
|
|
1954
|
+
);
|
|
1955
|
+
}
|
|
1956
|
+
async function zoneUpdate(ctx, name, recordId, record) {
|
|
1957
|
+
const domain = await findOwned(ctx, name);
|
|
1958
|
+
return call(
|
|
1959
|
+
ctx,
|
|
1960
|
+
"POST",
|
|
1961
|
+
`${REGISTERED(ctx)}/${seg(domain.id)}/records/${seg(recordId)}`,
|
|
1962
|
+
{ ...record }
|
|
1963
|
+
);
|
|
1964
|
+
}
|
|
1965
|
+
async function zoneDelete(ctx, name, recordId) {
|
|
1966
|
+
const domain = await findOwned(ctx, name);
|
|
1967
|
+
return call(
|
|
1968
|
+
ctx,
|
|
1969
|
+
"POST",
|
|
1970
|
+
`${REGISTERED(ctx)}/${seg(domain.id)}/records/${seg(recordId)}/delete`
|
|
1971
|
+
);
|
|
1972
|
+
}
|
|
1874
1973
|
|
|
1875
1974
|
// src/ops/email.ts
|
|
1876
1975
|
var email_exports = {};
|
|
@@ -2152,11 +2251,11 @@ function logs(ctx, params) {
|
|
|
2152
2251
|
if (params.limit) {
|
|
2153
2252
|
query3.set("limit", String(params.limit));
|
|
2154
2253
|
}
|
|
2155
|
-
const
|
|
2254
|
+
const search3 = query3.toString();
|
|
2156
2255
|
return call(
|
|
2157
2256
|
ctx,
|
|
2158
2257
|
"GET",
|
|
2159
|
-
`${base6(ctx.appId)}/${encodeURIComponent(params.id)}/logs${
|
|
2258
|
+
`${base6(ctx.appId)}/${encodeURIComponent(params.id)}/logs${search3 ? `?${search3}` : ""}`
|
|
2160
2259
|
);
|
|
2161
2260
|
}
|
|
2162
2261
|
function provision(ctx, params) {
|