@abacatepay/types 0.0.3 → 0.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/dist/routes.d.ts +78 -64
- package/dist/routes.js +83 -95
- package/dist/v1/utils.d.ts +19 -0
- package/dist/v1/utils.js +25 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +6 -3
package/dist/routes.d.ts
CHANGED
|
@@ -1,68 +1,82 @@
|
|
|
1
1
|
import type { RESTGetCheckQRCodePixStatusQueryParams, RESTGetSearchWithdrawQueryParams, RESTPostSimulatePaymentQueryParams } from './v1/rest';
|
|
2
2
|
export declare const API_BASE_URL = "https://api.abacatepay.com/";
|
|
3
3
|
export declare const Routes: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
4
|
+
readonly customer: {
|
|
5
|
+
/**
|
|
6
|
+
* POST - https://api.abacatepay.com/v1/customer/create
|
|
7
|
+
*/
|
|
8
|
+
readonly create: "/customer/create";
|
|
9
|
+
/**
|
|
10
|
+
* GET - https://api.abacatepay.com/v1/customer/list
|
|
11
|
+
*/
|
|
12
|
+
readonly list: "/customer/list";
|
|
13
|
+
};
|
|
14
|
+
readonly billing: {
|
|
15
|
+
/**
|
|
16
|
+
* POST - https://api.abacatepay.com/v1/billing/create
|
|
17
|
+
*/
|
|
18
|
+
readonly create: "/billing/create";
|
|
19
|
+
/**
|
|
20
|
+
* GET - https://api.abacatepay.com/v1/billing/list
|
|
21
|
+
*/
|
|
22
|
+
readonly list: "/billing/list";
|
|
23
|
+
};
|
|
24
|
+
readonly pix: {
|
|
25
|
+
/**
|
|
26
|
+
* POST - https://api.abacatepay.com/v1/pixQrCode/create
|
|
27
|
+
*/
|
|
28
|
+
readonly createQRCode: "/pixQrCode/create";
|
|
29
|
+
/**
|
|
30
|
+
* POST - https://api.abacatepay.com/v1/pixQrCode/simulate-payment
|
|
31
|
+
*/
|
|
32
|
+
readonly simulatePayment: ({ id }: RESTPostSimulatePaymentQueryParams) => `/pixQrCode/simulate-payment?id=${string}`;
|
|
33
|
+
/**
|
|
34
|
+
* GET - https://api.abacatepay.com/v1/pixQrCode/check
|
|
35
|
+
*/
|
|
36
|
+
readonly checkStatus: ({ id }: RESTGetCheckQRCodePixStatusQueryParams) => `/pixQrCode/check?id=${string}`;
|
|
37
|
+
};
|
|
38
|
+
readonly coupon: {
|
|
39
|
+
/**
|
|
40
|
+
* POST - https://api.abacatepay.com/v1/coupon/create
|
|
41
|
+
*/
|
|
42
|
+
readonly create: "/coupon/create";
|
|
43
|
+
/**
|
|
44
|
+
* GET - https://api.abacatepay.com/v1/coupon/list
|
|
45
|
+
*/
|
|
46
|
+
readonly list: "/coupon/list";
|
|
47
|
+
};
|
|
48
|
+
readonly withdraw: {
|
|
49
|
+
/**
|
|
50
|
+
* POST - https://api.abacatepay.com/v1/withdraw/create
|
|
51
|
+
*/
|
|
52
|
+
readonly create: "/withdraw/create";
|
|
53
|
+
/**
|
|
54
|
+
* GET - https://api.abacatepay.com/v1/withdraw/get
|
|
55
|
+
*/
|
|
56
|
+
readonly get: ({ externalId }: RESTGetSearchWithdrawQueryParams) => `/withdraw/get?externalId=${string}`;
|
|
57
|
+
/**
|
|
58
|
+
* GET - https://api.abacatepay.com/v1/withdraw/list
|
|
59
|
+
*/
|
|
60
|
+
readonly list: "/withdraw/list";
|
|
61
|
+
};
|
|
62
|
+
readonly store: {
|
|
63
|
+
/**
|
|
64
|
+
* GET - https://api.abacatepay.com/v1/store/get
|
|
65
|
+
*/
|
|
66
|
+
readonly get: "/store/get";
|
|
67
|
+
};
|
|
68
|
+
readonly mrr: {
|
|
69
|
+
/**
|
|
70
|
+
* GET - https://api.abacatepay.com/v1/public-mrr/mrr
|
|
71
|
+
*/
|
|
72
|
+
readonly get: "/public-mrr/mrr";
|
|
73
|
+
/**
|
|
74
|
+
* GET - https://api.abacatepay.com/v1/public-mrr/merchant-info
|
|
75
|
+
*/
|
|
76
|
+
readonly merchant: "/public-mrr/merchant-info";
|
|
77
|
+
/**
|
|
78
|
+
* GET - https://api.abacatepay.com/v1/public-mrr/renevue
|
|
79
|
+
*/
|
|
80
|
+
readonly revenue: "/public-mrr/revenue";
|
|
81
|
+
};
|
|
68
82
|
};
|
package/dist/routes.js
CHANGED
|
@@ -1,99 +1,87 @@
|
|
|
1
1
|
export const API_BASE_URL = 'https://api.abacatepay.com/';
|
|
2
2
|
export const Routes = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
},
|
|
87
|
-
/**
|
|
88
|
-
* GET - https://api.abacatepay.com/v1/public-mrr/merchant-info
|
|
89
|
-
*/
|
|
90
|
-
merchant() {
|
|
91
|
-
return '/public-mrr/merchant-info';
|
|
92
|
-
},
|
|
93
|
-
/**
|
|
94
|
-
* GET - https://api.abacatepay.com/v1/public-mrr/renevue
|
|
95
|
-
*/
|
|
96
|
-
renevue() {
|
|
97
|
-
return '/public-mrr/revenue';
|
|
3
|
+
customer: {
|
|
4
|
+
/**
|
|
5
|
+
* POST - https://api.abacatepay.com/v1/customer/create
|
|
6
|
+
*/
|
|
7
|
+
create: '/customer/create',
|
|
8
|
+
/**
|
|
9
|
+
* GET - https://api.abacatepay.com/v1/customer/list
|
|
10
|
+
*/
|
|
11
|
+
list: '/customer/list',
|
|
12
|
+
},
|
|
13
|
+
billing: {
|
|
14
|
+
/**
|
|
15
|
+
* POST - https://api.abacatepay.com/v1/billing/create
|
|
16
|
+
*/
|
|
17
|
+
create: '/billing/create',
|
|
18
|
+
/**
|
|
19
|
+
* GET - https://api.abacatepay.com/v1/billing/list
|
|
20
|
+
*/
|
|
21
|
+
list: '/billing/list',
|
|
22
|
+
},
|
|
23
|
+
pix: {
|
|
24
|
+
/**
|
|
25
|
+
* POST - https://api.abacatepay.com/v1/pixQrCode/create
|
|
26
|
+
*/
|
|
27
|
+
createQRCode: '/pixQrCode/create',
|
|
28
|
+
/**
|
|
29
|
+
* POST - https://api.abacatepay.com/v1/pixQrCode/simulate-payment
|
|
30
|
+
*/
|
|
31
|
+
simulatePayment({ id }) {
|
|
32
|
+
return `/pixQrCode/simulate-payment?id=${id}`;
|
|
33
|
+
},
|
|
34
|
+
/**
|
|
35
|
+
* GET - https://api.abacatepay.com/v1/pixQrCode/check
|
|
36
|
+
*/
|
|
37
|
+
checkStatus({ id }) {
|
|
38
|
+
return `/pixQrCode/check?id=${id}`;
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
coupon: {
|
|
42
|
+
/**
|
|
43
|
+
* POST - https://api.abacatepay.com/v1/coupon/create
|
|
44
|
+
*/
|
|
45
|
+
create: '/coupon/create',
|
|
46
|
+
/**
|
|
47
|
+
* GET - https://api.abacatepay.com/v1/coupon/list
|
|
48
|
+
*/
|
|
49
|
+
list: '/coupon/list',
|
|
50
|
+
},
|
|
51
|
+
withdraw: {
|
|
52
|
+
/**
|
|
53
|
+
* POST - https://api.abacatepay.com/v1/withdraw/create
|
|
54
|
+
*/
|
|
55
|
+
create: '/withdraw/create',
|
|
56
|
+
/**
|
|
57
|
+
* GET - https://api.abacatepay.com/v1/withdraw/get
|
|
58
|
+
*/
|
|
59
|
+
get({ externalId }) {
|
|
60
|
+
return `/withdraw/get?externalId=${externalId}`;
|
|
61
|
+
},
|
|
62
|
+
/**
|
|
63
|
+
* GET - https://api.abacatepay.com/v1/withdraw/list
|
|
64
|
+
*/
|
|
65
|
+
list: '/withdraw/list',
|
|
66
|
+
},
|
|
67
|
+
store: {
|
|
68
|
+
/**
|
|
69
|
+
* GET - https://api.abacatepay.com/v1/store/get
|
|
70
|
+
*/
|
|
71
|
+
get: '/store/get',
|
|
72
|
+
},
|
|
73
|
+
mrr: {
|
|
74
|
+
/**
|
|
75
|
+
* GET - https://api.abacatepay.com/v1/public-mrr/mrr
|
|
76
|
+
*/
|
|
77
|
+
get: '/public-mrr/mrr',
|
|
78
|
+
/**
|
|
79
|
+
* GET - https://api.abacatepay.com/v1/public-mrr/merchant-info
|
|
80
|
+
*/
|
|
81
|
+
merchant: '/public-mrr/merchant-info',
|
|
82
|
+
/**
|
|
83
|
+
* GET - https://api.abacatepay.com/v1/public-mrr/renevue
|
|
84
|
+
*/
|
|
85
|
+
revenue: '/public-mrr/revenue',
|
|
98
86
|
},
|
|
99
87
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type WebhookEvent } from './webhook';
|
|
2
|
+
/**
|
|
3
|
+
* A type guard check for `withdraw.done` webhook events
|
|
4
|
+
* @param event - The webhook event to check against
|
|
5
|
+
* @returns A boolean that indicates if the webhook is a withdraw done webhook
|
|
6
|
+
*/
|
|
7
|
+
export declare function isWithdrawDoneWebhookEvent(event: WebhookEvent): event is import("./webhook").WebhookWithdrawDoneEvent;
|
|
8
|
+
/**
|
|
9
|
+
* A type guard check for `withdraw.failed` webhook events
|
|
10
|
+
* @param event - The webhook event to check against
|
|
11
|
+
* @returns A boolean that indicates if the webhook is a withdraw failed webhook
|
|
12
|
+
*/
|
|
13
|
+
export declare function isWithdrawFailedWebhookEvent(event: WebhookEvent): event is import("./webhook").WebhookWithdrawFailedEvent;
|
|
14
|
+
/**
|
|
15
|
+
* A type guard check for `billing.paid` webhook events
|
|
16
|
+
* @param event - The webhook event to check against
|
|
17
|
+
* @returns A boolean that indicates if the webhook is a billing paid webhook
|
|
18
|
+
*/
|
|
19
|
+
export declare function isBillingPaidWebhookEvent(event: WebhookEvent): event is import("./webhook").WebhookBillingPaidEvent;
|
package/dist/v1/utils.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { WebhookEventType } from './webhook';
|
|
2
|
+
/**
|
|
3
|
+
* A type guard check for `withdraw.done` webhook events
|
|
4
|
+
* @param event - The webhook event to check against
|
|
5
|
+
* @returns A boolean that indicates if the webhook is a withdraw done webhook
|
|
6
|
+
*/
|
|
7
|
+
export function isWithdrawDoneWebhookEvent(event) {
|
|
8
|
+
return event.event === WebhookEventType.WithdrawDone;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A type guard check for `withdraw.failed` webhook events
|
|
12
|
+
* @param event - The webhook event to check against
|
|
13
|
+
* @returns A boolean that indicates if the webhook is a withdraw failed webhook
|
|
14
|
+
*/
|
|
15
|
+
export function isWithdrawFailedWebhookEvent(event) {
|
|
16
|
+
return event.event === WebhookEventType.WithdrawFailed;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A type guard check for `billing.paid` webhook events
|
|
20
|
+
* @param event - The webhook event to check against
|
|
21
|
+
* @returns A boolean that indicates if the webhook is a billing paid webhook
|
|
22
|
+
*/
|
|
23
|
+
export function isBillingPaidWebhookEvent(event) {
|
|
24
|
+
return event.event === WebhookEventType.BillingPaid;
|
|
25
|
+
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version: "0.0.
|
|
1
|
+
export declare const version: "0.0.4";
|
|
2
2
|
export declare const API_VERSION: "1";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.0.
|
|
2
|
+
"version": "0.0.4",
|
|
3
3
|
"name": "@abacatepay/types",
|
|
4
4
|
"description": "Abacate Pay API typings that are always up to date.",
|
|
5
5
|
"type": "module",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"gen:version": "bun run scripts/version.ts",
|
|
30
30
|
"build": "bun run gen:version && tsc",
|
|
31
31
|
"prepublishOnly": "bun run build",
|
|
32
|
-
"fmt": "bunx biome check --write
|
|
32
|
+
"fmt": "bunx biome check --write types && clear"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@biomejs/biome": "^2.3.8",
|
|
@@ -40,5 +40,8 @@
|
|
|
40
40
|
"abacatepay",
|
|
41
41
|
"types",
|
|
42
42
|
"typescript"
|
|
43
|
-
]
|
|
43
|
+
],
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public"
|
|
46
|
+
}
|
|
44
47
|
}
|