@turnkey/core 1.14.1 → 2.0.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 (83) hide show
  1. package/dist/__clients__/core.d.ts +86 -33
  2. package/dist/__clients__/core.d.ts.map +1 -1
  3. package/dist/__clients__/core.js +354 -195
  4. package/dist/__clients__/core.js.map +1 -1
  5. package/dist/__clients__/core.mjs +355 -196
  6. package/dist/__clients__/core.mjs.map +1 -1
  7. package/dist/__generated__/sdk-client-base.d.ts +8 -3
  8. package/dist/__generated__/sdk-client-base.d.ts.map +1 -1
  9. package/dist/__generated__/sdk-client-base.js +117 -55
  10. package/dist/__generated__/sdk-client-base.js.map +1 -1
  11. package/dist/__generated__/sdk-client-base.mjs +112 -50
  12. package/dist/__generated__/sdk-client-base.mjs.map +1 -1
  13. package/dist/__generated__/version.d.ts +1 -1
  14. package/dist/__generated__/version.d.ts.map +1 -1
  15. package/dist/__generated__/version.js +1 -1
  16. package/dist/__generated__/version.mjs +1 -1
  17. package/dist/__stampers__/api/base.d.ts +2 -1
  18. package/dist/__stampers__/api/base.d.ts.map +1 -1
  19. package/dist/__stampers__/api/mobile/stamper.d.ts +2 -1
  20. package/dist/__stampers__/api/mobile/stamper.d.ts.map +1 -1
  21. package/dist/__stampers__/api/mobile/stamper.js.map +1 -1
  22. package/dist/__stampers__/api/mobile/stamper.mjs.map +1 -1
  23. package/dist/__stampers__/api/web/stamper.d.ts +2 -1
  24. package/dist/__stampers__/api/web/stamper.d.ts.map +1 -1
  25. package/dist/__stampers__/api/web/stamper.js.map +1 -1
  26. package/dist/__stampers__/api/web/stamper.mjs.map +1 -1
  27. package/dist/__stampers__/passkey/base.d.ts +3 -1
  28. package/dist/__stampers__/passkey/base.d.ts.map +1 -1
  29. package/dist/__stampers__/passkey/base.js +19 -0
  30. package/dist/__stampers__/passkey/base.js.map +1 -1
  31. package/dist/__stampers__/passkey/base.mjs +20 -1
  32. package/dist/__stampers__/passkey/base.mjs.map +1 -1
  33. package/dist/__types__/auth.d.ts +2 -41
  34. package/dist/__types__/auth.d.ts.map +1 -1
  35. package/dist/__types__/auth.js.map +1 -1
  36. package/dist/__types__/auth.mjs.map +1 -1
  37. package/dist/__types__/config.d.ts +3 -2
  38. package/dist/__types__/config.d.ts.map +1 -1
  39. package/dist/__types__/enums.d.ts +1 -0
  40. package/dist/__types__/enums.d.ts.map +1 -1
  41. package/dist/__types__/enums.js +1 -0
  42. package/dist/__types__/enums.js.map +1 -1
  43. package/dist/__types__/enums.mjs +1 -0
  44. package/dist/__types__/enums.mjs.map +1 -1
  45. package/dist/__types__/http.d.ts +1 -14
  46. package/dist/__types__/http.d.ts.map +1 -1
  47. package/dist/__types__/index.d.ts +0 -1
  48. package/dist/__types__/index.d.ts.map +1 -1
  49. package/dist/__types__/method-types/shared.d.ts +28 -13
  50. package/dist/__types__/method-types/shared.d.ts.map +1 -1
  51. package/dist/__wallet__/stamper.d.ts +2 -1
  52. package/dist/__wallet__/stamper.d.ts.map +1 -1
  53. package/dist/__wallet__/stamper.js.map +1 -1
  54. package/dist/__wallet__/stamper.mjs.map +1 -1
  55. package/dist/index.d.ts +1 -2
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +8 -6
  58. package/dist/index.js.map +1 -1
  59. package/dist/index.mjs +2 -4
  60. package/dist/index.mjs.map +1 -1
  61. package/dist/turnkey-helpers.d.ts +4 -0
  62. package/dist/turnkey-helpers.d.ts.map +1 -1
  63. package/dist/turnkey-helpers.js +28 -0
  64. package/dist/turnkey-helpers.js.map +1 -1
  65. package/dist/turnkey-helpers.mjs +25 -1
  66. package/dist/turnkey-helpers.mjs.map +1 -1
  67. package/dist/utils.d.ts +41 -18
  68. package/dist/utils.d.ts.map +1 -1
  69. package/dist/utils.js +126 -57
  70. package/dist/utils.js.map +1 -1
  71. package/dist/utils.mjs +100 -38
  72. package/dist/utils.mjs.map +1 -1
  73. package/package.json +7 -7
  74. package/dist/__types__/error.d.ts +0 -13
  75. package/dist/__types__/error.d.ts.map +0 -1
  76. package/dist/__types__/error.js +0 -18
  77. package/dist/__types__/error.js.map +0 -1
  78. package/dist/__types__/error.mjs +0 -16
  79. package/dist/__types__/error.mjs.map +0 -1
  80. package/dist/__types__/http.js +0 -11
  81. package/dist/__types__/http.js.map +0 -1
  82. package/dist/__types__/http.mjs +0 -9
  83. package/dist/__types__/http.mjs.map +0 -1
