@turnkey/core 1.0.0-beta.4 → 1.0.0-beta.6
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.
- package/dist/__clients__/core.d.ts +88 -35
- package/dist/__clients__/core.d.ts.map +1 -1
- package/dist/__clients__/core.js +271 -140
- package/dist/__clients__/core.js.map +1 -1
- package/dist/__clients__/core.mjs +274 -143
- package/dist/__clients__/core.mjs.map +1 -1
- package/dist/__generated__/sdk-client-base.d.ts +13 -0
- package/dist/__generated__/sdk-client-base.d.ts.map +1 -1
- package/dist/__generated__/sdk-client-base.js +198 -8
- package/dist/__generated__/sdk-client-base.js.map +1 -1
- package/dist/__generated__/sdk-client-base.mjs +198 -8
- package/dist/__generated__/sdk-client-base.mjs.map +1 -1
- package/dist/__generated__/version.d.ts +1 -1
- package/dist/__generated__/version.js +1 -1
- package/dist/__generated__/version.mjs +1 -1
- package/dist/__inputs__/public_api.types.d.ts +629 -494
- package/dist/__inputs__/public_api.types.d.ts.map +1 -1
- package/dist/__polyfills__/jest.setup.webcrypto.d.ts +2 -0
- package/dist/__polyfills__/jest.setup.webcrypto.d.ts.map +1 -0
- package/dist/__stampers__/api/base.d.ts +11 -5
- package/dist/__stampers__/api/base.d.ts.map +1 -1
- package/dist/__stampers__/api/base.js +32 -10
- package/dist/__stampers__/api/base.js.map +1 -1
- package/dist/__stampers__/api/base.mjs +32 -10
- package/dist/__stampers__/api/base.mjs.map +1 -1
- package/dist/__stampers__/api/web/stamper.d.ts.map +1 -1
- package/dist/__stampers__/api/web/stamper.js +2 -4
- package/dist/__stampers__/api/web/stamper.js.map +1 -1
- package/dist/__stampers__/api/web/stamper.mjs +2 -4
- package/dist/__stampers__/api/web/stamper.mjs.map +1 -1
- package/dist/__types__/base.d.ts +195 -75
- package/dist/__types__/base.d.ts.map +1 -1
- package/dist/__types__/base.js +14 -13
- package/dist/__types__/base.js.map +1 -1
- package/dist/__types__/base.mjs +15 -14
- package/dist/__types__/base.mjs.map +1 -1
- package/dist/__wallet__/stamper.d.ts.map +1 -1
- package/dist/__wallet__/stamper.js +8 -7
- package/dist/__wallet__/stamper.js.map +1 -1
- package/dist/__wallet__/stamper.mjs +9 -8
- package/dist/__wallet__/stamper.mjs.map +1 -1
- package/dist/__wallet__/wallet-connect/base.d.ts +3 -0
- package/dist/__wallet__/wallet-connect/base.d.ts.map +1 -1
- package/dist/__wallet__/wallet-connect/base.js +32 -8
- package/dist/__wallet__/wallet-connect/base.js.map +1 -1
- package/dist/__wallet__/wallet-connect/base.mjs +32 -8
- package/dist/__wallet__/wallet-connect/base.mjs.map +1 -1
- package/dist/__wallet__/wallet-connect/client.d.ts +28 -3
- package/dist/__wallet__/wallet-connect/client.d.ts.map +1 -1
- package/dist/__wallet__/wallet-connect/client.js +54 -5
- package/dist/__wallet__/wallet-connect/client.js.map +1 -1
- package/dist/__wallet__/wallet-connect/client.mjs +54 -5
- package/dist/__wallet__/wallet-connect/client.mjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/utils.d.ts +61 -13
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +184 -32
- package/dist/utils.js.map +1 -1
- package/dist/utils.mjs +179 -33
- package/dist/utils.mjs.map +1 -1
- package/package.json +10 -9
|
@@ -182,6 +182,35 @@ class TurnkeySDKClientBase {
|
|
|
182
182
|
url: fullUrl,
|
|
183
183
|
};
|
|
184
184
|
};
|
|
185
|
+
this.getOauth2Credential = async (input, stampWith) => {
|
|
186
|
+
const session = await this.storageManager?.getActiveSession();
|
|
187
|
+
return this.request("/public/v1/query/get_oauth2_credential", {
|
|
188
|
+
...input,
|
|
189
|
+
organizationId: input.organizationId ??
|
|
190
|
+
session?.organizationId ??
|
|
191
|
+
this.config.organizationId,
|
|
192
|
+
}, stampWith);
|
|
193
|
+
};
|
|
194
|
+
this.stampGetOauth2Credential = async (input, stampWith) => {
|
|
195
|
+
const activeStamper = this.getStamper(stampWith);
|
|
196
|
+
if (!activeStamper) {
|
|
197
|
+
return undefined;
|
|
198
|
+
}
|
|
199
|
+
const { organizationId, ...parameters } = input;
|
|
200
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_oauth2_credential";
|
|
201
|
+
const bodyWithType = {
|
|
202
|
+
parameters,
|
|
203
|
+
organizationId,
|
|
204
|
+
type: "ACTIVITY_TYPE_GET_OAUTH2CREDENTIAL",
|
|
205
|
+
};
|
|
206
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
207
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
208
|
+
return {
|
|
209
|
+
body: stringifiedBody,
|
|
210
|
+
stamp: stamp,
|
|
211
|
+
url: fullUrl,
|
|
212
|
+
};
|
|
213
|
+
};
|
|
185
214
|
this.getOauthProviders = async (input, stampWith) => {
|
|
186
215
|
const session = await this.storageManager?.getActiveSession();
|
|
187
216
|
return this.request("/public/v1/query/get_oauth_providers", {
|
|
@@ -501,6 +530,35 @@ class TurnkeySDKClientBase {
|
|
|
501
530
|
url: fullUrl,
|
|
502
531
|
};
|
|
503
532
|
};
|
|
533
|
+
this.listOauth2Credentials = async (input, stampWith) => {
|
|
534
|
+
const session = await this.storageManager?.getActiveSession();
|
|
535
|
+
return this.request("/public/v1/query/list_oauth2_credentials", {
|
|
536
|
+
...input,
|
|
537
|
+
organizationId: input.organizationId ??
|
|
538
|
+
session?.organizationId ??
|
|
539
|
+
this.config.organizationId,
|
|
540
|
+
}, stampWith);
|
|
541
|
+
};
|
|
542
|
+
this.stampListOauth2Credentials = async (input, stampWith) => {
|
|
543
|
+
const activeStamper = this.getStamper(stampWith);
|
|
544
|
+
if (!activeStamper) {
|
|
545
|
+
return undefined;
|
|
546
|
+
}
|
|
547
|
+
const { organizationId, ...parameters } = input;
|
|
548
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_oauth2_credentials";
|
|
549
|
+
const bodyWithType = {
|
|
550
|
+
parameters,
|
|
551
|
+
organizationId,
|
|
552
|
+
type: "ACTIVITY_TYPE_LIST_OAUTH2CREDENTIALS",
|
|
553
|
+
};
|
|
554
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
555
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
556
|
+
return {
|
|
557
|
+
body: stringifiedBody,
|
|
558
|
+
stamp: stamp,
|
|
559
|
+
url: fullUrl,
|
|
560
|
+
};
|
|
561
|
+
};
|
|
504
562
|
this.getPolicies = async (input = {}, stampWith) => {
|
|
505
563
|
const session = await this.storageManager?.getActiveSession();
|
|
506
564
|
return this.request("/public/v1/query/list_policies", {
|
|
@@ -986,6 +1044,39 @@ class TurnkeySDKClientBase {
|
|
|
986
1044
|
url: fullUrl,
|
|
987
1045
|
};
|
|
988
1046
|
};
|
|
1047
|
+
this.createOauth2Credential = async (input, stampWith) => {
|
|
1048
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1049
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1050
|
+
return this.activity("/public/v1/submit/create_oauth2_credential", {
|
|
1051
|
+
parameters: rest,
|
|
1052
|
+
organizationId: organizationId ??
|
|
1053
|
+
session?.organizationId ??
|
|
1054
|
+
this.config.organizationId,
|
|
1055
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1056
|
+
type: "ACTIVITY_TYPE_CREATE_OAUTH2CREDENTIAL",
|
|
1057
|
+
}, "createOauth2CredentialResult", stampWith);
|
|
1058
|
+
};
|
|
1059
|
+
this.stampCreateOauth2Credential = async (input, stampWith) => {
|
|
1060
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1061
|
+
if (!activeStamper) {
|
|
1062
|
+
return undefined;
|
|
1063
|
+
}
|
|
1064
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1065
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_oauth2_credential";
|
|
1066
|
+
const bodyWithType = {
|
|
1067
|
+
parameters,
|
|
1068
|
+
organizationId,
|
|
1069
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1070
|
+
type: "ACTIVITY_TYPE_CREATE_OAUTH2CREDENTIAL",
|
|
1071
|
+
};
|
|
1072
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1073
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1074
|
+
return {
|
|
1075
|
+
body: stringifiedBody,
|
|
1076
|
+
stamp: stamp,
|
|
1077
|
+
url: fullUrl,
|
|
1078
|
+
};
|
|
1079
|
+
};
|
|
989
1080
|
this.createOauthProviders = async (input, stampWith) => {
|
|
990
1081
|
const { organizationId, timestampMs, ...rest } = input;
|
|
991
1082
|
const session = await this.storageManager?.getActiveSession();
|
|
@@ -1128,7 +1219,7 @@ class TurnkeySDKClientBase {
|
|
|
1128
1219
|
this.config.organizationId,
|
|
1129
1220
|
timestampMs: timestampMs ?? String(Date.now()),
|
|
1130
1221
|
type: "ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2",
|
|
1131
|
-
}, "
|
|
1222
|
+
}, "createPrivateKeysResult", stampWith);
|
|
1132
1223
|
};
|
|
1133
1224
|
this.stampCreatePrivateKeys = async (input, stampWith) => {
|
|
1134
1225
|
const activeStamper = this.getStamper(stampWith);
|
|
@@ -1194,7 +1285,7 @@ class TurnkeySDKClientBase {
|
|
|
1194
1285
|
this.config.organizationId,
|
|
1195
1286
|
timestampMs: timestampMs ?? String(Date.now()),
|
|
1196
1287
|
type: "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2",
|
|
1197
|
-
}, "
|
|
1288
|
+
}, "createReadWriteSessionResult", stampWith);
|
|
1198
1289
|
};
|
|
1199
1290
|
this.stampCreateReadWriteSession = async (input, stampWith) => {
|
|
1200
1291
|
const activeStamper = this.getStamper(stampWith);
|
|
@@ -1261,7 +1352,7 @@ class TurnkeySDKClientBase {
|
|
|
1261
1352
|
this.config.organizationId,
|
|
1262
1353
|
timestampMs: timestampMs ?? String(Date.now()),
|
|
1263
1354
|
type: "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7",
|
|
1264
|
-
}, "
|
|
1355
|
+
}, "createSubOrganizationResult", stampWith);
|
|
1265
1356
|
};
|
|
1266
1357
|
this.stampCreateSubOrganization = async (input, stampWith) => {
|
|
1267
1358
|
const activeStamper = this.getStamper(stampWith);
|
|
@@ -1515,6 +1606,39 @@ class TurnkeySDKClientBase {
|
|
|
1515
1606
|
url: fullUrl,
|
|
1516
1607
|
};
|
|
1517
1608
|
};
|
|
1609
|
+
this.deleteOauth2Credential = async (input, stampWith) => {
|
|
1610
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1611
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1612
|
+
return this.activity("/public/v1/submit/delete_oauth2_credential", {
|
|
1613
|
+
parameters: rest,
|
|
1614
|
+
organizationId: organizationId ??
|
|
1615
|
+
session?.organizationId ??
|
|
1616
|
+
this.config.organizationId,
|
|
1617
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1618
|
+
type: "ACTIVITY_TYPE_DELETE_OAUTH2CREDENTIAL",
|
|
1619
|
+
}, "deleteOauth2CredentialResult", stampWith);
|
|
1620
|
+
};
|
|
1621
|
+
this.stampDeleteOauth2Credential = async (input, stampWith) => {
|
|
1622
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1623
|
+
if (!activeStamper) {
|
|
1624
|
+
return undefined;
|
|
1625
|
+
}
|
|
1626
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1627
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/delete_oauth2_credential";
|
|
1628
|
+
const bodyWithType = {
|
|
1629
|
+
parameters,
|
|
1630
|
+
organizationId,
|
|
1631
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1632
|
+
type: "ACTIVITY_TYPE_DELETE_OAUTH2CREDENTIAL",
|
|
1633
|
+
};
|
|
1634
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1635
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1636
|
+
return {
|
|
1637
|
+
body: stringifiedBody,
|
|
1638
|
+
stamp: stamp,
|
|
1639
|
+
url: fullUrl,
|
|
1640
|
+
};
|
|
1641
|
+
};
|
|
1518
1642
|
this.deleteOauthProviders = async (input, stampWith) => {
|
|
1519
1643
|
const { organizationId, timestampMs, ...rest } = input;
|
|
1520
1644
|
const session = await this.storageManager?.getActiveSession();
|
|
@@ -2153,7 +2277,7 @@ class TurnkeySDKClientBase {
|
|
|
2153
2277
|
this.config.organizationId,
|
|
2154
2278
|
timestampMs: timestampMs ?? String(Date.now()),
|
|
2155
2279
|
type: "ACTIVITY_TYPE_INIT_OTP_AUTH_V2",
|
|
2156
|
-
}, "
|
|
2280
|
+
}, "initOtpAuthResult", stampWith);
|
|
2157
2281
|
};
|
|
2158
2282
|
this.stampInitOtpAuth = async (input, stampWith) => {
|
|
2159
2283
|
const activeStamper = this.getStamper(stampWith);
|
|
@@ -2242,6 +2366,39 @@ class TurnkeySDKClientBase {
|
|
|
2242
2366
|
url: fullUrl,
|
|
2243
2367
|
};
|
|
2244
2368
|
};
|
|
2369
|
+
this.oauth2Authenticate = async (input, stampWith) => {
|
|
2370
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2371
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2372
|
+
return this.activity("/public/v1/submit/oauth2_authenticate", {
|
|
2373
|
+
parameters: rest,
|
|
2374
|
+
organizationId: organizationId ??
|
|
2375
|
+
session?.organizationId ??
|
|
2376
|
+
this.config.organizationId,
|
|
2377
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2378
|
+
type: "ACTIVITY_TYPE_OAUTH2AUTHENTICATE",
|
|
2379
|
+
}, "oauth2AuthenticateResult", stampWith);
|
|
2380
|
+
};
|
|
2381
|
+
this.stampOauth2Authenticate = async (input, stampWith) => {
|
|
2382
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2383
|
+
if (!activeStamper) {
|
|
2384
|
+
return undefined;
|
|
2385
|
+
}
|
|
2386
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2387
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/oauth2_authenticate";
|
|
2388
|
+
const bodyWithType = {
|
|
2389
|
+
parameters,
|
|
2390
|
+
organizationId,
|
|
2391
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2392
|
+
type: "ACTIVITY_TYPE_OAUTH2AUTHENTICATE",
|
|
2393
|
+
};
|
|
2394
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2395
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2396
|
+
return {
|
|
2397
|
+
body: stringifiedBody,
|
|
2398
|
+
stamp: stamp,
|
|
2399
|
+
url: fullUrl,
|
|
2400
|
+
};
|
|
2401
|
+
};
|
|
2245
2402
|
this.oauthLogin = async (input, stampWith) => {
|
|
2246
2403
|
const { organizationId, timestampMs, ...rest } = input;
|
|
2247
2404
|
const session = await this.storageManager?.getActiveSession();
|
|
@@ -2605,6 +2762,39 @@ class TurnkeySDKClientBase {
|
|
|
2605
2762
|
url: fullUrl,
|
|
2606
2763
|
};
|
|
2607
2764
|
};
|
|
2765
|
+
this.updateOauth2Credential = async (input, stampWith) => {
|
|
2766
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2767
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2768
|
+
return this.activity("/public/v1/submit/update_oauth2_credential", {
|
|
2769
|
+
parameters: rest,
|
|
2770
|
+
organizationId: organizationId ??
|
|
2771
|
+
session?.organizationId ??
|
|
2772
|
+
this.config.organizationId,
|
|
2773
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2774
|
+
type: "ACTIVITY_TYPE_UPDATE_OAUTH2CREDENTIAL",
|
|
2775
|
+
}, "updateOauth2CredentialResult", stampWith);
|
|
2776
|
+
};
|
|
2777
|
+
this.stampUpdateOauth2Credential = async (input, stampWith) => {
|
|
2778
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2779
|
+
if (!activeStamper) {
|
|
2780
|
+
return undefined;
|
|
2781
|
+
}
|
|
2782
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2783
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/update_oauth2_credential";
|
|
2784
|
+
const bodyWithType = {
|
|
2785
|
+
parameters,
|
|
2786
|
+
organizationId,
|
|
2787
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2788
|
+
type: "ACTIVITY_TYPE_UPDATE_OAUTH2CREDENTIAL",
|
|
2789
|
+
};
|
|
2790
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2791
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2792
|
+
return {
|
|
2793
|
+
body: stringifiedBody,
|
|
2794
|
+
stamp: stamp,
|
|
2795
|
+
url: fullUrl,
|
|
2796
|
+
};
|
|
2797
|
+
};
|
|
2608
2798
|
this.updatePolicy = async (input, stampWith) => {
|
|
2609
2799
|
const { organizationId, timestampMs, ...rest } = input;
|
|
2610
2800
|
const session = await this.storageManager?.getActiveSession();
|
|
@@ -2615,7 +2805,7 @@ class TurnkeySDKClientBase {
|
|
|
2615
2805
|
this.config.organizationId,
|
|
2616
2806
|
timestampMs: timestampMs ?? String(Date.now()),
|
|
2617
2807
|
type: "ACTIVITY_TYPE_UPDATE_POLICY_V2",
|
|
2618
|
-
}, "
|
|
2808
|
+
}, "updatePolicyResult", stampWith);
|
|
2619
2809
|
};
|
|
2620
2810
|
this.stampUpdatePolicy = async (input, stampWith) => {
|
|
2621
2811
|
const activeStamper = this.getStamper(stampWith);
|
|
@@ -2967,6 +3157,9 @@ class TurnkeySDKClientBase {
|
|
|
2967
3157
|
this.proxyGetAccount = async (input) => {
|
|
2968
3158
|
return this.authProxyRequest("/v1/account", input);
|
|
2969
3159
|
};
|
|
3160
|
+
this.proxyOAuth2Authenticate = async (input) => {
|
|
3161
|
+
return this.authProxyRequest("/v1/oauth2_authenticate", input);
|
|
3162
|
+
};
|
|
2970
3163
|
this.proxyOAuthLogin = async (input) => {
|
|
2971
3164
|
return this.authProxyRequest("/v1/oauth_login", input);
|
|
2972
3165
|
};
|
|
@@ -3025,9 +3218,6 @@ class TurnkeySDKClientBase {
|
|
|
3025
3218
|
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
3026
3219
|
headers[stamp.stampHeaderName] = stamp.stampHeaderValue;
|
|
3027
3220
|
}
|
|
3028
|
-
if (this.config.readOnlySession) {
|
|
3029
|
-
headers["X-Session"] = this.config.readOnlySession;
|
|
3030
|
-
}
|
|
3031
3221
|
const response = await fetch(fullUrl, {
|
|
3032
3222
|
method: "POST",
|
|
3033
3223
|
headers: headers,
|