@internxt/sdk 1.9.19 → 1.9.21

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.
@@ -14,21 +14,21 @@ export declare class ObjectStorage {
14
14
  static client(apiUrl: ApiUrl, appDetails: AppDetails): ObjectStorage;
15
15
  private constructor();
16
16
  getObjectStoragePlanById(priceId: string, currency?: string): Promise<ObjectStoragePlan>;
17
- createCustomerForObjectStorage({ name, email, country, companyVatId, }: {
18
- name: string;
17
+ getObjectStorageCustomerId({ customerName, email, country, postalCode, companyVatId, }: {
18
+ customerName: string;
19
19
  email: string;
20
- country?: string;
20
+ country: string;
21
+ postalCode: string;
21
22
  companyVatId?: string;
22
23
  }): Promise<{
23
24
  customerId: string;
24
25
  token: string;
25
26
  }>;
26
- createObjectStorageSubscription({ customerId, plan, token, companyName, vatId, promoCodeId, }: {
27
+ createObjectStorageSubscription({ customerId, priceId, currency, token, promoCodeId, }: {
27
28
  customerId: string;
28
- plan: ObjectStoragePlan;
29
+ priceId: string;
30
+ currency: string;
29
31
  token: string;
30
- companyName: string;
31
- vatId: string;
32
32
  promoCodeId?: string;
33
33
  }): Promise<CreatedSubscriptionData>;
34
34
  private headers;
@@ -15,27 +15,25 @@ var ObjectStorage = /** @class */ (function () {
15
15
  var query = new URLSearchParams();
16
16
  priceId !== undefined && query.set('planId', priceId);
17
17
  currency !== undefined && query.set('currency', currency);
18
- return this.client.get("/object-storage-plan-by-id?".concat(query.toString()), this.headers());
18
+ return this.client.get("/object-storage/price?".concat(query.toString()), this.headers());
19
19
  };
20
- ObjectStorage.prototype.createCustomerForObjectStorage = function (_a) {
21
- var name = _a.name, email = _a.email, country = _a.country, companyVatId = _a.companyVatId;
22
- return this.client.post('/create-customer-for-object-storage', {
23
- name: name,
24
- email: email,
25
- country: country,
26
- companyVatId: companyVatId,
27
- }, this.headers());
20
+ ObjectStorage.prototype.getObjectStorageCustomerId = function (_a) {
21
+ var customerName = _a.customerName, email = _a.email, country = _a.country, postalCode = _a.postalCode, companyVatId = _a.companyVatId;
22
+ var query = new URLSearchParams();
23
+ query.set('customerName', customerName);
24
+ query.set('email', email);
25
+ query.set('postalCode', postalCode);
26
+ query.set('country', country);
27
+ companyVatId !== undefined && query.set('companyVatId', companyVatId);
28
+ return this.client.get("/object-storage/customer?".concat(query.toString()), this.headers());
28
29
  };
29
30
  ObjectStorage.prototype.createObjectStorageSubscription = function (_a) {
30
- var customerId = _a.customerId, plan = _a.plan, token = _a.token, companyName = _a.companyName, vatId = _a.vatId, promoCodeId = _a.promoCodeId;
31
- var priceId = plan.id, currency = plan.currency;
32
- return this.client.post('/create-subscription-for-object-storage', {
31
+ var customerId = _a.customerId, priceId = _a.priceId, currency = _a.currency, token = _a.token, promoCodeId = _a.promoCodeId;
32
+ return this.client.post('/object-storage/subscription', {
33
33
  customerId: customerId,
34
34
  priceId: priceId,
35
- token: token,
36
35
  currency: currency,
37
- companyName: companyName,
38
- companyVatId: vatId,
36
+ token: token,
39
37
  promoCodeId: promoCodeId,
40
38
  }, this.headers());
41
39
  };
@@ -58,7 +58,7 @@ export declare class Checkout {
58
58
  * @param currency - The currency of the price (optional)
59
59
  * @returns The price object containing the details of the requested price
60
60
  */
61
- getPriceById({ priceId, promoCodeName, currency, postalCode, country, }: GetPriceByIdPayload): Promise<PriceWithTax>;
61
+ getPriceById({ priceId, promoCodeName, userAddress, currency, postalCode, country, }: GetPriceByIdPayload): Promise<PriceWithTax>;
62
62
  /**
63
63
  * Returns the needed headers with authorization header for the module requests
64
64
  * @private
@@ -95,11 +95,13 @@ var Checkout = /** @class */ (function () {
95
95
  * @returns The price object containing the details of the requested price
96
96
  */
97
97
  Checkout.prototype.getPriceById = function (_a) {
98
- var priceId = _a.priceId, promoCodeName = _a.promoCodeName, currency = _a.currency, postalCode = _a.postalCode, country = _a.country;
98
+ var priceId = _a.priceId, promoCodeName = _a.promoCodeName, userAddress = _a.userAddress, currency = _a.currency, postalCode = _a.postalCode, country = _a.country;
99
99
  var query = new URLSearchParams();
100
100
  query.set('priceId', priceId);
101
101
  if (promoCodeName !== undefined)
102
102
  query.set('promoCodeName', promoCodeName);
103
+ if (userAddress !== undefined)
104
+ query.set('userAddress', userAddress);
103
105
  if (currency !== undefined)
104
106
  query.set('currency', currency);
105
107
  if (postalCode !== undefined)
@@ -17,6 +17,7 @@ export interface CreatePaymentIntentPayload {
17
17
  export interface GetPriceByIdPayload {
18
18
  priceId: string;
19
19
  promoCodeName?: string;
20
+ userAddress?: string;
20
21
  currency?: string;
21
22
  postalCode?: string;
22
23
  country?: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@internxt/sdk",
3
3
  "author": "Internxt <hello@internxt.com>",
4
- "version": "1.9.19",
4
+ "version": "1.9.21",
5
5
  "description": "An sdk for interacting with Internxt's services",
6
6
  "repository": {
7
7
  "type": "git",