@emilgroup/customer-sdk-node 1.9.1 → 1.11.0
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/.openapi-generator/FILES +9 -0
- package/README.md +58 -2
- package/api/authentication-api.ts +601 -0
- package/api/claims-api.ts +158 -40
- package/api/customers-api.ts +72 -1770
- package/api/documents-api.ts +442 -0
- package/api/invites-api.ts +443 -0
- package/api/invoices-api.ts +245 -0
- package/api/payments-api.ts +291 -0
- package/api/policies-api.ts +16 -16
- package/api/products-api.ts +16 -16
- package/api.ts +11 -0
- package/dist/api/authentication-api.d.ts +332 -0
- package/dist/api/authentication-api.js +604 -0
- package/dist/api/claims-api.d.ts +106 -31
- package/dist/api/claims-api.js +84 -36
- package/dist/api/customers-api.d.ts +0 -954
- package/dist/api/customers-api.js +20 -1381
- package/dist/api/documents-api.d.ts +262 -0
- package/dist/api/documents-api.js +417 -0
- package/dist/api/invites-api.d.ts +248 -0
- package/dist/api/invites-api.js +456 -0
- package/dist/api/invoices-api.d.ts +150 -0
- package/dist/api/invoices-api.js +253 -0
- package/dist/api/payments-api.d.ts +171 -0
- package/dist/api/payments-api.js +312 -0
- package/dist/api/policies-api.d.ts +16 -16
- package/dist/api/policies-api.js +12 -12
- package/dist/api/products-api.d.ts +16 -16
- package/dist/api/products-api.js +12 -12
- package/dist/api.d.ts +7 -1
- package/dist/api.js +6 -0
- package/dist/models/account-class.d.ts +31 -1
- package/dist/models/account-class.js +11 -0
- package/dist/models/claim-class.d.ts +132 -0
- package/dist/models/claim-class.js +15 -0
- package/dist/models/create-account-request-dto.d.ts +39 -9
- package/dist/models/create-account-request-dto.js +11 -1
- package/dist/models/create-customer-claim-response-class.d.ts +25 -0
- package/dist/models/create-customer-claim-response-class.js +15 -0
- package/dist/models/index.d.ts +4 -0
- package/dist/models/index.js +4 -0
- package/dist/models/list-customer-claims-response-class.d.ts +31 -0
- package/dist/models/list-customer-claims-response-class.js +15 -0
- package/dist/models/update-account-request-dto.d.ts +17 -0
- package/dist/models/update-account-request-dto.js +5 -1
- package/dist/models/update-customer-claim-response-class.d.ts +25 -0
- package/dist/models/update-customer-claim-response-class.js +15 -0
- package/models/account-class.ts +35 -1
- package/models/claim-class.ts +138 -0
- package/models/create-account-request-dto.ts +41 -9
- package/models/create-customer-claim-response-class.ts +31 -0
- package/models/index.ts +4 -0
- package/models/list-customer-claims-response-class.ts +37 -0
- package/models/update-account-request-dto.ts +18 -0
- package/models/update-customer-claim-response-class.ts +31 -0
- package/package.json +1 -1
package/.openapi-generator/FILES
CHANGED
|
@@ -3,8 +3,13 @@
|
|
|
3
3
|
.openapi-generator-ignore
|
|
4
4
|
README.md
|
|
5
5
|
api.ts
|
|
6
|
+
api/authentication-api.ts
|
|
6
7
|
api/claims-api.ts
|
|
7
8
|
api/customers-api.ts
|
|
9
|
+
api/documents-api.ts
|
|
10
|
+
api/invites-api.ts
|
|
11
|
+
api/invoices-api.ts
|
|
12
|
+
api/payments-api.ts
|
|
8
13
|
api/policies-api.ts
|
|
9
14
|
api/products-api.ts
|
|
10
15
|
base.ts
|
|
@@ -15,12 +20,14 @@ index.ts
|
|
|
15
20
|
models/account-class.ts
|
|
16
21
|
models/account-policy-class.ts
|
|
17
22
|
models/authentication-result-class.ts
|
|
23
|
+
models/claim-class.ts
|
|
18
24
|
models/complete-braintree-payment-setup-request-dto.ts
|
|
19
25
|
models/complete-payment-setup-psp-request.ts
|
|
20
26
|
models/complete-payment-setup-response-class.ts
|
|
21
27
|
models/complete-stripe-payment-setup-request-dto.ts
|
|
22
28
|
models/create-account-request-dto.ts
|
|
23
29
|
models/create-customer-claim-request-dto.ts
|
|
30
|
+
models/create-customer-claim-response-class.ts
|
|
24
31
|
models/create-customer-request-dto.ts
|
|
25
32
|
models/create-customer-response-class.ts
|
|
26
33
|
models/create-presigned-post-response-class.ts
|
|
@@ -43,6 +50,7 @@ models/invite-by-customer-response-class.ts
|
|
|
43
50
|
models/invite-by-tenant-response-class.ts
|
|
44
51
|
models/invite-class.ts
|
|
45
52
|
models/invoice-class.ts
|
|
53
|
+
models/list-customer-claims-response-class.ts
|
|
46
54
|
models/list-documents-response-class.ts
|
|
47
55
|
models/list-invoices-response-class.ts
|
|
48
56
|
models/list-policies-response-class.ts
|
|
@@ -65,6 +73,7 @@ models/terminate-customer-policy-response-class.ts
|
|
|
65
73
|
models/timeslice-class.ts
|
|
66
74
|
models/update-account-request-dto.ts
|
|
67
75
|
models/update-customer-claim-request-dto.ts
|
|
76
|
+
models/update-customer-claim-response-class.ts
|
|
68
77
|
models/update-customer-request-dto.ts
|
|
69
78
|
models/update-customer-response-class.ts
|
|
70
79
|
models/upload-customer-claim-documents-request-dto.ts
|
package/README.md
CHANGED
|
@@ -17,11 +17,11 @@ Although this package can be used in both TypeScript and JavaScript, it is inten
|
|
|
17
17
|
Navigate to the folder of your consuming project and run one of the following commands:
|
|
18
18
|
|
|
19
19
|
```
|
|
20
|
-
npm install @emilgroup/customer-sdk-node@1.
|
|
20
|
+
npm install @emilgroup/customer-sdk-node@1.11.0 --save
|
|
21
21
|
```
|
|
22
22
|
or
|
|
23
23
|
```
|
|
24
|
-
yarn add @emilgroup/customer-sdk-node@1.
|
|
24
|
+
yarn add @emilgroup/customer-sdk-node@1.11.0
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
And then you can import `CustomersApi`.
|
|
@@ -66,3 +66,59 @@ async function listCustomers(): Promise<Void> {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
```
|
|
69
|
+
|
|
70
|
+
</br>
|
|
71
|
+
|
|
72
|
+
# Migration notes
|
|
73
|
+
Migration 1.10.x > 1.11.x
|
|
74
|
+
* Some components of CustomersApi have been extracted to:
|
|
75
|
+
- AuthenticationApi includes : initiate, respond, refresh-token, and rest/verify/forget password of a customer functionality
|
|
76
|
+
- InvitesApi includes: invite by customer/tenant, verify and register a customer functionality.
|
|
77
|
+
- InvoicesApi includes: list invoices functionality.
|
|
78
|
+
- DocumentsApi includes: list documents, upload documents and Get a presigned download url for document.
|
|
79
|
+
- PaymentsApi includes: initiate/complete payment setup
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
import { InvoicesApi } from '@emilgroup/customer-sdk'
|
|
85
|
+
|
|
86
|
+
// First, call initiateAuthorization to get challenge information
|
|
87
|
+
try {
|
|
88
|
+
const response = await apiAuthCustomer.initiateAuthorization("username", "password", "tenantSlug");
|
|
89
|
+
} catch(error) {
|
|
90
|
+
// process error
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// after receiving the SMS, call the respondToAuthorizationChallenge method
|
|
94
|
+
try {
|
|
95
|
+
const response = await apiAuthCustomer.respondToAuthorizationChallenge({
|
|
96
|
+
challengeResponses: {
|
|
97
|
+
"USERNAME": username,
|
|
98
|
+
"SMS_MFA_CODE": smsCode,
|
|
99
|
+
},
|
|
100
|
+
challengeName,
|
|
101
|
+
tenantSlug,
|
|
102
|
+
session,
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
// Customer is now logged in with customersApi and refresh-token will automatically be called.
|
|
106
|
+
} catch(error) {
|
|
107
|
+
// process error
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### List invoices
|
|
112
|
+
```ts
|
|
113
|
+
//After login
|
|
114
|
+
|
|
115
|
+
const invoiceApi = new InvoicesApi();
|
|
116
|
+
try {
|
|
117
|
+
const listInvoices = await invoiceApi.listInvoices({customerCode: "me"});
|
|
118
|
+
if ( isMounted ) {
|
|
119
|
+
const { data: { items } } = listInvoices;
|
|
120
|
+
}
|
|
121
|
+
} catch ( error ) {
|
|
122
|
+
// process error
|
|
123
|
+
}
|
|
124
|
+
```
|