@stackbe/sdk 0.6.1 → 0.6.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.mts CHANGED
@@ -627,7 +627,8 @@ declare class EntitlementsClient {
627
627
 
628
628
  declare class CustomersClient {
629
629
  private http;
630
- constructor(http: HttpClient);
630
+ private appId;
631
+ constructor(http: HttpClient, appId: string);
631
632
  /**
632
633
  * Get a customer by ID.
633
634
  *
package/dist/index.d.ts CHANGED
@@ -627,7 +627,8 @@ declare class EntitlementsClient {
627
627
 
628
628
  declare class CustomersClient {
629
629
  private http;
630
- constructor(http: HttpClient);
630
+ private appId;
631
+ constructor(http: HttpClient, appId: string);
631
632
  /**
632
633
  * Get a customer by ID.
633
634
  *
package/dist/index.js CHANGED
@@ -474,8 +474,9 @@ var EntitlementsClient = class {
474
474
 
475
475
  // src/customers.ts
476
476
  var CustomersClient = class {
477
- constructor(http) {
477
+ constructor(http, appId) {
478
478
  this.http = http;
479
+ this.appId = appId;
479
480
  }
480
481
  /**
481
482
  * Get a customer by ID.
@@ -520,7 +521,10 @@ var CustomersClient = class {
520
521
  * ```
521
522
  */
522
523
  async create(options) {
523
- return this.http.post("/v1/customers", options);
524
+ return this.http.post("/v1/customers", {
525
+ ...options,
526
+ appId: this.appId
527
+ });
524
528
  }
525
529
  /**
526
530
  * Update a customer.
@@ -624,6 +628,7 @@ var CheckoutClient = class {
624
628
  */
625
629
  async createSession(options) {
626
630
  const body = {
631
+ appId: this.appId,
627
632
  planId: options.planId,
628
633
  successUrl: options.successUrl,
629
634
  cancelUrl: options.cancelUrl,
@@ -1203,7 +1208,7 @@ var StackBE = class {
1203
1208
  });
1204
1209
  this.usage = new UsageClient(this.http);
1205
1210
  this.entitlements = new EntitlementsClient(this.http);
1206
- this.customers = new CustomersClient(this.http);
1211
+ this.customers = new CustomersClient(this.http, config.appId);
1207
1212
  this.checkout = new CheckoutClient(this.http, config.appId);
1208
1213
  this.subscriptions = new SubscriptionsClient(this.http);
1209
1214
  this.auth = new AuthClient(this.http, config.appId, {
package/dist/index.mjs CHANGED
@@ -441,8 +441,9 @@ var EntitlementsClient = class {
441
441
 
442
442
  // src/customers.ts
443
443
  var CustomersClient = class {
444
- constructor(http) {
444
+ constructor(http, appId) {
445
445
  this.http = http;
446
+ this.appId = appId;
446
447
  }
447
448
  /**
448
449
  * Get a customer by ID.
@@ -487,7 +488,10 @@ var CustomersClient = class {
487
488
  * ```
488
489
  */
489
490
  async create(options) {
490
- return this.http.post("/v1/customers", options);
491
+ return this.http.post("/v1/customers", {
492
+ ...options,
493
+ appId: this.appId
494
+ });
491
495
  }
492
496
  /**
493
497
  * Update a customer.
@@ -591,6 +595,7 @@ var CheckoutClient = class {
591
595
  */
592
596
  async createSession(options) {
593
597
  const body = {
598
+ appId: this.appId,
594
599
  planId: options.planId,
595
600
  successUrl: options.successUrl,
596
601
  cancelUrl: options.cancelUrl,
@@ -1170,7 +1175,7 @@ var StackBE = class {
1170
1175
  });
1171
1176
  this.usage = new UsageClient(this.http);
1172
1177
  this.entitlements = new EntitlementsClient(this.http);
1173
- this.customers = new CustomersClient(this.http);
1178
+ this.customers = new CustomersClient(this.http, config.appId);
1174
1179
  this.checkout = new CheckoutClient(this.http, config.appId);
1175
1180
  this.subscriptions = new SubscriptionsClient(this.http);
1176
1181
  this.auth = new AuthClient(this.http, config.appId, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackbe/sdk",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "description": "Official JavaScript/TypeScript SDK for StackBE - the billing backend for your side project",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",