@beep-it/sdk-core 0.1.3-beta.2 → 0.1.3
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 +0 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -12
- package/dist/index.mjs +0 -12
- package/dist/types/payment.d.ts +24 -0
- package/dist/types/payment.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/modules/user.d.ts +0 -10
- package/dist/modules/user.d.ts.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ import { InvoicesModule } from './modules/invoices';
|
|
|
6
6
|
import { PaymentsModule } from './modules/payments';
|
|
7
7
|
import { ProductsModule } from './modules/products';
|
|
8
8
|
import { WidgetModule } from './modules/widget';
|
|
9
|
-
import { UserModule } from './modules/user';
|
|
10
9
|
/**
|
|
11
10
|
* Configuration options for initializing the BeepClient
|
|
12
11
|
*/
|
|
@@ -68,8 +67,6 @@ export declare class BeepClient {
|
|
|
68
67
|
* stopStreaming) are only available with BeepClient and secret API keys.
|
|
69
68
|
*/
|
|
70
69
|
readonly payments: PaymentsModule;
|
|
71
|
-
/** Access to authenticated user info */
|
|
72
|
-
readonly user: UserModule;
|
|
73
70
|
/**
|
|
74
71
|
* Creates a new BEEP client instance
|
|
75
72
|
*
|
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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"m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CAAC;IACvB,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAgB;IAE9B;;;;;;OAMG;IACH,SAAgB,MAAM,EAAE,YAAY,CAAC;IAErC;;;;;OAKG;gBACS,OAAO,EAAE,uBAAuB;CAe7C;AAED,YAAY,EACV,2BAA2B,EAC3B,4BAA4B,EAC5B,2BAA2B,EAC3B,aAAa,GACd,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -752,17 +752,6 @@ var WidgetModule = class {
|
|
|
752
752
|
}
|
|
753
753
|
};
|
|
754
754
|
|
|
755
|
-
// src/modules/user.ts
|
|
756
|
-
var UserModule = class {
|
|
757
|
-
constructor(client) {
|
|
758
|
-
this.client = client;
|
|
759
|
-
}
|
|
760
|
-
async getCurrentUser() {
|
|
761
|
-
const { data } = await this.client.get("/v1/user");
|
|
762
|
-
return data;
|
|
763
|
-
}
|
|
764
|
-
};
|
|
765
|
-
|
|
766
755
|
// src/index.ts
|
|
767
756
|
var BeepClient = class {
|
|
768
757
|
/**
|
|
@@ -786,7 +775,6 @@ var BeepClient = class {
|
|
|
786
775
|
this.products = new ProductsModule(this.client);
|
|
787
776
|
this.invoices = new InvoicesModule(this.client);
|
|
788
777
|
this.payments = new PaymentsModule(this.client);
|
|
789
|
-
this.user = new UserModule(this.client);
|
|
790
778
|
}
|
|
791
779
|
/**
|
|
792
780
|
* Initiate a payout from your treasury wallet to an external address.
|
package/dist/index.mjs
CHANGED
|
@@ -715,17 +715,6 @@ var WidgetModule = class {
|
|
|
715
715
|
}
|
|
716
716
|
};
|
|
717
717
|
|
|
718
|
-
// src/modules/user.ts
|
|
719
|
-
var UserModule = class {
|
|
720
|
-
constructor(client) {
|
|
721
|
-
this.client = client;
|
|
722
|
-
}
|
|
723
|
-
async getCurrentUser() {
|
|
724
|
-
const { data } = await this.client.get("/v1/user");
|
|
725
|
-
return data;
|
|
726
|
-
}
|
|
727
|
-
};
|
|
728
|
-
|
|
729
718
|
// src/index.ts
|
|
730
719
|
var BeepClient = class {
|
|
731
720
|
/**
|
|
@@ -749,7 +738,6 @@ var BeepClient = class {
|
|
|
749
738
|
this.products = new ProductsModule(this.client);
|
|
750
739
|
this.invoices = new InvoicesModule(this.client);
|
|
751
740
|
this.payments = new PaymentsModule(this.client);
|
|
752
|
-
this.user = new UserModule(this.client);
|
|
753
741
|
}
|
|
754
742
|
/**
|
|
755
743
|
* Initiate a payout from your treasury wallet to an external address.
|
package/dist/types/payment.d.ts
CHANGED
|
@@ -128,6 +128,7 @@ export interface SignSolanaTransactionData {
|
|
|
128
128
|
* const beep = new BeepClient({ apiKey: 'secret_key_here' });
|
|
129
129
|
*
|
|
130
130
|
* const paymentRequest = await beep.payments.issuePayment({
|
|
131
|
+
* apiKey: 'secret_api_key',
|
|
131
132
|
* assetChunks: [
|
|
132
133
|
* { assetId: 'video-content-uuid', quantity: 1 },
|
|
133
134
|
* { assetId: 'api-access-uuid', quantity: 10 }
|
|
@@ -138,6 +139,11 @@ export interface SignSolanaTransactionData {
|
|
|
138
139
|
* ```
|
|
139
140
|
*/
|
|
140
141
|
export interface IssuePaymentPayload {
|
|
142
|
+
/**
|
|
143
|
+
* Secret API key for authentication
|
|
144
|
+
* @remarks Must be a secret key, not a publishable key
|
|
145
|
+
*/
|
|
146
|
+
apiKey: string;
|
|
141
147
|
/**
|
|
142
148
|
* Array of asset chunks to be purchased in this payment request
|
|
143
149
|
* @remarks Each asset will be charged according to its configured pricing
|
|
@@ -186,11 +192,17 @@ export interface IssuePaymentResponse {
|
|
|
186
192
|
* ```typescript
|
|
187
193
|
* // Start charging for the streaming session
|
|
188
194
|
* const result = await beep.payments.startStreaming({
|
|
195
|
+
* apiKey: 'secret_api_key',
|
|
189
196
|
* invoiceId: 'invoice_uuid_from_issuePayment'
|
|
190
197
|
* });
|
|
191
198
|
* ```
|
|
192
199
|
*/
|
|
193
200
|
export interface StartStreamingPayload {
|
|
201
|
+
/**
|
|
202
|
+
* Secret API key for authentication
|
|
203
|
+
* @remarks Must be a secret key, not a publishable key
|
|
204
|
+
*/
|
|
205
|
+
apiKey: string;
|
|
194
206
|
/**
|
|
195
207
|
* UUID of the invoice to start streaming charges for
|
|
196
208
|
* @remarks This should be the invoiceId returned from issuePayment()
|
|
@@ -222,6 +234,7 @@ export interface StartStreamingResponse {
|
|
|
222
234
|
* ```typescript
|
|
223
235
|
* // Temporarily pause billing
|
|
224
236
|
* const result = await beep.payments.pauseStreaming({
|
|
237
|
+
* apiKey: 'secret_api_key',
|
|
225
238
|
* invoiceId: 'active_invoice_uuid'
|
|
226
239
|
* });
|
|
227
240
|
*
|
|
@@ -231,6 +244,11 @@ export interface StartStreamingResponse {
|
|
|
231
244
|
* ```
|
|
232
245
|
*/
|
|
233
246
|
export interface PauseStreamingPayload {
|
|
247
|
+
/**
|
|
248
|
+
* Secret API key for authentication
|
|
249
|
+
* @remarks Must be a secret key, not a publishable key
|
|
250
|
+
*/
|
|
251
|
+
apiKey: string;
|
|
234
252
|
/**
|
|
235
253
|
* UUID of the invoice to pause streaming for
|
|
236
254
|
* @remarks Invoice must be in an active streaming state
|
|
@@ -262,6 +280,7 @@ export interface PauseStreamingResponse {
|
|
|
262
280
|
* ```typescript
|
|
263
281
|
* // Permanently stop and finalize the streaming session
|
|
264
282
|
* const result = await beep.payments.stopStreaming({
|
|
283
|
+
* apiKey: 'secret_api_key',
|
|
265
284
|
* invoiceId: 'active_invoice_uuid'
|
|
266
285
|
* });
|
|
267
286
|
*
|
|
@@ -269,6 +288,11 @@ export interface PauseStreamingResponse {
|
|
|
269
288
|
* ```
|
|
270
289
|
*/
|
|
271
290
|
export interface StopStreamingPayload {
|
|
291
|
+
/**
|
|
292
|
+
* Secret API key for authentication
|
|
293
|
+
* @remarks Must be a secret key, not a publishable key
|
|
294
|
+
*/
|
|
295
|
+
apiKey: string;
|
|
272
296
|
/**
|
|
273
297
|
* UUID of the invoice to permanently stop streaming for
|
|
274
298
|
* @remarks This action will finalize all charges and cannot be undone
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../src/types/payment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AAEH,MAAM,WAAW,oCAAoC;IACnD,8DAA8D;IAC9D,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,uDAAuD;IACvD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mCAAmC;IACnC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;GAOG;AAEH;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,4DAA4D;IAC5D,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,iBAAiB,GAAG,iBAAiB,CAAC;CACnD;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,YAAY,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,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AC;CAClB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB"}
|
package/package.json
CHANGED
package/dist/modules/user.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { AxiosInstance } from 'axios';
|
|
2
|
-
export interface CurrentUserResponse {
|
|
3
|
-
merchantId: string | null;
|
|
4
|
-
}
|
|
5
|
-
export declare class UserModule {
|
|
6
|
-
private client;
|
|
7
|
-
constructor(client: AxiosInstance);
|
|
8
|
-
getCurrentUser(): Promise<CurrentUserResponse>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=user.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/modules/user.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,qBAAa,UAAU;IACT,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAEnC,cAAc,IAAI,OAAO,CAAC,mBAAmB,CAAC;CAIrD"}
|