@heymantle/core-api-client 0.3.2 → 0.3.3

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.js CHANGED
@@ -639,6 +639,64 @@ var DocsResource = class extends BaseResource {
639
639
  }
640
640
  };
641
641
 
642
+ // src/resources/email-campaigns.ts
643
+ var EmailCampaignsResource = class extends BaseResource {
644
+ async list(params) {
645
+ return this.unwrap(this.api.GET("/email/campaigns", { params: { query: params } }));
646
+ }
647
+ async create(data) {
648
+ return this.unwrap(this.api.POST("/email/campaigns", { body: data }));
649
+ }
650
+ async cancel(campaignId) {
651
+ return this.unwrap(this.api.POST("/email/campaigns/{id}/cancel", { params: { path: { id: campaignId } } }));
652
+ }
653
+ async deliver(campaignId, data) {
654
+ return this.unwrap(this.api.POST("/email/campaigns/{id}/deliver", { params: { path: { id: campaignId } }, body: data }));
655
+ }
656
+ async preview(campaignId, params) {
657
+ return this.unwrap(this.api.GET("/email/campaigns/{id}/preview", { params: { path: { id: campaignId }, query: params } }));
658
+ }
659
+ async send(campaignId, data) {
660
+ return this.unwrap(this.api.POST("/email/campaigns/{id}/send", { params: { path: { id: campaignId } }, body: data }));
661
+ }
662
+ async test(campaignId, data) {
663
+ return this.unwrap(this.api.POST("/email/campaigns/{id}/test", { params: { path: { id: campaignId } }, body: data }));
664
+ }
665
+ async get(campaignId) {
666
+ return this.unwrap(this.api.GET("/email/campaigns/{id}", { params: { path: { id: campaignId } } }));
667
+ }
668
+ async update(campaignId, data) {
669
+ return this.unwrap(this.api.PUT("/email/campaigns/{id}", { params: { path: { id: campaignId } }, body: data }));
670
+ }
671
+ async del(campaignId) {
672
+ return this.unwrap(this.api.DELETE("/email/campaigns/{id}", { params: { path: { id: campaignId } } }));
673
+ }
674
+ };
675
+
676
+ // src/resources/email-deliveries.ts
677
+ var EmailDeliveriesResource = class extends BaseResource {
678
+ async list(params) {
679
+ return this.unwrap(this.api.GET("/email/deliveries", { params: { query: params } }));
680
+ }
681
+ async get(deliveryId) {
682
+ return this.unwrap(this.api.GET("/email/deliveries/{id}", { params: { path: { id: deliveryId } } }));
683
+ }
684
+ };
685
+
686
+ // src/resources/email-layouts.ts
687
+ var EmailLayoutsResource = class extends BaseResource {
688
+ async list(params) {
689
+ return this.unwrap(this.api.GET("/email/layouts", { params: { query: params } }));
690
+ }
691
+ };
692
+
693
+ // src/resources/email-senders.ts
694
+ var EmailSendersResource = class extends BaseResource {
695
+ async list(params) {
696
+ return this.unwrap(this.api.GET("/email/senders", { params: { query: params } }));
697
+ }
698
+ };
699
+
642
700
  // src/resources/email-unsubscribe-groups.ts
