@turnkey/sdk-browser 5.16.0 → 6.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.
@@ -257,6 +257,37 @@ class TurnkeySDKClientBase {
257
257
  url: fullUrl,
258
258
  };
259
259
  };
260
+ this.getIpAllowlist = async (input) => {
261
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
262
+ const session = sessionData ? utils.parseSession(sessionData) : null;
263
+ return this.request("/public/v1/query/get_ip_allowlist", {
264
+ ...input,
265
+ organizationId: input.organizationId ??
266
+ session?.organizationId ??
267
+ this.config.organizationId,
268
+ });
269
+ };
270
+ this.stampGetIpAllowlist = async (input) => {
271
+ if (!this.stamper) {
272
+ return undefined;
273
+ }
274
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
275
+ const session = sessionData ? utils.parseSession(sessionData) : null;
276
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_ip_allowlist";
277
+ const body = {
278
+ ...input,
279
+ organizationId: input.organizationId ??
280
+ session?.organizationId ??
281
+ this.config.organizationId,
282
+ };
283
+ const stringifiedBody = JSON.stringify(body);
284
+ const stamp = await this.stamper.stamp(stringifiedBody);
285
+ return {
286
+ body: stringifiedBody,
287
+ stamp: stamp,
288
+ url: fullUrl,
289
+ };
290
+ };
260
291
  this.getLatestBootProof = async (input) => {
261
292
  const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
262
293
  const session = sessionData ? utils.parseSession(sessionData) : null;
@@ -1318,41 +1349,6 @@ class TurnkeySDKClientBase {
1318
1349
  url: fullUrl,
1319
1350
  };
1320
1351
  };
1321
- this.createApiOnlyUsers = async (input) => {
1322
- const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
1323
- const session = sessionData ? utils.parseSession(sessionData) : null;
1324
- const { organizationId, timestampMs, ...rest } = input;
1325
- return this.command("/public/v1/submit/create_api_only_users", {
1326
- parameters: rest,
1327
- organizationId: organizationId ??
1328
- session?.organizationId ??
1329
- this.config.organizationId,
1330
- timestampMs: timestampMs ?? String(Date.now()),
1331
- type: "ACTIVITY_TYPE_CREATE_API_ONLY_USERS",
1332
- }, "createApiOnlyUsersResult");
1333
- };
1334
- this.stampCreateApiOnlyUsers = async (input) => {
1335
- if (!this.stamper) {
1336
- return undefined;
1337
- }
1338
- const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
1339
- const session = sessionData ? utils.parseSession(sessionData) : null;
1340
- const { organizationId, timestampMs, ...parameters } = input;
1341
- const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_api_only_users";
1342
- const bodyWithType = {
1343
- parameters,
1344
- organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
1345
- timestampMs: timestampMs ?? String(Date.now()),
1346
- type: "ACTIVITY_TYPE_CREATE_API_ONLY_USERS",
1347
- };
1348
- const stringifiedBody = JSON.stringify(bodyWithType);
1349
- const stamp = await this.stamper.stamp(stringifiedBody);
1350
- return {
1351
- body: stringifiedBody,
1352
- stamp: stamp,
1353
- url: fullUrl,
1354
- };
1355
- };
1356
1352
  this.createAuthenticators = async (input) => {
1357
1353
  const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
1358
1354
  const session = sessionData ? utils.parseSession(sessionData) : null;
@@ -1504,8 +1500,8 @@ class TurnkeySDKClientBase {
1504
1500
  session?.organizationId ??
1505
1501
  this.config.organizationId,
1506
1502
  timestampMs: timestampMs ?? String(Date.now()),
1507
- type: "ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS",
1508
- }, "createOauthProvidersResult");
1503
+ type: "ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS_V2",
1504
+ }, "createOauthProvidersResultV2");
1509
1505
  };
1510
1506
  this.stampCreateOauthProviders = async (input) => {
1511
1507
  if (!this.stamper) {
@@ -1519,7 +1515,7 @@ class TurnkeySDKClientBase {
1519
1515
  parameters,
1520
1516
  organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
1521
1517
  timestampMs: timestampMs ?? String(Date.now()),
1522
- type: "ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS",
1518
+ type: "ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS_V2",
1523
1519
  };
1524
1520
  const stringifiedBody = JSON.stringify(bodyWithType);
1525
1521
  const stamp = await this.stamper.stamp(stringifiedBody);
@@ -1785,8 +1781,8 @@ class TurnkeySDKClientBase {
1785
1781
  session?.organizationId ??
1786
1782
  this.config.organizationId,
1787
1783
  timestampMs: timestampMs ?? String(Date.now()),
1788
- type: "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7",
1789
- }, "createSubOrganizationResultV7");
1784
+ type: "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V8",
1785
+ }, "createSubOrganizationResultV8");
1790
1786
  };
