shipmail 0.1.32 → 0.2.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/README.md +53 -0
- package/dist/index.cjs +115 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +150 -3
- package/dist/index.d.ts +150 -3
- package/dist/index.js +115 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -677,6 +677,28 @@ var Mailboxes = class extends ApiResource {
|
|
|
677
677
|
methodOptions: options
|
|
678
678
|
});
|
|
679
679
|
}
|
|
680
|
+
listAppPasswords(id, options) {
|
|
681
|
+
return this.client.request({
|
|
682
|
+
method: "GET",
|
|
683
|
+
path: `/mailboxes/${encodeURIComponent(id)}/app-passwords`,
|
|
684
|
+
methodOptions: options
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
createAppPassword(id, params, options) {
|
|
688
|
+
return this.client.request({
|
|
689
|
+
method: "POST",
|
|
690
|
+
path: `/mailboxes/${encodeURIComponent(id)}/app-passwords`,
|
|
691
|
+
body: params,
|
|
692
|
+
methodOptions: options
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
revokeAppPassword(id, appPasswordId, options) {
|
|
696
|
+
return this.client.request({
|
|
697
|
+
method: "DELETE",
|
|
698
|
+
path: `/mailboxes/${encodeURIComponent(id)}/app-passwords/${encodeURIComponent(appPasswordId)}`,
|
|
699
|
+
methodOptions: options
|
|
700
|
+
});
|
|
701
|
+
}
|
|
680
702
|
getRules(id, options) {
|
|
681
703
|
return this.client.request({
|
|
682
704
|
method: "GET",
|
|
@@ -974,6 +996,87 @@ var Newsletters = class extends ApiResource {
|
|
|
974
996
|
}
|
|
975
997
|
};
|
|
976
998
|
|
|
999
|
+
// src/resources/partner.ts
|
|
1000
|
+
var Partner = class extends ApiResource {
|
|
1001
|
+
listOrganizations(options) {
|
|
1002
|
+
return this.client.request({
|
|
1003
|
+
method: "GET",
|
|
1004
|
+
path: "/partner/organizations",
|
|
1005
|
+
methodOptions: options
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1008
|
+
createOrganization(params, options) {
|
|
1009
|
+
return this.client.request({
|
|
1010
|
+
method: "POST",
|
|
1011
|
+
path: "/partner/organizations",
|
|
1012
|
+
body: params,
|
|
1013
|
+
methodOptions: options
|
|
1014
|
+
});
|
|
1015
|
+
}
|
|
1016
|
+
getOrganization(id, options) {
|
|
1017
|
+
return this.client.request({
|
|
1018
|
+
method: "GET",
|
|
1019
|
+
path: `/partner/organizations/${encodeURIComponent(id)}`,
|
|
1020
|
+
methodOptions: options
|
|
1021
|
+
});
|
|
1022
|
+
}
|
|
1023
|
+
updateOrganization(id, params, options) {
|
|
1024
|
+
return this.client.request({
|
|
1025
|
+
method: "PATCH",
|
|
1026
|
+
path: `/partner/organizations/${encodeURIComponent(id)}`,
|
|
1027
|
+
body: params,
|
|
1028
|
+
methodOptions: options
|
|
1029
|
+
});
|
|
1030
|
+
}
|
|
1031
|
+
resendOwnershipInvitation(id, params = {}, options) {
|
|
1032
|
+
return this.client.request({
|
|
1033
|
+
method: "POST",
|
|
1034
|
+
path: `/partner/organizations/${encodeURIComponent(id)}/ownership-invitations`,
|
|
1035
|
+
body: params,
|
|
1036
|
+
methodOptions: options
|
|
1037
|
+
});
|
|
1038
|
+
}
|
|
1039
|
+
suspendOrganization(id, options) {
|
|
1040
|
+
return this.client.request({
|
|
1041
|
+
method: "POST",
|
|
1042
|
+
path: `/partner/organizations/${encodeURIComponent(id)}/suspend`,
|
|
1043
|
+
methodOptions: options
|
|
1044
|
+
});
|
|
1045
|
+
}
|
|
1046
|
+
resumeOrganization(id, options) {
|
|
1047
|
+
return this.client.request({
|
|
1048
|
+
method: "POST",
|
|
1049
|
+
path: `/partner/organizations/${encodeURIComponent(id)}/resume`,
|
|
1050
|
+
methodOptions: options
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1053
|
+
offboardOrganization(id, options) {
|
|
1054
|
+
return this.client.request({
|
|
1055
|
+
method: "DELETE",
|
|
1056
|
+
path: `/partner/organizations/${encodeURIComponent(id)}`,
|
|
1057
|
+
methodOptions: options
|
|
1058
|
+
});
|
|
1059
|
+
}
|
|
1060
|
+
listMailboxCredentialGrants(options) {
|
|
1061
|
+
return this.client.request({
|
|
1062
|
+
method: "GET",
|
|
1063
|
+
path: "/partner/mailbox-credential-grants",
|
|
1064
|
+
methodOptions: options
|
|
1065
|
+
});
|
|
1066
|
+
}
|
|
1067
|
+
consumeMailboxCredentialGrant(grantId, params = {}, options) {
|
|
1068
|
+
return this.client.request({
|
|
1069
|
+
method: "POST",
|
|
1070
|
+
path: `/partner/mailbox-credential-grants/${encodeURIComponent(grantId)}/consume`,
|
|
1071
|
+
body: params,
|
|
1072
|
+
methodOptions: options
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
usage(options) {
|
|
1076
|
+
return this.client.request({ method: "GET", path: "/partner/usage", methodOptions: options });
|
|
1077
|
+
}
|
|
1078
|
+
};
|
|
1079
|
+
|
|
977
1080
|
// src/resources/status.ts
|
|
978
1081
|
var Status = class extends ApiResource {
|
|
979
1082
|
get(options) {
|
|
@@ -1156,7 +1259,7 @@ var Webhooks = class extends ApiResource {
|
|
|
1156
1259
|
};
|
|
1157
1260
|
|
|
1158
1261
|
// src/version.ts
|
|
1159
|
-
var VERSION = "0.
|
|
1262
|
+
var VERSION = "0.2.0";
|
|
1160
1263
|
|
|
1161
1264
|
// src/client.ts
|
|
1162
1265
|
var DEFAULT_BASE_URL = "https://shipmail.to/api/v1";
|
|
@@ -1199,6 +1302,7 @@ var ShipMailClient = class {
|
|
|
1199
1302
|
this.timeout = DEFAULT_TIMEOUT;
|
|
1200
1303
|
this.fetchFn = globalThis.fetch;
|
|
1201
1304
|
this.defaultHeaders = {};
|
|
1305
|
+
this.organizationId = void 0;
|
|
1202
1306
|
} else {
|
|
1203
1307
|
this.apiKey = config.apiKey;
|
|
1204
1308
|
this.baseUrl = config.baseUrl ?? DEFAULT_BASE_URL;
|
|
@@ -1206,6 +1310,7 @@ var ShipMailClient = class {
|
|
|
1206
1310
|
this.timeout = config.timeout ?? DEFAULT_TIMEOUT;
|
|
1207
1311
|
this.fetchFn = config.fetch ?? globalThis.fetch;
|
|
1208
1312
|
this.defaultHeaders = config.defaultHeaders ? { ...config.defaultHeaders } : {};
|
|
1313
|
+
this.organizationId = config.organizationId;
|
|
1209
1314
|
}
|
|
1210
1315
|
this.audiences = new Audiences(this);
|
|
1211
1316
|
this.bookingPages = new BookingPages(this);
|
|
@@ -1214,6 +1319,7 @@ var ShipMailClient = class {
|
|
|
1214
1319
|
this.mailboxes = new Mailboxes(this);
|
|
1215
1320
|
this.messages = new Messages(this);
|
|
1216
1321
|
this.newsletters = new Newsletters(this);
|
|
1322
|
+
this.partner = new Partner(this);
|
|
1217
1323
|
this.suppressions = new Suppressions(this);
|
|
1218
1324
|
this.threads = new Threads(this);
|
|
1219
1325
|
this.webhooks = new Webhooks(this);
|
|
@@ -1254,6 +1360,10 @@ var ShipMailClient = class {
|
|
|
1254
1360
|
if (methodOpts?.idempotencyKey) {
|
|
1255
1361
|
headers["Idempotency-Key"] = methodOpts.idempotencyKey;
|
|
1256
1362
|
}
|
|
1363
|
+
const targetOrganizationId = methodOpts?.organizationId ?? this.organizationId;
|
|
1364
|
+
if (targetOrganizationId) {
|
|
1365
|
+
headers["X-ShipMail-Organization-Id"] = targetOrganizationId;
|
|
1366
|
+
}
|
|
1257
1367
|
let body = null;
|
|
1258
1368
|
if (options.rawBody !== void 0) {
|
|
1259
1369
|
headers["Content-Type"] = options.contentType ?? "application/octet-stream";
|
|
@@ -1310,6 +1420,9 @@ var ShipMailClient = class {
|
|
|
1310
1420
|
}
|
|
1311
1421
|
};
|
|
1312
1422
|
|
|
1423
|
+
// src/types/booking-page.ts
|
|
1424
|
+
var CONFERENCING_PROVIDER_IDS = ["zoom", "google_meet"];
|
|
1425
|
+
|
|
1313
1426
|
// src/types/common.ts
|
|
1314
1427
|
var WEBHOOK_EVENT_TYPES = [
|
|
1315
1428
|
"message.received",
|
|
@@ -1390,6 +1503,6 @@ async function verifyWebhook(body, headers, secret, options) {
|
|
|
1390
1503
|
return parsed;
|
|
1391
1504
|
}
|
|
1392
1505
|
|
|
1393
|
-
export { AuthenticationError, AuthorizationError, ConflictError, ConnectionError, DOMAIN_STATUSES, InternalServerError, MESSAGE_SOURCES, MESSAGE_STATUSES, NotFoundError, Page, QuotaExceededError, RateLimitError, ShipMailClient, ShipMailError, ValidationError, WEBHOOK_DELIVERY_EVENT_TYPES, WEBHOOK_DELIVERY_STATUSES, WEBHOOK_EVENT_TYPES, WebhookVerificationError, ShipMailClient as default, verifyWebhook };
|
|
1506
|
+
export { AuthenticationError, AuthorizationError, CONFERENCING_PROVIDER_IDS, ConflictError, ConnectionError, DOMAIN_STATUSES, InternalServerError, MESSAGE_SOURCES, MESSAGE_STATUSES, NotFoundError, Page, QuotaExceededError, RateLimitError, ShipMailClient, ShipMailError, ValidationError, WEBHOOK_DELIVERY_EVENT_TYPES, WEBHOOK_DELIVERY_STATUSES, WEBHOOK_EVENT_TYPES, WebhookVerificationError, ShipMailClient as default, verifyWebhook };
|
|
1394
1507
|
//# sourceMappingURL=index.js.map
|
|
1395
1508
|
//# sourceMappingURL=index.js.map
|