@internxt/sdk 1.9.25 → 1.9.27

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.
@@ -1,3 +1,4 @@
1
+ import { PaymentMethodVerification, PaymentMethodVerificationPayload } from 'src/payments/types';
1
2
  import { ApiUrl, AppDetails } from '../../shared';
2
3
  import { CreatedSubscriptionData } from './types/types';
3
4
  interface ObjectStoragePlan {
@@ -31,6 +32,7 @@ export declare class ObjectStorage {
31
32
  token: string;
32
33
  promoCodeId?: string;
33
34
  }): Promise<CreatedSubscriptionData>;
35
+ paymentMethodVerification({ customerId, token, currency, priceId, paymentMethod, }: PaymentMethodVerificationPayload): Promise<PaymentMethodVerification>;
34
36
  private headers;
35
37
  }
36
38
  export {};
@@ -13,7 +13,7 @@ var ObjectStorage = /** @class */ (function () {
13
13
  };
14
14
  ObjectStorage.prototype.getObjectStoragePlanById = function (priceId, currency) {
15
15
  var query = new URLSearchParams();
16
- priceId !== undefined && query.set('planId', priceId);
16
+ query.set('planId', priceId);
17
17
  currency !== undefined && query.set('currency', currency);
18
18
  return this.client.get("/object-storage/price?".concat(query.toString()), this.headers());
19
19
  };
@@ -37,6 +37,16 @@ var ObjectStorage = /** @class */ (function () {
37
37
  promoCodeId: promoCodeId,
38
38
  }, this.headers());
39
39
  };
40
+ ObjectStorage.prototype.paymentMethodVerification = function (_a) {
41
+ var customerId = _a.customerId, token = _a.token, _b = _a.currency, currency = _b === void 0 ? 'eur' : _b, priceId = _a.priceId, paymentMethod = _a.paymentMethod;
42
+ return this.client.post('/payment-method-verification', {
43
+ customerId: customerId,
44
+ token: token,
45
+ currency: currency,
46
+ priceId: priceId,
47
+ paymentMethod: paymentMethod,
48
+ }, this.headers());
49
+ };
40
50
  ObjectStorage.prototype.headers = function () {
41
51
  return (0, headers_1.basicHeaders)(this.appDetails.clientName, this.appDetails.clientVersion);
42
52
  };
@@ -266,9 +266,10 @@ export declare class Storage {
266
266
  *
267
267
  * @param {string} search - The name of the item.
268
268
  * @param {string} workspaceId - The ID of the workspace (optional).
269
+ * @param {number} offset - The position of the first item to return (optional).
269
270
  * @returns {[Promise<SearchResultData>, RequestCanceler]} An array containing a promise to get the API response and a function to cancel the request.
270
271
  */
271
- getGlobalSearchItems(search: string, workspaceId?: string): [Promise<SearchResultData>, RequestCanceler];
272
+ getGlobalSearchItems(search: string, workspaceId?: string, offset?: number): [Promise<SearchResultData>, RequestCanceler];
272
273
  /**
273
274
  * Returns the needed headers for the module requests
274
275
  * @private
@@ -542,12 +542,16 @@ var Storage = /** @class */ (function () {
542
542
  *
543
543
  * @param {string} search - The name of the item.
544
544
  * @param {string} workspaceId - The ID of the workspace (optional).
545
+ * @param {number} offset - The position of the first item to return (optional).
545
546
  * @returns {[Promise<SearchResultData>, RequestCanceler]} An array containing a promise to get the API response and a function to cancel the request.
546
547
  */
547
- Storage.prototype.getGlobalSearchItems = function (search, workspaceId) {
548
+ Storage.prototype.getGlobalSearchItems = function (search, workspaceId, offset) {
549
+ var query = new URLSearchParams();
550
+ if (offset !== undefined)
551
+ query.set('offset', String(offset));
548
552
  var _a = workspaceId
549
- ? this.client.getCancellable("workspaces/".concat(workspaceId, "/fuzzy/").concat(search), this.headers())
550
- : this.client.getCancellable("fuzzy/".concat(search), this.headers()), promise = _a.promise, requestCanceler = _a.requestCanceler;
553
+ ? this.client.getCancellable("workspaces/".concat(workspaceId, "/fuzzy/").concat(search, "?").concat(query), this.headers())
554
+ : this.client.getCancellable("fuzzy/".concat(search, "?").concat(query), this.headers()), promise = _a.promise, requestCanceler = _a.requestCanceler;
551
555
  return [promise, requestCanceler];
552
556
  };
553
557
  /**
@@ -14,6 +14,18 @@ export interface CreatePaymentIntentPayload {
14
14
  currency?: string;
15
15
  promoCodeId?: string;
16
16
  }
17
+ export interface PaymentMethodVerificationPayload {
18
+ customerId: string;
19
+ token: string;
20
+ paymentMethod: string;
21
+ priceId: string;
22
+ currency?: string;
23
+ }
24
+ export interface PaymentMethodVerification {
25
+ intentId: string;
26
+ verified: boolean;
27
+ clientSecret?: string;
28
+ }
17
29
  export interface GetPriceByIdPayload {
18
30
  priceId: string;
19
31
  promoCodeName?: 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.25",
4
+ "version": "1.9.27",
5
5
  "description": "An sdk for interacting with Internxt's services",
6
6
  "repository": {
7
7
  "type": "git",