@@ -1,8 +1,6 @@
1
- import { StamperType } from '../__types__/enums.mjs';
2
- import { TurnkeyRequestError } from '../__types__/error.mjs';
3
- import { TERMINAL_ACTIVITY_STATUSES } from '../__types__/http.mjs';
4
1
  import { VERSION } from './version.mjs';
5
- import { TurnkeyError, TurnkeyErrorCodes } from '@turnkey/sdk-types';
2
+ import { TERMINAL_ACTIVITY_STATUSES, TurnkeyRequestError, TurnkeyError, TurnkeyErrorCodes } from '@turnkey/sdk-types';
3
+ import { StamperType } from '../__types__/enums.mjs';
6
4
 
7
5
  /* @generated by codegen. DO NOT EDIT BY HAND */
8
6
  class TurnkeySDKClientBase {
@@ -247,6 +245,36 @@ class TurnkeySDKClientBase {
247
245
  url: fullUrl,
248
246
  };
249
247
  };
248
+ this.getIpAllowlist = async (input, stampWith) => {
249
+ const session = await this.storageManager?.getActiveSession();
250
+ return this.request("/public/v1/query/get_ip_allowlist", {
251
+ ...input,
252
+ organizationId: input.organizationId ??
253
+ session?.organizationId ??
254
+ this.config.organizationId,
255
+ }, stampWith);
256
+ };
257
+ this.stampGetIpAllowlist = async (input, stampWith) => {
258
+ const activeStamper = this.getStamper(stampWith);
259
+ if (!activeStamper) {
260
+ return undefined;
261
+ }
262
+ const session = await this.storageManager?.getActiveSession();
263
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_ip_allowlist";
264
+ const body = {
265
+ ...input,
266
+ organizationId: input.organizationId ??
267
+ session?.organizationId ??
268
+ this.config.organizationId,
269
+ };
270
+ const stringifiedBody = JSON.stringify(body);
271
+ const stamp = await activeStamper.stamp(stringifiedBody);
272
+ return {
273
+ body: stringifiedBody,
274
+ stamp: stamp,
275
+ url: fullUrl,
276
+ };
277
+ };
250
278
  this.getLatestBootProof = async (input, stampWith) => {
251
279
  const session = await this.storageManager?.getActiveSession();
252
280
  return this.request("/public/v1/query/get_latest_boot_proof", {
@@ -1276,40 +1304,6 @@ class TurnkeySDKClientBase {
1276
1304
  url: fullUrl,
1277
1305
  };
1278
1306
  };
1279
- this.createApiOnlyUsers = async (input, stampWith) => {
1280
- const { organizationId, timestampMs, ...rest } = input;
1281
- const session = await this.storageManager?.getActiveSession();
1282
- return this.activity("/public/v1/submit/create_api_only_users", {
1283
- parameters: rest,
1284
- organizationId: organizationId ??
1285
- session?.organizationId ??
1286
- this.config.organizationId,
1287
- timestampMs: timestampMs ?? String(Date.now()),
1288
- type: "ACTIVITY_TYPE_CREATE_API_ONLY_USERS",
1289
- }, "createApiOnlyUsersResult", stampWith);
1290
- };
1291
- this.stampCreateApiOnlyUsers = async (input, stampWith) => {
1292
- const activeStamper = this.getStamper(stampWith);
1293
- if (!activeStamper) {
1294
- return undefined;
1295
- }
1296
- const { organizationId, timestampMs, ...parameters } = input;
1297
- const session = await this.storageManager?.getActiveSession();
1298
- const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_api_only_users";
1299
- const bodyWithType = {
1300
- parameters,
1301
- organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
1302
- timestampMs: timestampMs ?? String(Date.now()),
1303
- type: "ACTIVITY_TYPE_CREATE_API_ONLY_USERS",
1304
- };
1305
- const stringifiedBody = JSON.stringify(bodyWithType);
1306
- const stamp = await activeStamper.stamp(stringifiedBody);
1307
- return {
1308
- body: stringifiedBody,
1309
- stamp: stamp,
1310
- url: fullUrl,
1311
- };
1312
- };
1313
1307
  this.createAuthenticators = async (input, stampWith) => {
1314
1308
  const { organizationId, timestampMs, ...rest } = input;
1315
1309
  const session = await this.storageManager?.getActiveSession();
@@ -1456,8 +1450,8 @@ class TurnkeySDKClientBase {
1456
1450
  session?.organizationId ??
1457
1451
  this.config.organizationId,
1458
1452
  timestampMs: timestampMs ?? String(Date.now()),
1459
- type: "ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS",
1460
- }, "createOauthProvidersResult", stampWith);
1453
+ type: "ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS_V2",
1454
+ }, "createOauthProvidersResultV2", stampWith);
1461
1455
  };
