@dropthis/cli 0.3.5 → 0.4.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 +10 -4
- package/dist/cli.cjs.map +1 -1
- package/node_modules/@dropthis/node/README.md +181 -53
- package/node_modules/@dropthis/node/dist/index.cjs +178 -157
- package/node_modules/@dropthis/node/dist/index.cjs.map +1 -1
- package/node_modules/@dropthis/node/dist/index.d.cts +87 -26
- package/node_modules/@dropthis/node/dist/index.d.ts +87 -26
- package/node_modules/@dropthis/node/dist/index.mjs +177 -157
- 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
|
@@ -19,6 +19,8 @@ type DropthisErrorResponse = {
|
|
|
19
19
|
param?: string | null;
|
|
20
20
|
currentRevision?: number;
|
|
21
21
|
requestId?: string | null;
|
|
22
|
+
suggestion?: string | null;
|
|
23
|
+
retryable?: boolean | null;
|
|
22
24
|
};
|
|
23
25
|
type DropthisResult<T> = {
|
|
24
26
|
data: T;
|
|
@@ -29,6 +31,28 @@ type DropthisResult<T> = {
|
|
|
29
31
|
error: DropthisErrorResponse;
|
|
30
32
|
headers: Record<string, string>;
|
|
31
33
|
};
|
|
34
|
+
type ActionResolve = {
|
|
35
|
+
method: string;
|
|
36
|
+
url?: string | null;
|
|
37
|
+
endpoint?: string | null;
|
|
38
|
+
};
|
|
39
|
+
type DropAction = {
|
|
40
|
+
code: string;
|
|
41
|
+
kind: "api" | "human";
|
|
42
|
+
priority: "required" | "suggested";
|
|
43
|
+
message: string;
|
|
44
|
+
resolve?: ActionResolve | null;
|
|
45
|
+
};
|
|
46
|
+
type TierInfo = {
|
|
47
|
+
name: string;
|
|
48
|
+
maxSizeBytes: number;
|
|
49
|
+
ttlDays: number | null;
|
|
50
|
+
persistent: boolean;
|
|
51
|
+
badge: boolean;
|
|
52
|
+
};
|
|
53
|
+
type Limitations = {
|
|
54
|
+
actions: DropAction[];
|
|
55
|
+
};
|
|
32
56
|
type DropResponse = {
|
|
33
57
|
id: string;
|
|
34
58
|
slug: string;
|
|
@@ -47,6 +71,12 @@ type DropResponse = {
|
|
|
47
71
|
warnings: Array<Record<string, unknown>>;
|
|
48
72
|
createdAt: string;
|
|
49
73
|
expiresAt: string | null;
|
|
74
|
+
object: string;
|
|
75
|
+
accessible: boolean;
|
|
76
|
+
persistent: boolean;
|
|
77
|
+
badgeApplied: boolean;
|
|
78
|
+
tier: TierInfo;
|
|
79
|
+
limitations: Limitations;
|
|
50
80
|
};
|
|
51
81
|
type DropDeploymentResponse = {
|
|
52
82
|
id: string;
|
|
@@ -86,9 +116,17 @@ type ListPage<T> = {
|
|
|
86
116
|
}): Promise<T[]>;
|
|
87
117
|
[Symbol.asyncIterator](): AsyncIterableIterator<T>;
|
|
88
118
|
};
|
|
119
|
+
type Action = {
|
|
120
|
+
code: string;
|
|
121
|
+
kind: string;
|
|
122
|
+
method?: string | null;
|
|
123
|
+
endpoint?: string | null;
|
|
124
|
+
message: string;
|
|
125
|
+
};
|
|
89
126
|
type EmailOtpResponse = {
|
|
90
127
|
ok: true;
|
|
91
128
|
expiresIn: number;
|
|
129
|
+
nextAction?: Action | null;
|
|
92
130
|
};
|
|
93
131
|
type SessionResponse = {
|
|
94
132
|
object: "session";
|
|
@@ -160,11 +198,13 @@ type UploadSessionResponse = {
|
|
|
160
198
|
expiresAt: string;
|
|
161
199
|
entry?: string | null;
|
|
162
200
|
files: UploadSessionFileResponse[];
|
|
201
|
+
nextAction?: Action | null;
|
|
163
202
|
};
|
|
164
203
|
type CreateUploadSessionResponse = {
|
|
165
204
|
uploadId: string;
|
|
166
205
|
expiresAt: string;
|
|
167
206
|
files: CreateUploadSessionFileResponse[];
|
|
207
|
+
nextAction?: Action | null;
|
|
168
208
|
};
|
|
169
209
|
type CreateUploadPartTargetsRequest = {
|
|
170
210
|
fileId: string;
|
|
@@ -189,39 +229,41 @@ type CompleteUploadSessionRequest = {
|
|
|
189
229
|
}> | null;
|
|
190
230
|
}>;
|
|
191
231
|
};
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
readonly data: T[];
|
|
195
|
-
readonly hasMore: boolean;
|
|
196
|
-
readonly nextCursor: string | null;
|
|
197
|
-
private readonly fetchNextPage;
|
|
198
|
-
constructor(input: {
|
|
199
|
-
data: T[];
|
|
200
|
-
hasMore: boolean;
|
|
201
|
-
nextCursor: string | null;
|
|
202
|
-
fetchNextPage?: (() => Promise<DropthisResult<CursorPage<T>>>) | undefined;
|
|
203
|
-
});
|
|
204
|
-
autoPagingToArray(options?: {
|
|
205
|
-
limit?: number;
|
|
206
|
-
}): Promise<T[]>;
|
|
207
|
-
[Symbol.asyncIterator](): AsyncIterableIterator<T>;
|
|
208
|
-
}
|
|
209
|
-
type PublishOptions = {
|
|
232
|
+
type DropOptions = {
|
|
233
|
+
/** Change the vanity slug (update only). */
|
|
210
234
|
slug?: string;
|
|
235
|
+
/** Drop title. */
|
|
211
236
|
title?: string;
|
|
237
|
+
/** public (default) or unlisted. */
|
|
212
238
|
visibility?: "public" | "unlisted";
|
|
239
|
+
/** Require password to view. Pass `null` to remove password protection. */
|
|
213
240
|
password?: string | null;
|
|
241
|
+
/** Prevent search-engine indexing. Pass `null` to allow indexing (default). */
|
|
214
242
|
noindex?: boolean | null;
|
|
243
|
+
/** Auto-delete after this ISO 8601 date. Pass `null` to clear. */
|
|
215
244
|
expiresAt?: string | Date | null;
|
|
245
|
+
/** Entry file for multi-file bundles (default: index.html). */
|
|
216
246
|
entry?: string;
|
|
247
|
+
/** Attach JSON key-value pairs, e.g. `{ source: "ci" }`. */
|
|
217
248
|
metadata?: Record<string, unknown>;
|
|
218
|
-
|
|
219
|
-
|
|
249
|
+
};
|
|
250
|
+
type PrepareOptions = {
|
|
251
|
+
/** Glob patterns to ignore when publishing directories. */
|
|
220
252
|
ignore?: string[];
|
|
253
|
+
/** Disable default ignore patterns. */
|
|
221
254
|
ignoreDefaults?: boolean;
|
|
255
|
+
/** Override MIME type (auto-detected from extension). */
|
|
222
256
|
contentType?: string;
|
|
257
|
+
/** Set filename when publishing from stdin or bytes. */
|
|
223
258
|
path?: string;
|
|
224
259
|
};
|
|
260
|
+
type RequestControls = {
|
|
261
|
+
/** Prevent duplicate publishes on retry (auto-generated by CLI). */
|
|
262
|
+
idempotencyKey?: string;
|
|
263
|
+
/** Fail if current revision doesn't match -- optimistic lock (update only). */
|
|
264
|
+
ifRevision?: number;
|
|
265
|
+
};
|
|
266
|
+
type PublishOptions = DropOptions & PrepareOptions & RequestControls;
|
|
225
267
|
type ExplicitPublishInput = {
|
|
226
268
|
content: string;
|
|
227
269
|
contentType?: string;
|
|
@@ -277,6 +319,7 @@ declare class Transport {
|
|
|
277
319
|
}>>;
|
|
278
320
|
request<T>(method: string, path: string, options?: RequestOptions & {
|
|
279
321
|
body?: unknown;
|
|
322
|
+
bodyCase?: "snake" | "raw";
|
|
280
323
|
params?: Record<string, string | number | boolean | null | undefined>;
|
|
281
324
|
}): Promise<DropthisResult<T>>;
|
|
282
325
|
}
|
|
@@ -336,6 +379,24 @@ declare class DeploymentsResource {
|
|
|
336
379
|
get(dropId: string, deploymentId: string): Promise<DropthisResult<DropDeploymentResponse>>;
|
|
337
380
|
}
|
|
338
381
|
|
|
382
|
+
declare class CursorPage<T> implements ListPage<T> {
|
|
383
|
+
readonly object: "list";
|
|
384
|
+
readonly data: T[];
|
|
385
|
+
readonly hasMore: boolean;
|
|
386
|
+
readonly nextCursor: string | null;
|
|
387
|
+
private readonly fetchNextPage;
|
|
388
|
+
constructor(input: {
|
|
389
|
+
data: T[];
|
|
390
|
+
hasMore: boolean;
|
|
391
|
+
nextCursor: string | null;
|
|
392
|
+
fetchNextPage?: (() => Promise<DropthisResult<CursorPage<T>>>) | undefined;
|
|
393
|
+
});
|
|
394
|
+
autoPagingToArray(options?: {
|
|
395
|
+
limit?: number;
|
|
396
|
+
}): Promise<T[]>;
|
|
397
|
+
[Symbol.asyncIterator](): AsyncIterableIterator<T>;
|
|
398
|
+
}
|
|
399
|
+
|
|
339
400
|
declare class DropsResource {
|
|
340
401
|
private readonly transport;
|
|
341
402
|
constructor(transport: Transport);
|
|
@@ -347,10 +408,7 @@ declare class DropsResource {
|
|
|
347
408
|
}): Promise<DropthisResult<DropResponse>>;
|
|
348
409
|
list(params?: ListDropsParams): Promise<DropthisResult<CursorPage<DropResponse>>>;
|
|
349
410
|
get(dropId: string): Promise<DropthisResult<DropResponse>>;
|
|
350
|
-
update(dropId: string,
|
|
351
|
-
idempotencyKey?: string;
|
|
352
|
-
ifRevision?: number;
|
|
353
|
-
}): Promise<DropthisResult<DropResponse>>;
|
|
411
|
+
update(dropId: string, options?: DropOptions & RequestControls): Promise<DropthisResult<DropResponse>>;
|
|
354
412
|
delete(dropId: string): Promise<DropthisResult<null>>;
|
|
355
413
|
}
|
|
356
414
|
|
|
@@ -385,7 +443,8 @@ declare class Dropthis {
|
|
|
385
443
|
get uploads(): UploadsResource;
|
|
386
444
|
prepare(input: PublishInput, options?: PublishOptions): Promise<PreparedPublishRequest>;
|
|
387
445
|
publish(input: PublishInput, options?: PublishOptions): Promise<DropthisResult<DropResponse>>;
|
|
388
|
-
|
|
446
|
+
deploy(dropId: string, input: PublishInput, options?: PublishOptions): Promise<DropthisResult<DropResponse>>;
|
|
447
|
+
update(dropId: string, options?: DropOptions & RequestControls): Promise<DropthisResult<DropResponse>>;
|
|
389
448
|
request<T>(method: string, path: string, options?: RequestOptions & {
|
|
390
449
|
body?: unknown;
|
|
391
450
|
params?: Record<string, string | number | boolean | null | undefined>;
|
|
@@ -403,6 +462,8 @@ declare function createErrorResult<T>(code: string, message: string, statusCode:
|
|
|
403
462
|
currentRevision?: number;
|
|
404
463
|
requestId?: string | null;
|
|
405
464
|
headers?: Record<string, string>;
|
|
465
|
+
suggestion?: string | null;
|
|
466
|
+
retryable?: boolean | null;
|
|
406
467
|
}): DropthisResult<T>;
|
|
407
468
|
|
|
408
|
-
export { type CompleteUploadSessionRequest, type CreateUploadPartTargetsRequest, type CreateUploadPartTargetsResponse, type CreateUploadSessionRequest, type CreateUploadSessionResponse, DeploymentsResource, type DropDeploymentResponse, type DropResponse, Dropthis, type DropthisClientOptions, type DropthisErrorResponse, type DropthisResult, type ListDeploymentsParams, type ListDeploymentsResponse, type ListPage, type PreparedPublishRequest, type PreparedUploadFile, type RequestOptions, type UploadManifestFile, type UploadPartTarget, type UploadSessionFileResponse, type UploadSessionResponse, type UploadTarget, UploadsResource, createErrorResult, redactSecrets };
|
|
469
|
+
export { type ActionResolve, type CompleteUploadSessionRequest, type CreateUploadPartTargetsRequest, type CreateUploadPartTargetsResponse, type CreateUploadSessionRequest, type CreateUploadSessionResponse, CursorPage, DeploymentsResource, type DropAction, type DropDeploymentResponse, type DropOptions, type DropResponse, Dropthis, type DropthisClientOptions, type DropthisErrorResponse, type DropthisResult, type Limitations, type ListDeploymentsParams, type ListDeploymentsResponse, type ListPage, type PrepareOptions, type PreparedPublishRequest, type PreparedUploadFile, type PublishOptions, type RequestControls, type RequestOptions, type TierInfo, type UploadManifestFile, type UploadPartTarget, type UploadSessionFileResponse, type UploadSessionResponse, type UploadTarget, UploadsResource, createErrorResult, redactSecrets };
|