@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.
@@ -97,6 +97,36 @@ class TurnkeySDKClientBase {
97
97
  url: fullUrl,
98
98
  };
99
99
  };
100
+ this.getAppStatus = async (input, stampWith) => {
101
+ const session = await this.storageManager?.getActiveSession();
102
+ return this.request("/public/v1/query/get_app_status", {
103
+ ...input,
104
+ organizationId: input.organizationId ??
105
+ session?.organizationId ??
106
+ this.config.organizationId,
107
+ }, stampWith);
108
+ };
109
+ this.stampGetAppStatus = async (input, stampWith) => {
110
+ const activeStamper = this.getStamper(stampWith);
111
+ if (!activeStamper) {
112
+ return undefined;
113
+ }
114
+ const session = await this.storageManager?.getActiveSession();
115
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_app_status";
116
+ const body = {
117
+ ...input,
118
+ organizationId: input.organizationId ??
119
+ session?.organizationId ??
120
+ this.config.organizationId,
121
+ };
122
+ const stringifiedBody = JSON.stringify(body);
123
+ const stamp = await activeStamper.stamp(stringifiedBody);
124
+ return {
125
+ body: stringifiedBody,
126
+ stamp: stamp,
127
+ url: fullUrl,
128
+ };
129
+ };
100
130
  this.getAuthenticator = async (input, stampWith) => {
101
131
  const session = await this.storageManager?.getActiveSession();
102
132
  return this.request("/public/v1/query/get_authenticator", {
@@ -1118,6 +1148,36 @@ class TurnkeySDKClientBase {
1118
1148
  url: fullUrl,
1119
1149
  };
1120
1150
  };
1151
+ this.listWebhookEndpoints = async (input, stampWith) => {
1152
+ const session = await this.storageManager?.getActiveSession();
1153
+ return this.request("/public/v1/query/list_webhook_endpoints", {
1154
+ ...input,
1155
+ organizationId: input.organizationId ??
1156
+ session?.organizationId ??
1157
+ this.config.organizationId,
1158
+ }, stampWith);
1159
+ };
1160
+ this.stampListWebhookEndpoints = async (input, stampWith) => {
1161
+ const activeStamper = this.getStamper(stampWith);
1162
+ if (!activeStamper) {
1163
+ return undefined;
1164
+ }
1165
+ const session = await this.storageManager?.getActiveSession();
1166
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_webhook_endpoints";
1167
+ const body = {
1168
+ ...input,
1169
+ organizationId: input.organizationId ??
1170
+ session?.organizationId ??
1171
+ this.config.organizationId,
1172
+ };
1173
+ const stringifiedBody = JSON.stringify(body);
1174
+ const stamp = await activeStamper.stamp(stringifiedBody);
1175
+ return {
1176
+ body: stringifiedBody,
1177
+ stamp: stamp,
1178
+ url: fullUrl,
1179
+ };
1180
+ };
1121
1181
  this.getWhoami = async (input = {}, stampWith) => {
1122
1182
  const session = await this.storageManager?.getActiveSession();
1123
1183
  return this.request("/public/v1/query/whoami", {
@@ -1216,6 +1276,40 @@ class TurnkeySDKClientBase {
1216
1276
  url: fullUrl,
1217
1277
  };
1218
1278
  };
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
+ };
1219
1313
  this.createAuthenticators = async (input, stampWith) => {
1220
1314
  const { organizationId, timestampMs, ...rest } = input;
1221
1315
  const session = await this.storageManager?.getActiveSession();
@@ -1567,7 +1661,7 @@ class TurnkeySDKClientBase {
1567
1661
  this.config.organizationId,
1568
1662
  timestampMs: timestampMs ?? String(Date.now()),
1569
1663
  type: "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2",
1570
- }, "createReadWriteSessionResultV2", stampWith);
1664
+ }, "createReadWriteSessionResult", stampWith);
1571
1665
  };
1572
1666
  this.stampCreateReadWriteSession = async (input, stampWith) => {
1573
1667
  const activeStamper = this.getStamper(stampWith);
@@ -1796,6 +1890,40 @@ class TurnkeySDKClientBase {
1796
1890
  url: fullUrl,
1797
1891
  };
1798
1892
  };
