New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@nuclia/core

Package Overview
Dependencies
Maintainers
3
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nuclia/core - npm Package Compare versions

Comparing version 1.7.0 to 1.8.0

25

CHANGELOG.md

@@ -0,1 +1,26 @@

# 1.8.0 (2023-11-10)
### Features
- Add account user management methods in `db`:
- getAccountUser: get an account user by their id
- getAccountUsers: get the list of all users of an account
- setAccountUsers: add and/or delete users from an account
- inviteToAccount: invite a user to an account
- Add Knowledge Box user management methods in `kb`:
- getUsers: get the list of Knowledge Box users
- updateUsers: update the list of Knowledge Box users
- inviteToKb: invite a user to the Knowledge Box
### Improvements
- Add `allow_kb_management` property to `NUAClientPayload`
- Add optional `zoneSlug` parameter to `getFullUrl`, `fetch`, `get`, `post`, `put` and `delete` methods.
- Add `LearningConfigurationOption` interface
- Add support for regional Knowledge Boxes
- new `getKbIndexes` method in `db` allowing to list of the KB index of an account
- update `getKnowledgeBoxes`, `getKnowledgeBox`, `createKnowledgeBox`, `WritableKnowledgeBox.modify` and `WritableKnowledgeBox.delete` methods for supporting regional endpoints when the flag `NUCLIA_NEW_REGIONAL_ENDPOINTS` is enabled
- add `getKnowledgeBoxesForZone` method listing all the KBs for an account and a zone
- support regional Knowledge Boxes on user management methods
# 1.7.0 (2023-10-19)

@@ -2,0 +27,0 @@

45

esm/libs/sdk-core/src/lib/db/db.d.ts
import { Observable } from 'rxjs';
import type { IDb, INuclia } from '../models';
import type { LearningConfigurations, PredictedToken } from './db.models';
import type { AccountUsersPayload, FullAccountUser, IDb, INuclia, InviteAccountUserPayload } from '../models';
import type { KbIndex, LearningConfigurations, PredictedToken } from './db.models';
import { Account, AccountCreation, AccountStatus, NUAClient, NUAClientPayload, ProcessingPullResponse, ProcessingPushResponse, ProcessingStat, ProcessingStatusResponse, StatsPeriod, StatsRange, StatsType, Welcome } from './db.models';

@@ -11,5 +11,11 @@ import type { EventList, IKnowledgeBoxItem, KnowledgeBoxCreation } from './kb';

private nuclia;
private useRegionalSystem;
constructor(nuclia: INuclia);
/** Returns a list of all the accounts which are accessible for the current authenticated user. */
getAccounts(): Observable<Account[]>;
/**
* Returns a list of all the KB indexes (account id, kb id, zone id) for the provided account slug.
* @param accountSlug
*/
getKbIndexes(accountSlug: string): Observable<KbIndex[]>;
/** Creates a new account. */

@@ -67,3 +73,4 @@ createAccount(account: AccountCreation): Observable<Account>;

/** Returns a list of all the Knowledge Boxes for the given account slug. */
getKnowledgeBoxes(account: string): Observable<IKnowledgeBoxItem[]>;
getKnowledgeBoxes(accountSlug: string): Observable<IKnowledgeBoxItem[]>;
getKnowledgeBoxesForZone(accountId: string, zone: string): Observable<IKnowledgeBoxItem[]>;
/**

@@ -132,2 +139,6 @@ * Returns the Knowledge Box with the given slug, or the one defined in the Nuclia options

}>;
createNUAClient(accountId: string, data: NUAClientPayload, zone: string): Observable<{
client_id: string;
token: string;
}>;
/** Renews a NUA token. */

@@ -138,6 +149,34 @@ renewNUAClient(account: string, client_id: string): Observable<{

}>;
renewNUAClient(accountId: string, client_id: string, zone: string): Observable<{
client_id: string;
token: string;
}>;
/** Deletes a NUA client. */
deleteNUAClient(account: string, client_id: string): Observable<void>;
deleteNUAClient(accountId: string, client_id: string, zone: string): Observable<void>;
getLearningConfigurations(): Observable<LearningConfigurations>;
predictTokens(text: string): Observable<PredictedToken[]>;
/**
* Get an account user by their id
* @param accountSlug
* @param userId
*/
getAccountUser(accountSlug: string, userId: string): Observable<Partial<FullAccountUser>>;
/**
* Get the list of all users of an account
* @param accountSlug
*/
getAccountUsers(accountSlug: string): Observable<FullAccountUser[]>;
/**
* Add and/or delete users from an account
* @param accountSlug
* @param users
*/
setAccountUsers(accountSlug: string, users: AccountUsersPayload): Observable<void>;
/**
* Invite a user to an account
* @param accountSlug
* @param data
*/
inviteToAccount(accountSlug: string, data: InviteAccountUserPayload): Observable<void>;
}

