@dotcms/client 0.0.1-alpha.2 → 0.0.1-alpha.21

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 (80) hide show
  1. package/README.md +0 -1
  2. package/package.json +4 -1
  3. package/src/index.d.ts +6 -2
  4. package/src/index.js +6 -2
  5. package/src/index.js.map +1 -1
  6. package/src/lib/client/content/builders/collection/collection.d.ts +148 -0
  7. package/src/lib/client/content/builders/collection/collection.js +264 -0
  8. package/src/lib/client/content/builders/collection/collection.js.map +1 -0
  9. package/src/lib/client/content/content-api.d.ts +78 -0
  10. package/src/lib/client/content/content-api.js +87 -0
  11. package/src/lib/client/content/content-api.js.map +1 -0
  12. package/src/lib/client/content/shared/const.d.ts +3 -0
  13. package/src/lib/client/content/shared/const.js +5 -0
  14. package/src/lib/client/content/shared/const.js.map +1 -0
  15. package/src/lib/client/content/shared/types.d.ts +62 -0
  16. package/src/lib/client/content/shared/types.js +2 -0
  17. package/src/lib/client/content/shared/types.js.map +1 -0
  18. package/src/lib/client/content/shared/utils.d.ts +12 -0
  19. package/src/lib/client/content/shared/utils.js +20 -0
  20. package/src/lib/client/content/shared/utils.js.map +1 -0
  21. package/src/lib/client/models/index.d.ts +1 -0
  22. package/src/lib/client/models/index.js +9 -0
  23. package/src/lib/client/models/index.js.map +1 -0
  24. package/src/lib/{sdk-js-client.d.ts → client/sdk-js-client.d.ts} +11 -2
  25. package/src/lib/{sdk-js-client.js → client/sdk-js-client.js} +14 -0
  26. package/src/lib/client/sdk-js-client.js.map +1 -0
  27. package/src/lib/editor/listeners/listeners.d.ts +46 -0
  28. package/src/lib/editor/listeners/listeners.js +198 -0
  29. package/src/lib/editor/listeners/listeners.js.map +1 -0
  30. package/src/lib/{postMessageToEditor.d.ts → editor/models/client.model.d.ts} +26 -1
  31. package/src/lib/editor/models/client.model.js +62 -0
  32. package/src/lib/editor/models/client.model.js.map +1 -0
  33. package/src/lib/editor/models/editor.model.d.ts +16 -0
  34. package/src/lib/editor/models/editor.model.js +2 -0
  35. package/src/lib/editor/models/editor.model.js.map +1 -0
  36. package/src/lib/editor/models/listeners.model.d.ts +47 -0
  37. package/src/lib/editor/models/listeners.model.js +26 -0
  38. package/src/lib/editor/models/listeners.model.js.map +1 -0
  39. package/src/lib/editor/sdk-editor-vtl.d.ts +6 -0
  40. package/src/lib/editor/sdk-editor-vtl.js +21 -0
  41. package/src/lib/editor/sdk-editor-vtl.js.map +1 -0
  42. package/src/lib/editor/sdk-editor.d.ts +29 -0
  43. package/src/lib/editor/sdk-editor.js +68 -0
  44. package/src/lib/editor/sdk-editor.js.map +1 -0
  45. package/src/lib/editor/utils/editor.utils.d.ts +83 -0
  46. package/src/lib/editor/utils/editor.utils.js +134 -0
  47. package/src/lib/editor/utils/editor.utils.js.map +1 -0
  48. package/src/lib/query-builder/lucene-syntax/Equals.d.ts +83 -0
  49. package/src/lib/query-builder/lucene-syntax/Equals.js +101 -0
  50. package/src/lib/query-builder/lucene-syntax/Equals.js.map +1 -0
  51. package/src/lib/query-builder/lucene-syntax/Field.d.ts +23 -0
  52. package/src/lib/query-builder/lucene-syntax/Field.js +31 -0
  53. package/src/lib/query-builder/lucene-syntax/Field.js.map +1 -0
  54. package/src/lib/query-builder/lucene-syntax/NotOperand.d.ts +22 -0
  55. package/src/lib/query-builder/lucene-syntax/NotOperand.js +30 -0
  56. package/src/lib/query-builder/lucene-syntax/NotOperand.js.map +1 -0
  57. package/src/lib/query-builder/lucene-syntax/Operand.d.ts +44 -0
  58. package/src/lib/query-builder/lucene-syntax/Operand.js +55 -0
  59. package/src/lib/query-builder/lucene-syntax/Operand.js.map +1 -0
  60. package/src/lib/query-builder/lucene-syntax/index.d.ts +4 -0
  61. package/src/lib/query-builder/lucene-syntax/index.js +5 -0
  62. package/src/lib/query-builder/lucene-syntax/index.js.map +1 -0
  63. package/src/lib/query-builder/sdk-query-builder.d.ts +42 -0
  64. package/src/lib/query-builder/sdk-query-builder.js +54 -0
  65. package/src/lib/query-builder/sdk-query-builder.js.map +1 -0
  66. package/src/lib/query-builder/utils/index.d.ts +91 -0
  67. package/src/lib/query-builder/utils/index.js +115 -0
  68. package/src/lib/query-builder/utils/index.js.map +1 -0
  69. package/src/lib/utils/graphql/transforms.d.ts +12 -0
  70. package/src/lib/utils/graphql/transforms.js +47 -0
  71. package/src/lib/utils/graphql/transforms.js.map +1 -0
  72. package/src/lib/utils/index.d.ts +2 -0
  73. package/src/lib/utils/index.js +3 -0
  74. package/src/lib/utils/index.js.map +1 -0
  75. package/src/lib/utils/page/common-utils.d.ts +14 -0
  76. package/src/lib/utils/page/common-utils.js +12 -0
  77. package/src/lib/utils/page/common-utils.js.map +1 -0
  78. package/src/lib/postMessageToEditor.js +0 -37
  79. package/src/lib/postMessageToEditor.js.map +0 -1
  80. package/src/lib/sdk-js-client.js.map +0 -1
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Actions received from the dotcms editor
3
+ *
4
+ * @export
5
+ * @enum {number}
6
+ */
7
+ export var NOTIFY_CUSTOMER;
8
+ (function (NOTIFY_CUSTOMER) {
9
+ /**
10
+ * Request to page to reload
11
+ */
12
+ NOTIFY_CUSTOMER["EMA_RELOAD_PAGE"] = "ema-reload-page";
13
+ /**
14
+ * Request the bounds for the elements
15
+ */
16
+ NOTIFY_CUSTOMER["EMA_REQUEST_BOUNDS"] = "ema-request-bounds";
17
+ /**
18
+ * Received pong from the editor
19
+ */
20
+ NOTIFY_CUSTOMER["EMA_EDITOR_PONG"] = "ema-editor-pong";
21
+ /**
22
+ * Received scroll event trigger from the editor
23
+ */
24
+ NOTIFY_CUSTOMER["EMA_SCROLL_INSIDE_IFRAME"] = "scroll-inside-iframe";
25
+ })(NOTIFY_CUSTOMER || (NOTIFY_CUSTOMER = {}));
26
+ //# sourceMappingURL=listeners.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listeners.model.js","sourceRoot":"","sources":["../../../../../../../../libs/sdk/client/src/lib/editor/models/listeners.model.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAN,IAAY,eAkBX;AAlBD,WAAY,eAAe;IACvB;;OAEG;IACH,sDAAmC,CAAA;IACnC;;OAEG;IACH,4DAAyC,CAAA;IACzC;;OAEG;IACH,sDAAmC,CAAA;IACnC;;OAEG;IAEH,oEAAiD,CAAA;AACrD,CAAC,EAlBW,eAAe,KAAf,eAAe,QAkB1B"}
@@ -0,0 +1,6 @@
1
+ declare global {
2
+ interface Window {
3
+ lastScrollYPosition: number;
4
+ }
5
+ }
6
+ export {};
@@ -0,0 +1,21 @@
1
+ import { listenEditorMessages, listenHoveredContentlet, pingEditor, preserveScrollOnIframe, scrollHandler } from './listeners/listeners';
2
+ import { isInsideEditor, addClassToEmptyContentlets } from './sdk-editor';
3
+ /**
4
+ * This is the main entry point for the SDK VTL.
5
+ * This is added to VTL Script in the EditPage
6
+ *
7
+ * @remarks
8
+ * This module sets up the necessary listeners and functionality for the SDK VTL.
9
+ * It checks if the script is running inside the editor and then initializes the client by pinging the editor,
10
+ * listening for editor messages, hovered contentlet changes, and content changes.
11
+ *
12
+ */
13
+ if (isInsideEditor()) {
14
+ pingEditor();
15
+ listenEditorMessages();
16
+ scrollHandler();
17
+ preserveScrollOnIframe();
18
+ listenHoveredContentlet();
19
+ addClassToEmptyContentlets();
20
+ }
21
+ //# sourceMappingURL=sdk-editor-vtl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk-editor-vtl.js","sourceRoot":"","sources":["../../../../../../../libs/sdk/client/src/lib/editor/sdk-editor-vtl.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,oBAAoB,EACpB,uBAAuB,EACvB,UAAU,EACV,sBAAsB,EACtB,aAAa,EAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAQ1E;;;;;;;;;GASG;AACH,IAAI,cAAc,EAAE,EAAE,CAAC;IACnB,UAAU,EAAE,CAAC;IACb,oBAAoB,EAAE,CAAC;IACvB,aAAa,EAAE,CAAC;IAChB,sBAAsB,EAAE,CAAC;IACzB,uBAAuB,EAAE,CAAC;IAC1B,0BAA0B,EAAE,CAAC;AACjC,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { DotCMSPageEditorConfig } from './models/editor.model';
2
+ /**
3
+ *
4
+ * Updates the navigation in the editor.
5
+ * @param {string} pathname - The pathname to update the navigation with.
6
+ * @memberof DotCMSPageEditor
7
+ */
8
+ export declare function updateNavigation(pathname: string): void;
9
+ /**
10
+ * Checks if the code is running inside an editor.
11
+ * @returns {boolean} Returns true if the code is running inside an editor, otherwise false.
12
+ */
13
+ export declare function isInsideEditor(): boolean;
14
+ /**
15
+ * Initializes the DotCMS page editor.
16
+ *
17
+ * @param conf - Optional configuration for the editor.
18
+ */
19
+ export declare function initEditor(config?: DotCMSPageEditorConfig): void;
20
+ /**
21
+ * Destroys the editor by removing event listeners and disconnecting observers.
22
+ */
23
+ export declare function destroyEditor(): void;
24
+ /**
25
+ * Adds a class to empty contentlets.
26
+ *
27
+ * @export
28
+ */
29
+ export declare function addClassToEmptyContentlets(): void;
@@ -0,0 +1,68 @@
1
+ import { listenEditorMessages, listenHoveredContentlet, pingEditor, scrollHandler, setPageEditorConfig, subscriptions } from './listeners/listeners';
2
+ import { CUSTOMER_ACTIONS, postMessageToEditor } from './models/client.model';
3
+ /**
4
+ *
5
+ * Updates the navigation in the editor.
6
+ * @param {string} pathname - The pathname to update the navigation with.
7
+ * @memberof DotCMSPageEditor
8
+ */
9
+ export function updateNavigation(pathname) {
10
+ postMessageToEditor({
11
+ action: CUSTOMER_ACTIONS.NAVIGATION_UPDATE,
12
+ payload: {
13
+ url: pathname === '/' ? 'index' : pathname?.replace('/', '')
14
+ }
15
+ });
16
+ }
17
+ /**
18
+ * Checks if the code is running inside an editor.
19
+ * @returns {boolean} Returns true if the code is running inside an editor, otherwise false.
20
+ */
21
+ export function isInsideEditor() {
22
+ if (typeof window === 'undefined') {
23
+ return false;
24
+ }
25
+ return window.parent !== window;
26
+ }
27
+ /**
28
+ * Initializes the DotCMS page editor.
29
+ *
30
+ * @param conf - Optional configuration for the editor.
31
+ */
32
+ export function initEditor(config) {
33
+ if (config) {
34
+ setPageEditorConfig(config);
35
+ }
36
+ pingEditor();
37
+ listenEditorMessages();
38
+ listenHoveredContentlet();
39
+ scrollHandler();
40
+ }
41
+ /**
42
+ * Destroys the editor by removing event listeners and disconnecting observers.
43
+ */
44
+ export function destroyEditor() {
45
+ subscriptions.forEach((subscription) => {
46
+ if (subscription.type === 'listener') {
47
+ window.removeEventListener(subscription.event, subscription.callback);
48
+ }
49
+ if (subscription.type === 'observer') {
50
+ subscription.observer.disconnect();
51
+ }
52
+ });
53
+ }
54
+ /**
55
+ * Adds a class to empty contentlets.
56
+ *
57
+ * @export
58
+ */
59
+ export function addClassToEmptyContentlets() {
60
+ const contentlets = document.querySelectorAll('[data-dot-object="contentlet"]');
61
+ contentlets.forEach((contentlet) => {
62
+ if (contentlet.clientHeight) {
63
+ return;
64
+ }
65
+ contentlet.classList.add('empty-contentlet');
66
+ });
67
+ }
68
+ //# sourceMappingURL=sdk-editor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk-editor.js","sourceRoot":"","sources":["../../../../../../../libs/sdk/client/src/lib/editor/sdk-editor.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,oBAAoB,EACpB,uBAAuB,EACvB,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,aAAa,EAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG9E;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAgB;IAC7C,mBAAmB,CAAC;QAChB,MAAM,EAAE,gBAAgB,CAAC,iBAAiB;QAC1C,OAAO,EAAE;YACL,GAAG,EAAE,QAAQ,KAAK,GAAG,CAAC,CAAC,CAAC,OAAO,CA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AC;AACP,CAAC"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Bound information for a contentlet.
3
+ *
4
+ * @interface ContentletBound
5
+ */
6
+ interface ContentletBound {
7
+ x: number;
8
+ y: number;
9
+ width: number;
10
+ height: number;
11
+ payload: string;
12
+ }
13
+ /**
14
+ * Bound information for a container.
15
+ *
16
+ * @interface ContainerBound
17
+ */
18
+ interface ContainerBound {
19
+ x: number;
20
+ y: number;
21
+ width: number;
22
+ height: number;
23
+ payload: string;
24
+ contentlets: ContentletBound[];
25
+ }
26
+ /**
27
+ * Calculates the bounding information for each page element within the given containers.
28
+ *
29
+ * @export
30
+ * @param {HTMLDivElement[]} containers
31
+ * @return {*} An array of objects containing the bounding information for each page element.
32
+ */
33
+ export declare function getPageElementBound(containers: HTMLDivElement[]): ContainerBound[];
34
+ /**
35
+ * An array of objects containing the bounding information for each contentlet inside a container.
36
+ *
37
+ * @export
38
+ * @param {DOMRect} containerRect
39
+ * @param {HTMLDivElement[]} contentlets
40
+ * @return {*}
41
+ */
42
+ export declare function getContentletsBound(containerRect: DOMRect, contentlets: HTMLDivElement[]): ContentletBound[];
43
+ /**
44
+ * Get container data from VTLS.
45
+ *
46
+ * @export
47
+ * @param {HTMLElement} container
48
+ * @return {*}
49
+ */
50
+ export declare function getContainerData(container: HTMLElement): {
51
+ acceptTypes: string;
52
+ identifier: string;
53
+ maxContentlets: string;
54
+ uuid: string;
55
+ };
56
+ /**
57
+ * Get the closest container data from the contentlet.
58
+ *
59
+ * @export
60
+ * @param {Element} element
61
+ * @return {*}
62
+ */
63
+ export declare function getClosestContainerData(element: Element): {
64
+ acceptTypes: string;
65
+ identifier: string;
66
+ maxContentlets: string;
67
+ uuid: string;
68
+ } | null;
69
+ /**
70
+ * Find the closest contentlet element based on HTMLElement.
71
+ *
72
+ * @export
73
+ * @param {(HTMLElement | null)} element
74
+ * @return {*}
75
+ */
76
+ export declare function findDotElement(element: HTMLElement | null): HTMLElement | null;
77
+ export declare function findDotVTLElement(element: HTMLElement | null): HTMLElement | null;
78
+ export declare function findVTLData(target: HTMLElement): {
79
+ inode: string | undefined;
80
+ name: string | undefined;
81
+ }[] | null;
82
+ export declare function scrollIsInBottom(): boolean;
83
+ export {};
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Calculates the bounding information for each page element within the given containers.
3
+ *
4
+ * @export
5
+ * @param {HTMLDivElement[]} containers
6
+ * @return {*} An array of objects containing the bounding information for each page element.
7
+ */
8
+ export function getPageElementBound(containers) {
9
+ return containers.map((container) => {
10
+ const containerRect = container.getBoundingClientRect();
11
+ const contentlets = Array.from(container.querySelectorAll('[data-dot-object="contentlet"]'));
12
+ return {
13
+ x: containerRect.x,
14
+ y: containerRect.y,
15
+ width: containerRect.width,
16
+ height: containerRect.height,
17
+ payload: JSON.stringify({
18
+ container: getContainerData(container)
19
+ }),
20
+ contentlets: getContentletsBound(containerRect, contentlets)
21
+ };
22
+ });
23
+ }
24
+ /**
25
+ * An array of objects containing the bounding information for each contentlet inside a container.
26
+ *
27
+ * @export
28
+ * @param {DOMRect} containerRect
29
+ * @param {HTMLDivElement[]} contentlets
30
+ * @return {*}
31
+ */
32
+ export function getContentletsBound(containerRect, contentlets) {
33
+ return contentlets.map((contentlet) => {
34
+ const contentletRect = contentlet.getBoundingClientRect();
35
+ return {
36
+ x: 0,
37
+ y: contentletRect.y - containerRect.y,
38
+ width: contentletRect.width,
39
+ height: contentletRect.height,
40
+ payload: JSON.stringify({
41
+ container: contentlet.dataset?.['dotContainer']
42
+ ? JSON.parse(contentlet.dataset?.['dotContainer'])
43
+ : getClosestContainerData(contentlet),
44
+ contentlet: {
45
+ identifier: contentlet.dataset?.['dotIdentifier'],
46
+ title: contentlet.dataset?.['dotTitle'],
47
+ inode: contentlet.dataset?.['dotInode'],
48
+ contentType: contentlet.dataset?.['dotType']
49
+ }
50
+ })
51
+ };
52
+ });
53
+ }
54
+ /**
55
+ * Get container data from VTLS.
56
+ *
57
+ * @export
58
+ * @param {HTMLElement} container
59
+ * @return {*}
60
+ */
61
+ export function getContainerData(container) {
62
+ return {
63
+ acceptTypes: container.dataset?.['dotAcceptTypes'] || '',
64
+ identifier: container.dataset?.['dotIdentifier'] || '',
65
+ maxContentlets: container.dataset?.['maxContentlets'] || '',
66
+ uuid: container.dataset?.['dotUuid'] || ''
67
+ };
68
+ }
69
+ /**
70
+ * Get the closest container data from the contentlet.
71
+ *
72
+ * @export
73
+ * @param {Element} element
74
+ * @return {*}
75
+ */
76
+ export function getClosestContainerData(element) {
77
+ // Find the closest ancestor element with data-dot-object="container" attribute
78
+ const container = element.closest('[data-dot-object="container"]');
79
+ // If a container element is found
80
+ if (container) {
81
+ // Return the dataset of the container element
82
+ return getContainerData(container);
83
+ }
84
+ else {
85
+ // If no container element is found, return null
86
+ console.warn('No container found for the contentlet');
87
+ return null;
88
+ }
89
+ }
90
+ /**
91
+ * Find the closest contentlet element based on HTMLElement.
92
+ *
93
+ * @export
94
+ * @param {(HTMLElement | null)} element
95
+ * @return {*}
96
+ */
97
+ export function findDotElement(element) {
98
+ if (!element)
99
+ return null;
100
+ if (element?.dataset?.['dotObject'] === 'contentlet' ||
101
+ (element?.dataset?.['dotObject'] === 'container' && element.children.length === 0)) {
102
+ return element;
103
+ }
104
+ return findDotElement(element?.['parentElement']);
105
+ }
106
+ export function findDotVTLElement(element) {
107
+ if (!element)
108
+ return null;
109
+ if (element.dataset && element.dataset?.['dotObject'] === 'vtl-file') {
110
+ return element;
111
+ }
112
+ else {
113
+ return findDotElement(element?.['parentElement']);
114
+ }
115
+ }
116
+ export function findVTLData(target) {
117
+ const vltElements = target.querySelectorAll('[data-dot-object="vtl-file"]');
118
+ if (!vltElements.length) {
119
+ return null;
120
+ }
121
+ return Array.from(vltElements).map((vltElement) => {
122
+ return {
123
+ inode: vltElement.dataset?.['dotInode'],
124
+ name: vltElement.dataset?.['dotUrl']
125
+ };
126
+ });
127
+ }
128
+ export function scrollIsInBottom() {
129
+ const documentHeight = document.documentElement.scrollHeight;
130
+ const viewportHeight = window.innerHeight;
131
+ const scrollY = window.scrollY;
132
+ return scrollY + viewportHeight >= documentHeight;
133
+ }
134
+ //# sourceMappingURL=editor.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor.utils.js","sourceRoot":"","sources":["../../../../../../../../libs/sdk/client/src/lib/editor/utils/editor.utils.ts"],"names":[],"mappings":"AA2BA;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,UAA4B;IAC5D,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;QAChC,MAAM,aAAa,GAAG,SAAS,CAAC,qBAAqB,EAAE,CAAC;QACxD,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAC1B,SAAS,CAAC,gBAAgB,CAAC,gCAAgC,CAAC,CAC3C,CAAC;QAEtB,OAAO;YACH,CAAC,EAAE,aAAa,CAAC,CAAC;YAClB,CAAC,EAAE,aAAa,CAAC,CAAC;YAClB,KAAK,EAAE,aAAa,CAAC,KAAK;YAC1B,MAAM,EAAE,aAAa,CAAC,MAAM;YAC5B,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC;gBACpB,SAAS,EAAE,gBAAgB,CAAC,SAAS,CAAC;aACzC,CAAC;YACF,WAAW,EAAE,mBAAmB,CAAC,aAAa,EAAE,WAAW,CAAC;SAC/D,CAAC;IACN,CAAC,CAAC,CAAC;AACP,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAC/B,aAAsB,EACtB,WAA6B;IAE7B,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;QAClC,MAAM,cAAc,GAAG,UAAU,CAAC,qBAAqB,EAAE,CAAC;QAE1D,OAAO;YACH,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,cAAc,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC;YACrC,KAAK,EAAE,cAAc,CAAC,KAAK;YAC3B,MAAM,EAAE,cAAc,CAAC,MAAM;YAC7B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AAE,CAAC,QAAQ,CAAC;SACvC,CAAC;IACN,CAAC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC5B,MAAM,cAAc,GAAG,QAAQ,CAAC,eAAe,CAAC,YAAY,CAAC;IAC7D,MAAM,cAAc,GAAG,MAAM,CAAC,WAAW,CAAC;IAC1C,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAE/B,OAAO,OAAO,GAAG,cAAc,IAAI,cAAc,CAAC;AACtD,CAAC"}
@@ -0,0 +1,83 @@
1
+ import { Field } from './Field';
2
+ import { NotOperand } from './NotOperand';
3
+ import { Operand } from './Operand';
4
+ /**
5
+ * 'Equal' Is a Typescript class that provides the ability to use terms in the lucene query string.
6
+ * A term is a value used to search for a specific value in a document. It can be a word or a phrase.
7
+ *
8
+ * Ex: myValue or "My Value"
9
+ *
10
+ * @export
11
+ * @class Equal
12
+ */
13
+ export declare class Equals {
14
+ #private;
15
+ private query;
16
+ constructor(query: string);
17
+ /**
18
+ * This method appends to the query a term that should be excluded in the search.
19
+ *
20
+ * Ex: "-myValue"
21
+ *
22
+ * @param {string} field - The field that should be excluded in the search.
23
+ * @return {*} {Field} - An instance of a Lucene Field. A field is a key used to search for a specific value in a document.
24
+ * @memberof Equal
25
+ */
26
+ excludeField(field: string): Field;
27
+ /**
28
+ * This method appends to the query a field that should be included in the search.
29
+ *
30
+ * Ex: "+myField:"
31
+ *
32
+ * @param {string} field - The field that should be included in the search.
33
+ * @return {*} {Field} - An instance of a Lucene Field. A field is a key used to search for a specific value in a document.
34
+ * @memberof Equal
35
+ */
36
+ field(field: string): Field;
37
+ /**
38
+ * This method appends to the query an operand to use logic operators in the query.
39
+ *
40
+ * Ex: "OR"
41
+ *
42
+ * @return {*} {Operand} - An instance of a Lucene Operand. An operand is a logical operator used to combine terms or phrases in a query.
43
+ * @memberof Equal
44
+ */
45
+ or(): Operand;
46
+ /**
47
+ * This method appends to the query an operand to use logic operators in the query.
48
+ *
49
+ * Ex: "AND"
50
+ *
51
+ * @return {*} {Operand} - An instance of a Lucene Operand. An operand is a logical operator used to combine terms or phrases in a query.
52
+ * @memberof Equal
53
+ */
54
+ and(): Operand;
55
+ /**
56
+ * This method appends to the query an operand to use logic operators in the query.
57
+ *
58
+ * Ex: "NOT"
59
+ *
60
+ * @return {*} {NotOperand} - An instance of a Lucene Not Operand. A not operand is a logical operator used to exclude terms or phrases in a query.
61
+ * @memberof Equal
62
+ */
63
+ not(): NotOperand;
64
+ /**
65
+ * This method allows to pass a raw query string to the query builder.
66
+ * This raw query should end in a Lucene Equal.
67
+ * This method is useful when you want to append a complex query or an already written query to the query builder.
68
+ *
69
+ * Ex: "+myField: value AND (someOtherValue OR anotherValue)"
70
+ *
71
+ * @param {string} query - A raw query string.
72
+ * @return {*} {Equal} - An instance of a Lucene Equal. A term is a value used to search for a specific value in a document.
73
+ * @memberof QueryBuilder
74
+ */
75
+ raw(query: string): Equals;
76
+ /**
77
+ * This method returns the final query string.
78
+ *
79
+ * @return {*} {string} - The final query string.
80
+ * @memberof Equal
81
+ */
82
+ build(): string;
83
+ }
@@ -0,0 +1,101 @@
1
+ var _Equals_query;
2
+ import { __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
3
+ import { OPERAND, buildExcludeField, buildField, buildNotOperand, buildOperand, buildRawEquals, sanitizeQuery } from '../utils';
4
+ /**
5
+ * 'Equal' Is a Typescript class that provides the ability to use terms in the lucene query string.
6
+ * A term is a value used to search for a specific value in a document. It can be a word or a phrase.
7
+ *
8
+ * Ex: myValue or "My Value"
9
+ *
10
+ * @export
11
+ * @class Equal
12
+ */
13
+ export class Equals {
14
+ constructor(query) {
15
+ this.query = query;
16
+ _Equals_query.set(this, '');
17
+ __classPrivateFieldSet(this, _Equals_query, this.query, "f");
18
+ }
19
+ /**
20
+ * This method appends to the query a term that should be excluded in the search.
21
+ *
22
+ * Ex: "-myValue"
23
+ *
24
+ * @param {string} field - The field that should be excluded in the search.
25
+ * @return {*} {Field} - An instance of a Lucene Field. A field is a key used to search for a specific value in a document.
26
+ * @memberof Equal
27
+ */
28
+ excludeField(field) {
29
+ return buildExcludeField(__classPrivateFieldGet(this, _Equals_query, "f"), field);
30
+ }
31
+ /**
32
+ * This method appends to the query a field that should be included in the search.
33
+ *
34
+ * Ex: "+myField:"
35
+ *
36
+ * @param {string} field - The field that should be included in the search.
37
+ * @return {*} {Field} - An instance of a Lucene Field. A field is a key used to search for a specific value in a document.
38
+ * @memberof Equal
39
+ */
40
+ field(field) {
41
+ return buildField(__classPrivateFieldGet(this, _Equals_query, "f"), field);
42
+ }
43
+ /**
44
+ * This method appends to the query an operand to use logic operators in the query.
45
+ *
46
+ * Ex: "OR"
47
+ *
48
+ * @return {*} {Operand} - An instance of a Lucene Operand. An operand is a logical operator used to combine terms or phrases in a query.
49
+ * @memberof Equal
50
+ */
51
+ or() {
52
+ return buildOperand(__classPrivateFieldGet(this, _Equals_query, "f"), OPERAND.OR);
53
+ }
54
+ /**
55
+ * This method appends to the query an operand to use logic operators in the query.
56
+ *
57
+ * Ex: "AND"
58
+ *
59
+ * @return {*} {Operand} - An instance of a Lucene Operand. An operand is a logical operator used to combine terms or phrases in a query.
60
+ * @memberof Equal
61
+ */
62
+ and() {
63
+ return buildOperand(__classPrivateFieldGet(this, _Equals_query, "f"), OPERAND.AND);
64
+ }
65
+ /**
66
+ * This method appends to the query an operand to use logic operators in the query.
67
+ *
68
+ * Ex: "NOT"
69
+ *
70
+ * @return {*} {NotOperand} - An instance of a Lucene Not Operand. A not operand is a logical operator used to exclude terms or phrases in a query.
71
+ * @memberof Equal
72
+ */
73
+ not() {
74
+ return buildNotOperand(__classPrivateFieldGet(this, _Equals_query, "f"));
75
+ }
76
+ /**
77
+ * This method allows to pass a raw query string to the query builder.
78
+ * This raw query should end in a Lucene Equal.
79
+ * This method is useful when you want to append a complex query or an already written query to the query builder.
80
+ *
81
+ * Ex: "+myField: value AND (someOtherValue OR anotherValue)"
82
+ *
83
+ * @param {string} query - A raw query string.
84
+ * @return {*} {Equal} - An instance of a Lucene Equal. A term is a value used to search for a specific value in a document.
85
+ * @memberof QueryBuilder
86
+ */
87
+ raw(query) {
88
+ return buildRawEquals(__classPrivateFieldGet(this, _Equals_query, "f"), query);
89
+ }
90
+ /**
91
+ * This method returns the final query string.
92
+ *
93
+ * @return {*} {string} - The final query string.
94
+ * @memberof Equal
95
+ */
96
+ build() {
97
+ return sanitizeQuery(__classPrivateFieldGet(this, _Equals_query, "f"));
98
+ }
99
+ }
100
+ _Equals_query = new WeakMap();
101
+ //# sourceMappingURL=Equals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Equals.js","sourceRoot":"","sources":["../../../../../../../../libs/sdk/client/src/lib/query-builder/lucene-syntax/Equals.ts"],"names":[],"mappings":";;AAIA,OAAO,EACH,OAAO,EACP,iBAAiB,EACjB,UAAU,EACV,eAAe,EACf,YAAY,EACZ,cAAc,EACd,aAAa,EAChB,MAAM,UAAU,CAAC;AAElB;;;;;;;;GAQG;AACH,MAAM,OAAO,MAAM;IAGf,YAAoB,KAAa;QAAb,UAAK,GAAL,KAAK,CAAQ;QAFjC,wBAAS,EAAE,EAAC;QAGR,uBAAA,IAAI,iBAAU,IAAI,CAAC,KAAK,MAAA,CAAC;IAC7B,CAAC;IAED;;;;;;;;OAQG;IACH,YAAY,CAAC,KAAa;QACtB,OAAO,iBAAiB,CAAC,uBAAA,IAAI,qBAAO,EAAE,KAAK,CAAC,CAAC;IACjD,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,KAAa;QACf,OAAO,UAAU,CAAC,uBAAA,IAAI,qBAAO,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;IAED;;;;;;;OAOG;IACH,EAAE;QACE,OAAO,YAAY,CAAC,uBAAA,IAAI,qBAAO,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;IACjD,CAAC;IAED;;;;;;;OAOG;IACH,GAAG;QACC,OAAO,YAAY,CAAC,uBAAA,IAAI,qBAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IAClD,CAAC;IAED;;;;;;;OAOG;IACH,GAAG;QACC,OAAO,eAAe,CAAC,uBAAA,IAAI,qBAAO,CAAC,CAAC;IACxC,CAAC;IAED;;;;;;;;;;OAUG;IACH,GAAG,CAAC,KAAa;QACb,OAAO,cAAc,CAAC,uBAAA,IAAI,qBAAO,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED;;;;;OAKG;IACH,KAAK;QACD,OAAO,aAAa,CAAC,uBAAA,IAAI,qBAAO,CAAC,CAAC;IACtC,CAAC;CACJ"}
@@ -0,0 +1,23 @@
1
+ import { Equals } from './Equals';
2
+ /**
3
+ * 'Field' class is used to build a query with a field.
4
+ * A Lucene Field is a key used to search for a specific value in a document.
5
+ *
6
+ * @export
7
+ * @class Field
8
+ */
9
+ export declare class Field {
10
+ #private;
11
+ private query;
12
+ constructor(query: string);
13
+ /**
14
+ * This method appends to the query a term that should be included in the search..
15
+ *
16
+ * Ex: myValue or "My value"
17
+ *
18
+ * @param {string} term - The term that should be included in the search.
19
+ * @return {*} {Equals} - An instance of Equals.
20
+ * @memberof Field
21
+ */
22
+ equals(term: string): Equals;
23
+ }
@@ -0,0 +1,31 @@
1
+ var _Field_query;
2
+ import { __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
3
+ import { buildEquals } from '../utils';
4
+ /**
5
+ * 'Field' class is used to build a query with a field.
6
+ * A Lucene Field is a key used to search for a specific value in a document.
7
+ *
8
+ * @export
9
+ * @class Field
10
+ */
11
+ export class Field {
12
+ constructor(query) {
13
+ this.query = query;
14
+ _Field_query.set(this, '');
15
+ __classPrivateFieldSet(this, _Field_query, this.query, "f");
16
+ }
17
+ /**
18
+ * This method appends to the query a term that should be included in the search..
19
+ *
20
+ * Ex: myValue or "My value"
21
+ *
22
+ * @param {string} term - The term that should be included in the search.
23
+ * @return {*} {Equals} - An instance of Equals.
24
+ * @memberof Field
25
+ */
26
+ equals(term) {
27
+ return buildEquals(__classPrivateFieldGet(this, _Field_query, "f"), term);
28
+ }
29
+ }
30
+ _Field_query = new WeakMap();
31
+ //# sourceMappingURL=Field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Field.js","sourceRoot":"","sources":["../../../../../../../../libs/sdk/client/src/lib/query-builder/lucene-syntax/Field.ts"],"names":[],"mappings":";;AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC;;;;;;GAMG;AACH,MAAM,OAAO,KAAK;IAEd,YAAoB,KAAa;QAAb,UAAK,GAAL,KAAK,CAAQ;QADjC,uBAAS,EAAE,EAAC;QAER,uBAAA,IAAI,gBAAU,IAAI,CAAC,KAAK,MAAA,CAAC;IAC7B,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,IAAY;QACf,OAAO,WAAW,CAAC,uBAAA,IAAI,oBAAO,EAAE,IAAI,CAAC,CAAC;IAC1C,CAAC;CACJ"}
@@ -0,0 +1,22 @@
1
+ import { Equals } from './Equals';
2
+ /**
3
+ * 'NotOperand' Is a Typescript class that provides the ability to use the NOT operand in the lucene query string.
4
+ *
5
+ * @export
6
+ * @class NotOperand
7
+ */
8
+ export declare class NotOperand {
9
+ #private;
10
+ private query;
11
+ constructor(query: string);
12
+ /**
13
+ * This method appends to the query a term that should be included in the search.
14
+ *
15
+ * Ex: myValue or "My value"
16
+ *
17
+ * @param {string} term - The term that should be included in the search.
18
+ * @return {*} {Equals} - An instance of Equals.
19
+ * @memberof NotOperand
20
+ */
21
+ equals(term: string): Equals;
22
+ }