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