@fluid-topics/public-api 1.0.76 → 1.0.77
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/.yarnrc +1 -0
- package/dist/cjs/index.js +7 -7
- package/dist/cjs/roles/roles.js +7 -7
- package/dist/mjs/index.d.ts +7 -7
- package/dist/mjs/index.js +5 -5
- package/dist/mjs/preferences/unauthenticated-preferences.d.ts +1 -1
- package/dist/mjs/roles/roles.d.ts +1 -1
- package/dist/mjs/roles/roles.js +1 -1
- package/dist/mjs/types/ft-common/public.d.ts +5 -5
- package/package.json +3 -2
- package/.npmignore +0 -13
- package/yarn.lock +0 -4146
package/.yarnrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
--frozen-lockfile false
|
package/dist/cjs/index.js
CHANGED
|
@@ -52,12 +52,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
52
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
53
|
exports.FluidTopicsApi = exports.HttpErrorEvent = exports.HttpError = void 0;
|
|
54
54
|
const cross_fetch_1 = __importDefault(require("cross-fetch"));
|
|
55
|
-
const
|
|
55
|
+
const GenAIChunkReader_js_1 = require("./helpers/GenAIChunkReader.js");
|
|
56
56
|
const wnd = (typeof window === "undefined" ? globalThis : window);
|
|
57
|
-
__exportStar(require("./types/ft-common/public"), exports);
|
|
58
|
-
__exportStar(require("./types/ft-server/public"), exports);
|
|
59
|
-
__exportStar(require("./roles/roles"), exports);
|
|
60
|
-
__exportStar(require("./preferences/unauthenticated-preferences"), exports);
|
|
57
|
+
__exportStar(require("./types/ft-common/public.js"), exports);
|
|
58
|
+
__exportStar(require("./types/ft-server/public.js"), exports);
|
|
59
|
+
__exportStar(require("./roles/roles.js"), exports);
|
|
60
|
+
__exportStar(require("./preferences/unauthenticated-preferences.js"), exports);
|
|
61
61
|
function toBase64(s) {
|
|
62
62
|
return typeof Buffer !== "undefined" ? Buffer.from(s).toString("base64") : btoa(s);
|
|
63
63
|
}
|
|
@@ -376,7 +376,7 @@ class FluidTopicsApi {
|
|
|
376
376
|
credentials: this.authorization == null ? "include" : undefined
|
|
377
377
|
}));
|
|
378
378
|
yield __await(handleError("POST", this.endpoints.ai.generate, response));
|
|
379
|
-
const reader = new
|
|
379
|
+
const reader = new GenAIChunkReader_js_1.GenAIChunkReader(response.body.getReader());
|
|
380
380
|
yield __await(yield* __asyncDelegator(__asyncValues(reader.read())));
|
|
381
381
|
});
|
|
382
382
|
}
|
|
@@ -391,7 +391,7 @@ class FluidTopicsApi {
|
|
|
391
391
|
credentials: this.authorization == null ? "include" : undefined
|
|
392
392
|
}));
|
|
393
393
|
yield __await(handleError("POST", this.endpoints.ai.chat, response));
|
|
394
|
-
const reader = new
|
|
394
|
+
const reader = new GenAIChunkReader_js_1.GenAIChunkReader(response.body.getReader());
|
|
395
395
|
yield __await(yield* __asyncDelegator(__asyncValues(reader.read())));
|
|
396
396
|
});
|
|
397
397
|
}
|
package/dist/cjs/roles/roles.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.userHasRole = void 0;
|
|
4
|
-
const
|
|
4
|
+
const public_js_1 = require("../types/ft-common/public.js");
|
|
5
5
|
const rolesInheritance = {
|
|
6
|
-
[
|
|
7
|
-
[
|
|
8
|
-
[
|
|
9
|
-
[
|
|
10
|
-
[
|
|
11
|
-
[
|
|
6
|
+
[public_js_1.FtUserRole.PERSONAL_BOOK_SHARE_USER]: [public_js_1.FtUserRole.PERSONAL_BOOK_USER],
|
|
7
|
+
[public_js_1.FtUserRole.HTML_EXPORT_USER]: [public_js_1.FtUserRole.PERSONAL_BOOK_USER],
|
|
8
|
+
[public_js_1.FtUserRole.PDF_EXPORT_USER]: [public_js_1.FtUserRole.PERSONAL_BOOK_USER],
|
|
9
|
+
[public_js_1.FtUserRole.KHUB_ADMIN]: [public_js_1.FtUserRole.CONTENT_PUBLISHER],
|
|
10
|
+
[public_js_1.FtUserRole.ADMIN]: [public_js_1.FtUserRole.KHUB_ADMIN, public_js_1.FtUserRole.USERS_ADMIN, public_js_1.FtUserRole.PORTAL_ADMIN],
|
|
11
|
+
[public_js_1.FtUserRole.DEVELOPER]: [public_js_1.FtUserRole.BETA_USER, public_js_1.FtUserRole.DEBUG_USER],
|
|
12
12
|
};
|
|
13
13
|
function roleMatches(actual, expected) {
|
|
14
14
|
var _a;
|
package/dist/mjs/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { FtAuthenticatedSession, FtBookmark, FtCollectionDocument, FtHttpErrorDetails, FtMap, FtMapResource, FtMessageContext, FtMetadataConfiguration, FtMySearch, FtRatingSummary, FtRatingType, FtRatingTypeKeys, FtSearchLocales, FtSearchRequest, FtSearchResults, FtSession, FtSuggestRequest, FtSuggestResults, FtTocNode, FtTopic, FtTopicContentTarget, FtTopicContentTargetKeys, FtUiLocale, FtUnstructuredDocument } from "./types/ft-common/public";
|
|
2
|
-
import { FtClusteredSemanticSearchReply, FtGenAIRating, FtMapAttachment, FtPaginatedToc, FtRagInput, FtReaderConfiguration, FtSemanticSearchRequest, FtSemanticSearchResponseItem } from "./types/ft-server/public";
|
|
3
|
-
import { GenAIChunk } from "./helpers/GenAIChunkReader";
|
|
4
|
-
export * from "./types/ft-common/public";
|
|
5
|
-
export * from "./types/ft-server/public";
|
|
6
|
-
export * from "./roles/roles";
|
|
7
|
-
export * from "./preferences/unauthenticated-preferences";
|
|
1
|
+
import { FtAuthenticatedSession, FtBookmark, FtCollectionDocument, FtHttpErrorDetails, FtMap, FtMapResource, FtMessageContext, FtMetadataConfiguration, FtMySearch, FtRatingSummary, FtRatingType, FtRatingTypeKeys, FtSearchLocales, FtSearchRequest, FtSearchResults, FtSession, FtSuggestRequest, FtSuggestResults, FtTocNode, FtTopic, FtTopicContentTarget, FtTopicContentTargetKeys, FtUiLocale, FtUnstructuredDocument } from "./types/ft-common/public.js";
|
|
2
|
+
import { FtClusteredSemanticSearchReply, FtGenAIRating, FtMapAttachment, FtPaginatedToc, FtRagInput, FtReaderConfiguration, FtSemanticSearchRequest, FtSemanticSearchResponseItem } from "./types/ft-server/public.js";
|
|
3
|
+
import { GenAIChunk } from "./helpers/GenAIChunkReader.js";
|
|
4
|
+
export * from "./types/ft-common/public.js";
|
|
5
|
+
export * from "./types/ft-server/public.js";
|
|
6
|
+
export * from "./roles/roles.js";
|
|
7
|
+
export * from "./preferences/unauthenticated-preferences.js";
|
|
8
8
|
export declare class HttpError extends Error {
|
|
9
9
|
readonly method: string;
|
|
10
10
|
readonly endpoint: string;
|
package/dist/mjs/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import fetch from "cross-fetch";
|
|
2
|
-
import { GenAIChunkReader } from "./helpers/GenAIChunkReader";
|
|
2
|
+
import { GenAIChunkReader } from "./helpers/GenAIChunkReader.js";
|
|
3
3
|
const wnd = (typeof window === "undefined" ? globalThis : window);
|
|
4
|
-
export * from "./types/ft-common/public";
|
|
5
|
-
export * from "./types/ft-server/public";
|
|
6
|
-
export * from "./roles/roles";
|
|
7
|
-
export * from "./preferences/unauthenticated-preferences";
|
|
4
|
+
export * from "./types/ft-common/public.js";
|
|
5
|
+
export * from "./types/ft-server/public.js";
|
|
6
|
+
export * from "./roles/roles.js";
|
|
7
|
+
export * from "./preferences/unauthenticated-preferences.js";
|
|
8
8
|
function toBase64(s) {
|
|
9
9
|
return typeof Buffer !== "undefined" ? Buffer.from(s).toString("base64") : btoa(s);
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FtMetadataPreferenceConfiguration, FtSearchPreferencesConfiguration } from "../types/ft-common/public";
|
|
1
|
+
import { FtMetadataPreferenceConfiguration, FtSearchPreferencesConfiguration } from "../types/ft-common/public.js";
|
|
2
2
|
export declare function setUnauthenticatedUserSearchPreferences(tenantBaseUrl: string, input: FtSearchPreferencesConfiguration): {
|
|
3
3
|
metadata: Record<string, FtMetadataPreferenceConfiguration>;
|
|
4
4
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FtSession, FtUserProfile, FtUserRole, FtUserRoleKeys } from "../types/ft-common/public";
|
|
1
|
+
import { FtSession, FtUserProfile, FtUserRole, FtUserRoleKeys } from "../types/ft-common/public.js";
|
|
2
2
|
export declare function userHasRole(sessionOrProfileOrRoles: FtSession | FtUserProfile | Array<FtUserRole | FtUserRoleKeys> | undefined, expectedRole: FtUserRole | FtUserRoleKeys): boolean;
|
package/dist/mjs/roles/roles.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FtUserRole } from "../types/ft-common/public";
|
|
1
|
+
import { FtUserRole } from "../types/ft-common/public.js";
|
|
2
2
|
const rolesInheritance = {
|
|
3
3
|
[FtUserRole.PERSONAL_BOOK_SHARE_USER]: [FtUserRole.PERSONAL_BOOK_USER],
|
|
4
4
|
[FtUserRole.HTML_EXPORT_USER]: [FtUserRole.PERSONAL_BOOK_USER],
|
|
@@ -259,10 +259,10 @@ export interface FtMySearch {
|
|
|
259
259
|
}
|
|
260
260
|
export declare const isFtMySearch: (o: any) => o is FtMySearch;
|
|
261
261
|
export interface FtMySearchRequest {
|
|
262
|
-
periodFilter?: FtPeriodFilter;
|
|
262
|
+
/** @deprecated */ periodFilter?: FtPeriodFilter;
|
|
263
263
|
query: string;
|
|
264
264
|
scope?: FtSearchScopeKeys;
|
|
265
|
-
filters?: Array<FtLegacyLabeledMetadataFilter>;
|
|
265
|
+
/** @deprecated */ filters?: Array<FtLegacyLabeledMetadataFilter>;
|
|
266
266
|
sort: Array<FtSearchSortCriterion>;
|
|
267
267
|
virtualField?: FtVirtualFieldKeys;
|
|
268
268
|
metadataFilters?: Array<FtLabeledMetadataFilter>;
|
|
@@ -469,10 +469,10 @@ export interface FtSearchPrior {
|
|
|
469
469
|
}
|
|
470
470
|
export declare const isFtSearchPrior: (o: any) => o is FtSearchPrior;
|
|
471
471
|
export interface FtSearchRequest {
|
|
472
|
-
periodFilter?: FtPeriodFilter;
|
|
472
|
+
/** @deprecated */ periodFilter?: FtPeriodFilter;
|
|
473
473
|
query: string;
|
|
474
474
|
paging: FtPageRequest;
|
|
475
|
-
filters?: Array<FtLegacyMetadataFilter>;
|
|
475
|
+
/** @deprecated */ filters?: Array<FtLegacyMetadataFilter>;
|
|
476
476
|
sort: Array<FtSearchSortCriterion>;
|
|
477
477
|
virtualField?: FtVirtualFieldKeys;
|
|
478
478
|
metadataFilters: Array<FtMetadataFilter>;
|
|
@@ -669,7 +669,7 @@ export interface FtAuthenticatedSession {
|
|
|
669
669
|
}
|
|
670
670
|
export declare const isFtAuthenticatedSession: (o: any) => o is FtAuthenticatedSession;
|
|
671
671
|
export interface FtSearchPreferences {
|
|
672
|
-
defaultFilters?: Array<FtLegacyMetadataFilter>;
|
|
672
|
+
/** @deprecated */ defaultFilters?: Array<FtLegacyMetadataFilter>;
|
|
673
673
|
defaultMetadataFilters: Array<FtMetadataFilter>;
|
|
674
674
|
}
|
|
675
675
|
export declare const isFtSearchPreferences: (o: any) => o is FtSearchPreferences;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/public-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.77",
|
|
4
4
|
"description": "Fluid Topics Public API",
|
|
5
5
|
"author": "Fluid Topics dev team <opensource@antidot.net>",
|
|
6
6
|
"license": "LGPL-3.0-only",
|
|
@@ -43,7 +43,8 @@
|
|
|
43
43
|
"rollup-plugin-typescript2": "0.34.1",
|
|
44
44
|
"ts-node": "10.9.1",
|
|
45
45
|
"typescript": "5.0.4",
|
|
46
|
-
"vite": "4.3.1"
|
|
46
|
+
"vite": "4.3.1",
|
|
47
|
+
"tsx": "4.19.2"
|
|
47
48
|
},
|
|
48
49
|
"resolutions": {
|
|
49
50
|
"playwright": "1.47.2"
|