@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.
- package/README.md +36 -10
- package/dist/cli.cjs +702 -108
- package/dist/cli.cjs.map +1 -1
- package/node_modules/@dropthis/node/README.md +2 -2
- package/node_modules/@dropthis/node/dist/edge.cjs +21 -1
- 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 +21 -1
- package/node_modules/@dropthis/node/dist/edge.mjs.map +1 -1
- package/node_modules/@dropthis/node/dist/index.cjs +100 -1
- package/node_modules/@dropthis/node/dist/index.cjs.map +1 -1
- package/node_modules/@dropthis/node/dist/index.d.cts +43 -3
- package/node_modules/@dropthis/node/dist/index.d.ts +43 -3
- package/node_modules/@dropthis/node/dist/index.mjs +98 -1
- package/node_modules/@dropthis/node/dist/index.mjs.map +1 -1
- package/node_modules/@dropthis/node/dist/{workspaces-Xmo2L46y.d.cts → workspaces-CebiV4DS.d.cts} +59 -1
- package/node_modules/@dropthis/node/dist/{workspaces-Xmo2L46y.d.ts → workspaces-CebiV4DS.d.ts} +59 -1
- package/node_modules/@dropthis/node/package.json +1 -1
- package/package.json +49 -49
|
@@ -34,6 +34,8 @@ __export(index_exports, {
|
|
|
34
34
|
DeploymentsResource: () => DeploymentsResource,
|
|
35
35
|
DomainsResource: () => DomainsResource,
|
|
36
36
|
Dropthis: () => Dropthis,
|
|
37
|
+
InvitationsResource: () => InvitationsResource,
|
|
38
|
+
MembersResource: () => MembersResource,
|
|
37
39
|
PublishInputError: () => PublishInputError,
|
|
38
40
|
SHARED_POOL: () => SHARED_POOL,
|
|
39
41
|
UploadsResource: () => UploadsResource,
|
|
@@ -760,6 +762,7 @@ var ApiKeysResource = class {
|
|
|
760
762
|
if (input.workspace !== void 0) body.workspace = input.workspace;
|
|
761
763
|
if (input.allowedWorkspaces !== void 0)
|
|
762
764
|
body.allowed_workspace_ids = input.allowedWorkspaces;
|
|
765
|
+
if (input.scopes !== void 0) body.scopes = input.scopes;
|
|
763
766
|
return this.transport.request("POST", "/api-keys", { body });
|
|
764
767
|
}
|
|
765
768
|
/** Revoke an API key. 204 No Content — data is null on success. */
|
|
@@ -1113,6 +1116,69 @@ function updateBody(options) {
|
|
|
1113
1116
|
};
|
|
1114
1117
|
}
|
|
1115
1118
|
|
|
1119
|
+
// src/resources/invitations.ts
|
|
1120
|
+
var InvitationsResource = class {
|
|
1121
|
+
constructor(transport) {
|
|
1122
|
+
this.transport = transport;
|
|
1123
|
+
}
|
|
1124
|
+
transport;
|
|
1125
|
+
/** List the calling account's own pending invitations. */
|
|
1126
|
+
list() {
|
|
1127
|
+
return this.transport.request("GET", "/invitations");
|
|
1128
|
+
}
|
|
1129
|
+
/** Accept by the raw single-use token from the invite email. Joins + switches active workspace. */
|
|
1130
|
+
accept(input) {
|
|
1131
|
+
return this.transport.request("POST", "/invitations/accept", {
|
|
1132
|
+
body: input
|
|
1133
|
+
});
|
|
1134
|
+
}
|
|
1135
|
+
/** Accept by invitation id, once authenticated as the invited email — the agent path, no token. */
|
|
1136
|
+
acceptById(input) {
|
|
1137
|
+
return this.transport.request("POST", "/invitations/accept-by-id", {
|
|
1138
|
+
body: input
|
|
1139
|
+
});
|
|
1140
|
+
}
|
|
1141
|
+
};
|
|
1142
|
+
|
|
1143
|
+
// src/resources/members.ts
|
|
1144
|
+
var MembersResource = class {
|
|
1145
|
+
constructor(transport) {
|
|
1146
|
+
this.transport = transport;
|
|
1147
|
+
}
|
|
1148
|
+
transport;
|
|
1149
|
+
/** List a workspace's members (any member, `members:read`). */
|
|
1150
|
+
list(workspaceId) {
|
|
1151
|
+
return this.transport.request(
|
|
1152
|
+
"GET",
|
|
1153
|
+
`/workspaces/${encodeURIComponent(workspaceId)}/members`
|
|
1154
|
+
);
|
|
1155
|
+
}
|
|
1156
|
+
/** Invite an email to the workspace (owner/admin, `members:write`). */
|
|
1157
|
+
invite(workspaceId, input) {
|
|
1158
|
+
return this.transport.request(
|
|
1159
|
+
"POST",
|
|
1160
|
+
`/workspaces/${encodeURIComponent(workspaceId)}/invitations`,
|
|
1161
|
+
{ body: input }
|
|
1162
|
+
);
|
|
1163
|
+
}
|
|
1164
|
+
/** Change a member's role (`members:admin`, owner-only-touches-owner enforced server-side). */
|
|
1165
|
+
updateRole(workspaceId, accountId, input) {
|
|
1166
|
+
return this.transport.request(
|
|
1167
|
+
"PATCH",
|
|
1168
|
+
`/workspaces/${encodeURIComponent(workspaceId)}/members/${encodeURIComponent(accountId)}`,
|
|
1169
|
+
{ body: input }
|
|
1170
|
+
);
|
|
1171
|
+
}
|
|
1172
|
+
/** Remove a member, or leave the workspace (your own id). Removing others needs `members:admin`;
|
|
1173
|
+
* leaving needs `members:write`. 204 — data is null. */
|
|
1174
|
+
remove(workspaceId, accountId) {
|
|
1175
|
+
return this.transport.request(
|
|
1176
|
+
"DELETE",
|
|
1177
|
+
`/workspaces/${encodeURIComponent(workspaceId)}/members/${encodeURIComponent(accountId)}`
|
|
1178
|
+
);
|
|
1179
|
+
}
|
|
1180
|
+
};
|
|
1181
|
+
|
|
1116
1182
|
// src/resources/uploads.ts
|
|
1117
1183
|
var UploadsResource = class {
|
|
1118
1184
|
constructor(transport) {
|
|
@@ -1165,6 +1231,25 @@ var WorkspacesResource = class {
|
|
|
1165
1231
|
list() {
|
|
1166
1232
|
return this.transport.request("GET", "/workspaces");
|
|
1167
1233
|
}
|
|
1234
|
+
/** Create a team workspace (the caller becomes its sole owner). Needs `workspaces:write`. */
|
|
1235
|
+
create(input) {
|
|
1236
|
+
return this.transport.request("POST", "/workspaces", { body: input });
|
|
1237
|
+
}
|
|
1238
|
+
/** Rename a team workspace (owner/admin). Needs `workspaces:write`. */
|
|
1239
|
+
rename(workspaceId, input) {
|
|
1240
|
+
return this.transport.request(
|
|
1241
|
+
"PATCH",
|
|
1242
|
+
`/workspaces/${encodeURIComponent(workspaceId)}`,
|
|
1243
|
+
{ body: input }
|
|
1244
|
+
);
|
|
1245
|
+
}
|
|
1246
|
+
/** Delete a team workspace (owner only). Needs `workspaces:admin`. 204 — data is null. */
|
|
1247
|
+
delete(workspaceId) {
|
|
1248
|
+
return this.transport.request(
|
|
1249
|
+
"DELETE",
|
|
1250
|
+
`/workspaces/${encodeURIComponent(workspaceId)}`
|
|
1251
|
+
);
|
|
1252
|
+
}
|
|
1168
1253
|
use(workspace) {
|
|
1169
1254
|
return this.transport.request("PUT", "/account/active-workspace", {
|
|
1170
1255
|
body: { workspace }
|
|
@@ -1215,7 +1300,7 @@ function toSnakeCase(value) {
|
|
|
1215
1300
|
|
|
1216
1301
|
// src/transport.ts
|
|
1217
1302
|
var DEFAULT_BASE_URL = "https://api.dropthis.app";
|
|
1218
|
-
var SDK_VERSION = "0.
|
|
1303
|
+
var SDK_VERSION = "0.29.0";
|
|
1219
1304
|
var Transport = class {
|
|
1220
1305
|
apiKey;
|
|
1221
1306
|
baseUrl;
|
|
@@ -1474,6 +1559,8 @@ var Dropthis = class {
|
|
|
1474
1559
|
uploadsResource;
|
|
1475
1560
|
domainsResource;
|
|
1476
1561
|
workspacesResource;
|
|
1562
|
+
membersResource;
|
|
1563
|
+
invitationsResource;
|
|
1477
1564
|
constructor(options = {}) {
|
|
1478
1565
|
this.transport = new Transport(options);
|
|
1479
1566
|
this.defaultWorkspace = typeof options === "string" ? void 0 : options.workspace;
|
|
@@ -1523,6 +1610,16 @@ var Dropthis = class {
|
|
|
1523
1610
|
this.workspacesResource = new WorkspacesResource(this.transport);
|
|
1524
1611
|
return this.workspacesResource;
|
|
1525
1612
|
}
|
|
1613
|
+
get members() {
|
|
1614
|
+
if (!this.membersResource)
|
|
1615
|
+
this.membersResource = new MembersResource(this.transport);
|
|
1616
|
+
return this.membersResource;
|
|
1617
|
+
}
|
|
1618
|
+
get invitations() {
|
|
1619
|
+
if (!this.invitationsResource)
|
|
1620
|
+
this.invitationsResource = new InvitationsResource(this.transport);
|
|
1621
|
+
return this.invitationsResource;
|
|
1622
|
+
}
|
|
1526
1623
|
async prepare(input, options = {}) {
|
|
1527
1624
|
const merged = this.defaultWorkspace !== void 0 && options.workspace === void 0 ? { ...options, workspace: this.defaultWorkspace } : options;
|
|
1528
1625
|
return resolveInput(input, merged);
|
|
@@ -1537,6 +1634,8 @@ var SHARED_POOL = "shared";
|
|
|
1537
1634
|
DeploymentsResource,
|
|
1538
1635
|
DomainsResource,
|
|
1539
1636
|
Dropthis,
|
|
1637
|
+
InvitationsResource,
|
|
1638
|
+
MembersResource,
|
|
1540
1639
|
PublishInputError,
|
|
1541
1640
|
SHARED_POOL,
|
|
1542
1641
|
UploadsResource,
|