@internxt/sdk 1.15.13 → 1.16.0

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.
Files changed (39) hide show
  1. package/dist/auth/index.js +180 -262
  2. package/dist/auth/types.js +2 -22
  3. package/dist/drive/backups/index.js +34 -32
  4. package/dist/drive/payments/index.js +96 -149
  5. package/dist/drive/payments/object-storage.js +34 -36
  6. package/dist/drive/referrals/index.js +19 -17
  7. package/dist/drive/share/index.js +168 -235
  8. package/dist/drive/storage/index.js +213 -302
  9. package/dist/drive/trash/index.js +40 -84
  10. package/dist/drive/users/index.js +95 -140
  11. package/dist/mail/index.d.ts +124 -2
  12. package/dist/mail/index.js +170 -16
  13. package/dist/mail/types.d.ts +50 -0
  14. package/dist/mail/types.js +6 -0
  15. package/dist/meet/index.js +31 -99
  16. package/dist/misc/location/index.js +10 -50
  17. package/dist/network/download.js +38 -107
  18. package/dist/network/errors/codes.js +8 -24
  19. package/dist/network/errors/context.js +9 -26
  20. package/dist/network/errors/download.js +6 -24
  21. package/dist/network/errors/upload.js +21 -48
  22. package/dist/network/index.js +120 -277
  23. package/dist/network/types.js +3 -4
  24. package/dist/network/upload.js +63 -133
  25. package/dist/payments/checkout.js +57 -69
  26. package/dist/send/send.js +17 -27
  27. package/dist/shared/headers/index.js +56 -42
  28. package/dist/shared/http/client.d.ts +7 -0
  29. package/dist/shared/http/client.js +101 -188
  30. package/dist/shared/http/retryWithBackoff.js +36 -110
  31. package/dist/shared/types/errors.js +37 -51
  32. package/dist/workspaces/index.js +224 -264
  33. package/package.json +14 -15
  34. package/dist/mail/api.d.ts +0 -126
  35. package/dist/mail/api.js +0 -288
  36. package/dist/mail/crypto.d.ts +0 -66
  37. package/dist/mail/crypto.js +0 -156
  38. package/dist/mail/mail.d.ts +0 -162
  39. package/dist/mail/mail.js +0 -382
@@ -34,41 +34,44 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.Referrals = exports.ReferralTypes = void 0;
37
- var headers_1 = require("../../shared/headers");
38
- var client_1 = require("../../shared/http/client");
37
+ const headers_1 = require("../../shared/headers");
38
+ const client_1 = require("../../shared/http/client");
39
39
  exports.ReferralTypes = __importStar(require("./types"));
40
- var Referrals = /** @class */ (function () {
41
- function Referrals(apiUrl, appDetails, apiSecurity) {
40
+ class Referrals {
41
+ client;
42
+ appDetails;
43
+ apiSecurity;
44
+ static client(apiUrl, appDetails, apiSecurity) {
45
+ return new Referrals(apiUrl, appDetails, apiSecurity);
46
+ }
47
+ constructor(apiUrl, appDetails, apiSecurity) {
42
48
  this.client = client_1.HttpClient.create(apiUrl, apiSecurity.unauthorizedCallback, apiSecurity.retryOptions);
43
49
  this.appDetails = appDetails;
44
50
  this.apiSecurity = apiSecurity;
45
51
  }
46
- Referrals.client = function (apiUrl, appDetails, apiSecurity) {
47
- return new Referrals(apiUrl, appDetails, apiSecurity);
48
- };
49
52
  /**
50
53
  * Returns a list of referrals of this user
51
54
  */
52
- Referrals.prototype.getReferrals = function () {
55
+ getReferrals() {
53
56
  return this.client.get('/users-referrals', this.headers());
54
- };
57
+ }
55
58
  /**
56
59
  * Generates a referral token for the authenticated user
57
60
  */
58
- Referrals.prototype.createReferralToken = function () {
61
+ createReferralToken() {
59
62
  return this.client.post('/referral/token', {}, this.headers());
60
- };
63
+ }
61
64
  /**
62
65
  * Checks if the referral feature is enabled for the authenticated user
63
66
  */
64
- Referrals.prototype.isReferralEnabled = function () {
67
+ isReferralEnabled() {
65
68
  return this.client.get('/referral/enabled', this.headers());
66
- };
69
+ }
67
70
  /**
68
71
  * Returns the needed headers for the module requests
69
72
  * @private
70
73
  */
71
- Referrals.prototype.headers = function () {
74
+ headers() {
72
75
  return (0, headers_1.headersWithToken)({
73
76
  clientName: this.appDetails.clientName,
74
77
  clientVersion: this.appDetails.clientVersion,
@@ -77,7 +80,6 @@ var Referrals = /** @class */ (function () {
77
80
  desktopToken: this.appDetails.desktopHeader,
78
81
  customHeaders: this.appDetails.customHeaders,
79
82
  });
80
- };
81
- return Referrals;
82
- }());
83
+ }
84
+ }
83
85
  exports.Referrals = Referrals;