Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@trycourier/courier

Package Overview
Dependencies
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@trycourier/courier - npm Package Compare versions

Comparing version 1.6.0 to 1.6.1

12

CHANGELOG.md

@@ -8,2 +8,11 @@ # Change Log

## [v1.6.1] - 2020-09-23
### Fixed
- Fixed return types for `PUT` methods that return 204
- Fixed param types for `client.lists.send()`
- Fixed return type for `client.lists.findByRecipientId()`
- Fixed param types for `client.lists.put()`
## [v1.6.0] - 2020-09-22

@@ -96,3 +105,4 @@

[unreleased]: https://github.com/trycourier/courier-python/compare/v1.6.0...HEAD
[unreleased]: https://github.com/trycourier/courier-python/compare/v1.6.1...HEAD
[v1.6.1]: https://github.com/trycourier/courier-python/compare/v1.6.0...v1.6.1
[v1.6.0]: https://github.com/trycourier/courier-python/compare/v1.5.0...v1.6.0

@@ -99,0 +109,0 @@ [v1.5.0]: https://github.com/trycourier/courier-python/compare/v1.4.0...v1.5.0

30

lib/lists/index.js

@@ -68,10 +68,9 @@ "use strict";

// tslint:disable-next-line: no-shadowed-variable
return function (listId, list) { return __awaiter(void 0, void 0, void 0, function () {
var res;
return function (listId, params) { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, options.httpClient.put("/lists/" + listId, list)];
case 0: return [4 /*yield*/, options.httpClient.put("/lists/" + listId, params)];
case 1:
res = _a.sent();
return [2 /*return*/, res.data];
_a.sent();
return [2 /*return*/];
}

@@ -119,16 +118,8 @@ });

var putSubscriptions = function (options) {
return function (listId, recipients, config) { return __awaiter(void 0, void 0, void 0, function () {
var axiosConfig;
return function (listId, recipients) { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
axiosConfig = {
headers: {}
};
if (config && config.idempotencyKey) {
axiosConfig.headers["Idempotency-Key"] = config.idempotencyKey;
}
return [4 /*yield*/, options.httpClient.put("/lists/" + listId + "/subscriptions", {
recipients: recipients
}, axiosConfig)];
case 0: return [4 /*yield*/, options.httpClient.put("/lists/" + listId + "/subscriptions", {
recipients: recipients
})];
case 1:

@@ -143,3 +134,2 @@ _a.sent();

return function (listId, recipientId) { return __awaiter(void 0, void 0, void 0, function () {
var res;
return __generator(this, function (_a) {

@@ -149,4 +139,4 @@ switch (_a.label) {

case 1:
res = _a.sent();
return [2 /*return*/, res.data];
_a.sent();
return [2 /*return*/];
}

@@ -153,0 +143,0 @@ });

@@ -8,2 +8,5 @@ import { ICourierPaging, ICourierSendConfig, ICourierSendListOrPatternParams, ICourierSendResponse } from "../types";

}
export interface ICourierListPutParams {
name: string;
}
export interface ICourierListGetAllParams {

@@ -24,5 +27,2 @@ cursor?: string;

}
export interface ICourierListPostConfig {
idempotencyKey?: string;
}
export interface ICourierListGetSubscriptionsResponse {

@@ -35,14 +35,18 @@ paging: ICourierPaging;

}
export interface ICourierListFindByRecipientIdResponse {
paging: ICourierPaging;
results: ICourierList[];
}
export interface ICourierClientLists {
delete: (listId: string) => Promise<void>;
findByRecipientId: (recipientId: string, params?: ICourierListFindByRecipientIdParams) => Promise<ICourierListGetAllResponse>;
findByRecipientId: (recipientId: string, params?: ICourierListFindByRecipientIdParams) => Promise<ICourierListFindByRecipientIdResponse>;
get: (listId: string) => Promise<ICourierList>;
getSubscriptions: (listId: string, params?: ICourierListGetSubscriptionsParams) => Promise<ICourierListGetSubscriptionsResponse>;
list: (params?: ICourierListGetAllParams) => Promise<ICourierListGetAllResponse>;
put: (listId: string, list: ICourierList) => Promise<ICourierList>;
putSubscriptions: (listId: string, recipients: string[], config?: ICourierListPostConfig) => Promise<void>;
put: (listId: string, parms: ICourierListPutParams) => Promise<void>;
putSubscriptions: (listId: string, recipients: string[]) => Promise<void>;
restore: (listId: string) => Promise<void>;
send: (params: ICourierSendListOrPatternParams, config?: ICourierSendConfig) => Promise<ICourierSendResponse>;
subscribe: (listId: string, recipientId: string) => Promise<ICourierListRecipient>;
subscribe: (listId: string, recipientId: string) => Promise<void>;
unsubscribe: (listId: string, recipientId: string) => Promise<void>;
}

@@ -36,3 +36,3 @@ import { AxiosRequestConfig } from "axios";

export interface ICourierSendListOrPatternParams {
eventId: string;
event: string;
data?: object;

@@ -39,0 +39,0 @@ brand?: string;

{
"name": "@trycourier/courier",
"version": "1.6.0",
"version": "1.6.1",
"description": "A node.js module for communicating with the Courier REST API.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -33,4 +33,4 @@ # `@trycourier/courier`

const { messageId } = await courier.lists.send({
eventId: "<EVENT_ID>", // get from the Courier UI
listId: "<LIST_ID>", // e.g. example.list.id
event: "<EVENT_ID>", // get from the Courier UI
list: "<LIST_ID>", // e.g. example.list.id
data: {} // optional variables for merging into templates

@@ -41,3 +41,3 @@ });

const { messageId } = await courier.lists.send({
eventId: "<EVENT_ID>", // get from the Courier UI
event: "<EVENT_ID>", // get from the Courier UI
pattern: "<PATTERN>", // e.g. example.list.*

@@ -44,0 +44,0 @@ data: {} // optional variables for merging into templates

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc