@fluid-topics/public-api 1.0.49 → 1.0.50

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.
Files changed (34) hide show
  1. package/build/cjs/index.js +373 -0
  2. package/build/cjs/preferences/unauthenticated-preferences.js +67 -0
  3. package/build/cjs/roles/roles.js +31 -0
  4. package/build/cjs/types/ft-common/public.js +743 -0
  5. package/build/cjs/types/ft-server/public.js +69 -0
  6. package/build/mjs/index.d.ts +168 -0
  7. package/build/mjs/index.js +358 -0
  8. package/build/mjs/preferences/unauthenticated-preferences.d.ts +9 -0
  9. package/build/mjs/preferences/unauthenticated-preferences.js +61 -0
  10. package/build/mjs/roles/roles.d.ts +2 -0
  11. package/build/mjs/roles/roles.js +25 -0
  12. package/build/mjs/types/ft-common/public.d.ts +580 -0
  13. package/build/mjs/types/ft-common/public.js +667 -0
  14. package/build/mjs/types/ft-server/public.d.ts +50 -0
  15. package/build/mjs/types/ft-server/public.js +59 -0
  16. package/dist/cjs/index.js +373 -0
  17. package/dist/cjs/package.json +3 -0
  18. package/dist/cjs/preferences/unauthenticated-preferences.js +67 -0
  19. package/dist/cjs/roles/roles.js +31 -0
  20. package/dist/cjs/types/ft-common/public.js +743 -0
  21. package/dist/cjs/types/ft-server/public.js +69 -0
  22. package/dist/fluidtopics.min.js +1 -0
  23. package/dist/mjs/index.d.ts +168 -0
  24. package/dist/mjs/index.js +358 -0
  25. package/dist/mjs/package.json +3 -0
  26. package/dist/mjs/preferences/unauthenticated-preferences.d.ts +9 -0
  27. package/dist/mjs/preferences/unauthenticated-preferences.js +61 -0
  28. package/dist/mjs/roles/roles.d.ts +2 -0
  29. package/dist/mjs/roles/roles.js +25 -0
  30. package/dist/mjs/types/ft-common/public.d.ts +580 -0
  31. package/dist/mjs/types/ft-common/public.js +667 -0
  32. package/dist/mjs/types/ft-server/public.d.ts +50 -0
  33. package/dist/mjs/types/ft-server/public.js +59 -0
  34. package/package.json +1 -1
