@dotcms/client 0.0.1-beta.2 → 0.0.1-beta.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 (47) hide show
  1. package/README.md +164 -36
  2. package/index.cjs.js +102 -1238
  3. package/index.esm.js +86 -1221
  4. package/next.cjs.d.ts +1 -0
  5. package/next.cjs.default.js +1 -0
  6. package/next.cjs.js +575 -0
  7. package/next.cjs.mjs +2 -0
  8. package/next.esm.d.ts +1 -0
  9. package/next.esm.js +573 -0
  10. package/package.json +32 -7
  11. package/src/index.d.ts +6 -6
  12. package/src/lib/client/client.d.ts +84 -0
  13. package/src/lib/client/content/builders/collection/collection.d.ts +1 -1
  14. package/src/lib/client/content/content-api.d.ts +1 -1
  15. package/src/lib/client/content/shared/types.d.ts +2 -2
  16. package/src/lib/client/models/types.d.ts +573 -10
  17. package/src/lib/client/navigation/navigation-api.d.ts +31 -0
  18. package/src/lib/client/page/page-api.d.ts +172 -0
  19. package/src/lib/client/page/utils.d.ts +41 -0
  20. package/src/lib/{editor → deprecated/editor}/models/client.model.d.ts +13 -0
  21. package/src/lib/{editor → deprecated/editor}/sdk-editor.d.ts +1 -1
  22. package/src/lib/{client → deprecated}/sdk-js-client.d.ts +1 -1
  23. package/src/lib/utils/page/common-utils.d.ts +1 -1
  24. package/src/next.d.ts +1 -0
  25. package/src/types.d.ts +2 -0
  26. package/transforms.cjs.js +1149 -0
  27. package/transforms.esm.js +1143 -0
  28. package/types.cjs.d.ts +1 -0
  29. package/types.cjs.default.js +1 -0
  30. package/types.cjs.js +2 -0
  31. package/types.cjs.mjs +2 -0
  32. package/types.esm.d.ts +1 -0
  33. package/types.esm.js +1 -0
  34. /package/src/lib/{query-builder → client/content/builders/query}/lucene-syntax/Equals.d.ts +0 -0
  35. /package/src/lib/{query-builder → client/content/builders/query}/lucene-syntax/Field.d.ts +0 -0
  36. /package/src/lib/{query-builder → client/content/builders/query}/lucene-syntax/NotOperand.d.ts +0 -0
  37. /package/src/lib/{query-builder → client/content/builders/query}/lucene-syntax/Operand.d.ts +0 -0
  38. /package/src/lib/{query-builder → client/content/builders/query}/lucene-syntax/index.d.ts +0 -0
  39. /package/src/lib/{query-builder/sdk-query-builder.d.ts → client/content/builders/query/query.d.ts} +0 -0
  40. /package/src/lib/{query-builder → client/content/builders/query}/utils/index.d.ts +0 -0
  41. /package/src/lib/{editor → deprecated/editor}/listeners/listeners.d.ts +0 -0
  42. /package/src/lib/{editor → deprecated/editor}/models/editor.model.d.ts +0 -0
  43. /package/src/lib/{editor → deprecated/editor}/models/inline-event.model.d.ts +0 -0
  44. /package/src/lib/{editor → deprecated/editor}/models/listeners.model.d.ts +0 -0
  45. /package/src/lib/{editor → deprecated/editor}/sdk-editor-vtl.d.ts +0 -0
  46. /package/src/lib/{editor → deprecated/editor}/utils/editor.utils.d.ts +0 -0
  47. /package/src/lib/{editor → deprecated/editor}/utils/traditional-vtl.utils.d.ts +0 -0
