@hotcodepush/node 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1240 -120
- package/dist/index.mjs +191 -50
- package/package.json +3 -2
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
//#region package.json
|
|
2
|
-
var version = "0.
|
|
2
|
+
var version = "0.1.0";
|
|
3
3
|
//#endregion
|
|
4
4
|
//#region src/errors.ts
|
|
5
5
|
/**
|
|
6
6
|
* Thrown when the API answers with a status outside 2xx.
|
|
7
7
|
* `code`, `message` and `details` come from the API verbatim.
|
|
8
|
+
* A code newer than this client passes through as a plain string, so `code` is not limited to `HotCodePushErrorCode`.
|
|
8
9
|
* A response without the API error shape becomes `unexpected_response` with the status, and its body is dropped.
|
|
9
10
|
*/
|
|
10
11
|
var HotCodePushError = class extends Error {
|
|
@@ -30,8 +31,8 @@ function resolveErrorBody(text) {
|
|
|
30
31
|
return;
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
|
-
function resolveHotCodePushError(
|
|
34
|
-
return new HotCodePushError(resolveErrorBody(
|
|
34
|
+
function resolveHotCodePushError({ responseText, status }) {
|
|
35
|
+
return new HotCodePushError(resolveErrorBody(responseText) ?? {
|
|
35
36
|
code: "unexpected_response",
|
|
36
37
|
message: `Request failed with status ${status}.`
|
|
37
38
|
}, status);
|
|
@@ -85,7 +86,7 @@ var HttpClient = class {
|
|
|
85
86
|
await response.body?.cancel();
|
|
86
87
|
}
|
|
87
88
|
async fetchUpload(options) {
|
|
88
|
-
const fetchWithTimeout = withTimeout(fetch, UPLOAD_TIMEOUT_MS);
|
|
89
|
+
const fetchWithTimeout = withTimeout(fetch, { timeoutMs: UPLOAD_TIMEOUT_MS });
|
|
89
90
|
const fetchFunction = isBlobUploadBody(options) ? withRetry(fetchWithTimeout) : fetchWithTimeout;
|
|
90
91
|
const contentLength = isBlobUploadBody(options) ? options.body.size : options.contentLength;
|
|
91
92
|
return parseResponseBody(await fetchFunction(this.resolveRouteUrl(options.path), {
|
|
@@ -100,7 +101,7 @@ var HttpClient = class {
|
|
|
100
101
|
}));
|
|
101
102
|
}
|
|
102
103
|
async fetchResponse(options) {
|
|
103
|
-
const fetchWithTimeout = withTimeout(fetch, this.timeoutMs);
|
|
104
|
+
const fetchWithTimeout = withTimeout(fetch, { timeoutMs: this.timeoutMs });
|
|
104
105
|
return (options.isRetryable ?? IDEMPOTENT_METHODS.has(options.method) ? withRetry(fetchWithTimeout) : fetchWithTimeout)(this.resolveUrl(options), this.resolveRequestInit(options));
|
|
105
106
|
}
|
|
106
107
|
resolveRequestInit(options) {
|
|
@@ -126,12 +127,18 @@ var HttpClient = class {
|
|
|
126
127
|
}
|
|
127
128
|
resolveUrl(options) {
|
|
128
129
|
const url = this.resolveRouteUrl(options.path);
|
|
129
|
-
for (const [name, value] of Object.entries(options.query ?? {})) for (const queryValue of resolveQueryValues(
|
|
130
|
+
for (const [name, value] of Object.entries(options.query ?? {})) for (const queryValue of resolveQueryValues({
|
|
131
|
+
name,
|
|
132
|
+
value
|
|
133
|
+
})) url.searchParams.append(name, queryValue);
|
|
130
134
|
return url;
|
|
131
135
|
}
|
|
132
136
|
};
|
|
133
137
|
async function assertResponseOk(response) {
|
|
134
|
-
if (!response.ok) throw resolveHotCodePushError(
|
|
138
|
+
if (!response.ok) throw resolveHotCodePushError({
|
|
139
|
+
responseText: await response.text(),
|
|
140
|
+
status: response.status
|
|
141
|
+
});
|
|
135
142
|
}
|
|
136
143
|
function isBlobUploadBody(uploadBody) {
|
|
137
144
|
return uploadBody.body instanceof Blob;
|
|
@@ -161,7 +168,7 @@ function resolvePath(template, parameters = {}) {
|
|
|
161
168
|
return encodeURIComponent(parameter);
|
|
162
169
|
});
|
|
163
170
|
}
|
|
164
|
-
function resolveQueryValues(name, value) {
|
|
171
|
+
function resolveQueryValues({ name, value }) {
|
|
165
172
|
if (value === void 0 || value === "") return [];
|
|
166
173
|
if (typeof value !== "object") return [String(value)];
|
|
167
174
|
if (COMMA_LIST_QUERY_NAMES.has(name)) return value.length === 0 ? [] : [value.join(",")];
|
|
@@ -194,7 +201,7 @@ function withRetry(fetchFunction) {
|
|
|
194
201
|
}
|
|
195
202
|
};
|
|
196
203
|
}
|
|
197
|
-
function withTimeout(fetchFunction, timeoutMs) {
|
|
204
|
+
function withTimeout(fetchFunction, { timeoutMs }) {
|
|
198
205
|
return (input, init) => fetchFunction(input, {
|
|
199
206
|
...init,
|
|
200
207
|
signal: AbortSignal.timeout(timeoutMs)
|
|
@@ -333,19 +340,14 @@ const SINGLE_UPLOAD_LIMIT_BYTES = 67108864;
|
|
|
333
340
|
function isBlobAboveSingleUploadLimit(uploadBody) {
|
|
334
341
|
return uploadBody.body instanceof Blob && uploadBody.body.size > 67108864;
|
|
335
342
|
}
|
|
336
|
-
async function uploadInParts(uploads,
|
|
343
|
+
async function uploadInParts(uploads, { blob, pathParameters }) {
|
|
337
344
|
const { uploadId } = await uploads.create(pathParameters);
|
|
338
345
|
try {
|
|
339
|
-
const parts =
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
partNumber,
|
|
345
|
-
uploadId
|
|
346
|
-
});
|
|
347
|
-
parts.push(uploadedPart);
|
|
348
|
-
}
|
|
346
|
+
const parts = await uploadEveryPart(uploads, {
|
|
347
|
+
blob,
|
|
348
|
+
pathParameters,
|
|
349
|
+
uploadId
|
|
350
|
+
});
|
|
349
351
|
return await uploads.complete({
|
|
350
352
|
...pathParameters,
|
|
351
353
|
parts,
|
|
@@ -359,6 +361,19 @@ async function uploadInParts(uploads, pathParameters, blob) {
|
|
|
359
361
|
throw error;
|
|
360
362
|
}
|
|
361
363
|
}
|
|
364
|
+
async function uploadEveryPart(uploads, { blob, pathParameters, uploadId }) {
|
|
365
|
+
const parts = [];
|
|
366
|
+
for (let start = 0, partNumber = 1; start < blob.size; start += PART_SIZE_BYTES, partNumber += 1) {
|
|
367
|
+
const uploadedPart = await uploads.parts.upload({
|
|
368
|
+
...pathParameters,
|
|
369
|
+
body: blob.slice(start, start + PART_SIZE_BYTES),
|
|
370
|
+
partNumber,
|
|
371
|
+
uploadId
|
|
372
|
+
});
|
|
373
|
+
parts.push(uploadedPart);
|
|
374
|
+
}
|
|
375
|
+
return parts;
|
|
376
|
+
}
|
|
362
377
|
//#endregion
|
|
363
378
|
//#region src/resources/bundle-pack-upload-parts.ts
|
|
364
379
|
var BundlePackUploadPartsResource = class {
|
|
@@ -429,7 +444,7 @@ var BundlePackUploadsResource = class {
|
|
|
429
444
|
* Aborts a multipart pack upload and discards its parts.
|
|
430
445
|
*/
|
|
431
446
|
async delete(options) {
|
|
432
|
-
await this.httpClient.
|
|
447
|
+
await this.httpClient.fetchStatus({
|
|
433
448
|
method: "DELETE",
|
|
434
449
|
path: resolvePath("/v1/apps/{appId}/bundles/{bundleId}/pack/uploads/{uploadId}", options)
|
|
435
450
|
});
|
|
@@ -451,9 +466,12 @@ var BundlePackResource = class {
|
|
|
451
466
|
async upload(options) {
|
|
452
467
|
const { appId, bundleId, ...uploadBody } = options;
|
|
453
468
|
if (isBlobAboveSingleUploadLimit(uploadBody)) return uploadInParts(this.uploads, {
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
469
|
+
blob: uploadBody.body,
|
|
470
|
+
pathParameters: {
|
|
471
|
+
appId,
|
|
472
|
+
bundleId
|
|
473
|
+
}
|
|
474
|
+
});
|
|
457
475
|
return this.httpClient.fetchUpload({
|
|
458
476
|
...uploadBody,
|
|
459
477
|
contentType: "application/x-tar",
|
|
@@ -517,7 +535,7 @@ var BundlesResource = class {
|
|
|
517
535
|
* A bundle that a release serves or a store build embeds is refused.
|
|
518
536
|
*/
|
|
519
537
|
async delete(options) {
|
|
520
|
-
await this.httpClient.
|
|
538
|
+
await this.httpClient.fetchStatus({
|
|
521
539
|
method: "DELETE",
|
|
522
540
|
path: resolvePath("/v1/apps/{appId}/bundles/{bundleId}", options)
|
|
523
541
|
});
|
|
@@ -686,7 +704,7 @@ var ChannelsResource = class {
|
|
|
686
704
|
* Deletes a channel at once. The default channel of the app is refused.
|
|
687
705
|
*/
|
|
688
706
|
async delete(options) {
|
|
689
|
-
await this.httpClient.
|
|
707
|
+
await this.httpClient.fetchStatus({
|
|
690
708
|
method: "DELETE",
|
|
691
709
|
path: resolvePath("/v1/apps/{appId}/channels/{channelId}", options)
|
|
692
710
|
});
|
|
@@ -697,7 +715,7 @@ var ChannelsResource = class {
|
|
|
697
715
|
*/
|
|
698
716
|
async deleteMany(options) {
|
|
699
717
|
const { appId, ...query } = options;
|
|
700
|
-
await this.httpClient.
|
|
718
|
+
await this.httpClient.fetchStatus({
|
|
701
719
|
method: "DELETE",
|
|
702
720
|
path: resolvePath("/v1/apps/{appId}/channels", { appId }),
|
|
703
721
|
query
|
|
@@ -818,7 +836,7 @@ var DevicesResource = class {
|
|
|
818
836
|
* Deletes a device from the registry, for an erasure request.
|
|
819
837
|
*/
|
|
820
838
|
async delete(options) {
|
|
821
|
-
await this.httpClient.
|
|
839
|
+
await this.httpClient.fetchStatus({
|
|
822
840
|
method: "DELETE",
|
|
823
841
|
path: resolvePath("/v1/apps/{appId}/devices/{deviceId}", options)
|
|
824
842
|
});
|
|
@@ -828,7 +846,7 @@ var DevicesResource = class {
|
|
|
828
846
|
*/
|
|
829
847
|
async deleteMany(options) {
|
|
830
848
|
const { appId, ...query } = options;
|
|
831
|
-
await this.httpClient.
|
|
849
|
+
await this.httpClient.fetchStatus({
|
|
832
850
|
method: "DELETE",
|
|
833
851
|
path: resolvePath("/v1/apps/{appId}/devices", { appId }),
|
|
834
852
|
query
|
|
@@ -929,7 +947,7 @@ var FileUploadsResource = class {
|
|
|
929
947
|
* Aborts a multipart file upload and discards its parts.
|
|
930
948
|
*/
|
|
931
949
|
async delete(options) {
|
|
932
|
-
await this.httpClient.
|
|
950
|
+
await this.httpClient.fetchStatus({
|
|
933
951
|
method: "DELETE",
|
|
934
952
|
path: resolvePath("/v1/apps/{appId}/files/{sha256}/uploads/{uploadId}", options)
|
|
935
953
|
});
|
|
@@ -952,9 +970,12 @@ var FilesResource = class {
|
|
|
952
970
|
async upload(options) {
|
|
953
971
|
const { appId, sha256, ...uploadBody } = options;
|
|
954
972
|
if (isBlobAboveSingleUploadLimit(uploadBody)) return uploadInParts(this.uploads, {
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
973
|
+
blob: uploadBody.body,
|
|
974
|
+
pathParameters: {
|
|
975
|
+
appId,
|
|
976
|
+
sha256
|
|
977
|
+
}
|
|
978
|
+
});
|
|
958
979
|
return this.httpClient.fetchUpload({
|
|
959
980
|
...uploadBody,
|
|
960
981
|
contentType: "application/gzip",
|
|
@@ -1110,7 +1131,7 @@ var SigningKeysResource = class {
|
|
|
1110
1131
|
});
|
|
1111
1132
|
}
|
|
1112
1133
|
async delete(options) {
|
|
1113
|
-
await this.httpClient.
|
|
1134
|
+
await this.httpClient.fetchStatus({
|
|
1114
1135
|
method: "DELETE",
|
|
1115
1136
|
path: resolvePath("/v1/apps/{appId}/signing-keys/{signingKeyId}", options)
|
|
1116
1137
|
});
|
|
@@ -1225,7 +1246,7 @@ var AppsResource = class {
|
|
|
1225
1246
|
* An API token answers `forbidden`; sign in with a session.
|
|
1226
1247
|
*/
|
|
1227
1248
|
async delete(options) {
|
|
1228
|
-
await this.httpClient.
|
|
1249
|
+
await this.httpClient.fetchStatus({
|
|
1229
1250
|
method: "DELETE",
|
|
1230
1251
|
path: resolvePath("/v1/apps/{appId}", options)
|
|
1231
1252
|
});
|
|
@@ -1406,7 +1427,7 @@ var NotificationsResource = class {
|
|
|
1406
1427
|
* An API token answers `forbidden`; sign in with a session.
|
|
1407
1428
|
*/
|
|
1408
1429
|
async updateMany(options) {
|
|
1409
|
-
await this.httpClient.
|
|
1430
|
+
await this.httpClient.fetchStatus({
|
|
1410
1431
|
body: options,
|
|
1411
1432
|
method: "PATCH",
|
|
1412
1433
|
path: resolvePath("/v1/notifications")
|
|
@@ -1544,7 +1565,7 @@ var MembersResource = class {
|
|
|
1544
1565
|
* An API token answers `forbidden`; sign in with a session.
|
|
1545
1566
|
*/
|
|
1546
1567
|
async delete(options) {
|
|
1547
|
-
await this.httpClient.
|
|
1568
|
+
await this.httpClient.fetchStatus({
|
|
1548
1569
|
method: "DELETE",
|
|
1549
1570
|
path: resolvePath("/v1/organizations/{organizationId}/members/{memberId}", options)
|
|
1550
1571
|
});
|
|
@@ -1556,7 +1577,7 @@ var MembersResource = class {
|
|
|
1556
1577
|
*/
|
|
1557
1578
|
async deleteMany(options) {
|
|
1558
1579
|
const { organizationId, ...query } = options;
|
|
1559
|
-
await this.httpClient.
|
|
1580
|
+
await this.httpClient.fetchStatus({
|
|
1560
1581
|
method: "DELETE",
|
|
1561
1582
|
path: resolvePath("/v1/organizations/{organizationId}/members", { organizationId }),
|
|
1562
1583
|
query
|
|
@@ -1677,7 +1698,7 @@ var OrganizationInvitationsResource = class {
|
|
|
1677
1698
|
* An API token answers `forbidden`; sign in with a session.
|
|
1678
1699
|
*/
|
|
1679
1700
|
async delete(options) {
|
|
1680
|
-
await this.httpClient.
|
|
1701
|
+
await this.httpClient.fetchStatus({
|
|
1681
1702
|
method: "DELETE",
|
|
1682
1703
|
path: resolvePath("/v1/organizations/{organizationId}/invitations/{invitationId}", options)
|
|
1683
1704
|
});
|
|
@@ -1688,7 +1709,7 @@ var OrganizationInvitationsResource = class {
|
|
|
1688
1709
|
*/
|
|
1689
1710
|
async deleteMany(options) {
|
|
1690
1711
|
const { organizationId, ...query } = options;
|
|
1691
|
-
await this.httpClient.
|
|
1712
|
+
await this.httpClient.fetchStatus({
|
|
1692
1713
|
method: "DELETE",
|
|
1693
1714
|
path: resolvePath("/v1/organizations/{organizationId}/invitations", { organizationId }),
|
|
1694
1715
|
query
|
|
@@ -1742,7 +1763,7 @@ var SsoProviderResource = class {
|
|
|
1742
1763
|
* An API token answers `forbidden`; sign in with a session.
|
|
1743
1764
|
*/
|
|
1744
1765
|
async delete(options) {
|
|
1745
|
-
await this.httpClient.
|
|
1766
|
+
await this.httpClient.fetchStatus({
|
|
1746
1767
|
method: "DELETE",
|
|
1747
1768
|
path: resolvePath("/v1/organizations/{organizationId}/sso-provider", options)
|
|
1748
1769
|
});
|
|
@@ -1788,7 +1809,7 @@ var SubscriptionResource = class {
|
|
|
1788
1809
|
*/
|
|
1789
1810
|
async cancel(options) {
|
|
1790
1811
|
const { organizationId, ...body } = options;
|
|
1791
|
-
await this.httpClient.
|
|
1812
|
+
await this.httpClient.fetchStatus({
|
|
1792
1813
|
body,
|
|
1793
1814
|
isRetryable: true,
|
|
1794
1815
|
method: "POST",
|
|
@@ -1801,7 +1822,7 @@ var SubscriptionResource = class {
|
|
|
1801
1822
|
* An API token answers `forbidden`; sign in with a session.
|
|
1802
1823
|
*/
|
|
1803
1824
|
async uncancel(options) {
|
|
1804
|
-
await this.httpClient.
|
|
1825
|
+
await this.httpClient.fetchStatus({
|
|
1805
1826
|
isRetryable: true,
|
|
1806
1827
|
method: "POST",
|
|
1807
1828
|
path: resolvePath("/v1/organizations/{organizationId}/subscription/uncancel", options)
|
|
@@ -1809,6 +1830,124 @@ var SubscriptionResource = class {
|
|
|
1809
1830
|
}
|
|
1810
1831
|
};
|
|
1811
1832
|
//#endregion
|
|
1833
|
+
//#region src/resources/telemetry-export-deliveries.ts
|
|
1834
|
+
/**
|
|
1835
|
+
* The delivery log of the telemetry export. Each delivery is kept for 30 days.
|
|
1836
|
+
*/
|
|
1837
|
+
var TelemetryExportDeliveriesResource = class {
|
|
1838
|
+
httpClient;
|
|
1839
|
+
constructor(httpClient) {
|
|
1840
|
+
this.httpClient = httpClient;
|
|
1841
|
+
}
|
|
1842
|
+
/**
|
|
1843
|
+
* Counts the deliveries of the telemetry export that match the filters.
|
|
1844
|
+
* An API token answers `forbidden`; sign in with a session.
|
|
1845
|
+
*/
|
|
1846
|
+
async count(options) {
|
|
1847
|
+
const { organizationId, ...query } = options;
|
|
1848
|
+
return this.httpClient.fetchJson({
|
|
1849
|
+
method: "GET",
|
|
1850
|
+
path: resolvePath("/v1/organizations/{organizationId}/telemetry-export/deliveries/count", { organizationId }),
|
|
1851
|
+
query
|
|
1852
|
+
});
|
|
1853
|
+
}
|
|
1854
|
+
/**
|
|
1855
|
+
* Lists the deliveries of the telemetry export, newest first.
|
|
1856
|
+
* Filter by `status`, and by `createdSince` and `createdUntil`, both inclusive.
|
|
1857
|
+
* An API token answers `forbidden`; sign in with a session.
|
|
1858
|
+
*/
|
|
1859
|
+
async list(options) {
|
|
1860
|
+
const { organizationId, ...query } = options;
|
|
1861
|
+
return this.httpClient.fetchJson({
|
|
1862
|
+
method: "GET",
|
|
1863
|
+
path: resolvePath("/v1/organizations/{organizationId}/telemetry-export/deliveries", { organizationId }),
|
|
1864
|
+
query
|
|
1865
|
+
});
|
|
1866
|
+
}
|
|
1867
|
+
/**
|
|
1868
|
+
* Sends the record again, once, within the request, and answers the settled delivery with its attempt count carried on.
|
|
1869
|
+
* Each call makes another attempt, so the client never retries the call.
|
|
1870
|
+
* An API token answers `forbidden`; sign in with a session.
|
|
1871
|
+
*/
|
|
1872
|
+
async redeliver(options) {
|
|
1873
|
+
return this.httpClient.fetchJson({
|
|
1874
|
+
method: "POST",
|
|
1875
|
+
path: resolvePath("/v1/organizations/{organizationId}/telemetry-export/deliveries/{deliveryId}/redeliver", options)
|
|
1876
|
+
});
|
|
1877
|
+
}
|
|
1878
|
+
};
|
|
1879
|
+
//#endregion
|
|
1880
|
+
//#region src/resources/telemetry-export.ts
|
|
1881
|
+
/**
|
|
1882
|
+
* The telemetry export of the organization, for Admins and Owners.
|
|
1883
|
+
* Setting, switching, testing and redelivering need a paying plan, and any other plan answers `plan_required`; reading and deleting do not.
|
|
1884
|
+
*/
|
|
1885
|
+
var TelemetryExportResource = class {
|
|
1886
|
+
httpClient;
|
|
1887
|
+
deliveries;
|
|
1888
|
+
constructor(httpClient) {
|
|
1889
|
+
this.httpClient = httpClient;
|
|
1890
|
+
this.deliveries = new TelemetryExportDeliveriesResource(httpClient);
|
|
1891
|
+
}
|
|
1892
|
+
/**
|
|
1893
|
+
* Removes the telemetry export with its delivery log, on any plan.
|
|
1894
|
+
* An API token answers `forbidden`; sign in with a session.
|
|
1895
|
+
*/
|
|
1896
|
+
async delete(options) {
|
|
1897
|
+
await this.httpClient.fetchStatus({
|
|
1898
|
+
method: "DELETE",
|
|
1899
|
+
path: resolvePath("/v1/organizations/{organizationId}/telemetry-export", options)
|
|
1900
|
+
});
|
|
1901
|
+
}
|
|
1902
|
+
/**
|
|
1903
|
+
* Gets the telemetry export of the organization; an organization without one answers `not_found`.
|
|
1904
|
+
* An API token answers `forbidden`; sign in with a session.
|
|
1905
|
+
*/
|
|
1906
|
+
async get(options) {
|
|
1907
|
+
return this.httpClient.fetchJson({
|
|
1908
|
+
method: "GET",
|
|
1909
|
+
path: resolvePath("/v1/organizations/{organizationId}/telemetry-export", options)
|
|
1910
|
+
});
|
|
1911
|
+
}
|
|
1912
|
+
/**
|
|
1913
|
+
* Sets the OTLP/HTTP base URL, the `headers` that carry the vendor's credentials and the `signals`, replacing the export before.
|
|
1914
|
+
* A URL ending in a signal path answers `url_signal_path`, and a `content-type`, `content-length` or `host` header `header_reserved`.
|
|
1915
|
+
* The export starts enabled.
|
|
1916
|
+
* An API token answers `forbidden`; sign in with a session.
|
|
1917
|
+
*/
|
|
1918
|
+
async set(options) {
|
|
1919
|
+
const { organizationId, ...body } = options;
|
|
1920
|
+
return this.httpClient.fetchJson({
|
|
1921
|
+
body,
|
|
1922
|
+
method: "PUT",
|
|
1923
|
+
path: resolvePath("/v1/organizations/{organizationId}/telemetry-export", { organizationId })
|
|
1924
|
+
});
|
|
1925
|
+
}
|
|
1926
|
+
/**
|
|
1927
|
+
* Sends one delivery per signal within the request, a `telemetry_export.test` log record and the current metrics document, and answers the settled deliveries.
|
|
1928
|
+
* Each call sends again, so the client never retries the call.
|
|
1929
|
+
* An API token answers `forbidden`; sign in with a session.
|
|
1930
|
+
*/
|
|
1931
|
+
async test(options) {
|
|
1932
|
+
return this.httpClient.fetchJson({
|
|
1933
|
+
method: "POST",
|
|
1934
|
+
path: resolvePath("/v1/organizations/{organizationId}/telemetry-export/test", options)
|
|
1935
|
+
});
|
|
1936
|
+
}
|
|
1937
|
+
/**
|
|
1938
|
+
* Switches the telemetry export on or off. `isEnabled: false` stamps `disabledAt`; `isEnabled: true` clears it and resets the count of failed deliveries in a row.
|
|
1939
|
+
* An API token answers `forbidden`; sign in with a session.
|
|
1940
|
+
*/
|
|
1941
|
+
async update(options) {
|
|
1942
|
+
const { organizationId, ...body } = options;
|
|
1943
|
+
return this.httpClient.fetchJson({
|
|
1944
|
+
body,
|
|
1945
|
+
method: "PATCH",
|
|
1946
|
+
path: resolvePath("/v1/organizations/{organizationId}/telemetry-export", { organizationId })
|
|
1947
|
+
});
|
|
1948
|
+
}
|
|
1949
|
+
};
|
|
1950
|
+
//#endregion
|
|
1812
1951
|
//#region src/resources/usage-apps.ts
|
|
1813
1952
|
var UsageAppsResource = class {
|
|
1814
1953
|
httpClient;
|
|
@@ -1969,7 +2108,7 @@ var WebhooksResource = class {
|
|
|
1969
2108
|
* An API token answers `forbidden`; sign in with a session.
|
|
1970
2109
|
*/
|
|
1971
2110
|
async delete(options) {
|
|
1972
|
-
await this.httpClient.
|
|
2111
|
+
await this.httpClient.fetchStatus({
|
|
1973
2112
|
method: "DELETE",
|
|
1974
2113
|
path: resolvePath("/v1/organizations/{organizationId}/webhooks/{webhookId}", options)
|
|
1975
2114
|
});
|
|
@@ -2009,7 +2148,7 @@ var WebhooksResource = class {
|
|
|
2009
2148
|
}
|
|
2010
2149
|
/**
|
|
2011
2150
|
* Changes the name, the URL, the subscribed `events`, the app filter or `isEnabled`. The format and the secret never change.
|
|
2012
|
-
*
|
|
2151
|
+
* `isEnabled: false` stamps `disabledAt`; `isEnabled: true` clears it and resets the count of failed deliveries in a row.
|
|
2013
2152
|
* An API token answers `forbidden`; sign in with a session.
|
|
2014
2153
|
*/
|
|
2015
2154
|
async update(options) {
|
|
@@ -2037,6 +2176,7 @@ var OrganizationsResource = class {
|
|
|
2037
2176
|
members;
|
|
2038
2177
|
ssoProvider;
|
|
2039
2178
|
subscription;
|
|
2179
|
+
telemetryExport;
|
|
2040
2180
|
usage;
|
|
2041
2181
|
webhooks;
|
|
2042
2182
|
constructor(httpClient) {
|
|
@@ -2050,6 +2190,7 @@ var OrganizationsResource = class {
|
|
|
2050
2190
|
this.members = new MembersResource(httpClient);
|
|
2051
2191
|
this.ssoProvider = new SsoProviderResource(httpClient);
|
|
2052
2192
|
this.subscription = new SubscriptionResource(httpClient);
|
|
2193
|
+
this.telemetryExport = new TelemetryExportResource(httpClient);
|
|
2053
2194
|
this.usage = new UsageResource(httpClient);
|
|
2054
2195
|
this.webhooks = new WebhooksResource(httpClient);
|
|
2055
2196
|
}
|
|
@@ -2080,7 +2221,7 @@ var OrganizationsResource = class {
|
|
|
2080
2221
|
* An API token answers `forbidden`; sign in with a session.
|
|
2081
2222
|
*/
|
|
2082
2223
|
async delete(options) {
|
|
2083
|
-
await this.httpClient.
|
|
2224
|
+
await this.httpClient.fetchStatus({
|
|
2084
2225
|
method: "DELETE",
|
|
2085
2226
|
path: resolvePath("/v1/organizations/{organizationId}", options)
|
|
2086
2227
|
});
|
|
@@ -2148,7 +2289,7 @@ var UserPasswordResource = class {
|
|
|
2148
2289
|
*/
|
|
2149
2290
|
async create(options) {
|
|
2150
2291
|
const { userId, ...body } = options;
|
|
2151
|
-
await this.httpClient.
|
|
2292
|
+
await this.httpClient.fetchStatus({
|
|
2152
2293
|
body,
|
|
2153
2294
|
method: "POST",
|
|
2154
2295
|
path: resolvePath("/v1/users/{userId}/password", { userId })
|
|
@@ -2169,7 +2310,7 @@ var UserSessionsResource = class {
|
|
|
2169
2310
|
*/
|
|
2170
2311
|
async deleteMany(options) {
|
|
2171
2312
|
const { userId, ...query } = options;
|
|
2172
|
-
await this.httpClient.
|
|
2313
|
+
await this.httpClient.fetchStatus({
|
|
2173
2314
|
method: "DELETE",
|
|
2174
2315
|
path: resolvePath("/v1/users/{userId}/sessions", { userId }),
|
|
2175
2316
|
query
|
|
@@ -2190,7 +2331,7 @@ var UserTokensResource = class {
|
|
|
2190
2331
|
*/
|
|
2191
2332
|
async deleteMany(options) {
|
|
2192
2333
|
const { userId, ...query } = options;
|
|
2193
|
-
await this.httpClient.
|
|
2334
|
+
await this.httpClient.fetchStatus({
|
|
2194
2335
|
method: "DELETE",
|
|
2195
2336
|
path: resolvePath("/v1/users/{userId}/tokens", { userId }),
|
|
2196
2337
|
query
|
|
@@ -2218,7 +2359,7 @@ var UsersResource = class {
|
|
|
2218
2359
|
*/
|
|
2219
2360
|
async delete(options) {
|
|
2220
2361
|
const { userId, ...body } = options;
|
|
2221
|
-
await this.httpClient.
|
|
2362
|
+
await this.httpClient.fetchStatus({
|
|
2222
2363
|
body,
|
|
2223
2364
|
method: "DELETE",
|
|
2224
2365
|
path: resolvePath("/v1/users/{userId}", { userId })
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hotcodepush/node",
|
|
3
3
|
"description": "The typed Node client for the HotCodePush REST API",
|
|
4
|
-
"version": "0.0
|
|
4
|
+
"version": "0.1.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"keywords": [
|
|
7
7
|
"hotcodepush",
|
|
@@ -47,7 +47,8 @@
|
|
|
47
47
|
"prepublishOnly": "npm run build",
|
|
48
48
|
"sync-openapi": "node scripts/sync-openapi.ts",
|
|
49
49
|
"test": "vitest run",
|
|
50
|
-
"typecheck": "npm run generate -- --check && tsc --noEmit"
|
|
50
|
+
"typecheck": "npm run generate -- --check && tsc --noEmit",
|
|
51
|
+
"verify": "npm run lint && npm run typecheck && npm test && npm run build"
|
|
51
52
|
},
|
|
52
53
|
"devDependencies": {
|
|
53
54
|
"@eslint/js": "10.0.1",
|