@turnkey/core 1.0.0-beta.5 → 1.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.
Files changed (61) hide show
  1. package/README.MD +3 -1
  2. package/dist/__clients__/core.d.ts +118 -30
  3. package/dist/__clients__/core.d.ts.map +1 -1
  4. package/dist/__clients__/core.js +362 -102
  5. package/dist/__clients__/core.js.map +1 -1
  6. package/dist/__clients__/core.mjs +364 -104
  7. package/dist/__clients__/core.mjs.map +1 -1
  8. package/dist/__generated__/sdk-client-base.d.ts +17 -0
  9. package/dist/__generated__/sdk-client-base.d.ts.map +1 -1
  10. package/dist/__generated__/sdk-client-base.js +256 -5
  11. package/dist/__generated__/sdk-client-base.js.map +1 -1
  12. package/dist/__generated__/sdk-client-base.mjs +256 -5
  13. package/dist/__generated__/sdk-client-base.mjs.map +1 -1
  14. package/dist/__generated__/version.d.ts +1 -1
  15. package/dist/__generated__/version.d.ts.map +1 -1
  16. package/dist/__generated__/version.js +1 -1
  17. package/dist/__generated__/version.mjs +1 -1
  18. package/dist/__inputs__/public_api.types.d.ts +373 -23
  19. package/dist/__inputs__/public_api.types.d.ts.map +1 -1
  20. package/dist/__polyfills__/jest.setup.webcrypto.d.ts +2 -0
  21. package/dist/__polyfills__/jest.setup.webcrypto.d.ts.map +1 -0
  22. package/dist/__stampers__/api/base.d.ts +11 -5
  23. package/dist/__stampers__/api/base.d.ts.map +1 -1
  24. package/dist/__stampers__/api/base.js +32 -10
  25. package/dist/__stampers__/api/base.js.map +1 -1
  26. package/dist/__stampers__/api/base.mjs +32 -10
  27. package/dist/__stampers__/api/base.mjs.map +1 -1
  28. package/dist/__stampers__/api/web/stamper.d.ts.map +1 -1
  29. package/dist/__stampers__/api/web/stamper.js +2 -4
  30. package/dist/__stampers__/api/web/stamper.js.map +1 -1
  31. package/dist/__stampers__/api/web/stamper.mjs +2 -4
  32. package/dist/__stampers__/api/web/stamper.mjs.map +1 -1
  33. package/dist/__types__/base.d.ts +3 -1
  34. package/dist/__types__/base.d.ts.map +1 -1
  35. package/dist/__types__/base.js.map +1 -1
  36. package/dist/__types__/base.mjs.map +1 -1
  37. package/dist/__wallet__/base.d.ts.map +1 -1
  38. package/dist/__wallet__/base.js +6 -6
  39. package/dist/__wallet__/base.js.map +1 -1
  40. package/dist/__wallet__/base.mjs +2 -2
  41. package/dist/__wallet__/base.mjs.map +1 -1
  42. package/dist/__wallet__/stamper.d.ts.map +1 -1
  43. package/dist/__wallet__/stamper.js +7 -6
  44. package/dist/__wallet__/stamper.js.map +1 -1
  45. package/dist/__wallet__/stamper.mjs +8 -7
  46. package/dist/__wallet__/stamper.mjs.map +1 -1
  47. package/dist/__wallet__/wallet-connect/base.js +5 -6
  48. package/dist/__wallet__/wallet-connect/base.js.map +1 -1
  49. package/dist/__wallet__/wallet-connect/base.mjs +1 -2
  50. package/dist/__wallet__/wallet-connect/base.mjs.map +1 -1
  51. package/dist/__wallet__/web/native/solana.js +1 -2
  52. package/dist/__wallet__/web/native/solana.js.map +1 -1
  53. package/dist/__wallet__/web/native/solana.mjs +1 -2
  54. package/dist/__wallet__/web/native/solana.mjs.map +1 -1
  55. package/dist/utils.d.ts +33 -6
  56. package/dist/utils.d.ts.map +1 -1
  57. package/dist/utils.js +160 -18
  58. package/dist/utils.js.map +1 -1
  59. package/dist/utils.mjs +156 -21
  60. package/dist/utils.mjs.map +1 -1
  61. package/package.json +10 -10
