@docyrus/signin 0.17.0 → 0.18.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 +49 -6
- package/dist/{constants-CB5mfHCf.d.ts → constants-C9ezX9zG.d.ts} +19 -5
- package/dist/core-index.d.ts +3 -3
- package/dist/core-index.js +60 -12
- package/dist/core-index.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +61 -13
- package/dist/index.js.map +1 -1
- package/dist/react-native/index.d.ts +4 -4
- package/dist/react-native/index.js +61 -13
- package/dist/react-native/index.js.map +1 -1
- package/dist/{types-CFnKr6T_.d.ts → types-BcLDyMdw.d.ts} +46 -5
- package/dist/{use-docyrus-client-BYQdgvz1.d.ts → use-docyrus-client-C9uiHma9.d.ts} +1 -1
- package/dist/vue/index.d.ts +2 -2
- package/package.json +1 -1
|
@@ -293,8 +293,12 @@ interface DocyrusAuthContextValue {
|
|
|
293
293
|
signOut: () => Promise<void>;
|
|
294
294
|
/** Check if the current user has a specific role (by slug or uid) */
|
|
295
295
|
hasRole: (role: string | string[] | null | undefined) => boolean;
|
|
296
|
-
/**
|
|
297
|
-
|
|
296
|
+
/**
|
|
297
|
+
* Check if the current user has permission for an operation. Pass a data
|
|
298
|
+
* source id (or a {@link PermissionScope}) to scope it to an entity; omit it
|
|
299
|
+
* for tenant-wide operations such as `ai-access`.
|
|
300
|
+
*/
|
|
301
|
+
hasPermission: (operation: string, scope?: string | null | PermissionScope) => boolean;
|
|
298
302
|
/** Re-fetch the current user from the API */
|
|
299
303
|
refreshUser: () => Promise<void>;
|
|
300
304
|
/**
|
|
@@ -735,11 +739,43 @@ interface DocyrusRole {
|
|
|
735
739
|
slug: string;
|
|
736
740
|
rules: DocyrusAclRule[];
|
|
737
741
|
}
|
|
738
|
-
/**
|
|
742
|
+
/**
|
|
743
|
+
* An ACL rule — maps a data source to its allowed operations.
|
|
744
|
+
*
|
|
745
|
+
* Legacy shape, superseded by {@link DocyrusPermission}: every entity-less rule
|
|
746
|
+
* (ai/settings/devtools) and every app/ai-tool rule collapses into the single
|
|
747
|
+
* entry whose `dataSourceId` is null.
|
|
748
|
+
*/
|
|
739
749
|
interface DocyrusAclRule {
|
|
740
|
-
dataSourceId: string;
|
|
750
|
+
dataSourceId: string | null;
|
|
751
|
+
allowedOperations: string[];
|
|
752
|
+
}
|
|
753
|
+
/** The entity an ACL rule applies to (`core_acl_operation.target_type`) */
|
|
754
|
+
type AclTargetType = 'data_source' | 'field' | 'app' | 'ai_tool' | 'ai' | 'settings' | 'devtools';
|
|
755
|
+
/**
|
|
756
|
+
* A permission as returned by GET /v1/users/me, merged across the user's roles
|
|
757
|
+
* and keyed by target type. Entity-scoped targets carry the single id that
|
|
758
|
+
* scopes them (`data_source`/`field` → dataSourceId, `app` → appId, `ai_tool`
|
|
759
|
+
* → aiToolId); `ai`, `settings` and `devtools` are tenant-wide and carry none.
|
|
760
|
+
*/
|
|
761
|
+
interface DocyrusPermission {
|
|
762
|
+
targetType: AclTargetType;
|
|
763
|
+
dataSourceId?: string | null;
|
|
764
|
+
appId?: string | null;
|
|
765
|
+
aiToolId?: string | null;
|
|
741
766
|
allowedOperations: string[];
|
|
742
767
|
}
|
|
768
|
+
/**
|
|
769
|
+
* What a permission check applies to. Omit every id to check a tenant-wide
|
|
770
|
+
* operation such as `ai-access` or `manage_users`.
|
|
771
|
+
*/
|
|
772
|
+
interface PermissionScope {
|
|
773
|
+
dataSourceId?: string | null;
|
|
774
|
+
appId?: string | null;
|
|
775
|
+
aiToolId?: string | null;
|
|
776
|
+
/** Narrow the check to one target type; inferred from the ids when omitted. */
|
|
777
|
+
targetType?: AclTargetType;
|
|
778
|
+
}
|
|
743
779
|
/** The user object as returned by GET /v1/users/me */
|
|
744
780
|
interface DocyrusUser {
|
|
745
781
|
id: string;
|
|
@@ -750,6 +786,11 @@ interface DocyrusUser {
|
|
|
750
786
|
primaryRole: DocyrusRole | null;
|
|
751
787
|
roles: DocyrusRole[];
|
|
752
788
|
aclRules: DocyrusAclRule[];
|
|
789
|
+
/**
|
|
790
|
+
* Target-type-aware permissions. Absent on older API versions, where
|
|
791
|
+
* `aclRules` is the only shape available.
|
|
792
|
+
*/
|
|
793
|
+
permissions?: DocyrusPermission[];
|
|
753
794
|
tenant?: {
|
|
754
795
|
id: string;
|
|
755
796
|
name: string;
|
|
@@ -771,4 +812,4 @@ interface PermissionConfig {
|
|
|
771
812
|
alwaysPermittedDataSources?: Record<string, AclOperation[]>;
|
|
772
813
|
}
|
|
773
814
|
|
|
774
|
-
export {
|
|
815
|
+
export { IframeAuth as $, type AclOperation as A, type ChatSendAckMessage as B, type CalendarSendAckMessage as C, type DocyrusAuthConfig as D, type ChatSendMessage as E, type DocySendAckMessage as F, type GuidyRoute as G, type HostNavigationHandler as H, type DocySendMessage as I, type DocyrusNotification as J, type EmailSendAckMessage as K, type EmailSendMessage as L, type MsGraphAccount as M, type GuidyCommandHandler as N, type OpenAuthSessionFn as O, type PermissionConfig as P, type GuidyCommandMessage as Q, type RouteChangePayload as R, type GuidyElement as S, type GuidyElementsMessage as T, type GuidyPointAckMessage as U, type GuidyPointMessage as V, type GuidyRoutesMessage as W, type GuidyScanMessage as X, type HostNavigationMessage as Y, type HostNotificationMessage as Z, type HostSignInMessage as _, type AclTargetType as a, type MsGraphRequestMessage as a0, type MsGraphResponseMessage as a1, type MsGraphStatusRequestMessage as a2, type MsGraphStatusResponseMessage as a3, type TokenRefreshRequestMessage as a4, type AdaptiveCard as b, type AuthMode as c, type AuthSessionResult as d, type AuthStatus as e, type DocyrusAclRule as f, type DocyrusAuthContextValue as g, type DocyrusCalendarEventPayload as h, type DocyrusEmailPayload as i, type DocyrusPermission as j, type DocyrusRole as k, type DocyrusShareAdaptiveCardPayload as l, type DocyrusSharePayload as m, type DocyrusShareTextPayload as n, type DocyrusUser as o, MsGraphClient as p, type MsGraphRequest as q, type MsGraphRequestOptions as r, type MsGraphResponse as s, type MsGraphStatus as t, type PermissionScope as u, type HostNotificationHandler as v, type HostNavigationRequestOptions as w, type AppNavigationRequestMessage as x, type AppRouteChangeMessage as y, type CalendarSendMessage as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { D as DocyrusAuthConfig,
|
|
3
|
+
import { D as DocyrusAuthConfig, g as DocyrusAuthContextValue } from './types-BcLDyMdw.js';
|
|
4
4
|
import { RestApiClient } from '@docyrus/api-client';
|
|
5
5
|
|
|
6
6
|
interface DocyrusAuthProviderProps extends DocyrusAuthConfig {
|
package/dist/vue/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
2
|
import { PropType } from 'vue';
|
|
3
3
|
import { OAuth2TokenStorage, OAuth2Tokens, RestApiClient } from '@docyrus/api-client';
|
|
4
|
-
import {
|
|
5
|
-
export {
|
|
4
|
+
import { c as AuthMode, e as AuthStatus, H as HostNavigationHandler, v as HostNotificationHandler, R as RouteChangePayload, w as HostNavigationRequestOptions, m as DocyrusSharePayload, i as DocyrusEmailPayload, h as DocyrusCalendarEventPayload, p as MsGraphClient } from '../types-BcLDyMdw.js';
|
|
5
|
+
export { b as AdaptiveCard, D as DocyrusAuthConfig, l as DocyrusShareAdaptiveCardPayload, n as DocyrusShareTextPayload, M as MsGraphAccount, q as MsGraphRequest, r as MsGraphRequestOptions, s as MsGraphResponse, t as MsGraphStatus } from '../types-BcLDyMdw.js';
|
|
6
6
|
|
|
7
7
|
interface DocyrusAuthState {
|
|
8
8
|
status: AuthStatus;
|