package/next.esm.js ADDED
@@ -0,0 +1,573 @@
1
+ import { E as ErrorMessages, _ as __classPrivateFieldGet, g as graphqlToPageEntity, C as Content } from './transforms.esm.js';
2
+
3
+ class NavigationClient {
4
+ constructor(config, requestOptions) {
5
+ this.requestOptions = requestOptions;
6
+ this.BASE_URL = `${config?.dotcmsUrl}/api/v1/nav`;
7
+ }
8
+ /**
9
+ * Retrieves information about the dotCMS file and folder tree.
10
+ * @param {NavigationApiOptions} options - The options for the Navigation API call. Defaults to `{ depth: 0, path: '/', languageId: 1 }`.
11
+ * @returns {Promise<unknown>} - A Promise that resolves to the response from the DotCMS API.
12
+ * @throws {Error} - Throws an error if the options are not valid.
13
+ */
14
+ async get(path, params) {
15
+ if (!path) {
16
+ throw new Error("The 'path' parameter is required for the Navigation API");
17
+ }
18
+ const navParams = params ? this.mapToBackendParams(params) : {};
19
+ const urlParams = new URLSearchParams(navParams).toString();
20
+ const parsedPath = path.replace(/^\/+/, '/').replace(/\/+$/, '/');
21
+ const url = `${this.BASE_URL}${parsedPath}${urlParams ? `?${urlParams}` : ''}`;
22
+ const response = await fetch(url, this.requestOptions);
23
+ if (!response.ok) {
24
+ throw new Error(`Failed to fetch navigation data: ${response.statusText} - ${response.status}`);
25
+ }
26
+ return response.json().then((data) => data.entity);
27
+ }
28
+ mapToBackendParams(params) {
29
+ const backendParams = {};
30
+ if (params.depth) {
31
+ backendParams['depth'] = String(params.depth);
32
+ }
33
+ if (params.languageId) {
34
+ backendParams['language_id'] = String(params.languageId);
35
+ }
36
+ return backendParams;
37
+ }
38
+ }
39
+
40
+ const DEFAULT_PAGE_CONTENTLETS_CONTENT = `
41
+ publishDate
42
+ inode
43
+ identifier
44
+ archived
45
+ urlMap
46
+ urlMap
47
+ locked
48
+ contentType
49
+ creationDate
50
+ modDate
51
+ title
52
+ baseType
53
+ working
54
+ live
55
+ publishUser {
56
+ firstName
57
+ lastName
58
+ }
59
+ owner {
60
+ lastName
61
+ }
62
+ conLanguage {
63
+ language
64
+ languageCode
65
+ }
66
+ modUser {
67
+ firstName
68
+ lastName
69
+ }
70
+ `;
71
+ /**
72
+ * Builds a GraphQL query for retrieving page content from DotCMS.
73
+ *
74
+ * @param {string} pageQuery - Custom fragment fields to include in the ClientPage fragment
75
+ * @param {string} additionalQueries - Additional GraphQL queries to include in the main query
76
+ * @returns {string} Complete GraphQL query string for page content
77
+ */
78
+ const buildPageQuery = ({ page, fragments, additionalQueries }) => {
79
+ if (!page) {
80
+ console.warn('No page query provided. The query will be used by fetching all content with _map. This may mean poor performance in the query. We suggest you provide a detailed query on page attribute.');
81
+ }
82
+ return `
83
+ fragment DotCMSPage on DotPage {
84
+ publishDate
85
+ type
86
+ httpsRequired
87
+ inode
88
+ path
89
+ identifier
90
+ hasTitleImage
91
+ sortOrder
92
+ extension
93
+ canRead
94
+ pageURI
95
+ canEdit
96
+ archived
97
+ friendlyName
98
+ workingInode
99
+ url
100
+ hasLiveVersion
101
+ deleted
102
+ pageUrl
103
+ shortyWorking
104
+ mimeType
105
+ locked
106
+ stInode
107
+ contentType
108
+ creationDate
109
+ liveInode
110
+ name
111
+ shortyLive
112
+ modDate
113
+ title
114
+ baseType
115
+ working
116
+ canLock
117
+ live
118
+ isContentlet
119
+ statusIcons
120
+ canEdit
121
+ canLock
122
+ canRead
123
+ canEdit
124
+ canLock
125
+ canRead
126
+ urlContentMap {
127
+ _map
128
+ }
129
+ conLanguage {
130
+ id
131
+ language
132
+ languageCode
133
+ }
134
+ template {
135
+ drawed
136
+ }
137
+ containers {
138
+ path
139
+ identifier
140
+ maxContentlets
141
+ containerStructures {
142
+ id
143
+ code
144
+ structureId
145
+ containerId
146
+ contentTypeVar
147
+ containerInode
148
+ }
149
+ containerContentlets {
150
+ uuid
151
+ contentlets {
152
+ ${page ? DEFAULT_PAGE_CONTENTLETS_CONTENT : '_map'}
153
+ }
154
+ }
155
+ }
156
+ layout {
157
+ header
158
+ footer
159
+ body {
160
+ rows {
161
+ columns {
162
+ leftOffset
163
+ styleClass
164
+ width
165
+ left
166
+ containers {
167
+ identifier
168
+ uuid
169
+ }
170
+ }
171
+ }
172
+ }
173
+ }
174
+ viewAs {
175
+ visitor {
176
+ persona {
177
+ name
178
+ }
179
+ }
180
+ language {
181
+ id
182
+ languageCode
183
+ countryCode
184
+ language
185
+ country
186
+ }
187
+ }
188
+ }
189
+
190
+ ${page ? ` fragment ClientPage on DotPage { ${page} } ` : ''}
191
+
192
+ ${fragments ? fragments.join('\n\n') : ''}
193
+
194
+ query PageContent($url: String!, $languageId: String, $mode: String, $personaId: String, $fireRules: Boolean, $publishDate: String, $siteId: String) {
195
+ page: page(url: $url, languageId: $languageId, pageMode: $mode, persona: $personaId, fireRules: $fireRules, publishDate: $publishDate, site: $siteId) {
196
+ ...DotCMSPage
197
+ ${page ? '...ClientPage' : ''}
198
+ }
199
+
200
+ ${additionalQueries}
201
+ }
202
+ `;
203
+ };
204
+ /**
205
+ * Converts a record of query strings into a single GraphQL query string.
206
+ *
207
+ * @param {Record<string, string>} queryData - Object containing named query strings
208
+ * @returns {string} Combined query string or empty string if no queryData provided
209
+ */
210
+ function buildQuery(queryData) {
211
+ if (!queryData)
212
+ return '';
213
+ return Object.entries(queryData)
214
+ .map(([key, query]) => `${key}: ${query}`)
215
+ .join(' ');
216
+ }
217
+ /**
218
+ * Filters response data to include only specified keys.
219
+ *
220
+ * @param {Record<string, string>} responseData - Original response data object
221
+ * @param {string[]} keys - Array of keys to extract from the response data
222
+ * @returns {Record<string, string>} New object containing only the specified keys
223
+ */
224
+ function mapResponseData(responseData, keys) {
225
+ return keys.reduce((accumulator, key) => {
226
+ if (responseData[key] !== undefined) {
227
+ accumulator[key] = responseData[key];
228
+ }
229
+ return accumulator;
230
+ }, {});
231
+ }
232
+ /**
233
+ * Executes a GraphQL query against the DotCMS API.
234
+ *
235
+ * @param {Object} options - Options for the fetch request
236
+ * @param {string} options.body - GraphQL query string
237
+ * @param {Record<string, string>} options.headers - HTTP headers for the request
238
+ * @returns {Promise<any>} Parsed JSON response from the GraphQL API
239
+ * @throws {Error} If the HTTP response is not successful
240
+ */
241
+ async function fetchGraphQL({ baseURL, body, headers }) {
242
+ const url = new URL(baseURL);
243
+ url.pathname = '/api/v1/graphql';
244
+ const response = await fetch(url.toString(), {
245
+ method: 'POST',
246
+ body,
247
+ headers
248
+ });
249
+ if (!response.ok) {
250
+ const error = {
251
+ status: response.status,
252
+ message: ErrorMessages[response.status] || response.statusText
253
+ };
254
+ throw error;
255
+ }
256
+ return await response.json();
257
+ }
258
+
259
+ var _PageClient_instances, _PageClient_isGraphQLRequest, _PageClient_getPageFromAPI, _PageClient_getPageFromGraphQL, _PageClient_mapToBackendParams;
260
+ /**
261
+ * Client for interacting with the DotCMS Page API.
262
+ * Provides methods to retrieve and manipulate pages.
263
+ */
264
+ class PageClient {
265
+ /**
266
+ * Creates a new PageClient instance.
267
+ *
268
+ * @param {DotCMSClientConfig} config - Configuration options for the DotCMS client
269
+ * @param {RequestOptions} requestOptions - Options for fetch requests including authorization headers
270
+ * @example
271
+ * ```typescript
272
+ * const pageClient = new PageClient(
273
+ * {
274
+ * dotcmsUrl: 'https://demo.dotcms.com',
275
+ * authToken: 'your-auth-token',
276
+ * siteId: 'demo.dotcms.com'
277
+ * },
278
+ * {
279
+ * headers: {
280
+ * Authorization: 'Bearer your-auth-token'
281
+ * }
282
+ * }
283
+ * );
284
+ * ```
285
+ */
286
+ constructor(config, requestOptions) {
287
+ _PageClient_instances.add(this);
288
+ this.requestOptions = requestOptions;
289
+ this.siteId = config.siteId || '';
290
+ this.dotcmsUrl = config.dotcmsUrl;
291
+ }
292
+ get(url, options) {
293
+ if (!options) {
294
+ return __classPrivateFieldGet(this, _PageClient_instances, "m", _PageClient_getPageFromAPI).call(this, url);
295
+ }
296
+ if (__classPrivateFieldGet(this, _PageClient_instances, "m", _PageClient_isGraphQLRequest).call(this, options)) {
297
+ return __classPrivateFieldGet(this, _PageClient_instances, "m", _PageClient_getPageFromGraphQL).call(this, url, options);
298
+ }
299
+ return __classPrivateFieldGet(this, _PageClient_instances, "m", _PageClient_getPageFromAPI).call(this, url, options);
300
+ }
301
+ }
302
+ _PageClient_instances = new WeakSet(), _PageClient_isGraphQLRequest = function _PageClient_isGraphQLRequest(options) {
303
+ return 'graphql' in options;
304
+ }, _PageClient_getPageFromAPI =
305
+ /**
306
+ * Retrieves all the elements of a Page in your dotCMS system in JSON format.
307
+ *
308
+ * @param {string} path - The path of the page to retrieve
309
+ * @param {PageRequestParams} params - The options for the Page API call
310
+ * @returns {Promise<unknown>} A Promise that resolves to the page data
311
+ * @throws {Error} Throws an error if the path parameter is missing or if the fetch request fails
312
+ * @example
313
+ * ```typescript
314
+ * // Get a page with default parameters
315
+ * const homePage = await pageClient.get('/');
316
+ *
317
+ * // Get a page with specific language and mode
318
+ * const aboutPage = await pageClient.get('/about-us', {
319
+ * languageId: 2,
320
+ * mode: 'PREVIEW_MODE'
321
+ * });
322
+ *
323
+ * // Get a page with persona targeting
324
+ * const productPage = await pageClient.get('/products', {
325
+ * personaId: 'persona-123',
326
+ * depth: 2
327
+ * });
328
+ * ```
329
+ */
330
+ async function _PageClient_getPageFromAPI(path, params) {
331
+ if (!path) {
332
+ throw new Error("The 'path' parameter is required for the Page API");
333
+ }
334
+ // If the siteId is not provided, use the one from the config
335
+ const completedParams = {
336
+ ...(params ?? {}),
337
+ siteId: params?.siteId || this.siteId
338
+ };
339
+ // Map the public parameters to the one used by the API
340
+ const normalizedParams = __classPrivateFieldGet(this, _PageClient_instances, "m", _PageClient_mapToBackendParams).call(this, completedParams || {});
341
+ // Build the query params
342
+ const queryParams = new URLSearchParams(normalizedParams).toString();
343
+ // If the path starts with a slash, remove it to avoid double slashes in the final URL
344
+ // Because the page path is part of api url path
345
+ const pagePath = path.startsWith('/') ? path.slice(1) : path;
346
+ const url = `${this.dotcmsUrl}/api/v1/page/json/${pagePath}?${queryParams}`;
347
+ const response = await fetch(url, this.requestOptions);
348
+ if (!response.ok) {
349
+ const error = {
350
+ status: response.status,
351
+ message: ErrorMessages[response.status] || response.statusText
352
+ };
353
+ throw error;
354
+ }
355
+ return response.json().then((data) => ({
356
+ ...data.entity,
357
+ params: completedParams // We retrieve the params from the API response, to make the same fetch on UVE
358
+ }));
359
+ }, _PageClient_getPageFromGraphQL =
360
+ /**
361
+ * Retrieves a personalized page with associated content and navigation.
362
+ *
363
+ * @param {Object} options - Options for the personalized page request
364
+ * @param {string} options.url - The URL of the page to retrieve
365
+ * @param {string} options.languageId - The language ID for the page content
366
+ * @param {string} options.mode - The rendering mode for the page
367
+ * @param {string} options.pageFragment - GraphQL fragment for page data
368
+ * @param {Record<string, string>} options.content - Content queries to include
369
+ * @param {Record<string, string>} options.nav - Navigation queries to include
370
+ * @returns {Promise<Object>} A Promise that resolves to the personalized page data with content and navigation
371
+ * @example
372
+ * ```typescript
373
+ * // Get a personalized page with content and navigation
374
+ * const personalizedPage = await pageClient.getPageFromGraphQL({
375
+ * url: '/about-us',
376
+ * languageId: '1',
377
+ * mode: 'LIVE',
378
+ * pageFragment: `
379
+ * fragment PageFields on Page {
380
+ * title
381
+ * description
382
+ * modDate
383
+ * }
384
+ * `,
385
+ * content: {
386
+ * blogs: `
387
+ * search(query: "+contentType: blog", limit: 3) {
388
+ * title
389
+ * ...on Blog {
390
+ * author {
391
+ * title
392
+ * }
393
+ * }
394
+ }
395
+ * nav: {
396
+ * mainNav: `
397
+ * query MainNav {
398
+ * Nav(identifier: "main-nav") {
399
+ * title
400
+ * items {
401
+ * label
402
+ * url
403
+ * }
404
+ * }
405
+ * }
406
+ * `
407
+ * }
408
+ * });
409
+ * ```
410
+ */
411
+ async function _PageClient_getPageFromGraphQL(url, options) {
412
+ const { languageId = '1', mode = 'LIVE', siteId = this.siteId, fireRules = false, personaId, publishDate, graphql = {} } = options || {};
413
+ const { page, content = {}, variables, fragments } = graphql;
414
+ const contentQuery = buildQuery(content);
415
+ const completeQuery = buildPageQuery({
416
+ page,
417
+ fragments,
418
+ additionalQueries: contentQuery
419
+ });
420
+ const requestVariables = {
421
+ url,
422
+ mode,
423
+ languageId,
424
+ personaId,
425
+ fireRules,
426
+ publishDate,
427
+ siteId,
428
+ ...variables
429
+ };
430
+ const requestHeaders = this.requestOptions.headers;
431
+ const requestBody = JSON.stringify({ query: completeQuery, variables: requestVariables });
432
+ try {
433
+ const { data, errors } = await fetchGraphQL({
434
+ baseURL: this.dotcmsUrl,
435
+ body: requestBody,
436
+ headers: requestHeaders
437
+ });
438
+ if (errors) {
439
+ errors.forEach((error) => {
440
+ throw new Error(error.message);
441
+ });
442
+ }
443
+ const pageResponse = graphqlToPageEntity(data);
444
+ if (!pageResponse) {
445
+ throw new Error('No page data found');
446
+ }
447
+ const contentResponse = mapResponseData(data, Object.keys(content));
448
+ return {
449
+ page: pageResponse,
450
+ content: contentResponse,
451
+ graphql: {
452
+ query: completeQuery,
453
+ variables: requestVariables
454
+ }
455
+ };
456
+ }
457
+ catch (error) {
458
+ const errorMessage = {
459
+ error,
460
+ message: 'Failed to retrieve page data',
461
+ graphql: {
462
+ query: completeQuery,
463
+ variables: requestVariables
464
+ }
465
+ };
466
+ throw errorMessage;
467
+ }
468
+ }, _PageClient_mapToBackendParams = function _PageClient_mapToBackendParams(params) {
469
+ const backendParams = {
470
+ hostId: params.siteId,
471
+ mode: params.mode,
472
+ language_id: params.languageId ? String(params.languageId) : undefined,
473
+ 'com.dotmarketing.persona.id': params.personaId,
474
+ fireRules: params.fireRules ? String(params.fireRules) : undefined,
475
+ depth: params.depth ? String(params.depth) : undefined,
476
+ publishDate: params.publishDate
477
+ };
478
+ // Remove undefined values
479
+ return Object.fromEntries(Object.entries(backendParams).filter(([_, value]) => value !== undefined));
480
+ };
481
+
482
+ /**
483
+ * Parses a string into a URL object.
484
+ *
485
+ * @param url - The URL string to parse
486
+ * @returns A URL object if parsing is successful, undefined otherwise
487
+ */
488
+ function parseURL(url) {
489
+ try {
490
+ return new URL(url);
491
+ }
492
+ catch {
493
+ console.error('Invalid URL:', url);
494
+ return undefined;
495
+ }
496
+ }
497
+ /**
498
+ * Default configuration for the DotCMS client.
499
+ */
500
+ const defaultConfig = {
501
+ dotcmsUrl: '',
502
+ authToken: '',
503
+ requestOptions: {}
504
+ };
505
+ /**
506
+ * Client for interacting with the DotCMS REST API.
507
+ * Provides access to content, page, and navigation functionality.
508
+ */
509
+ class DotCMSClient {
510
+ /**
511
+ * Creates a new DotCMS client instance.
512
+ *
513
+ * @param config - Configuration options for the client
514
+ * @throws Warning if dotcmsUrl is invalid or authToken is missing
515
+ */
516
+ constructor(config = defaultConfig) {
517
+ this.config = config;
518
+ this.requestOptions = this.createAuthenticatedRequestOptions(this.config);
519
+ // Initialize clients
520
+ this.page = new PageClient(this.config, this.requestOptions);
521
+ this.nav = new NavigationClient(this.config, this.requestOptions);
522
+ this.content = new Content(this.requestOptions, this.config.dotcmsUrl);
523
+ }
524
+ /**
525
+ * Creates request options with authentication headers.
526
+ *
527
+ * @param config - The client configuration
528
+ * @returns Request options with authorization headers
529
+ */
530
+ createAuthenticatedRequestOptions(config) {
531
+ return {
532
+ ...config.requestOptions,
533
+ headers: {
534
+ ...config.requestOptions?.headers,
535
+ Authorization: `Bearer ${config.authToken}`
536
+ }
537
+ };
538
+ }
539
+ }
540
+ /**
541
+ * Creates and returns a new DotCMS client instance.
542
+ *
543
+ * @param config - Configuration options for the client
544
+ * @returns A configured DotCMS client instance
545
+ * @example
546
+ * ```typescript
547
+ * const client = dotCMSCreateClient({
548
+ * dotcmsUrl: 'https://demo.dotcms.com',
549
+ * authToken: 'your-auth-token'
550
+ * });
551
+ *
552
+ * // Use the client to fetch content
553
+ * const pages = await client.page.get('/about-us');
554
+ * ```
555
+ */
556
+ const createDotCMSClient = (clientConfig) => {
557
+ const { dotcmsUrl, authToken } = clientConfig || {};
558
+ const instanceUrl = parseURL(dotcmsUrl)?.origin;
559
+ if (!instanceUrl) {
560
+ throw new TypeError("Invalid configuration - 'dotcmsUrl' must be a valid URL");
561
+ }
562
+ if (!authToken) {
563
+ throw new TypeError("Invalid configuration - 'authToken' is required");
564
+ }
565
+ const config = {
566
+ ...clientConfig,
567
+ authToken,
568
+ dotcmsUrl: instanceUrl
569
+ };
570
+ return new DotCMSClient(config);
571
+ };
572
+
573
+ export { createDotCMSClient };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotcms/client",
3
- "version": "0.0.1-beta.2",
3
+ "version": "0.0.1-beta.21",
4
4
  "description": "Official JavaScript library for interacting with DotCMS REST APIs.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,12 +16,6 @@