@@ -180,6 +180,93 @@ class TurnkeySDKClientBase {
180
180
  url: fullUrl,
181
181
  };
182
182
  };
183
+ this.getBootProof = async (input, stampWith) => {
184
+ const session = await this.storageManager?.getActiveSession();
185
+ return this.request("/public/v1/query/get_boot_proof", {
186
+ ...input,
187
+ organizationId: input.organizationId ??
188
+ session?.organizationId ??
189
+ this.config.organizationId,
190
+ }, stampWith);
191
+ };
192
+ this.stampGetBootProof = async (input, stampWith) => {
193
+ const activeStamper = this.getStamper(stampWith);
194
+ if (!activeStamper) {
195
+ return undefined;
196
+ }
197
+ const { organizationId, ...parameters } = input;
198
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_boot_proof";
199
+ const bodyWithType = {
200
+ parameters,
201
+ organizationId,
202
+ type: "ACTIVITY_TYPE_GET_BOOT_PROOF",
203
+ };
204
+ const stringifiedBody = JSON.stringify(bodyWithType);
205
+ const stamp = await activeStamper.stamp(stringifiedBody);
206
+ return {
207
+ body: stringifiedBody,
208
+ stamp: stamp,
209
+ url: fullUrl,
210
+ };
211
+ };
212
+ this.getLatestBootProof = async (input, stampWith) => {
213
+ const session = await this.storageManager?.getActiveSession();
214
+ return this.request("/public/v1/query/get_latest_boot_proof", {
215
+ ...input,
216
+ organizationId: input.organizationId ??
217
+ session?.organizationId ??
218
+ this.config.organizationId,
219
+ }, stampWith);
220
+ };
221
+ this.stampGetLatestBootProof = async (input, stampWith) => {
222
+ const activeStamper = this.getStamper(stampWith);
223
+ if (!activeStamper) {
224
+ return undefined;
225
+ }
226
+ const { organizationId, ...parameters } = input;
227
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_latest_boot_proof";
228
+ const bodyWithType = {
229
+ parameters,
230
+ organizationId,
231
+ type: "ACTIVITY_TYPE_GET_LATEST_BOOT_PROOF",
232
+ };
233
+ const stringifiedBody = JSON.stringify(bodyWithType);
234
+ const stamp = await activeStamper.stamp(stringifiedBody);
235
+ return {
236
+ body: stringifiedBody,
237
+ stamp: stamp,
238
+ url: fullUrl,
239
+ };
240
+ };
241
+ this.getOauth2Credential = async (input, stampWith) => {
242
+ const session = await this.storageManager?.getActiveSession();
243
+ return this.request("/public/v1/query/get_oauth2_credential", {
244
+ ...input,
245
+ organizationId: input.organizationId ??
246
+ session?.organizationId ??
247
+ this.config.organizationId,
248
+ }, stampWith);
249
+ };
250
+ this.stampGetOauth2Credential = async (input, stampWith) => {
251
+ const activeStamper = this.getStamper(stampWith);
252
+ if (!activeStamper) {
253
+ return undefined;
254
+ }
255
+ const { organizationId, ...parameters } = input;
256
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_oauth2_credential";
257
+ const bodyWithType = {
258
+ parameters,
259
+ organizationId,
260
+ type: "ACTIVITY_TYPE_GET_OAUTH2CREDENTIAL",
261
+ };
262
+ const stringifiedBody = JSON.stringify(bodyWithType);
263
+ const stamp = await activeStamper.stamp(stringifiedBody);
264
+ return {
265
+ body: stringifiedBody,
266
+ stamp: stamp,
267
+ url: fullUrl,
268
+ };
269
+ };
183
270
  this.getOauthProviders = async (input, stampWith) => {
184
271
  const session = await this.storageManager?.getActiveSession();
185
272
  return this.request("/public/v1/query/get_oauth_providers", {
@@ -499,6 +586,35 @@ class TurnkeySDKClientBase {
499
586
  url: fullUrl,
500
587
  };
501
588
  };
589
+ this.listOauth2Credentials = async (input, stampWith) => {
590
+ const session = await this.storageManager?.getActiveSession();
591
+ return this.request("/public/v1/query/list_oauth2_credentials", {
592
+ ...input,
593
+ organizationId: input.organizationId ??
594
+ session?.organizationId ??
595
+ this.config.organizationId,
596
+ }, stampWith);
597
+ };
598
+ this.stampListOauth2Credentials = async (input, stampWith) => {
599
+ const activeStamper = this.getStamper(stampWith);
600
+ if (!activeStamper) {
601
+ return undefined;
602
+ }
603
+ const { organizationId, ...parameters } = input;
604
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_oauth2_credentials";
605
+ const bodyWithType = {
606
+ parameters,
607
+ organizationId,
608
+ type: "ACTIVITY_TYPE_LIST_OAUTH2CREDENTIALS",
609
+ };
610
+ const stringifiedBody = JSON.stringify(bodyWithType);
611
+ const stamp = await activeStamper.stamp(stringifiedBody);
612
+ return {
613
+ body: stringifiedBody,
614
+ stamp: stamp,
615
+ url: fullUrl,
616
+ };
617
+ };
502
618
  this.getPolicies = async (input = {}, stampWith) => {
503
619
  const session = await this.storageManager?.getActiveSession();
504
620
  return this.request("/public/v1/query/list_policies", {
@@ -984,6 +1100,39 @@ class TurnkeySDKClientBase {
984
1100
  url: fullUrl,
985
1101
  };
986
1102
  };
1103
+ this.createOauth2Credential = async (input, stampWith) => {
1104
+ const { organizationId, timestampMs, ...rest } = input;
1105
+ const session = await this.storageManager?.getActiveSession();
1106
+ return this.activity("/public/v1/submit/create_oauth2_credential", {
1107
+ parameters: rest,
1108
+ organizationId: organizationId ??
1109
+ session?.organizationId ??
1110
+ this.config.organizationId,
1111
+ timestampMs: timestampMs ?? String(Date.now()),
1112
+ type: "ACTIVITY_TYPE_CREATE_OAUTH2CREDENTIAL",
1113
+ }, "createOauth2CredentialResult", stampWith);
1114
+ };
1115
+ this.stampCreateOauth2Credential = async (input, stampWith) => {
1116
+ const activeStamper = this.getStamper(stampWith);
1117
+ if (!activeStamper) {
1118
+ return undefined;
1119
+ }
1120
+ const { organizationId, timestampMs, ...parameters } = input;
1121
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_oauth2_credential";
1122
+ const bodyWithType = {
1123
+ parameters,
1124
+ organizationId,
1125
+ timestampMs: timestampMs ?? String(Date.now()),
1126
+ type: "ACTIVITY_TYPE_CREATE_OAUTH2CREDENTIAL",
1127
+ };
1128
+ const stringifiedBody = JSON.stringify(bodyWithType);
1129
+ const stamp = await activeStamper.stamp(stringifiedBody);
1130
+ return {
1131
+ body: stringifiedBody,
1132
+ stamp: stamp,
1133
+ url: fullUrl,
1134
+ };
1135
+ };
987
1136
  this.createOauthProviders = async (input, stampWith) => {
988
1137
  const { organizationId, timestampMs, ...rest } = input;
989
1138
  const session = await this.storageManager?.getActiveSession();
@@ -1126,7 +1275,7 @@ class TurnkeySDKClientBase {
1126
1275
  this.config.organizationId,
1127
1276
  timestampMs: timestampMs ?? String(Date.now()),
1128
1277
  type: "ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2",
1129
- }, "createPrivateKeysResultV2", stampWith);
1278
+ }, "createPrivateKeysResult", stampWith);
1130
1279
  };
1131
1280
  this.stampCreatePrivateKeys = async (input, stampWith) => {
1132
1281
  const activeStamper = this.getStamper(stampWith);
@@ -1192,7 +1341,7 @@ class TurnkeySDKClientBase {
1192
1341
  this.config.organizationId,
1193
1342
  timestampMs: timestampMs ?? String(Date.now()),
1194
1343
  type: "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2",
1195
- }, "createReadWriteSessionResultV2", stampWith);
1344
+ }, "createReadWriteSessionResult", stampWith);
1196
1345
  };
