@internxt/sdk 1.11.14 → 1.11.16

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.
@@ -25,6 +25,10 @@ export declare class Users {
25
25
  * Returns fresh data of the user
26
26
  */
27
27
  refreshUser(): Promise<paths['/users/refresh']['get']['responses']['200']['content']['application/json']>;
28
+ /**
29
+ * Returns fresh data of the user
30
+ */
31
+ refreshUserCredentials(): Promise<paths['/users/cli/refresh']['get']['responses']['200']['content']['application/json']>;
28
32
  /**
29
33
  * Returns fresh avatar URL of the user
30
34
  */
@@ -112,6 +112,12 @@ var Users = /** @class */ (function () {
112
112
  Users.prototype.refreshUser = function () {
113
113
  return this.client.get('/users/refresh', this.headers());
114
114
  };
115
+ /**
116
+ * Returns fresh data of the user
117
+ */
118
+ Users.prototype.refreshUserCredentials = function () {
119
+ return this.client.get('/users/cli/refresh', this.headers());
120
+ };
115
121
  /**
116
122
  * Returns fresh avatar URL of the user
117
123
  */
@@ -1,6 +1,6 @@
1
1
  import { CreatedSubscriptionData } from '../drive/payments/types/types';
2
2
  import { ApiSecurity, ApiUrl, AppDetails } from '../shared';
3
- import { CreatePaymentIntentPayload, CreateSubscriptionPayload, CryptoCurrency, GetPriceByIdPayload, PaymentIntent, PriceWithTax } from './types';
3
+ import { CreateCustomerPayload, CreatePaymentIntentPayload, CreateSubscriptionPayload, CryptoCurrency, GetPriceByIdPayload, PaymentIntent, PriceWithTax } from './types';
4
4
  export declare class Checkout {
5
5
  private readonly client;
6
6
  private readonly appDetails;
@@ -9,18 +9,18 @@ export declare class Checkout {
9
9
  private constructor();
10
10
  /**
11
11
  * @description Creates a customer or gets the existing one if it already exists
12
+ * @param customerName - The name of the customer
13
+ * @param lineAddress1 - The address of the user
14
+ * @param lineAddress2 - The address of the user
15
+ * @param postalCode - The postal code of the city where the user lives
16
+ * @param city - The city of the user
12
17
  * @param country - The country of the customer
13
18
  * @param postalCode - The postal code of the customer
19
+ * @param captchaToken - The captcha token to verify the call
14
20
  * @param companyVatId - The VAT ID of the company (optional)
15
21
  * @returns The customer ID and the user token used to create a subscription or payment intent
16
22
  */
17
- getCustomerId({ customerName, postalCode, country, captchaToken, companyVatId, }: {
18
- customerName: string;
19
- postalCode: string;
20
- country: string;
21
- captchaToken: string;
22
- companyVatId?: string;
23
- }): Promise<{
23
+ createCustomer({ customerName, lineAddress1, lineAddress2, postalCode, city, country, captchaToken, companyVatId, }: CreateCustomerPayload): Promise<{
24
24
  customerId: string;
25
25
  token: string;
26
26
  }>;
@@ -25,21 +25,29 @@ var Checkout = /** @class */ (function () {
25
25
  };
26
26
  /**
27
27
  * @description Creates a customer or gets the existing one if it already exists
28
+ * @param customerName - The name of the customer
29
+ * @param lineAddress1 - The address of the user
30
+ * @param lineAddress2 - The address of the user
31
+ * @param postalCode - The postal code of the city where the user lives
32
+ * @param city - The city of the user
28
33
  * @param country - The country of the customer
29
34
  * @param postalCode - The postal code of the customer
35
+ * @param captchaToken - The captcha token to verify the call
30
36
  * @param companyVatId - The VAT ID of the company (optional)
31
37
  * @returns The customer ID and the user token used to create a subscription or payment intent
32
38
  */
33
- Checkout.prototype.getCustomerId = function (_a) {
34
- var customerName = _a.customerName, postalCode = _a.postalCode, country = _a.country, captchaToken = _a.captchaToken, companyVatId = _a.companyVatId;
35
- var query = new URLSearchParams();
36
- query.set('customerName', customerName);
37
- query.set('country', country);
38
- query.set('postalCode', postalCode);
39
- query.set('captchaToken', captchaToken);
40
- if (companyVatId !== undefined)
41
- query.set('companyVatId', companyVatId);
42
- return this.client.get("/checkout/customer?".concat(query.toString()), this.authHeaders());
39
+ Checkout.prototype.createCustomer = function (_a) {
40
+ var customerName = _a.customerName, lineAddress1 = _a.lineAddress1, lineAddress2 = _a.lineAddress2, postalCode = _a.postalCode, city = _a.city, country = _a.country, captchaToken = _a.captchaToken, companyVatId = _a.companyVatId;
41
+ return this.client.post('/checkout/customer', {
42
+ customerName: customerName,
43
+ city: city,
44
+ lineAddress1: lineAddress1,
45
+ lineAddress2: lineAddress2,
46
+ country: country,
47
+ postalCode: postalCode,
48
+ captchaToken: captchaToken,
49
+ companyVatId: companyVatId,
50
+ }, this.authHeaders());
43
51
  };
44
52
  /**
45
53
  * @description Creates a subscription for a given customer
@@ -1,4 +1,14 @@
1
1
  import { UserType } from '../../drive/payments/types/types';
2
+ export interface CreateCustomerPayload {
3
+ customerName: string;
4
+ lineAddress1: string;
5
+ lineAddress2?: string;
6
+ city: string;
7
+ country: string;
8
+ postalCode: string;
9
+ captchaToken: string;
10
+ companyVatId?: string;
11
+ }
2
12
  export interface CreateSubscriptionPayload {
3
13
  customerId: string;
4
14
  priceId: string;
package/dist/schema.d.ts CHANGED
@@ -1800,6 +1800,23 @@ export interface paths {
1800
1800
  patch?: never;
1801
1801
  trace?: never;
1802
1802
  };
1803
+ '/users/cli/refresh': {
1804
+ parameters: {
1805
+ query?: never;
1806
+ header?: never;
1807
+ path?: never;
1808
+ cookie?: never;
1809
+ };
1810
+ /** CLI platform refresh session token */
1811
+ get: operations['UserController_cliRefresh'];
1812
+ put?: never;
1813
+ post?: never;
1814
+ delete?: never;
1815
+ options?: never;
1816
+ head?: never;
1817
+ patch?: never;
1818
+ trace?: never;
1819
+ };
1803
1820
  '/users/avatar/refresh': {
1804
1821
  parameters: {
1805
1822
  query?: never;
@@ -7903,6 +7920,33 @@ export interface operations {
7903
7920
  };
7904
7921
  };
7905
7922
  };
7923
+ UserController_cliRefresh: {
7924
+ parameters: {
7925
+ query?: never;
7926
+ header?: never;
7927
+ path?: never;
7928
+ cookie?: never;
7929
+ };
7930
+ requestBody?: never;
7931
+ responses: {
7932
+ /** @description Returns the user metadata and the authentication tokens */
7933
+ 200: {
7934
+ headers: {
7935
+ [name: string]: unknown;
7936
+ };
7937
+ content: {
7938
+ 'application/json': components['schemas']['RefreshUserTokensDto'];
7939
+ };
7940
+ };
7941
+ /** @description This user current tier does not allow CLI access */
7942
+ 402: {
7943
+ headers: {
7944
+ [name: string]: unknown;
7945
+ };
7946
+ content?: never;
7947
+ };
7948
+ };
7949
+ };
7906
7950
  UserController_refreshAvatarUser: {
7907
7951
  parameters: {
7908
7952
  query?: never;
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.11.14",
4
+ "version": "1.11.16",
5
5
  "description": "An sdk for interacting with Internxt's services",
6
6
  "repository": {
7
7
  "type": "git",