41

esm/libs/sdk-core/src/lib/db/db.models.d.ts
export type AccountTypes = 'stash-basic' | 'stash-team' | 'stash-trial' | 'stash-startup' | 'stash-starter' | 'stash-growth' | 'stash-enterprise' | 'stash-developer' | 'stash-business';
export declare const NUA_KEY = "NUCLIA_NUA_KEY";
export interface Account {
id: string;
slug: string;
title: string;
description?: string;
zone: string;
type: AccountTypes;
blocked_features: BlockedFeature[];
blocking_state?: AccountBlockingState;
can_manage_account: boolean;
config?: AccountConfig;
current_kbs?: number;
current_users?: number;
description?: string;
id: string;
limits?: AccountLimits;
max_kbs: number;
current_users?: number;
max_users: number | null;
config?: AccountConfig;
limits?: AccountLimits;
blocking_state?: AccountBlockingState;
blocked_features: BlockedFeature[];
slug: string;
title: string;
trial_expiration_date?: string;
type: AccountTypes;
zone: string;
}

@@ -116,2 +116,3 @@ export interface AccountConfig {

export interface NUAClientPayload {
allow_kb_management?: boolean;
client_id?: string;

@@ -150,9 +151,10 @@ contact: string;

}
export interface LearningConfigurationOption {
value: string;
name: string;
user_key?: string;
user_prompt?: string;
}
export interface LearningConfiguration {
options?: {
value: string;
name: string;
user_key?: string;
user_prompt?: string;
}[];
options?: LearningConfigurationOption[];
schemas?: {

@@ -208,1 +210,6 @@ [key: string]: LearningConfigurationSchema;

}
export interface KbIndex {
account_id: string;
kb_id: string;
zone_id: string;
}
import { Observable } from 'rxjs';
import type { ActivityDownloadList, Counters, Entities, EntitiesGroup, EventList, EventType, IKnowledgeBox, IKnowledgeBoxCreation, IWritableKnowledgeBox, LabelSet, LabelSets, ResourceList, ServiceAccount, ServiceAccountCreation, Synonyms, UpdateEntitiesGroupPayload } from './kb.models';
import type { ActivityDownloadList, Counters, Entities, EntitiesGroup, EventList, EventType, IKnowledgeBox, IKnowledgeBoxCreation, InviteKbData, IWritableKnowledgeBox, KbUserPayload, LabelSet, LabelSets, ResourceList, ServiceAccount, ServiceAccountCreation, Synonyms, UpdateEntitiesGroupPayload } from './kb.models';
import { FullKbUser } from './kb.models';
import type { IErrorResponse, INuclia } from '../../models';

@@ -23,2 +24,3 @@ import type { ICreateResource, IResource, LinkField, Origin, UserMetadata } from '../resource';

private tempToken?;
protected useRegionalSystem: boolean;
/**

@@ -154,2 +156,3 @@ * The Knowledge Box path on the regional API.

}>;
getUsers(): Observable<FullKbUser[]>;
}

@@ -177,6 +180,10 @@ /** Extends `KnowledgeBox` with all the write operations. */

modify(data: Partial<IKnowledgeBox>): Observable<void>;
/** Deletes the Knowledge Box. */
delete(): Observable<void>;
protected getKbEndpointAndZone(): {
endpoint: string;
zone: string | undefined;
};
/** Publishes or unpublishes the Knowledge Box. */
publish(published: boolean): Observable<void>;
/** Deletes the Knowledge Box. */
delete(): Observable<void>;
/** Creates a new NER family. */

@@ -285,2 +292,12 @@ createEntitiesGroup(groupId: string, group: EntitiesGroup): Observable<void>;

}): Observable<void>;
/**
* Update the list of users of the Knowledge Box, providing the list of users (id and role) to add and/or update, and the list of user ids to delete.
* @param data
*/
updateUsers(data: KbUserPayload): Observable<void>;
/**
* Invite a user to the Knowledge Box
* @param data
*/
inviteToKb(data: InviteKbData): Observable<void>;
}

