@iblai/data-layer 1.40.0 → 1.42.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/dist/index.d.ts +722 -2
- package/dist/index.esm.js +124 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +139 -0
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/features/mentor/__tests__/privacy.test.d.ts +1 -0
- package/dist/src/features/mentor/privacy.d.ts +9 -0
- package/dist/src/features/privacy-flags/__tests__/api-slice.test.d.ts +1 -0
- package/dist/src/features/privacy-flags/api-slice.d.ts +614 -0
- package/dist/src/features/privacy-flags/constants.d.ts +22 -0
- package/dist/src/features/privacy-flags/index.d.ts +3 -0
- package/dist/src/features/privacy-flags/types.d.ts +72 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SERVICES } from '@data-layer/constants';
|
|
2
|
+
export declare const PRIVACY_FLAGS_REDUCER_PATH = "privacyFlagsApiSlice";
|
|
3
|
+
export declare const PRIVACY_FLAGS_QUERY_KEYS: {
|
|
4
|
+
readonly PRIVACY_FLAGS: "PRIVACY_FLAGS";
|
|
5
|
+
readonly PRIVACY_FLAG: "PRIVACY_FLAG";
|
|
6
|
+
};
|
|
7
|
+
/** Guardrail that produced the detection. */
|
|
8
|
+
export declare const PRIVACY_FLAG_RAILS: readonly ["pii", "phi"];
|
|
9
|
+
/** What the privacy router did with the detected content. */
|
|
10
|
+
export declare const PRIVACY_FLAG_ACTIONS: readonly ["redact", "mask", "block", "allow"];
|
|
11
|
+
/** Where in the pipeline the detection happened. `file_*` sources carry file metadata. */
|
|
12
|
+
export declare const PRIVACY_FLAG_SOURCES: readonly ["text_prompt", "file_text", "file_image", "file_pdf", "llm_response", "memory_retrieval"];
|
|
13
|
+
export declare const PRIVACY_FLAGS_ENDPOINTS: {
|
|
14
|
+
LIST: {
|
|
15
|
+
service: SERVICES;
|
|
16
|
+
path: (org: string, userId: string) => string;
|
|
17
|
+
};
|
|
18
|
+
RETRIEVE: {
|
|
19
|
+
service: SERVICES;
|
|
20
|
+
path: (org: string, userId: string, id: number) => string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { PRIVACY_FLAG_ACTIONS, PRIVACY_FLAG_RAILS, PRIVACY_FLAG_SOURCES } from './constants';
|
|
2
|
+
export type PrivacyFlagRail = (typeof PRIVACY_FLAG_RAILS)[number];
|
|
3
|
+
export type PrivacyFlagAction = (typeof PRIVACY_FLAG_ACTIONS)[number];
|
|
4
|
+
/** The backend stores a blank string when no action was recorded. */
|
|
5
|
+
export type PrivacyFlagActionTaken = PrivacyFlagAction | '';
|
|
6
|
+
export type PrivacyFlagSource = (typeof PRIVACY_FLAG_SOURCES)[number];
|
|
7
|
+
/**
|
|
8
|
+
* A single PII/PHI detection. Only entity TYPES are exposed
|
|
9
|
+
* (`detected_entities`, e.g. `["EMAIL_ADDRESS"]`) — never raw values.
|
|
10
|
+
* Identity fields are all null when the user has since been deleted.
|
|
11
|
+
*/
|
|
12
|
+
export interface PrivacyFlag {
|
|
13
|
+
id: number;
|
|
14
|
+
user: number | null;
|
|
15
|
+
username: string | null;
|
|
16
|
+
email: string | null;
|
|
17
|
+
user_full_name: string | null;
|
|
18
|
+
platform_key: string;
|
|
19
|
+
mentor: number | null;
|
|
20
|
+
session_id: string;
|
|
21
|
+
rail: PrivacyFlagRail;
|
|
22
|
+
action_taken: PrivacyFlagActionTaken;
|
|
23
|
+
source: PrivacyFlagSource;
|
|
24
|
+
detected_entities: string[];
|
|
25
|
+
/** Empty string for non-file sources. */
|
|
26
|
+
file_name: string;
|
|
27
|
+
file_content_type: string;
|
|
28
|
+
file_size: number | null;
|
|
29
|
+
file_reference: string;
|
|
30
|
+
date_created: string;
|
|
31
|
+
}
|
|
32
|
+
export interface PaginatedPrivacyFlagList {
|
|
33
|
+
count: number;
|
|
34
|
+
next: string | null;
|
|
35
|
+
previous: string | null;
|
|
36
|
+
results: PrivacyFlag[];
|
|
37
|
+
}
|
|
38
|
+
export interface PrivacyFlagsFilters {
|
|
39
|
+
/** Agent id to scope the list to. */
|
|
40
|
+
mentor?: string;
|
|
41
|
+
rail?: PrivacyFlagRail;
|
|
42
|
+
actionTaken?: PrivacyFlagAction;
|
|
43
|
+
source?: PrivacyFlagSource;
|
|
44
|
+
sessionId?: string;
|
|
45
|
+
username?: string;
|
|
46
|
+
/** ISO datetime lower bound on `date_created`. */
|
|
47
|
+
startTime?: string;
|
|
48
|
+
/** ISO datetime upper bound on `date_created`. */
|
|
49
|
+
endTime?: string;
|
|
50
|
+
/** Free text over username / session id / file name. */
|
|
51
|
+
search?: string;
|
|
52
|
+
ordering?: string;
|
|
53
|
+
page?: number;
|
|
54
|
+
pageSize?: number;
|
|
55
|
+
}
|
|
56
|
+
export interface GetPrivacyFlagsArgs extends PrivacyFlagsFilters {
|
|
57
|
+
org: string;
|
|
58
|
+
/** Username of the requesting admin (path segment). */
|
|
59
|
+
userId: string;
|
|
60
|
+
[key: string]: unknown;
|
|
61
|
+
}
|
|
62
|
+
export interface GetPrivacyFlagArgs {
|
|
63
|
+
org: string;
|
|
64
|
+
userId: string;
|
|
65
|
+
id: number;
|
|
66
|
+
[key: string]: unknown;
|
|
67
|
+
}
|
|
68
|
+
/** Error thrown by the privacy-flags fetchers; `status` is preserved for 403 detection. */
|
|
69
|
+
export interface PrivacyFlagsHttpError {
|
|
70
|
+
status: number;
|
|
71
|
+
body: unknown;
|
|
72
|
+
}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -75,6 +75,7 @@ export * from './features/call-configurations/api-slice';
|
|
|
75
75
|
export * from './features/call-configurations/constants';
|
|
76
76
|
export * from './features/call-configurations/types';
|
|
77
77
|
export * from './features/moderation-logs/api-slice';
|
|
78
|
+
export * from './features/privacy-flags';
|
|
78
79
|
export * from './features/mentor/constants';
|
|
79
80
|
export * from './features/mentor/types';
|
|
80
81
|
export * from './features/mentor/privacy';
|