@dropthis/cli 0.24.0 → 0.25.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/cli.cjs +24 -5
- package/dist/cli.cjs.map +1 -1
- package/node_modules/@dropthis/node/README.md +14 -13
- package/node_modules/@dropthis/node/dist/{drops-O6ymlqmb.d.cts → drops-BVoN5MaZ.d.cts} +16 -21
- package/node_modules/@dropthis/node/dist/{drops-O6ymlqmb.d.ts → drops-BVoN5MaZ.d.ts} +16 -21
- package/node_modules/@dropthis/node/dist/edge.cjs +33 -22
- 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 +33 -22
- package/node_modules/@dropthis/node/dist/edge.mjs.map +1 -1
- package/node_modules/@dropthis/node/dist/index.cjs +33 -24
- package/node_modules/@dropthis/node/dist/index.cjs.map +1 -1
- package/node_modules/@dropthis/node/dist/index.d.cts +2 -2
- package/node_modules/@dropthis/node/dist/index.d.ts +2 -2
- package/node_modules/@dropthis/node/dist/index.mjs +33 -23
- 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,
|
|
1
|
+
import { U as Transport, v as DropthisResult, E as EmailOtpResponse, Q as SessionResponse, C as CreateUploadSessionRequest, e as CreateUploadSessionResponse, Y as UploadSessionResponse, t as DropthisClientOptions, d as ApiKeysResource, a as AccountResource, s as DropsResource, H as PublishInput, h as DeploymentsResource, m as DomainsResource, J as PublishOptions, z as PreparedPublishRequest } from './drops-BVoN5MaZ.cjs';
|
|
2
|
+
export { A as AccountLimits, b as AccountResponse, c as ActionResolve, f as CursorPage, D as DeploymentContentFile, g as DeploymentContentManifest, i as DnsRecord, j as DomainDeletedResponse, k as DomainListResponse, l as DomainResponse, n as DropAction, o as DropContentFile, p as DropDeploymentResponse, q as DropOptions, r as DropResponse, u as DropthisErrorResponse, G as GetContentOptions, I as InMemoryPublishInput, K as KeyType, L as Limitations, w as ListDeploymentsParams, x as ListDeploymentsResponse, y as ListPage, N as NextHint, P as PrepareOptions, B as PreparedUploadFile, F as PublishFileInput, R as RequestControls, M as RequestOptions, O as RevokeImpact, S as SHARED_POOL, T as TierInfo, V as UpdateContentOptions, W as UploadManifestFile, X as UploadSessionFileResponse, Z as UploadTarget } from './drops-BVoN5MaZ.cjs';
|
|
3
3
|
|
|
4
4
|
declare class AuthResource {
|
|
5
5
|
private readonly transport;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as AccountLimits, b as AccountResponse, c as ActionResolve, f as CursorPage,
|
|
1
|
+
import { U as Transport, v as DropthisResult, E as EmailOtpResponse, Q as SessionResponse, C as CreateUploadSessionRequest, e as CreateUploadSessionResponse, Y as UploadSessionResponse, t as DropthisClientOptions, d as ApiKeysResource, a as AccountResource, s as DropsResource, H as PublishInput, h as DeploymentsResource, m as DomainsResource, J as PublishOptions, z as PreparedPublishRequest } from './drops-BVoN5MaZ.js';
|
|
2
|
+
export { A as AccountLimits, b as AccountResponse, c as ActionResolve, f as CursorPage, D as DeploymentContentFile, g as DeploymentContentManifest, i as DnsRecord, j as DomainDeletedResponse, k as DomainListResponse, l as DomainResponse, n as DropAction, o as DropContentFile, p as DropDeploymentResponse, q as DropOptions, r as DropResponse, u as DropthisErrorResponse, G as GetContentOptions, I as InMemoryPublishInput, K as KeyType, L as Limitations, w as ListDeploymentsParams, x as ListDeploymentsResponse, y as ListPage, N as NextHint, P as PrepareOptions, B as PreparedUploadFile, F as PublishFileInput, R as RequestControls, M as RequestOptions, O as RevokeImpact, S as SHARED_POOL, T as TierInfo, V as UpdateContentOptions, W as UploadManifestFile, X as UploadSessionFileResponse, Z as UploadTarget } from './drops-BVoN5MaZ.js';
|
|
3
3
|
|
|
4
4
|
declare class AuthResource {
|
|
5
5
|
private readonly transport;
|
|
@@ -811,45 +811,55 @@ var DomainsResource = class {
|
|
|
811
811
|
};
|
|
812
812
|
|
|
813
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
|
-
};
|
|
824
814
|
var CursorPage = class {
|
|
825
815
|
object = "list";
|
|
826
816
|
data;
|
|
827
817
|
hasMore;
|
|
828
818
|
nextCursor;
|
|
819
|
+
/** Response headers from the fetch that produced this page. */
|
|
820
|
+
headers;
|
|
829
821
|
fetchNextPage;
|
|
830
822
|
constructor(input) {
|
|
831
823
|
this.data = input.data;
|
|
832
824
|
this.hasMore = input.hasMore;
|
|
833
825
|
this.nextCursor = input.nextCursor;
|
|
826
|
+
this.headers = input.headers ?? {};
|
|
834
827
|
this.fetchNextPage = input.fetchNextPage;
|
|
835
828
|
}
|
|
829
|
+
/**
|
|
830
|
+
* Collect items across every page into a single array.
|
|
831
|
+
*
|
|
832
|
+
* No-throw, consistent with the rest of the SDK's {@link DropthisResult}
|
|
833
|
+
* contract: returns `{ data: items, error: null }` on success, or
|
|
834
|
+
* `{ data: null, error }` if fetching a later page fails — never a thrown
|
|
835
|
+
* exception, and never a silently truncated list. Inspect `.error`
|
|
836
|
+
* (`code`/`statusCode`/`retryable`/`requestId`) exactly as you would for any
|
|
837
|
+
* other call. Pass `limit` to stop once that many items are collected.
|
|
838
|
+
*/
|
|
836
839
|
async autoPagingToArray(options = {}) {
|
|
837
|
-
const
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
if (options.limit !== void 0 && items.length >= options.limit) break;
|
|
840
|
+
const { limit } = options;
|
|
841
|
+
if (limit !== void 0 && limit <= 0) {
|
|
842
|
+
return { data: [], error: null, headers: this.headers };
|
|
841
843
|
}
|
|
842
|
-
|
|
843
|
-
}
|
|
844
|
-
async *[Symbol.asyncIterator]() {
|
|
845
|
-
for (const item of this.data) yield item;
|
|
844
|
+
const items = [];
|
|
846
845
|
let current = this;
|
|
847
|
-
|
|
846
|
+
let lastHeaders = this.headers;
|
|
847
|
+
while (current) {
|
|
848
|
+
for (const item of current.data) {
|
|
849
|
+
items.push(item);
|
|
850
|
+
if (limit !== void 0 && items.length >= limit) {
|
|
851
|
+
return { data: items, error: null, headers: lastHeaders };
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
if (!current.hasMore || !current.fetchNextPage) break;
|
|
848
855
|
const next = await current.fetchNextPage();
|
|
849
|
-
if (next.error)
|
|
856
|
+
if (next.error) {
|
|
857
|
+
return { data: null, error: next.error, headers: next.headers };
|
|
858
|
+
}
|
|
859
|
+
lastHeaders = next.headers;
|
|
850
860
|
current = next.data;
|
|
851
|
-
for (const item of current.data) yield item;
|
|
852
861
|
}
|
|
862
|
+
return { data: items, error: null, headers: lastHeaders };
|
|
853
863
|
}
|
|
854
864
|
};
|
|
855
865
|
|
|
@@ -918,6 +928,7 @@ var DropsResource = class {
|
|
|
918
928
|
data: result.data.drops,
|
|
919
929
|
nextCursor: result.data.nextCursor,
|
|
920
930
|
hasMore: result.data.nextCursor !== null,
|
|
931
|
+
headers: result.headers,
|
|
921
932
|
fetchNextPage: result.data.nextCursor ? () => this.list({ ...params, cursor: result.data.nextCursor }) : void 0
|
|
922
933
|
});
|
|
923
934
|
return { data: page, error: null, headers: result.headers };
|
|
@@ -1101,7 +1112,7 @@ function toSnakeCase(value) {
|
|
|
1101
1112
|
|
|
1102
1113
|
// src/transport.ts
|
|
1103
1114
|
var DEFAULT_BASE_URL = "https://api.dropthis.app";
|
|
1104
|
-
var SDK_VERSION = "0.
|
|
1115
|
+
var SDK_VERSION = "0.22.0";
|
|
1105
1116
|
var Transport = class {
|
|
1106
1117
|
apiKey;
|
|
1107
1118
|
baseUrl;
|
|
@@ -1395,7 +1406,6 @@ var Dropthis = class {
|
|
|
1395
1406
|
var SHARED_POOL = "shared";
|
|
1396
1407
|
export {
|
|
1397
1408
|
CursorPage,
|
|
1398
|
-
CursorPaginationError,
|
|
1399
1409
|
DeploymentsResource,
|
|
1400
1410
|
DomainsResource,
|
|
1401
1411
|
Dropthis,
|