@@ -41,2 +41,21 @@ import type { Observable } from 'rxjs';

}
export interface FullKbUser {
id: string;
name: string;
email: string;
role: KBRoles;
}
export interface KbUser {
id: string;
role: KBRoles;
}
export interface KbUserPayload {
add?: KbUser[];
update?: KbUser[];
delete?: string[];
}
export interface InviteKbData {
email: string;
role: KBRoles;
}
export interface IKnowledgeBox extends IKnowledgeBoxCreation {

@@ -67,2 +86,3 @@ get path(): string;

}>;
getUsers(): Observable<FullKbUser[]>;
}

@@ -82,3 +102,3 @@ export interface IWritableKnowledgeBox extends IKnowledgeBox {

deleteAllSynonyms(): Observable<void>;
createResource(resource: IResource): Observable<{
createResource(resource: IResource, synchronous: boolean): Observable<{
uuid: string;

@@ -95,13 +115,15 @@ }>;

createServiceAccount(data: ServiceAccountCreation): Observable<void>;
deleteServiceAccount(saId: string): Observable<void>;
deleteServiceAccount(serviceAccountId: string): Observable<void>;
createKeyForService(data: ServiceAccountCreation, expires: string): Observable<{
token: string;
}>;
createKey(saId: string, expires: string): Observable<{
createKey(serviceAccountId: string, expires: string): Observable<{
token: string;
}>;
deleteKey(saId: string, saKeyId: string): Observable<void>;
deleteKey(serviceAccountId: string, serviceAccountKeyId: string): Observable<void>;
setConfiguration(config: {
[id: string]: any;
}): Observable<void>;
updateUsers(data: KbUserPayload): Observable<void>;
inviteToKb(data: InviteKbData): Observable<void>;
}

@@ -108,0 +130,0 @@ export interface KnowledgeBoxCreation {

import type { Classification } from '../resource';
export declare function getFilterFromLabel(label: Classification): string;
export declare function getLabelFromFilter(filter: string): Classification;
export declare function getFilterFromLabelSet(labelSet: string): string;
export declare function getLabelSetFromFilter(filter: string): string;
export declare function getFilterFromEntity(entity: {

@@ -5,0 +7,0 @@ family: string;

@@ -33,2 +33,3 @@ import type { ExtractedDataTypes, FIELD_TYPE, FieldId, IFieldData, IResource, RelationEntityType, RelationType } from '../resource';

synchronous?: boolean;
prompt?: string;
}

@@ -35,0 +36,0 @@ export interface SearchOptions extends BaseSearchOptions {

import type { Observable } from 'rxjs';
import type { AuthTokens, JwtUser } from './auth';
import type { Account, AccountCreation, AccountStatus, AccountTypes, EventList, IKnowledgeBoxItem, IStandaloneKb, KnowledgeBox, KnowledgeBoxCreation, LearningConfigurations, NUAClient, NUAClientPayload, PredictedToken, ProcessingPullResponse, ProcessingPushResponse, ProcessingStat, ProcessingStatusResponse, StatsPeriod, StatsRange, StatsType, Welcome, WritableKnowledgeBox } from './db';
import { KbIndex } from './db';
export interface INuclia {

@@ -42,15 +43,15 @@ options: NucliaOptions;

[key: string]: string;
}, doNotParse?: boolean): Observable<T>;
}, doNotParse?: boolean, zoneSlug?: string): Observable<T>;
post<T>(path: string, body: any, extraHeaders?: {
[key: string]: string;
}, doNotParse?: boolean, synchronous?: boolean): Observable<T>;
}, doNotParse?: boolean, synchronous?: boolean, zoneSlug?: string): Observable<T>;
put<T>(path: string, body: any, extraHeaders?: {
[key: string]: string;
}, doNotParse?: boolean, synchronous?: boolean): Observable<T>;
}, doNotParse?: boolean, synchronous?: boolean, zoneSlug?: string): Observable<T>;
patch<T>(path: string, body: any, extraHeaders?: {
[key: string]: string;
}, doNotParse?: boolean, synchronous?: boolean): Observable<T>;
}, doNotParse?: boolean, synchronous?: boolean, zoneSlug?: string): Observable<T>;
delete(path: string, extraHeaders?: {
[key: string]: string;
}, synchronous?: boolean): Observable<void>;
}, synchronous?: boolean, zoneSlug?: string): Observable<void>;
head(path: string, extraHeaders?: {

@@ -73,2 +74,3 @@ [key: string]: string;

getAccounts(): Observable<Account[]>;
getKbIndexes(accountSlug: string): Observable<KbIndex[]>;
createAccount(account: AccountCreation): Observable<Account>;

@@ -82,3 +84,4 @@ getAccountStatus(account: string): Observable<AccountStatus>;

getStandaloneKbs(): Observable<IStandaloneKb[]>;
getKnowledgeBoxes(account: string): Observable<IKnowledgeBoxItem[]>;
getKnowledgeBoxes(accountSlug: string): Observable<IKnowledgeBoxItem[]>;
getKnowledgeBoxesForZone(accountId: string, zone: string): Observable<IKnowledgeBoxItem[]>;
getKnowledgeBox(): Observable<WritableKnowledgeBox>;

@@ -98,2 +101,6 @@ getKnowledgeBox(account: string, knowledgeBox: string): Observable<WritableKnowledgeBox>;

}>;
createNUAClient(accountId: string, data: NUAClientPayload, zone: string): Observable<{
client_id: string;
token: string;
}>;
renewNUAClient(account: string, client_id: string): Observable<{

@@ -103,3 +110,8 @@ client_id: string;

}>;
renewNUAClient(accountId: string, client_id: string, zone: string): Observable<{
client_id: string;
token: string;
}>;
deleteNUAClient(account: string, client_id: string): Observable<void>;
deleteNUAClient(accountId: string, client_id: string, zone: string): Observable<void>;
hasNUAClient(): boolean;

@@ -109,2 +121,6 @@ getNUAActivity(accountSlug: string, client_id: string, pageIndex?: number): Observable<EventList>;

predictTokens(text: string): Observable<PredictedToken[]>;
getAccountUser(accountSlug: string, userId: string): Observable<Partial<FullAccountUser>>;
getAccountUsers(accountSlug: string): Observable<FullAccountUser[]>;
setAccountUsers(accountSlug: string, users: AccountUsersPayload): Observable<void>;
inviteToAccount(accountSlug: string, data: InviteAccountUserPayload): Observable<void>;
}