16
16
  "API Client",
17
17
  "REST API"
18
18
  ],
19
- "author": "dotcms <dev@dotcms.com>",
20
- "license": "MIT",
21
- "bugs": {
22
- "url": "https://github.com/dotCMS/core/issues"
23
- },
24
- "homepage": "https://github.com/dotCMS/core/tree/main/core-web/libs/sdk/client/README.md",
25
19
  "exports": {
26
20
  "./package.json": "./package.json",
27
21
  ".": {
@@ -29,8 +23,39 @@
29
23
  "types": "./index.esm.d.ts",
30
24
  "import": "./index.cjs.mjs",
31
25
  "default": "./index.cjs.js"
26
+ },
27
+ "./next": {
28
+ "module": "./next.esm.js",
29
+ "types": "./next.esm.d.ts",
30
+ "import": "./next.cjs.mjs",
31
+ "default": "./next.cjs.js"
32
+ },
33
+ "./types": {
34
+ "module": "./types.esm.js",
35
+ "types": "./types.esm.d.ts",
36
+ "import": "./types.cjs.mjs",
37
+ "default": "./types.cjs.js"
38
+ }
39
+ },
40
+ "typesVersions": {
41
+ "*": {
42
+ ".": [
43
+ "./src/index.d.ts"
44
+ ],
45
+ "next": [
46
+ "./src/next.d.ts"
47
+ ],
48
+ "types": [
49
+ "./src/types.d.ts"
50
+ ]
32
51
  }
33
52
  },
