@dropthis/cli 0.30.0 → 0.31.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.
@@ -1,5 +1,5 @@
1
- import { W as Transport, x as DropthisResult, E as EmailOtpResponse, U as SessionResponse, C as CreateUploadSessionRequest, f as CreateUploadSessionResponse, _ as UploadSessionResponse, v as DropthisClientOptions, e as ApiKeysResource, a as AccountResource, u as DropsResource, M as PublishInput, i as DeploymentsResource, n as DomainsResource, a1 as WorkspacesResource, O as PublishOptions, F as PreparedPublishRequest } from './workspaces-BXW942z-.cjs';
2
- export { A as AccountLimits, b as AccountResponse, c as AccountWorkspace, d as ActionResolve, g as CursorPage, 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, t as DropWorkspace, w as DropthisErrorResponse, G as GetContentOptions, I as InMemoryPublishInput, K as KeyType, L as Limitations, y as ListDeploymentsParams, z as ListDeploymentsResponse, B as ListPage, N as NextHint, P as PrepareOptions, H as PreparedUploadFile, J as PublishFileInput, R as RequestControls, Q as RequestOptions, S as RevokeImpact, T as SHARED_POOL, V as TierInfo, X as UpdateContentOptions, Y as UploadManifestFile, Z as UploadSessionFileResponse, $ as UploadTarget, a0 as Workspace } from './workspaces-BXW942z-.cjs';
1
+ import { Y as Transport, x as DropthisResult, E as EmailOtpResponse, W as SessionResponse, C as CreateUploadSessionRequest, f as CreateUploadSessionResponse, a0 as UploadSessionResponse, v as DropthisClientOptions, e as ApiKeysResource, A as AccountResource, u as DropsResource, Q as PublishInput, i as DeploymentsResource, n as DomainsResource, a3 as WorkspacesResource, R as PublishOptions, J as PreparedPublishRequest } from './workspaces-Xmo2L46y.cjs';
2
+ export { a as AccountResponse, b as AccountUsage, c as AccountWorkspace, d as ActionResolve, g as CursorPage, 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, t as DropWorkspace, w as DropthisErrorResponse, y as EntitlementLimits, z as Entitlements, G as GetContentOptions, I as InMemoryPublishInput, K as KeyType, L as Limitations, B as ListDeploymentsParams, F as ListDeploymentsResponse, H as ListPage, N as NextHint, P as PrepareOptions, M as PreparedUploadFile, O as PublishFileInput, S as RequestControls, T as RequestOptions, U as RevokeImpact, V as SHARED_POOL, X as TierInfo, Z as UpdateContentOptions, _ as UploadManifestFile, $ as UploadSessionFileResponse, a1 as UploadTarget, a2 as Workspace } from './workspaces-Xmo2L46y.cjs';
3
3
 
4
4
  declare class AuthResource {
5
5
  private readonly transport;
@@ -74,8 +74,29 @@ declare function createErrorResult<T>(code: string, message: string, statusCode:
74
74
  headers?: Record<string, string>;
75
75
  suggestion?: string | null;
76
76
  retryable?: boolean | null;
77
+ feature?: string | null;
78
+ currentPlan?: string | null;
79
+ requiredPlan?: string | null;
80
+ upgradeUrl?: string | null;
81
+ limit?: number | null;
82
+ used?: number | null;
83
+ requested?: number | null;
77
84
  body?: unknown;
78
85
  }): DropthisResult<T>;
