@internxt/sdk 1.15.2 → 1.15.4

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,5 +1,5 @@
1
1
  import { ApiSecurity, ApiUrl, AppDetails } from '../../shared';
2
- import { UserReferral } from './types';
2
+ import { ReferralTokenResponse, UserReferral } from './types';
3
3
  export * as ReferralTypes from './types';
4
4
  export declare class Referrals {
5
5
  private readonly client;
@@ -11,6 +11,10 @@ export declare class Referrals {
11
11
  * Returns a list of referrals of this user
12
12
  */
13
13
  getReferrals(): Promise<UserReferral[]>;
14
+ /**
15
+ * Generates a referral token for the authenticated user
16
+ */
17
+ createReferralToken(): Promise<ReferralTokenResponse>;
14
18
  /**
15
19
  * Returns the needed headers for the module requests
16
20
  * @private
@@ -52,6 +52,12 @@ var Referrals = /** @class */ (function () {
52
52
  Referrals.prototype.getReferrals = function () {
53
53
  return this.client.get('/users-referrals', this.headers());
54
54
  };
55
+ /**
56
+ * Generates a referral token for the authenticated user
57
+ */
58
+ Referrals.prototype.createReferralToken = function () {
59
+ return this.client.post('/referral/token', {}, this.headers());
60
+ };
55
61
  /**
56
62
  * Returns the needed headers for the module requests
57
63
  * @private
@@ -19,3 +19,6 @@ export interface UserReferral {
19
19
  credit: number;
20
20
  type: ReferralType;
21
21
  }
22
+ export interface ReferralTokenResponse {
23
+ token: string;
24
+ }
@@ -18,9 +18,10 @@ export declare class Checkout {
18
18
  * @param postalCode - The postal code of the customer
19
19
  * @param captchaToken - The captcha token to verify the call
20
20
  * @param companyVatId - The VAT ID of the company (optional)
21
+ * @param metadata - Additional metadata to attach to the customer (optional)
21
22
  * @returns The customer ID and the user token used to create a subscription or payment intent
22
23
  */
23
- createCustomer({ customerName, lineAddress1, lineAddress2, postalCode, city, country, captchaToken, companyVatId, }: CreateCustomerPayload): Promise<{
24
+ createCustomer({ customerName, lineAddress1, lineAddress2, postalCode, city, country, captchaToken, companyVatId, metadata, }: CreateCustomerPayload): Promise<{
24
25
  customerId: string;
25
26
  token: string;
26
27
  }>;
@@ -34,10 +34,11 @@ var Checkout = /** @class */ (function () {
34
34
  * @param postalCode - The postal code of the customer
35
35
  * @param captchaToken - The captcha token to verify the call
36
36
  * @param companyVatId - The VAT ID of the company (optional)
37
+ * @param metadata - Additional metadata to attach to the customer (optional)
37
38
  * @returns The customer ID and the user token used to create a subscription or payment intent
38
39
  */
39
40
  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
+ 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, metadata = _a.metadata;
41
42
  return this.client.post('/checkout/customer', {
42
43
  customerName: customerName,
43
44
  city: city,
@@ -47,6 +48,7 @@ var Checkout = /** @class */ (function () {
47
48
  postalCode: postalCode,
48
49
  captchaToken: captchaToken,
49
50
  companyVatId: companyVatId,
51
+ metadata: metadata,
50
52
  }, this.authHeaders());
51
53
  };
52
54
  /**
@@ -8,6 +8,7 @@ export interface CreateCustomerPayload {
8
8
  postalCode: string;
9
9
  captchaToken: string;
10
10
  companyVatId?: string;
11
+ metadata?: Record<string, string>;
11
12
  }
12
13
  export interface CreateSubscriptionPayload {
13
14
  customerId: 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.15.2",
4
+ "version": "1.15.4",
5
5
  "description": "An sdk for interacting with Internxt's services",
6
6
  "repository": {
7
7
  "type": "git",
@@ -28,23 +28,23 @@
28
28
  "swagger": "openapi-typescript https://gateway.internxt.com/drive/api-json -o ./src/schema.ts && yarn format"
29
29
  },
30
30
  "devDependencies": {
31
- "@internxt/eslint-config-internxt": "2.0.1",
31
+ "@internxt/eslint-config-internxt": "2.1.0",
32
32
  "@internxt/prettier-config": "internxt/prettier-config#v1.0.2",
33
- "@types/node": "25.2.3",
34
- "@vitest/coverage-istanbul": "4.0.18",
35
- "@vitest/spy": "4.0.18",
36
- "eslint": "9.39.2",
33
+ "@types/node": "25.5.0",
34
+ "@vitest/coverage-istanbul": "4.1.0",
35
+ "@vitest/spy": "4.1.0",
36
+ "eslint": "10.0.3",
37
37
  "husky": "9.1.7",
38
- "lint-staged": "16.2.7",
39
- "openapi-typescript": "7.12.0",
38
+ "lint-staged": "16.4.0",
39
+ "openapi-typescript": "7.13.0",
40
40
  "prettier": "3.8.1",
41
- "rimraf": "6.1.2",
41
+ "rimraf": "6.1.3",
42
42
  "typescript": "5.9.3",
43
- "vitest": "4.0.18"
43
+ "vitest": "4.1.0"
44
44
  },
45
45
  "dependencies": {
46
- "axios": "1.13.5",
47
- "internxt-crypto": "0.0.13"
46
+ "axios": "1.13.6",
47
+ "internxt-crypto": "0.0.14"
48
48
  },
49
49
  "lint-staged": {
50
50
  "*.{js,jsx,tsx,ts}": [