643
701
  var EmailUnsubscribeGroupsResource = class extends BaseResource {
644
702
  async list() {
@@ -1153,6 +1211,10 @@ var MantleCoreClient = class {
1153
1211
  this.dealFlows = new DealFlowsResource(this);
1154
1212
  this.deals = new DealsResource(this);
1155
1213
  this.docs = new DocsResource(this);
1214
+ this.emailCampaigns = new EmailCampaignsResource(this);
1215
+ this.emailDeliveries = new EmailDeliveriesResource(this);
1216
+ this.emailLayouts = new EmailLayoutsResource(this);
1217
+ this.emailSenders = new EmailSendersResource(this);
1156
1218
  this.emailUnsubscribeGroups = new EmailUnsubscribeGroupsResource(this);
1157
1219
  this.entities = new EntitiesResource(this);
1158
1220
  this.flowExtensions = new FlowExtensionsResource(this);
package/dist/index.mjs CHANGED
@@ -556,6 +556,64 @@ var DocsResource = class extends BaseResource {
556
556
  }
557
557
  };
558
558
 
559
+ // src/resources/email-campaigns.ts
560
+ var EmailCampaignsResource = class extends BaseResource {
561
+ async list(params) {
562
+ return this.unwrap(this.api.GET("/email/campaigns", { params: { query: params } }));
563
+ }
564
+ async create(data) {
565
+ return this.unwrap(this.api.POST("/email/campaigns", { body: data }));
566
+ }
567
+ async cancel(campaignId) {
568
+ return this.unwrap(this.api.POST("/email/campaigns/{id}/cancel", { params: { path: { id: campaignId } } }));
569
+ }
570
+ async deliver(campaignId, data) {
571
+ return this.unwrap(this.api.POST("/email/campaigns/{id}/deliver", { params: { path: { id: campaignId } }, body: data }));
572
+ }
573
+ async preview(campaignId, params) {
574
+ return this.unwrap(this.api.GET("/email/campaigns/{id}/preview", { params: { path: { id: campaignId }, query: params } }));
575
+ }
576
+ async send(campaignId, data) {
577
+ return this.unwrap(this.api.POST("/email/campaigns/{id}/send", { params: { path: { id: campaignId } }, body: data }));
578
+ }
579
+ async test(campaignId, data) {
580
+ return this.unwrap(this.api.POST("/email/campaigns/{id}/test", { params: { path: { id: campaignId } }, body: data }));
581
+ }
582
+ async get(campaignId) {
583
+ return this.unwrap(this.api.GET("/email/campaigns/{id}", { params: { path: { id: campaignId } } }));
584
+ }
585
+ async update(campaignId, data) {
586
+ return this.unwrap(this.api.PUT("/email/campaigns/{id}", { params: { path: { id: campaignId } }, body: data }));
587
+ }
588
+ async del(campaignId) {
589
+ return this.unwrap(this.api.DELETE("/email/campaigns/{id}", { params: { path: { id: campaignId } } }));
590
+ }
591
+ };
592
+
593
+ // src/resources/email-deliveries.ts
594
+ var EmailDeliveriesResource = class extends BaseResource {
595
+ async list(params) {
596
+ return this.unwrap(this.api.GET("/email/deliveries", { params: { query: params } }));
597
+ }
598
+ async get(deliveryId) {
599
+ return this.unwrap(this.api.GET("/email/deliveries/{id}", { params: { path: { id: deliveryId } } }));
600
+ }
601
+ };
602
+
603
+ // src/resources/email-layouts.ts
604
+ var EmailLayoutsResource = class extends BaseResource {
605
+ async list(params) {
606
+ return this.unwrap(this.api.GET("/email/layouts", { params: { query: params } }));
607
+ }
608
+ };
609
+
610
+ // src/resources/email-senders.ts
611
+ var EmailSendersResource = class extends BaseResource {
612
+ async list(params) {
613
+ return this.unwrap(this.api.GET("/email/senders", { params: { query: params } }));
614
+ }
615
+ };
616
+
559
617
  // src/resources/email-unsubscribe-groups.ts
560
618
  var EmailUnsubscribeGroupsResource = class extends BaseResource {
561
619
  async list() {
@@ -1070,6 +1128,10 @@ var MantleCoreClient = class {
1070
1128
  this.dealFlows = new DealFlowsResource(this);
1071
1129
  this.deals = new DealsResource(this);
1072
1130
  this.docs = new DocsResource(this);
1131
+ this.emailCampaigns = new EmailCampaignsResource(this);
1132
+ this.emailDeliveries = new EmailDeliveriesResource(this);
1133
+ this.emailLayouts = new EmailLayoutsResource(this);
1134
+ this.emailSenders = new EmailSendersResource(this);
1073
1135
  this.emailUnsubscribeGroups = new EmailUnsubscribeGroupsResource(this);
1074
1136
  this.entities = new EntitiesResource(this);
1075
1137
  this.flowExtensions = new FlowExtensionsResource(this);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heymantle/core-api-client",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "TypeScript SDK for the Mantle Core API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",