@dropthis/cli 0.23.0 → 0.24.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/README.md +2 -2
- package/dist/cli.cjs +35 -47
- package/dist/cli.cjs.map +1 -1
- package/node_modules/@dropthis/node/README.md +28 -0
- package/node_modules/@dropthis/node/dist/{drops-DNwOp7g_.d.cts → drops-O6ymlqmb.d.cts} +56 -4
- package/node_modules/@dropthis/node/dist/{drops-DNwOp7g_.d.ts → drops-O6ymlqmb.d.ts} +56 -4
- package/node_modules/@dropthis/node/dist/edge.cjs +23 -6
- package/node_modules/@dropthis/node/dist/edge.cjs.map +1 -1
- package/node_modules/@dropthis/node/dist/edge.d.cts +1 -1
- package/node_modules/@dropthis/node/dist/edge.d.ts +1 -1
- package/node_modules/@dropthis/node/dist/edge.mjs +23 -6
- package/node_modules/@dropthis/node/dist/edge.mjs.map +1 -1
- package/node_modules/@dropthis/node/dist/index.cjs +31 -6
- package/node_modules/@dropthis/node/dist/index.cjs.map +1 -1
- package/node_modules/@dropthis/node/dist/index.d.cts +8 -2
- package/node_modules/@dropthis/node/dist/index.d.ts +8 -2
- package/node_modules/@dropthis/node/dist/index.mjs +30 -6
- package/node_modules/@dropthis/node/dist/index.mjs.map +1 -1
- package/node_modules/@dropthis/node/package.json +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as AccountLimits, b as AccountResponse, c as ActionResolve, f as CursorPage, D as DeploymentContentFile,
|
|
1
|
+
import { V as Transport, w as DropthisResult, E as EmailOtpResponse, T as SessionResponse, C as CreateUploadSessionRequest, e as CreateUploadSessionResponse, Z as UploadSessionResponse, u as DropthisClientOptions, d as ApiKeysResource, a as AccountResource, t as DropsResource, J as PublishInput, i as DeploymentsResource, n as DomainsResource, M as PublishOptions, B as PreparedPublishRequest } from './drops-O6ymlqmb.cjs';
|
|
2
|
+
export { A as AccountLimits, b as AccountResponse, c as ActionResolve, f as CursorPage, g as CursorPaginationError, D as DeploymentContentFile, h as DeploymentContentManifest, j as DnsRecord, k as DomainDeletedResponse, l as DomainListResponse, m as DomainResponse, o as DropAction, p as DropContentFile, q as DropDeploymentResponse, r as DropOptions, s as DropResponse, v as DropthisErrorResponse, G as GetContentOptions, I as InMemoryPublishInput, K as KeyType, L as Limitations, x as ListDeploymentsParams, y as ListDeploymentsResponse, z as ListPage, N as NextHint, P as PrepareOptions, F as PreparedUploadFile, H as PublishFileInput, R as RequestControls, O as RequestOptions, Q as RevokeImpact, S as SHARED_POOL, U as TierInfo, W as UpdateContentOptions, X as UploadManifestFile, Y as UploadSessionFileResponse, _ as UploadTarget } from './drops-O6ymlqmb.cjs';
|
|
3
3
|
|
|
4
4
|
declare class AuthResource {
|
|
5
5
|
private readonly transport;
|
|
@@ -7,6 +7,12 @@ declare class AuthResource {
|
|
|
7
7
|
requestEmailOtp(input: {
|
|
8
8
|
email: string;
|
|
9
9
|
}): Promise<DropthisResult<EmailOtpResponse>>;
|
|
10
|
+
/**
|
|
11
|
+
* Verify an email OTP and exchange it for a short-lived `at_` session token.
|
|
12
|
+
* On failure the error `code` distinguishes `otp_expired` (no active code —
|
|
13
|
+
* request a new one) from `otp_invalid` (wrong digits — re-check, do not
|
|
14
|
+
* auto-resend). 401 on either. See dropthis#80.
|
|
15
|
+
*/
|
|
10
16
|
verifyEmailOtp(input: {
|
|
11
17
|
email: string;
|
|
12
18
|
code: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as AccountLimits, b as AccountResponse, c as ActionResolve, f as CursorPage, D as DeploymentContentFile,
|
|
1
|
+
import { V as Transport, w as DropthisResult, E as EmailOtpResponse, T as SessionResponse, C as CreateUploadSessionRequest, e as CreateUploadSessionResponse, Z as UploadSessionResponse, u as DropthisClientOptions, d as ApiKeysResource, a as AccountResource, t as DropsResource, J as PublishInput, i as DeploymentsResource, n as DomainsResource, M as PublishOptions, B as PreparedPublishRequest } from './drops-O6ymlqmb.js';
|
|
2
|
+
export { A as AccountLimits, b as AccountResponse, c as ActionResolve, f as CursorPage, g as CursorPaginationError, D as DeploymentContentFile, h as DeploymentContentManifest, j as DnsRecord, k as DomainDeletedResponse, l as DomainListResponse, m as DomainResponse, o as DropAction, p as DropContentFile, q as DropDeploymentResponse, r as DropOptions, s as DropResponse, v as DropthisErrorResponse, G as GetContentOptions, I as InMemoryPublishInput, K as KeyType, L as Limitations, x as ListDeploymentsParams, y as ListDeploymentsResponse, z as ListPage, N as NextHint, P as PrepareOptions, F as PreparedUploadFile, H as PublishFileInput, R as RequestControls, O as RequestOptions, Q as RevokeImpact, S as SHARED_POOL, U as TierInfo, W as UpdateContentOptions, X as UploadManifestFile, Y as UploadSessionFileResponse, _ as UploadTarget } from './drops-O6ymlqmb.js';
|
|
3
3
|
|
|
4
4
|
declare class AuthResource {
|
|
5
5
|
private readonly transport;
|
|
@@ -7,6 +7,12 @@ declare class AuthResource {
|
|
|
7
7
|
requestEmailOtp(input: {
|
|
8
8
|
email: string;
|
|
9
9
|
}): Promise<DropthisResult<EmailOtpResponse>>;
|
|
10
|
+
/**
|
|
11
|
+
* Verify an email OTP and exchange it for a short-lived `at_` session token.
|
|
12
|
+
* On failure the error `code` distinguishes `otp_expired` (no active code —
|
|
13
|
+
* request a new one) from `otp_invalid` (wrong digits — re-check, do not
|
|
14
|
+
* auto-resend). 401 on either. See dropthis#80.
|
|
15
|
+
*/
|
|
10
16
|
verifyEmailOtp(input: {
|
|
11
17
|
email: string;
|
|
12
18
|
code: string;
|
|
@@ -710,6 +710,12 @@ var AuthResource = class {
|
|
|
710
710
|
authenticated: false
|
|
711
711
|
});
|
|
712
712
|
}
|
|
713
|
+
/**
|
|
714
|
+
* Verify an email OTP and exchange it for a short-lived `at_` session token.
|
|
715
|
+
* On failure the error `code` distinguishes `otp_expired` (no active code —
|
|
716
|
+
* request a new one) from `otp_invalid` (wrong digits — re-check, do not
|
|
717
|
+
* auto-resend). 401 on either. See dropthis#80.
|
|
718
|
+
*/
|
|
713
719
|
verifyEmailOtp(input) {
|
|
714
720
|
return this.transport.request("POST", "/auth/email/verify", {
|
|
715
721
|
body: input,
|
|
@@ -805,6 +811,16 @@ var DomainsResource = class {
|
|
|
805
811
|
};
|
|
806
812
|
|
|
807
813
|
// src/pagination.ts
|
|
814
|
+
var CursorPaginationError = class extends Error {
|
|
815
|
+
constructor(error, headers = {}) {
|
|
816
|
+
super(`Failed to fetch next page: ${error.code} \u2014 ${error.message}`);
|
|
817
|
+
this.error = error;
|
|
818
|
+
this.headers = headers;
|
|
819
|
+
this.name = "CursorPaginationError";
|
|
820
|
+
}
|
|
821
|
+
error;
|
|
822
|
+
headers;
|
|
823
|
+
};
|
|
808
824
|
var CursorPage = class {
|
|
809
825
|
object = "list";
|
|
810
826
|
data;
|
|
@@ -830,7 +846,7 @@ var CursorPage = class {
|
|
|
830
846
|
let current = this;
|
|
831
847
|
while (current.hasMore && current.fetchNextPage) {
|
|
832
848
|
const next = await current.fetchNextPage();
|
|
833
|
-
if (next.error)
|
|
849
|
+
if (next.error) throw new CursorPaginationError(next.error, next.headers);
|
|
834
850
|
current = next.data;
|
|
835
851
|
for (const item of current.data) yield item;
|
|
836
852
|
}
|
|
@@ -1085,7 +1101,7 @@ function toSnakeCase(value) {
|
|
|
1085
1101
|
|
|
1086
1102
|
// src/transport.ts
|
|
1087
1103
|
var DEFAULT_BASE_URL = "https://api.dropthis.app";
|
|
1088
|
-
var SDK_VERSION = "0.
|
|
1104
|
+
var SDK_VERSION = "0.21.0";
|
|
1089
1105
|
var Transport = class {
|
|
1090
1106
|
apiKey;
|
|
1091
1107
|
baseUrl;
|
|
@@ -1124,7 +1140,10 @@ var Transport = class {
|
|
|
1124
1140
|
`signed_upload_${response.status}`,
|
|
1125
1141
|
text || response.statusText,
|
|
1126
1142
|
response.status,
|
|
1127
|
-
|
|
1143
|
+
// A 5xx from object storage is a transient upstream failure — safe to
|
|
1144
|
+
// re-PUT. A 4xx (e.g. 403 expired/denied signed URL) won't fix itself on
|
|
1145
|
+
// a blind retry, so leave it unmarked.
|
|
1146
|
+
{ headers: responseHeaders, retryable: response.status >= 500 }
|
|
1128
1147
|
);
|
|
1129
1148
|
}
|
|
1130
1149
|
return {
|
|
@@ -1139,7 +1158,8 @@ var Transport = class {
|
|
|
1139
1158
|
return createErrorResult(
|
|
1140
1159
|
error instanceof Error && error.name === "AbortError" ? "timeout" : "network_error",
|
|
1141
1160
|
message,
|
|
1142
|
-
null
|
|
1161
|
+
null,
|
|
1162
|
+
{ retryable: true }
|
|
1143
1163
|
);
|
|
1144
1164
|
} finally {
|
|
1145
1165
|
clearTimeout(timeout);
|
|
@@ -1196,7 +1216,8 @@ var Transport = class {
|
|
|
1196
1216
|
return createErrorResult(
|
|
1197
1217
|
error instanceof Error && error.name === "AbortError" ? "timeout" : "network_error",
|
|
1198
1218
|
message,
|
|
1199
|
-
null
|
|
1219
|
+
null,
|
|
1220
|
+
{ retryable: true }
|
|
1200
1221
|
);
|
|
1201
1222
|
} finally {
|
|
1202
1223
|
clearTimeout(timeout);
|
|
@@ -1257,10 +1278,12 @@ var Transport = class {
|
|
|
1257
1278
|
};
|
|
1258
1279
|
} catch (error) {
|
|
1259
1280
|
const message = error instanceof Error && error.name === "AbortError" ? "Request timed out" : error instanceof Error ? error.message : "Network error";
|
|
1281
|
+
const retrySafe = method.toUpperCase() === "GET" || options.idempotencyKey !== void 0;
|
|
1260
1282
|
return createErrorResult(
|
|
1261
1283
|
error instanceof Error && error.name === "AbortError" ? "timeout" : "network_error",
|
|
1262
1284
|
message,
|
|
1263
|
-
null
|
|
1285
|
+
null,
|
|
1286
|
+
retrySafe ? { retryable: true } : {}
|
|
1264
1287
|
);
|
|
1265
1288
|
} finally {
|
|
1266
1289
|
clearTimeout(timeout);
|
|
@@ -1372,6 +1395,7 @@ var Dropthis = class {
|
|
|
1372
1395
|
var SHARED_POOL = "shared";
|
|
1373
1396
|
export {
|
|
1374
1397
|
CursorPage,
|
|
1398
|
+
CursorPaginationError,
|
|
1375
1399
|
DeploymentsResource,
|
|
1376
1400
|
DomainsResource,
|
|
1377
1401
|
Dropthis,
|