@@ -125,4 +141,8 @@ export interface NucliaOptions {

*
* It can be used in a server-side app, but never in a web app. */
* It can be used in a server-side app, but never in a web app.
*/
apiKey?: string;
/**
* Allows you to make calls the NUA processing.
*/
nuaKey?: string;

@@ -132,6 +152,11 @@ /**

*
* Example: `my-account` */
* Example: `my-account`
*/
account?: string;
accountType?: AccountTypes;
/**
* The Nuclia account id.
*/
accountId?: string;
/**
* The Nuclia Knowledge Box unique id.

@@ -165,1 +190,19 @@ *

}
export type AccountRoles = 'AOWNER' | 'AMEMBER';
export interface FullAccountUser {
id: string;
name: string;
email: string;
role: AccountRoles;
}
export interface AccountUser {
id: string;
role: AccountRoles;
}
export interface AccountUsersPayload {
add?: AccountUser[];
delete?: string[];
}
export interface InviteAccountUserPayload {
email: string;
}

@@ -27,15 +27,15 @@ import { Observable } from 'rxjs';

[key: string]: string;
}, doNotParse?: boolean): Observable<T>;
}, doNotParse?: boolean, zoneSlug?: string): Observable<T>;
post<T>(path: string, body: any, extraHeaders?: {
[key: string]: string;
}, doNotParse?: boolean, synchronous?: boolean): Observable<T>;
}, doNotParse?: boolean, synchronous?: boolean, zoneSlug?: string): Observable<T>;
put<T>(path: string, body: any, extraHeaders?: {
[key: string]: string;
}, doNotParse?: boolean, synchronous?: boolean): Observable<T>;
}, doNotParse?: boolean, synchronous?: boolean, zoneSlug?: string): Observable<T>;
patch<T>(path: string, body: any, extraHeaders?: {
[key: string]: string;
}, doNotParse?: boolean, synchronous?: boolean): Observable<T>;
}, doNotParse?: boolean, synchronous?: boolean, zoneSlug?: string): Observable<T>;
delete<T>(path: string, extraHeaders?: {
[key: string]: string;
}, synchronous?: boolean): Observable<T>;
}, synchronous?: boolean, zoneSlug?: string): Observable<T>;
head(path: string, extraHeaders?: {

@@ -46,4 +46,6 @@ [key: string]: string;

private fetch;
/** Returns the full URL of the given path, using the regional or the global Nuclia backend according the path. */
getFullUrl(path: string): string;
/**
* Returns the full URL of the given path, using the regional or the global Nuclia backend according to the path or the provided zone slug (if any).
*/
getFullUrl(path: string, zoneSlug?: string): string;
/** Returns a dictionary giving the geographical zones available slugs by unique ids. */

@@ -50,0 +52,0 @@ getZones(): Observable<{

{
"name": "@nuclia/core",
"version": "1.7.0",
"version": "1.8.0",
"description": "SDK allowing to integrate Nuclia services in your frontend application",

@@ -5,0 +5,0 @@ "license": "MIT",

import { Observable } from 'rxjs';
import type { IDb, INuclia } from '../models';
import type { LearningConfigurations, PredictedToken } from './db.models';
import type { AccountUsersPayload, FullAccountUser, IDb, INuclia, InviteAccountUserPayload } from '../models';
import type { KbIndex, LearningConfigurations, PredictedToken } from './db.models';
import { Account, AccountCreation, AccountStatus, NUAClient, NUAClientPayload, ProcessingPullResponse, ProcessingPushResponse, ProcessingStat, ProcessingStatusResponse, StatsPeriod, StatsRange, StatsType, Welcome } from './db.models';

@@ -11,5 +11,11 @@ import type { EventList, IKnowledgeBoxItem, KnowledgeBoxCreation } from './kb';

private nuclia;
private useRegionalSystem;
constructor(nuclia: INuclia);
/** Returns a list of all the accounts which are accessible for the current authenticated user. */
getAccounts(): Observable<Account[]>;
/**
* Returns a list of all the KB indexes (account id, kb id, zone id) for the provided account slug.
* @param accountSlug
*/
getKbIndexes(accountSlug: string): Observable<KbIndex[]>;
/** Creates a new account. */

@@ -67,3 +73,4 @@ createAccount(account: AccountCreation): Observable<Account>;

/** Returns a list of all the Knowledge Boxes for the given account slug. */
getKnowledgeBoxes(account: string): Observable<IKnowledgeBoxItem[]>;
getKnowledgeBoxes(accountSlug: string): Observable<IKnowledgeBoxItem[]>;
getKnowledgeBoxesForZone(accountId: string, zone: string): Observable<IKnowledgeBoxItem[]>;
/**

@@ -132,2 +139,6 @@ * Returns the Knowledge Box with the given slug, or the one defined in the Nuclia options

}>;
createNUAClient(accountId: string, data: NUAClientPayload, zone: string): Observable<{
client_id: string;
token: string;
}>;
/** Renews a NUA token. */

@@ -138,6 +149,34 @@ renewNUAClient(account: string, client_id: string): Observable<{

}>;
renewNUAClient(accountId: string, client_id: string, zone: string): Observable<{
client_id: string;
token: string;
}>;
/** Deletes a NUA client. */
deleteNUAClient(account: string, client_id: string): Observable<void>;
deleteNUAClient(accountId: string, client_id: string, zone: string): Observable<void>;
getLearningConfigurations(): Observable<LearningConfigurations>;
predictTokens(text: string): Observable<PredictedToken[]>;
/**
* Get an account user by their id
* @param accountSlug
* @param userId
*/
getAccountUser(accountSlug: string, userId: string): Observable<Partial<FullAccountUser>>;
/**
* Get the list of all users of an account
* @param accountSlug
*/
getAccountUsers(accountSlug: string): Observable<FullAccountUser[]>;
/**
* Add and/or delete users from an account
* @param accountSlug
* @param users
*/
setAccountUsers(accountSlug: string, users: AccountUsersPayload): Observable<void>;
/**
* Invite a user to an account
* @param accountSlug
* @param data
*/
inviteToAccount(accountSlug: string, data: InviteAccountUserPayload): Observable<void>;
}
export type AccountTypes = 'stash-basic' | 'stash-team' | 'stash-trial' | 'stash-startup' | 'stash-starter' | 'stash-growth' | 'stash-enterprise' | 'stash-developer' | 'stash-business';
export declare const NUA_KEY = "NUCLIA_NUA_KEY";
export interface Account {
id: string;
slug: string;
title: string;
description?: string;
zone: string;
type: AccountTypes;
blocked_features: BlockedFeature[];
blocking_state?: AccountBlockingState;
can_manage_account: boolean;
config?: AccountConfig;
current_kbs?: number;
current_users?: number;
description?: string;
id: string;
limits?: AccountLimits;
max_kbs: number;
current_users?: number;
max_users: number | null;
config?: AccountConfig;
limits?: AccountLimits;
blocking_state?: AccountBlockingState;
blocked_features: BlockedFeature[];
slug: string;
title: string;
trial_expiration_date?: string;
type: AccountTypes;
zone: string;
}

@@ -116,2 +116,3 @@ export interface AccountConfig {

export interface NUAClientPayload {
allow_kb_management?: boolean;
client_id?: string;

@@ -150,9 +151,10 @@ contact: string;

}
export interface LearningConfigurationOption {
value: string;
name: string;
user_key?: string;
user_prompt?: string;
}
export interface LearningConfiguration {
options?: {
value: string;
name: string;
user_key?: string;
user_prompt?: string;
}[];
options?: LearningConfigurationOption[];
schemas?: {

@@ -208,1 +210,6 @@ [key: string]: LearningConfigurationSchema;

}
export interface KbIndex {
account_id: string;
kb_id: string;
zone_id: string;
}
import { Observable } from 'rxjs';
import type { ActivityDownloadList, Counters, Entities, EntitiesGroup, EventList, EventType, IKnowledgeBox, IKnowledgeBoxCreation, IWritableKnowledgeBox, LabelSet, LabelSets, ResourceList, ServiceAccount, ServiceAccountCreation, Synonyms, UpdateEntitiesGroupPayload } from './kb.models';
import type { ActivityDownloadList, Counters, Entities, EntitiesGroup, EventList, EventType, IKnowledgeBox, IKnowledgeBoxCreation, InviteKbData, IWritableKnowledgeBox, KbUserPayload, LabelSet, LabelSets, ResourceList, ServiceAccount, ServiceAccountCreation, Synonyms, UpdateEntitiesGroupPayload } from './kb.models';
import { FullKbUser } from './kb.models';
import type { IErrorResponse, INuclia } from '../../models';

@@ -23,2 +24,3 @@ import type { ICreateResource, IResource, LinkField, Origin, UserMetadata } from '../resource';

private tempToken?;
protected useRegionalSystem: boolean;
/**

@@ -154,2 +156,3 @@ * The Knowledge Box path on the regional API.

}>;
getUsers(): Observable<FullKbUser[]>;
}

@@ -177,6 +180,10 @@ /** Extends `KnowledgeBox` with all the write operations. */

modify(data: Partial<IKnowledgeBox>): Observable<void>;
/** Deletes the Knowledge Box. */
delete(): Observable<void>;
protected getKbEndpointAndZone(): {
endpoint: string;
zone: string | undefined;
};
/** Publishes or unpublishes the Knowledge Box. */
publish(published: boolean): Observable<void>;
/** Deletes the Knowledge Box. */
delete(): Observable<void>;
/** Creates a new NER family. */

@@ -285,2 +292,12 @@ createEntitiesGroup(groupId: string, group: EntitiesGroup): Observable<void>;

}): Observable<void>;
/**
* Update the list of users of the Knowledge Box, providing the list of users (id and role) to add and/or update, and the list of user ids to delete.
* @param data
*/
updateUsers(data: KbUserPayload): Observable<void>;
/**
* Invite a user to the Knowledge Box
* @param data
*/
inviteToKb(data: InviteKbData): Observable<void>;
}

@@ -41,2 +41,21 @@ import type { Observable } from 'rxjs';

}
export interface FullKbUser {
id: string;
name: string;
email: string;
role: KBRoles;
}
export interface KbUser {
id: string;
role: KBRoles;
}
export interface KbUserPayload {
add?: KbUser[];
update?: KbUser[];
delete?: string[];
}
export interface InviteKbData {
email: string;
role: KBRoles;
}
export interface IKnowledgeBox extends IKnowledgeBoxCreation {

@@ -67,2 +86,3 @@ get path(): string;

}>;
getUsers(): Observable<FullKbUser[]>;
}

