@ariary/ariary 1.0.4
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 +120 -0
- package/dist/client-DwMAE1vB.d.mts +38 -0
- package/dist/client-DwMAE1vB.d.ts +38 -0
- package/dist/index.d.mts +23 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +267 -0
- package/dist/index.mjs +225 -0
- package/dist/payment/index.d.mts +54 -0
- package/dist/payment/index.d.ts +54 -0
- package/dist/payment/index.js +86 -0
- package/dist/payment/index.mjs +59 -0
- package/dist/sms/index.d.mts +61 -0
- package/dist/sms/index.d.ts +61 -0
- package/dist/sms/index.js +57 -0
- package/dist/sms/index.mjs +30 -0
- package/dist/transfert/index.d.mts +36 -0
- package/dist/transfert/index.d.ts +36 -0
- package/dist/transfert/index.js +51 -0
- package/dist/transfert/index.mjs +24 -0
- package/package.json +73 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { a as ApiClient } from '../client-DwMAE1vB.mjs';
|
|
2
|
+
|
|
3
|
+
interface SendTransactionDto {
|
|
4
|
+
phone: string;
|
|
5
|
+
amount: number;
|
|
6
|
+
}
|
|
7
|
+
interface SendTransactionResponse {
|
|
8
|
+
id: string;
|
|
9
|
+
phone: string;
|
|
10
|
+
amount: number;
|
|
11
|
+
status: string;
|
|
12
|
+
message: string;
|
|
13
|
+
requestId: string;
|
|
14
|
+
projectId: string;
|
|
15
|
+
secretId: string;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
}
|
|
18
|
+
interface TransactionResponseDto {
|
|
19
|
+
id: string;
|
|
20
|
+
phone: string;
|
|
21
|
+
amount: number;
|
|
22
|
+
rest?: number;
|
|
23
|
+
status: string;
|
|
24
|
+
ticketCode: string;
|
|
25
|
+
createdAt: string;
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare class TransferService {
|
|
30
|
+
private client;
|
|
31
|
+
constructor(client: ApiClient);
|
|
32
|
+
send(phone: string, amount: number): Promise<SendTransactionResponse>;
|
|
33
|
+
getAll(): Promise<SendTransactionResponse[]>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { type SendTransactionDto, type SendTransactionResponse, type TransactionResponseDto, TransferService };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { a as ApiClient } from '../client-DwMAE1vB.js';
|
|
2
|
+
|
|
3
|
+
interface SendTransactionDto {
|
|
4
|
+
phone: string;
|
|
5
|
+
amount: number;
|
|
6
|
+
}
|
|
7
|
+
interface SendTransactionResponse {
|
|
8
|
+
id: string;
|
|
9
|
+
phone: string;
|
|
10
|
+
amount: number;
|
|
11
|
+
status: string;
|
|
12
|
+
message: string;
|
|
13
|
+
requestId: string;
|
|
14
|
+
projectId: string;
|
|
15
|
+
secretId: string;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
}
|
|
18
|
+
interface TransactionResponseDto {
|
|
19
|
+
id: string;
|
|
20
|
+
phone: string;
|
|
21
|
+
amount: number;
|
|
22
|
+
rest?: number;
|
|
23
|
+
status: string;
|
|
24
|
+
ticketCode: string;
|
|
25
|
+
createdAt: string;
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare class TransferService {
|
|
30
|
+
private client;
|
|
31
|
+
constructor(client: ApiClient);
|
|
32
|
+
send(phone: string, amount: number): Promise<SendTransactionResponse>;
|
|
33
|
+
getAll(): Promise<SendTransactionResponse[]>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { type SendTransactionDto, type SendTransactionResponse, type TransactionResponseDto, TransferService };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/transfert/index.ts
|
|
21
|
+
var transfert_exports = {};
|
|
22
|
+
__export(transfert_exports, {
|
|
23
|
+
TransferService: () => TransferService
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(transfert_exports);
|
|
26
|
+
|
|
27
|
+
// src/transfert.ts
|
|
28
|
+
var TransferService = class {
|
|
29
|
+
constructor(client) {
|
|
30
|
+
this.client = client;
|
|
31
|
+
}
|
|
32
|
+
async send(phone, amount) {
|
|
33
|
+
const response = await this.client.post(
|
|
34
|
+
"/api/send-transaction",
|
|
35
|
+
{ phone, amount },
|
|
36
|
+
true
|
|
37
|
+
);
|
|
38
|
+
return response;
|
|
39
|
+
}
|
|
40
|
+
async getAll() {
|
|
41
|
+
const response = await this.client.get(
|
|
42
|
+
"/api/send-transaction",
|
|
43
|
+
true
|
|
44
|
+
);
|
|
45
|
+
return response;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
49
|
+
0 && (module.exports = {
|
|
50
|
+
TransferService
|
|
51
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// src/transfert.ts
|
|
2
|
+
var TransferService = class {
|
|
3
|
+
constructor(client) {
|
|
4
|
+
this.client = client;
|
|
5
|
+
}
|
|
6
|
+
async send(phone, amount) {
|
|
7
|
+
const response = await this.client.post(
|
|
8
|
+
"/api/send-transaction",
|
|
9
|
+
{ phone, amount },
|
|
10
|
+
true
|
|
11
|
+
);
|
|
12
|
+
return response;
|
|
13
|
+
}
|
|
14
|
+
async getAll() {
|
|
15
|
+
const response = await this.client.get(
|
|
16
|
+
"/api/send-transaction",
|
|
17
|
+
true
|
|
18
|
+
);
|
|
19
|
+
return response;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
TransferService
|
|
24
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ariary/ariary",
|
|
3
|
+
"version": "1.0.4",
|
|
4
|
+
"description": "SDK officiel pour l'API de paiement Ariary",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
|
+
"require": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./payment": {
|
|
15
|
+
"types": "./dist/payment/index.d.ts",
|
|
16
|
+
"import": "./dist/payment/index.mjs",
|
|
17
|
+
"require": "./dist/payment/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./sms": {
|
|
20
|
+
"types": "./dist/sms/index.d.ts",
|
|
21
|
+
"import": "./dist/sms/index.mjs",
|
|
22
|
+
"require": "./dist/sms/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./transfert": {
|
|
25
|
+
"types": "./dist/transfert/index.d.ts",
|
|
26
|
+
"import": "./dist/transfert/index.mjs",
|
|
27
|
+
"require": "./dist/transfert/index.js"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
33
|
+
"tsup": [
|
|
34
|
+
{
|
|
35
|
+
"entry": {
|
|
36
|
+
"index": "src/index.ts",
|
|
37
|
+
"payment/index": "src/payment/index.ts",
|
|
38
|
+
"sms/index": "src/sms/index.ts",
|
|
39
|
+
"transfert/index": "src/transfert/index.ts"
|
|
40
|
+
},
|
|
41
|
+
"format": [
|
|
42
|
+
"cjs",
|
|
43
|
+
"esm"
|
|
44
|
+
],
|
|
45
|
+
"outDir": "dist",
|
|
46
|
+
"dts": true,
|
|
47
|
+
"splitting": false,
|
|
48
|
+
"sourcemap": false,
|
|
49
|
+
"clean": true,
|
|
50
|
+
"minify": false
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"scripts": {
|
|
54
|
+
"build": "tsup",
|
|
55
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
56
|
+
},
|
|
57
|
+
"keywords": [
|
|
58
|
+
"ariary",
|
|
59
|
+
"payment",
|
|
60
|
+
"sms",
|
|
61
|
+
"transfer",
|
|
62
|
+
"api"
|
|
63
|
+
],
|
|
64
|
+
"author": "Ariary",
|
|
65
|
+
"license": "ISC",
|
|
66
|
+
"dependencies": {
|
|
67
|
+
"axios": "^1.13.2"
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"tsup": "^8.5.1",
|
|
71
|
+
"typescript": "^5.9.3"
|
|
72
|
+
}
|
|
73
|
+
}
|