@turnkey/core 1.13.0 → 1.14.1

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", {
@@ -1362,7 +1422,7 @@ class TurnkeySDKClientBase {
1362
1422
  session?.organizationId ??
1363
1423
  this.config.organizationId,
1364
1424
  timestampMs: timestampMs ?? String(Date.now()),
1365
- type: "ACTIVITY_TYPE_CREATE_OAUTH2CREDENTIAL",
1425
+ type: "ACTIVITY_TYPE_CREATE_OAUTH2_CREDENTIAL",
1366
1426
  }, "createOauth2CredentialResult", stampWith);
1367
1427
  };
1368
1428
  this.stampCreateOauth2Credential = async (input, stampWith) => {
@@ -1377,7 +1437,7 @@ class TurnkeySDKClientBase {
1377
1437
  parameters,
1378
1438
  organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
1379
1439
  timestampMs: timestampMs ?? String(Date.now()),
1380
- type: "ACTIVITY_TYPE_CREATE_OAUTH2CREDENTIAL",
1440
+ type: "ACTIVITY_TYPE_CREATE_OAUTH2_CREDENTIAL",
1381
1441
  };
1382
1442
  const stringifiedBody = JSON.stringify(bodyWithType);
1383
1443
  const stamp = await activeStamper.stamp(stringifiedBody);
@@ -1601,7 +1661,7 @@ class TurnkeySDKClientBase {
1601
1661
  this.config.organizationId,
1602
1662
  timestampMs: timestampMs ?? String(Date.now()),
1603
1663
  type: "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2",
1604
- }, "createReadWriteSessionResultV2", stampWith);
1664
+ }, "createReadWriteSessionResult", stampWith);
1605
1665
  };
1606
1666
  this.stampCreateReadWriteSession = async (input, stampWith) => {
1607
1667
  const activeStamper = this.getStamper(stampWith);
@@ -1830,6 +1890,40 @@ class TurnkeySDKClientBase {
1830
1890
  url: fullUrl,
1831
1891
  };
1832
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
+ };
1833
1927
  this.deleteApiKeys = async (input, stampWith) => {
1834
1928
  const { organizationId, timestampMs, ...rest } = input;
1835
1929
  const session = await this.storageManager?.getActiveSession();
@@ -1976,7 +2070,7 @@ class TurnkeySDKClientBase {
1976
2070
  session?.organizationId ??
1977
2071
  this.config.organizationId,
1978
2072
  timestampMs: timestampMs ?? String(Date.now()),
1979
- type: "ACTIVITY_TYPE_DELETE_OAUTH2CREDENTIAL",
2073
+ type: "ACTIVITY_TYPE_DELETE_OAUTH2_CREDENTIAL",
1980
2074
  }, "deleteOauth2CredentialResult", stampWith);
1981
2075
  };
1982
2076
  this.stampDeleteOauth2Credential = async (input, stampWith) => {
@@ -1991,7 +2085,7 @@ class TurnkeySDKClientBase {
1991
2085
  parameters,
1992
2086
  organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
1993
2087
  timestampMs: timestampMs ?? String(Date.now()),
1994
- type: "ACTIVITY_TYPE_DELETE_OAUTH2CREDENTIAL",
2088
+ type: "ACTIVITY_TYPE_DELETE_OAUTH2_CREDENTIAL",
1995
2089
  };
1996
2090
  const stringifiedBody = JSON.stringify(bodyWithType);
1997
2091
  const stamp = await activeStamper.stamp(stringifiedBody);
@@ -2376,6 +2470,40 @@ class TurnkeySDKClientBase {
2376
2470
  url: fullUrl,
2377
2471
  };
2378
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
+ };
2379
2507
  this.emailAuth = async (input, stampWith) => {
2380
2508
  const { organizationId, timestampMs, ...rest } = input;
2381
2509
  const session = await this.storageManager?.getActiveSession();
@@ -2861,7 +2989,7 @@ class TurnkeySDKClientBase {
2861
2989
  session?.organizationId ??
2862
2990
  this.config.organizationId,
2863
2991
  timestampMs: timestampMs ?? String(Date.now()),
2864
- type: "ACTIVITY_TYPE_OAUTH2AUTHENTICATE",
2992
+ type: "ACTIVITY_TYPE_OAUTH2_AUTHENTICATE",
2865
2993
  }, "oauth2AuthenticateResult", stampWith);