86
+ /** True for a capability denial (`feature_not_in_plan`) — a plan gate, never retryable. */
87
+ declare function isFeatureNotInPlan(error: {
88
+ code: string;
89
+ } | null): boolean;
90
+ /** True for a numeric-ceiling denial (`quota_exceeded`: per-drop bytes 413, or an
91
+ * account ceiling 403). Never retryable — a plan ceiling does not free up on retry. */
92
+ declare function isQuotaExceeded(error: {
93
+ code: string;
94
+ } | null): boolean;
95
+ /** True for either plan-gate code — branch a retry layer on this to stop and
96
+ * hand off to a human instead of re-issuing a request that can never succeed. */
97
+ declare function isPlanGate(error: {
98
+ code: string;
99
+ } | null): boolean;
79
100
  declare class PublishInputError extends Error {
80
101
  readonly code: string;
81
102
  readonly param?: string | undefined;
@@ -83,4 +104,4 @@ declare class PublishInputError extends Error {
83
104
  constructor(code: string, message: string, param?: string | undefined, suggestion?: string | undefined);
84
105
  }
85
106
 
86
- export { CreateUploadSessionRequest, CreateUploadSessionResponse, DeploymentsResource, DomainsResource, Dropthis, DropthisClientOptions, DropthisResult, PreparedPublishRequest, PublishInput, PublishInputError, PublishOptions, UploadSessionResponse, UploadsResource, WorkspacesResource, createErrorResult, redactSecrets };
107
+ export { CreateUploadSessionRequest, CreateUploadSessionResponse, DeploymentsResource, DomainsResource, Dropthis, DropthisClientOptions, DropthisResult, PreparedPublishRequest, PublishInput, PublishInputError, PublishOptions, UploadSessionResponse, UploadsResource, WorkspacesResource, createErrorResult, isFeatureNotInPlan, isPlanGate, isQuotaExceeded, redactSecrets };
@@ -1,5 +1,5 @@
1
- import { W as Transport, x as DropthisResult, E as EmailOtpResponse, U as SessionResponse, C as CreateUploadSessionRequest, f as CreateUploadSessionResponse, _ as UploadSessionResponse, v as DropthisClientOptions, e as ApiKeysResource, a as AccountResource, u as DropsResource, M as PublishInput, i as DeploymentsResource, n as DomainsResource, a1 as WorkspacesResource, O as PublishOptions, F as PreparedPublishRequest } from './workspaces-BXW942z-.js';
2
- export { A as AccountLimits, b as AccountResponse, c as AccountWorkspace, d as ActionResolve, g as CursorPage, 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, t as DropWorkspace, w as DropthisErrorResponse, G as GetContentOptions, I as InMemoryPublishInput, K as KeyType, L as Limitations, y as ListDeploymentsParams, z as ListDeploymentsResponse, B as ListPage, N as NextHint, P as PrepareOptions, H as PreparedUploadFile, J as PublishFileInput, R as RequestControls, Q as RequestOptions, S as RevokeImpact, T as SHARED_POOL, V as TierInfo, X as UpdateContentOptions, Y as UploadManifestFile, Z as UploadSessionFileResponse, $ as UploadTarget, a0 as Workspace } from './workspaces-BXW942z-.js';
1
+ import { Y as Transport, x as DropthisResult, E as EmailOtpResponse, W as SessionResponse, C as CreateUploadSessionRequest, f as CreateUploadSessionResponse, a0 as UploadSessionResponse, v as DropthisClientOptions, e as ApiKeysResource, A as AccountResource, u as DropsResource, Q as PublishInput, i as DeploymentsResource, n as DomainsResource, a3 as WorkspacesResource, R as PublishOptions, J as PreparedPublishRequest } from './workspaces-Xmo2L46y.js';
2
+ export { a as AccountResponse, b as AccountUsage, c as AccountWorkspace, d as ActionResolve, g as CursorPage, 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, t as DropWorkspace, w as DropthisErrorResponse, y as EntitlementLimits, z as Entitlements, G as GetContentOptions, I as InMemoryPublishInput, K as KeyType, L as Limitations, B as ListDeploymentsParams, F as ListDeploymentsResponse, H as ListPage, N as NextHint, P as PrepareOptions, M as PreparedUploadFile, O as PublishFileInput, S as RequestControls, T as RequestOptions, U as RevokeImpact, V as SHARED_POOL, X as TierInfo, Z as UpdateContentOptions, _ as UploadManifestFile, $ as UploadSessionFileResponse, a1 as UploadTarget, a2 as Workspace } from './workspaces-Xmo2L46y.js';
3
3
 
4
4
  declare class AuthResource {
5
5
  private readonly transport;
@@ -74,8 +74,29 @@ declare function createErrorResult<T>(code: string, message: string, statusCode:
74
74
  headers?: Record<string, string>;
75
75
  suggestion?: string | null;
76
76
  retryable?: boolean | null;
77
+ feature?: string | null;
78
+ currentPlan?: string | null;
79
+ requiredPlan?: string | null;
80
+ upgradeUrl?: string | null;
81
+ limit?: number | null;
82
+ used?: number | null;
83
+ requested?: number | null;
77
84
  body?: unknown;
78
85
  }): DropthisResult<T>;
86
+ /** True for a capability denial (`feature_not_in_plan`) — a plan gate, never retryable. */
87
+ declare function isFeatureNotInPlan(error: {
88
+ code: string;
89
+ } | null): boolean;
90
+ /** True for a numeric-ceiling denial (`quota_exceeded`: per-drop bytes 413, or an
91
+ * account ceiling 403). Never retryable — a plan ceiling does not free up on retry. */
92
+ declare function isQuotaExceeded(error: {
93
+ code: string;
94
+ } | null): boolean;
95
+ /** True for either plan-gate code — branch a retry layer on this to stop and
96
+ * hand off to a human instead of re-issuing a request that can never succeed. */
97
+ declare function isPlanGate(error: {
98
+ code: string;
99
+ } | null): boolean;
79
100
  declare class PublishInputError extends Error {
80
101
  readonly code: string;
81
102
  readonly param?: string | undefined;
@@ -83,4 +104,4 @@ declare class PublishInputError extends Error {
83
104
  constructor(code: string, message: string, param?: string | undefined, suggestion?: string | undefined);
84
105
  }
85
106
 
86
- export { CreateUploadSessionRequest, CreateUploadSessionResponse, DeploymentsResource, DomainsResource, Dropthis, DropthisClientOptions, DropthisResult, PreparedPublishRequest, PublishInput, PublishInputError, PublishOptions, UploadSessionResponse, UploadsResource, WorkspacesResource, createErrorResult, redactSecrets };
107
+ export { CreateUploadSessionRequest, CreateUploadSessionResponse, DeploymentsResource, DomainsResource, Dropthis, DropthisClientOptions, DropthisResult, PreparedPublishRequest, PublishInput, PublishInputError, PublishOptions, UploadSessionResponse, UploadsResource, WorkspacesResource, createErrorResult, isFeatureNotInPlan, isPlanGate, isQuotaExceeded, redactSecrets };
@@ -23,11 +23,27 @@ function createErrorResult(code, message, statusCode, extra = {}) {
23
23
  ...extra.requestId !== void 0 ? { requestId: extra.requestId } : {},
24
24
  ...extra.suggestion !== void 0 ? { suggestion: extra.suggestion } : {},
25
25
  ...extra.retryable !== void 0 ? { retryable: extra.retryable } : {},
26
+ ...extra.feature != null ? { feature: extra.feature } : {},
27
+ ...extra.currentPlan != null ? { currentPlan: extra.currentPlan } : {},
28
+ ...extra.requiredPlan != null ? { requiredPlan: extra.requiredPlan } : {},
29
+ ...extra.upgradeUrl != null ? { upgradeUrl: extra.upgradeUrl } : {},
30
+ ...extra.limit != null ? { limit: extra.limit } : {},
31
+ ...extra.used != null ? { used: extra.used } : {},
32
+ ...extra.requested != null ? { requested: extra.requested } : {},
26
33
  ...extra.body !== void 0 ? { body: extra.body } : {}
27
34
  },
28
35
  headers: extra.headers ?? {}
29
36
  };
30
37
  }
