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.
- package/README.md +25 -4
- package/dist/{cauthy-CKfvvv_i.d.ts → cauthy-BUozWD72.d.ts} +1 -1
- package/dist/{cauthy-2jtP2LVQ.d.mts → cauthy-C-GoRXy9.d.mts} +1 -1
- package/dist/cli.js +1 -1
- package/dist/client.d.mts +7 -3
- package/dist/client.d.ts +7 -3
- package/dist/client.js.map +1 -1
- package/dist/client.mjs.map +1 -1
- package/dist/express.d.mts +2 -2
- package/dist/express.d.ts +2 -2
- package/dist/fastify.d.mts +2 -2
- package/dist/fastify.d.ts +2 -2
- package/dist/hono.d.mts +2 -2
- package/dist/hono.d.ts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -1
- package/dist/index.mjs.map +1 -1
- package/dist/next.d.mts +2 -2
- package/dist/next.d.ts +2 -2
- package/dist/react.d.mts +59 -8
- package/dist/react.d.ts +59 -8
- package/dist/react.js +188 -113
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +191 -116
- package/dist/react.mjs.map +1 -1
- package/dist/svelte.d.mts +2 -2
- package/dist/svelte.d.ts +2 -2
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs.map +1 -1
- package/dist/{system-BvvoNs2y.d.ts → system-Bz4haPrI.d.ts} +10 -2
- package/dist/{system-BrrJsrFW.d.mts → system-DUGV040y.d.mts} +10 -2
- package/dist/vue.d.mts +2 -2
- package/dist/vue.d.ts +2 -2
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -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-
|
|
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-
|
|
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-
|
|
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-
|
|
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';
|