1197
1346
  this.stampCreateReadWriteSession = async (input, stampWith) => {
1198
1347
  const activeStamper = this.getStamper(stampWith);
@@ -1259,7 +1408,7 @@ class TurnkeySDKClientBase {
1259
1408
  this.config.organizationId,
1260
1409
  timestampMs: timestampMs ?? String(Date.now()),
1261
1410
  type: "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7",
1262
- }, "createSubOrganizationResultV7", stampWith);
1411
+ }, "createSubOrganizationResult", stampWith);
1263
1412
  };
1264
1413
  this.stampCreateSubOrganization = async (input, stampWith) => {
1265
1414
  const activeStamper = this.getStamper(stampWith);
@@ -1513,6 +1662,39 @@ class TurnkeySDKClientBase {
1513
1662
  url: fullUrl,
1514
1663
  };
1515
1664
  };
1665
+ this.deleteOauth2Credential = async (input, stampWith) => {
1666
+ const { organizationId, timestampMs, ...rest } = input;
1667
+ const session = await this.storageManager?.getActiveSession();
1668
+ return this.activity("/public/v1/submit/delete_oauth2_credential", {
1669
+ parameters: rest,
1670
+ organizationId: organizationId ??
1671
+ session?.organizationId ??
1672
+ this.config.organizationId,
1673
+ timestampMs: timestampMs ?? String(Date.now()),
1674
+ type: "ACTIVITY_TYPE_DELETE_OAUTH2CREDENTIAL",
1675
+ }, "deleteOauth2CredentialResult", stampWith);
1676
+ };
1677
+ this.stampDeleteOauth2Credential = async (input, stampWith) => {
1678
+ const activeStamper = this.getStamper(stampWith);
1679
+ if (!activeStamper) {
1680
+ return undefined;
1681
+ }
1682
+ const { organizationId, timestampMs, ...parameters } = input;
1683
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/delete_oauth2_credential";
1684
+ const bodyWithType = {
1685
+ parameters,
1686
+ organizationId,
1687
+ timestampMs: timestampMs ?? String(Date.now()),
1688
+ type: "ACTIVITY_TYPE_DELETE_OAUTH2CREDENTIAL",
1689
+ };
1690
+ const stringifiedBody = JSON.stringify(bodyWithType);
1691
+ const stamp = await activeStamper.stamp(stringifiedBody);
1692
+ return {
1693
+ body: stringifiedBody,
1694
+ stamp: stamp,
1695
+ url: fullUrl,
1696
+ };
1697
+ };
1516
1698
  this.deleteOauthProviders = async (input, stampWith) => {
1517
1699
  const { organizationId, timestampMs, ...rest } = input;
1518
1700
  const session = await this.storageManager?.getActiveSession();
@@ -2151,7 +2333,7 @@ class TurnkeySDKClientBase {
2151
2333
  this.config.organizationId,
2152
2334
  timestampMs: timestampMs ?? String(Date.now()),
2153
2335
  type: "ACTIVITY_TYPE_INIT_OTP_AUTH_V2",
2154
- }, "initOtpAuthResultV2", stampWith);
2336
+ }, "initOtpAuthResult", stampWith);
2155
2337
  };
