@iblai/data-layer 1.5.5 → 1.5.6
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 +64 -2
- package/dist/index.esm.js +64 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +71 -0
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/features/mentor/privacy.d.ts +61 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/tests/features/mentor/privacy.test.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -42806,6 +42806,69 @@ const moderationLogsApiSlice = react.createApi({
|
|
|
42806
42806
|
const moderationLogsApiReducer = moderationLogsApiSlice.reducer;
|
|
42807
42807
|
const { useGetModerationLogsQuery, useLazyGetModerationLogsQuery, useDeleteModerationLogMutation, } = moderationLogsApiSlice;
|
|
42808
42808
|
|
|
42809
|
+
/**
|
|
42810
|
+
* Privacy Router types and constants.
|
|
42811
|
+
*
|
|
42812
|
+
* The backend's privacy router optionally detects and filters PII from chat
|
|
42813
|
+
* messages before they reach the LLM. It is configured per-mentor through the
|
|
42814
|
+
* existing mentor-settings endpoints (no new endpoints required):
|
|
42815
|
+
*
|
|
42816
|
+
* - GET /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{name}/settings/
|
|
42817
|
+
* - PUT /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{name}/settings/
|
|
42818
|
+
* - GET /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{name}/public-settings/
|
|
42819
|
+
*
|
|
42820
|
+
* These are already wired in `mentorApiSlice`
|
|
42821
|
+
* (`useGetMentorSettingsQuery`, `useEditMentorMutation`,
|
|
42822
|
+
* `useGetMentorPublicSettingsQuery`) — this file just adds the typed
|
|
42823
|
+
* surface for the new fields.
|
|
42824
|
+
*/
|
|
42825
|
+
const PRIVACY_ACTIONS = ['redact', 'mask', 'block'];
|
|
42826
|
+
const PRIVACY_ENTITY_TYPES = [
|
|
42827
|
+
'PERSON',
|
|
42828
|
+
'EMAIL_ADDRESS',
|
|
42829
|
+
'PHONE_NUMBER',
|
|
42830
|
+
'US_SSN',
|
|
42831
|
+
'CREDIT_CARD',
|
|
42832
|
+
'LOCATION',
|
|
42833
|
+
'DATE_TIME',
|
|
42834
|
+
'US_PASSPORT',
|
|
42835
|
+
'US_DRIVER_LICENSE',
|
|
42836
|
+
'IP_ADDRESS',
|
|
42837
|
+
'IBAN_CODE',
|
|
42838
|
+
'MEDICAL_LICENSE',
|
|
42839
|
+
'US_BANK_NUMBER',
|
|
42840
|
+
];
|
|
42841
|
+
/**
|
|
42842
|
+
* Entities suggested in the simple/default view of the privacy settings UI.
|
|
42843
|
+
* The remaining entities are surfaced under an "Advanced" disclosure.
|
|
42844
|
+
*/
|
|
42845
|
+
const SUGGESTED_PRIVACY_ENTITIES = [
|
|
42846
|
+
'PERSON',
|
|
42847
|
+
'EMAIL_ADDRESS',
|
|
42848
|
+
'PHONE_NUMBER',
|
|
42849
|
+
'US_SSN',
|
|
42850
|
+
];
|
|
42851
|
+
const DEFAULT_PRIVACY_RESPONSE = 'Your message contains sensitive personal information and cannot be processed. Please remove any personal data and try again.';
|
|
42852
|
+
const DEFAULT_PRIVACY_ACTION = 'redact';
|
|
42853
|
+
/**
|
|
42854
|
+
* `kind` value the backend returns on chat WS / SSE messages when a request
|
|
42855
|
+
* is rejected by the privacy router (action = "block"). Sits alongside the
|
|
42856
|
+
* existing `innappropriate_prompt` moderation/safety kind.
|
|
42857
|
+
*/
|
|
42858
|
+
const PRIVACY_BLOCKED_ERROR_KIND = 'privacy_blocked';
|
|
42859
|
+
const PRIVACY_TARGET_SYSTEM = 'privacy';
|
|
42860
|
+
/**
|
|
42861
|
+
* Type guard for the privacy-block error returned over the chat WS / SSE
|
|
42862
|
+
* channel. Use this in chat error handlers to give privacy blocks a distinct
|
|
42863
|
+
* visual treatment from moderation/safety blocks.
|
|
42864
|
+
*/
|
|
42865
|
+
function isPrivacyBlockedError(payload) {
|
|
42866
|
+
if (!payload || typeof payload !== 'object')
|
|
42867
|
+
return false;
|
|
42868
|
+
const p = payload;
|
|
42869
|
+
return p.kind === PRIVACY_BLOCKED_ERROR_KIND;
|
|
42870
|
+
}
|
|
42871
|
+
|
|
42809
42872
|
const MEMORY_REDUCER_PATH = 'memoryApiSlice';
|
|
42810
42873
|
const MEMORY_QUERY_KEYS = {
|
|
42811
42874
|
MEMSEARCH_USER_SETTINGS: () => ['MEMSEARCH_USER_SETTINGS'],
|
|
@@ -45129,6 +45192,8 @@ exports.CUSTOM_AI_SEARCH_REDUCER_PATH = CUSTOM_AI_SEARCH_REDUCER_PATH;
|
|
|
45129
45192
|
exports.CUSTOM_DOMAIN_ENDPOINTS = CUSTOM_DOMAIN_ENDPOINTS;
|
|
45130
45193
|
exports.CUSTOM_DOMAIN_QUERY_KEYS = CUSTOM_DOMAIN_QUERY_KEYS;
|
|
45131
45194
|
exports.CUSTOM_DOMAIN_REDUCER_PATH = CUSTOM_DOMAIN_REDUCER_PATH;
|
|
45195
|
+
exports.DEFAULT_PRIVACY_ACTION = DEFAULT_PRIVACY_ACTION;
|
|
45196
|
+
exports.DEFAULT_PRIVACY_RESPONSE = DEFAULT_PRIVACY_RESPONSE;
|
|
45132
45197
|
exports.DISCLAIMERS_ENDPOINTS = DISCLAIMERS_ENDPOINTS;
|
|
45133
45198
|
exports.DISCLAIMERS_QUERY_KEYS = DISCLAIMERS_QUERY_KEYS;
|
|
45134
45199
|
exports.DISCLAIMERS_REDUCER_PATH = DISCLAIMERS_REDUCER_PATH;
|
|
@@ -45153,12 +45218,17 @@ exports.PLATFORM_CONFIGURATION_TAG = PLATFORM_CONFIGURATION_TAG;
|
|
|
45153
45218
|
exports.PLATFORM_CUSTOM_ENDPOINTS = PLATFORM_CUSTOM_ENDPOINTS;
|
|
45154
45219
|
exports.PLATFORM_CUSTOM_REDUCER_PATH = PLATFORM_CUSTOM_REDUCER_PATH;
|
|
45155
45220
|
exports.PLATFORM_MEMBERSHIP_TAG = PLATFORM_MEMBERSHIP_TAG;
|
|
45221
|
+
exports.PRIVACY_ACTIONS = PRIVACY_ACTIONS;
|
|
45222
|
+
exports.PRIVACY_BLOCKED_ERROR_KIND = PRIVACY_BLOCKED_ERROR_KIND;
|
|
45223
|
+
exports.PRIVACY_ENTITY_TYPES = PRIVACY_ENTITY_TYPES;
|
|
45224
|
+
exports.PRIVACY_TARGET_SYSTEM = PRIVACY_TARGET_SYSTEM;
|
|
45156
45225
|
exports.PROJECTS_CUSTOM_ENDPOINTS = PROJECTS_CUSTOM_ENDPOINTS;
|
|
45157
45226
|
exports.PROJECTS_CUSTOM_REDUCER_PATH = PROJECTS_CUSTOM_REDUCER_PATH;
|
|
45158
45227
|
exports.PROJECTS_QUERY_KEYS = PROJECTS_QUERY_KEYS;
|
|
45159
45228
|
exports.QUERY_PARAMS = QUERY_PARAMS;
|
|
45160
45229
|
exports.RETIREMENT_ENDPOINTS = RETIREMENT_ENDPOINTS;
|
|
45161
45230
|
exports.STORAGE_KEYS = STORAGE_KEYS;
|
|
45231
|
+
exports.SUGGESTED_PRIVACY_ENTITIES = SUGGESTED_PRIVACY_ENTITIES;
|
|
45162
45232
|
exports.TENANT_IDENTIFIERS = TENANT_IDENTIFIERS;
|
|
45163
45233
|
exports.TENANT_LOGO_ENDPOINTS = TENANT_LOGO_ENDPOINTS;
|
|
45164
45234
|
exports.TENANT_LOGO_QUERY_KEYS = TENANT_LOGO_QUERY_KEYS;
|
|
@@ -45208,6 +45278,7 @@ exports.featureTags = featureTags;
|
|
|
45208
45278
|
exports.iblFakeBaseQuery = iblFakeBaseQuery;
|
|
45209
45279
|
exports.initializeDataLayer = initializeDataLayer;
|
|
45210
45280
|
exports.isPoliciesResponse = isPoliciesResponse;
|
|
45281
|
+
exports.isPrivacyBlockedError = isPrivacyBlockedError;
|
|
45211
45282
|
exports.llmsApiSlice = llmsApiSlice;
|
|
45212
45283
|
exports.mcpApiSlice = mcpApiSlice;
|
|
45213
45284
|
exports.memoryApiSlice = memoryApiSlice;
|