@dotcms/client 0.0.1-alpha.37 → 0.0.1-alpha.39

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 (66) hide show
  1. package/.eslintrc.json +18 -0
  2. package/README.md +4 -4
  3. package/jest.config.ts +15 -0
  4. package/package.json +3 -15
  5. package/project.json +72 -0
  6. package/src/index.ts +30 -0
  7. package/src/lib/client/content/builders/collection/collection.spec.ts +515 -0
  8. package/src/lib/client/content/builders/collection/collection.ts +416 -0
  9. package/src/lib/client/content/content-api.ts +139 -0
  10. package/src/lib/client/content/shared/const.ts +15 -0
  11. package/src/lib/client/content/shared/types.ts +155 -0
  12. package/src/lib/client/content/shared/utils.ts +28 -0
  13. package/src/lib/client/models/index.ts +19 -0
  14. package/src/lib/client/models/types.ts +14 -0
  15. package/src/lib/client/sdk-js-client.spec.ts +483 -0
  16. package/src/lib/client/sdk-js-client.ts +442 -0
  17. package/src/lib/editor/listeners/listeners.spec.ts +119 -0
  18. package/src/lib/editor/listeners/listeners.ts +223 -0
  19. package/src/lib/editor/models/{client.model.d.ts → client.model.ts} +19 -16
  20. package/src/lib/editor/models/{editor.model.d.ts → editor.model.ts} +9 -5
  21. package/src/lib/editor/models/{listeners.model.d.ts → listeners.model.ts} +9 -6
  22. package/src/lib/editor/sdk-editor-vtl.ts +31 -0
  23. package/src/lib/editor/sdk-editor.spec.ts +116 -0
  24. package/src/lib/editor/sdk-editor.ts +105 -0
  25. package/src/lib/editor/utils/editor.utils.spec.ts +206 -0
  26. package/src/lib/editor/utils/editor.utils.ts +258 -0
  27. package/src/lib/query-builder/lucene-syntax/{Equals.d.ts → Equals.ts} +83 -18
  28. package/src/lib/query-builder/lucene-syntax/Field.ts +40 -0
  29. package/src/lib/query-builder/lucene-syntax/{NotOperand.d.ts → NotOperand.ts} +18 -6
  30. package/src/lib/query-builder/lucene-syntax/{Operand.d.ts → Operand.ts} +21 -7
  31. package/src/lib/query-builder/sdk-query-builder.spec.ts +159 -0
  32. package/src/lib/query-builder/sdk-query-builder.ts +87 -0
  33. package/src/lib/query-builder/utils/index.ts +179 -0
  34. package/src/lib/utils/graphql/transforms.spec.ts +150 -0
  35. package/src/lib/utils/graphql/transforms.ts +99 -0
  36. package/src/lib/utils/page/common-utils.spec.ts +37 -0
  37. package/src/lib/utils/page/common-utils.ts +64 -0
  38. package/tsconfig.json +22 -0
  39. package/tsconfig.lib.json +13 -0
  40. package/tsconfig.spec.json +9 -0
  41. package/index.cjs.d.ts +0 -1
  42. package/index.cjs.default.js +0 -1
  43. package/index.cjs.js +0 -1490
  44. package/index.cjs.mjs +0 -2
  45. package/index.esm.d.ts +0 -1
  46. package/index.esm.js +0 -1481
  47. package/src/index.d.ts +0 -6
  48. package/src/lib/client/content/builders/collection/collection.d.ts +0 -148
  49. package/src/lib/client/content/content-api.d.ts +0 -78
  50. package/src/lib/client/content/shared/const.d.ts +0 -3
  51. package/src/lib/client/content/shared/types.d.ts +0 -62
  52. package/src/lib/client/content/shared/utils.d.ts +0 -12
  53. package/src/lib/client/models/index.d.ts +0 -1
  54. package/src/lib/client/models/types.d.ts +0 -5
  55. package/src/lib/client/sdk-js-client.d.ts +0 -193
  56. package/src/lib/editor/listeners/listeners.d.ts +0 -46
  57. package/src/lib/editor/sdk-editor-vtl.d.ts +0 -6
  58. package/src/lib/editor/sdk-editor.d.ts +0 -29
  59. package/src/lib/editor/utils/editor.utils.d.ts +0 -83
  60. package/src/lib/query-builder/lucene-syntax/Field.d.ts +0 -23
  61. package/src/lib/query-builder/sdk-query-builder.d.ts +0 -42
  62. package/src/lib/query-builder/utils/index.d.ts +0 -91
  63. package/src/lib/utils/graphql/transforms.d.ts +0 -11
  64. package/src/lib/utils/page/common-utils.d.ts +0 -11
  65. /package/src/lib/query-builder/lucene-syntax/{index.d.ts → index.ts} +0 -0
  66. /package/src/lib/utils/{index.d.ts → index.ts} +0 -0
