cauthy-auth 0.32.0 → 0.34.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.
@@ -467,10 +467,10 @@ interface SystemOptions {
467
467
  /** Cauthy refused a request of the application's own. */
468
468
  declare class CauthyApiError extends Error {
469
469
  readonly status: number;
470
- /** Cauthy's code for what went wrong: `organization_not_found`, `other_system`, `outside_system_scope`… */
470
+ /** Cauthy's code for what went wrong: `organization_not_found`, `other_system`, `outside_system_scope`, `member_exists`… */
471
471
  readonly code: string;
472
472
  constructor(status: number,
473
- /** Cauthy's code for what went wrong: `organization_not_found`, `other_system`, `outside_system_scope`… */
473
+ /** Cauthy's code for what went wrong: `organization_not_found`, `other_system`, `outside_system_scope`, `member_exists`… */
474
474
  code: string, message: string);
475
475
  }
476
476
  /** An organization of the application's system. Every moment is UTC. */
@@ -502,6 +502,13 @@ type NewMember = {
502
502
  role: string;
503
503
  name?: string;
504
504
  locale?: string;
505
+ /**
506
+ * Adds and nothing else (the default): a person who already belongs keeps
507
+ * their role, and the call throws `CauthyApiError` with code
508
+ * `member_exists` (409). `false` sets the role of whoever is already
509
+ * there, as `setRole` does.
510
+ */
511
+ onlyNew?: boolean;
505
512
  } & ({
506
513
  userId: string;
507
514
  email?: undefined;
@@ -542,6 +549,7 @@ interface CauthySystem {
542
549
  };
543
550
  members: {
544
551
  list(organizationId: string): Promise<OrganizationMember[]>;
552
+ /** Adds a person; one who already belongs throws `member_exists` unless `onlyNew: false`. */
545
553
  add(organizationId: string, member: NewMember): Promise<OrganizationMember>;
546
554
  setRole(organizationId: string, userId: string, role: string): Promise<OrganizationMember>;
547
555
  remove(organizationId: string, userId: string): Promise<void>;
@@ -467,10 +467,10 @@ interface SystemOptions {
467
467
  /** Cauthy refused a request of the application's own. */
468
468
  declare class CauthyApiError extends Error {
469
469
  readonly status: number;
470
- /** Cauthy's code for what went wrong: `organization_not_found`, `other_system`, `outside_system_scope`… */
470
+ /** Cauthy's code for what went wrong: `organization_not_found`, `other_system`, `outside_system_scope`, `member_exists`… */
471
471
  readonly code: string;
472
472
  constructor(status: number,
473
- /** Cauthy's code for what went wrong: `organization_not_found`, `other_system`, `outside_system_scope`… */
473
+ /** Cauthy's code for what went wrong: `organization_not_found`, `other_system`, `outside_system_scope`, `member_exists`… */
474
474
  code: string, message: string);
475
475
  }
476
476
  /** An organization of the application's system. Every moment is UTC. */
@@ -502,6 +502,13 @@ type NewMember = {
502
502
  role: string;
503
503
  name?: string;
504
504
  locale?: string;
505
+ /**
506
+ * Adds and nothing else (the default): a person who already belongs keeps
507
+ * their role, and the call throws `CauthyApiError` with code
508
+ * `member_exists` (409). `false` sets the role of whoever is already
509
+ * there, as `setRole` does.
510
+ */
511
+ onlyNew?: boolean;
505
512
  } & ({
506
513
  userId: string;
507
514
  email?: undefined;
@@ -542,6 +549,7 @@ interface CauthySystem {
542
549
  };
543
550
  members: {
544
551
  list(organizationId: string): Promise<OrganizationMember[]>;
552
+ /** Adds a person; one who already belongs throws `member_exists` unless `onlyNew: false`. */
545
553
  add(organizationId: string, member: NewMember): Promise<OrganizationMember>;
546
554
  setRole(organizationId: string, userId: string, role: string): Promise<OrganizationMember>;
547
555
  remove(organizationId: string, userId: string): Promise<void>;
package/dist/vue.d.mts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { ShallowRef, Plugin } from 'vue';
2
2
  import { SessionStore, SessionState, SessionStoreOptions, AuthClient } from './client.mjs';
3
3
  export { Account, AccountSession, AuthError, AuthMethods, AuthResult, Passkey, PasskeyKind, SSOConnection } from './client.mjs';
4
- import { q as PublicSession } from './system-BrrJsrFW.mjs';
5
- export { P as PermissionOf, m as Policy, R as RoleOf, s as SessionOrganization, u as SessionUser, y as can, B as definePolicy } from './system-BrrJsrFW.mjs';
4
+ import { q as PublicSession } from './system-DUGV040y.mjs';
5
+ export { P as PermissionOf, m as Policy, R as RoleOf, s as SessionOrganization, u as SessionUser, y as can, B as definePolicy } from './system-DUGV040y.mjs';
6
6
  import './theme.mjs';
7
7
  import './validate-sEXG82po.mjs';
8
8
  import 'jose';
package/dist/vue.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { ShallowRef, Plugin } from 'vue';
2
2
  import { SessionStore, SessionState, SessionStoreOptions, AuthClient } from './client.js';
3
3
  export { Account, AccountSession, AuthError, AuthMethods, AuthResult, Passkey, PasskeyKind, SSOConnection } from './client.js';
4
- import { q as PublicSession } from './system-BvvoNs2y.js';
5
- export { P as PermissionOf, m as Policy, R as RoleOf, s as SessionOrganization, u as SessionUser, y as can, B as definePolicy } from './system-BvvoNs2y.js';
4
+ import { q as PublicSession } from './system-Bz4haPrI.js';
5
+ export { P as PermissionOf, m as Policy, R as RoleOf, s as SessionOrganization, u as SessionUser, y as can, B as definePolicy } from './system-Bz4haPrI.js';
6
6
  import './theme.js';
7
7
  import './validate-sEXG82po.js';
8
8
  import 'jose';