@turnkey/core 1.12.0 → 1.14.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.
@@ -99,6 +99,36 @@ class TurnkeySDKClientBase {
99
99
  url: fullUrl,
100
100
  };
101
101
  };
102
+ this.getAppStatus = async (input, stampWith) => {
103
+ const session = await this.storageManager?.getActiveSession();
104
+ return this.request("/public/v1/query/get_app_status", {
105
+ ...input,
106
+ organizationId: input.organizationId ??
107
+ session?.organizationId ??
108
+ this.config.organizationId,
109
+ }, stampWith);
110
+ };
111
+ this.stampGetAppStatus = async (input, stampWith) => {
112
+ const activeStamper = this.getStamper(stampWith);
113
+ if (!activeStamper) {
114
+ return undefined;
115
+ }
116
+ const session = await this.storageManager?.getActiveSession();
117
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_app_status";
118
+ const body = {
119
+ ...input,
120
+ organizationId: input.organizationId ??
121
+ session?.organizationId ??
122
+ this.config.organizationId,
123
+ };
124
+ const stringifiedBody = JSON.stringify(body);
125
+ const stamp = await activeStamper.stamp(stringifiedBody);
126
+ return {
127
+ body: stringifiedBody,
128
+ stamp: stamp,
129
+ url: fullUrl,
130
+ };
131
+ };
102
132
  this.getAuthenticator = async (input, stampWith) => {
103
133
  const session = await this.storageManager?.getActiveSession();
104
134
  return this.request("/public/v1/query/get_authenticator", {
@@ -1120,6 +1150,36 @@ class TurnkeySDKClientBase {
1120
1150
  url: fullUrl,
1121
1151
  };
1122
1152
  };
1153
+ this.listWebhookEndpoints = async (input, stampWith) => {
1154
+ const session = await this.storageManager?.getActiveSession();
1155
+ return this.request("/public/v1/query/list_webhook_endpoints", {
1156
+ ...input,
1157
+ organizationId: input.organizationId ??
1158
+ session?.organizationId ??
1159
+ this.config.organizationId,
1160
+ }, stampWith);
1161
+ };
1162
+ this.stampListWebhookEndpoints = async (input, stampWith) => {
1163
+ const activeStamper = this.getStamper(stampWith);
1164
+ if (!activeStamper) {
1165
+ return undefined;
1166
+ }
1167
+ const session = await this.storageManager?.getActiveSession();
1168
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_webhook_endpoints";
1169
+ const body = {
1170
+ ...input,
1171
+ organizationId: input.organizationId ??
1172
+ session?.organizationId ??
1173
+ this.config.organizationId,
1174
+ };
1175
+ const stringifiedBody = JSON.stringify(body);
1176
+ const stamp = await activeStamper.stamp(stringifiedBody);
1177
+ return {
1178
+ body: stringifiedBody,
1179
+ stamp: stamp,
1180
+ url: fullUrl,
1181
+ };
1182
+ };
1123
1183
  this.getWhoami = async (input = {}, stampWith) => {
1124
1184
  const session = await this.storageManager?.getActiveSession();
1125
1185
  return this.request("/public/v1/query/whoami", {
@@ -1218,6 +1278,40 @@ class TurnkeySDKClientBase {
1218
1278
  url: fullUrl,
1219
1279
  };
1220
1280
  };
1281
+ this.createApiOnlyUsers = async (input, stampWith) => {
1282
+ const { organizationId, timestampMs, ...rest } = input;
1283
+ const session = await this.storageManager?.getActiveSession();
1284
+ return this.activity("/public/v1/submit/create_api_only_users", {
1285
+ parameters: rest,
1286
+ organizationId: organizationId ??
1287
+ session?.organizationId ??
1288
+ this.config.organizationId,
1289
+ timestampMs: timestampMs ?? String(Date.now()),
1290
+ type: "ACTIVITY_TYPE_CREATE_API_ONLY_USERS",
1291
+ }, "createApiOnlyUsersResult", stampWith);
1292
+ };
1293
+ this.stampCreateApiOnlyUsers = async (input, stampWith) => {
1294
+ const activeStamper = this.getStamper(stampWith);
1295
+ if (!activeStamper) {
1296
+ return undefined;
1297
+ }
1298
+ const { organizationId, timestampMs, ...parameters } = input;
1299
+ const session = await this.storageManager?.getActiveSession();
1300
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_api_only_users";
1301
+ const bodyWithType = {
1302
+ parameters,
1303
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
1304
+ timestampMs: timestampMs ?? String(Date.now()),
1305
+ type: "ACTIVITY_TYPE_CREATE_API_ONLY_USERS",
1306
+ };
1307
+ const stringifiedBody = JSON.stringify(bodyWithType);
1308
+ const stamp = await activeStamper.stamp(stringifiedBody);
1309
+ return {
1310
+ body: stringifiedBody,
1311
+ stamp: stamp,
1312
+ url: fullUrl,
1313
+ };
1314
+ };
1221
1315
  this.createAuthenticators = async (input, stampWith) => {
1222
1316
  const { organizationId, timestampMs, ...rest } = input;
1223
1317
  const session = await this.storageManager?.getActiveSession();
@@ -1569,7 +1663,7 @@ class TurnkeySDKClientBase {
1569
1663
  this.config.organizationId,
1570
1664
  timestampMs: timestampMs ?? String(Date.now()),
1571
1665
  type: "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2",
1572
- }, "createReadWriteSessionResultV2", stampWith);
1666
+ }, "createReadWriteSessionResult", stampWith);
1573
1667
  };
1574
1668
  this.stampCreateReadWriteSession = async (input, stampWith) => {
1575
1669
  const activeStamper = this.getStamper(stampWith);
@@ -1798,6 +1892,40 @@ class TurnkeySDKClientBase {
1798
1892
  url: fullUrl,
1799
1893
  };
1800
1894
  };
1895
+ this.createWebhookEndpoint = async (input, stampWith) => {
1896
+ const { organizationId, timestampMs, ...rest } = input;
1897
+ const session = await this.storageManager?.getActiveSession();
1898
+ return this.activity("/public/v1/submit/create_webhook_endpoint", {
1899
+ parameters: rest,
1900
+ organizationId: organizationId ??
1901
+ session?.organizationId ??
1902
+ this.config.organizationId,
1903
+ timestampMs: timestampMs ?? String(Date.now()),
1904
+ type: "ACTIVITY_TYPE_CREATE_WEBHOOK_ENDPOINT",
1905
+ }, "createWebhookEndpointResult", stampWith);
1906
+ };
1907
+ this.stampCreateWebhookEndpoint = async (input, stampWith) => {
1908
+ const activeStamper = this.getStamper(stampWith);
1909
+ if (!activeStamper) {
1910
+ return undefined;
1911
+ }
1912
+ const { organizationId, timestampMs, ...parameters } = input;
1913
+ const session = await this.storageManager?.getActiveSession();
1914
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_webhook_endpoint";
1915
+ const bodyWithType = {
1916
+ parameters,
1917
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
1918
+ timestampMs: timestampMs ?? String(Date.now()),
1919
+ type: "ACTIVITY_TYPE_CREATE_WEBHOOK_ENDPOINT",
1920
+ };
1921
+ const stringifiedBody = JSON.stringify(bodyWithType);
1922
+ const stamp = await activeStamper.stamp(stringifiedBody);
1923
+ return {
1924
+ body: stringifiedBody,
1925
+ stamp: stamp,
1926
+ url: fullUrl,
1927
+ };
1928
+ };
1801
1929
  this.deleteApiKeys = async (input, stampWith) => {
1802
1930
  const { organizationId, timestampMs, ...rest } = input;
1803
1931
  const session = await this.storageManager?.getActiveSession();
@@ -2344,6 +2472,40 @@ class TurnkeySDKClientBase {
2344
2472
  url: fullUrl,
2345
2473
  };
2346
2474
  };
2475
+ this.deleteWebhookEndpoint = async (input, stampWith) => {
2476
+ const { organizationId, timestampMs, ...rest } = input;
2477
+ const session = await this.storageManager?.getActiveSession();
2478
+ return this.activity("/public/v1/submit/delete_webhook_endpoint", {
2479
+ parameters: rest,
2480
+ organizationId: organizationId ??
2481
+ session?.organizationId ??
2482
+ this.config.organizationId,
2483
+ timestampMs: timestampMs ?? String(Date.now()),
2484
+ type: "ACTIVITY_TYPE_DELETE_WEBHOOK_ENDPOINT",
2485
+ }, "deleteWebhookEndpointResult", stampWith);
2486
+ };
2487
+ this.stampDeleteWebhookEndpoint = async (input, stampWith) => {
2488
+ const activeStamper = this.getStamper(stampWith);
2489
+ if (!activeStamper) {
2490
+ return undefined;
2491
+ }
2492
+ const { organizationId, timestampMs, ...parameters } = input;
2493
+ const session = await this.storageManager?.getActiveSession();
2494
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/delete_webhook_endpoint";
2495
+ const bodyWithType = {
2496
+ parameters,
2497
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
2498
+ timestampMs: timestampMs ?? String(Date.now()),
2499
+ type: "ACTIVITY_TYPE_DELETE_WEBHOOK_ENDPOINT",
2500
+ };
2501
+ const stringifiedBody = JSON.stringify(bodyWithType);
2502
+ const stamp = await activeStamper.stamp(stringifiedBody);
2503
+ return {
2504
+ body: stringifiedBody,
2505
+ stamp: stamp,
2506
+ url: fullUrl,
2507
+ };
2508
+ };
2347
2509
  this.emailAuth = async (input, stampWith) => {
2348
2510
  const { organizationId, timestampMs, ...rest } = input;
2349
2511
  const session = await this.storageManager?.getActiveSession();
@@ -3331,6 +3493,40 @@ class TurnkeySDKClientBase {
3331
3493
  url: fullUrl,
3332
3494
  };
3333
3495
  };
3496
+ this.updateOrganizationName = async (input, stampWith) => {
3497
+ const { organizationId, timestampMs, ...rest } = input;
3498
+ const session = await this.storageManager?.getActiveSession();
3499
+ return this.activity("/public/v1/submit/update_organization_name", {
3500
+ parameters: rest,
3501
+ organizationId: organizationId ??
3502
+ session?.organizationId ??
3503
+ this.config.organizationId,
3504
+ timestampMs: timestampMs ?? String(Date.now()),
3505
+ type: "ACTIVITY_TYPE_UPDATE_ORGANIZATION_NAME",
3506
+ }, "updateOrganizationNameResult", stampWith);
3507
+ };
3508
+ this.stampUpdateOrganizationName = async (input, stampWith) => {
3509
+ const activeStamper = this.getStamper(stampWith);
3510
+ if (!activeStamper) {
3511
+ return undefined;
3512
+ }
3513
+ const { organizationId, timestampMs, ...parameters } = input;
3514
+ const session = await this.storageManager?.getActiveSession();
3515
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/update_organization_name";
3516
+ const bodyWithType = {
3517
+ parameters,
3518
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
3519
+ timestampMs: timestampMs ?? String(Date.now()),
3520
+ type: "ACTIVITY_TYPE_UPDATE_ORGANIZATION_NAME",
3521
+ };
3522
+ const stringifiedBody = JSON.stringify(bodyWithType);
3523
+ const stamp = await activeStamper.stamp(stringifiedBody);
3524
+ return {
3525
+ body: stringifiedBody,
3526
+ stamp: stamp,
3527
+ url: fullUrl,
3528
+ };
3529
+ };
3334
3530
  this.updatePolicy = async (input, stampWith) => {
3335
3531
  const { organizationId, timestampMs, ...rest } = input;
3336
3532
  const session = await this.storageManager?.getActiveSession();
@@ -3637,6 +3833,40 @@ class TurnkeySDKClientBase {
3637
3833
  url: fullUrl,
3638
3834
  };
3639
3835
  };
3836
+ this.updateWebhookEndpoint = async (input, stampWith) => {
3837
+ const { organizationId, timestampMs, ...rest } = input;
3838
+ const session = await this.storageManager?.getActiveSession();
3839
+ return this.activity("/public/v1/submit/update_webhook_endpoint", {
3840
+ parameters: rest,
3841
+ organizationId: organizationId ??
3842
+ session?.organizationId ??
3843
+ this.config.organizationId,
3844
+ timestampMs: timestampMs ?? String(Date.now()),
3845
+ type: "ACTIVITY_TYPE_UPDATE_WEBHOOK_ENDPOINT",
3846
+ }, "updateWebhookEndpointResult", stampWith);
3847
+ };
3848
+ this.stampUpdateWebhookEndpoint = async (input, stampWith) => {
3849
+ const activeStamper = this.getStamper(stampWith);
3850
+ if (!activeStamper) {
3851
+ return undefined;
3852
+ }
3853
+ const { organizationId, timestampMs, ...parameters } = input;
3854
+ const session = await this.storageManager?.getActiveSession();
3855
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/update_webhook_endpoint";
3856
+ const bodyWithType = {
3857
+ parameters,
3858
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
3859
+ timestampMs: timestampMs ?? String(Date.now()),
3860
+ type: "ACTIVITY_TYPE_UPDATE_WEBHOOK_ENDPOINT",
3861
+ };
3862
+ const stringifiedBody = JSON.stringify(bodyWithType);
3863
+ const stamp = await activeStamper.stamp(stringifiedBody);
3864
+ return {
3865
+ body: stringifiedBody,
3866
+ stamp: stamp,
3867
+ url: fullUrl,
3868
+ };
3869
+ };
3640
3870
  this.verifyOtp = async (input, stampWith) => {
3641
3871
  const { organizationId, timestampMs, ...rest } = input;
3642
3872
  const session = await this.storageManager?.getActiveSession();
@@ -3683,15 +3913,27 @@ class TurnkeySDKClientBase {
3683
3913
  this.proxyInitOtp = async (input) => {
3684
3914
  return this.authProxyRequest("/v1/otp_init", input);
3685
3915
  };
3916
+ this.proxyInitOtpV2 = async (input) => {
3917
+ return this.authProxyRequest("/v1/otp_init_v2", input);
3918
+ };
3686
3919
  this.proxyOtpLogin = async (input) => {
3687
3920
  return this.authProxyRequest("/v1/otp_login", input);
3688
3921
  };
3922
+ this.proxyOtpLoginV2 = async (input) => {
3923
+ return this.authProxyRequest("/v1/otp_login_v2", input);
3924
+ };
3689
3925
  this.proxyVerifyOtp = async (input) => {
3690
3926
  return this.authProxyRequest("/v1/otp_verify", input);
3691
3927
  };
3928
+ this.proxyVerifyOtpV2 = async (input) => {
3929
+ return this.authProxyRequest("/v1/otp_verify_v2", input);
3930
+ };
3692
3931
  this.proxySignup = async (input) => {
3693
3932
  return this.authProxyRequest("/v1/signup", input);
3694
3933
  };
3934
+ this.proxySignupV2 = async (input) => {
3935
+ return this.authProxyRequest("/v1/signup_v2", input);
3936
+ };
3695
3937
  this.proxyGetWalletKitConfig = async (input) => {
3696
3938
  return this.authProxyRequest("/v1/wallet_kit_config", input);
3697
3939
  };