@@ -1,23 +0,0 @@
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
- }
@@ -1,42 +0,0 @@
1
- import { Equals, Field } from './lucene-syntax/index';
2
- /**
3
- * 'QueryBuilder' Is a Typescript class that provides the ability to build a query string using the Lucene syntax in a more readable way.
4
- *
5
- * @export
6
- * @class QueryBuilder
7
- */
8
- export declare class QueryBuilder {
9
- #private;
10
- /**
11
- * This method appends to the query a field that should be included in the search.
12
- *
13
- * Ex: "+myField:"
14
- *
15
- * @param {string} field - The field that should be included in the search.
16
- * @return {*} {Field} - An instance of a Lucene Field. A field is a key used to search for a specific value in a document.
17
- * @memberof QueryBuilder
18
- */
19
- field(field: string): Field;
20
- /**
21
- * This method appends to the query a field that should be excluded from the search.
22
- *
23
- * Ex: "-myField:"
24
- *
25
- * @param {string} field - The field that should be excluded from the search.
26
- * @return {*} {Field} - An instance of a Lucene Exclude Field. An exclude field is a key used to exclude for a specific value in a document.
27
- * @memberof QueryBuilder
28
- */
29
- excludeField(field: string): Field;
30
- /**
31
- * This method allows to pass a raw query string to the query builder.
32
- * This raw query should end in Equals.
33
- * This method is useful when you want to append a complex query or an already written query to the query builder.
34
- *
35
- * Ex: "+myField: value AND (someOtherValue OR anotherValue)"
36
- *
37
- * @param {string} query - A raw query string.
38
- * @return {*} {Equals} - An instance of Equals. A term is a value used to search for a specific value in a document.
39
- * @memberof QueryBuilder
40
- */
41
- raw(query: string): Equals;
42
- }
@@ -1,91 +0,0 @@
1
- import { Equals } from '../lucene-syntax/Equals';
2
- import { Field } from '../lucene-syntax/Field';
3
- import { NotOperand } from '../lucene-syntax/NotOperand';
4
- import { Operand } from '../lucene-syntax/Operand';
5
- /**
6
- * Enum for common Operands
7
- *
8
- * @export
9
- * @enum {number}
10
- */
11
- export declare enum OPERAND {
12
- OR = "OR",
13
- AND = "AND",
14
- NOT = "NOT"
15
- }
16
- /**
17
- * This function removes extra spaces from a string.
18
- *
19
- * @export
20
- * @param {string} str
21
- * @return {*} {string}
22
- */
23
- export declare function sanitizeQuery(str: string): string;
24
- /**
25
- * This function sanitizes a term by adding quotes if it contains spaces.
26
- * In lucene, a term with spaces should be enclosed in quotes.
27
- *
28
- * @export
29
- * @param {string} term
30
- * @return {*} {string}
31
- */
32
- export declare function sanitizePhrases(term: string): string;
33
- /**
34
- * This function builds a term to be used in a lucene query.
35
- * We need to sanitize the term before adding it to the query.
36
- *
37
- * @export
38
- * @param {string} query
39
- * @param {string} term
40
- * @return {*} {Equals}
41
- */
42
- export declare function buildEquals(query: string, term: string): Equals;
43
- /**
44
- * This function builds a term to be used in a lucene query.
45
- * We need to sanitize the raw query before adding it to the query.
46
- *
47
- * @export
48
- * @param {string} query
49
- * @param {string} raw
50
- * @return {*} {Equals}
51
- */
52
- export declare function buildRawEquals(query: string, raw: string): Equals;
53
- /**
54
- * This function builds a field to be used in a lucene query.
55
- * We need to format the field before adding it to the query.
56
- *
57
- * @export
58
- * @param {string} query
59
- * @param {string} field
60
- * @return {*} {Field}
61
- */
62
- export declare function buildField(query: string, field: string): Field;
63
- /**
64
- * This function builds an exclude field to be used in a lucene query.
65
- * We need to format the field before adding it to the query.
66
- *
67
- * @export
68
- * @param {string} query
69
- * @param {string} field
70
- * @return {*} {Field}
71
- */
72
- export declare function buildExcludeField(query: string, field: string): Field;
73
- /**
74
- * This function builds an operand to be used in a lucene query.
75
- * We need to format the operand before adding it to the query.
76
- *
77
- * @export
78
- * @param {string} query
79
- * @param {OPERAND} operand
80
- * @return {*} {Operand}
81
- */
82
- export declare function buildOperand(query: string, operand: OPERAND): Operand;
83
- /**
84
- * This function builds a NOT operand to be used in a lucene query.
85
- * We need to format the operand before adding it to the query.
86
- *
87
- * @export
88
- * @param {string} query
89
- * @return {*} {NotOperand}
90
- */
91
- export declare function buildNotOperand(query: string): NotOperand;
@@ -1,11 +0,0 @@
1
- export declare const graphqlToPageEntity: ({ page }: {
2
- page: Record<string, unknown>;
3
- }) => {
4
- layout: unknown;
5
- template: unknown;
6
- viewAs: unknown;
7
- urlContentMap: unknown;
8
- site: unknown;
9
- page: any;
10
- containers: Record<string, unknown>;
11
- } | null;
@@ -1,11 +0,0 @@
1
- interface PageRequestParamsProps {
2
- path: string;
3
- params: {
4
- [key: string]: any;
5
- } | undefined | URLSearchParams;
6
- }
7
- export declare const getPageRequestParams: ({ path, params }: PageRequestParamsProps) => {
8
- path: string;
9
- [key: string]: string | number;
10
- };
11
- export {};
File without changes