@internxt/sdk 1.8.1 → 1.9.1

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.
@@ -77,9 +77,22 @@ var Auth = /** @class */ (function () {
77
77
  password: registerDetails.password,
78
78
  mnemonic: registerDetails.mnemonic,
79
79
  salt: registerDetails.salt,
80
+ /**
81
+ / @deprecated The individual fields for keys should not be used
82
+ */
80
83
  privateKey: registerDetails.keys.privateKeyEncrypted,
81
84
  publicKey: registerDetails.keys.publicKey,
82
85
  revocationKey: registerDetails.keys.revocationCertificate,
86
+ keys: {
87
+ ecc: {
88
+ publicKey: registerDetails.keys.ecc.publicKey,
89
+ privateKeyEncrypted: registerDetails.keys.ecc.privateKeyEncrypted,
90
+ },
91
+ kyber: {
92
+ publicKey: registerDetails.keys.kyber.publicKey,
93
+ privateKeyEncrypted: registerDetails.keys.kyber.privateKeyEncrypted,
94
+ }
95
+ },
83
96
  referral: registerDetails.referral,
84
97
  referrer: registerDetails.referrer,
85
98
  }, this.basicHeaders());
@@ -98,9 +111,22 @@ var Auth = /** @class */ (function () {
98
111
  password: registerDetails.password,
99
112
  mnemonic: registerDetails.mnemonic,
100
113
  salt: registerDetails.salt,
114
+ /**
115
+ / @deprecated The individual fields for keys should not be used
116
+ */
101
117
  privateKey: registerDetails.keys.privateKeyEncrypted,
102
118
  publicKey: registerDetails.keys.publicKey,
103
119
  revocationKey: registerDetails.keys.revocationCertificate,
120
+ keys: {
121
+ ecc: {
122
+ publicKey: registerDetails.keys.ecc.publicKey,
123
+ privateKeyEncrypted: registerDetails.keys.ecc.privateKeyEncrypted,
124
+ },
125
+ kyber: {
126
+ publicKey: registerDetails.keys.kyber.publicKey,
127
+ privateKeyEncrypted: registerDetails.keys.kyber.privateKeyEncrypted,
128
+ },
129
+ },
104
130
  referral: registerDetails.referral,
105
131
  referrer: registerDetails.referrer,
106
132
  invitationId: registerDetails.invitationId,
@@ -149,9 +175,22 @@ var Auth = /** @class */ (function () {
149
175
  email: details.email,
150
176
  password: encryptedPasswordHash,
151
177
  tfa: details.tfaCode,
178
+ /**
179
+ / @deprecated The individual fields for keys should not be used
180
+ */
152
181
  privateKey: keys.privateKeyEncrypted,
153
182
  publicKey: keys.publicKey,
154
183
  revocateKey: keys.revocationCertificate,
184
+ keys: {
185
+ ecc: {
186
+ publicKey: keys.ecc.publicKey,
187
+ privateKeyEncrypted: keys.ecc.privateKeyEncrypted,
188
+ },
189
+ kyber: {
190
+ publicKey: keys.kyber.publicKey,
191
+ privateKeyEncrypted: keys.kyber.privateKeyEncrypted,
192
+ }
193
+ },
155
194
  }, this.basicHeaders())
156
195
  .then(function (data) {
157
196
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -170,9 +209,20 @@ var Auth = /** @class */ (function () {
170
209
  */
171
210
  Auth.prototype.updateKeys = function (keys, token) {
172
211
  return this.client.patch('/user/keys', {
212
+ /**
213
+ / @deprecated The individual fields for keys should not be used
214
+ */
173
215
  publicKey: keys.publicKey,
174
216
  privateKey: keys.privateKeyEncrypted,
175
217
  revocationKey: keys.revocationCertificate,
218
+ ecc: {
219
+ publicKey: keys.ecc.publicKey,
220
+ privateKeyEncrypted: keys.ecc.privateKeyEncrypted,
221
+ },
222
+ kyber: {
223
+ publicKey: keys.kyber.publicKey,
224
+ privateKeyEncrypted: keys.kyber.privateKeyEncrypted,
225
+ }
176
226
  }, this.headersWithToken(token));
177
227
  };
178
228
  /**
@@ -33,6 +33,14 @@ export interface Keys {
33
33
  privateKeyEncrypted: string;
34
34
  publicKey: string;
35
35
  revocationCertificate: string;
36
+ ecc: {
37
+ publicKey: string;
38
+ privateKeyEncrypted: string;
39
+ };
40
+ kyber: {
41
+ publicKey: string | null;
42
+ privateKeyEncrypted: string | null;
43
+ };
36
44
  }
37
45
  export interface CryptoProvider {
38
46
  encryptPasswordHash: (password: Password, encryptedSalt: string) => string;
@@ -31,7 +31,7 @@ export declare class Payments {
31
31
  clientSecret: string;
32
32
  }>;
33
33
  getDefaultPaymentMethod(userType?: UserType): Promise<PaymentMethod>;
34
- getInvoices({ subscriptionId, startingAfter, limit }: InvoicePayload): Promise<Invoice[]>;
34
+ getInvoices({ subscriptionId, userType, startingAfter, limit, }: InvoicePayload): Promise<Invoice[]>;
35
35
  isCouponUsedByUser({ couponCode }: {
36
36
  couponCode: string;
37
37
  }): Promise<{
@@ -50,6 +50,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
50
50
  exports.Payments = void 0;
51
51
  var headers_1 = require("../../shared/headers");
52
52
  var client_1 = require("../../shared/http/client");
53
+ var types_1 = require("./types");
53
54
  var Payments = /** @class */ (function () {
54
55
  function Payments(apiUrl, appDetails, apiSecurity) {
55
56
  this.client = client_1.HttpClient.create(apiUrl, apiSecurity.unauthorizedCallback);
@@ -117,12 +118,14 @@ var Payments = /** @class */ (function () {
117
118
  return this.client.get("/default-payment-method?".concat(query.toString()), this.headers());
118
119
  };
119
120
  Payments.prototype.getInvoices = function (_a) {
120
- var subscriptionId = _a.subscriptionId, startingAfter = _a.startingAfter, limit = _a.limit;
121
+ var subscriptionId = _a.subscriptionId, _b = _a.userType, userType = _b === void 0 ? types_1.UserType.Individual : _b, startingAfter = _a.startingAfter, limit = _a.limit;
121
122
  var query = new URLSearchParams();
122
- if (subscriptionId)
123
+ if (subscriptionId !== undefined)
123
124
  query.set('subscription', subscriptionId);
124
125
  if (startingAfter !== undefined)
125
126
  query.set('starting_after', startingAfter);
127
+ if (userType !== undefined)
128
+ query.set('userType', userType);
126
129
  if (limit !== undefined)
127
130
  query.set('limit', limit.toString());
128
131
  return this.client.get("/invoices?".concat(query.toString()), this.headers());
@@ -121,8 +121,9 @@ export interface Invoice {
121
121
  currency: string;
122
122
  }
123
123
  export interface InvoicePayload {
124
- subscriptionId: string;
124
+ subscriptionId?: string;
125
125
  startingAfter?: string;
126
+ userType?: UserType;
126
127
  limit?: number;
127
128
  }
128
129
  export type UserSubscription = {
@@ -19,6 +19,16 @@ export interface UserSettings {
19
19
  privateKey: string;
20
20
  publicKey: string;
21
21
  revocationKey: string;
22
+ keys: {
23
+ ecc: {
24
+ publicKey: string;
25
+ privateKeyEncrypted: string;
26
+ };
27
+ kyber: {
28
+ publicKey: string;
29
+ privateKeyEncrypted: string;
30
+ };
31
+ };
22
32
  teams?: boolean;
23
33
  appSumoDetails: AppSumoDetails | null;
24
34
  registerCompleted: boolean;
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.8.1",
4
+ "version": "1.9.1",
5
5
  "description": "An sdk for interacting with Internxt's services",
6
6
  "repository": {
7
7
  "type": "git",