2156
2338
  this.stampInitOtpAuth = async (input, stampWith) => {
2157
2339
  const activeStamper = this.getStamper(stampWith);
@@ -2240,6 +2422,39 @@ class TurnkeySDKClientBase {
2240
2422
  url: fullUrl,
2241
2423
  };
2242
2424
  };
2425
+ this.oauth2Authenticate = async (input, stampWith) => {
2426
+ const { organizationId, timestampMs, ...rest } = input;
2427
+ const session = await this.storageManager?.getActiveSession();
2428
+ return this.activity("/public/v1/submit/oauth2_authenticate", {
2429
+ parameters: rest,
2430
+ organizationId: organizationId ??
2431
+ session?.organizationId ??
2432
+ this.config.organizationId,
2433
+ timestampMs: timestampMs ?? String(Date.now()),
2434
+ type: "ACTIVITY_TYPE_OAUTH2AUTHENTICATE",
2435
+ }, "oauth2AuthenticateResult", stampWith);
2436
+ };
2437
+ this.stampOauth2Authenticate = async (input, stampWith) => {
2438
+ const activeStamper = this.getStamper(stampWith);
2439
+ if (!activeStamper) {
2440
+ return undefined;
2441
+ }
2442
+ const { organizationId, timestampMs, ...parameters } = input;
2443
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/oauth2_authenticate";
2444
+ const bodyWithType = {
2445
+ parameters,
2446
+ organizationId,
2447
+ timestampMs: timestampMs ?? String(Date.now()),
2448
+ type: "ACTIVITY_TYPE_OAUTH2AUTHENTICATE",
2449
+ };
2450
+ const stringifiedBody = JSON.stringify(bodyWithType);
2451
+ const stamp = await activeStamper.stamp(stringifiedBody);
2452
+ return {
2453
+ body: stringifiedBody,
2454
+ stamp: stamp,
2455
+ url: fullUrl,
2456
+ };
2457
+ };
2243
2458
  this.oauthLogin = async (input, stampWith) => {
2244
2459
  const { organizationId, timestampMs, ...rest } = input;
2245
2460
  const session = await this.storageManager?.getActiveSession();
@@ -2603,6 +2818,39 @@ class TurnkeySDKClientBase {
2603
2818
  url: fullUrl,
2604
2819
  };
2605
2820
  };