1462
1456
  this.stampCreateOauthProviders = async (input, stampWith) => {
1463
1457
  const activeStamper = this.getStamper(stampWith);
@@ -1471,7 +1465,7 @@ class TurnkeySDKClientBase {
1471
1465
  parameters,
1472
1466
  organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
1473
1467
  timestampMs: timestampMs ?? String(Date.now()),
1474
- type: "ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS",
1468
+ type: "ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS_V2",
1475
1469
  };
1476
1470
  const stringifiedBody = JSON.stringify(bodyWithType);
1477
1471
  const stamp = await activeStamper.stamp(stringifiedBody);
@@ -1661,7 +1655,7 @@ class TurnkeySDKClientBase {
1661
1655
  this.config.organizationId,
1662
1656
  timestampMs: timestampMs ?? String(Date.now()),
1663
1657
  type: "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2",
1664
- }, "createReadWriteSessionResult", stampWith);
1658
+ }, "createReadWriteSessionResultV2", stampWith);
1665
1659
  };
1666
1660
  this.stampCreateReadWriteSession = async (input, stampWith) => {
1667
1661
  const activeStamper = this.getStamper(stampWith);
@@ -1729,8 +1723,8 @@ class TurnkeySDKClientBase {
1729
1723
  session?.organizationId ??
1730
1724
  this.config.organizationId,
1731
1725
  timestampMs: timestampMs ?? String(Date.now()),
1732
- type: "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7",
1733
- }, "createSubOrganizationResultV7", stampWith);
1726
+ type: "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V8",
1727
+ }, "createSubOrganizationResultV8", stampWith);
1734
1728
  };
1735
1729
  this.stampCreateSubOrganization = async (input, stampWith) => {
1736
1730
  const activeStamper = this.getStamper(stampWith);
@@ -1744,7 +1738,7 @@ class TurnkeySDKClientBase {
1744
1738
  parameters,
1745
1739
  organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
1746
1740
  timestampMs: timestampMs ?? String(Date.now()),
1747
- type: "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7",
1741
+ type: "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V8",
1748
1742
  };
1749
1743
  const stringifiedBody = JSON.stringify(bodyWithType);
1750
1744
  const stamp = await activeStamper.stamp(stringifiedBody);
@@ -1797,7 +1791,7 @@ class TurnkeySDKClientBase {
1797
1791
  session?.organizationId ??
1798
1792
  this.config.organizationId,
1799
1793
  timestampMs: timestampMs ?? String(Date.now()),
1800
- type: "ACTIVITY_TYPE_CREATE_USERS_V3",
1794
+ type: "ACTIVITY_TYPE_CREATE_USERS_V4",
1801
1795
  }, "createUsersResult", stampWith);
1802
1796
  };
1803
1797
  this.stampCreateUsers = async (input, stampWith) => {
@@ -1812,7 +1806,7 @@ class TurnkeySDKClientBase {
1812
1806
  parameters,
1813
1807
  organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
1814
1808
  timestampMs: timestampMs ?? String(Date.now()),
1815
- type: "ACTIVITY_TYPE_CREATE_USERS_V3",
1809
+ type: "ACTIVITY_TYPE_CREATE_USERS_V4",
1816
1810
  };
1817
1811
  const stringifiedBody = JSON.stringify(bodyWithType);
1818
1812
  const stamp = await activeStamper.stamp(stringifiedBody);
@@ -2853,8 +2847,8 @@ class TurnkeySDKClientBase {
2853
2847
  session?.organizationId ??
2854
2848
  this.config.organizationId,
2855
2849
  timestampMs: timestampMs ?? String(Date.now()),
2856
- type: "ACTIVITY_TYPE_INIT_OTP_V2",
2857
- }, "initOtpResult", stampWith);
2850
+ type: "ACTIVITY_TYPE_INIT_OTP_V3",
2851
+ }, "initOtpResultV2", stampWith);
2858
2852
  };
