dotcms 0.0.20 → 0.2.0
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/README.md +33 -74
- package/index.js +1197 -0
- package/package.json +22 -9
- package/src/index.d.ts +0 -30
- package/src/index.js +0 -40
- package/src/index.js.map +0 -1
- package/src/lib/api/DotApiAuthorization.d.ts +0 -11
- package/src/lib/api/DotApiAuthorization.js +0 -46
- package/src/lib/api/DotApiAuthorization.js.map +0 -1
- package/src/lib/api/DotApiConfiguration.d.ts +0 -11
- package/src/lib/api/DotApiConfiguration.js +0 -32
- package/src/lib/api/DotApiConfiguration.js.map +0 -1
- package/src/lib/api/DotApiContent.d.ts +0 -14
- package/src/lib/api/DotApiContent.js +0 -59
- package/src/lib/api/DotApiContent.js.map +0 -1
- package/src/lib/api/DotApiContentType.d.ts +0 -12
- package/src/lib/api/DotApiContentType.js +0 -35
- package/src/lib/api/DotApiContentType.js.map +0 -1
- package/src/lib/api/DotApiElasticSearch.d.ts +0 -15
- package/src/lib/api/DotApiElasticSearch.js +0 -37
- package/src/lib/api/DotApiElasticSearch.js.map +0 -1
- package/src/lib/api/DotApiEvent.d.ts +0 -8
- package/src/lib/api/DotApiEvent.js +0 -20
- package/src/lib/api/DotApiEvent.js.map +0 -1
- package/src/lib/api/DotApiForm.d.ts +0 -17
- package/src/lib/api/DotApiForm.js +0 -25
- package/src/lib/api/DotApiForm.js.map +0 -1
- package/src/lib/api/DotApiLanguage.d.ts +0 -13
- package/src/lib/api/DotApiLanguage.js +0 -33
- package/src/lib/api/DotApiLanguage.js.map +0 -1
- package/src/lib/api/DotApiNavigation.d.ts +0 -11
- package/src/lib/api/DotApiNavigation.js +0 -34
- package/src/lib/api/DotApiNavigation.js.map +0 -1
- package/src/lib/api/DotApiPage.d.ts +0 -18
- package/src/lib/api/DotApiPage.js +0 -51
- package/src/lib/api/DotApiPage.js.map +0 -1
- package/src/lib/api/DotApiSite.d.ts +0 -10
- package/src/lib/api/DotApiSite.js +0 -31
- package/src/lib/api/DotApiSite.js.map +0 -1
- package/src/lib/api/DotApiWidget.d.ts +0 -13
- package/src/lib/api/DotApiWidget.js +0 -33
- package/src/lib/api/DotApiWidget.js.map +0 -1
- package/src/lib/models/DotCMSAuthorization.model.d.ts +0 -6
- package/src/lib/models/DotCMSAuthorization.model.js +0 -3
- package/src/lib/models/DotCMSAuthorization.model.js.map +0 -1
- package/src/lib/models/DotCMSConfiguration.model.d.ts +0 -53
- package/src/lib/models/DotCMSConfiguration.model.js +0 -3
- package/src/lib/models/DotCMSConfiguration.model.js.map +0 -1
- package/src/lib/models/DotCMSContent.model.d.ts +0 -13
- package/src/lib/models/DotCMSContent.model.js +0 -3
- package/src/lib/models/DotCMSContent.model.js.map +0 -1
- package/src/lib/models/DotCMSElasticSearch.model.d.ts +0 -48
- package/src/lib/models/DotCMSElasticSearch.model.js +0 -3
- package/src/lib/models/DotCMSElasticSearch.model.js.map +0 -1
- package/src/lib/models/DotCMSError.model.d.ts +0 -4
- package/src/lib/models/DotCMSError.model.js +0 -3
- package/src/lib/models/DotCMSError.model.js.map +0 -1
- package/src/lib/models/DotCMSEvent.model.d.ts +0 -4
- package/src/lib/models/DotCMSEvent.model.js +0 -3
- package/src/lib/models/DotCMSEvent.model.js.map +0 -1
- package/src/lib/models/DotCMSForm.model.d.ts +0 -14
- package/src/lib/models/DotCMSForm.model.js +0 -3
- package/src/lib/models/DotCMSForm.model.js.map +0 -1
- package/src/lib/models/DotCMSHttpClient.model.d.ts +0 -10
- package/src/lib/models/DotCMSHttpClient.model.js +0 -3
- package/src/lib/models/DotCMSHttpClient.model.js.map +0 -1
- package/src/lib/models/DotCMSLanguage.model.d.ts +0 -7
- package/src/lib/models/DotCMSLanguage.model.js +0 -3
- package/src/lib/models/DotCMSLanguage.model.js.map +0 -1
- package/src/lib/models/DotCMSNavigation.model.d.ts +0 -13
- package/src/lib/models/DotCMSNavigation.model.js +0 -3
- package/src/lib/models/DotCMSNavigation.model.js.map +0 -1
- package/src/lib/models/DotCMSPage.model.d.ts +0 -245
- package/src/lib/models/DotCMSPage.model.js +0 -3
- package/src/lib/models/DotCMSPage.model.js.map +0 -1
- package/src/lib/models/DotCMSPageFormat.model.d.ts +0 -4
- package/src/lib/models/DotCMSPageFormat.model.js +0 -3
- package/src/lib/models/DotCMSPageFormat.model.js.map +0 -1
- package/src/lib/models/DotCMSSite.model.d.ts +0 -156
- package/src/lib/models/DotCMSSite.model.js +0 -3
- package/src/lib/models/DotCMSSite.model.js.map +0 -1
- package/src/lib/models/index.d.ts +0 -13
- package/src/lib/models/index.js +0 -17
- package/src/lib/models/index.js.map +0 -1
- package/src/lib/utils/DotCMSHttpClient.d.ts +0 -6
- package/src/lib/utils/DotCMSHttpClient.js +0 -14
- package/src/lib/utils/DotCMSHttpClient.js.map +0 -1
- package/src/lib/utils/getEsQuery.d.ts +0 -2
- package/src/lib/utils/getEsQuery.js +0 -39
- package/src/lib/utils/getEsQuery.js.map +0 -1
- package/src/lib/utils/request.d.ts +0 -2
- package/src/lib/utils/request.js +0 -47
- package/src/lib/utils/request.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
|
|
2
|
+
"name": "dotcms",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"dotcms": "./index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"*.js",
|
|
11
|
+
"README.md"
|
|
12
|
+
],
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"cfonts": "^3.3.1",
|
|
18
|
+
"chalk": "^5.6.2",
|
|
19
|
+
"commander": "^14.0.2",
|
|
20
|
+
"inquirer": "^13.0.1",
|
|
21
|
+
"ora": "^9.0.0",
|
|
22
|
+
"smol-toml": "^1.8.0"
|
|
23
|
+
}
|
|
11
24
|
}
|
package/src/index.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { DotApiAuthorization } from './lib/api/DotApiAuthorization';
|
|
2
|
-
import { DotApiConfiguration } from './lib/api/DotApiConfiguration';
|
|
3
|
-
import { DotApiElasticSearch } from './lib/api/DotApiElasticSearch';
|
|
4
|
-
import { DotApiEvent } from './lib/api/DotApiEvent';
|
|
5
|
-
import { DotApiLanguage } from './lib/api/DotApiLanguage';
|
|
6
|
-
import { DotApiNavigation } from './lib/api/DotApiNavigation';
|
|
7
|
-
import { DotApiPage } from './lib/api/DotApiPage';
|
|
8
|
-
import { DotApiSite } from './lib/api/DotApiSite';
|
|
9
|
-
import { DotApiWidget } from './lib/api/DotApiWidget';
|
|
10
|
-
import { DotCMSHttpClient } from './lib/utils/DotCMSHttpClient';
|
|
11
|
-
import { DotCMSConfigurationParams, DotCMSFormConfig } from './lib/models';
|
|
12
|
-
import { DotApiContent } from './lib/api/DotApiContent';
|
|
13
|
-
import { DotApiContentType } from './lib/api/DotApiContentType';
|
|
14
|
-
import { DotApiForm } from './lib/api/DotApiForm';
|
|
15
|
-
export interface DotCMSApp {
|
|
16
|
-
auth: DotApiAuthorization;
|
|
17
|
-
content: DotApiContent;
|
|
18
|
-
contentType: DotApiContentType;
|
|
19
|
-
esSearch: DotApiElasticSearch;
|
|
20
|
-
event: DotApiEvent;
|
|
21
|
-
nav: DotApiNavigation;
|
|
22
|
-
page: DotApiPage;
|
|
23
|
-
site: DotApiSite;
|
|
24
|
-
form: (formConfig: DotCMSFormConfig, win?: Window) => DotApiForm;
|
|
25
|
-
widget: DotApiWidget;
|
|
26
|
-
config: DotApiConfiguration;
|
|
27
|
-
language: DotApiLanguage;
|
|
28
|
-
httpClient: DotCMSHttpClient;
|
|
29
|
-
}
|
|
30
|
-
export declare const initDotCMS: (config: DotCMSConfigurationParams) => DotCMSApp;
|
package/src/index.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initDotCMS = void 0;
|
|
4
|
-
const DotApiAuthorization_1 = require("./lib/api/DotApiAuthorization");
|
|
5
|
-
const DotApiConfiguration_1 = require("./lib/api/DotApiConfiguration");
|
|
6
|
-
const DotApiElasticSearch_1 = require("./lib/api/DotApiElasticSearch");
|
|
7
|
-
const DotApiEvent_1 = require("./lib/api/DotApiEvent");
|
|
8
|
-
const DotApiLanguage_1 = require("./lib/api/DotApiLanguage");
|
|
9
|
-
const DotApiNavigation_1 = require("./lib/api/DotApiNavigation");
|
|
10
|
-
const DotApiPage_1 = require("./lib/api/DotApiPage");
|
|
11
|
-
const DotApiSite_1 = require("./lib/api/DotApiSite");
|
|
12
|
-
const DotApiWidget_1 = require("./lib/api/DotApiWidget");
|
|
13
|
-
const DotCMSHttpClient_1 = require("./lib/utils/DotCMSHttpClient");
|
|
14
|
-
const DotApiContent_1 = require("./lib/api/DotApiContent");
|
|
15
|
-
const DotApiContentType_1 = require("./lib/api/DotApiContentType");
|
|
16
|
-
const DotApiForm_1 = require("./lib/api/DotApiForm");
|
|
17
|
-
const initDotCMS = (config) => {
|
|
18
|
-
const httpClient = new DotCMSHttpClient_1.DotCMSHttpClient(config);
|
|
19
|
-
const apiConfig = new DotApiConfiguration_1.DotApiConfiguration(httpClient);
|
|
20
|
-
const apiLanguage = new DotApiLanguage_1.DotApiLanguage(apiConfig);
|
|
21
|
-
const content = new DotApiContent_1.DotApiContent(httpClient);
|
|
22
|
-
const dotApiContentType = new DotApiContentType_1.DotApiContentType(httpClient);
|
|
23
|
-
return {
|
|
24
|
-
auth: new DotApiAuthorization_1.DotApiAuthorization(),
|
|
25
|
-
config: apiConfig,
|
|
26
|
-
content: content,
|
|
27
|
-
contentType: new DotApiContentType_1.DotApiContentType(httpClient),
|
|
28
|
-
esSearch: new DotApiElasticSearch_1.DotApiElasticSearch(httpClient),
|
|
29
|
-
event: new DotApiEvent_1.DotApiEvent(),
|
|
30
|
-
form: (formConfig) => new DotApiForm_1.DotApiForm(dotApiContentType, formConfig),
|
|
31
|
-
language: apiLanguage,
|
|
32
|
-
nav: new DotApiNavigation_1.DotApiNavigation(httpClient),
|
|
33
|
-
page: new DotApiPage_1.DotApiPage(httpClient, apiLanguage),
|
|
34
|
-
site: new DotApiSite_1.DotApiSite(httpClient),
|
|
35
|
-
widget: new DotApiWidget_1.DotApiWidget(httpClient),
|
|
36
|
-
httpClient
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
exports.initDotCMS = initDotCMS;
|
|
40
|
-
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/dotcms/src/index.ts"],"names":[],"mappings":";;;AAAA,uEAAoE;AACpE,uEAAoE;AACpE,uEAAoE;AACpE,uDAAoD;AACpD,6DAA0D;AAC1D,iEAA8D;AAC9D,qDAAkD;AAClD,qDAAkD;AAClD,yDAAsD;AACtD,mEAAgE;AAEhE,2DAAwD;AACxD,mEAAgE;AAChE,qDAAkD;AAkB3C,MAAM,UAAU,GAAG,CAAC,MAAiC,EAAa,EAAE;IACvE,MAAM,UAAU,GAAG,IAAI,mCAAgB,CAAC,MAAM,CAAC,CAAC;IAChD,MAAM,SAAS,GAAG,IAAI,yCAAmB,CAAC,UAAU,CAAC,CAAC;IACtD,MAAM,WAAW,GAAG,IAAI,+BAAc,CAAC,SAAS,CAAC,CAAC;IAClD,MAAM,OAAO,GAAG,IAAI,6BAAa,CAAC,UAAU,CAAC,CAAC;IAC9C,MAAM,iBAAiB,GAAG,IAAI,qCAAiB,CAAC,UAAU,CAAC,CAAC;IAE5D,OAAO;QACH,IAAI,EAAE,IAAI,yCAAmB,EAAE;QAC/B,MAAM,EAAE,SAAS;QACjB,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,IAAI,qCAAiB,CAAC,UAAU,CAAC;QAC9C,QAAQ,EAAE,IAAI,yCAAmB,CAAC,UAAU,CAAC;QAC7C,KAAK,EAAE,IAAI,yBAAW,EAAE;QACxB,IAAI,EAAE,CAAC,UAA4B,EAAE,EAAE,CAAC,IAAI,uBAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC;QACrF,QAAQ,EAAE,WAAW;QACrB,GAAG,EAAE,IAAI,mCAAgB,CAAC,UAAU,CAAC;QACrC,IAAI,EAAE,IAAI,uBAAU,CAAC,UAAU,EAAE,WAAW,CAAC;QAC7C,IAAI,EAAE,IAAI,uBAAU,CAAC,UAAU,CAAC;QAChC,MAAM,EAAE,IAAI,2BAAY,CAAC,UAAU,CAAC;QACpC,UAAU;KACb,CAAC;AACN,CAAC,CAAC;AAtBW,QAAA,UAAU,cAsBrB"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { DotCMSAuthorizationLoginParams } from '../models';
|
|
2
|
-
/**
|
|
3
|
-
* DotCMS Authentication handler to intereact with {@link https://dotcms.com/docs/latest/rest-api-authentication | Authentication API}
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
export declare class DotApiAuthorization {
|
|
7
|
-
/**
|
|
8
|
-
* Given user, password and expiration date to get a DotCMS Autorization Token
|
|
9
|
-
*/
|
|
10
|
-
getToken(params: DotCMSAuthorizationLoginParams): Promise<Response>;
|
|
11
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DotApiAuthorization = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
function getErrorMessage(data) {
|
|
6
|
-
if (data.errors) {
|
|
7
|
-
return data.errors[0].message;
|
|
8
|
-
}
|
|
9
|
-
if (data.error) {
|
|
10
|
-
return data.error;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* DotCMS Authentication handler to intereact with {@link https://dotcms.com/docs/latest/rest-api-authentication | Authentication API}
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
class DotApiAuthorization {
|
|
18
|
-
/**
|
|
19
|
-
* Given user, password and expiration date to get a DotCMS Autorization Token
|
|
20
|
-
*/
|
|
21
|
-
getToken(params) {
|
|
22
|
-
const { user, password, expirationDays, host } = params;
|
|
23
|
-
return fetch(`${host || ''}/api/v1/authentication/api-token`, {
|
|
24
|
-
method: 'POST',
|
|
25
|
-
headers: {
|
|
26
|
-
'Content-Type': 'application/json'
|
|
27
|
-
},
|
|
28
|
-
body: JSON.stringify({
|
|
29
|
-
user: user,
|
|
30
|
-
password: password,
|
|
31
|
-
expirationDays: expirationDays || 10
|
|
32
|
-
})
|
|
33
|
-
}).then((res) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
const data = yield res.json();
|
|
35
|
-
if (res.status === 200) {
|
|
36
|
-
return data.entity.token;
|
|
37
|
-
}
|
|
38
|
-
throw {
|
|
39
|
-
message: getErrorMessage(data),
|
|
40
|
-
statusCode: res.status
|
|
41
|
-
};
|
|
42
|
-
}));
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.DotApiAuthorization = DotApiAuthorization;
|
|
46
|
-
//# sourceMappingURL=DotApiAuthorization.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DotApiAuthorization.js","sourceRoot":"","sources":["../../../../../../libs/dotcms/src/lib/api/DotApiAuthorization.ts"],"names":[],"mappings":";;;;AAEA,SAAS,eAAe,CAAC,IAA4B;IACjD,IAAI,IAAI,CAAC,MAAM,EAAE;QACb,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;KACjC;IAED,IAAI,IAAI,CAAC,KAAK,EAAE;QACZ,OAAO,IAAI,CAAC,KAAK,CAAC;KACrB;AACL,CAAC;AAED;;;GAGG;AACH,MAAa,mBAAmB;IAC5B;;OAEG;IAEH,QAAQ,CAAC,MAAsC;QAC3C,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;QAExD,OAAO,KAAK,CAAC,GAAG,IAAI,IAAI,EAAE,kCAAkC,EAAE;YAC1D,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACL,cAAc,EAAE,kBAAkB;aACrC;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACjB,IAAI,EAAE,IAAI;gBACV,QAAQ,EAAE,QAAQ;gBAClB,cAAc,EAAE,cAAc,IAAI,EAAE;aACvC,CAAC;SACL,CAAC,CAAC,IAAI,CAAC,CAAO,GAAa,EAAE,EAAE;YAC5B,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;YAE9B,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE;gBACpB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;aAC5B;YAED,MAAmB;gBACf,OAAO,EAAE,eAAe,CAAC,IAAI,CAAC;gBAC9B,UAAU,EAAE,GAAG,CAAC,MAAM;aACzB,CAAC;QACN,CAAC,CAAA,CAAC,CAAC;IACP,CAAC;CACJ;AA/BD,kDA+BC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { DotCMSHttpClient } from '../utils/DotCMSHttpClient';
|
|
2
|
-
import { DotCMSConfigurationItem } from '../models';
|
|
3
|
-
/**
|
|
4
|
-
* Get the information of DotCMS configuration
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
export declare class DotApiConfiguration {
|
|
8
|
-
private dotCMSHttpClient;
|
|
9
|
-
constructor(httpClient: DotCMSHttpClient);
|
|
10
|
-
get(): Promise<DotCMSConfigurationItem>;
|
|
11
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DotApiConfiguration = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
/**
|
|
6
|
-
* Get the information of DotCMS configuration
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
class DotApiConfiguration {
|
|
10
|
-
constructor(httpClient) {
|
|
11
|
-
this.dotCMSHttpClient = httpClient;
|
|
12
|
-
}
|
|
13
|
-
// TODO: CATCH THIS ERROR
|
|
14
|
-
get() {
|
|
15
|
-
return this.dotCMSHttpClient
|
|
16
|
-
.request({
|
|
17
|
-
url: '/api/v1/configuration'
|
|
18
|
-
})
|
|
19
|
-
.then((response) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
if (response.status === 200) {
|
|
21
|
-
const data = yield response.json();
|
|
22
|
-
return data.entity;
|
|
23
|
-
}
|
|
24
|
-
throw {
|
|
25
|
-
message: yield response.text(),
|
|
26
|
-
statusCode: response.status
|
|
27
|
-
};
|
|
28
|
-
}));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
exports.DotApiConfiguration = DotApiConfiguration;
|
|
32
|
-
//# sourceMappingURL=DotApiConfiguration.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DotApiConfiguration.js","sourceRoot":"","sources":["../../../../../../libs/dotcms/src/lib/api/DotApiConfiguration.ts"],"names":[],"mappings":";;;;AAGA;;;GAGG;AACH,MAAa,mBAAmB;IAG5B,YAAY,UAA4B;QACpC,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC;IACvC,CAAC;IAED,yBAAyB;IACzB,GAAG;QACC,OAAO,IAAI,CAAC,gBAAgB;aACvB,OAAO,CAAC;YACL,GAAG,EAAE,uBAAuB;SAC/B,CAAC;aACD,IAAI,CAAC,CAAO,QAAkB,EAAE,EAAE;YAC/B,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE;gBACzB,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;gBACnC,OAAO,IAAI,CAAC,MAAM,CAAC;aACtB;YAED,MAAmB;gBACf,OAAO,EAAE,MAAM,QAAQ,CAAC,IAAI,EAAE;gBAC9B,UAAU,EAAE,QAAQ,CAAC,MAAM;aAC9B,CAAC;QACN,CAAC,CAAA,CAAC,CAAC;IACX,CAAC;CACJ;AAzBD,kDAyBC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { DotCMSHttpClient } from '../utils/DotCMSHttpClient';
|
|
2
|
-
import { DotCMSContent, DotCMSContentQuery } from '../models';
|
|
3
|
-
/**
|
|
4
|
-
* Query/Save/Publish the information of DotCMS Content
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
export declare class DotApiContent {
|
|
8
|
-
private dotCMSHttpClient;
|
|
9
|
-
constructor(httpClient: DotCMSHttpClient);
|
|
10
|
-
query(params: DotCMSContentQuery): Promise<Response>;
|
|
11
|
-
save<Content extends DotCMSContent>(params: Content): Promise<Response>;
|
|
12
|
-
publish<Content extends DotCMSContent>(params: Content): Promise<Response>;
|
|
13
|
-
private doRequest;
|
|
14
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DotApiContent = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
function populateQueryUrl(params) {
|
|
6
|
-
let url = '';
|
|
7
|
-
const attrs = {
|
|
8
|
-
depth: `/depth/${params.options.depth}`,
|
|
9
|
-
limit: `/limit/${params.options.limit}`,
|
|
10
|
-
offset: `/offset/${params.options.offset}`,
|
|
11
|
-
orderBy: `/orderby/${params.options.orderBy}`
|
|
12
|
-
};
|
|
13
|
-
if (params.queryParams) {
|
|
14
|
-
for (const key of Object.keys(params.queryParams)) {
|
|
15
|
-
url += `+${key}:${params.queryParams[key]}%20`;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
for (const key of Object.keys(params.options)) {
|
|
19
|
-
url += attrs[key];
|
|
20
|
-
}
|
|
21
|
-
return url;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Query/Save/Publish the information of DotCMS Content
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
27
|
-
class DotApiContent {
|
|
28
|
-
constructor(httpClient) {
|
|
29
|
-
this.dotCMSHttpClient = httpClient;
|
|
30
|
-
}
|
|
31
|
-
query(params) {
|
|
32
|
-
const url = `/api/content/query/+contentType:${params.contentType}%20${populateQueryUrl(params)}`;
|
|
33
|
-
return this.doRequest(url, null, 'GET');
|
|
34
|
-
}
|
|
35
|
-
save(params) {
|
|
36
|
-
return this.doRequest('/api/content/save/1', params);
|
|
37
|
-
}
|
|
38
|
-
publish(params) {
|
|
39
|
-
return this.doRequest('/api/content/publish/1', params);
|
|
40
|
-
}
|
|
41
|
-
doRequest(url, params, httpMethod = 'POST') {
|
|
42
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
const response = yield this.dotCMSHttpClient.request({
|
|
44
|
-
url,
|
|
45
|
-
method: httpMethod,
|
|
46
|
-
body: params ? JSON.stringify(params) : ''
|
|
47
|
-
});
|
|
48
|
-
if (response.status !== 200) {
|
|
49
|
-
throw {
|
|
50
|
-
message: yield response.text(),
|
|
51
|
-
statusCode: response.status
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
return response;
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
exports.DotApiContent = DotApiContent;
|
|
59
|
-
//# sourceMappingURL=DotApiContent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DotApiContent.js","sourceRoot":"","sources":["../../../../../../libs/dotcms/src/lib/api/DotApiContent.ts"],"names":[],"mappings":";;;;AAGA,SAAS,gBAAgB,CAAC,MAA0B;IAChD,IAAI,GAAG,GAAG,EAAE,CAAC;IAEb,MAAM,KAAK,GAAG;QACV,KAAK,EAAE,UAAU,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE;QACvC,KAAK,EAAE,UAAU,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE;QACvC,MAAM,EAAE,WAAW,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE;QAC1C,OAAO,EAAE,YAAY,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE;KAChD,CAAC;IAEF,IAAI,MAAM,CAAC,WAAW,EAAE;QACpB,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE;YAC/C,GAAG,IAAI,IAAI,GAAG,IAAI,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC;SAClD;KACJ;IAED,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE;QAC3C,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;KACrB;IAED,OAAO,GAAG,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAa,aAAa;IAGtB,YAAY,UAA4B;QACpC,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,MAA0B;QAC5B,MAAM,GAAG,GAAG,mCAAmC,MAAM,CAAC,WAAW,MAAM,gBAAgB,CACnF,MAAM,CACT,EAAE,CAAC;QACJ,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED,IAAI,CAAgC,MAAe;QAC/C,OAAO,IAAI,CAAC,SAAS,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;IACzD,CAAC;IAED,OAAO,CAAgC,MAAe;QAClD,OAAO,IAAI,CAAC,SAAS,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC;IAC5D,CAAC;IAEa,SAAS,CACnB,GAAW,EACX,MAAgB,EAChB,UAAU,GAAG,MAAM;;YAEnB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;gBACjD,GAAG;gBACH,MAAM,EAAE,UAAU;gBAClB,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE;aAC7C,CAAC,CAAC;YAEH,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE;gBACzB,MAAmB;oBACf,OAAO,EAAE,MAAM,QAAQ,CAAC,IAAI,EAAE;oBAC9B,UAAU,EAAE,QAAQ,CAAC,MAAM;iBAC9B,CAAC;aACL;YAED,OAAO,QAAQ,CAAC;QACpB,CAAC;KAAA;CACJ;AA1CD,sCA0CC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { DotCMSHttpClient } from '../utils/DotCMSHttpClient';
|
|
2
|
-
import { DotCMSContentTypeLayoutRow, DotCMSContentType } from 'dotcms-models';
|
|
3
|
-
/**
|
|
4
|
-
* Get the information of DotCMS contentTypes
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
export declare class DotApiContentType {
|
|
8
|
-
private dotCMSHttpClient;
|
|
9
|
-
constructor(httpClient: DotCMSHttpClient);
|
|
10
|
-
get(contentTypeId: any): Promise<DotCMSContentType>;
|
|
11
|
-
getLayout(contentTypeId: any): Promise<DotCMSContentTypeLayoutRow[]>;
|
|
12
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DotApiContentType = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
/**
|
|
6
|
-
* Get the information of DotCMS contentTypes
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
class DotApiContentType {
|
|
10
|
-
constructor(httpClient) {
|
|
11
|
-
this.dotCMSHttpClient = httpClient;
|
|
12
|
-
}
|
|
13
|
-
get(contentTypeId) {
|
|
14
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
15
|
-
const response = yield this.dotCMSHttpClient.request({
|
|
16
|
-
url: `/api/v1/contenttype/id/${contentTypeId}`
|
|
17
|
-
});
|
|
18
|
-
if (response.status !== 200) {
|
|
19
|
-
throw {
|
|
20
|
-
message: yield response.text(),
|
|
21
|
-
statusCode: response.status
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
const data = yield response.json();
|
|
25
|
-
return data.entity;
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
getLayout(contentTypeId) {
|
|
29
|
-
return this.get(contentTypeId).then((contentType) => {
|
|
30
|
-
return contentType.layout;
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
exports.DotApiContentType = DotApiContentType;
|
|
35
|
-
//# sourceMappingURL=DotApiContentType.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DotApiContentType.js","sourceRoot":"","sources":["../../../../../../libs/dotcms/src/lib/api/DotApiContentType.ts"],"names":[],"mappings":";;;;AAIA;;;GAGG;AACH,MAAa,iBAAiB;IAG1B,YAAY,UAA4B;QACpC,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC;IACvC,CAAC;IAEK,GAAG,CAAC,aAAa;;YACnB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;gBACjD,GAAG,EAAE,0BAA0B,aAAa,EAAE;aACjD,CAAC,CAAC;YAEH,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE;gBACzB,MAAmB;oBACf,OAAO,EAAE,MAAM,QAAQ,CAAC,IAAI,EAAE;oBAC9B,UAAU,EAAE,QAAQ,CAAC,MAAM;iBAC9B,CAAC;aACL;YAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YACnC,OAAO,IAAI,CAAC,MAAM,CAAC;QACvB,CAAC;KAAA;IAED,SAAS,CAAC,aAAa;QACnB,OAAO,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,WAA8B,EAAE,EAAE;YACnE,OAAO,WAAW,CAAC,MAAM,CAAC;QAC9B,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AA5BD,8CA4BC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { DotCMSHttpClient } from '../utils/DotCMSHttpClient';
|
|
2
|
-
import { DotCMSElasticSearchResult, DotCMSElasticSearchParams } from '../models';
|
|
3
|
-
/**
|
|
4
|
-
* Request content from DotCMS using the {@link https://dotcms.com/docs/latest/elasticsearch-rest-api | Elastic Search API}
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
export declare class DotApiElasticSearch {
|
|
8
|
-
private dotCMSHttpClient;
|
|
9
|
-
constructor(httpClient: DotCMSHttpClient);
|
|
10
|
-
/**
|
|
11
|
-
* Provide the content type and the elastic search query and get the results contentlets and elastic search information
|
|
12
|
-
*
|
|
13
|
-
*/
|
|
14
|
-
search(params: DotCMSElasticSearchParams): Promise<DotCMSElasticSearchResult>;
|
|
15
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DotApiElasticSearch = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const getEsQuery_1 = require("../utils/getEsQuery");
|
|
6
|
-
/**
|
|
7
|
-
* Request content from DotCMS using the {@link https://dotcms.com/docs/latest/elasticsearch-rest-api | Elastic Search API}
|
|
8
|
-
*
|
|
9
|
-
*/
|
|
10
|
-
class DotApiElasticSearch {
|
|
11
|
-
constructor(httpClient) {
|
|
12
|
-
this.dotCMSHttpClient = httpClient;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Provide the content type and the elastic search query and get the results contentlets and elastic search information
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
18
|
-
search(params) {
|
|
19
|
-
return this.dotCMSHttpClient
|
|
20
|
-
.request({
|
|
21
|
-
url: '/api/es/search',
|
|
22
|
-
method: 'POST',
|
|
23
|
-
body: (0, getEsQuery_1.getEsQuery)(params)
|
|
24
|
-
})
|
|
25
|
-
.then((response) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
if (response.status === 200) {
|
|
27
|
-
return response.json();
|
|
28
|
-
}
|
|
29
|
-
throw {
|
|
30
|
-
message: yield response.text(),
|
|
31
|
-
statusCode: response.status
|
|
32
|
-
};
|
|
33
|
-
}));
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
exports.DotApiElasticSearch = DotApiElasticSearch;
|
|
37
|
-
//# sourceMappingURL=DotApiElasticSearch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DotApiElasticSearch.js","sourceRoot":"","sources":["../../../../../../libs/dotcms/src/lib/api/DotApiElasticSearch.ts"],"names":[],"mappings":";;;;AAEA,oDAAiD;AAGjD;;;GAGG;AACH,MAAa,mBAAmB;IAG5B,YAAY,UAA4B;QACpC,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC;IACvC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,MAAiC;QACpC,OAAO,IAAI,CAAC,gBAAgB;aACvB,OAAO,CAAC;YACL,GAAG,EAAE,gBAAgB;YACrB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAA,uBAAU,EAAC,MAAM,CAAC;SAC3B,CAAC;aACD,IAAI,CAAC,CAAO,QAAkB,EAAE,EAAE;YAC/B,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE;gBACzB,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;aAC1B;YAED,MAAmB;gBACf,OAAO,EAAE,MAAM,QAAQ,CAAC,IAAI,EAAE;gBAC9B,UAAU,EAAE,QAAQ,CAAC,MAAM;aAC9B,CAAC;QACN,CAAC,CAAA,CAAC,CAAC;IACX,CAAC;CACJ;AA7BD,kDA6BC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DotApiEvent = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Emit custom events for the DotCMS Edit Mode
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
class DotApiEvent {
|
|
9
|
-
emit(params) {
|
|
10
|
-
const { name, data } = params;
|
|
11
|
-
const customEvent = window.top.document.createEvent('CustomEvent');
|
|
12
|
-
customEvent.initCustomEvent('ng-event', false, false, {
|
|
13
|
-
name: name,
|
|
14
|
-
data: data
|
|
15
|
-
});
|
|
16
|
-
window.top.document.dispatchEvent(customEvent);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.DotApiEvent = DotApiEvent;
|
|
20
|
-
//# sourceMappingURL=DotApiEvent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DotApiEvent.js","sourceRoot":"","sources":["../../../../../../libs/dotcms/src/lib/api/DotApiEvent.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACH,MAAa,WAAW;IACpB,IAAI,CAAC,MAA0B;QAC3B,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;QAC9B,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;QACnE,WAAW,CAAC,eAAe,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE;YAClD,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,IAAI;SACb,CAAC,CAAC;QACH,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IACnD,CAAC;CACJ;AAVD,kCAUC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { DotCMSFormConfig } from '../models';
|
|
2
|
-
import { DotApiContentType } from './DotApiContentType';
|
|
3
|
-
import { DotCMSContentType } from 'dotcms-models';
|
|
4
|
-
/**
|
|
5
|
-
* Creates and provide methods to render a DotCMS Form
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
export declare class DotApiForm {
|
|
9
|
-
private dotApiContentType;
|
|
10
|
-
private formConfig;
|
|
11
|
-
constructor(dotApiContentType: DotApiContentType, formConfig: DotCMSFormConfig);
|
|
12
|
-
/**
|
|
13
|
-
* Render form on provided html element
|
|
14
|
-
* @memberof DotApiForm
|
|
15
|
-
*/
|
|
16
|
-
get(): Promise<DotCMSContentType>;
|
|
17
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DotApiForm = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
/**
|
|
6
|
-
* Creates and provide methods to render a DotCMS Form
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
class DotApiForm {
|
|
10
|
-
constructor(dotApiContentType, formConfig) {
|
|
11
|
-
this.dotApiContentType = dotApiContentType;
|
|
12
|
-
this.formConfig = formConfig;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Render form on provided html element
|
|
16
|
-
* @memberof DotApiForm
|
|
17
|
-
*/
|
|
18
|
-
get() {
|
|
19
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
return this.dotApiContentType.get(this.formConfig.identifier);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.DotApiForm = DotApiForm;
|
|
25
|
-
//# sourceMappingURL=DotApiForm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DotApiForm.js","sourceRoot":"","sources":["../../../../../../libs/dotcms/src/lib/api/DotApiForm.ts"],"names":[],"mappings":";;;;AAMA;;;GAGG;AACH,MAAa,UAAU;IACnB,YACY,iBAAoC,EACpC,UAA4B;QAD5B,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,eAAU,GAAV,UAAU,CAAkB;IACrC,CAAC;IAEJ;;;OAGG;IACG,GAAG;;YACL,OAAO,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAClE,CAAC;KAAA;CACJ;AAbD,gCAaC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { DotApiConfiguration } from './DotApiConfiguration';
|
|
2
|
-
import { DotCMSLanguageItem } from '../models';
|
|
3
|
-
/**
|
|
4
|
-
* Get DotCMS {@link https://dotcms.com/docs/latest/adding-and-editing-languages | Language code}
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
export declare class DotApiLanguage {
|
|
8
|
-
private _languagesConf;
|
|
9
|
-
private dotAppConfig;
|
|
10
|
-
constructor(appConfig: DotApiConfiguration);
|
|
11
|
-
getId(langCode: string): Promise<string>;
|
|
12
|
-
getLanguages(): Promise<DotCMSLanguageItem[]>;
|
|
13
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DotApiLanguage = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
/**
|
|
6
|
-
* Get DotCMS {@link https://dotcms.com/docs/latest/adding-and-editing-languages | Language code}
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
class DotApiLanguage {
|
|
10
|
-
constructor(appConfig) {
|
|
11
|
-
this.dotAppConfig = appConfig;
|
|
12
|
-
}
|
|
13
|
-
getId(langCode) {
|
|
14
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
15
|
-
const languages = yield this.getLanguages();
|
|
16
|
-
const language = languages.find((lang) => lang.languageCode === langCode);
|
|
17
|
-
return language ? `${language.id}` : null;
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
getLanguages() {
|
|
21
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
if (this._languagesConf) {
|
|
23
|
-
return this._languagesConf;
|
|
24
|
-
}
|
|
25
|
-
this._languagesConf = yield this.dotAppConfig
|
|
26
|
-
.get()
|
|
27
|
-
.then((data) => data.languages);
|
|
28
|
-
return this._languagesConf;
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.DotApiLanguage = DotApiLanguage;
|
|
33
|
-
//# sourceMappingURL=DotApiLanguage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DotApiLanguage.js","sourceRoot":"","sources":["../../../../../../libs/dotcms/src/lib/api/DotApiLanguage.ts"],"names":[],"mappings":";;;;AAGA;;;GAGG;AACH,MAAa,cAAc;IAIvB,YAAY,SAA8B;QACtC,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;IAClC,CAAC;IAEK,KAAK,CAAC,QAAgB;;YACxB,MAAM,SAAS,GAAyB,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;YAElE,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,CAC3B,CAAC,IAAwB,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,KAAK,QAAQ,CAC/D,CAAC;YACF,OAAO,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QAC9C,CAAC;KAAA;IAEK,YAAY;;YACd,IAAI,IAAI,CAAC,cAAc,EAAE;gBACrB,OAAO,IAAI,CAAC,cAAc,CAAC;aAC9B;YAED,IAAI,CAAC,cAAc,GAAG,MAAM,IAAI,CAAC,YAAY;iBACxC,GAAG,EAAE;iBACL,IAAI,CAAC,CAAC,IAA6B,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAE7D,OAAO,IAAI,CAAC,cAAc,CAAC;QAC/B,CAAC;KAAA;CACJ;AA5BD,wCA4BC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { DotCMSHttpClient } from '../utils/DotCMSHttpClient';
|
|
2
|
-
import { DotCMSNavigationItem } from '../models';
|
|
3
|
-
/**
|
|
4
|
-
* Retrieve information about the dotCMS file and folder tree with the {@link https://dotcms.com/docs/latest/navigation-rest-api | Navigation REST API }
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
export declare class DotApiNavigation {
|
|
8
|
-
private dotCMSHttpClient;
|
|
9
|
-
constructor(httpClient: DotCMSHttpClient);
|
|
10
|
-
get(depth?: string, location?: string): Promise<DotCMSNavigationItem>;
|
|
11
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DotApiNavigation = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
/**
|
|
6
|
-
* Retrieve information about the dotCMS file and folder tree with the {@link https://dotcms.com/docs/latest/navigation-rest-api | Navigation REST API }
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
class DotApiNavigation {
|
|
10
|
-
constructor(httpClient) {
|
|
11
|
-
this.dotCMSHttpClient = httpClient;
|
|
12
|
-
}
|
|
13
|
-
get(depth = '2', location = '/') {
|
|
14
|
-
return this.dotCMSHttpClient
|
|
15
|
-
.request({
|
|
16
|
-
url: `/api/v1/nav/${location}`,
|
|
17
|
-
params: {
|
|
18
|
-
depth
|
|
19
|
-
}
|
|
20
|
-
})
|
|
21
|
-
.then((res) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
if (res.status === 200) {
|
|
23
|
-
const data = yield res.json();
|
|
24
|
-
return data.entity;
|
|
25
|
-
}
|
|
26
|
-
throw {
|
|
27
|
-
message: yield res.text(),
|
|
28
|
-
statusCode: res.status
|
|
29
|
-
};
|
|
30
|
-
}));
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.DotApiNavigation = DotApiNavigation;
|
|
34
|
-
//# sourceMappingURL=DotApiNavigation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DotApiNavigation.js","sourceRoot":"","sources":["../../../../../../libs/dotcms/src/lib/api/DotApiNavigation.ts"],"names":[],"mappings":";;;;AAGA;;;GAGG;AACH,MAAa,gBAAgB;IAGzB,YAAY,UAA4B;QACpC,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC;IACvC,CAAC;IAED,GAAG,CAAC,KAAK,GAAG,GAAG,EAAE,QAAQ,GAAG,GAAG;QAC3B,OAAO,IAAI,CAAC,gBAAgB;aACvB,OAAO,CAAC;YACL,GAAG,EAAE,eAAe,QAAQ,EAAE;YAC9B,MAAM,EAAE;gBACJ,KAAK;aACR;SACJ,CAAC;aACD,IAAI,CAAC,CAAO,GAAa,EAAE,EAAE;YAC1B,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE;gBACpB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;gBAC9B,OAA6B,IAAI,CAAC,MAAM,CAAC;aAC5C;YAED,MAAmB;gBACf,OAAO,EAAE,MAAM,GAAG,CAAC,IAAI,EAAE;gBACzB,UAAU,EAAE,GAAG,CAAC,MAAM;aACzB,CAAC;QACN,CAAC,CAAA,CAAC,CAAC;IACX,CAAC;CACJ;AA3BD,4CA2BC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { DotCMSPageParams } from '../models/DotCMSPage.model';
|
|
2
|
-
import { DotCMSHttpClient } from '../utils/DotCMSHttpClient';
|
|
3
|
-
import { DotCMSPageAsset, DotCMSPageFormat } from '../models';
|
|
4
|
-
import { DotApiLanguage } from './DotApiLanguage';
|
|
5
|
-
/**
|
|
6
|
-
* Allow easy interaction with {@link https://dotcms.com/docs/latest/page-rest-api-layout-as-a-service-laas | DotCMS Page API}
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
export declare class DotApiPage {
|
|
10
|
-
private dotAppLanguage;
|
|
11
|
-
private dotCMSHttpClient;
|
|
12
|
-
constructor(httpClient: DotCMSHttpClient, appLanguage: DotApiLanguage);
|
|
13
|
-
/**
|
|
14
|
-
* Given the page url and the language return a {@link DotCMSPageAsset}
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
get(params: DotCMSPageParams, format?: DotCMSPageFormat): Promise<DotCMSPageAsset>;
|
|
18
|
-
}
|