@beep-it/sdk-core 0.1.6 → 0.1.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/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -5
- package/dist/index.mjs +42 -5
- package/dist/modules/widget.d.ts +9 -4
- package/dist/modules/widget.d.ts.map +1 -1
- package/dist/types/cash-payment.d.ts +13 -0
- package/dist/types/cash-payment.d.ts.map +1 -0
- package/dist/types/public.d.ts +95 -1
- package/dist/types/public.d.ts.map +1 -1
- package/package.json +11 -13
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,mFAAmF;IACnF,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAgB;IAE9B,oEAAoE;IACpE,SAAgB,QAAQ,EAAE,cAAc,CAAC;IAEzC,oEAAoE;IACpE,SAAgB,QAAQ,EAAE,cAAc,CAAC;IAEzC;;;;;OAKG;IACH,SAAgB,QAAQ,EAAE,cAAc,CAAC;IACzC,wCAAwC;IACxC,SAAgB,IAAI,EAAE,UAAU,CAAC;IAEjC;;;;;OAKG;gBACS,OAAO,EAAE,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YAAY,CAAC;IAErC;;;;;OAKG;gBACS,OAAO,EAAE,uBAAuB;CAgB7C;AAED,YAAY,EACV,2BAA2B,EAC3B,4BAA4B,EAC5B,2BAA2B,EAC3B,aAAa,GACd,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -697,16 +697,14 @@ var ProductsModule = class {
|
|
|
697
697
|
|
|
698
698
|
// src/modules/widget.ts
|
|
699
699
|
var WidgetModule = class {
|
|
700
|
-
constructor(client
|
|
700
|
+
constructor(client) {
|
|
701
701
|
this.client = client;
|
|
702
|
-
this.publishableKey = publishableKey;
|
|
703
702
|
}
|
|
704
703
|
/**
|
|
705
704
|
* Creates a payment session (public, CORS-open) for Checkout Widget
|
|
706
705
|
*/
|
|
707
706
|
async createPaymentSession(input) {
|
|
708
707
|
const body = {
|
|
709
|
-
publishableKey: this.publishableKey,
|
|
710
708
|
assets: input.assets,
|
|
711
709
|
paymentLabel: input.paymentLabel,
|
|
712
710
|
generateQrCode: input.generateQrCode ?? true
|
|
@@ -717,6 +715,36 @@ var WidgetModule = class {
|
|
|
717
715
|
);
|
|
718
716
|
return res.data;
|
|
719
717
|
}
|
|
718
|
+
async generateOTP(input) {
|
|
719
|
+
const res = await this.client.post("/v1/widget/generate-otp", {
|
|
720
|
+
...input
|
|
721
|
+
});
|
|
722
|
+
return res.data;
|
|
723
|
+
}
|
|
724
|
+
async verifyOTP(input) {
|
|
725
|
+
const res = await this.client.post("/v1/widget/verify-otp", {
|
|
726
|
+
...input
|
|
727
|
+
});
|
|
728
|
+
return res.data;
|
|
729
|
+
}
|
|
730
|
+
async generatePaymentQuote(input) {
|
|
731
|
+
const res = await this.client.post(
|
|
732
|
+
"/v1/widget/generate-payment-quote",
|
|
733
|
+
{
|
|
734
|
+
...input
|
|
735
|
+
}
|
|
736
|
+
);
|
|
737
|
+
return res.data;
|
|
738
|
+
}
|
|
739
|
+
async createCashPaymentOrder(input) {
|
|
740
|
+
const res = await this.client.post(
|
|
741
|
+
"/v1/widget/create-cash-payment-order",
|
|
742
|
+
{
|
|
743
|
+
...input
|
|
744
|
+
}
|
|
745
|
+
);
|
|
746
|
+
return res.data;
|
|
747
|
+
}
|
|
720
748
|
/**
|
|
721
749
|
* Retrieves payment status for a reference key
|
|
722
750
|
*/
|
|
@@ -759,6 +787,14 @@ var WidgetModule = class {
|
|
|
759
787
|
await new Promise((r) => setTimeout(r, currentIntervalMs));
|
|
760
788
|
}
|
|
761
789
|
}
|
|
790
|
+
async getDynamicEnv() {
|
|
791
|
+
const res = await this.client.get("/v1/widget/environment");
|
|
792
|
+
return res.data;
|
|
793
|
+
}
|
|
794
|
+
async getProducts() {
|
|
795
|
+
const res = await this.client.get("/v1/widget/products");
|
|
796
|
+
return res.data;
|
|
797
|
+
}
|
|
762
798
|
};
|
|
763
799
|
|
|
764
800
|
// src/modules/user.ts
|
|
@@ -854,10 +890,11 @@ var BeepPublicClient = class {
|
|
|
854
890
|
baseURL: options.serverUrl || "https://api.justbeep.it",
|
|
855
891
|
headers: {
|
|
856
892
|
"Content-Type": "application/json",
|
|
857
|
-
"X-Beep-Client": "beep-sdk"
|
|
893
|
+
"X-Beep-Client": "beep-sdk",
|
|
894
|
+
Authorization: `Bearer ${options.publishableKey}`
|
|
858
895
|
}
|
|
859
896
|
});
|
|
860
|
-
this.widget = new WidgetModule(this.client
|
|
897
|
+
this.widget = new WidgetModule(this.client);
|
|
861
898
|
}
|
|
862
899
|
};
|
|
863
900
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.mjs
CHANGED
|
@@ -660,16 +660,14 @@ var ProductsModule = class {
|
|
|
660
660
|
|
|
661
661
|
// src/modules/widget.ts
|
|
662
662
|
var WidgetModule = class {
|
|
663
|
-
constructor(client
|
|
663
|
+
constructor(client) {
|
|
664
664
|
this.client = client;
|
|
665
|
-
this.publishableKey = publishableKey;
|
|
666
665
|
}
|
|
667
666
|
/**
|
|
668
667
|
* Creates a payment session (public, CORS-open) for Checkout Widget
|
|
669
668
|
*/
|
|
670
669
|
async createPaymentSession(input) {
|
|
671
670
|
const body = {
|
|
672
|
-
publishableKey: this.publishableKey,
|
|
673
671
|
assets: input.assets,
|
|
674
672
|
paymentLabel: input.paymentLabel,
|
|
675
673
|
generateQrCode: input.generateQrCode ?? true
|
|
@@ -680,6 +678,36 @@ var WidgetModule = class {
|
|
|
680
678
|
);
|
|
681
679
|
return res.data;
|
|
682
680
|
}
|
|
681
|
+
async generateOTP(input) {
|
|
682
|
+
const res = await this.client.post("/v1/widget/generate-otp", {
|
|
683
|
+
...input
|
|
684
|
+
});
|
|
685
|
+
return res.data;
|
|
686
|
+
}
|
|
687
|
+
async verifyOTP(input) {
|
|
688
|
+
const res = await this.client.post("/v1/widget/verify-otp", {
|
|
689
|
+
...input
|
|
690
|
+
});
|
|
691
|
+
return res.data;
|
|
692
|
+
}
|
|
693
|
+
async generatePaymentQuote(input) {
|
|
694
|
+
const res = await this.client.post(
|
|
695
|
+
"/v1/widget/generate-payment-quote",
|
|
696
|
+
{
|
|
697
|
+
...input
|
|
698
|
+
}
|
|
699
|
+
);
|
|
700
|
+
return res.data;
|
|
701
|
+
}
|
|
702
|
+
async createCashPaymentOrder(input) {
|
|
703
|
+
const res = await this.client.post(
|
|
704
|
+
"/v1/widget/create-cash-payment-order",
|
|
705
|
+
{
|
|
706
|
+
...input
|
|
707
|
+
}
|
|
708
|
+
);
|
|
709
|
+
return res.data;
|
|
710
|
+
}
|
|
683
711
|
/**
|
|
684
712
|
* Retrieves payment status for a reference key
|
|
685
713
|
*/
|
|
@@ -722,6 +750,14 @@ var WidgetModule = class {
|
|
|
722
750
|
await new Promise((r) => setTimeout(r, currentIntervalMs));
|
|
723
751
|
}
|
|
724
752
|
}
|
|
753
|
+
async getDynamicEnv() {
|
|
754
|
+
const res = await this.client.get("/v1/widget/environment");
|
|
755
|
+
return res.data;
|
|
756
|
+
}
|
|
757
|
+
async getProducts() {
|
|
758
|
+
const res = await this.client.get("/v1/widget/products");
|
|
759
|
+
return res.data;
|
|
760
|
+
}
|
|
725
761
|
};
|
|
726
762
|
|
|
727
763
|
// src/modules/user.ts
|
|
@@ -817,10 +853,11 @@ var BeepPublicClient = class {
|
|
|
817
853
|
baseURL: options.serverUrl || "https://api.justbeep.it",
|
|
818
854
|
headers: {
|
|
819
855
|
"Content-Type": "application/json",
|
|
820
|
-
"X-Beep-Client": "beep-sdk"
|
|
856
|
+
"X-Beep-Client": "beep-sdk",
|
|
857
|
+
Authorization: `Bearer ${options.publishableKey}`
|
|
821
858
|
}
|
|
822
859
|
});
|
|
823
|
-
this.widget = new WidgetModule(this.client
|
|
860
|
+
this.widget = new WidgetModule(this.client);
|
|
824
861
|
}
|
|
825
862
|
};
|
|
826
863
|
export {
|
package/dist/modules/widget.d.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
import { PublicPaymentSessionRequest, PublicPaymentSessionResponse, PublicPaymentStatusResponse } from '../types/public';
|
|
2
|
+
import { GenerateOTPRequest, GenerateOTPResponse, DynamicEnvResponse, CreateCashPaymentOrderRequest, CreateCashPaymentOrderResponse, PublicPaymentSessionRequest, PublicPaymentSessionResponse, PublicPaymentStatusResponse, VerifyOTPRequest, VerifyOTPResponse, GeneratePaymentQuoteRequest, GeneratePaymentQuoteResponse, GetProductsResponse } from '../types/public';
|
|
3
3
|
export declare class WidgetModule {
|
|
4
4
|
private client;
|
|
5
|
-
|
|
6
|
-
constructor(client: AxiosInstance, publishableKey: string);
|
|
5
|
+
constructor(client: AxiosInstance);
|
|
7
6
|
/**
|
|
8
7
|
* Creates a payment session (public, CORS-open) for Checkout Widget
|
|
9
8
|
*/
|
|
10
|
-
createPaymentSession(input:
|
|
9
|
+
createPaymentSession(input: PublicPaymentSessionRequest): Promise<PublicPaymentSessionResponse>;
|
|
10
|
+
generateOTP(input: GenerateOTPRequest): Promise<GenerateOTPResponse>;
|
|
11
|
+
verifyOTP(input: VerifyOTPRequest): Promise<VerifyOTPResponse>;
|
|
12
|
+
generatePaymentQuote(input: GeneratePaymentQuoteRequest): Promise<GeneratePaymentQuoteResponse>;
|
|
13
|
+
createCashPaymentOrder(input: CreateCashPaymentOrderRequest): Promise<CreateCashPaymentOrderResponse>;
|
|
11
14
|
/**
|
|
12
15
|
* Retrieves payment status for a reference key
|
|
13
16
|
*/
|
|
@@ -27,5 +30,7 @@ export declare class WidgetModule {
|
|
|
27
30
|
paid: boolean;
|
|
28
31
|
last?: PublicPaymentStatusResponse;
|
|
29
32
|
}>;
|
|
33
|
+
getDynamicEnv(): Promise<DynamicEnvResponse>;
|
|
34
|
+
getProducts(): Promise<GetProductsResponse>;
|
|
30
35
|
}
|
|
31
36
|
//# sourceMappingURL=widget.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../../src/modules/widget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,aAAa,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,2BAA2B,EAC5B,MAAM,iBAAiB,CAAC;AAEzB,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAgB;
|
|
1
|
+
{"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../../src/modules/widget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,aAAa,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,6BAA6B,EAC7B,8BAA8B,EAC9B,2BAA2B,EAC3B,4BAA4B,EAC5B,2BAA2B,EAC3B,gBAAgB,EAChB,iBAAiB,EACjB,2BAA2B,EAC3B,4BAA4B,EAC5B,mBAAmB,EACpB,MAAM,iBAAiB,CAAC;AAEzB,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAgB;gBAElB,MAAM,EAAE,aAAa;IAIjC;;OAEG;IACG,oBAAoB,CACxB,KAAK,EAAE,2BAA2B,GACjC,OAAO,CAAC,4BAA4B,CAAC;IAalC,WAAW,CAAC,KAAK,EAAE,kBAAkB;IAOrC,SAAS,CAAC,KAAK,EAAE,gBAAgB;IAOjC,oBAAoB,CAAC,KAAK,EAAE,2BAA2B;IAUvD,sBAAsB,CAAC,KAAK,EAAE,6BAA6B;IAUjE;;OAEG;IACG,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAOlF;;;OAGG;IACG,WAAW,CAAC,OAAO,EAAE;QACzB,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,MAAM,CAAC,EAAE,WAAW,CAAC;QACrB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,2BAA2B,KAAK,IAAI,CAAC;QACzD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;KACpC,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,2BAA2B,CAAA;KAAE,CAAC;IAmC5D,aAAa;IAKb,WAAW;CAIlB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Alchemy Pay payment method codes
|
|
3
|
+
* The payment methods below support USD.
|
|
4
|
+
* Reference: https://alchemypay.notion.site/Payment-Methods-Coverages-Other-Details-Table-fb3b4f5c68c04b9b8619c48aad31277d
|
|
5
|
+
*/
|
|
6
|
+
export declare enum PayWayCode {
|
|
7
|
+
VISA_MASTER_CARD = "10001",// Visa, MasterCard
|
|
8
|
+
APPLE_PAY = "501",
|
|
9
|
+
GOOGLE_PAY = "701",
|
|
10
|
+
NETELLER = "52004",
|
|
11
|
+
SKRILL = "52005"
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=cash-payment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cash-payment.d.ts","sourceRoot":"","sources":["../../src/types/cash-payment.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,oBAAY,UAAU;IACpB,gBAAgB,UAAU,CAAE,mBAAmB;IAC/C,SAAS,QAAQ;IACjB,UAAU,QAAQ;IAClB,QAAQ,UAAU;IAClB,MAAM,UAAU;CACjB"}
|
package/dist/types/public.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BeepPurchaseAsset } from './payment';
|
|
2
2
|
import { SupportedToken } from './token';
|
|
3
3
|
import { InvoiceStatus } from './invoice';
|
|
4
|
+
import { PayWayCode } from './cash-payment';
|
|
4
5
|
/**
|
|
5
6
|
* On-the-fly item sent from the browser. The server will create a corresponding product record
|
|
6
7
|
* during the payment-session so it is persisted for audit/reuse. Safe to send from clients.
|
|
@@ -14,11 +15,56 @@ export interface EphemeralItem {
|
|
|
14
15
|
}
|
|
15
16
|
export type PublicAssetInput = BeepPurchaseAsset | EphemeralItem;
|
|
16
17
|
export interface PublicPaymentSessionRequest {
|
|
17
|
-
publishableKey: string;
|
|
18
18
|
assets: PublicAssetInput[];
|
|
19
19
|
paymentLabel?: string;
|
|
20
20
|
generateQrCode?: boolean;
|
|
21
21
|
}
|
|
22
|
+
export interface GeneratePaymentQuoteRequest {
|
|
23
|
+
amount: string;
|
|
24
|
+
walletAddress: string;
|
|
25
|
+
payWayCode?: PayWayCode;
|
|
26
|
+
}
|
|
27
|
+
interface PaymentLimit {
|
|
28
|
+
/** Country code (e.g., 'US') */
|
|
29
|
+
country: string;
|
|
30
|
+
/** Payment method code */
|
|
31
|
+
payWayCode: PayWayCode;
|
|
32
|
+
/** Minimum purchase amount in fiat currency */
|
|
33
|
+
minPurchaseAmount: string;
|
|
34
|
+
/** Maximum purchase amount in fiat currency */
|
|
35
|
+
maxPurchaseAmount: string;
|
|
36
|
+
}
|
|
37
|
+
export interface GeneratePaymentQuoteResponse {
|
|
38
|
+
fiatAmount: string;
|
|
39
|
+
networkFee: string;
|
|
40
|
+
rampFee: string;
|
|
41
|
+
supportedPaymentMethods: PaymentLimit[];
|
|
42
|
+
}
|
|
43
|
+
export interface CreateCashPaymentOrderRequest {
|
|
44
|
+
reference: string;
|
|
45
|
+
walletAddress: string;
|
|
46
|
+
amount: string;
|
|
47
|
+
payWayCode: PayWayCode;
|
|
48
|
+
email: string;
|
|
49
|
+
}
|
|
50
|
+
export interface CreateCashPaymentOrderResponse {
|
|
51
|
+
payUrl: string;
|
|
52
|
+
}
|
|
53
|
+
export interface VerifyOTPRequest {
|
|
54
|
+
email: string;
|
|
55
|
+
otp: string;
|
|
56
|
+
}
|
|
57
|
+
export interface VerifyOTPResponse {
|
|
58
|
+
success: boolean;
|
|
59
|
+
}
|
|
60
|
+
export interface GenerateOTPRequest {
|
|
61
|
+
email: string;
|
|
62
|
+
tosAccepted: boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface GenerateOTPResponse {
|
|
65
|
+
verificationCode?: string;
|
|
66
|
+
newCodeGenerated: boolean;
|
|
67
|
+
}
|
|
22
68
|
export interface PublicPaymentSessionResponse {
|
|
23
69
|
referenceKey: string;
|
|
24
70
|
paymentUrl: string;
|
|
@@ -26,9 +72,57 @@ export interface PublicPaymentSessionResponse {
|
|
|
26
72
|
amount: string;
|
|
27
73
|
expiresAt: string | Date;
|
|
28
74
|
status: InvoiceStatus | string;
|
|
75
|
+
isCashPaymentEligible: boolean;
|
|
76
|
+
destinationAddress: string;
|
|
29
77
|
}
|
|
30
78
|
export interface PublicPaymentStatusResponse {
|
|
31
79
|
paid: boolean;
|
|
32
80
|
status?: InvoiceStatus | string;
|
|
33
81
|
}
|
|
82
|
+
export interface DynamicEnvResponse {
|
|
83
|
+
environmentId: string;
|
|
84
|
+
}
|
|
85
|
+
export interface ProductWithPrices {
|
|
86
|
+
/** External UUID for API references */
|
|
87
|
+
uuid: string;
|
|
88
|
+
/** UUID of the merchant who owns this product */
|
|
89
|
+
merchantId: string;
|
|
90
|
+
/** Display name for the product */
|
|
91
|
+
name: string;
|
|
92
|
+
/** Optional detailed description of the product */
|
|
93
|
+
description: string | null;
|
|
94
|
+
/** Whether product is available for purchase */
|
|
95
|
+
active: boolean;
|
|
96
|
+
/** Array of image URLs for product display */
|
|
97
|
+
images: string[];
|
|
98
|
+
/** Flexible key-value data for additional product information */
|
|
99
|
+
metadata: Record<string, any>;
|
|
100
|
+
/** Associated price information (most recent active price) */
|
|
101
|
+
prices: Array<{
|
|
102
|
+
/** External UUID for API references */
|
|
103
|
+
uuid: string;
|
|
104
|
+
/** The currency token (USDT, USDC, etc.) */
|
|
105
|
+
token: string;
|
|
106
|
+
/** Blockchain network (SOLANA, BASE, SUI) */
|
|
107
|
+
chain: string;
|
|
108
|
+
/** Base amount in smallest units. */
|
|
109
|
+
amount: string;
|
|
110
|
+
/** Type/description of billing unit */
|
|
111
|
+
unitType: string;
|
|
112
|
+
/** Unit amount for incremental billing */
|
|
113
|
+
unitAmount: string;
|
|
114
|
+
/** Size of each billing unit */
|
|
115
|
+
unitSize: number;
|
|
116
|
+
/** Whether this price is available for new purchases */
|
|
117
|
+
active: boolean;
|
|
118
|
+
}>;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Response structure for the public products endpoint.
|
|
122
|
+
*/
|
|
123
|
+
export interface GetProductsResponse {
|
|
124
|
+
/** Array of products with their associated prices */
|
|
125
|
+
products: Array<ProductWithPrices>;
|
|
126
|
+
}
|
|
127
|
+
export {};
|
|
34
128
|
//# sourceMappingURL=public.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/types/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"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EAAE,OAAO,CAAC;IAChB,8CAA8C;IAC9C,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,8DAA8D;IAC9D,MAAM,EAAE,KAAK,CAAC;QACZ,uCAAuC;QACvC,IAAI,EAAE,MAAM,CAAC;QACb,4CAA4C;QAC5C,KAAK,EAAE,MAAM,CAAC;QACd,6CAA6C;QAC7C,KAAK,EAAE,MAAM,CAAC;QACd,qCAAqC;QACrC,MAAM,EAAE,MAAM,CAAC;QACf,uCAAuC;QACvC,QAAQ,EAAE,MAAM,CAAC;QACjB,0CAA0C;QAC1C,UAAU,EAAE,MAAM,CAAC;QACnB,gCAAgC;QAChC,QAAQ,EAAE,MAAM,CAAC;QACjB,wDAAwD;QACxD,MAAM,EAAE,OAAO,CAAC;KACjB,CAAC,CAAC;CACJ;AACD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,qDAAqD;IACrD,QAAQ,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;CACpC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beep-it/sdk-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Official TypeScript SDK for the BEEP Payment and Invoice Server",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -11,17 +11,6 @@
|
|
|
11
11
|
"engines": {
|
|
12
12
|
"node": ">=20"
|
|
13
13
|
},
|
|
14
|
-
"scripts": {
|
|
15
|
-
"build": "tsc --project tsconfig.build.json --emitDeclarationOnly && tsup src/index.ts --format cjs,esm --no-dts",
|
|
16
|
-
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
|
|
17
|
-
"lint": "eslint . --ext .ts",
|
|
18
|
-
"test": "jest",
|
|
19
|
-
"test:watch": "jest --watch",
|
|
20
|
-
"test:coverage": "jest --coverage",
|
|
21
|
-
"prepare": "husky",
|
|
22
|
-
"prepublishOnly": "npm run lint && npm test && npm run build",
|
|
23
|
-
"pack": "npm pack --pack-destination ../cli/templates"
|
|
24
|
-
},
|
|
25
14
|
"lint-staged": {
|
|
26
15
|
"*.{js,ts}": [
|
|
27
16
|
"eslint --fix"
|
|
@@ -65,5 +54,14 @@
|
|
|
65
54
|
},
|
|
66
55
|
"dependencies": {
|
|
67
56
|
"axios": "^1.7.2"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"build": "tsc --project tsconfig.build.json --emitDeclarationOnly && tsup src/index.ts --format cjs,esm --no-dts",
|
|
60
|
+
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
|
|
61
|
+
"lint": "eslint . --ext .ts",
|
|
62
|
+
"test": "jest",
|
|
63
|
+
"test:watch": "jest --watch",
|
|
64
|
+
"test:coverage": "jest --coverage",
|
|
65
|
+
"pack": "npm pack --pack-destination ../cli/templates"
|
|
68
66
|
}
|
|
69
|
-
}
|
|
67
|
+
}
|