1791
1787
  this.stampCreateSubOrganization = async (input) => {
1792
1788
  if (!this.stamper) {
@@ -1800,7 +1796,7 @@ class TurnkeySDKClientBase {
1800
1796
  parameters,
1801
1797
  organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
1802
1798
  timestampMs: timestampMs ?? String(Date.now()),
1803
- type: "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7",
1799
+ type: "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V8",
1804
1800
  };
1805
1801
  const stringifiedBody = JSON.stringify(bodyWithType);
1806
1802
  const stamp = await this.stamper.stamp(stringifiedBody);
@@ -1855,7 +1851,7 @@ class TurnkeySDKClientBase {
1855
1851
  session?.organizationId ??
1856
1852
  this.config.organizationId,
1857
1853
  timestampMs: timestampMs ?? String(Date.now()),
1858
- type: "ACTIVITY_TYPE_CREATE_USERS_V3",
1854
+ type: "ACTIVITY_TYPE_CREATE_USERS_V4",
1859
1855
  }, "createUsersResult");
1860
1856
  };
1861
1857
  this.stampCreateUsers = async (input) => {
@@ -1870,7 +1866,7 @@ class TurnkeySDKClientBase {
1870
1866
  parameters,
1871
1867
  organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
1872
1868
  timestampMs: timestampMs ?? String(Date.now()),
1873
- type: "ACTIVITY_TYPE_CREATE_USERS_V3",
1869
+ type: "ACTIVITY_TYPE_CREATE_USERS_V4",
1874
1870
  };
1875
1871
  const stringifiedBody = JSON.stringify(bodyWithType);
1876
1872
  const stamp = await this.stamper.stamp(stringifiedBody);
@@ -2942,8 +2938,8 @@ class TurnkeySDKClientBase {
2942
2938
  session?.organizationId ??
2943
2939
  this.config.organizationId,
2944
2940
  timestampMs: timestampMs ?? String(Date.now()),
2945
- type: "ACTIVITY_TYPE_INIT_OTP_V2",
2946
- }, "initOtpResult");
2941
+ type: "ACTIVITY_TYPE_INIT_OTP_V3",
2942
+ }, "initOtpResultV2");
2947
2943
  };
2948
2944
  this.stampInitOtp = async (input) => {
2949
2945
  if (!this.stamper) {
@@ -2957,7 +2953,7 @@ class TurnkeySDKClientBase {
2957
2953
  parameters,
2958
2954
  organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
2959
2955
  timestampMs: timestampMs ?? String(Date.now()),
2960
- type: "ACTIVITY_TYPE_INIT_OTP_V2",
2956
+ type: "ACTIVITY_TYPE_INIT_OTP_V3",
2961
2957
  };
2962
2958
  const stringifiedBody = JSON.stringify(bodyWithType);
2963
2959
  const stamp = await this.stamper.stamp(stringifiedBody);
@@ -3187,7 +3183,7 @@ class TurnkeySDKClientBase {
3187
3183
  session?.organizationId ??
3188
3184
  this.config.organizationId,
3189
3185
  timestampMs: timestampMs ?? String(Date.now()),
3190
- type: "ACTIVITY_TYPE_OTP_LOGIN",
3186
+ type: "ACTIVITY_TYPE_OTP_LOGIN_V2",
3191
3187
  }, "otpLoginResult");
3192
3188
  };
3193
3189
  this.stampOtpLogin = async (input) => {
@@ -3202,7 +3198,7 @@ class TurnkeySDKClientBase {
3202
3198
  parameters,
3203
3199
  organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
3204
3200
  timestampMs: timestampMs ?? String(Date.now()),
3205
- type: "ACTIVITY_TYPE_OTP_LOGIN",
3201
+ type: "ACTIVITY_TYPE_OTP_LOGIN_V2",
3206
3202
  };
3207
3203
  const stringifiedBody = JSON.stringify(bodyWithType);
3208
3204
  const stamp = await this.stamper.stamp(stringifiedBody);
@@ -3280,6 +3276,41 @@ class TurnkeySDKClientBase {
3280
3276
  url: fullUrl,
3281
3277
  };
3282
3278
  };
