@turnkey/http 3.18.1 → 4.1.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.
- package/CHANGELOG.md +277 -1
- package/dist/__fixtures__/shared.d.ts +6 -0
- package/dist/__fixtures__/shared.d.ts.map +1 -0
- package/dist/__generated__/services/coordinator/public/v1/public_api.client.d.ts +375 -0
- package/dist/__generated__/services/coordinator/public/v1/public_api.client.d.ts.map +1 -1
- package/dist/__generated__/services/coordinator/public/v1/public_api.client.js +626 -0
- package/dist/__generated__/services/coordinator/public/v1/public_api.client.js.map +1 -1
- package/dist/__generated__/services/coordinator/public/v1/public_api.client.mjs +626 -0
- package/dist/__generated__/services/coordinator/public/v1/public_api.client.mjs.map +1 -1
- package/dist/__generated__/services/coordinator/public/v1/public_api.fetcher.d.ts +69430 -3921
- package/dist/__generated__/services/coordinator/public/v1/public_api.fetcher.d.ts.map +1 -1
- package/dist/__generated__/services/coordinator/public/v1/public_api.fetcher.js +600 -0
- package/dist/__generated__/services/coordinator/public/v1/public_api.fetcher.js.map +1 -1
- package/dist/__generated__/services/coordinator/public/v1/public_api.fetcher.mjs +551 -1
- package/dist/__generated__/services/coordinator/public/v1/public_api.fetcher.mjs.map +1 -1
- package/dist/__generated__/services/coordinator/public/v1/public_api.types.d.ts +1462 -33
- package/dist/__generated__/services/coordinator/public/v1/public_api.types.d.ts.map +1 -1
- package/dist/__tests__/async-test.d.ts +2 -0
- package/dist/__tests__/async-test.d.ts.map +1 -0
- package/dist/__tests__/request-test.d.ts +2 -0
- package/dist/__tests__/request-test.d.ts.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,285 @@
|
|
|
1
1
|
# @turnkey/http
|
|
2
2
|
|
|
3
|
+
## 4.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1324](https://github.com/tkhq/sdk/pull/1324) [`f505818`](https://github.com/tkhq/sdk/commit/f505818e121c137d290156a32918a884ba80e5f5) Author [@janjakubnanista](https://github.com/janjakubnanista) - ### Breaking/Behavioral Changes
|
|
8
|
+
|
|
9
|
+
#### `nonce` parameter in `oauth2Authenticate` is now required
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
# Before
|
|
13
|
+
apiClient.oauth2Authenticate({
|
|
14
|
+
oauth2CredentialId: ...,
|
|
15
|
+
authCode: ...,
|
|
16
|
+
redirectUri: ...,
|
|
17
|
+
codeVerifier: ...,
|
|
18
|
+
bearerTokenTargetPublicKey: ...,
|
|
19
|
+
// nonce can be undefined
|
|
20
|
+
nonce: undefined
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
# After
|
|
24
|
+
apiClient.oauth2Authenticate({
|
|
25
|
+
oauth2CredentialId: ...,
|
|
26
|
+
authCode: ...,
|
|
27
|
+
redirectUri: ...,
|
|
28
|
+
codeVerifier: ...,
|
|
29
|
+
bearerTokenTargetPublicKey: ...,
|
|
30
|
+
// nonce is required
|
|
31
|
+
nonce: ""
|
|
32
|
+
})
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
#### Solana transactions in Transaction Management are now limited to the following `caip2` values:
|
|
36
|
+
- `solana:mainnet`
|
|
37
|
+
- `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp`
|
|
38
|
+
- `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d`
|
|
39
|
+
- `solana:devnet`
|
|
40
|
+
- `solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1`
|
|
41
|
+
- `solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG`
|
|
42
|
+
|
|
43
|
+
### New SDK methods
|
|
44
|
+
|
|
45
|
+
#### TVC
|
|
46
|
+
|
|
47
|
+
These methods will only work if you are part of the [TVC beta](https://www.turnkey.com/turnkey-verifiable-cloud#waitlist)
|
|
48
|
+
- `getTvcApp`
|
|
49
|
+
- `getTvcDeployment`
|
|
50
|
+
- `getTvcAppDeployments`
|
|
51
|
+
- `getTvcApps`
|
|
52
|
+
- `validateTvcImage`
|
|
53
|
+
- `createTvcApp`
|
|
54
|
+
- `createTvcDeployment`
|
|
55
|
+
- `createTvcManifestApprovals`
|
|
56
|
+
- `deleteTvcAppAndDeployments`
|
|
57
|
+
- `deleteTvcDeployment`
|
|
58
|
+
- `restoreTvcDeployment`
|
|
59
|
+
- `updateTvcAppLiveDeployment`
|
|
60
|
+
|
|
61
|
+
#### Spark protocol support
|
|
62
|
+
- `sparkClaimTransfer`
|
|
63
|
+
- `sparkPrepareLightningReceive`
|
|
64
|
+
- `sparkPrepareTransfer`
|
|
65
|
+
- `sparkSignFrost`
|
|
66
|
+
|
|
67
|
+
### Patch Changes
|
|
68
|
+
|
|
69
|
+
- Updated dependencies []:
|
|
70
|
+
- @turnkey/api-key-stamper@0.6.7
|
|
71
|
+
|
|
72
|
+
## 4.0.0
|
|
73
|
+
|
|
74
|
+
### Major Changes
|
|
75
|
+
|
|
76
|
+
- [#1250](https://github.com/tkhq/sdk/pull/1250) [`6128132`](https://github.com/tkhq/sdk/commit/6128132d910f658cdf83ecc1dec6598eb20c008a) Author [@moeodeh3](https://github.com/moeodeh3) - ### `INIT_OTP`
|
|
77
|
+
|
|
78
|
+
`ACTIVITY_TYPE_INIT_OTP_V2` → `ACTIVITY_TYPE_INIT_OTP_V3`
|
|
79
|
+
|
|
80
|
+
**What changed:** Added required `otpEncryptionTargetBundle` to the result.
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
// before — v1InitOtpResult
|
|
84
|
+
{
|
|
85
|
+
otpId: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// after — v1InitOtpResultV2
|
|
89
|
+
{
|
|
90
|
+
otpId: string;
|
|
91
|
+
otpEncryptionTargetBundle: string; // new
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
***
|
|
96
|
+
|
|
97
|
+
### `VERIFY_OTP`
|
|
98
|
+
|
|
99
|
+
`ACTIVITY_TYPE_VERIFY_OTP` → `ACTIVITY_TYPE_VERIFY_OTP_V2`
|
|
100
|
+
|
|
101
|
+
**What changed:** Replaced plaintext `otpCode` + `publicKey` with a single `encryptedOtpBundle`.
|
|
102
|
+
|
|
103
|
+
Instead of sending the OTP code in plaintext, you now HPKE-encrypt it (along with your public key) to Turnkey's enclave using the `otpEncryptionTargetBundle` returned by `initOtp`. This ensures the OTP code never leaves the client in plaintext.
|
|
104
|
+
|
|
105
|
+
Use `encryptOtpCodeToBundle` from `@turnkey/crypto` to build the bundle:
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
import { encryptOtpCodeToBundle } from "@turnkey/crypto";
|
|
109
|
+
|
|
110
|
+
const { otpId, otpEncryptionTargetBundle } = await client.initOtp({ ... });
|
|
111
|
+
|
|
112
|
+
// After the user enters their OTP code:
|
|
113
|
+
const encryptedOtpBundle = await encryptOtpCodeToBundle(
|
|
114
|
+
otpCode, // the code the user entered
|
|
115
|
+
otpEncryptionTargetBundle, // from the initOtp response
|
|
116
|
+
publicKey, // your target public key
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
await client.verifyOtp({
|
|
120
|
+
otpId,
|
|
121
|
+
encryptedOtpBundle,
|
|
122
|
+
});
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
```ts
|
|
126
|
+
// before — v1VerifyOtpIntent
|
|
127
|
+
{
|
|
128
|
+
otpId: string;
|
|
129
|
+
otpCode: string; // removed
|
|
130
|
+
expirationSeconds?: string;
|
|
131
|
+
publicKey?: string; // removed
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// after — v1VerifyOtpIntentV2
|
|
135
|
+
{
|
|
136
|
+
otpId: string;
|
|
137
|
+
encryptedOtpBundle: string; // new — replaces otpCode + publicKey
|
|
138
|
+
expirationSeconds?: string;
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
***
|
|
143
|
+
|
|
144
|
+
### `OTP_LOGIN`
|
|
145
|
+
|
|
146
|
+
`ACTIVITY_TYPE_OTP_LOGIN` → `ACTIVITY_TYPE_OTP_LOGIN_V2`
|
|
147
|
+
|
|
148
|
+
**What changed:** `clientSignature` promoted from optional to required.
|
|
149
|
+
|
|
150
|
+
```ts
|
|
151
|
+
// before — v1OtpLoginIntent
|
|
152
|
+
{
|
|
153
|
+
verificationToken: string;
|
|
154
|
+
publicKey: string;
|
|
155
|
+
expirationSeconds?: string;
|
|
156
|
+
invalidateExisting?: boolean;
|
|
157
|
+
clientSignature?: v1ClientSignature; // optional
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// after — v1OtpLoginIntentV2
|
|
161
|
+
{
|
|
162
|
+
verificationToken: string;
|
|
163
|
+
publicKey: string;
|
|
164
|
+
expirationSeconds?: string;
|
|
165
|
+
invalidateExisting?: boolean;
|
|
166
|
+
clientSignature: v1ClientSignature; // now required
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
***
|
|
171
|
+
|
|
172
|
+
### `CREATE_OAUTH_PROVIDERS`
|
|
173
|
+
|
|
174
|
+
`ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS` → `ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS_V2`
|
|
175
|
+
|
|
176
|
+
**What changed:** Added `oidcClaims` as a new option alongside `oidcToken`; you must provide exactly one. This updated type feeds into the `CREATE_SUB_ORGANIZATION` and `CREATE_USERS` changes below.
|
|
177
|
+
|
|
178
|
+
```ts
|
|
179
|
+
// before — v1OauthProviderParams
|
|
180
|
+
{
|
|
181
|
+
providerName: string;
|
|
182
|
+
oidcToken: string;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// after — v1OauthProviderParamsV2
|
|
186
|
+
{
|
|
187
|
+
providerName: string;
|
|
188
|
+
} & (
|
|
189
|
+
| { oidcToken: string }
|
|
190
|
+
| { oidcClaims: { iss: string; sub: string; aud: string } }
|
|
191
|
+
)
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
***
|
|
195
|
+
|
|
196
|
+
### `CREATE_SUB_ORGANIZATION`
|
|
197
|
+
|
|
198
|
+
`ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7` → `ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V8`
|
|
199
|
+
|
|
200
|
+
**What changed:** `rootUsers` items updated from `v1RootUserParamsV4` → `v1RootUserParamsV5`, which updates `oauthProviders` from `v1OauthProviderParams` → `v1OauthProviderParamsV2`.
|
|
201
|
+
|
|
202
|
+
```ts
|
|
203
|
+
// before — v1RootUserParamsV4
|
|
204
|
+
{
|
|
205
|
+
userName: string;
|
|
206
|
+
userEmail?: string;
|
|
207
|
+
userPhoneNumber?: string;
|
|
208
|
+
apiKeys: v1ApiKeyParamsV2[];
|
|
209
|
+
authenticators: v1AuthenticatorParamsV2[];
|
|
210
|
+
oauthProviders: { // v1OauthProviderParams
|
|
211
|
+
providerName: string;
|
|
212
|
+
oidcToken: string; // was required
|
|
213
|
+
}[];
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// after — v1RootUserParamsV5
|
|
217
|
+
{
|
|
218
|
+
userName: string;
|
|
219
|
+
userEmail?: string;
|
|
220
|
+
userPhoneNumber?: string;
|
|
221
|
+
apiKeys: v1ApiKeyParamsV2[];
|
|
222
|
+
authenticators: v1AuthenticatorParamsV2[];
|
|
223
|
+
oauthProviders: ({ // v1OauthProviderParamsV2
|
|
224
|
+
providerName: string;
|
|
225
|
+
} & (
|
|
226
|
+
| { oidcToken: string }
|
|
227
|
+
| { oidcClaims: { iss: string; sub: string; aud: string } }
|
|
228
|
+
))[];
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
***
|
|
233
|
+
|
|
234
|
+
### `CREATE_USERS`
|
|
235
|
+
|
|
236
|
+
`ACTIVITY_TYPE_CREATE_USERS_V3` → `ACTIVITY_TYPE_CREATE_USERS_V4`
|
|
237
|
+
|
|
238
|
+
**What changed:** `users` items updated from `v1UserParamsV3` → `v1UserParamsV4`, which updates `oauthProviders` from `v1OauthProviderParams` → `v1OauthProviderParamsV2`.
|
|
239
|
+
|
|
240
|
+
```ts
|
|
241
|
+
// before — v1UserParamsV3
|
|
242
|
+
{
|
|
243
|
+
userName: string;
|
|
244
|
+
userEmail?: string;
|
|
245
|
+
userPhoneNumber?: string;
|
|
246
|
+
apiKeys: v1ApiKeyParamsV2[];
|
|
247
|
+
authenticators: v1AuthenticatorParamsV2[];
|
|
248
|
+
oauthProviders: { // v1OauthProviderParams
|
|
249
|
+
providerName: string;
|
|
250
|
+
oidcToken: string; // was required
|
|
251
|
+
}[];
|
|
252
|
+
userTags: string[];
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// after — v1UserParamsV4
|
|
256
|
+
{
|
|
257
|
+
userName: string;
|
|
258
|
+
userEmail?: string;
|
|
259
|
+
userPhoneNumber?: string;
|
|
260
|
+
apiKeys: v1ApiKeyParamsV2[];
|
|
261
|
+
authenticators: v1AuthenticatorParamsV2[];
|
|
262
|
+
oauthProviders: ({ // v1OauthProviderParamsV2
|
|
263
|
+
providerName: string;
|
|
264
|
+
} & (
|
|
265
|
+
| { oidcToken: string }
|
|
266
|
+
| { oidcClaims: { iss: string; sub: string; aud: string } }
|
|
267
|
+
))[];
|
|
268
|
+
userTags: string[];
|
|
269
|
+
}
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### Patch Changes
|
|
273
|
+
|
|
274
|
+
- Updated dependencies []:
|
|
275
|
+
- @turnkey/api-key-stamper@0.6.6
|
|
276
|
+
|
|
3
277
|
## 3.18.1
|
|
4
278
|
|
|
5
279
|
### Patch Changes
|
|
6
280
|
|
|
281
|
+
- [#1269](https://github.com/tkhq/sdk/pull/1269) [`ef66673`](https://github.com/tkhq/sdk/commit/ef6667325d210c8aa0ea4c1d11d834ff28ddb66c) Author [@ethankonk](https://github.com/ethankonk) - Sync with v2026.4.5 of mono
|
|
282
|
+
|
|
7
283
|
- Updated dependencies []:
|
|
8
284
|
- @turnkey/api-key-stamper@0.6.5
|
|
9
285
|
|
|
@@ -78,7 +354,7 @@
|
|
|
78
354
|
|
|
79
355
|
The following activity types have been versioned:
|
|
80
356
|
- `ACTIVITY_TYPE_INIT_OTP` → `ACTIVITY_TYPE_INIT_OTP_V2`
|
|
81
|
-
- `ACTIVITY_TYPE_INIT_OTP_AUTH_V2` → `
|
|
357
|
+
- `ACTIVITY_TYPE_INIT_OTP_AUTH_V2` → `ACTIVITY_TYPE_INIT_OTP_AUTH_V3`
|
|
82
358
|
- `ACTIVITY_TYPE_EMAIL_AUTH_V2` → `ACTIVITY_TYPE_EMAIL_AUTH_V3`
|
|
83
359
|
- `ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY` -> `ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY_V2`
|
|
84
360
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/__fixtures__/shared.ts"],"names":[],"mappings":"AAKA,wBAAsB,WAAW,IAAI,OAAO,CAAC;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC,CA2BD"}
|