@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 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
- * POST - https://api.abacatepay.com/v1/customer/create
6
- */
7
- createCustomer(): "/customer/create";
8
- /**
9
- * GET - https://api.abacatepay.com/v1/customer/list
10
- */
11
- listCustomers(): "/customer/list";
12
- /**
13
- * POST - https://api.abacatepay.com/v1/billing/create
14
- */
15
- createCharge(): "/billing/create";
16
- /**
17
- * GET - https://api.abacatepay.com/v1/billing/list
18
- */
19
- listCharges(): "/billing/list";
20
- /**
21
- * POST - https://api.abacatepay.com/v1/pixQrCode/create
22
- */
23
- createPIXQRCode(): "/pixQrCode/create";
24
- /**
25
- * POST - https://api.abacatepay.com/v1/pixQrCode/simulate-payment
26
- */
27
- simulatePayment({ id }: RESTPostSimulatePaymentQueryParams): `/pixQrCode/simulate-payment?id=${string}`;
28
- /**
29
- * GET - https://api.abacatepay.com/v1/pixQrCode/check
30
- */
31
- checkQRCodePIXStatus({ id }: RESTGetCheckQRCodePixStatusQueryParams): `/pixQrCode/check?id=${string}`;
32
- /**
33
- * POST - https://api.abacatepay.com/v1/coupon/create
34
- */
35
- createCoupon(): "/coupon/create";
36
- /**
37
- * GET - https://api.abacatepay.com/v1/coupon/list
38
- */
39
- listCoupons(): "/coupon/list";
40
- /**
41
- * POST - https://api.abacatepay.com/v1/withdraw/create
42
- */
43
- createWithdraw(): "/withdraw/create";
44
- /**
45
- * GET - https://api.abacatepay.com/v1/withdraw/get
46
- */
47
- getWithdraw({ externalId }: RESTGetSearchWithdrawQueryParams): `/withdraw/get?externalId=${string}`;
48
- /**
49
- * GET - https://api.abacatepay.com/v1/withdraw/list
50
- */
51
- listWithdraw(): "/withdraw/list";
52
- /**
53
- * GET - https://api.abacatepay.com/v1/store/get
54
- */
55
- store(): "/store/get";
56
- /**
57
- * GET - https://api.abacatepay.com/v1/public-mrr/mrr
58
- */
59
- getMRR(): "/public-mrr/mrr";
60
- /**
61
- * GET - https://api.abacatepay.com/v1/public-mrr/merchant-info
62
- */
63
- merchant(): "/public-mrr/merchant-info";
64
- /**
65
- * GET - https://api.abacatepay.com/v1/public-mrr/renevue
66
- */
67
- renevue(): "/public-mrr/revenue";
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
- * POST - https://api.abacatepay.com/v1/customer/create
5
- */
6
- createCustomer() {
7
- return '/customer/create';
8
- },
9
- /**
10
- * GET - https://api.abacatepay.com/v1/customer/list
11
- */
12
- listCustomers() {
13
- return '/customer/list';
14
- },
15
- /**
16
- * POST - https://api.abacatepay.com/v1/billing/create
17
- */
18
- createCharge() {
19
- return '/billing/create';
20
- },
21
- /**
22
- * GET - https://api.abacatepay.com/v1/billing/list
23
- */
24
- listCharges() {
25
- return '/billing/list';
26
- },
27
- /**
28
- * POST - https://api.abacatepay.com/v1/pixQrCode/create
29
- */
30
- createPIXQRCode() {
31
- return '/pixQrCode/create';
32
- },
33
- /**
34
- * POST - https://api.abacatepay.com/v1/pixQrCode/simulate-payment
35
- */
36
- simulatePayment({ id }) {
37
- return `/pixQrCode/simulate-payment?id=${id}`;
38
- },
39
- /**
40
- * GET - https://api.abacatepay.com/v1/pixQrCode/check
41
- */
42
- checkQRCodePIXStatus({ id }) {
43
- return `/pixQrCode/check?id=${id}`;
44
- },
45
- /**
46
- * POST - https://api.abacatepay.com/v1/coupon/create
47
- */
48
- createCoupon() {
49
- return '/coupon/create';
50
- },
51
- /**
52
- * GET - https://api.abacatepay.com/v1/coupon/list
53
- */
54
- listCoupons() {
55
- return '/coupon/list';
56
- },
57
- /**
58
- * POST - https://api.abacatepay.com/v1/withdraw/create
59
- */
60
- createWithdraw() {
61
- return '/withdraw/create';
62
- },
63
- /**
64
- * GET - https://api.abacatepay.com/v1/withdraw/get
65
- */
66
- getWithdraw({ externalId }) {
67
- return `/withdraw/get?externalId=${externalId}`;
68
- },
69
- /**
70
- * GET - https://api.abacatepay.com/v1/withdraw/list
71
- */
72
- listWithdraw() {
73
- return '/withdraw/list';
74
- },
75
- /**
76
- * GET - https://api.abacatepay.com/v1/store/get
77
- */
78
- store() {
79
- return '/store/get';
80
- },
81
- /**
82
- * GET - https://api.abacatepay.com/v1/public-mrr/mrr
83
- */
84
- getMRR() {
85
- return '/public-mrr/mrr';
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;
@@ -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.3";
1
+ export declare const version: "0.0.4";
2
2
  export declare const API_VERSION: "1";
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  // Auto-generated in build (DO NOT edit)
2
- export const version = '0.0.3';
2
+ export const version = '0.0.4';
3
3
  // Current AbacatePay API version - https://docs.abacatepay.com/pages/introduction
4
4
  export const API_VERSION = '1';
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.3",
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 . && clear"
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
  }