3279
+ this.removeIpAllowlist = async (input) => {
3280
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
3281
+ const session = sessionData ? utils.parseSession(sessionData) : null;
3282
+ const { organizationId, timestampMs, ...rest } = input;
3283
+ return this.command("/public/v1/submit/remove_ip_allowlist", {
3284
+ parameters: rest,
3285
+ organizationId: organizationId ??
3286
+ session?.organizationId ??
3287
+ this.config.organizationId,
3288
+ timestampMs: timestampMs ?? String(Date.now()),
3289
+ type: "ACTIVITY_TYPE_REMOVE_IP_ALLOWLIST",
3290
+ }, "removeIpAllowlistResult");
3291
+ };
3292
+ this.stampRemoveIpAllowlist = async (input) => {
3293
+ if (!this.stamper) {
3294
+ return undefined;
3295
+ }
3296
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
3297
+ const session = sessionData ? utils.parseSession(sessionData) : null;
3298
+ const { organizationId, timestampMs, ...parameters } = input;
3299
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/remove_ip_allowlist";
3300
+ const bodyWithType = {
3301
+ parameters,
3302
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
3303
+ timestampMs: timestampMs ?? String(Date.now()),
3304
+ type: "ACTIVITY_TYPE_REMOVE_IP_ALLOWLIST",
3305
+ };
3306
+ const stringifiedBody = JSON.stringify(bodyWithType);
3307
+ const stamp = await this.stamper.stamp(stringifiedBody);
3308
+ return {
3309
+ body: stringifiedBody,
3310
+ stamp: stamp,
3311
+ url: fullUrl,
3312
+ };
3313
+ };
3283
3314
  this.removeOrganizationFeature = async (input) => {
3284
3315
  const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
3285
3316
  const session = sessionData ? utils.parseSession(sessionData) : null;
@@ -3315,6 +3346,41 @@ class TurnkeySDKClientBase {
3315
3346
  url: fullUrl,
3316
3347
  };
3317
3348
  };
3349
+ this.setIpAllowlist = async (input) => {
3350
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
3351
+ const session = sessionData ? utils.parseSession(sessionData) : null;
3352
+ const { organizationId, timestampMs, ...rest } = input;
3353
+ return this.command("/public/v1/submit/set_ip_allowlist", {
3354
+ parameters: rest,
3355
+ organizationId: organizationId ??
3356
+ session?.organizationId ??
3357
+ this.config.organizationId,
3358
+ timestampMs: timestampMs ?? String(Date.now()),
3359
+ type: "ACTIVITY_TYPE_SET_IP_ALLOWLIST",
3360
+ }, "setIpAllowlistResult");
3361
+ };
3362
+ this.stampSetIpAllowlist = async (input) => {
3363
+ if (!this.stamper) {
3364
+ return undefined;
3365
+ }
3366
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
3367
+ const session = sessionData ? utils.parseSession(sessionData) : null;
3368
+ const { organizationId, timestampMs, ...parameters } = input;
3369
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/set_ip_allowlist";
3370
+ const bodyWithType = {
3371
+ parameters,
3372
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
3373
+ timestampMs: timestampMs ?? String(Date.now()),
3374
+ type: "ACTIVITY_TYPE_SET_IP_ALLOWLIST",
3375
+ };
3376
+ const stringifiedBody = JSON.stringify(bodyWithType);
3377
+ const stamp = await this.stamper.stamp(stringifiedBody);
3378
+ return {
3379
+ body: stringifiedBody,
3380
+ stamp: stamp,
3381
+ url: fullUrl,
3382
+ };
3383
+ };
3318
3384
  this.setOrganizationFeature = async (input) => {
3319
3385
  const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
3320
3386
  const session = sessionData ? utils.parseSession(sessionData) : null;
@@ -3991,7 +4057,7 @@ class TurnkeySDKClientBase {
3991
4057
  session?.organizationId ??
3992
4058
  this.config.organizationId,
3993
4059
  timestampMs: timestampMs ?? String(Date.now()),
3994
- type: "ACTIVITY_TYPE_VERIFY_OTP",
4060
+ type: "ACTIVITY_TYPE_VERIFY_OTP_V2",
3995
4061
  }, "verifyOtpResult");
3996
4062
  };
3997
4063
  this.stampVerifyOtp = async (input) => {
@@ -4006,7 +4072,7 @@ class TurnkeySDKClientBase {
4006
4072
  parameters,
4007
4073
  organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
4008
4074
  timestampMs: timestampMs ?? String(Date.now()),
4009
- type: "ACTIVITY_TYPE_VERIFY_OTP",
4075
+ type: "ACTIVITY_TYPE_VERIFY_OTP_V2",
4010
4076
  };
4011
4077
  const stringifiedBody = JSON.stringify(bodyWithType);
4012
4078
  const stamp = await this.stamper.stamp(stringifiedBody);