2859
2853
  this.stampInitOtp = async (input, stampWith) => {
2860
2854
  const activeStamper = this.getStamper(stampWith);
@@ -2868,7 +2862,7 @@ class TurnkeySDKClientBase {
2868
2862
  parameters,
2869
2863
  organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
2870
2864
  timestampMs: timestampMs ?? String(Date.now()),
2871
- type: "ACTIVITY_TYPE_INIT_OTP_V2",
2865
+ type: "ACTIVITY_TYPE_INIT_OTP_V3",
2872
2866
  };
2873
2867
  const stringifiedBody = JSON.stringify(bodyWithType);
2874
2868
  const stamp = await activeStamper.stamp(stringifiedBody);
@@ -3184,6 +3178,40 @@ class TurnkeySDKClientBase {
3184
3178
  url: fullUrl,
3185
3179
  };
3186
3180
  };
3181
+ this.removeIpAllowlist = async (input, stampWith) => {
3182
+ const { organizationId, timestampMs, ...rest } = input;
3183
+ const session = await this.storageManager?.getActiveSession();
3184
+ return this.activity("/public/v1/submit/remove_ip_allowlist", {
3185
+ parameters: rest,
3186
+ organizationId: organizationId ??
3187
+ session?.organizationId ??
3188
+ this.config.organizationId,
3189
+ timestampMs: timestampMs ?? String(Date.now()),
3190
+ type: "ACTIVITY_TYPE_REMOVE_IP_ALLOWLIST",
3191
+ }, "removeIpAllowlistResult", stampWith);
3192
+ };
3193
+ this.stampRemoveIpAllowlist = async (input, stampWith) => {
3194
+ const activeStamper = this.getStamper(stampWith);
3195
+ if (!activeStamper) {
3196
+ return undefined;
3197
+ }
3198
+ const { organizationId, timestampMs, ...parameters } = input;
3199
+ const session = await this.storageManager?.getActiveSession();
3200
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/remove_ip_allowlist";
3201
+ const bodyWithType = {
3202
+ parameters,
3203
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
3204
+ timestampMs: timestampMs ?? String(Date.now()),
3205
+ type: "ACTIVITY_TYPE_REMOVE_IP_ALLOWLIST",
3206
+ };
3207
+ const stringifiedBody = JSON.stringify(bodyWithType);
3208
+ const stamp = await activeStamper.stamp(stringifiedBody);
3209
+ return {
3210
+ body: stringifiedBody,
3211
+ stamp: stamp,
3212
+ url: fullUrl,
3213
+ };
3214
+ };
3187
3215
  this.removeOrganizationFeature = async (input, stampWith) => {
3188
3216
  const { organizationId, timestampMs, ...rest } = input;
3189
3217
  const session = await this.storageManager?.getActiveSession();
@@ -3218,6 +3246,40 @@ class TurnkeySDKClientBase {
3218
3246
  url: fullUrl,
3219
3247
  };
3220
3248
  };
3249
+ this.setIpAllowlist = async (input, stampWith) => {
3250
+ const { organizationId, timestampMs, ...rest } = input;
3251
+ const session = await this.storageManager?.getActiveSession();
3252
+ return this.activity("/public/v1/submit/set_ip_allowlist", {
3253
+ parameters: rest,
3254
+ organizationId: organizationId ??
3255
+ session?.organizationId ??
3256
+ this.config.organizationId,
3257
+ timestampMs: timestampMs ?? String(Date.now()),
3258
+ type: "ACTIVITY_TYPE_SET_IP_ALLOWLIST",
3259
+ }, "setIpAllowlistResult", stampWith);
3260
+ };
3261
+ this.stampSetIpAllowlist = async (input, stampWith) => {
3262
+ const activeStamper = this.getStamper(stampWith);
3263
+ if (!activeStamper) {
3264
+ return undefined;
3265
+ }
3266
+ const { organizationId, timestampMs, ...parameters } = input;
3267
+ const session = await this.storageManager?.getActiveSession();
3268
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/set_ip_allowlist";
3269
+ const bodyWithType = {
3270
+ parameters,
3271
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
3272
+ timestampMs: timestampMs ?? String(Date.now()),
3273
+ type: "ACTIVITY_TYPE_SET_IP_ALLOWLIST",
3274
+ };
3275
+ const stringifiedBody = JSON.stringify(bodyWithType);
3276
+ const stamp = await activeStamper.stamp(stringifiedBody);
3277
+ return {
3278
+ body: stringifiedBody,
3279
+ stamp: stamp,
3280
+ url: fullUrl,
3281
+ };
3282
+ };
3221
3283
  this.setOrganizationFeature = async (input, stampWith) => {
3222
3284
  const { organizationId, timestampMs, ...rest } = input;
3223
3285
  const session = await this.storageManager?.getActiveSession();