1893
+ this.createWebhookEndpoint = async (input, stampWith) => {
1894
+ const { organizationId, timestampMs, ...rest } = input;
1895
+ const session = await this.storageManager?.getActiveSession();
1896
+ return this.activity("/public/v1/submit/create_webhook_endpoint", {
1897
+ parameters: rest,
1898
+ organizationId: organizationId ??
1899
+ session?.organizationId ??
1900
+ this.config.organizationId,
1901
+ timestampMs: timestampMs ?? String(Date.now()),
1902
+ type: "ACTIVITY_TYPE_CREATE_WEBHOOK_ENDPOINT",
1903
+ }, "createWebhookEndpointResult", stampWith);
1904
+ };
1905
+ this.stampCreateWebhookEndpoint = async (input, stampWith) => {
1906
+ const activeStamper = this.getStamper(stampWith);
1907
+ if (!activeStamper) {
1908
+ return undefined;
1909
+ }
1910
+ const { organizationId, timestampMs, ...parameters } = input;
1911
+ const session = await this.storageManager?.getActiveSession();
1912
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_webhook_endpoint";
1913
+ const bodyWithType = {
1914
+ parameters,
1915
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
1916
+ timestampMs: timestampMs ?? String(Date.now()),
1917
+ type: "ACTIVITY_TYPE_CREATE_WEBHOOK_ENDPOINT",
1918
+ };
1919
+ const stringifiedBody = JSON.stringify(bodyWithType);
1920
+ const stamp = await activeStamper.stamp(stringifiedBody);
1921
+ return {
1922
+ body: stringifiedBody,
1923
+ stamp: stamp,
1924
+ url: fullUrl,
1925
+ };
1926
+ };
1799
1927
  this.deleteApiKeys = async (input, stampWith) => {
1800
1928
  const { organizationId, timestampMs, ...rest } = input;
1801
1929
  const session = await this.storageManager?.getActiveSession();
@@ -2342,6 +2470,40 @@ class TurnkeySDKClientBase {
2342
2470
  url: fullUrl,
2343
2471
  };
2344
2472
  };
2473
+ this.deleteWebhookEndpoint = async (input, stampWith) => {
2474
+ const { organizationId, timestampMs, ...rest } = input;
2475
+ const session = await this.storageManager?.getActiveSession();
2476
+ return this.activity("/public/v1/submit/delete_webhook_endpoint", {
2477
+ parameters: rest,
2478
+ organizationId: organizationId ??
2479
+ session?.organizationId ??
2480
+ this.config.organizationId,
2481
+ timestampMs: timestampMs ?? String(Date.now()),
2482
+ type: "ACTIVITY_TYPE_DELETE_WEBHOOK_ENDPOINT",
2483
+ }, "deleteWebhookEndpointResult", stampWith);
2484
+ };
2485
+ this.stampDeleteWebhookEndpoint = async (input, stampWith) => {
2486
+ const activeStamper = this.getStamper(stampWith);
2487
+ if (!activeStamper) {
2488
+ return undefined;
2489
+ }
2490
+ const { organizationId, timestampMs, ...parameters } = input;
2491
+ const session = await this.storageManager?.getActiveSession();
2492
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/delete_webhook_endpoint";
2493
+ const bodyWithType = {
2494
+ parameters,
2495
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
2496
+ timestampMs: timestampMs ?? String(Date.now()),
2497
+ type: "ACTIVITY_TYPE_DELETE_WEBHOOK_ENDPOINT",
2498
+ };
2499
+ const stringifiedBody = JSON.stringify(bodyWithType);
2500
+ const stamp = await activeStamper.stamp(stringifiedBody);
2501
+ return {
2502
+ body: stringifiedBody,
2503
+ stamp: stamp,
2504
+ url: fullUrl,
2505
+ };
2506
+ };
2345
2507
  this.emailAuth = async (input, stampWith) => {
2346
2508
  const { organizationId, timestampMs, ...rest } = input;
2347
2509
  const session = await this.storageManager?.getActiveSession();
@@ -3329,6 +3491,40 @@ class TurnkeySDKClientBase {
3329
3491
  url: fullUrl,
3330
3492
  };
3331
3493
  };