53
+ "author": "dotcms <dev@dotcms.com>",
54
+ "license": "MIT",
55
+ "bugs": {
56
+ "url": "https://github.com/dotCMS/core/issues"
57
+ },
58
+ "homepage": "https://github.com/dotCMS/core/tree/main/core-web/libs/sdk/client/README.md",
34
59
  "module": "./index.esm.js",
35
60
  "main": "./index.cjs.js",
36
61
  "types": "./index.esm.d.ts"
package/src/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { ClientConfig, DotCmsClient } from './lib/client/sdk-js-client';
2
- import { CLIENT_ACTIONS, postMessageToEditor } from './lib/editor/models/client.model';
3
- import { CustomClientParams, DotCMSPageEditorConfig, EditorConfig } from './lib/editor/models/editor.model';
4
- import { InlineEditorData, INLINE_EDITING_EVENT_KEY, InlineEditEventData } from './lib/editor/models/inline-event.model';
5
- import { NOTIFY_CLIENT } from './lib/editor/models/listeners.model';
6
- import { destroyEditor, editContentlet, reorderMenu, initEditor, isInsideEditor, updateNavigation, initInlineEditing } from './lib/editor/sdk-editor';
1
+ import { CLIENT_ACTIONS, postMessageToEditor } from './lib/deprecated/editor/models/client.model';
2
+ import { CustomClientParams, DotCMSPageEditorConfig, EditorConfig } from './lib/deprecated/editor/models/editor.model';
3
+ import { InlineEditorData, INLINE_EDITING_EVENT_KEY, InlineEditEventData } from './lib/deprecated/editor/models/inline-event.model';
4
+ import { NOTIFY_CLIENT } from './lib/deprecated/editor/models/listeners.model';
5
+ import { destroyEditor, editContentlet, reorderMenu, initEditor, isInsideEditor, updateNavigation, initInlineEditing } from './lib/deprecated/editor/sdk-editor';
6
+ import { ClientConfig, DotCmsClient } from './lib/deprecated/sdk-js-client';
7
7
  import { getPageRequestParams, graphqlToPageEntity } from './lib/utils';
8
8
  export { destroyEditor, editContentlet, getPageRequestParams, graphqlToPageEntity, initEditor, initInlineEditing, isInsideEditor, postMessageToEditor, reorderMenu, updateNavigation, DotCmsClient, ClientConfig, CustomClientParams, DotCMSPageEditorConfig, EditorConfig, InlineEditEventData, InlineEditorData, CLIENT_ACTIONS, INLINE_EDITING_EVENT_KEY, NOTIFY_CLIENT };