@dropthis/cli 0.31.0 → 0.33.1

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 { 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';
1
+ import { a1 as Transport, x as DropthisResult, E as EmailOtpResponse, $ as SessionResponse, H as InvitationListResponse, a7 as Workspace, P as MemberListResponse, B as InvitableRole, F as Invitation, a8 as WorkspaceRole, O as Member, C as CreateUploadSessionRequest, f as CreateUploadSessionResponse, a5 as UploadSessionResponse, v as DropthisClientOptions, e as ApiKeysResource, A as AccountResource, u as DropsResource, V as PublishInput, i as DeploymentsResource, n as DomainsResource, a9 as WorkspacesResource, W as PublishOptions, S as PreparedPublishRequest } from './workspaces-CebiV4DS.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, J as ListDeploymentsParams, M as ListDeploymentsResponse, N as ListPage, Q as NextHint, R as PrepareOptions, T as PreparedUploadFile, U as PublishFileInput, X as RequestControls, Y as RequestOptions, Z as RevokeImpact, _ as SHARED_POOL, a0 as TierInfo, a2 as UpdateContentOptions, a3 as UploadManifestFile, a4 as UploadSessionFileResponse, a6 as UploadTarget } from './workspaces-CebiV4DS.cjs';
3
3
 
4
4
  declare class AuthResource {
5
5
  private readonly transport;
@@ -21,6 +21,42 @@ declare class AuthResource {
21
21
  logout(): Promise<DropthisResult<null>>;
22
22
  }
23
23
 
24
+ /** Invitee-side invitations (ADR 0068). Listing needs `members:read`; accepting needs `members:write`. */
25
+ declare class InvitationsResource {
26
+ private readonly transport;
27
+ constructor(transport: Transport);
28
+ /** List the calling account's own pending invitations. */
29
+ list(): Promise<DropthisResult<InvitationListResponse>>;
30
+ /** Accept by the raw single-use token from the invite email. Joins + switches active workspace. */
31
+ accept(input: {
32
+ token: string;
33
+ }): Promise<DropthisResult<Workspace>>;
34
+ /** Accept by invitation id, once authenticated as the invited email — the agent path, no token. */
35
+ acceptById(input: {
36
+ invitationId: string;
37
+ }): Promise<DropthisResult<Workspace>>;
38
+ }
39
+
40
+ /** Team membership management (ADR 0068). Capability follows the credential's scopes. */
41
+ declare class MembersResource {
42
+ private readonly transport;
43
+ constructor(transport: Transport);
44
+ /** List a workspace's members (any member, `members:read`). */
45
+ list(workspaceId: string): Promise<DropthisResult<MemberListResponse>>;
46
+ /** Invite an email to the workspace (owner/admin, `members:write`). */
47
+ invite(workspaceId: string, input: {
48
+ email: string;
49
+ role: InvitableRole;
50
+ }): Promise<DropthisResult<Invitation>>;
51
+ /** Change a member's role (`members:admin`, owner-only-touches-owner enforced server-side). */
52
+ updateRole(workspaceId: string, accountId: string, input: {
53
+ role: WorkspaceRole;
54
+ }): Promise<DropthisResult<Member>>;
55
+ /** Remove a member, or leave the workspace (your own id). Removing others needs `members:admin`;
56
+ * leaving needs `members:write`. 204 — data is null. */
57
+ remove(workspaceId: string, accountId: string): Promise<DropthisResult<null>>;
58
+ }
59
+
24
60
  declare class UploadsResource {
25
61
  private readonly transport;
26
62
  constructor(transport: Transport);
@@ -50,6 +86,8 @@ declare class Dropthis {
50
86
  private uploadsResource?;
51
87
  private domainsResource?;
52
88
  private workspacesResource?;
89
+ private membersResource?;
90
+ private invitationsResource?;
53
91
  constructor(options?: DropthisClientOptions | string);
54
92
  get auth(): AuthResource;
55
93
  get apiKeys(): ApiKeysResource;
@@ -59,6 +97,8 @@ declare class Dropthis {
59
97
  get uploads(): UploadsResource;
60
98
  get domains(): DomainsResource;
61
99
  get workspaces(): WorkspacesResource;
100
+ get members(): MembersResource;
101
+ get invitations(): InvitationsResource;
62
102
  prepare(input: PublishInput, options?: PublishOptions): Promise<PreparedPublishRequest>;
63
103
  }
64
104
 
@@ -104,4 +144,4 @@ declare class PublishInputError extends Error {
104
144
  constructor(code: string, message: string, param?: string | undefined, suggestion?: string | undefined);
105
145
  }
106
146
 
107
- export { CreateUploadSessionRequest, CreateUploadSessionResponse, DeploymentsResource, DomainsResource, Dropthis, DropthisClientOptions, DropthisResult, PreparedPublishRequest, PublishInput, PublishInputError, PublishOptions, UploadSessionResponse, UploadsResource, WorkspacesResource, createErrorResult, isFeatureNotInPlan, isPlanGate, isQuotaExceeded, redactSecrets };
147
+ export { CreateUploadSessionRequest, CreateUploadSessionResponse, DeploymentsResource, DomainsResource, Dropthis, DropthisClientOptions, DropthisResult, InvitableRole, Invitation, InvitationListResponse, InvitationsResource, Member, MemberListResponse, MembersResource, PreparedPublishRequest, PublishInput, PublishInputError, PublishOptions, UploadSessionResponse, UploadsResource, Workspace, WorkspaceRole, WorkspacesResource, createErrorResult, isFeatureNotInPlan, isPlanGate, isQuotaExceeded, redactSecrets };
@@ -1,5 +1,5 @@
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';
1
+ import { a1 as Transport, x as DropthisResult, E as EmailOtpResponse, $ as SessionResponse, H as InvitationListResponse, a7 as Workspace, P as MemberListResponse, B as InvitableRole, F as Invitation, a8 as WorkspaceRole, O as Member, C as CreateUploadSessionRequest, f as CreateUploadSessionResponse, a5 as UploadSessionResponse, v as DropthisClientOptions, e as ApiKeysResource, A as AccountResource, u as DropsResource, V as PublishInput, i as DeploymentsResource, n as DomainsResource, a9 as WorkspacesResource, W as PublishOptions, S as PreparedPublishRequest } from './workspaces-CebiV4DS.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, J as ListDeploymentsParams, M as ListDeploymentsResponse, N as ListPage, Q as NextHint, R as PrepareOptions, T as PreparedUploadFile, U as PublishFileInput, X as RequestControls, Y as RequestOptions, Z as RevokeImpact, _ as SHARED_POOL, a0 as TierInfo, a2 as UpdateContentOptions, a3 as UploadManifestFile, a4 as UploadSessionFileResponse, a6 as UploadTarget } from './workspaces-CebiV4DS.js';
3
3
 
4
4
  declare class AuthResource {
5
5
  private readonly transport;
@@ -21,6 +21,42 @@ declare class AuthResource {
21
21
  logout(): Promise<DropthisResult<null>>;
22
22
  }
23
23
 
24
+ /** Invitee-side invitations (ADR 0068). Listing needs `members:read`; accepting needs `members:write`. */
25
+ declare class InvitationsResource {
26
+ private readonly transport;
27
+ constructor(transport: Transport);
28
+ /** List the calling account's own pending invitations. */
29
+ list(): Promise<DropthisResult<InvitationListResponse>>;
30
+ /** Accept by the raw single-use token from the invite email. Joins + switches active workspace. */
31
+ accept(input: {
32
+ token: string;
33
+ }): Promise<DropthisResult<Workspace>>;
34
+ /** Accept by invitation id, once authenticated as the invited email — the agent path, no token. */
35
+ acceptById(input: {
36
+ invitationId: string;
37
+ }): Promise<DropthisResult<Workspace>>;
38
+ }
39
+
40
+ /** Team membership management (ADR 0068). Capability follows the credential's scopes. */
41
+ declare class MembersResource {
42
+ private readonly transport;
43
+ constructor(transport: Transport);
44
+ /** List a workspace's members (any member, `members:read`). */
45
+ list(workspaceId: string): Promise<DropthisResult<MemberListResponse>>;
46
+ /** Invite an email to the workspace (owner/admin, `members:write`). */
47
+ invite(workspaceId: string, input: {
48
+ email: string;
49
+ role: InvitableRole;
50
+ }): Promise<DropthisResult<Invitation>>;
51
+ /** Change a member's role (`members:admin`, owner-only-touches-owner enforced server-side). */
52
+ updateRole(workspaceId: string, accountId: string, input: {
53
+ role: WorkspaceRole;
54
+ }): Promise<DropthisResult<Member>>;
55
+ /** Remove a member, or leave the workspace (your own id). Removing others needs `members:admin`;
56
+ * leaving needs `members:write`. 204 — data is null. */
57
+ remove(workspaceId: string, accountId: string): Promise<DropthisResult<null>>;
58
+ }
59
+
24
60
  declare class UploadsResource {
25
61
  private readonly transport;
26
62
  constructor(transport: Transport);
@@ -50,6 +86,8 @@ declare class Dropthis {
50
86
  private uploadsResource?;
51
87
  private domainsResource?;
52
88
  private workspacesResource?;
89
+ private membersResource?;
90
+ private invitationsResource?;
53
91
  constructor(options?: DropthisClientOptions | string);
54
92
  get auth(): AuthResource;
55
93
  get apiKeys(): ApiKeysResource;
@@ -59,6 +97,8 @@ declare class Dropthis {
59
97
  get uploads(): UploadsResource;
60
98
  get domains(): DomainsResource;
61
99
  get workspaces(): WorkspacesResource;
100
+ get members(): MembersResource;
101
+ get invitations(): InvitationsResource;
62
102
  prepare(input: PublishInput, options?: PublishOptions): Promise<PreparedPublishRequest>;
63
103
  }
64
104
 
@@ -104,4 +144,4 @@ declare class PublishInputError extends Error {
104
144
  constructor(code: string, message: string, param?: string | undefined, suggestion?: string | undefined);
105
145
  }
106
146
 
107
- export { CreateUploadSessionRequest, CreateUploadSessionResponse, DeploymentsResource, DomainsResource, Dropthis, DropthisClientOptions, DropthisResult, PreparedPublishRequest, PublishInput, PublishInputError, PublishOptions, UploadSessionResponse, UploadsResource, WorkspacesResource, createErrorResult, isFeatureNotInPlan, isPlanGate, isQuotaExceeded, redactSecrets };
147
+ export { CreateUploadSessionRequest, CreateUploadSessionResponse, DeploymentsResource, DomainsResource, Dropthis, DropthisClientOptions, DropthisResult, InvitableRole, Invitation, InvitationListResponse, InvitationsResource, Member, MemberListResponse, MembersResource, PreparedPublishRequest, PublishInput, PublishInputError, PublishOptions, UploadSessionResponse, UploadsResource, Workspace, WorkspaceRole, WorkspacesResource, createErrorResult, isFeatureNotInPlan, isPlanGate, isQuotaExceeded, redactSecrets };
@@ -712,6 +712,7 @@ var ApiKeysResource = class {
712
712
  if (input.workspace !== void 0) body.workspace = input.workspace;
713
713
  if (input.allowedWorkspaces !== void 0)
714
714
  body.allowed_workspace_ids = input.allowedWorkspaces;
715
+ if (input.scopes !== void 0) body.scopes = input.scopes;
715
716
  return this.transport.request("POST", "/api-keys", { body });
716
717
  }
717
718
  /** Revoke an API key. 204 No Content — data is null on success. */
@@ -1065,6 +1066,69 @@ function updateBody(options) {
1065
1066
  };
1066
1067
  }
1067
1068
 
1069
+ // src/resources/invitations.ts
1070
+ var InvitationsResource = class {
1071
+ constructor(transport) {
1072
+ this.transport = transport;
1073
+ }
1074
+ transport;
1075
+ /** List the calling account's own pending invitations. */
1076
+ list() {
1077
+ return this.transport.request("GET", "/invitations");
1078
+ }
1079
+ /** Accept by the raw single-use token from the invite email. Joins + switches active workspace. */
1080
+ accept(input) {
1081
+ return this.transport.request("POST", "/invitations/accept", {
1082
+ body: input
1083
+ });
1084
+ }
1085
+ /** Accept by invitation id, once authenticated as the invited email — the agent path, no token. */
1086
+ acceptById(input) {
1087
+ return this.transport.request("POST", "/invitations/accept-by-id", {
1088
+ body: input
1089
+ });
1090
+ }
1091
+ };
1092
+
1093
+ // src/resources/members.ts
1094
+ var MembersResource = class {
1095
+ constructor(transport) {
1096
+ this.transport = transport;
1097
+ }
1098
+ transport;
1099
+ /** List a workspace's members (any member, `members:read`). */
1100
+ list(workspaceId) {
1101
+ return this.transport.request(
1102
+ "GET",
1103
+ `/workspaces/${encodeURIComponent(workspaceId)}/members`
1104
+ );
1105
+ }
1106
+ /** Invite an email to the workspace (owner/admin, `members:write`). */
1107
+ invite(workspaceId, input) {
1108
+ return this.transport.request(
1109
+ "POST",
1110
+ `/workspaces/${encodeURIComponent(workspaceId)}/invitations`,
1111
+ { body: input }
1112
+ );
1113
+ }
1114
+ /** Change a member's role (`members:admin`, owner-only-touches-owner enforced server-side). */
1115
+ updateRole(workspaceId, accountId, input) {
1116
+ return this.transport.request(
1117
+ "PATCH",
1118
+ `/workspaces/${encodeURIComponent(workspaceId)}/members/${encodeURIComponent(accountId)}`,
1119
+ { body: input }
1120
+ );
1121
+ }
1122
+ /** Remove a member, or leave the workspace (your own id). Removing others needs `members:admin`;
1123
+ * leaving needs `members:write`. 204 — data is null. */
1124
+ remove(workspaceId, accountId) {
1125
+ return this.transport.request(
1126
+ "DELETE",
1127
+ `/workspaces/${encodeURIComponent(workspaceId)}/members/${encodeURIComponent(accountId)}`
1128
+ );
1129
+ }
1130
+ };
1131
+
1068
1132
  // src/resources/uploads.ts
1069
1133
  var UploadsResource = class {
1070
1134
  constructor(transport) {
@@ -1117,6 +1181,25 @@ var WorkspacesResource = class {
1117
1181
  list() {
1118
1182
  return this.transport.request("GET", "/workspaces");
1119
1183
  }
1184
+ /** Create a team workspace (the caller becomes its sole owner). Needs `workspaces:write`. */
1185
+ create(input) {
1186
+ return this.transport.request("POST", "/workspaces", { body: input });
1187
+ }
1188
+ /** Rename a team workspace (owner/admin). Needs `workspaces:write`. */
1189
+ rename(workspaceId, input) {
1190
+ return this.transport.request(
1191
+ "PATCH",
1192
+ `/workspaces/${encodeURIComponent(workspaceId)}`,
1193
+ { body: input }
1194
+ );
1195
+ }
1196
+ /** Delete a team workspace (owner only). Needs `workspaces:admin`. 204 — data is null. */
1197
+ delete(workspaceId) {
1198
+ return this.transport.request(
1199
+ "DELETE",
1200
+ `/workspaces/${encodeURIComponent(workspaceId)}`
1201
+ );
1202
+ }
1120
1203
  use(workspace) {
1121
1204
  return this.transport.request("PUT", "/account/active-workspace", {
1122
1205
  body: { workspace }
@@ -1167,7 +1250,7 @@ function toSnakeCase(value) {
1167
1250
 
1168
1251
  // src/transport.ts
1169
1252
  var DEFAULT_BASE_URL = "https://api.dropthis.app";
1170
- var SDK_VERSION = "0.27.0";
1253
+ var SDK_VERSION = "0.29.0";
1171
1254
  var Transport = class {
1172
1255
  apiKey;
1173
1256
  baseUrl;
@@ -1426,6 +1509,8 @@ var Dropthis = class {
1426
1509
  uploadsResource;
1427
1510
  domainsResource;
1428
1511
  workspacesResource;
1512
+ membersResource;
1513
+ invitationsResource;
1429
1514
  constructor(options = {}) {
1430
1515
  this.transport = new Transport(options);
1431
1516
  this.defaultWorkspace = typeof options === "string" ? void 0 : options.workspace;
@@ -1475,6 +1560,16 @@ var Dropthis = class {
1475
1560
  this.workspacesResource = new WorkspacesResource(this.transport);
1476
1561
  return this.workspacesResource;
1477
1562
  }
1563
+ get members() {
1564
+ if (!this.membersResource)
1565
+ this.membersResource = new MembersResource(this.transport);
1566
+ return this.membersResource;
1567
+ }
1568
+ get invitations() {
1569
+ if (!this.invitationsResource)
1570
+ this.invitationsResource = new InvitationsResource(this.transport);
1571
+ return this.invitationsResource;
1572
+ }
1478
1573
  async prepare(input, options = {}) {
1479
1574
  const merged = this.defaultWorkspace !== void 0 && options.workspace === void 0 ? { ...options, workspace: this.defaultWorkspace } : options;
1480
1575
  return resolveInput(input, merged);
@@ -1488,6 +1583,8 @@ export {
1488
1583
  DeploymentsResource,
1489
1584
  DomainsResource,
1490
1585
  Dropthis,
1586
+ InvitationsResource,
1587
+ MembersResource,
1491
1588
  PublishInputError,
1492
1589
  SHARED_POOL,
1493
1590
  UploadsResource,