3494
+ this.updateOrganizationName = async (input, stampWith) => {
3495
+ const { organizationId, timestampMs, ...rest } = input;
3496
+ const session = await this.storageManager?.getActiveSession();
3497
+ return this.activity("/public/v1/submit/update_organization_name", {
3498
+ parameters: rest,
3499
+ organizationId: organizationId ??
3500
+ session?.organizationId ??
3501
+ this.config.organizationId,
3502
+ timestampMs: timestampMs ?? String(Date.now()),
3503
+ type: "ACTIVITY_TYPE_UPDATE_ORGANIZATION_NAME",
3504
+ }, "updateOrganizationNameResult", stampWith);
3505
+ };
3506
+ this.stampUpdateOrganizationName = async (input, stampWith) => {
3507
+ const activeStamper = this.getStamper(stampWith);
3508
+ if (!activeStamper) {
3509
+ return undefined;
3510
+ }
3511
+ const { organizationId, timestampMs, ...parameters } = input;
3512
+ const session = await this.storageManager?.getActiveSession();
3513
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/update_organization_name";
3514
+ const bodyWithType = {
3515
+ parameters,
3516
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
3517
+ timestampMs: timestampMs ?? String(Date.now()),
3518
+ type: "ACTIVITY_TYPE_UPDATE_ORGANIZATION_NAME",
3519
+ };
3520
+ const stringifiedBody = JSON.stringify(bodyWithType);
3521
+ const stamp = await activeStamper.stamp(stringifiedBody);
3522
+ return {
3523
+ body: stringifiedBody,
3524
+ stamp: stamp,
3525
+ url: fullUrl,
3526
+ };
3527
+ };
3332
3528
  this.updatePolicy = async (input, stampWith) => {
3333
3529
  const { organizationId, timestampMs, ...rest } = input;
3334
3530
  const session = await this.storageManager?.getActiveSession();
@@ -3635,6 +3831,40 @@ class TurnkeySDKClientBase {
3635
3831
  url: fullUrl,
3636
3832
  };
3637
3833
  };
3834
+ this.updateWebhookEndpoint = async (input, stampWith) => {
3835
+ const { organizationId, timestampMs, ...rest } = input;
3836
+ const session = await this.storageManager?.getActiveSession();
3837
+ return this.activity("/public/v1/submit/update_webhook_endpoint", {
3838
+ parameters: rest,
3839
+ organizationId: organizationId ??
3840
+ session?.organizationId ??
3841
+ this.config.organizationId,
3842
+ timestampMs: timestampMs ?? String(Date.now()),
3843
+ type: "ACTIVITY_TYPE_UPDATE_WEBHOOK_ENDPOINT",
3844
+ }, "updateWebhookEndpointResult", stampWith);
3845
+ };
3846
+ this.stampUpdateWebhookEndpoint = async (input, stampWith) => {
3847
+ const activeStamper = this.getStamper(stampWith);
3848
+ if (!activeStamper) {
3849
+ return undefined;
3850
+ }
3851
+ const { organizationId, timestampMs, ...parameters } = input;
3852
+ const session = await this.storageManager?.getActiveSession();
3853
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/update_webhook_endpoint";
3854
+ const bodyWithType = {
3855
+ parameters,
3856
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
3857
+ timestampMs: timestampMs ?? String(Date.now()),
3858
+ type: "ACTIVITY_TYPE_UPDATE_WEBHOOK_ENDPOINT",
3859
+ };
3860
+ const stringifiedBody = JSON.stringify(bodyWithType);
3861
+ const stamp = await activeStamper.stamp(stringifiedBody);
3862
+ return {
3863
+ body: stringifiedBody,
3864
+ stamp: stamp,
3865
+ url: fullUrl,
3866
+ };
3867
+ };
3638
3868
  this.verifyOtp = async (input, stampWith) => {
3639
3869
  const { organizationId, timestampMs, ...rest } = input;
3640
3870
  const session = await this.storageManager?.getActiveSession();
@@ -3681,15 +3911,27 @@ class TurnkeySDKClientBase {
3681
3911
  this.proxyInitOtp = async (input) => {
3682
3912
  return this.authProxyRequest("/v1/otp_init", input);
3683
3913
  };
3914
+ this.proxyInitOtpV2 = async (input) => {
3915
+ return this.authProxyRequest("/v1/otp_init_v2", input);
3916
+ };
3684
3917
  this.proxyOtpLogin = async (input) => {
3685
3918
  return this.authProxyRequest("/v1/otp_login", input);
3686
3919
  };
3920
+ this.proxyOtpLoginV2 = async (input) => {
3921
+ return this.authProxyRequest("/v1/otp_login_v2", input);
3922
+ };
3687
3923
  this.proxyVerifyOtp = async (input) => {
3688
3924
  return this.authProxyRequest("/v1/otp_verify", input);
3689
3925
  };
3926
+ this.proxyVerifyOtpV2 = async (input) => {
3927
+ return this.authProxyRequest("/v1/otp_verify_v2", input);
3928
+ };
3690
3929
  this.proxySignup = async (input) => {
3691
3930
  return this.authProxyRequest("/v1/signup", input);
3692
3931
  };
3932
+ this.proxySignupV2 = async (input) => {
3933
+ return this.authProxyRequest("/v1/signup_v2", input);
3934
+ };
3693
3935
  this.proxyGetWalletKitConfig = async (input) => {
3694
3936
  return this.authProxyRequest("/v1/wallet_kit_config", input);
3695
3937
  };