@nurama/sdk 1.4.1 → 1.4.3
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/browser/nurama-bot-sdk.js +135 -4
- package/dist/browser/nurama-bot-sdk.min.js +1 -1
- package/dist/browser/nurama-sdk.js +135 -4
- package/dist/browser/nurama-sdk.min.js +1 -1
- package/dist/routes/auth.d.ts +45 -1
- package/dist/routes/auth.d.ts.map +1 -1
- package/dist/routes/auth.js +92 -0
- package/dist/routes/auth.js.map +1 -1
- package/dist/routes/device.d.ts +16 -1
- package/dist/routes/device.d.ts.map +1 -1
- package/dist/routes/device.js +34 -0
- package/dist/routes/device.js.map +1 -1
- package/dist/version.js +4 -4
- package/package.json +2 -2
- package/src/routes/auth.ts +108 -0
- package/src/routes/device.ts +38 -0
- package/src/version.ts +4 -4
|
@@ -4156,6 +4156,103 @@
|
|
|
4156
4156
|
});
|
|
4157
4157
|
return result;
|
|
4158
4158
|
},
|
|
4159
|
+
/**
|
|
4160
|
+
* Gets the options for the browser's passkey sign-in prompt. Pass them to the WebAuthn library
|
|
4161
|
+
* (`startAuthentication` in @simplewebauthn/browser), then send its result to `loginWithPasskey`.
|
|
4162
|
+
* @returns Promise resolving to WebAuthn request options.
|
|
4163
|
+
*/
|
|
4164
|
+
async getPasskeyLoginOptions() {
|
|
4165
|
+
return client._request({
|
|
4166
|
+
endpoint: "/v1/auth/passkeys/login-options",
|
|
4167
|
+
method: "POST",
|
|
4168
|
+
sendJWT: false
|
|
4169
|
+
});
|
|
4170
|
+
},
|
|
4171
|
+
/**
|
|
4172
|
+
* Signs in with the browser's response to the passkey prompt and stores the tokens.
|
|
4173
|
+
* A passkey stands in for two-factor, so this never returns an MFA challenge.
|
|
4174
|
+
* @param credential - The WebAuthn library's AuthenticationResponseJSON.
|
|
4175
|
+
* @returns Promise resolving to the user and tokens.
|
|
4176
|
+
*/
|
|
4177
|
+
async loginWithPasskey(credential) {
|
|
4178
|
+
const result = await client._request({
|
|
4179
|
+
endpoint: "/v1/auth/passkeys/login",
|
|
4180
|
+
method: "POST",
|
|
4181
|
+
body: { credential },
|
|
4182
|
+
sendJWT: false
|
|
4183
|
+
});
|
|
4184
|
+
client._setTokens(
|
|
4185
|
+
result.tokens.access.token,
|
|
4186
|
+
result.tokens.refresh.token,
|
|
4187
|
+
result.tokens.access.expires,
|
|
4188
|
+
result.tokens.refresh.expires
|
|
4189
|
+
);
|
|
4190
|
+
return result;
|
|
4191
|
+
},
|
|
4192
|
+
/**
|
|
4193
|
+
* Gets the options for the browser's "create a passkey" prompt, after confirming who is asking.
|
|
4194
|
+
* @param proof - The password when the account has one, and a two-factor code when two-factor is on.
|
|
4195
|
+
* @returns Promise resolving to WebAuthn creation options.
|
|
4196
|
+
*/
|
|
4197
|
+
async getPasskeyRegistrationOptions(proof = {}) {
|
|
4198
|
+
return client._request({
|
|
4199
|
+
endpoint: "/v1/auth/passkeys/registration-options",
|
|
4200
|
+
method: "POST",
|
|
4201
|
+
body: proof,
|
|
4202
|
+
sendJWT: true
|
|
4203
|
+
});
|
|
4204
|
+
},
|
|
4205
|
+
/**
|
|
4206
|
+
* Saves the passkey the browser created.
|
|
4207
|
+
* @param credential - The WebAuthn library's RegistrationResponseJSON.
|
|
4208
|
+
* @param name - Optional name to tell it apart, e.g. "MacBook".
|
|
4209
|
+
* @returns Promise resolving to the saved passkey.
|
|
4210
|
+
*/
|
|
4211
|
+
async registerPasskey(credential, name) {
|
|
4212
|
+
return client._request({
|
|
4213
|
+
endpoint: "/v1/auth/passkeys",
|
|
4214
|
+
method: "POST",
|
|
4215
|
+
body: { credential, ...name ? { name } : {} },
|
|
4216
|
+
sendJWT: true
|
|
4217
|
+
});
|
|
4218
|
+
},
|
|
4219
|
+
/**
|
|
4220
|
+
* Lists the authenticated user's passkeys, oldest first.
|
|
4221
|
+
* @returns Promise resolving to the user's passkeys.
|
|
4222
|
+
*/
|
|
4223
|
+
async listPasskeys() {
|
|
4224
|
+
return client._request({
|
|
4225
|
+
endpoint: "/v1/auth/passkeys",
|
|
4226
|
+
method: "GET",
|
|
4227
|
+
sendJWT: true
|
|
4228
|
+
});
|
|
4229
|
+
},
|
|
4230
|
+
/**
|
|
4231
|
+
* Renames one of the authenticated user's passkeys.
|
|
4232
|
+
* @param passkeyId - The passkey's id.
|
|
4233
|
+
* @param name - The new name.
|
|
4234
|
+
* @returns Promise resolving to the renamed passkey.
|
|
4235
|
+
*/
|
|
4236
|
+
async renamePasskey(passkeyId, name) {
|
|
4237
|
+
return client._request({
|
|
4238
|
+
endpoint: `/v1/auth/passkeys/${passkeyId}`,
|
|
4239
|
+
method: "PATCH",
|
|
4240
|
+
body: { name },
|
|
4241
|
+
sendJWT: true
|
|
4242
|
+
});
|
|
4243
|
+
},
|
|
4244
|
+
/**
|
|
4245
|
+
* Removes one of the authenticated user's passkeys.
|
|
4246
|
+
* @param passkeyId - The passkey's id.
|
|
4247
|
+
* @returns Promise resolving when complete.
|
|
4248
|
+
*/
|
|
4249
|
+
async deletePasskey(passkeyId) {
|
|
4250
|
+
await client._request({
|
|
4251
|
+
endpoint: `/v1/auth/passkeys/${passkeyId}`,
|
|
4252
|
+
method: "DELETE",
|
|
4253
|
+
sendJWT: true
|
|
4254
|
+
});
|
|
4255
|
+
},
|
|
4159
4256
|
/**
|
|
4160
4257
|
* Unlinks an OAuth provider from the authenticated user's account.
|
|
4161
4258
|
* User must have at least one authentication method remaining (password or another OAuth provider).
|
|
@@ -9785,6 +9882,40 @@
|
|
|
9785
9882
|
endpoint: `/v1/devices/${deviceId}`,
|
|
9786
9883
|
sendJWT: true
|
|
9787
9884
|
});
|
|
9885
|
+
},
|
|
9886
|
+
/**
|
|
9887
|
+
* Register or refresh an iOS upload Live Activity, so the API carries it on by push through post-processing
|
|
9888
|
+
* while the app is suspended. Send the activity's push token and the app's view of the batch; send it again
|
|
9889
|
+
* as the batch changes. Requires authentication.
|
|
9890
|
+
* @param {string} activityId - ActivityKit's id for the activity.
|
|
9891
|
+
* @param {RegisterLiveActivityBody} body - Push token, APNs environment and the batch's files.
|
|
9892
|
+
* @returns {Promise<LiveActivityRegistration>} The activity id and the batch's stage.
|
|
9893
|
+
*/
|
|
9894
|
+
async registerLiveActivity(activityId, body) {
|
|
9895
|
+
if (!activityId) {
|
|
9896
|
+
throw new Error("activityId is required.");
|
|
9897
|
+
}
|
|
9898
|
+
return client._request({
|
|
9899
|
+
method: "PUT",
|
|
9900
|
+
endpoint: `/v1/devices/live-activities/${activityId}`,
|
|
9901
|
+
body,
|
|
9902
|
+
sendJWT: true
|
|
9903
|
+
});
|
|
9904
|
+
},
|
|
9905
|
+
/**
|
|
9906
|
+
* Stop following an upload Live Activity (the app ended it). Requires authentication.
|
|
9907
|
+
* @param {string} activityId - ActivityKit's id for the activity.
|
|
9908
|
+
* @returns {Promise<void>}
|
|
9909
|
+
*/
|
|
9910
|
+
async endLiveActivity(activityId) {
|
|
9911
|
+
if (!activityId) {
|
|
9912
|
+
throw new Error("activityId is required.");
|
|
9913
|
+
}
|
|
9914
|
+
return client._request({
|
|
9915
|
+
method: "DELETE",
|
|
9916
|
+
endpoint: `/v1/devices/live-activities/${activityId}`,
|
|
9917
|
+
sendJWT: true
|
|
9918
|
+
});
|
|
9788
9919
|
}
|
|
9789
9920
|
};
|
|
9790
9921
|
}
|
|
@@ -11225,10 +11356,10 @@
|
|
|
11225
11356
|
|
|
11226
11357
|
// src/version.ts
|
|
11227
11358
|
var SDK_VERSION = {
|
|
11228
|
-
version: "1.4.
|
|
11229
|
-
buildTimestamp: "2026-10-
|
|
11230
|
-
buildHash: "
|
|
11231
|
-
gitCommit: "
|
|
11359
|
+
version: "1.4.3",
|
|
11360
|
+
buildTimestamp: "2026-10-14T13:35:12.378Z",
|
|
11361
|
+
buildHash: "df74c9b4b055b19a9012e0c265c3b94f",
|
|
11362
|
+
gitCommit: "b66adea",
|
|
11232
11363
|
dirty: false
|
|
11233
11364
|
};
|
|
11234
11365
|
|