@@ -82,3 +102,3 @@ export interface IWritableKnowledgeBox extends IKnowledgeBox {

deleteAllSynonyms(): Observable<void>;
createResource(resource: IResource): Observable<{
createResource(resource: IResource, synchronous: boolean): Observable<{
uuid: string;

@@ -95,13 +115,15 @@ }>;

createServiceAccount(data: ServiceAccountCreation): Observable<void>;
deleteServiceAccount(saId: string): Observable<void>;
deleteServiceAccount(serviceAccountId: string): Observable<void>;
createKeyForService(data: ServiceAccountCreation, expires: string): Observable<{
token: string;
}>;
createKey(saId: string, expires: string): Observable<{
createKey(serviceAccountId: string, expires: string): Observable<{
token: string;
}>;
deleteKey(saId: string, saKeyId: string): Observable<void>;
deleteKey(serviceAccountId: string, serviceAccountKeyId: string): Observable<void>;
setConfiguration(config: {
[id: string]: any;
}): Observable<void>;
updateUsers(data: KbUserPayload): Observable<void>;
inviteToKb(data: InviteKbData): Observable<void>;
}

@@ -108,0 +130,0 @@ export interface KnowledgeBoxCreation {

import type { Classification } from '../resource';
export declare function getFilterFromLabel(label: Classification): string;
export declare function getLabelFromFilter(filter: string): Classification;
export declare function getFilterFromLabelSet(labelSet: string): string;
export declare function getLabelSetFromFilter(filter: string): string;
export declare function getFilterFromEntity(entity: {

@@ -5,0 +7,0 @@ family: string;

@@ -33,2 +33,3 @@ import type { ExtractedDataTypes, FIELD_TYPE, FieldId, IFieldData, IResource, RelationEntityType, RelationType } from '../resource';

synchronous?: boolean;
prompt?: string;
}

@@ -35,0 +36,0 @@ export interface SearchOptions extends BaseSearchOptions {

import type { Observable } from 'rxjs';
import type { AuthTokens, JwtUser } from './auth';
import type { Account, AccountCreation, AccountStatus, AccountTypes, EventList, IKnowledgeBoxItem, IStandaloneKb, KnowledgeBox, KnowledgeBoxCreation, LearningConfigurations, NUAClient, NUAClientPayload, PredictedToken, ProcessingPullResponse, ProcessingPushResponse, ProcessingStat, ProcessingStatusResponse, StatsPeriod, StatsRange, StatsType, Welcome, WritableKnowledgeBox } from './db';
import { KbIndex } from './db';
export interface INuclia {

@@ -42,15 +43,15 @@ options: NucliaOptions;

[key: string]: string;
}, doNotParse?: boolean): Observable<T>;
}, doNotParse?: boolean, zoneSlug?: string): Observable<T>;
post<T>(path: string, body: any, extraHeaders?: {
[key: string]: string;
}, doNotParse?: boolean, synchronous?: boolean): Observable<T>;
}, doNotParse?: boolean, synchronous?: boolean, zoneSlug?: string): Observable<T>;
put<T>(path: string, body: any, extraHeaders?: {
[key: string]: string;
}, doNotParse?: boolean, synchronous?: boolean): Observable<T>;
}, doNotParse?: boolean, synchronous?: boolean, zoneSlug?: string): Observable<T>;
patch<T>(path: string, body: any, extraHeaders?: {
[key: string]: string;
}, doNotParse?: boolean, synchronous?: boolean): Observable<T>;
}, doNotParse?: boolean, synchronous?: boolean, zoneSlug?: string): Observable<T>;
delete(path: string, extraHeaders?: {
[key: string]: string;
}, synchronous?: boolean): Observable<void>;
}, synchronous?: boolean, zoneSlug?: string): Observable<void>;
head(path: string, extraHeaders?: {

@@ -73,2 +74,3 @@ [key: string]: string;

getAccounts(): Observable<Account[]>;
getKbIndexes(accountSlug: string): Observable<KbIndex[]>;
createAccount(account: AccountCreation): Observable<Account>;

@@ -82,3 +84,4 @@ getAccountStatus(account: string): Observable<AccountStatus>;

getStandaloneKbs(): Observable<IStandaloneKb[]>;
getKnowledgeBoxes(account: string): Observable<IKnowledgeBoxItem[]>;
getKnowledgeBoxes(accountSlug: string): Observable<IKnowledgeBoxItem[]>;
getKnowledgeBoxesForZone(accountId: string, zone: string): Observable<IKnowledgeBoxItem[]>;
getKnowledgeBox(): Observable<WritableKnowledgeBox>;

@@ -98,2 +101,6 @@ getKnowledgeBox(account: string, knowledgeBox: string): Observable<WritableKnowledgeBox>;

}>;
createNUAClient(accountId: string, data: NUAClientPayload, zone: string): Observable<{
client_id: string;
token: string;
}>;
renewNUAClient(account: string, client_id: string): Observable<{

@@ -103,3 +110,8 @@ client_id: string;

}>;
renewNUAClient(accountId: string, client_id: string, zone: string): Observable<{
client_id: string;
token: string;
}>;
deleteNUAClient(account: string, client_id: string): Observable<void>;
deleteNUAClient(accountId: string, client_id: string, zone: string): Observable<void>;
hasNUAClient(): boolean;

@@ -109,2 +121,6 @@ getNUAActivity(accountSlug: string, client_id: string, pageIndex?: number): Observable<EventList>;

predictTokens(text: string): Observable<PredictedToken[]>;
getAccountUser(accountSlug: string, userId: string): Observable<Partial<FullAccountUser>>;
getAccountUsers(accountSlug: string): Observable<FullAccountUser[]>;
setAccountUsers(accountSlug: string, users: AccountUsersPayload): Observable<void>;
inviteToAccount(accountSlug: string, data: InviteAccountUserPayload): Observable<void>;
}