2866
2994
  };
2867
2995
  this.stampOauth2Authenticate = async (input, stampWith) => {
@@ -2876,7 +3004,7 @@ class TurnkeySDKClientBase {
2876
3004
  parameters,
2877
3005
  organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
2878
3006
  timestampMs: timestampMs ?? String(Date.now()),
2879
- type: "ACTIVITY_TYPE_OAUTH2AUTHENTICATE",
3007
+ type: "ACTIVITY_TYPE_OAUTH2_AUTHENTICATE",
2880
3008
  };
2881
3009
  const stringifiedBody = JSON.stringify(bodyWithType);
2882
3010
  const stamp = await activeStamper.stamp(stringifiedBody);
@@ -3338,7 +3466,7 @@ class TurnkeySDKClientBase {
3338
3466
  session?.organizationId ??
3339
3467
  this.config.organizationId,
3340
3468
  timestampMs: timestampMs ?? String(Date.now()),
3341
- type: "ACTIVITY_TYPE_UPDATE_OAUTH2CREDENTIAL",
3469
+ type: "ACTIVITY_TYPE_UPDATE_OAUTH2_CREDENTIAL",
3342
3470
  }, "updateOauth2CredentialResult", stampWith);
3343
3471
  };
3344
3472
  this.stampUpdateOauth2Credential = async (input, stampWith) => {
@@ -3353,7 +3481,7 @@ class TurnkeySDKClientBase {
3353
3481
  parameters,
3354
3482
  organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
3355
3483
  timestampMs: timestampMs ?? String(Date.now()),
3356
- type: "ACTIVITY_TYPE_UPDATE_OAUTH2CREDENTIAL",
3484
+ type: "ACTIVITY_TYPE_UPDATE_OAUTH2_CREDENTIAL",
3357
3485
  };
3358
3486
  const stringifiedBody = JSON.stringify(bodyWithType);
3359
3487
  const stamp = await activeStamper.stamp(stringifiedBody);
@@ -3703,6 +3831,40 @@ class TurnkeySDKClientBase {
3703
3831
  url: fullUrl,
3704
3832
  };
3705
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
+ };
3706
3868
  this.verifyOtp = async (input, stampWith) => {
3707
3869
  const { organizationId, timestampMs, ...rest } = input;
3708
3870
  const session = await this.storageManager?.getActiveSession();
@@ -3749,15 +3911,27 @@ class TurnkeySDKClientBase {
3749
3911
  this.proxyInitOtp = async (input) => {
3750
3912
  return this.authProxyRequest("/v1/otp_init", input);
3751
3913
  };
3914
+ this.proxyInitOtpV2 = async (input) => {
3915
+ return this.authProxyRequest("/v1/otp_init_v2", input);
3916
+ };
3752
3917
  this.proxyOtpLogin = async (input) => {
3753
3918
  return this.authProxyRequest("/v1/otp_login", input);
3754
3919
  };
3920
+ this.proxyOtpLoginV2 = async (input) => {
3921
+ return this.authProxyRequest("/v1/otp_login_v2", input);
3922
+ };
3755
3923
  this.proxyVerifyOtp = async (input) => {
3756
3924
  return this.authProxyRequest("/v1/otp_verify", input);
3757
3925
  };
3926
+ this.proxyVerifyOtpV2 = async (input) => {
3927
+ return this.authProxyRequest("/v1/otp_verify_v2", input);
3928
+ };
3758
3929
  this.proxySignup = async (input) => {
3759
3930
  return this.authProxyRequest("/v1/signup", input);
3760
3931
  };
3932
+ this.proxySignupV2 = async (input) => {
3933
+ return this.authProxyRequest("/v1/signup_v2", input);
3934
+ };
3761
3935
  this.proxyGetWalletKitConfig = async (input) => {
3762
3936
  return this.authProxyRequest("/v1/wallet_kit_config", input);
3763
3937
  };