2821
+ this.updateOauth2Credential = async (input, stampWith) => {
2822
+ const { organizationId, timestampMs, ...rest } = input;
2823
+ const session = await this.storageManager?.getActiveSession();
2824
+ return this.activity("/public/v1/submit/update_oauth2_credential", {
2825
+ parameters: rest,
2826
+ organizationId: organizationId ??
2827
+ session?.organizationId ??
2828
+ this.config.organizationId,
2829
+ timestampMs: timestampMs ?? String(Date.now()),
2830
+ type: "ACTIVITY_TYPE_UPDATE_OAUTH2CREDENTIAL",
2831
+ }, "updateOauth2CredentialResult", stampWith);
2832
+ };
2833
+ this.stampUpdateOauth2Credential = async (input, stampWith) => {
2834
+ const activeStamper = this.getStamper(stampWith);
2835
+ if (!activeStamper) {
2836
+ return undefined;
2837
+ }
2838
+ const { organizationId, timestampMs, ...parameters } = input;
2839
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/update_oauth2_credential";
2840
+ const bodyWithType = {
2841
+ parameters,
2842
+ organizationId,
2843
+ timestampMs: timestampMs ?? String(Date.now()),
2844
+ type: "ACTIVITY_TYPE_UPDATE_OAUTH2CREDENTIAL",
2845
+ };
2846
+ const stringifiedBody = JSON.stringify(bodyWithType);
2847
+ const stamp = await activeStamper.stamp(stringifiedBody);
2848
+ return {
2849
+ body: stringifiedBody,
2850
+ stamp: stamp,
2851
+ url: fullUrl,
2852
+ };
2853
+ };
2606
2854
  this.updatePolicy = async (input, stampWith) => {
2607
2855
  const { organizationId, timestampMs, ...rest } = input;
2608
2856
  const session = await this.storageManager?.getActiveSession();
@@ -2613,7 +2861,7 @@ class TurnkeySDKClientBase {
2613
2861
  this.config.organizationId,
2614
2862
  timestampMs: timestampMs ?? String(Date.now()),
2615
2863
  type: "ACTIVITY_TYPE_UPDATE_POLICY_V2",
2616
- }, "updatePolicyResultV2", stampWith);
2864
+ }, "updatePolicyResult", stampWith);
2617
2865
  };
2618
2866
  this.stampUpdatePolicy = async (input, stampWith) => {
2619
2867
  const activeStamper = this.getStamper(stampWith);
@@ -2965,6 +3213,9 @@ class TurnkeySDKClientBase {
2965
3213
  this.proxyGetAccount = async (input) => {
2966
3214
  return this.authProxyRequest("/v1/account", input);
2967
3215
  };
3216
+ this.proxyOAuth2Authenticate = async (input) => {
3217
+ return this.authProxyRequest("/v1/oauth2_authenticate", input);
3218
+ };
2968
3219
  this.proxyOAuthLogin = async (input) => {
2969
3220
  return this.authProxyRequest("/v1/oauth_login", input);
2970
3221
  };