shipmail 0.1.29 → 0.1.31
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/index.cjs +138 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +217 -5
- package/dist/index.d.ts +217 -5
- package/dist/index.js +138 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -276,6 +276,139 @@ var Audiences = class extends ApiResource {
|
|
|
276
276
|
}
|
|
277
277
|
};
|
|
278
278
|
|
|
279
|
+
// src/resources/booking-pages.ts
|
|
280
|
+
var BookingPages = class extends ApiResource {
|
|
281
|
+
create(params, options) {
|
|
282
|
+
return this.client.request({
|
|
283
|
+
method: "POST",
|
|
284
|
+
path: "/booking-pages",
|
|
285
|
+
body: params,
|
|
286
|
+
methodOptions: options
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
list(params, options) {
|
|
290
|
+
return this.client.request({
|
|
291
|
+
method: "GET",
|
|
292
|
+
path: "/booking-pages",
|
|
293
|
+
query: { cursor: params?.cursor, limit: params?.limit },
|
|
294
|
+
methodOptions: options
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
listAutoPaginating(params) {
|
|
298
|
+
return new Page(this.client, "/booking-pages", { limit: params?.limit });
|
|
299
|
+
}
|
|
300
|
+
get(id, options) {
|
|
301
|
+
return this.client.request({
|
|
302
|
+
method: "GET",
|
|
303
|
+
path: `/booking-pages/${encodeURIComponent(id)}`,
|
|
304
|
+
methodOptions: options
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
update(id, params, options) {
|
|
308
|
+
return this.client.request({
|
|
309
|
+
method: "PATCH",
|
|
310
|
+
path: `/booking-pages/${encodeURIComponent(id)}`,
|
|
311
|
+
body: params,
|
|
312
|
+
methodOptions: options
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
delete(id, options) {
|
|
316
|
+
return this.client.request({
|
|
317
|
+
method: "DELETE",
|
|
318
|
+
path: `/booking-pages/${encodeURIComponent(id)}`,
|
|
319
|
+
methodOptions: options
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
// src/resources/calendar.ts
|
|
325
|
+
var CalendarEvents = class extends ApiResource {
|
|
326
|
+
create(params, options) {
|
|
327
|
+
return this.client.request({
|
|
328
|
+
method: "POST",
|
|
329
|
+
path: "/calendar/events",
|
|
330
|
+
body: params,
|
|
331
|
+
methodOptions: options
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
list(params, options) {
|
|
335
|
+
return this.client.request({
|
|
336
|
+
method: "GET",
|
|
337
|
+
path: "/calendar/events",
|
|
338
|
+
query: {
|
|
339
|
+
mailbox: params.mailbox,
|
|
340
|
+
from: params.from,
|
|
341
|
+
to: params.to,
|
|
342
|
+
expand: params.expand,
|
|
343
|
+
calendar_id: params.calendar_id,
|
|
344
|
+
cursor: params.cursor,
|
|
345
|
+
limit: params.limit
|
|
346
|
+
},
|
|
347
|
+
methodOptions: options
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
listAutoPaginating(params) {
|
|
351
|
+
return new Page(this.client, "/calendar/events", {
|
|
352
|
+
mailbox: params.mailbox,
|
|
353
|
+
from: params.from,
|
|
354
|
+
to: params.to,
|
|
355
|
+
expand: params.expand,
|
|
356
|
+
calendar_id: params.calendar_id,
|
|
357
|
+
limit: params.limit
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
get(id, params, options) {
|
|
361
|
+
return this.client.request({
|
|
362
|
+
method: "GET",
|
|
363
|
+
path: `/calendar/events/${encodeURIComponent(id)}`,
|
|
364
|
+
query: { mailbox: params.mailbox },
|
|
365
|
+
methodOptions: options
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
update(id, params, options) {
|
|
369
|
+
return this.client.request({
|
|
370
|
+
method: "PATCH",
|
|
371
|
+
path: `/calendar/events/${encodeURIComponent(id)}`,
|
|
372
|
+
body: params,
|
|
373
|
+
methodOptions: options
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
delete(id, params, options) {
|
|
377
|
+
return this.client.request({
|
|
378
|
+
method: "DELETE",
|
|
379
|
+
path: `/calendar/events/${encodeURIComponent(id)}`,
|
|
380
|
+
query: { mailbox: params.mailbox },
|
|
381
|
+
methodOptions: options
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
};
|
|
385
|
+
var Calendar = class extends ApiResource {
|
|
386
|
+
constructor(client) {
|
|
387
|
+
super(client);
|
|
388
|
+
this.events = new CalendarEvents(client);
|
|
389
|
+
}
|
|
390
|
+
availability(params, options) {
|
|
391
|
+
return this.client.request({
|
|
392
|
+
method: "GET",
|
|
393
|
+
path: "/calendar/availability",
|
|
394
|
+
query: {
|
|
395
|
+
mailbox: params.mailbox,
|
|
396
|
+
from: params.from,
|
|
397
|
+
to: params.to,
|
|
398
|
+
duration: params.duration,
|
|
399
|
+
interval: params.interval,
|
|
400
|
+
timezone: params.timezone,
|
|
401
|
+
days: params.days ? params.days.join(",") : void 0,
|
|
402
|
+
window_start: params.window_start,
|
|
403
|
+
window_end: params.window_end,
|
|
404
|
+
buffer: params.buffer,
|
|
405
|
+
minimum_notice: params.minimum_notice
|
|
406
|
+
},
|
|
407
|
+
methodOptions: options
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
};
|
|
411
|
+
|
|
279
412
|
// src/resources/domains.ts
|
|
280
413
|
var Domains = class extends ApiResource {
|
|
281
414
|
create(params, options) {
|
|
@@ -942,7 +1075,7 @@ var Webhooks = class extends ApiResource {
|
|
|
942
1075
|
};
|
|
943
1076
|
|
|
944
1077
|
// src/version.ts
|
|
945
|
-
var VERSION = "0.1.
|
|
1078
|
+
var VERSION = "0.1.31";
|
|
946
1079
|
|
|
947
1080
|
// src/client.ts
|
|
948
1081
|
var DEFAULT_BASE_URL = "https://shipmail.to/api/v1";
|
|
@@ -994,6 +1127,8 @@ var ShipMailClient = class {
|
|
|
994
1127
|
this.defaultHeaders = config.defaultHeaders ? { ...config.defaultHeaders } : {};
|
|
995
1128
|
}
|
|
996
1129
|
this.audiences = new Audiences(this);
|
|
1130
|
+
this.bookingPages = new BookingPages(this);
|
|
1131
|
+
this.calendar = new Calendar(this);
|
|
997
1132
|
this.domains = new Domains(this);
|
|
998
1133
|
this.mailboxes = new Mailboxes(this);
|
|
999
1134
|
this.messages = new Messages(this);
|
|
@@ -1118,9 +1253,10 @@ var MESSAGE_STATUSES = [
|
|
|
1118
1253
|
"bounced",
|
|
1119
1254
|
"complained",
|
|
1120
1255
|
"failed",
|
|
1256
|
+
"suppressed",
|
|
1121
1257
|
"cancelled"
|
|
1122
1258
|
];
|
|
1123
|
-
var MESSAGE_SOURCES = ["api", "dashboard", "inbound", "smtp"];
|
|
1259
|
+
var MESSAGE_SOURCES = ["api", "newsletter", "dashboard", "inbound", "smtp"];
|
|
1124
1260
|
var WEBHOOK_DELIVERY_STATUSES = ["pending", "delivered", "failed"];
|
|
1125
1261
|
|
|
1126
1262
|
// src/webhook-verification.ts
|