38
+ function isFeatureNotInPlan(error) {
39
+ return error?.code === "feature_not_in_plan";
40
+ }
41
+ function isQuotaExceeded(error) {
42
+ return error?.code === "quota_exceeded";
43
+ }
44
+ function isPlanGate(error) {
45
+ return isFeatureNotInPlan(error) || isQuotaExceeded(error);
46
+ }
31
47
  var PublishInputError = class extends Error {
32
48
  constructor(code, message, param, suggestion) {
33
49
  super(message);
@@ -1151,7 +1167,7 @@ function toSnakeCase(value) {
1151
1167
 
1152
1168
  // src/transport.ts
1153
1169
  var DEFAULT_BASE_URL = "https://api.dropthis.app";
1154
- var SDK_VERSION = "0.26.0";
1170
+ var SDK_VERSION = "0.27.0";
1155
1171
  var Transport = class {
1156
1172
  apiKey;
1157
1173
  baseUrl;
@@ -1360,6 +1376,15 @@ function problemResult(response, text, responseHeaders) {
1360
1376
  requestId: stringValue(body.request_id) ?? responseHeaders["x-request-id"] ?? null,
1361
1377
  suggestion: stringValue(body.suggestion),
1362
1378
  retryable: booleanValue(body.retryable),
1379
+ // Unified plan-gate contract (feature_not_in_plan / quota_exceeded). The
1380
+ // error body isn't camelCased like a success body, so map the snake keys here.
1381
+ feature: stringValue(body.feature),
1382
+ currentPlan: stringValue(body.current_plan),
1383
+ requiredPlan: stringValue(body.required_plan),
1384
+ upgradeUrl: stringValue(body.upgrade_url),
1385
+ limit: numberValue(body.limit) ?? null,
1386
+ used: numberValue(body.used) ?? null,
1387
+ requested: numberValue(body.requested) ?? null,
1363
1388
  headers: responseHeaders
1364
1389
  });
1365
1390
  }
@@ -1468,6 +1493,9 @@ export {
1468
1493
  UploadsResource,
1469
1494
  WorkspacesResource,
1470
1495
  createErrorResult,
1496
+ isFeatureNotInPlan,
1497
+ isPlanGate,
1498
+ isQuotaExceeded,
1471
1499
  redactSecrets
1472
1500
  };
1473
1501
  //# sourceMappingURL=index.mjs.map