@ariary/ariary 2.0.5 → 2.0.7
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/README.md +15 -15
- package/dist/index.d.mts +1 -4
- package/dist/index.d.ts +1 -4
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,26 +23,26 @@ Ariari.config({
|
|
|
23
23
|
|
|
24
24
|
```typescript
|
|
25
25
|
// Pay
|
|
26
|
-
await Ariari.payment.create({ code: 'PAY-123', amount: 5000 });
|
|
27
|
-
await Ariari.payment.getAll();
|
|
28
|
-
await Ariari.payment.getById(paymentId);
|
|
29
|
-
await Ariari.payment.updateRest(paymentId, 'TICKET123');
|
|
30
|
-
await Ariari.payment.transfert({ phone: '261345678901', amount: 5000 });
|
|
31
|
-
await Ariari.payment.getAllTransfert();
|
|
26
|
+
const payment = await Ariari.payment.create({ code: 'PAY-123', amount: 5000, projectId: 'your_project_id' });
|
|
27
|
+
const payments = await Ariari.payment.getAll();
|
|
28
|
+
const paymentById = await Ariari.payment.getById(paymentId);
|
|
29
|
+
const updated = await Ariari.payment.updateRest(paymentId, 'TICKET123');
|
|
30
|
+
const transfer = await Ariari.payment.transfert({ phone: '261345678901', amount: 5000 });
|
|
31
|
+
const transfers = await Ariari.payment.getAllTransfert();
|
|
32
32
|
|
|
33
33
|
// Notifications
|
|
34
|
-
await Ariari.notification.send({ phone: '261345678901', message: 'Hello' });
|
|
35
|
-
await Ariari.notification.sendBulk([
|
|
34
|
+
const sms = await Ariari.notification.send({ phone: '261345678901', message: 'Hello' });
|
|
35
|
+
const bulkSms = await Ariari.notification.sendBulk([
|
|
36
36
|
{ phone: '261345678901', message: 'Message 1' },
|
|
37
37
|
{ phone: '261345678902', message: 'Message 2' }
|
|
38
38
|
]);
|
|
39
|
-
await Ariari.notification.getAll();
|
|
40
|
-
await Ariari.notification.task.findAll('projectId');
|
|
41
|
-
await Ariari.notification.task.findOne(taskId);
|
|
42
|
-
await Ariari.notification.task.update(taskId, { message: 'New' });
|
|
43
|
-
await Ariari.notification.task.delete(taskId);
|
|
44
|
-
await Ariari.notification.task.getSmsDetails(taskId);
|
|
45
|
-
await Ariari.notification.task.retryFailedSms(taskId);
|
|
39
|
+
const allSms = await Ariari.notification.getAll();
|
|
40
|
+
const tasks = await Ariari.notification.task.findAll('projectId');
|
|
41
|
+
const task = await Ariari.notification.task.findOne(taskId);
|
|
42
|
+
const updatedTask = await Ariari.notification.task.update(taskId, { message: 'New' });
|
|
43
|
+
const deleted = await Ariari.notification.task.delete(taskId);
|
|
44
|
+
const smsDetails = await Ariari.notification.task.getSmsDetails(taskId);
|
|
45
|
+
const retried = await Ariari.notification.task.retryFailedSms(taskId);
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
## Imports
|
package/dist/index.d.mts
CHANGED
|
@@ -160,10 +160,7 @@ interface TransactionResponseDto {
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
interface PaymentService {
|
|
163
|
-
create(data:
|
|
164
|
-
code: string;
|
|
165
|
-
amount: number;
|
|
166
|
-
}): Promise<PaymentResponseDto>;
|
|
163
|
+
create(data: CreatePaymentDto): Promise<PaymentResponseDto>;
|
|
167
164
|
getAll(): Promise<PaymentResponseDto[]>;
|
|
168
165
|
getById(id: string): Promise<PaymentResponseDto>;
|
|
169
166
|
updateRest(paymentId: string, ticketCode: string): Promise<PaymentResponseDto>;
|
package/dist/index.d.ts
CHANGED
|
@@ -160,10 +160,7 @@ interface TransactionResponseDto {
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
interface PaymentService {
|
|
163
|
-
create(data:
|
|
164
|
-
code: string;
|
|
165
|
-
amount: number;
|
|
166
|
-
}): Promise<PaymentResponseDto>;
|
|
163
|
+
create(data: CreatePaymentDto): Promise<PaymentResponseDto>;
|
|
167
164
|
getAll(): Promise<PaymentResponseDto[]>;
|
|
168
165
|
getById(id: string): Promise<PaymentResponseDto>;
|
|
169
166
|
updateRest(paymentId: string, ticketCode: string): Promise<PaymentResponseDto>;
|
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
27
27
|
// src/http.ts
|
|
28
28
|
async function request(method, endpoint, body) {
|
|
29
29
|
const config2 = getConfig();
|
|
30
|
-
const baseUrl = config2.baseUrl || "https://back.ariari.mg
|
|
30
|
+
const baseUrl = config2.baseUrl || "https://back.ariari.mg";
|
|
31
31
|
const url = `${baseUrl}${endpoint}`;
|
|
32
32
|
const response = await fetch(url, {
|
|
33
33
|
method,
|
|
@@ -161,7 +161,7 @@ var Ariari = {
|
|
|
161
161
|
config = {
|
|
162
162
|
secretId: cfg.secretId,
|
|
163
163
|
projectId: cfg.projectId,
|
|
164
|
-
baseUrl: cfg.baseUrl || "https://back.ariari.mg
|
|
164
|
+
baseUrl: cfg.baseUrl || "https://back.ariari.mg"
|
|
165
165
|
};
|
|
166
166
|
},
|
|
167
167
|
payment: paymentService,
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/http.ts
|
|
2
2
|
async function request(method, endpoint, body) {
|
|
3
3
|
const config2 = getConfig();
|
|
4
|
-
const baseUrl = config2.baseUrl || "https://back.ariari.mg
|
|
4
|
+
const baseUrl = config2.baseUrl || "https://back.ariari.mg";
|
|
5
5
|
const url = `${baseUrl}${endpoint}`;
|
|
6
6
|
const response = await fetch(url, {
|
|
7
7
|
method,
|
|
@@ -135,7 +135,7 @@ var Ariari = {
|
|
|
135
135
|
config = {
|
|
136
136
|
secretId: cfg.secretId,
|
|
137
137
|
projectId: cfg.projectId,
|
|
138
|
-
baseUrl: cfg.baseUrl || "https://back.ariari.mg
|
|
138
|
+
baseUrl: cfg.baseUrl || "https://back.ariari.mg"
|
|
139
139
|
};
|
|
140
140
|
},
|
|
141
141
|
payment: paymentService,
|