@bondsports/types 2.0.71 → 2.0.73
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/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/cart/dto/cart-item.dto.d.ts +0 -4
- package/dist/types/cart/dto/cart-item.dto.js.map +1 -1
- package/dist/types/cart/entities/cart-item.entity.d.ts +5 -0
- package/dist/types/cart/entities/cart-item.entity.js.map +1 -1
- package/dist/types/cart/entities/cart.entity.d.ts +7 -0
- package/dist/types/cart/entities/cart.entity.js.map +1 -1
- package/dist/types/cart/types/consts/cart.consts.d.ts +4 -0
- package/dist/types/cart/types/consts/cart.consts.js +14 -0
- package/dist/types/cart/types/consts/cart.consts.js.map +1 -0
- package/dist/types/cart/types/consts/index.d.ts +1 -0
- package/dist/types/cart/types/consts/index.js +18 -0
- package/dist/types/cart/types/consts/index.js.map +1 -0
- package/dist/types/cart/types/index.d.ts +1 -0
- package/dist/types/cart/types/index.js +1 -0
- package/dist/types/cart/types/index.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/notifications/dto/index.d.ts +2 -0
- package/dist/types/notifications/dto/index.js +19 -0
- package/dist/types/notifications/dto/index.js.map +1 -0
- package/dist/types/notifications/dto/notification.create.dto.d.ts +39 -0
- package/dist/types/notifications/dto/notification.create.dto.js +62 -0
- package/dist/types/notifications/dto/notification.create.dto.js.map +1 -0
- package/dist/types/notifications/dto/notification.response.dto.d.ts +21 -0
- package/dist/types/notifications/dto/notification.response.dto.js +30 -0
- package/dist/types/notifications/dto/notification.response.dto.js.map +1 -0
- package/dist/types/notifications/index.d.ts +2 -0
- package/dist/types/notifications/index.js +19 -0
- package/dist/types/notifications/index.js.map +1 -0
- package/dist/types/notifications/types/enums/index.d.ts +1 -0
- package/dist/types/notifications/types/enums/index.js +18 -0
- package/dist/types/notifications/types/enums/index.js.map +1 -0
- package/dist/types/notifications/types/enums/notification.enums.d.ts +18 -0
- package/dist/types/notifications/types/enums/notification.enums.js +28 -0
- package/dist/types/notifications/types/enums/notification.enums.js.map +1 -0
- package/dist/types/notifications/types/index.d.ts +1 -0
- package/dist/types/notifications/types/index.js +18 -0
- package/dist/types/notifications/types/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -39,10 +39,6 @@ export declare class CartItemDto extends OrganizationBaseEntityDto {
|
|
|
39
39
|
status: CartStatusEnum;
|
|
40
40
|
errors?: string[];
|
|
41
41
|
ordinal?: number;
|
|
42
|
-
percentage?: number;
|
|
43
|
-
isTaxInclusive?: boolean;
|
|
44
|
-
entitlementGroupId?: number;
|
|
45
|
-
parentId?: number;
|
|
46
42
|
taxItem?: CartTaxDto;
|
|
47
43
|
discounts?: CartDiscountDto[];
|
|
48
44
|
children?: CartItemDto[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cart-item.dto.js","sourceRoot":"","sources":["../../../../src/types/cart/dto/cart-item.dto.ts"],"names":[],"mappings":";;;AACA,8EAAoF;AAOpF,MAAa,eAAgB,SAAQ,4CAAyB;CAwB7D;AAxBD,0CAwBC;AAED,MAAa,UAAW,SAAQ,4CAAyB;CAUxD;AAVD,gCAUC;AAED,MAAa,WAAY,SAAQ,4CAAyB;
|
|
1
|
+
{"version":3,"file":"cart-item.dto.js","sourceRoot":"","sources":["../../../../src/types/cart/dto/cart-item.dto.ts"],"names":[],"mappings":";;;AACA,8EAAoF;AAOpF,MAAa,eAAgB,SAAQ,4CAAyB;CAwB7D;AAxBD,0CAwBC;AAED,MAAa,UAAW,SAAQ,4CAAyB;CAUxD;AAVD,gCAUC;AAED,MAAa,WAAY,SAAQ,4CAAyB;CAgCzD;AAhCD,kCAgCC;AAED,MAAa,eAAe;IAC3B,YAAY,YAAuC;QAClD,IAAI,CAAC,QAAQ,GAAG,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,QAAQ,CAAC;QACvC,IAAI,CAAC,MAAM,GAAG,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,MAAM,CAAC;QACnC,IAAI,CAAC,SAAS,GAAG,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,SAAS,CAAC;IAC1C,CAAC;CAOD;AAZD,0CAYC;AAED,MAAa,iBAAkB,SAAQ,eAAe;IACrD,YAAY,cAA2C;QACtD,KAAK,CAAC,cAAc,CAAC,CAAC;QACtB,IAAI,CAAC,EAAE,GAAG,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,EAAE,CAAC;IAC9B,CAAC;CAGD;AAPD,8CAOC;AAED,MAAa,cAAe,SAAQ,eAAe;CAIlD;AAJD,wCAIC"}
|
|
@@ -6,15 +6,19 @@ import { ProductTypesEnum } from '../../services/enums.service';
|
|
|
6
6
|
import { ResourceDto } from '../../spaces/dto/resource.dto';
|
|
7
7
|
import { CartStatusEnum } from '../types/enums/cart.enums';
|
|
8
8
|
import { Cart } from './cart.entity';
|
|
9
|
+
import { CartDiscountDto } from '../dto/cart-item.dto';
|
|
10
|
+
import { User } from '../../user/entities/User';
|
|
9
11
|
export declare class CartItem extends OrganizationConnectionBaseEntity {
|
|
10
12
|
deletedAt?: Date;
|
|
11
13
|
cartId: number;
|
|
12
14
|
cart: Cart;
|
|
13
15
|
userId: number;
|
|
16
|
+
user: User;
|
|
14
17
|
productId: number;
|
|
15
18
|
product: Product;
|
|
16
19
|
productType: ProductTypesEnum;
|
|
17
20
|
price: number;
|
|
21
|
+
totalPrice?: number;
|
|
18
22
|
unitPrice?: number;
|
|
19
23
|
quantity?: number;
|
|
20
24
|
status: CartStatusEnum;
|
|
@@ -27,6 +31,7 @@ export declare class CartItem extends OrganizationConnectionBaseEntity {
|
|
|
27
31
|
parentId?: number;
|
|
28
32
|
parent?: CartItem;
|
|
29
33
|
children?: CartItem[];
|
|
34
|
+
discounts?: CartDiscountDto[];
|
|
30
35
|
taxItem?: CartItem;
|
|
31
36
|
discountId?: number;
|
|
32
37
|
discount?: Discount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cart-item.entity.js","sourceRoot":"","sources":["../../../../src/types/cart/entities/cart-item.entity.ts"],"names":[],"mappings":";;;AAEA,oGAAiG;
|
|
1
|
+
{"version":3,"file":"cart-item.entity.js","sourceRoot":"","sources":["../../../../src/types/cart/entities/cart-item.entity.ts"],"names":[],"mappings":";;;AAEA,oGAAiG;AAWjG,MAAa,QAAS,SAAQ,mEAAgC;CAsD7D;AAtDD,4BAsDC"}
|
|
@@ -4,6 +4,7 @@ import { CurrencyEnum, PlatformsEnum } from '../../services/enums.service';
|
|
|
4
4
|
import { User } from '../../user/entities/User';
|
|
5
5
|
import { CartStateEnum, CartStatusEnum } from '../types/enums/cart.enums';
|
|
6
6
|
import { CartItem } from './cart-item.entity';
|
|
7
|
+
import { CartDiscountDto, CartTaxDto } from '../dto/cart-item.dto';
|
|
7
8
|
export declare class Cart extends OrganizationConnectionBaseEntity {
|
|
8
9
|
deletedAt?: Date;
|
|
9
10
|
price: number;
|
|
@@ -20,4 +21,10 @@ export declare class Cart extends OrganizationConnectionBaseEntity {
|
|
|
20
21
|
lastActiveTime: Date;
|
|
21
22
|
lastFetchedTime: Date;
|
|
22
23
|
cartItems: CartItem[];
|
|
24
|
+
taxes?: CartTaxDto[];
|
|
25
|
+
taxAmount?: number;
|
|
26
|
+
discounts?: CartDiscountDto[];
|
|
27
|
+
discountAmount?: number;
|
|
28
|
+
discountSubtotal?: number;
|
|
29
|
+
subtotal?: number;
|
|
23
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cart.entity.js","sourceRoot":"","sources":["../../../../src/types/cart/entities/cart.entity.ts"],"names":[],"mappings":";;;AAEA,oGAAiG;
|
|
1
|
+
{"version":3,"file":"cart.entity.js","sourceRoot":"","sources":["../../../../src/types/cart/entities/cart.entity.ts"],"names":[],"mappings":";;;AAEA,oGAAiG;AAQjG,MAAa,IAAK,SAAQ,mEAAgC;CA0CzD;AA1CD,oBA0CC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CartDiscountDto } from '../../dto/cart-item.dto';
|
|
2
|
+
import { CartItem } from '../../entities/cart-item.entity';
|
|
3
|
+
export declare const uniqueCartTaxTemplate: (lineItem: CartItem) => string;
|
|
4
|
+
export declare const uniqueCartDiscountTemplate: (discountItem: CartDiscountDto) => string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uniqueCartDiscountTemplate = exports.uniqueCartTaxTemplate = void 0;
|
|
4
|
+
const uniqueCartTaxTemplate = (lineItem) => {
|
|
5
|
+
return `${lineItem.percentage}_${lineItem.isTaxInclusive}`;
|
|
6
|
+
};
|
|
7
|
+
exports.uniqueCartTaxTemplate = uniqueCartTaxTemplate;
|
|
8
|
+
const uniqueCartDiscountTemplate = (discountItem) => {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
const discountPercentage = (_a = `${discountItem.percentage}`) !== null && _a !== void 0 ? _a : '';
|
|
11
|
+
return `${discountItem.discountId}_${(_b = discountItem.discount) === null || _b === void 0 ? void 0 : _b.type}_${discountPercentage}`;
|
|
12
|
+
};
|
|
13
|
+
exports.uniqueCartDiscountTemplate = uniqueCartDiscountTemplate;
|
|
14
|
+
//# sourceMappingURL=cart.consts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cart.consts.js","sourceRoot":"","sources":["../../../../../src/types/cart/types/consts/cart.consts.ts"],"names":[],"mappings":";;;AAGO,MAAM,qBAAqB,GAAG,CAAC,QAAkB,EAAU,EAAE;IACnE,OAAO,GAAG,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,cAAc,EAAE,CAAC;AAC5D,CAAC,CAAC;AAFW,QAAA,qBAAqB,yBAEhC;AAEK,MAAM,0BAA0B,GAAG,CAAC,YAA6B,EAAU,EAAE;;IACnF,MAAM,kBAAkB,GAAW,MAAA,GAAG,YAAY,CAAC,UAAU,EAAE,mCAAI,EAAE,CAAC;IACtE,OAAO,GAAG,YAAY,CAAC,UAAU,IAAI,MAAA,YAAY,CAAC,QAAQ,0CAAE,IAAI,IAAI,kBAAkB,EAAE,CAAC;AAC1F,CAAC,CAAC;AAHW,QAAA,0BAA0B,8BAGrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './cart.consts';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./cart.consts"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/types/cart/types/consts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B"}
|
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./consts"), exports);
|
|
17
18
|
__exportStar(require("./enums"), exports);
|
|
18
19
|
__exportStar(require("./interfaces"), exports);
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/cart/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,+CAA6B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/cart/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,0CAAwB;AACxB,+CAA6B"}
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
|
@@ -33,6 +33,7 @@ __exportStar(require("./membership"), exports);
|
|
|
33
33
|
__exportStar(require("./models"), exports);
|
|
34
34
|
__exportStar(require("./monitor-config"), exports);
|
|
35
35
|
__exportStar(require("./notes"), exports);
|
|
36
|
+
__exportStar(require("./notifications"), exports);
|
|
36
37
|
__exportStar(require("./notifyTracker"), exports);
|
|
37
38
|
__exportStar(require("./organization"), exports);
|
|
38
39
|
__exportStar(require("./payment"), exports);
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,2CAAyB;AACzB,yCAAuB;AACvB,kDAAgC;AAChC,8CAA4B;AAC5B,wCAAsB;AACtB,2CAAyB;AACzB,kDAAgC;AAChC,wCAAsB;AACtB,6CAA2B;AAC3B,2CAAyB;AACzB,gDAA8B;AAC9B,4CAA0B;AAC1B,2CAAyB;AACzB,0CAAwB;AACxB,+CAA6B;AAC7B,2CAAyB;AACzB,mDAAiC;AACjC,0CAAwB;AACxB,kDAAgC;AAChC,iDAA+B;AAC/B,4CAA0B;AAC1B,4CAA0B;AAC1B,oDAAkC;AAClC,6CAA2B;AAC3B,qDAAmC;AACnC,+CAA6B;AAC7B,6CAA2B;AAC3B,mDAAiC;AACjC,iDAA+B;AAC/B,sDAAoC;AACpC,0CAAwB;AACxB,6CAA2B;AAC3B,2CAAyB;AACzB,2CAAyB;AACzB,yCAAuB;AACvB,oDAAkC;AAClC,yCAAuB;AACvB,4CAA0B;AAC1B,6CAA2B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,2CAAyB;AACzB,yCAAuB;AACvB,kDAAgC;AAChC,8CAA4B;AAC5B,wCAAsB;AACtB,2CAAyB;AACzB,kDAAgC;AAChC,wCAAsB;AACtB,6CAA2B;AAC3B,2CAAyB;AACzB,gDAA8B;AAC9B,4CAA0B;AAC1B,2CAAyB;AACzB,0CAAwB;AACxB,+CAA6B;AAC7B,2CAAyB;AACzB,mDAAiC;AACjC,0CAAwB;AACxB,kDAAgC;AAChC,kDAAgC;AAChC,iDAA+B;AAC/B,4CAA0B;AAC1B,4CAA0B;AAC1B,oDAAkC;AAClC,6CAA2B;AAC3B,qDAAmC;AACnC,+CAA6B;AAC7B,6CAA2B;AAC3B,mDAAiC;AACjC,iDAA+B;AAC/B,sDAAoC;AACpC,0CAAwB;AACxB,6CAA2B;AAC3B,2CAAyB;AACzB,2CAAyB;AACzB,yCAAuB;AACvB,oDAAkC;AAClC,yCAAuB;AACvB,4CAA0B;AAC1B,6CAA2B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./notification.create.dto"), exports);
|
|
18
|
+
__exportStar(require("./notification.response.dto"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/notifications/dto/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,8DAA4C"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**************************
|
|
2
|
+
* ************************
|
|
3
|
+
* ************************
|
|
4
|
+
*
|
|
5
|
+
* COPIED FROM https://github.com/Bond-Sports/NotificationsService
|
|
6
|
+
*
|
|
7
|
+
* + Convenience API added.
|
|
8
|
+
*
|
|
9
|
+
* ************************
|
|
10
|
+
* ************************
|
|
11
|
+
*/
|
|
12
|
+
import { NotificationDeliveryChannel } from '../types/enums/notification.enums';
|
|
13
|
+
export declare class SenderDto {
|
|
14
|
+
static UNKNOWN_USER_ID: number;
|
|
15
|
+
userId: number;
|
|
16
|
+
organizationId?: number;
|
|
17
|
+
facilityId?: number;
|
|
18
|
+
replyTo?: string;
|
|
19
|
+
constructor(userId: number, organizationId?: number, facilityId?: number, replyTo?: string);
|
|
20
|
+
}
|
|
21
|
+
export declare class RecipientsDto {
|
|
22
|
+
to: string[];
|
|
23
|
+
cc?: string[];
|
|
24
|
+
bcc?: string[];
|
|
25
|
+
static to(to: string): RecipientsDto;
|
|
26
|
+
}
|
|
27
|
+
export declare class ContentDto {
|
|
28
|
+
bodyText: string;
|
|
29
|
+
bodyHtml?: string;
|
|
30
|
+
subject?: string;
|
|
31
|
+
}
|
|
32
|
+
export declare class NotificationCreateDto {
|
|
33
|
+
channel: NotificationDeliveryChannel;
|
|
34
|
+
sender: SenderDto;
|
|
35
|
+
recipients: RecipientsDto[];
|
|
36
|
+
content: ContentDto;
|
|
37
|
+
deliveryPayload?: any;
|
|
38
|
+
static sendgridTemplate(toEmailAddress: string, dynamicTemplateData: any, sendingUserId: number, sendingOrganizationId?: number, sendingFacilityId?: number): NotificationCreateDto;
|
|
39
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**************************
|
|
3
|
+
* ************************
|
|
4
|
+
* ************************
|
|
5
|
+
*
|
|
6
|
+
* COPIED FROM https://github.com/Bond-Sports/NotificationsService
|
|
7
|
+
*
|
|
8
|
+
* + Convenience API added.
|
|
9
|
+
*
|
|
10
|
+
* ************************
|
|
11
|
+
* ************************
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.NotificationCreateDto = exports.ContentDto = exports.RecipientsDto = exports.SenderDto = void 0;
|
|
15
|
+
const notification_enums_1 = require("../types/enums/notification.enums");
|
|
16
|
+
// This file contains DTOs for sending notifications with the SendService.
|
|
17
|
+
// Start at the Notification object, below.
|
|
18
|
+
// It contains all the other request objects.
|
|
19
|
+
class SenderDto {
|
|
20
|
+
// Added for convenience.
|
|
21
|
+
// Not part of NotificationsService object definitions.
|
|
22
|
+
constructor(userId, organizationId, facilityId, replyTo) {
|
|
23
|
+
this.userId = userId;
|
|
24
|
+
this.organizationId = organizationId;
|
|
25
|
+
this.facilityId = facilityId;
|
|
26
|
+
this.replyTo = replyTo;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.SenderDto = SenderDto;
|
|
30
|
+
// used in cases where the user is unknown / unknowable (ie. "system" generated without clear user action)
|
|
31
|
+
SenderDto.UNKNOWN_USER_ID = -10;
|
|
32
|
+
class RecipientsDto {
|
|
33
|
+
// Added for convenience.
|
|
34
|
+
// Not part of NotificationsService object definitions.
|
|
35
|
+
static to(to) {
|
|
36
|
+
const r = new RecipientsDto();
|
|
37
|
+
r.to = [to];
|
|
38
|
+
return r;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.RecipientsDto = RecipientsDto;
|
|
42
|
+
class ContentDto {
|
|
43
|
+
}
|
|
44
|
+
exports.ContentDto = ContentDto;
|
|
45
|
+
class NotificationCreateDto {
|
|
46
|
+
// Added for convenience.
|
|
47
|
+
// Not part of NotificationsService object definitions.
|
|
48
|
+
static sendgridTemplate(toEmailAddress, dynamicTemplateData, sendingUserId, sendingOrganizationId, sendingFacilityId) {
|
|
49
|
+
const note = new NotificationCreateDto();
|
|
50
|
+
note.channel = notification_enums_1.NotificationDeliveryChannel.EMAIL;
|
|
51
|
+
note.sender = new SenderDto(sendingUserId, sendingOrganizationId, sendingFacilityId);
|
|
52
|
+
note.recipients = [RecipientsDto.to(toEmailAddress)];
|
|
53
|
+
// there is no Content object when using a sendgrid template, it's the template and dynamic data:
|
|
54
|
+
note.deliveryPayload = {
|
|
55
|
+
// `templateId` *is necessary* -- it is looked up (via template Name) & set in the NotificationsService.
|
|
56
|
+
dynamicTemplateData: dynamicTemplateData,
|
|
57
|
+
};
|
|
58
|
+
return note;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.NotificationCreateDto = NotificationCreateDto;
|
|
62
|
+
//# sourceMappingURL=notification.create.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification.create.dto.js","sourceRoot":"","sources":["../../../../src/types/notifications/dto/notification.create.dto.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAEH,0EAAgF;AAEhF,0EAA0E;AAE1E,2CAA2C;AAC3C,6CAA6C;AAE7C,MAAa,SAAS;IAYrB,yBAAyB;IACzB,uDAAuD;IACvD,YAAY,MAAc,EAAE,cAAuB,EAAE,UAAmB,EAAE,OAAgB;QACzF,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACxB,CAAC;;AAnBF,8BAoBC;AAnBA,0GAA0G;AACnG,yBAAe,GAAG,CAAC,EAAE,CAAC;AAoB9B,MAAa,aAAa;IAUzB,yBAAyB;IACzB,uDAAuD;IACvD,MAAM,CAAC,EAAE,CAAC,EAAU;QACnB,MAAM,CAAC,GAAG,IAAI,aAAa,EAAE,CAAC;QAC9B,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;QACZ,OAAO,CAAC,CAAC;IACV,CAAC;CACD;AAjBD,sCAiBC;AAED,MAAa,UAAU;CAMtB;AAND,gCAMC;AAED,MAAa,qBAAqB;IAiBjC,yBAAyB;IACzB,uDAAuD;IACvD,MAAM,CAAC,gBAAgB,CACtB,cAAsB,EACtB,mBAAwB,EACxB,aAAqB,EACrB,qBAA8B,EAC9B,iBAA0B;QAE1B,MAAM,IAAI,GAAG,IAAI,qBAAqB,EAAE,CAAC;QACzC,IAAI,CAAC,OAAO,GAAG,gDAA2B,CAAC,KAAK,CAAC;QACjD,IAAI,CAAC,MAAM,GAAG,IAAI,SAAS,CAAC,aAAa,EAAE,qBAAqB,EAAE,iBAAiB,CAAC,CAAC;QACrF,IAAI,CAAC,UAAU,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;QACrD,iGAAiG;QACjG,IAAI,CAAC,eAAe,GAAG;YACtB,wGAAwG;YACxG,mBAAmB,EAAE,mBAAmB;SACxC,CAAC;QACF,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AArCD,sDAqCC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**************************
|
|
2
|
+
* ************************
|
|
3
|
+
* ************************
|
|
4
|
+
* COPIED FROM https://github.com/Bond-Sports/NotificationsService
|
|
5
|
+
* ************************
|
|
6
|
+
* ************************
|
|
7
|
+
*/
|
|
8
|
+
import { SendErrorCode } from '../types/enums/notification.enums';
|
|
9
|
+
export declare class SendErrorDto {
|
|
10
|
+
error: SendErrorCode;
|
|
11
|
+
serviceCode?: number;
|
|
12
|
+
serviceReason?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare class SendResultDto {
|
|
15
|
+
attempted: number;
|
|
16
|
+
succeeded: number;
|
|
17
|
+
failed: number;
|
|
18
|
+
errors: SendErrorDto[];
|
|
19
|
+
constructor(attempted?: number, succeeded?: number, failed?: number, errors?: [SendErrorDto]);
|
|
20
|
+
static withError(error: SendErrorDto): SendResultDto;
|
|
21
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**************************
|
|
3
|
+
* ************************
|
|
4
|
+
* ************************
|
|
5
|
+
* COPIED FROM https://github.com/Bond-Sports/NotificationsService
|
|
6
|
+
* ************************
|
|
7
|
+
* ************************
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.SendResultDto = exports.SendErrorDto = void 0;
|
|
11
|
+
class SendErrorDto {
|
|
12
|
+
}
|
|
13
|
+
exports.SendErrorDto = SendErrorDto;
|
|
14
|
+
class SendResultDto {
|
|
15
|
+
constructor(attempted = 0, succeeded = 0, failed = 0, errors) {
|
|
16
|
+
this.attempted = 0;
|
|
17
|
+
this.succeeded = 0;
|
|
18
|
+
this.failed = 0;
|
|
19
|
+
this.errors = [];
|
|
20
|
+
this.attempted = attempted;
|
|
21
|
+
this.succeeded = succeeded;
|
|
22
|
+
this.failed = failed;
|
|
23
|
+
this.errors = errors ? errors : [];
|
|
24
|
+
}
|
|
25
|
+
static withError(error) {
|
|
26
|
+
return new SendResultDto(0, 0, 0, [error]);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.SendResultDto = SendResultDto;
|
|
30
|
+
//# sourceMappingURL=notification.response.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification.response.dto.js","sourceRoot":"","sources":["../../../../src/types/notifications/dto/notification.response.dto.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAIH,MAAa,YAAY;CAMxB;AAND,oCAMC;AAED,MAAa,aAAa;IASzB,YAAY,YAAoB,CAAC,EAAE,YAAoB,CAAC,EAAE,SAAiB,CAAC,EAAE,MAAuB;QARrG,cAAS,GAAW,CAAC,CAAC;QAEtB,cAAS,GAAW,CAAC,CAAC;QAEtB,WAAM,GAAW,CAAC,CAAC;QAEnB,WAAM,GAAmB,EAAE,CAAC;QAG3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IACpC,CAAC;IAED,MAAM,CAAC,SAAS,CAAC,KAAmB;QACnC,OAAO,IAAI,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAC5C,CAAC;CACD;AAnBD,sCAmBC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./dto"), exports);
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/notifications/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB;AACtB,0CAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './notification.enums';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./notification.enums"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/types/notifications/types/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**************************
|
|
2
|
+
* ************************
|
|
3
|
+
* ************************
|
|
4
|
+
*
|
|
5
|
+
* COPIED FROM https://github.com/Bond-Sports/NotificationsService
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* ************************
|
|
9
|
+
* ************************
|
|
10
|
+
*/
|
|
11
|
+
export declare enum NotificationDeliveryChannel {
|
|
12
|
+
EMAIL = "EMAIL",
|
|
13
|
+
SMS = "SMS"
|
|
14
|
+
}
|
|
15
|
+
export declare enum SendErrorCode {
|
|
16
|
+
BAD_DELIVERY_CHANNEL = 400,
|
|
17
|
+
SENDGRID_ERROR = 401
|
|
18
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**************************
|
|
3
|
+
* ************************
|
|
4
|
+
* ************************
|
|
5
|
+
*
|
|
6
|
+
* COPIED FROM https://github.com/Bond-Sports/NotificationsService
|
|
7
|
+
*
|
|
8
|
+
*
|
|
9
|
+
* ************************
|
|
10
|
+
* ************************
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.SendErrorCode = exports.NotificationDeliveryChannel = void 0;
|
|
14
|
+
var NotificationDeliveryChannel;
|
|
15
|
+
(function (NotificationDeliveryChannel) {
|
|
16
|
+
NotificationDeliveryChannel["EMAIL"] = "EMAIL";
|
|
17
|
+
// SMS is not yet implemented. Error will be returned if attempted.
|
|
18
|
+
NotificationDeliveryChannel["SMS"] = "SMS";
|
|
19
|
+
})(NotificationDeliveryChannel = exports.NotificationDeliveryChannel || (exports.NotificationDeliveryChannel = {}));
|
|
20
|
+
// Internal error codes.
|
|
21
|
+
// NB: Specific errors (ie. from Sendgrid) will be logged and returned directly.
|
|
22
|
+
// We are not translating each, as they are quite granular, and prone to frequent updates by service providers.
|
|
23
|
+
var SendErrorCode;
|
|
24
|
+
(function (SendErrorCode) {
|
|
25
|
+
SendErrorCode[SendErrorCode["BAD_DELIVERY_CHANNEL"] = 400] = "BAD_DELIVERY_CHANNEL";
|
|
26
|
+
SendErrorCode[SendErrorCode["SENDGRID_ERROR"] = 401] = "SENDGRID_ERROR";
|
|
27
|
+
})(SendErrorCode = exports.SendErrorCode || (exports.SendErrorCode = {}));
|
|
28
|
+
//# sourceMappingURL=notification.enums.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification.enums.js","sourceRoot":"","sources":["../../../../../src/types/notifications/types/enums/notification.enums.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAEH,IAAY,2BAIX;AAJD,WAAY,2BAA2B;IACtC,8CAAe,CAAA;IACf,oEAAoE;IACpE,0CAAW,CAAA;AACZ,CAAC,EAJW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAItC;AAED,wBAAwB;AACxB,gFAAgF;AAChF,+GAA+G;AAC/G,IAAY,aAGX;AAHD,WAAY,aAAa;IACxB,mFAA0B,CAAA;IAC1B,uEAAoB,CAAA;AACrB,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './enums';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./enums"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/notifications/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB"}
|