@camstack/sdk 1.1.20 → 1.1.21

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/index.cjs CHANGED
@@ -979,6 +979,29 @@ var System = class {
979
979
  }
980
980
  return result;
981
981
  }
982
+ /**
983
+ * Usernameless (passkey-FIRST) login — step 1. Fetches discoverable-
984
+ * credential assertion options (EMPTY `allowCredentials`); the caller
985
+ * feeds `optionsJSON` to `@simplewebauthn/browser` `startAuthentication`
986
+ * and the browser's own passkey picker takes over. PUBLIC (pre-session,
987
+ * no challenge token — the WebAuthn challenge is the whole state).
988
+ */
989
+ async passkeyLoginBegin() {
990
+ return await this._trpcClient.auth.passkeyLoginBegin.mutate();
991
+ }
992
+ /**
993
+ * Usernameless login — step 2. Submits the browser assertion; on
994
+ * success the server resolves the credential's owner and mints the
995
+ * real session JWT, which we set as the active token on this client.
996
+ */
997
+ async passkeyLoginFinish(response) {
998
+ const result = await this._trpcClient.auth.passkeyLoginFinish.mutate({ response });
999
+ if (typeof result === "object" && result !== null && "token" in result) {
1000
+ const token = result.token;
1001
+ if (typeof token === "string") this.setToken(token);
1002
+ }
1003
+ return result;
1004
+ }
982
1005
  async logout() {
983
1006
  await this._trpcClient.auth.logout.mutate();
984
1007
  }
package/dist/index.js CHANGED
@@ -978,6 +978,29 @@ var System = class {
978
978
  }
979
979
  return result;
980
980
  }
981
+ /**
982
+ * Usernameless (passkey-FIRST) login — step 1. Fetches discoverable-
983
+ * credential assertion options (EMPTY `allowCredentials`); the caller
984
+ * feeds `optionsJSON` to `@simplewebauthn/browser` `startAuthentication`
985
+ * and the browser's own passkey picker takes over. PUBLIC (pre-session,
986
+ * no challenge token — the WebAuthn challenge is the whole state).
987
+ */
988
+ async passkeyLoginBegin() {
989
+ return await this._trpcClient.auth.passkeyLoginBegin.mutate();
990
+ }
991
+ /**
992
+ * Usernameless login — step 2. Submits the browser assertion; on
993
+ * success the server resolves the credential's owner and mints the
994
+ * real session JWT, which we set as the active token on this client.
995
+ */
996
+ async passkeyLoginFinish(response) {
997
+ const result = await this._trpcClient.auth.passkeyLoginFinish.mutate({ response });
998
+ if (typeof result === "object" && result !== null && "token" in result) {
999
+ const token = result.token;
1000
+ if (typeof token === "string") this.setToken(token);
1001
+ }
1002
+ return result;
1003
+ }
981
1004
  async logout() {
982
1005
  await this._trpcClient.auth.logout.mutate();
983
1006
  }
package/dist/system.d.ts CHANGED
@@ -219,6 +219,24 @@ export declare class System {
219
219
  loginVerifyPasskey(challengeToken: string, response: Record<string, unknown>): Promise<{
220
220
  token: string;
221
221
  }>;
222
+ /**
223
+ * Usernameless (passkey-FIRST) login — step 1. Fetches discoverable-
224
+ * credential assertion options (EMPTY `allowCredentials`); the caller
225
+ * feeds `optionsJSON` to `@simplewebauthn/browser` `startAuthentication`
226
+ * and the browser's own passkey picker takes over. PUBLIC (pre-session,
227
+ * no challenge token — the WebAuthn challenge is the whole state).
228
+ */
229
+ passkeyLoginBegin(): Promise<{
230
+ optionsJSON: Record<string, unknown>;
231
+ }>;
232
+ /**
233
+ * Usernameless login — step 2. Submits the browser assertion; on
234
+ * success the server resolves the credential's owner and mints the
235
+ * real session JWT, which we set as the active token on this client.
236
+ */
237
+ passkeyLoginFinish(response: Record<string, unknown>): Promise<{
238
+ token: string;
239
+ }>;
222
240
  logout(): Promise<void>;
223
241
  getMe(): Promise<UserInfo>;
224
242
  changeOwnPassword(input: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/sdk",
3
- "version": "1.1.20",
3
+ "version": "1.1.21",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",