@@ -0,0 +1,50 @@
1
+ export interface FtReaderConfiguration {
2
+ feedback: FtReaderFeedbackConfiguration;
3
+ loadAfterLastVisibleTopic: number;
4
+ loadBeforeFirstVisibleTopic: number;
5
+ }
6
+ export declare const isFtReaderConfiguration: (o: any) => o is FtReaderConfiguration;
7
+ export interface FtReaderFeedbackConfiguration {
8
+ mailsSentByFluidTopics: boolean;
9
+ mailsSentByFluidTopicsForUnauthenticatedUsers: boolean;
10
+ recipients: Array<string>;
11
+ bodyMetadataIds: Array<string>;
12
+ subjectMetadataIds: Array<string>;
13
+ }
14
+ export declare const isFtReaderFeedbackConfiguration: (o: any) => o is FtReaderFeedbackConfiguration;
15
+ export interface FtMapAttachment {
16
+ file: string;
17
+ size?: number;
18
+ externalLink: boolean;
19
+ name: string;
20
+ id: string;
21
+ mimeType?: string;
22
+ viewerUrl?: string;
23
+ }
24
+ export declare const isFtMapAttachment: (o: any) => o is FtMapAttachment;
25
+ export interface FtPageConfiguration {
26
+ parentsVisibility?: Array<boolean>;
27
+ isVisible: boolean;
28
+ }
29
+ export declare const isFtPageConfiguration: (o: any) => o is FtPageConfiguration;
30
+ export interface FtPaginatedToc {
31
+ configuration: FtPaginationConfiguration;
32
+ paginatedToc: Array<FtPaginatedTocNode>;
33
+ }
34
+ export declare const isFtPaginatedToc: (o: any) => o is FtPaginatedToc;
35
+ export interface FtPaginatedTocNode {
36
+ prettyUrl?: string;
37
+ hasRating?: boolean;
38
+ pageToc?: Array<any>;
39
+ tocId?: string;
40
+ children: Array<FtPaginatedTocNode>;
41
+ pageConfiguration?: FtPageConfiguration;
42
+ origin?: any;
43
+ contentId?: string;
44
+ title?: string;
45
+ }
46
+ export declare const isFtPaginatedTocNode: (o: any) => o is FtPaginatedTocNode;
47
+ export interface FtPaginationConfiguration {
48
+ splitCurrentPageToc: boolean;
49
+ }
50
+ export declare const isFtPaginationConfiguration: (o: any) => o is FtPaginationConfiguration;
@@ -0,0 +1,59 @@
1
+ const isObject = (o) => typeof o === "object" && o != null;
2
+ const isBoolean = (o) => typeof o === "boolean";
3
+ const isNumber = (o) => typeof o === "number";
4
+ const isString = (o) => typeof o === "string";
5
+ export const isFtReaderConfiguration = (o) => {
6
+ return isObject(o)
7
+ && (isFtReaderFeedbackConfiguration(o.feedback))
8
+ && (isNumber(o.loadAfterLastVisibleTopic))
9
+ && (isNumber(o.loadBeforeFirstVisibleTopic));
10
+ };
11
+ export const isFtReaderFeedbackConfiguration = (o) => {
12
+ return isObject(o)
13
+ && (isBoolean(o.mailsSentByFluidTopics))
14
+ && (isBoolean(o.mailsSentByFluidTopicsForUnauthenticatedUsers))
15
+ && ((Array.isArray(o.recipients)
16
+ && o.recipients.every((v) => isString(v))))
17
+ && ((Array.isArray(o.bodyMetadataIds)
18
+ && o.bodyMetadataIds.every((v) => isString(v))))
19
+ && ((Array.isArray(o.subjectMetadataIds)
20
+ && o.subjectMetadataIds.every((v) => isString(v))));
21
+ };
22
+ export const isFtMapAttachment = (o) => {
23
+ return isObject(o)
24
+ && (isString(o.file))
25
+ && (o.size == null || isNumber(o.size))
26
+ && (isBoolean(o.externalLink))
27
+ && (isString(o.name))
28
+ && (isString(o.id))
29
+ && (o.mimeType == null || isString(o.mimeType))
30
+ && (o.viewerUrl == null || isString(o.viewerUrl));
31
+ };
32
+ export const isFtPageConfiguration = (o) => {
33
+ return isObject(o)
34
+ && (o.parentsVisibility == null || (Array.isArray(o.parentsVisibility)
35
+ && o.parentsVisibility.every((v) => isBoolean(v))))
36
+ && (isBoolean(o.isVisible));
37
+ };
38
+ export const isFtPaginatedToc = (o) => {
39
+ return isObject(o)
40
+ && (isFtPaginationConfiguration(o.configuration))
41
+ && ((Array.isArray(o.paginatedToc)
42
+ && o.paginatedToc.every((v) => isFtPaginatedTocNode(v))));
43
+ };
44
+ export const isFtPaginatedTocNode = (o) => {
45
+ return isObject(o)
46
+ && (o.prettyUrl == null || isString(o.prettyUrl))
47
+ && (o.hasRating == null || isBoolean(o.hasRating))
48
+ && (o.pageToc == null || (Array.isArray(o.pageToc)))
49
+ && (o.tocId == null || isString(o.tocId))
50
+ && ((Array.isArray(o.children)
51
+ && o.children.every((v) => isFtPaginatedTocNode(v))))
52
+ && (o.pageConfiguration == null || isFtPageConfiguration(o.pageConfiguration))
53
+ && (o.contentId == null || isString(o.contentId))
54
+ && (o.title == null || isString(o.title));
55
+ };
56
+ export const isFtPaginationConfiguration = (o) => {
57
+ return isObject(o)
58
+ && (isBoolean(o.splitCurrentPageToc));
59
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/public-api",
3
- "version": "1.0.49",
3
+ "version": "1.0.50",
4
4
  "description": "Fluid Topics Public API",
5
5
  "author": "Fluid Topics dev team <opensource@antidot.net>",
6
6
  "license": "LGPL-3.0-only",