@nuclia/core
Advanced tools
Comparing version 1.14.1 to 1.14.2
@@ -0,1 +1,7 @@ | ||
# 1.14.2 (2024-03-15) | ||
### Improvements | ||
- Allow to check authorization on endpoints | ||
# 1.14.1 (2024-03-14) | ||
@@ -2,0 +8,0 @@ |
import type { Observable } from 'rxjs'; | ||
import type { AuthTokens, JwtUser } from './auth'; | ||
import { Account, AccountCreation, AccountModification, AccountStatus, AccountTypes, EventList, IKnowledgeBoxItem, IStandaloneKb, KbIndex, KnowledgeBox, KnowledgeBoxCreation, LearningConfigurations, NUAClient, NUAClientPayload, PredictedToken, ProcessingPullResponse, ProcessingPushResponse, ProcessingStat, StatsPeriod, StatsRange, StatsType, Welcome, WritableKnowledgeBox } from './db'; | ||
import type { AuthTokens, JwtUser, NucliaDBRole } from './auth'; | ||
import { Account, AccountCreation, AccountModification, AccountStatus, AccountTypes, EventList, IKnowledgeBoxItem, IStandaloneKb, KBRoles, KbIndex, KnowledgeBox, KnowledgeBoxCreation, LearningConfigurations, NUAClient, NUAClientPayload, PredictedToken, ProcessingPullResponse, ProcessingPushResponse, ProcessingStat, StatsPeriod, StatsRange, StatsType, Welcome, WritableKnowledgeBox } from './db'; | ||
export interface INuclia { | ||
@@ -73,2 +73,6 @@ options: NucliaOptions; | ||
}>; | ||
checkAuthorization(path: string): Observable<{ | ||
allowed: boolean; | ||
roles: (KBRoles | NucliaDBRole)[]; | ||
}>; | ||
} | ||
@@ -75,0 +79,0 @@ export interface IDb { |
import { Observable } from 'rxjs'; | ||
import type { INuclia, IRest } from '../models'; | ||
import { KBRoles } from '../db/kb/kb.models'; | ||
import { NucliaDBRole } from '../auth/auth.models'; | ||
export declare const ABORT_STREAMING_REASON = "Stop listening to streaming"; | ||
@@ -50,3 +52,10 @@ /** | ||
*/ | ||
getFullUrl(path: string, zoneSlug?: string): string; | ||
getFullUrl(path: string, zoneSlug?: string, insertAuthorizer?: boolean): string; | ||
/** | ||
* Check if the user has access to the given endpoint, and return the corresponding roles. | ||
* */ | ||
checkAuthorization(endpoint: string): Observable<{ | ||
allowed: boolean; | ||
roles: (KBRoles | NucliaDBRole)[]; | ||
}>; | ||
/** Returns a dictionary giving the geographical zones available slugs by unique ids. */ | ||
@@ -53,0 +62,0 @@ getZones(): Observable<{ |
{ | ||
"name": "@nuclia/core", | ||
"version": "1.14.1", | ||
"version": "1.14.2", | ||
"description": "SDK allowing to integrate Nuclia services in your frontend application", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
import type { Observable } from 'rxjs'; | ||
import type { AuthTokens, JwtUser } from './auth'; | ||
import { Account, AccountCreation, AccountModification, AccountStatus, AccountTypes, EventList, IKnowledgeBoxItem, IStandaloneKb, KbIndex, KnowledgeBox, KnowledgeBoxCreation, LearningConfigurations, NUAClient, NUAClientPayload, PredictedToken, ProcessingPullResponse, ProcessingPushResponse, ProcessingStat, StatsPeriod, StatsRange, StatsType, Welcome, WritableKnowledgeBox } from './db'; | ||
import type { AuthTokens, JwtUser, NucliaDBRole } from './auth'; | ||
import { Account, AccountCreation, AccountModification, AccountStatus, AccountTypes, EventList, IKnowledgeBoxItem, IStandaloneKb, KBRoles, KbIndex, KnowledgeBox, KnowledgeBoxCreation, LearningConfigurations, NUAClient, NUAClientPayload, PredictedToken, ProcessingPullResponse, ProcessingPushResponse, ProcessingStat, StatsPeriod, StatsRange, StatsType, Welcome, WritableKnowledgeBox } from './db'; | ||
export interface INuclia { | ||
@@ -73,2 +73,6 @@ options: NucliaOptions; | ||
}>; | ||
checkAuthorization(path: string): Observable<{ | ||
allowed: boolean; | ||
roles: (KBRoles | NucliaDBRole)[]; | ||
}>; | ||
} | ||
@@ -75,0 +79,0 @@ export interface IDb { |
import { Observable } from 'rxjs'; | ||
import type { INuclia, IRest } from '../models'; | ||
import { KBRoles } from '../db/kb/kb.models'; | ||
import { NucliaDBRole } from '../auth/auth.models'; | ||
export declare const ABORT_STREAMING_REASON = "Stop listening to streaming"; | ||
@@ -50,3 +52,10 @@ /** | ||
*/ | ||
getFullUrl(path: string, zoneSlug?: string): string; | ||
getFullUrl(path: string, zoneSlug?: string, insertAuthorizer?: boolean): string; | ||
/** | ||
* Check if the user has access to the given endpoint, and return the corresponding roles. | ||
* */ | ||
checkAuthorization(endpoint: string): Observable<{ | ||
allowed: boolean; | ||
roles: (KBRoles | NucliaDBRole)[]; | ||
}>; | ||
/** Returns a dictionary giving the geographical zones available slugs by unique ids. */ | ||
@@ -53,0 +62,0 @@ getZones(): Observable<{ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
457224
8892