@nerdjs/sales-kit 2.0.37 → 2.0.39
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/entities/company/company.d.ts +17 -0
- package/dist/entities/company/company.js +51 -0
- package/dist/entities/company/company.js.map +1 -0
- package/dist/entities/company/helper.d.ts +5 -0
- package/dist/entities/company/helper.js +16 -0
- package/dist/entities/company/helper.js.map +1 -0
- package/dist/entities/company/index.d.ts +2 -0
- package/dist/entities/company/index.js +3 -0
- package/dist/entities/company/index.js.map +1 -0
- package/dist/entities/contact/contact.d.ts +19 -0
- package/dist/entities/contact/contact.js +55 -0
- package/dist/entities/contact/contact.js.map +1 -0
- package/dist/entities/contact/helper.d.ts +5 -0
- package/dist/entities/contact/helper.js +16 -0
- package/dist/entities/contact/helper.js.map +1 -0
- package/dist/entities/contact/index.d.ts +2 -0
- package/dist/entities/contact/index.js +3 -0
- package/dist/entities/contact/index.js.map +1 -0
- package/dist/entities/customerV1/customerV1.d.ts +138 -0
- package/dist/entities/customerV1/customerV1.js +278 -0
- package/dist/entities/customerV1/customerV1.js.map +1 -0
- package/dist/entities/customerV1/helper.d.ts +5 -0
- package/dist/entities/customerV1/helper.js +16 -0
- package/dist/entities/customerV1/helper.js.map +1 -0
- package/dist/entities/customerV1/index.d.ts +2 -0
- package/dist/entities/customerV1/index.js +3 -0
- package/dist/entities/customerV1/index.js.map +1 -0
- package/dist/entities/customersAccessorial/customersAccessorial.d.ts +20 -0
- package/dist/entities/customersAccessorial/customersAccessorial.js +58 -0
- package/dist/entities/customersAccessorial/customersAccessorial.js.map +1 -0
- package/dist/entities/customersAccessorial/helper.d.ts +5 -0
- package/dist/entities/customersAccessorial/helper.js +16 -0
- package/dist/entities/customersAccessorial/helper.js.map +1 -0
- package/dist/entities/customersAccessorial/index.d.ts +2 -0
- package/dist/entities/customersAccessorial/index.js +3 -0
- package/dist/entities/customersAccessorial/index.js.map +1 -0
- package/dist/entities/flag/flag.d.ts +9 -0
- package/dist/entities/flag/flag.js +35 -0
- package/dist/entities/flag/flag.js.map +1 -0
- package/dist/entities/flag/helper.d.ts +5 -0
- package/dist/entities/flag/helper.js +16 -0
- package/dist/entities/flag/helper.js.map +1 -0
- package/dist/entities/flag/index.d.ts +2 -0
- package/dist/entities/flag/index.js +3 -0
- package/dist/entities/flag/index.js.map +1 -0
- package/dist/entities/index.d.ts +11 -0
- package/dist/entities/index.js +11 -0
- package/dist/entities/index.js.map +1 -1
- package/dist/entities/notification/helper.d.ts +5 -0
- package/dist/entities/notification/helper.js +16 -0
- package/dist/entities/notification/helper.js.map +1 -0
- package/dist/entities/notification/index.d.ts +2 -0
- package/dist/entities/notification/index.js +3 -0
- package/dist/entities/notification/index.js.map +1 -0
- package/dist/entities/notification/notification.d.ts +14 -0
- package/dist/entities/notification/notification.js +45 -0
- package/dist/entities/notification/notification.js.map +1 -0
- package/dist/entities/notificationSubscription/helper.d.ts +5 -0
- package/dist/entities/notificationSubscription/helper.js +16 -0
- package/dist/entities/notificationSubscription/helper.js.map +1 -0
- package/dist/entities/notificationSubscription/index.d.ts +2 -0
- package/dist/entities/notificationSubscription/index.js +3 -0
- package/dist/entities/notificationSubscription/index.js.map +1 -0
- package/dist/entities/notificationSubscription/notificationSubscription.d.ts +14 -0
- package/dist/entities/notificationSubscription/notificationSubscription.js +46 -0
- package/dist/entities/notificationSubscription/notificationSubscription.js.map +1 -0
- package/dist/entities/notificationUserSubscription/helper.d.ts +5 -0
- package/dist/entities/notificationUserSubscription/helper.js +16 -0
- package/dist/entities/notificationUserSubscription/helper.js.map +1 -0
- package/dist/entities/notificationUserSubscription/index.d.ts +2 -0
- package/dist/entities/notificationUserSubscription/index.js +3 -0
- package/dist/entities/notificationUserSubscription/index.js.map +1 -0
- package/dist/entities/notificationUserSubscription/notificationUserSubscription.d.ts +15 -0
- package/dist/entities/notificationUserSubscription/notificationUserSubscription.js +47 -0
- package/dist/entities/notificationUserSubscription/notificationUserSubscription.js.map +1 -0
- package/dist/entities/person/helper.d.ts +5 -0
- package/dist/entities/person/helper.js +16 -0
- package/dist/entities/person/helper.js.map +1 -0
- package/dist/entities/person/index.d.ts +2 -0
- package/dist/entities/person/index.js +3 -0
- package/dist/entities/person/index.js.map +1 -0
- package/dist/entities/person/person.d.ts +46 -0
- package/dist/entities/person/person.js +108 -0
- package/dist/entities/person/person.js.map +1 -0
- package/dist/entities/rateReview/helper.d.ts +5 -0
- package/dist/entities/rateReview/helper.js +16 -0
- package/dist/entities/rateReview/helper.js.map +1 -0
- package/dist/entities/rateReview/index.d.ts +2 -0
- package/dist/entities/rateReview/index.js +3 -0
- package/dist/entities/rateReview/index.js.map +1 -0
- package/dist/entities/rateReview/rateReview.d.ts +49 -0
- package/dist/entities/rateReview/rateReview.js +116 -0
- package/dist/entities/rateReview/rateReview.js.map +1 -0
- package/dist/entities/unitV1/helper.d.ts +5 -0
- package/dist/entities/unitV1/helper.js +16 -0
- package/dist/entities/unitV1/helper.js.map +1 -0
- package/dist/entities/unitV1/index.d.ts +2 -0
- package/dist/entities/unitV1/index.js +3 -0
- package/dist/entities/unitV1/index.js.map +1 -0
- package/dist/entities/unitV1/unit.d.ts +11 -0
- package/dist/entities/unitV1/unit.js +39 -0
- package/dist/entities/unitV1/unit.js.map +1 -0
- package/dist/hooks/customer/customerAutocomplete.d.ts +7 -7
- package/dist/hooks/customer/customerAutocomplete.js +12 -13
- package/dist/hooks/customer/customerAutocomplete.js.map +1 -1
- package/dist/hooks/locationsForm/locationsFormSales.d.ts +1 -0
- package/dist/hooks/locationsForm/locationsFormSales.js +33 -6
- package/dist/hooks/locationsForm/locationsFormSales.js.map +1 -1
- package/dist/hooks/quote/form.js +11 -0
- package/dist/hooks/quote/form.js.map +1 -1
- package/dist/hooks/quote/helpers.d.ts +9 -0
- package/dist/hooks/quote/helpers.js +19 -2
- package/dist/hooks/quote/helpers.js.map +1 -1
- package/dist/hooks/quote/result.js +1 -0
- package/dist/hooks/quote/result.js.map +1 -1
- package/dist/hooks/tender/form.js +3 -6
- package/dist/hooks/tender/form.js.map +1 -1
- package/dist/redux/api/salesApi.d.ts +1 -1
- package/dist/redux/api/salesApi.js +9 -0
- package/dist/redux/api/salesApi.js.map +1 -1
- package/dist/redux/appointmentIssue/appointmentIssueEndpoints.d.ts +10 -10
- package/dist/redux/appointmentIssueCategory/appointmentIssueCategoryEndpoints.d.ts +11 -11
- package/dist/redux/appointmentIssueSubcategory/appointmentIssueSubcategoryEndpoints.d.ts +10 -10
- package/dist/redux/appointmentNote/appointmentNoteEndpoints.d.ts +10 -10
- package/dist/redux/appointmentNoteType/appointmentNoteTypeEndpoints.d.ts +10 -10
- package/dist/redux/archerFile/archerFileEndpoints.d.ts +20 -8
- package/dist/redux/archerFile/archerFileEndpoints.js +18 -3
- package/dist/redux/archerFile/archerFileEndpoints.js.map +1 -1
- package/dist/redux/carrierName/carrierNameEndpoints.d.ts +10 -10
- package/dist/redux/commodityV1/commodityV1Endpoints.d.ts +11 -11
- package/dist/redux/contact/contactEndpoints.d.ts +26 -0
- package/dist/redux/contact/contactEndpoints.js +54 -0
- package/dist/redux/contact/contactEndpoints.js.map +1 -0
- package/dist/redux/contact/index.d.ts +2 -0
- package/dist/redux/contact/index.js +3 -0
- package/dist/redux/contact/index.js.map +1 -0
- package/dist/redux/customer/customerEndpoints.d.ts +27 -19
- package/dist/redux/customer/customerEndpoints.js +7 -7
- package/dist/redux/customer/customerEndpoints.js.map +1 -1
- package/dist/redux/customersAccessorial/customersAccessorialEndpoints.d.ts +24 -0
- package/dist/redux/customersAccessorial/customersAccessorialEndpoints.js +56 -0
- package/dist/redux/customersAccessorial/customersAccessorialEndpoints.js.map +1 -0
- package/dist/redux/customersAccessorial/index.d.ts +2 -0
- package/dist/redux/customersAccessorial/index.js +3 -0
- package/dist/redux/customersAccessorial/index.js.map +1 -0
- package/dist/redux/driverName/driverNameEndpoints.d.ts +9 -9
- package/dist/redux/flag/flagEndpoints.d.ts +24 -0
- package/dist/redux/flag/flagEndpoints.js +64 -0
- package/dist/redux/flag/flagEndpoints.js.map +1 -0
- package/dist/redux/flag/index.d.ts +2 -0
- package/dist/redux/flag/index.js +3 -0
- package/dist/redux/flag/index.js.map +1 -0
- package/dist/redux/holiday/holidayEndpoints.d.ts +10 -10
- package/dist/redux/index.d.ts +8 -0
- package/dist/redux/index.js +8 -0
- package/dist/redux/index.js.map +1 -1
- package/dist/redux/load/loadEndpoints.d.ts +10 -10
- package/dist/redux/loadAdjustment/loadAdjustmentEndpoints.d.ts +10 -10
- package/dist/redux/loadAdjustmentV1/loadAdjustmentV1Endpoints.d.ts +10 -10
- package/dist/redux/loadV1/loadV1Endpoints.d.ts +32 -16
- package/dist/redux/loadV1/loadV1Endpoints.js +28 -1
- package/dist/redux/loadV1/loadV1Endpoints.js.map +1 -1
- package/dist/redux/location/locationEndpoints.d.ts +14 -14
- package/dist/redux/locationV1/locationV1Endpoints.d.ts +19 -19
- package/dist/redux/nmfcClass/nmfcClassEndpoints.d.ts +9 -9
- package/dist/redux/nodeName/nodeNameEndpoints.d.ts +10 -10
- package/dist/redux/notification/index.d.ts +2 -0
- package/dist/redux/notification/index.js +3 -0
- package/dist/redux/notification/index.js.map +1 -0
- package/dist/redux/notification/notificationEndpoints.d.ts +36 -0
- package/dist/redux/notification/notificationEndpoints.js +81 -0
- package/dist/redux/notification/notificationEndpoints.js.map +1 -0
- package/dist/redux/person/index.d.ts +2 -0
- package/dist/redux/person/index.js +3 -0
- package/dist/redux/person/index.js.map +1 -0
- package/dist/redux/person/personEndpoints.d.ts +34 -0
- package/dist/redux/person/personEndpoints.js +67 -0
- package/dist/redux/person/personEndpoints.js.map +1 -0
- package/dist/redux/personName/personNameEndpoints.d.ts +10 -10
- package/dist/redux/quote/quoteEndpoints.d.ts +38 -17
- package/dist/redux/quote/quoteEndpoints.js +18 -1
- package/dist/redux/quote/quoteEndpoints.js.map +1 -1
- package/dist/redux/quote/quoteHooks.d.ts +2 -2
- package/dist/redux/quoteAccessorial/quoteAccessorialEndpoints.d.ts +9 -9
- package/dist/redux/quoteAccessorialV1/quoteAccessorialV1Endpoints.d.ts +10 -10
- package/dist/redux/rateReview/index.d.ts +2 -0
- package/dist/redux/rateReview/index.js +3 -0
- package/dist/redux/rateReview/index.js.map +1 -0
- package/dist/redux/rateReview/rateReviewEndpoints.d.ts +32 -0
- package/dist/redux/rateReview/rateReviewEndpoints.js +65 -0
- package/dist/redux/rateReview/rateReviewEndpoints.js.map +1 -0
- package/dist/redux/shipcon/shipconEndpoints.d.ts +10 -10
- package/dist/redux/shipconV1/shipconV1Endpoints.d.ts +14 -14
- package/dist/redux/tender/tenderEndpoints.d.ts +9 -9
- package/dist/redux/trailerAvailability/customerEndpoints.d.ts +4 -4
- package/dist/redux/types.d.ts +2 -2
- package/dist/redux/unitV1/index.d.ts +2 -0
- package/dist/redux/unitV1/index.js +3 -0
- package/dist/redux/unitV1/index.js.map +1 -0
- package/dist/redux/unitV1/unitV1Endpoints.d.ts +24 -0
- package/dist/redux/unitV1/unitV1Endpoints.js +64 -0
- package/dist/redux/unitV1/unitV1Endpoints.js.map +1 -0
- package/dist/redux/userNoteV1/userNoteV1Endpoints.d.ts +10 -10
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import CustomerV1_Entity from "./customerV1";
|
|
2
|
+
export default class CustomerV1 extends CustomerV1_Entity {
|
|
3
|
+
static fromList(customerV1sJSON) {
|
|
4
|
+
const customerV1s = [];
|
|
5
|
+
if (customerV1sJSON)
|
|
6
|
+
Array.isArray(customerV1sJSON) &&
|
|
7
|
+
customerV1sJSON.forEach((customerV1JSON) => {
|
|
8
|
+
customerV1s.push(new CustomerV1(customerV1JSON));
|
|
9
|
+
});
|
|
10
|
+
return customerV1s;
|
|
11
|
+
}
|
|
12
|
+
toJson() {
|
|
13
|
+
return JSON.stringify(this);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../src/entities/customerV1/helper.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,cAAc,CAAC;AAC7C,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,iBAAiB;IACvD,MAAM,CAAC,QAAQ,CAAC,eAAwB;QACtC,MAAM,WAAW,GAAiB,EAAE,CAAC;QACrC,IAAI,eAAe;YACjB,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC;gBAC5B,eAAe,CAAC,OAAO,CAAC,CAAC,cAAc,EAAE,EAAE;oBACzC,WAAW,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC;gBACnD,CAAC,CAAC,CAAC;QACP,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/entities/customerV1/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default class CustomersAccessorial_Entity {
|
|
2
|
+
static requiredFields: string[];
|
|
3
|
+
constructor(customersAccessorialJson?: unknown);
|
|
4
|
+
id: number;
|
|
5
|
+
customer_id?: number;
|
|
6
|
+
accessorial_id?: number;
|
|
7
|
+
cost_amount?: number;
|
|
8
|
+
condition_a?: number;
|
|
9
|
+
condition_b?: number;
|
|
10
|
+
load_type?: string;
|
|
11
|
+
unit_id?: number;
|
|
12
|
+
direct_payment?: boolean;
|
|
13
|
+
grace_time?: number;
|
|
14
|
+
grace_amount?: number;
|
|
15
|
+
default_contract?: boolean;
|
|
16
|
+
pre_minute_warning?: number;
|
|
17
|
+
edi_code?: string;
|
|
18
|
+
invoice_name?: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CustomersAccessorial_Entity type guard.
|
|
3
|
+
*
|
|
4
|
+
* @param {any} customersAccessorialJson CustomersAccessorial object from API
|
|
5
|
+
* @returns {boolean} Return true if type is CustomersAccessorial_Entity
|
|
6
|
+
*/
|
|
7
|
+
function validator(customersAccessorialJson) {
|
|
8
|
+
if (typeof customersAccessorialJson === "object" &&
|
|
9
|
+
customersAccessorialJson != null) {
|
|
10
|
+
CustomersAccessorial_Entity.requiredFields.forEach((element) => {
|
|
11
|
+
if (!Object.keys(customersAccessorialJson).includes(element))
|
|
12
|
+
throw new Error(`Field ${element} is null or undefined`);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
export default class CustomersAccessorial_Entity {
|
|
18
|
+
static requiredFields = ["id"];
|
|
19
|
+
constructor(customersAccessorialJson) {
|
|
20
|
+
if (validator(customersAccessorialJson)) {
|
|
21
|
+
this.id = customersAccessorialJson.id;
|
|
22
|
+
this.customer_id = customersAccessorialJson.customer_id;
|
|
23
|
+
this.accessorial_id = customersAccessorialJson.accessorial_id;
|
|
24
|
+
this.cost_amount = customersAccessorialJson.cost_amount;
|
|
25
|
+
this.condition_a = customersAccessorialJson.condition_a;
|
|
26
|
+
this.condition_b = customersAccessorialJson.condition_b;
|
|
27
|
+
this.load_type = customersAccessorialJson.load_type;
|
|
28
|
+
this.unit_id = customersAccessorialJson.unit_id;
|
|
29
|
+
this.direct_payment = customersAccessorialJson.direct_payment;
|
|
30
|
+
this.grace_time = customersAccessorialJson.grace_time;
|
|
31
|
+
this.grace_amount = customersAccessorialJson.grace_amount;
|
|
32
|
+
this.default_contract = customersAccessorialJson.default_contract;
|
|
33
|
+
this.pre_minute_warning = customersAccessorialJson.pre_minute_warning;
|
|
34
|
+
this.edi_code = customersAccessorialJson.edi_code;
|
|
35
|
+
this.invoice_name = customersAccessorialJson.invoice_name;
|
|
36
|
+
this.name = customersAccessorialJson.name;
|
|
37
|
+
}
|
|
38
|
+
else
|
|
39
|
+
throw new Error(`Failed to create new instance of ${CustomersAccessorial_Entity.name}`);
|
|
40
|
+
}
|
|
41
|
+
id;
|
|
42
|
+
customer_id;
|
|
43
|
+
accessorial_id;
|
|
44
|
+
cost_amount;
|
|
45
|
+
condition_a;
|
|
46
|
+
condition_b;
|
|
47
|
+
load_type;
|
|
48
|
+
unit_id;
|
|
49
|
+
direct_payment;
|
|
50
|
+
grace_time;
|
|
51
|
+
grace_amount;
|
|
52
|
+
default_contract;
|
|
53
|
+
pre_minute_warning;
|
|
54
|
+
edi_code;
|
|
55
|
+
invoice_name;
|
|
56
|
+
name;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=customersAccessorial.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customersAccessorial.js","sourceRoot":"","sources":["../../../src/entities/customersAccessorial/customersAccessorial.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,SAAS,SAAS,CAChB,wBAAiC;IAEjC,IACE,OAAO,wBAAwB,KAAK,QAAQ;QAC5C,wBAAwB,IAAI,IAAI,EAChC;QACA,2BAA2B,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC7D,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC;gBAC1D,MAAM,IAAI,KAAK,CAAC,SAAS,OAAO,uBAAuB,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;KACJ;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,CAAC,OAAO,OAAO,2BAA2B;IAC9C,MAAM,CAAC,cAAc,GAAG,CAAC,IAAI,CAAC,CAAC;IAE/B,YAAY,wBAAkC;QAC5C,IAA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B,YAAY,CAAU;IACtB,gBAAgB,CAAW;IAC3B,kBAAkB,CAAU;IAC5B,QAAQ,CAAU;IAClB,YAAY,CAAU;IACtB,IAAI,CAAU"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import CustomersAccessorial_Entity from "./customersAccessorial";
|
|
2
|
+
export default class CustomersAccessorial extends CustomersAccessorial_Entity {
|
|
3
|
+
static fromList(customersAccessorialsJSON) {
|
|
4
|
+
const customersAccessorials = [];
|
|
5
|
+
if (customersAccessorialsJSON)
|
|
6
|
+
Array.isArray(customersAccessorialsJSON) &&
|
|
7
|
+
customersAccessorialsJSON.forEach((customersAccessorialJSON) => {
|
|
8
|
+
customersAccessorials.push(new CustomersAccessorial(customersAccessorialJSON));
|
|
9
|
+
});
|
|
10
|
+
return customersAccessorials;
|
|
11
|
+
}
|
|
12
|
+
toJson() {
|
|
13
|
+
return JSON.stringify(this);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../src/entities/customersAccessorial/helper.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,MAAM,wBAAwB,CAAC;AACjE,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,2BAA2B;IAC3E,MAAM,CAAC,QAAQ,CACb,yBAAkC;QAElC,MAAM,qBAAqB,GAA2B,EAAE,CAAC;QACzD,IAAI,yBAAyB;YAC3B,KAAK,CAAC,OAAO,CAAC,yBAAyB,CAAC;gBACtC,yBAAyB,CAAC,OAAO,CAAC,CAAC,wBAAwB,EAAE,EAAE;oBAC7D,qBAAqB,CAAC,IAAI,CACxB,IAAI,oBAAoB,CAAC,wBAAwB,CAAC,CACnD,CAAC;gBACJ,CAAC,CAAC,CAAC;QACP,OAAO,qBAAqB,CAAC;IAC/B,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/entities/customersAccessorial/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,2BAA2B,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flag_Entity type guard.
|
|
3
|
+
*
|
|
4
|
+
* @param {any} flagJson Flag object from API
|
|
5
|
+
* @returns {boolean} Return true if type is Flag_Entity
|
|
6
|
+
*/
|
|
7
|
+
function validator(flagJson) {
|
|
8
|
+
if (typeof flagJson === "object" && flagJson != null) {
|
|
9
|
+
Flag_Entity.requiredFields.forEach((element) => {
|
|
10
|
+
if (!Object.keys(flagJson).includes(element))
|
|
11
|
+
throw new Error(`Field ${element} is null or undefined`);
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
export default class Flag_Entity {
|
|
17
|
+
static requiredFields = ["id"];
|
|
18
|
+
constructor(flagJson) {
|
|
19
|
+
if (validator(flagJson)) {
|
|
20
|
+
this.id = flagJson.id;
|
|
21
|
+
this.flag_area_ids = flagJson.flag_area_ids;
|
|
22
|
+
this.is_area_flag = flagJson.is_area_flag;
|
|
23
|
+
this.name = flagJson.name;
|
|
24
|
+
this.network = flagJson.network;
|
|
25
|
+
}
|
|
26
|
+
else
|
|
27
|
+
throw new Error(`Failed to create new instance of ${Flag_Entity.name}`);
|
|
28
|
+
}
|
|
29
|
+
flag_area_ids;
|
|
30
|
+
id;
|
|
31
|
+
is_area_flag;
|
|
32
|
+
name;
|
|
33
|
+
network;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=flag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flag.js","sourceRoot":"","sources":["../../../src/entities/flag/flag.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,SAAS,SAAS,CAAC,QAAiB;IAClC,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,IAAI,IAAI,EAAE;QACpD,WAAW,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC7C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC;gBAC1C,MAAM,IAAI,KAAK,CAAC,SAAS,OAAO,uBAAuB,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;KACJ;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B,MAAM,CAAC,cAAc,GAAG,CAAC,IAAI,CAAC,CAAC;IAE/B,YAAY,QAAiB;QAC3B,IAAI,SAAS,CAAC,QAAQ,CAAC,EAAE;YACvB,IAAI,CAAC,EAAE,GAAG,QAAQ,CAAC,EAAE,CAAC;YACtB,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC;YAC5C,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC;YAC1C,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;YAC1B,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;SACjC;;YACC,MAAM,IAAI,KAAK,CAAC,oCAAoC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,aAAa,CAAY;IACzB,EAAE,CAAS;IACX,YAAY,CAAW;IACvB,IAAI,CAAU;IACd,OAAO,CAAW"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Flag_Entity from "./flag";
|
|
2
|
+
export default class Flag extends Flag_Entity {
|
|
3
|
+
static fromList(flagsJSON) {
|
|
4
|
+
const flags = [];
|
|
5
|
+
if (flagsJSON)
|
|
6
|
+
Array.isArray(flagsJSON) &&
|
|
7
|
+
flagsJSON.forEach((flagJSON) => {
|
|
8
|
+
flags.push(new Flag(flagJSON));
|
|
9
|
+
});
|
|
10
|
+
return flags;
|
|
11
|
+
}
|
|
12
|
+
toJson() {
|
|
13
|
+
return JSON.stringify(this);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../src/entities/flag/helper.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,QAAQ,CAAC;AACjC,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,WAAW;IAC3C,MAAM,CAAC,QAAQ,CAAC,SAAkB;QAChC,MAAM,KAAK,GAAW,EAAE,CAAC;QACzB,IAAI,SAAS;YACX,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;gBACtB,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;oBAC7B,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;gBACjC,CAAC,CAAC,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/entities/flag/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAC"}
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -32,3 +32,14 @@ export * from "./commodityV1";
|
|
|
32
32
|
export * from "./quoteAccessorialV1";
|
|
33
33
|
export * from "./loadAdjustmentV1";
|
|
34
34
|
export * from "./userNoteV1";
|
|
35
|
+
export * from "./customerV1";
|
|
36
|
+
export * from "./customersAccessorial";
|
|
37
|
+
export * from "./unitV1";
|
|
38
|
+
export * from "./notification";
|
|
39
|
+
export * from "./notificationSubscription";
|
|
40
|
+
export * from "./notificationUserSubscription";
|
|
41
|
+
export * from "./person";
|
|
42
|
+
export * from "./company";
|
|
43
|
+
export * from "./contact";
|
|
44
|
+
export * from "./flag";
|
|
45
|
+
export * from "./rateReview";
|
package/dist/entities/index.js
CHANGED
|
@@ -32,4 +32,15 @@ export * from "./commodityV1";
|
|
|
32
32
|
export * from "./quoteAccessorialV1";
|
|
33
33
|
export * from "./loadAdjustmentV1";
|
|
34
34
|
export * from "./userNoteV1";
|
|
35
|
+
export * from "./customerV1";
|
|
36
|
+
export * from "./customersAccessorial";
|
|
37
|
+
export * from "./unitV1";
|
|
38
|
+
export * from "./notification";
|
|
39
|
+
export * from "./notificationSubscription";
|
|
40
|
+
export * from "./notificationUserSubscription";
|
|
41
|
+
export * from "./person";
|
|
42
|
+
export * from "./company";
|
|
43
|
+
export * from "./contact";
|
|
44
|
+
export * from "./flag";
|
|
45
|
+
export * from "./rateReview";
|
|
35
46
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB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Ac,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Notification_Entity from "./notification";
|
|
2
|
+
export default class Notification extends Notification_Entity {
|
|
3
|
+
static fromList(notificationsJSON) {
|
|
4
|
+
const notifications = [];
|
|
5
|
+
if (notificationsJSON)
|
|
6
|
+
Array.isArray(notificationsJSON) &&
|
|
7
|
+
notificationsJSON.forEach((notificationJSON) => {
|
|
8
|
+
notifications.push(new Notification(notificationJSON));
|
|
9
|
+
});
|
|
10
|
+
return notifications;
|
|
11
|
+
}
|
|
12
|
+
toJson() {
|
|
13
|
+
return JSON.stringify(this);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../src/entities/notification/helper.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,MAAM,gBAAgB,CAAC;AACjD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,mBAAmB;IAC3D,MAAM,CAAC,QAAQ,CAAC,iBAA0B;QACxC,MAAM,aAAa,GAAmB,EAAE,CAAC;QACzC,IAAI,iBAAiB;YACnB,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC;gBAC9B,iBAAiB,CAAC,OAAO,CAAC,CAAC,gBAAgB,EAAE,EAAE;oBAC7C,aAAa,CAAC,IAAI,CAAC,IAAI,YAAY,CAAC,gBAAgB,CAAC,CAAC,CAAC;gBACzD,CAAC,CAAC,CAAC;QACP,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/entities/notification/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export default class Notification_Entity {
|
|
2
|
+
static requiredFields: string[];
|
|
3
|
+
constructor(notificationJson?: unknown);
|
|
4
|
+
id: number;
|
|
5
|
+
subscription_id?: number;
|
|
6
|
+
load_id?: number;
|
|
7
|
+
email_subject?: string;
|
|
8
|
+
email_message?: string;
|
|
9
|
+
push_data?: string;
|
|
10
|
+
notifiable_type?: string;
|
|
11
|
+
notifiable_id?: number;
|
|
12
|
+
cc_email?: string;
|
|
13
|
+
created_at?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notification_Entity type guard.
|
|
3
|
+
*
|
|
4
|
+
* @param {any} notificationJson Notification object from API
|
|
5
|
+
* @returns {boolean} Return true if type is Notification_Entity
|
|
6
|
+
*/
|
|
7
|
+
function validator(notificationJson) {
|
|
8
|
+
if (typeof notificationJson === "object" && notificationJson != null) {
|
|
9
|
+
Notification_Entity.requiredFields.forEach((element) => {
|
|
10
|
+
if (!Object.keys(notificationJson).includes(element))
|
|
11
|
+
throw new Error(`Field ${element} is null or undefined`);
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
export default class Notification_Entity {
|
|
17
|
+
static requiredFields = ["id"];
|
|
18
|
+
constructor(notificationJson) {
|
|
19
|
+
if (validator(notificationJson)) {
|
|
20
|
+
this.id = notificationJson.id;
|
|
21
|
+
this.subscription_id = notificationJson.subscription_id;
|
|
22
|
+
this.load_id = notificationJson.load_id;
|
|
23
|
+
this.email_subject = notificationJson.email_subject;
|
|
24
|
+
this.email_message = notificationJson.email_message;
|
|
25
|
+
this.push_data = notificationJson.push_data;
|
|
26
|
+
this.notifiable_type = notificationJson.notifiable_type;
|
|
27
|
+
this.notifiable_id = notificationJson.notifiable_id;
|
|
28
|
+
this.cc_email = notificationJson.cc_email;
|
|
29
|
+
this.created_at = notificationJson.created_at;
|
|
30
|
+
}
|
|
31
|
+
else
|
|
32
|
+
throw new Error(`Failed to create new instance of ${Notification_Entity.name}`);
|
|
33
|
+
}
|
|
34
|
+
id;
|
|
35
|
+
subscription_id;
|
|
36
|
+
load_id;
|
|
37
|
+
email_subject;
|
|
38
|
+
email_message;
|
|
39
|
+
push_data;
|
|
40
|
+
notifiable_type;
|
|
41
|
+
notifiable_id;
|
|
42
|
+
cc_email;
|
|
43
|
+
created_at;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=notification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification.js","sourceRoot":"","sources":["../../../src/entities/notification/notification.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,SAAS,SAAS,CAChB,gBAAyB;IAEzB,IAAI,OAAO,gBAAgB,KAAK,QAAQ,IAAI,gBAAgB,IAAI,IAAI,EAAE;QACpE,mBAAmB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YACrD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAA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|
|
2
|
+
export default class NotificationSubscription extends NotificationSubscription_Entity {
|
|
3
|
+
static fromList(notificationSubscriptionsJSON: unknown): Array<NotificationSubscription>;
|
|
4
|
+
toJson(): string;
|
|
5
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import NotificationSubscription_Entity from "./notificationSubscription";
|
|
2
|
+
export default class NotificationSubscription extends NotificationSubscription_Entity {
|
|
3
|
+
static fromList(notificationSubscriptionsJSON) {
|
|
4
|
+
const notificationSubscriptions = [];
|
|
5
|
+
if (notificationSubscriptionsJSON)
|
|
6
|
+
Array.isArray(notificationSubscriptionsJSON) &&
|
|
7
|
+
notificationSubscriptionsJSON.forEach((notificationSubscriptionJSON) => {
|
|
8
|
+
notificationSubscriptions.push(new NotificationSubscription(notificationSubscriptionJSON));
|
|
9
|
+
});
|
|
10
|
+
return notificationSubscriptions;
|
|
11
|
+
}
|
|
12
|
+
toJson() {
|
|
13
|
+
return JSON.stringify(this);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../src/entities/notificationSubscription/helper.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,MAAM,4BAA4B,CAAC;AACzE,MAAM,CAAC,OAAO,OAAO,wBAAyB,SAAQ,+BAA+B;IACnF,MAAM,CAAC,QAAQ,CACb,6BAAsC;QAEtC,MAAM,yBAAyB,GAA+B,EAAE,CAAC;QACjE,IAAI,6BAA6B;YAC/B,KAAK,CAAC,OAAO,CAAC,6BAA6B,CAAC;gBAC1C,6BAA6B,CAAC,OAAO,CACnC,CAAC,4BAA4B,EAAE,EAAE;oBAC/B,yBAAyB,CAAC,IAAI,CAC5B,IAAI,wBAAwB,CAAC,4BAA4B,CAAC,CAC3D,CAAC;gBACJ,CAAC,CACF,CAAC;QACN,OAAO,yBAAyB,CAAC;IACnC,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/entities/notificationSubscription/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,+BAA+B,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export default class NotificationSubscription_Entity {
|
|
2
|
+
static requiredFields: string[];
|
|
3
|
+
constructor(notificationSubscriptionJson: unknown);
|
|
4
|
+
id: number;
|
|
5
|
+
name?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
destination_id?: number;
|
|
8
|
+
code?: string;
|
|
9
|
+
item_order?: number;
|
|
10
|
+
cc_emails?: string;
|
|
11
|
+
from_email?: string;
|
|
12
|
+
icon_resource?: string;
|
|
13
|
+
sync_notification?: boolean;
|
|
14
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NotificationSubscription_Entity type guard.
|
|
3
|
+
*
|
|
4
|
+
* @param {any} notificationSubscriptionJson NotificationSubscription object from API
|
|
5
|
+
* @returns {boolean} Return true if type is NotificationSubscription_Entity
|
|
6
|
+
*/
|
|
7
|
+
function validator(notificationSubscriptionJson) {
|
|
8
|
+
if (typeof notificationSubscriptionJson === "object" &&
|
|
9
|
+
notificationSubscriptionJson != null) {
|
|
10
|
+
NotificationSubscription_Entity.requiredFields.forEach((element) => {
|
|
11
|
+
if (!Object.keys(notificationSubscriptionJson).includes(element))
|
|
12
|
+
throw new Error(`Field ${element} is null or undefined`);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
export default class NotificationSubscription_Entity {
|
|
18
|
+
static requiredFields = ["id"];
|
|
19
|
+
constructor(notificationSubscriptionJson) {
|
|
20
|
+
if (validator(notificationSubscriptionJson)) {
|
|
21
|
+
this.id = notificationSubscriptionJson.id;
|
|
22
|
+
this.name = notificationSubscriptionJson.name;
|
|
23
|
+
this.description = notificationSubscriptionJson.description;
|
|
24
|
+
this.destination_id = notificationSubscriptionJson.destination_id;
|
|
25
|
+
this.code = notificationSubscriptionJson.code;
|
|
26
|
+
this.item_order = notificationSubscriptionJson.item_order;
|
|
27
|
+
this.cc_emails = notificationSubscriptionJson.cc_emails;
|
|
28
|
+
this.from_email = notificationSubscriptionJson.from_email;
|
|
29
|
+
this.icon_resource = notificationSubscriptionJson.icon_resource;
|
|
30
|
+
this.sync_notification = notificationSubscriptionJson.sync_notification;
|
|
31
|
+
}
|
|
32
|
+
else
|
|
33
|
+
throw new Error(`Failed to create new instance of ${NotificationSubscription_Entity.name}`);
|
|
34
|
+
}
|
|
35
|
+
id;
|
|
36
|
+
name;
|
|
37
|
+
description;
|
|
38
|
+
destination_id;
|
|
39
|
+
code;
|
|
40
|
+
item_order;
|
|
41
|
+
cc_emails;
|
|
42
|
+
from_email;
|
|
43
|
+
icon_resource;
|
|
44
|
+
sync_notification;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=notificationSubscription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notificationSubscription.js","sourceRoot":"","sources":["../../../src/entities/notificationSubscription/notificationSubscription.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,SAAS,SAAS,CAChB,4BAAqC;IAErC,IACE,OAAO,4BAA4B,KAAK,QAAQ;QAChD,4BAA4B,IAAI,IAAI,EACpC;QACA,+BAA+B,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YACjE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC;gBAC9D,MAAM,IAAI,KAAK,CAAC,SAAS,OAAO,uBAAuB,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;KACJ;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,CAAC,OAAO,OAAO,+BAA+B;IAClD,MAAM,CAAC,cAAc,GAAG,CAAC,IAAI,CAAC,CAAC;IAE/B,YAAY,4BAAqC;QAC/C,IAAI,SAAS,CAAC,4BAA4B,CAAC,EAAE;YAC3C,IAAI,CAAC,EAAE,GAAG,4BAA4B,CAAC,EAAE,CAAC;YAC1C,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC,IAAI,CAAC;YAC9C,IAAI,CAAC,WAAW,GAAG,4BAA4B,CAAC,WAAW,CAAC;YAC5D,IAAI,CAAC,cAAc,GAAG,4BAA4B,CAAC,cAAc,CAAC;YAClE,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC,IAAI,CAAC;YAC9C,IAAI,CAAC,UAAU,GAAG,4BAA4B,CAAC,UAAU,CAAC;YAC1D,IAAI,CAAC,SAAS,GAAG,4BAA4B,CAAC,SAAS,CAAC;YACxD,IAAI,CAAC,UAAU,GAAG,4BAA4B,CAAC,UAAU,CAAC;YAC1D,IAAI,CAAC,aAAa,GAAG,4BAA4B,CAAC,aAAa,CAAC;YAChE,IAAI,CAAC,iBAAiB,GAAG,4BAA4B,CAAC,iBAAiB,CAAC;SACzE;;YACC,MAAM,IAAI,KAAK,CACb,oCAAoC,+BAA+B,CAAC,IAAI,EAAE,CAC3E,CAAC;IACN,CAAC;IAED,EAAE,CAAS;IACX,IAAI,CAAU;IACd,WAAW,CAAU;IACrB,cAAc,CAAU;IACxB,IAAI,CAAU;IACd,UAAU,CAAU;IACpB,SAAS,CAAU;IACnB,UAAU,CAAU;IACpB,aAAa,CAAU;IACvB,iBAAiB,CAAW"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import NotificationUserSubscription_Entity from "./notificationUserSubscription";
|
|
2
|
+
export default class NotificationUserSubscription extends NotificationUserSubscription_Entity {
|
|
3
|
+
static fromList(notificationUserSubscriptionsJSON: unknown): Array<NotificationUserSubscription>;
|
|
4
|
+
toJson(): string;
|
|
5
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import NotificationUserSubscription_Entity from "./notificationUserSubscription";
|
|
2
|
+
export default class NotificationUserSubscription extends NotificationUserSubscription_Entity {
|
|
3
|
+
static fromList(notificationUserSubscriptionsJSON) {
|
|
4
|
+
const notificationUserSubscriptions = [];
|
|
5
|
+
if (notificationUserSubscriptionsJSON)
|
|
6
|
+
Array.isArray(notificationUserSubscriptionsJSON) &&
|
|
7
|
+
notificationUserSubscriptionsJSON.forEach((notificationUserSubscriptionJSON) => {
|
|
8
|
+
notificationUserSubscriptions.push(new NotificationUserSubscription(notificationUserSubscriptionJSON));
|
|
9
|
+
});
|
|
10
|
+
return notificationUserSubscriptions;
|
|
11
|
+
}
|
|
12
|
+
toJson() {
|
|
13
|
+
return JSON.stringify(this);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../src/entities/notificationUserSubscription/helper.ts"],"names":[],"mappings":"AAAA,OAAO,mCAAmC,MAAM,gCAAgC,CAAC;AACjF,MAAM,CAAC,OAAO,OAAO,4BAA6B,SAAQ,mCAAmC;IAC3F,MAAM,CAAC,QAAQ,CACb,iCAA0C;QAE1C,MAAM,6BAA6B,GAAmC,EAAE,CAAC;QACzE,IAAI,iCAAiC;YACnC,KAAK,CAAC,OAAO,CAAC,iCAAiC,CAAC;gBAC9C,iCAAiC,CAAC,OAAO,CACvC,CAAC,gCAAgC,EAAE,EAAE;oBACnC,6BAA6B,CAAC,IAAI,CAChC,IAAI,4BAA4B,CAAC,gCAAgC,CAAC,CACnE,CAAC;gBACJ,CAAC,CACF,CAAC;QACN,OAAO,6BAA6B,CAAC;IACvC,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/entities/notificationUserSubscription/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,4BAA4B,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,mCAAmC,EAAE,MAAM,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NotificationSubscription_Entity } from "../notificationSubscription";
|
|
2
|
+
export default class NotificationUserSubscription_Entity {
|
|
3
|
+
static requiredFields: string[];
|
|
4
|
+
constructor(notificationUserSubscriptionJson?: unknown);
|
|
5
|
+
id: number;
|
|
6
|
+
subscription_id?: number;
|
|
7
|
+
person_id?: number;
|
|
8
|
+
push?: boolean;
|
|
9
|
+
email?: boolean;
|
|
10
|
+
report?: boolean;
|
|
11
|
+
unsubscribe_code?: string;
|
|
12
|
+
reminder?: boolean;
|
|
13
|
+
alternative_email?: string;
|
|
14
|
+
subscription?: NotificationSubscription_Entity;
|
|
15
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NotificationUserSubscription_Entity type guard.
|
|
3
|
+
*
|
|
4
|
+
* @param {any} notificationUserSubscriptionJson NotificationUserSubscription object from API
|
|
5
|
+
* @returns {boolean} Return true if type is NotificationUserSubscription_Entity
|
|
6
|
+
*/
|
|
7
|
+
function validator(notificationUserSubscriptionJson) {
|
|
8
|
+
if (typeof notificationUserSubscriptionJson === "object" &&
|
|
9
|
+
notificationUserSubscriptionJson != null) {
|
|
10
|
+
NotificationUserSubscription_Entity.requiredFields.forEach((element) => {
|
|
11
|
+
if (!Object.keys(notificationUserSubscriptionJson).includes(element))
|
|
12
|
+
throw new Error(`Field ${element} is null or undefined`);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
export default class NotificationUserSubscription_Entity {
|
|
18
|
+
static requiredFields = ["id"];
|
|
19
|
+
constructor(notificationUserSubscriptionJson) {
|
|
20
|
+
if (validator(notificationUserSubscriptionJson)) {
|
|
21
|
+
this.id = notificationUserSubscriptionJson.id;
|
|
22
|
+
this.subscription_id = notificationUserSubscriptionJson.subscription_id;
|
|
23
|
+
this.person_id = notificationUserSubscriptionJson.person_id;
|
|
24
|
+
this.push = notificationUserSubscriptionJson.push;
|
|
25
|
+
this.email = notificationUserSubscriptionJson.email;
|
|
26
|
+
this.report = notificationUserSubscriptionJson.report;
|
|
27
|
+
this.unsubscribe_code = notificationUserSubscriptionJson.unsubscribe_code;
|
|
28
|
+
this.reminder = notificationUserSubscriptionJson.reminder;
|
|
29
|
+
this.alternative_email =
|
|
30
|
+
notificationUserSubscriptionJson.alternative_email;
|
|
31
|
+
this.subscription = notificationUserSubscriptionJson.subscription;
|
|
32
|
+
}
|
|
33
|
+
else
|
|
34
|
+
throw new Error(`Failed to create new instance of ${NotificationUserSubscription_Entity.name}`);
|
|
35
|
+
}
|
|
36
|
+
id;
|
|
37
|
+
subscription_id;
|
|
38
|
+
person_id;
|
|
39
|
+
push;
|
|
40
|
+
email;
|
|
41
|
+
report;
|
|
42
|
+
unsubscribe_code;
|
|
43
|
+
reminder;
|
|
44
|
+
alternative_email;
|
|
45
|
+
subscription;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=notificationUserSubscription.js.map
|