@@ -125,4 +141,8 @@ export interface NucliaOptions {

*
* It can be used in a server-side app, but never in a web app. */
* It can be used in a server-side app, but never in a web app.
*/
apiKey?: string;
/**
* Allows you to make calls the NUA processing.
*/
nuaKey?: string;

@@ -132,6 +152,11 @@ /**

*
* Example: `my-account` */
* Example: `my-account`
*/
account?: string;
accountType?: AccountTypes;
/**
* The Nuclia account id.
*/
accountId?: string;
/**
* The Nuclia Knowledge Box unique id.

@@ -165,1 +190,19 @@ *

}
export type AccountRoles = 'AOWNER' | 'AMEMBER';
export interface FullAccountUser {
id: string;
name: string;
email: string;
role: AccountRoles;
}
export interface AccountUser {
id: string;
role: AccountRoles;
}
export interface AccountUsersPayload {
add?: AccountUser[];
delete?: string[];
}
export interface InviteAccountUserPayload {
email: string;
}

@@ -27,15 +27,15 @@ import { Observable } from 'rxjs';

[key: string]: string;
}, doNotParse?: boolean): Observable<T>;
}, doNotParse?: boolean, zoneSlug?: string): Observable<T>;
post<T>(path: string, body: any, extraHeaders?: {
[key: string]: string;
}, doNotParse?: boolean, synchronous?: boolean): Observable<T>;
}, doNotParse?: boolean, synchronous?: boolean, zoneSlug?: string): Observable<T>;
put<T>(path: string, body: any, extraHeaders?: {
[key: string]: string;
}, doNotParse?: boolean, synchronous?: boolean): Observable<T>;
}, doNotParse?: boolean, synchronous?: boolean, zoneSlug?: string): Observable<T>;
patch<T>(path: string, body: any, extraHeaders?: {
[key: string]: string;
}, doNotParse?: boolean, synchronous?: boolean): Observable<T>;
}, doNotParse?: boolean, synchronous?: boolean, zoneSlug?: string): Observable<T>;
delete<T>(path: string, extraHeaders?: {
[key: string]: string;
}, synchronous?: boolean): Observable<T>;
}, synchronous?: boolean, zoneSlug?: string): Observable<T>;
head(path: string, extraHeaders?: {

@@ -46,4 +46,6 @@ [key: string]: string;

private fetch;
/** Returns the full URL of the given path, using the regional or the global Nuclia backend according the path. */
getFullUrl(path: string): string;
/**
* Returns the full URL of the given path, using the regional or the global Nuclia backend according to the path or the provided zone slug (if any).
*/
getFullUrl(path: string, zoneSlug?: string): string;
/** Returns a dictionary giving the geographical zones available slugs by unique ids. */

@@ -50,0 +52,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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc