@turnkey/sdk-types 0.14.0 → 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.
package/CHANGELOG.md CHANGED
@@ -1,11 +1,232 @@
1
1
  # @turnkey/sdk-types
2
2
 
3
+ ## 1.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#1250](https://github.com/tkhq/sdk/pull/1250) [`6128132`](https://github.com/tkhq/sdk/commit/6128132d910f658cdf83ecc1dec6598eb20c008a) Author [@moeodeh3](https://github.com/moeodeh3) - ### `INIT_OTP`
8
+
9
+ `ACTIVITY_TYPE_INIT_OTP_V2` → `ACTIVITY_TYPE_INIT_OTP_V3`
10
+
11
+ **What changed:** Added required `otpEncryptionTargetBundle` to the result.
12
+
13
+ ```ts
14
+ // before — v1InitOtpResult
15
+ {
16
+ otpId: string;
17
+ }
18
+
19
+ // after — v1InitOtpResultV2
20
+ {
21
+ otpId: string;
22
+ otpEncryptionTargetBundle: string; // new
23
+ }
24
+ ```
25
+
26
+ ***
27
+
28
+ ### `VERIFY_OTP`
29
+
30
+ `ACTIVITY_TYPE_VERIFY_OTP` → `ACTIVITY_TYPE_VERIFY_OTP_V2`
31
+
32
+ **What changed:** Replaced plaintext `otpCode` + `publicKey` with a single `encryptedOtpBundle`.
33
+
34
+ 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.
35
+
36
+ Use `encryptOtpCodeToBundle` from `@turnkey/crypto` to build the bundle:
37
+
38
+ ```ts
39
+ import { encryptOtpCodeToBundle } from "@turnkey/crypto";
40
+
41
+ const { otpId, otpEncryptionTargetBundle } = await client.initOtp({ ... });
42
+
43
+ // After the user enters their OTP code:
44
+ const encryptedOtpBundle = await encryptOtpCodeToBundle(
45
+ otpCode, // the code the user entered
46
+ otpEncryptionTargetBundle, // from the initOtp response
47
+ publicKey, // your target public key
48
+ );
49
+
50
+ await client.verifyOtp({
51
+ otpId,
52
+ encryptedOtpBundle,
53
+ });
54
+ ```
55
+
56
+ ```ts
57
+ // before — v1VerifyOtpIntent
58
+ {
59
+ otpId: string;
60
+ otpCode: string; // removed
61
+ expirationSeconds?: string;
62
+ publicKey?: string; // removed
63
+ }
64
+
65
+ // after — v1VerifyOtpIntentV2
66
+ {
67
+ otpId: string;
68
+ encryptedOtpBundle: string; // new — replaces otpCode + publicKey
69
+ expirationSeconds?: string;
70
+ }
71
+ ```
72
+
73
+ ***
74
+
75
+ ### `OTP_LOGIN`
76
+
77
+ `ACTIVITY_TYPE_OTP_LOGIN` → `ACTIVITY_TYPE_OTP_LOGIN_V2`
78
+
79
+ **What changed:** `clientSignature` promoted from optional to required.
80
+
81
+ ```ts
82
+ // before — v1OtpLoginIntent
83
+ {
84
+ verificationToken: string;
85
+ publicKey: string;
86
+ expirationSeconds?: string;
87
+ invalidateExisting?: boolean;
88
+ clientSignature?: v1ClientSignature; // optional
89
+ }
90
+
91
+ // after — v1OtpLoginIntentV2
92
+ {
93
+ verificationToken: string;
94
+ publicKey: string;
95
+ expirationSeconds?: string;
96
+ invalidateExisting?: boolean;
97
+ clientSignature: v1ClientSignature; // now required
98
+ }
99
+ ```
100
+
101
+ ***
102
+
103
+ ### `CREATE_OAUTH_PROVIDERS`
104
+
105
+ `ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS` → `ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS_V2`
106
+
107
+ **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.
108
+
109
+ ```ts
110
+ // before — v1OauthProviderParams
111
+ {
112
+ providerName: string;
113
+ oidcToken: string;
114
+ }
115
+
116
+ // after — v1OauthProviderParamsV2
117
+ {
118
+ providerName: string;
119
+ } & (
120
+ | { oidcToken: string }
121
+ | { oidcClaims: { iss: string; sub: string; aud: string } }
122
+ )
123
+ ```
124
+
125
+ ***
126
+
127
+ ### `CREATE_SUB_ORGANIZATION`
128
+
129
+ `ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7` → `ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V8`
130
+
131
+ **What changed:** `rootUsers` items updated from `v1RootUserParamsV4` → `v1RootUserParamsV5`, which updates `oauthProviders` from `v1OauthProviderParams` → `v1OauthProviderParamsV2`.
132
+
133
+ ```ts
134
+ // before — v1RootUserParamsV4
135
+ {
136
+ userName: string;
137
+ userEmail?: string;
138
+ userPhoneNumber?: string;
139
+ apiKeys: v1ApiKeyParamsV2[];
140
+ authenticators: v1AuthenticatorParamsV2[];
141
+ oauthProviders: { // v1OauthProviderParams
142
+ providerName: string;
143
+ oidcToken: string; // was required
144
+ }[];
145
+ }
146
+
147
+ // after — v1RootUserParamsV5
148
+ {
149
+ userName: string;
150
+ userEmail?: string;
151
+ userPhoneNumber?: string;
152
+ apiKeys: v1ApiKeyParamsV2[];
153
+ authenticators: v1AuthenticatorParamsV2[];
154
+ oauthProviders: ({ // v1OauthProviderParamsV2
155
+ providerName: string;
156
+ } & (
157
+ | { oidcToken: string }
158
+ | { oidcClaims: { iss: string; sub: string; aud: string } }
159
+ ))[];
160
+ }
161
+ ```
162
+
163
+ ***
164
+
165
+ ### `CREATE_USERS`
166
+
167
+ `ACTIVITY_TYPE_CREATE_USERS_V3` → `ACTIVITY_TYPE_CREATE_USERS_V4`
168
+
169
+ **What changed:** `users` items updated from `v1UserParamsV3` → `v1UserParamsV4`, which updates `oauthProviders` from `v1OauthProviderParams` → `v1OauthProviderParamsV2`.
170
+
171
+ ```ts
172
+ // before — v1UserParamsV3
173
+ {
174
+ userName: string;
175
+ userEmail?: string;
176
+ userPhoneNumber?: string;
177
+ apiKeys: v1ApiKeyParamsV2[];
178
+ authenticators: v1AuthenticatorParamsV2[];
179
+ oauthProviders: { // v1OauthProviderParams
180
+ providerName: string;
181
+ oidcToken: string; // was required
182
+ }[];
183
+ userTags: string[];
184
+ }
185
+
186
+ // after — v1UserParamsV4
187
+ {
188
+ userName: string;
189
+ userEmail?: string;
190
+ userPhoneNumber?: string;
191
+ apiKeys: v1ApiKeyParamsV2[];
192
+ authenticators: v1AuthenticatorParamsV2[];
193
+ oauthProviders: ({ // v1OauthProviderParamsV2
194
+ providerName: string;
195
+ } & (
196
+ | { oidcToken: string }
197
+ | { oidcClaims: { iss: string; sub: string; aud: string } }
198
+ ))[];
199
+ userTags: string[];
200
+ }
201
+ ```
202
+
203
+ ### Minor Changes
204
+
205
+ - [#1250](https://github.com/tkhq/sdk/pull/1250) [`34522d4`](https://github.com/tkhq/sdk/commit/34522d447592138a82d34cd690091315f9748edb) Author [@moeodeh3](https://github.com/moeodeh3) - Add `SignatureFormat` enum with `Der` and `Raw` options
206
+
207
+ - [#1286](https://github.com/tkhq/sdk/pull/1286) [`7a36539`](https://github.com/tkhq/sdk/commit/7a36539196856a8bd4ca4c54115fa9874ccc83fa) Author [@moeodeh3](https://github.com/moeodeh3) - Add `DELETE_API_KEY_PAIR_ERROR` to `TurnkeyErrorCodes`
208
+ Add `INITIALIZE_API_KEY_STAMPER_ERROR` to `TurnkeyErrorCodes`
209
+ Add `INITIALIZE_PASSKEY_STAMPER_ERROR` to `TurnkeyErrorCodes`
210
+ Add `INITIALIZE_WALLET_MANAGER_ERROR` to `TurnkeyErrorCodes`
211
+
212
+ - [#1225](https://github.com/tkhq/sdk/pull/1225) [`5624d54`](https://github.com/tkhq/sdk/commit/5624d5417d2cc30032ca4ce71da0a5c7ab9a462d) Author [@ethankonk](https://github.com/ethankonk) - Fixed nested enums in types, now generates the enum values rather than generating them as strings
213
+
214
+ - [#1280](https://github.com/tkhq/sdk/pull/1280) [`7b80b1e`](https://github.com/tkhq/sdk/commit/7b80b1e9755b83988b5e49c34dff13dd92d9932f) Author [@hadrelandon](https://github.com/hadrelandon) - Added a new error code `INVALID_OAUTH_STATE` in `TurnkeyErrorCodes`.
215
+
216
+ ### Patch Changes
217
+
218
+ - [#1225](https://github.com/tkhq/sdk/pull/1225) [`47c0ca4`](https://github.com/tkhq/sdk/commit/47c0ca4696c8a518f95550c35cfe4cb4985a2633) Author [@ethankonk](https://github.com/ethankonk) - Added `Stamp`, `Activity` response + status, `TurnkeyRequestError`, and `GrpcStatus` types
219
+
3
220
  ## 0.14.0
4
221
 
5
222
  ### Minor Changes
6
223
 
7
224
  - [#1258](https://github.com/tkhq/sdk/pull/1258) [`8209887`](https://github.com/tkhq/sdk/commit/8209887d48bae7ea617645603a156aeb1cfbd2e7) Author [@moeodeh3](https://github.com/moeodeh3) - Added a new error code `NO_PKCE_VERIFIER_FOUND` in `TurnkeyErrorCodes`
8
225
 
226
+ ### Patch Changes
227
+
228
+ - [#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
229
+
9
230
  ## 0.13.0
10
231
 
11
232
  ### Minor Changes