@agility/management-sdk 0.1.39 → 0.2.0-beta.2
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 +5 -1
- package/dist/apiClient.d.ts +2 -0
- package/dist/apiClient.js +2 -0
- package/dist/apiMethods/searchMethods.d.ts +16 -0
- package/dist/apiMethods/searchMethods.js +81 -0
- package/dist/apiMethods/webhookMethods.d.ts +11 -2
- package/dist/apiMethods/webhookMethods.js +58 -7
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/models/contentItem.d.ts +26 -0
- package/dist/models/contentItem.js +7 -1
- package/dist/models/geo.d.ts +38 -0
- package/dist/models/geo.js +31 -0
- package/dist/models/pageItem.d.ts +11 -0
- package/dist/models/pagedResult.d.ts +4 -0
- package/dist/models/search.d.ts +114 -0
- package/dist/models/search.js +45 -0
- package/dist/models/searchNotAvailableException.d.ts +12 -0
- package/dist/models/searchNotAvailableException.js +41 -0
- package/dist/models/webhook.d.ts +17 -0
- package/dist/models/webhookHistory.d.ts +32 -0
- package/dist/models/webhookHistory.js +9 -0
- package/docs/content-methods.md +10 -0
- package/docs/page-methods.md +32 -0
- package/docs/search-methods.md +129 -0
- package/docs/webhook-methods.md +253 -354
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
## About the Management API SDK
|
|
16
16
|
|
|
17
17
|
- Provides a facility to developers to use the new Agility Management API more effectively.
|
|
18
|
-
- Provides methods to perform operations on Assets, Batches, Containers, Content, Models, Pages, and Users.
|
|
18
|
+
- Provides methods to perform operations on Assets, Batches, Containers, Content, Models, Pages, and Users, and to search an instance.
|
|
19
19
|
- **Content and Page Creation** - Create individual or multiple content items and pages (which automatically get added to batches).
|
|
20
20
|
- **Essential batch workflow operations** - Perform publish, unpublish, approve, decline, and request approval operations on existing batches.
|
|
21
21
|
- Ability to generate Content in bulk for a Website.
|
|
@@ -145,6 +145,10 @@ console.log('Content retrieved:', contentItem.fields.title);
|
|
|
145
145
|
- **[PageMethods](./docs/page-methods.md)** - Page management operations (18 functions)
|
|
146
146
|
- [getPage](./docs/page-methods.md#getpage), [getPageByPath](./docs/page-methods.md#getpagebypath), [getPageHistory](./docs/page-methods.md#getpagehistory), [getPageComments](./docs/page-methods.md#getpagecomments), [getPageList](./docs/page-methods.md#getpagelist), [getPageListByPageTemplateID](./docs/page-methods.md#getpagelistbypagetemplateid), [getPageListByPage](./docs/page-methods.md#getpagelistbypage), [getPageListByPageAndPageTemplateID](./docs/page-methods.md#getpagelistbypageandpagetemplateid), [getPageTree](./docs/page-methods.md#getpagetree), [getPageTemplateList](./docs/page-methods.md#getpagetemplatelist), [getPageSecurity](./docs/page-methods.md#getpagesecurity), [getPageItemTemplateList](./docs/page-methods.md#getpageitemtemplatelist), [getPageContentZones](./docs/page-methods.md#getpagecontentzones), [savePage](./docs/page-methods.md#savepage), [savePageSecurity](./docs/page-methods.md#savepagesecurity), [movePageItem](./docs/page-methods.md#movepageitem), [deletePage](./docs/page-methods.md#deletepage), [batchWorkflowPages](./docs/page-methods.md#batchworkflowpages)
|
|
147
147
|
|
|
148
|
+
### Search
|
|
149
|
+
- **[SearchMethods](./docs/search-methods.md)** - Search everything in an instance (1 function)
|
|
150
|
+
- [search](./docs/search-methods.md#search)
|
|
151
|
+
|
|
148
152
|
### User Management
|
|
149
153
|
- **[InstanceMethods](./docs/instance-methods.md)** - Instance-level operations (2 functions)
|
|
150
154
|
- [getLocales](./docs/instance-methods.md#getlocales), [getFetchApiStatus](./docs/instance-methods.md#getfetchapistatus)
|
package/dist/apiClient.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { Options } from "./models/options";
|
|
|
9
9
|
import { ServerUserMethods } from "./apiMethods/serverUserMethods";
|
|
10
10
|
import { WebhookMethods } from "./apiMethods/webhookMethods";
|
|
11
11
|
import { InstanceMethods } from "./apiMethods/instanceMethods";
|
|
12
|
+
import { SearchMethods } from "./apiMethods/searchMethods";
|
|
12
13
|
export declare class ApiClient {
|
|
13
14
|
_options: Options;
|
|
14
15
|
contentMethods: ContentMethods;
|
|
@@ -19,6 +20,7 @@ export declare class ApiClient {
|
|
|
19
20
|
instanceMethods: InstanceMethods;
|
|
20
21
|
modelMethods: ModelMethods;
|
|
21
22
|
pageMethods: PageMethods;
|
|
23
|
+
searchMethods: SearchMethods;
|
|
22
24
|
serverUserMethods: ServerUserMethods;
|
|
23
25
|
webhookMethods: WebhookMethods;
|
|
24
26
|
constructor(options: Options);
|
package/dist/apiClient.js
CHANGED
|
@@ -11,6 +11,7 @@ var pageMethods_1 = require("./apiMethods/pageMethods");
|
|
|
11
11
|
var serverUserMethods_1 = require("./apiMethods/serverUserMethods");
|
|
12
12
|
var webhookMethods_1 = require("./apiMethods/webhookMethods");
|
|
13
13
|
var instanceMethods_1 = require("./apiMethods/instanceMethods");
|
|
14
|
+
var searchMethods_1 = require("./apiMethods/searchMethods");
|
|
14
15
|
var ApiClient = /** @class */ (function () {
|
|
15
16
|
function ApiClient(options) {
|
|
16
17
|
this._options = options;
|
|
@@ -22,6 +23,7 @@ var ApiClient = /** @class */ (function () {
|
|
|
22
23
|
this.instanceMethods = new instanceMethods_1.InstanceMethods(this._options);
|
|
23
24
|
this.modelMethods = new modelMethods_1.ModelMethods(this._options);
|
|
24
25
|
this.pageMethods = new pageMethods_1.PageMethods(this._options);
|
|
26
|
+
this.searchMethods = new searchMethods_1.SearchMethods(this._options);
|
|
25
27
|
this.serverUserMethods = new serverUserMethods_1.ServerUserMethods(this._options);
|
|
26
28
|
this.webhookMethods = new webhookMethods_1.WebhookMethods(this._options);
|
|
27
29
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Options } from "../models/options";
|
|
2
|
+
import { SearchRequest, SearchResult } from "../models/search";
|
|
3
|
+
import { ClientInstance } from "./clientInstance";
|
|
4
|
+
export declare class SearchMethods {
|
|
5
|
+
_options: Options;
|
|
6
|
+
_clientInstance: ClientInstance;
|
|
7
|
+
constructor(options: Options);
|
|
8
|
+
/**
|
|
9
|
+
* Search everything in an instance: content items, components, pages, assets, models and containers.
|
|
10
|
+
* Makes one request and never retries.
|
|
11
|
+
*
|
|
12
|
+
* Throws `SearchNotAvailableException` when search is not available for the instance yet (HTTP 501),
|
|
13
|
+
* and `Exception` otherwise, for example with `statusCode` 400 for a blank query or an unknown kind or state.
|
|
14
|
+
*/
|
|
15
|
+
search(guid: string, request: SearchRequest): Promise<SearchResult>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.SearchMethods = void 0;
|
|
40
|
+
var exception_1 = require("../models/exception");
|
|
41
|
+
var searchNotAvailableException_1 = require("../models/searchNotAvailableException");
|
|
42
|
+
var clientInstance_1 = require("./clientInstance");
|
|
43
|
+
var SearchMethods = /** @class */ (function () {
|
|
44
|
+
function SearchMethods(options) {
|
|
45
|
+
this._options = options;
|
|
46
|
+
this._clientInstance = new clientInstance_1.ClientInstance(this._options);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Search everything in an instance: content items, components, pages, assets, models and containers.
|
|
50
|
+
* Makes one request and never retries.
|
|
51
|
+
*
|
|
52
|
+
* Throws `SearchNotAvailableException` when search is not available for the instance yet (HTTP 501),
|
|
53
|
+
* and `Exception` otherwise, for example with `statusCode` 400 for a blank query or an unknown kind or state.
|
|
54
|
+
*/
|
|
55
|
+
SearchMethods.prototype.search = function (guid, request) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
57
|
+
var apiPath, resp, err_1;
|
|
58
|
+
var _a;
|
|
59
|
+
return __generator(this, function (_b) {
|
|
60
|
+
switch (_b.label) {
|
|
61
|
+
case 0:
|
|
62
|
+
_b.trys.push([0, 2, , 3]);
|
|
63
|
+
apiPath = "search";
|
|
64
|
+
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, request)];
|
|
65
|
+
case 1:
|
|
66
|
+
resp = _b.sent();
|
|
67
|
+
return [2 /*return*/, resp.data];
|
|
68
|
+
case 2:
|
|
69
|
+
err_1 = _b.sent();
|
|
70
|
+
if (((_a = err_1 === null || err_1 === void 0 ? void 0 : err_1.response) === null || _a === void 0 ? void 0 : _a.status) === 501) {
|
|
71
|
+
throw new searchNotAvailableException_1.SearchNotAvailableException("Unable to search the instance.", err_1);
|
|
72
|
+
}
|
|
73
|
+
throw new exception_1.Exception("Unable to search the instance.", err_1);
|
|
74
|
+
case 3: return [2 /*return*/];
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
return SearchMethods;
|
|
80
|
+
}());
|
|
81
|
+
exports.SearchMethods = SearchMethods;
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import { Options } from "../models/options";
|
|
2
|
+
import { TokenPagedResult } from "../models/pagedResult";
|
|
2
3
|
import { Webhook } from "../models/webhook";
|
|
4
|
+
import { WebhookHistory } from "../models/webhookHistory";
|
|
3
5
|
import { ClientInstance } from "./clientInstance";
|
|
4
6
|
export declare class WebhookMethods {
|
|
5
7
|
_options: Options;
|
|
6
|
-
|
|
8
|
+
_clientInstance: ClientInstance;
|
|
7
9
|
constructor(options: Options);
|
|
8
|
-
webhookList(guid: string, take?: number, token?: string): Promise<
|
|
10
|
+
webhookList(guid: string, take?: number, token?: string): Promise<TokenPagedResult<Webhook>>;
|
|
9
11
|
saveWebhook(guid: string, webhook: Webhook): Promise<any>;
|
|
10
12
|
getWebhook(guid: string, webhookID: string): Promise<any>;
|
|
11
13
|
deleteWebhook(guid: string, webhookID: string): Promise<void>;
|
|
14
|
+
getWebhookHistory(guid: string, webhookID: string, options?: {
|
|
15
|
+
fromDate?: string;
|
|
16
|
+
toDate?: string;
|
|
17
|
+
take?: number;
|
|
18
|
+
token?: string;
|
|
19
|
+
}): Promise<TokenPagedResult<WebhookHistory>>;
|
|
20
|
+
rotateWebhookSecret(guid: string, webhookID: string): Promise<Webhook>;
|
|
12
21
|
}
|
|
@@ -38,23 +38,28 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.WebhookMethods = void 0;
|
|
40
40
|
var exception_1 = require("../models/exception");
|
|
41
|
+
var queryString_1 = require("../util/queryString");
|
|
41
42
|
var clientInstance_1 = require("./clientInstance");
|
|
42
43
|
var WebhookMethods = /** @class */ (function () {
|
|
43
44
|
function WebhookMethods(options) {
|
|
44
45
|
this._options = options;
|
|
45
|
-
this.
|
|
46
|
+
this._clientInstance = new clientInstance_1.ClientInstance(this._options);
|
|
46
47
|
}
|
|
47
48
|
WebhookMethods.prototype.webhookList = function (guid_1) {
|
|
48
49
|
return __awaiter(this, arguments, void 0, function (guid, take, token) {
|
|
49
|
-
var apiPath, resp, err_1;
|
|
50
|
+
var queryParams, apiPath, resp, err_1;
|
|
50
51
|
if (take === void 0) { take = 20; }
|
|
51
52
|
if (token === void 0) { token = null; }
|
|
52
53
|
return __generator(this, function (_a) {
|
|
53
54
|
switch (_a.label) {
|
|
54
55
|
case 0:
|
|
55
56
|
_a.trys.push([0, 2, , 3]);
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
queryParams = (0, queryString_1.buildQueryString)({
|
|
58
|
+
take: take,
|
|
59
|
+
token: token
|
|
60
|
+
});
|
|
61
|
+
apiPath = "webhook/list".concat(queryParams);
|
|
62
|
+
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
58
63
|
case 1:
|
|
59
64
|
resp = _a.sent();
|
|
60
65
|
return [2 /*return*/, resp.data];
|
|
@@ -74,7 +79,7 @@ var WebhookMethods = /** @class */ (function () {
|
|
|
74
79
|
case 0:
|
|
75
80
|
_a.trys.push([0, 2, , 3]);
|
|
76
81
|
apiPath = "webhook";
|
|
77
|
-
return [4 /*yield*/, this.
|
|
82
|
+
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, webhook)];
|
|
78
83
|
case 1:
|
|
79
84
|
resp = _a.sent();
|
|
80
85
|
return [2 /*return*/, resp.data];
|
|
@@ -94,7 +99,7 @@ var WebhookMethods = /** @class */ (function () {
|
|
|
94
99
|
case 0:
|
|
95
100
|
_a.trys.push([0, 2, , 3]);
|
|
96
101
|
apiPath = "webhook/".concat(webhookID);
|
|
97
|
-
return [4 /*yield*/, this.
|
|
102
|
+
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
98
103
|
case 1:
|
|
99
104
|
resp = _a.sent();
|
|
100
105
|
return [2 /*return*/, resp.data];
|
|
@@ -114,7 +119,7 @@ var WebhookMethods = /** @class */ (function () {
|
|
|
114
119
|
case 0:
|
|
115
120
|
_a.trys.push([0, 2, , 3]);
|
|
116
121
|
apiPath = "webhook/".concat(webhookID);
|
|
117
|
-
return [4 /*yield*/, this.
|
|
122
|
+
return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, guid, this._options.token)];
|
|
118
123
|
case 1:
|
|
119
124
|
_a.sent();
|
|
120
125
|
return [3 /*break*/, 3];
|
|
@@ -126,6 +131,52 @@ var WebhookMethods = /** @class */ (function () {
|
|
|
126
131
|
});
|
|
127
132
|
});
|
|
128
133
|
};
|
|
134
|
+
WebhookMethods.prototype.getWebhookHistory = function (guid, webhookID, options) {
|
|
135
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
136
|
+
var queryParams, apiPath, resp, err_5;
|
|
137
|
+
return __generator(this, function (_a) {
|
|
138
|
+
switch (_a.label) {
|
|
139
|
+
case 0:
|
|
140
|
+
_a.trys.push([0, 2, , 3]);
|
|
141
|
+
queryParams = (0, queryString_1.buildQueryString)({
|
|
142
|
+
fromDate: options === null || options === void 0 ? void 0 : options.fromDate,
|
|
143
|
+
toDate: options === null || options === void 0 ? void 0 : options.toDate,
|
|
144
|
+
take: options === null || options === void 0 ? void 0 : options.take,
|
|
145
|
+
token: options === null || options === void 0 ? void 0 : options.token
|
|
146
|
+
});
|
|
147
|
+
apiPath = "webhook/".concat(webhookID, "/history").concat(queryParams);
|
|
148
|
+
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
|
|
149
|
+
case 1:
|
|
150
|
+
resp = _a.sent();
|
|
151
|
+
return [2 /*return*/, resp.data];
|
|
152
|
+
case 2:
|
|
153
|
+
err_5 = _a.sent();
|
|
154
|
+
throw new exception_1.Exception("Unable to retrieve webhook history for webhookID: ".concat(webhookID, "."), err_5);
|
|
155
|
+
case 3: return [2 /*return*/];
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
WebhookMethods.prototype.rotateWebhookSecret = function (guid, webhookID) {
|
|
161
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
162
|
+
var apiPath, resp, err_6;
|
|
163
|
+
return __generator(this, function (_a) {
|
|
164
|
+
switch (_a.label) {
|
|
165
|
+
case 0:
|
|
166
|
+
_a.trys.push([0, 2, , 3]);
|
|
167
|
+
apiPath = "webhook/".concat(webhookID, "/rotate-secret");
|
|
168
|
+
return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, null)];
|
|
169
|
+
case 1:
|
|
170
|
+
resp = _a.sent();
|
|
171
|
+
return [2 /*return*/, resp.data];
|
|
172
|
+
case 2:
|
|
173
|
+
err_6 = _a.sent();
|
|
174
|
+
throw new exception_1.Exception("Unable to rotate the signing secret for webhookID: ".concat(webhookID, "."), err_6);
|
|
175
|
+
case 3: return [2 /*return*/];
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
};
|
|
129
180
|
return WebhookMethods;
|
|
130
181
|
}());
|
|
131
182
|
exports.WebhookMethods = WebhookMethods;
|
package/dist/index.d.ts
CHANGED
|
@@ -14,8 +14,13 @@ export * from "./models/media";
|
|
|
14
14
|
export * from "./models/model";
|
|
15
15
|
export * from "./models/notification";
|
|
16
16
|
export * from "./models/pageItem";
|
|
17
|
+
export * from "./models/geo";
|
|
17
18
|
export * from "./models/pagedResult";
|
|
19
|
+
export * from "./models/search";
|
|
20
|
+
export * from "./models/searchNotAvailableException";
|
|
18
21
|
export * from "./models/sitemap";
|
|
22
|
+
export * from "./models/webhook";
|
|
23
|
+
export * from "./models/webhookHistory";
|
|
19
24
|
export * from "./models/websiteUser";
|
|
20
25
|
export * from "./models/assetContainer";
|
|
21
26
|
export * from "./models/assetGalleries";
|
package/dist/index.js
CHANGED
|
@@ -30,8 +30,13 @@ __exportStar(require("./models/media"), exports);
|
|
|
30
30
|
__exportStar(require("./models/model"), exports);
|
|
31
31
|
__exportStar(require("./models/notification"), exports);
|
|
32
32
|
__exportStar(require("./models/pageItem"), exports);
|
|
33
|
+
__exportStar(require("./models/geo"), exports);
|
|
33
34
|
__exportStar(require("./models/pagedResult"), exports);
|
|
35
|
+
__exportStar(require("./models/search"), exports);
|
|
36
|
+
__exportStar(require("./models/searchNotAvailableException"), exports);
|
|
34
37
|
__exportStar(require("./models/sitemap"), exports);
|
|
38
|
+
__exportStar(require("./models/webhook"), exports);
|
|
39
|
+
__exportStar(require("./models/webhookHistory"), exports);
|
|
35
40
|
__exportStar(require("./models/websiteUser"), exports);
|
|
36
41
|
__exportStar(require("./models/assetContainer"), exports);
|
|
37
42
|
__exportStar(require("./models/assetGalleries"), exports);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { GeoProperties } from "./geo";
|
|
1
2
|
export declare class ContentItem {
|
|
2
3
|
contentID: number;
|
|
3
4
|
properties: ContentItemProperties;
|
|
@@ -5,6 +6,17 @@ export declare class ContentItem {
|
|
|
5
6
|
[key: string]: any;
|
|
6
7
|
};
|
|
7
8
|
seo: SeoProperties | null;
|
|
9
|
+
/**
|
|
10
|
+
* GEO / AEO properties of the page this item generates. Only items in a list that backs a
|
|
11
|
+
* dynamic page carry them. On save, three states:
|
|
12
|
+
* - left out (`undefined`): everything stored is kept;
|
|
13
|
+
* - `null`: the whole block is cleared;
|
|
14
|
+
* - an object: each property in it is applied (a property set to `null` clears just that
|
|
15
|
+
* property, one left out is kept; see `GeoProperties`).
|
|
16
|
+
*
|
|
17
|
+
* Absent from responses when the item has no GEO data.
|
|
18
|
+
*/
|
|
19
|
+
geo?: GeoProperties | null;
|
|
8
20
|
scripts: ContentScripts | null;
|
|
9
21
|
}
|
|
10
22
|
export declare class ContentItemProperties {
|
|
@@ -24,6 +36,20 @@ export declare class SeoProperties {
|
|
|
24
36
|
metaHTML: string | null;
|
|
25
37
|
menuVisible: boolean | null;
|
|
26
38
|
sitemapVisible: boolean | null;
|
|
39
|
+
/** The page's `<title>`, when it differs from the page title. */
|
|
40
|
+
title?: string | null;
|
|
41
|
+
/** The page's canonical URL override. */
|
|
42
|
+
canonicalUrl?: string | null;
|
|
43
|
+
/** The page's robots directives. */
|
|
44
|
+
robots?: SeoRobots | null;
|
|
45
|
+
/** The page's social share (Open Graph) image: an absolute http(s) URL or a site-relative path. */
|
|
46
|
+
ogImage?: string | null;
|
|
47
|
+
}
|
|
48
|
+
export declare class SeoRobots {
|
|
49
|
+
/** Whether search engines may index the page. */
|
|
50
|
+
index?: boolean | null;
|
|
51
|
+
/** Whether search engines may follow the page's links. */
|
|
52
|
+
follow?: boolean | null;
|
|
27
53
|
}
|
|
28
54
|
export declare class ContentScripts {
|
|
29
55
|
top: string | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ContentList = exports.ContentScripts = exports.SeoProperties = exports.ContentItemProperties = exports.ContentItem = void 0;
|
|
3
|
+
exports.ContentList = exports.ContentScripts = exports.SeoRobots = exports.SeoProperties = exports.ContentItemProperties = exports.ContentItem = void 0;
|
|
4
4
|
var ContentItem = /** @class */ (function () {
|
|
5
5
|
function ContentItem() {
|
|
6
6
|
}
|
|
@@ -19,6 +19,12 @@ var SeoProperties = /** @class */ (function () {
|
|
|
19
19
|
return SeoProperties;
|
|
20
20
|
}());
|
|
21
21
|
exports.SeoProperties = SeoProperties;
|
|
22
|
+
var SeoRobots = /** @class */ (function () {
|
|
23
|
+
function SeoRobots() {
|
|
24
|
+
}
|
|
25
|
+
return SeoRobots;
|
|
26
|
+
}());
|
|
27
|
+
exports.SeoRobots = SeoRobots;
|
|
22
28
|
var ContentScripts = /** @class */ (function () {
|
|
23
29
|
function ContentScripts() {
|
|
24
30
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GEO / AEO (generative and answer engine optimization) properties of a page, or of a content item
|
|
3
|
+
* in a list that backs a dynamic page (`ContentItem.geo`, the item's own values).
|
|
4
|
+
*
|
|
5
|
+
* Writes are three-state, per property:
|
|
6
|
+
* - property left out (`undefined`), or the whole `geo` left out: the stored value is kept;
|
|
7
|
+
* - property set to `null`: the stored value is cleared;
|
|
8
|
+
* - property set to a value: the stored value is replaced.
|
|
9
|
+
*
|
|
10
|
+
* To clear the whole block, save the page with `geo: null`.
|
|
11
|
+
*
|
|
12
|
+
* `JSON.stringify` drops `undefined`, so a page read with `getPage` (or an item read with
|
|
13
|
+
* `getContentItem`), changed elsewhere and saved keeps its GEO data. Only set a property to `null`
|
|
14
|
+
* when you mean to clear it.
|
|
15
|
+
* Responses leave out properties that aren't set.
|
|
16
|
+
*/
|
|
17
|
+
export declare class GeoProperties {
|
|
18
|
+
/** The schema.org page type. Defaults to `WebPage` when not set. */
|
|
19
|
+
schemaType?: GeoSchemaType | null;
|
|
20
|
+
/** A short, answer-first plain-text summary of the page. */
|
|
21
|
+
summary?: string | null;
|
|
22
|
+
/** Editor-supplied JSON-LD (an object, which may hold an `@graph`, or an array of objects). Must be valid JSON. */
|
|
23
|
+
structuredData?: {
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
} | {
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
}[] | null;
|
|
28
|
+
/** The page's AI-engine settings. */
|
|
29
|
+
ai?: GeoAiProperties | null;
|
|
30
|
+
}
|
|
31
|
+
/** The schema.org page types a page can declare. */
|
|
32
|
+
export type GeoSchemaType = "WebPage" | "AboutPage" | "ContactPage" | "CollectionPage" | "FAQPage" | "ItemPage" | "ProfilePage" | (string & {});
|
|
33
|
+
export declare class GeoAiProperties {
|
|
34
|
+
/** Whether the page is listed in llms.txt: `inherit` (follow sitemap visibility), `include` or `exclude`. */
|
|
35
|
+
llmsInclude?: "inherit" | "include" | "exclude" | null;
|
|
36
|
+
/** Whether AI crawlers may crawl the page: `inherit` (follow the site policy) or `block`. */
|
|
37
|
+
crawl?: "inherit" | "block" | null;
|
|
38
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GeoAiProperties = exports.GeoProperties = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* GEO / AEO (generative and answer engine optimization) properties of a page, or of a content item
|
|
6
|
+
* in a list that backs a dynamic page (`ContentItem.geo`, the item's own values).
|
|
7
|
+
*
|
|
8
|
+
* Writes are three-state, per property:
|
|
9
|
+
* - property left out (`undefined`), or the whole `geo` left out: the stored value is kept;
|
|
10
|
+
* - property set to `null`: the stored value is cleared;
|
|
11
|
+
* - property set to a value: the stored value is replaced.
|
|
12
|
+
*
|
|
13
|
+
* To clear the whole block, save the page with `geo: null`.
|
|
14
|
+
*
|
|
15
|
+
* `JSON.stringify` drops `undefined`, so a page read with `getPage` (or an item read with
|
|
16
|
+
* `getContentItem`), changed elsewhere and saved keeps its GEO data. Only set a property to `null`
|
|
17
|
+
* when you mean to clear it.
|
|
18
|
+
* Responses leave out properties that aren't set.
|
|
19
|
+
*/
|
|
20
|
+
var GeoProperties = /** @class */ (function () {
|
|
21
|
+
function GeoProperties() {
|
|
22
|
+
}
|
|
23
|
+
return GeoProperties;
|
|
24
|
+
}());
|
|
25
|
+
exports.GeoProperties = GeoProperties;
|
|
26
|
+
var GeoAiProperties = /** @class */ (function () {
|
|
27
|
+
function GeoAiProperties() {
|
|
28
|
+
}
|
|
29
|
+
return GeoAiProperties;
|
|
30
|
+
}());
|
|
31
|
+
exports.GeoAiProperties = GeoAiProperties;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SeoProperties } from "./contentItem";
|
|
2
|
+
import { GeoProperties } from "./geo";
|
|
2
3
|
export declare class PageItem {
|
|
3
4
|
pageID: number | null;
|
|
4
5
|
name: string | null;
|
|
@@ -12,6 +13,16 @@ export declare class PageItem {
|
|
|
12
13
|
excludeFromOutputCache: boolean | null;
|
|
13
14
|
visible: PageVisible | null;
|
|
14
15
|
seo: SeoProperties | null;
|
|
16
|
+
/**
|
|
17
|
+
* GEO / AEO properties. On save, three states:
|
|
18
|
+
* - left out (`undefined`): everything stored is kept;
|
|
19
|
+
* - `null`: the whole block is cleared;
|
|
20
|
+
* - an object: each property in it is applied (a property set to `null` clears just that
|
|
21
|
+
* property, one left out is kept; see `GeoProperties`).
|
|
22
|
+
*
|
|
23
|
+
* Absent from responses when the page has no GEO data.
|
|
24
|
+
*/
|
|
25
|
+
geo?: GeoProperties | null;
|
|
15
26
|
scripts: PageScripts | null;
|
|
16
27
|
dynamic: PageDynamic | null;
|
|
17
28
|
properties: PageItemProperties | null;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A search across everything in an instance: content items, components, pages, assets, models and
|
|
3
|
+
* containers. Only `query` is required.
|
|
4
|
+
*
|
|
5
|
+
* Results are limited to what the caller may see: content, pages and containers for everyone,
|
|
6
|
+
* components and models with Develop or Manage, assets with Edit or Delete. Content and pages in
|
|
7
|
+
* containers or pages the caller can't read are left out.
|
|
8
|
+
*/
|
|
9
|
+
export declare class SearchRequest {
|
|
10
|
+
/**
|
|
11
|
+
* The text to search for. Words match as prefixes ("newsl" finds "newsletter") and every word must
|
|
12
|
+
* match; text in double quotes matches as an exact phrase. A number also matches content, page,
|
|
13
|
+
* asset and model IDs exactly. A blank query is rejected (HTTP 400).
|
|
14
|
+
*/
|
|
15
|
+
query: string;
|
|
16
|
+
/**
|
|
17
|
+
* The kinds of result to return. Defaults to every kind the caller may see. An unknown kind is
|
|
18
|
+
* rejected (HTTP 400). The facet counts always cover every kind the caller may see, whatever this is.
|
|
19
|
+
*/
|
|
20
|
+
kinds?: SearchKind[] | null;
|
|
21
|
+
/** Only search content, components and pages in this locale (for example `en-us`). Omit it, or pass `*`, for every locale. */
|
|
22
|
+
locale?: string | null;
|
|
23
|
+
/** Only return content in these containers, by reference name. Limits the search to content kinds. */
|
|
24
|
+
containers?: string[] | null;
|
|
25
|
+
/** Only return content and components of these models, by reference name. Limits the search to content kinds. */
|
|
26
|
+
models?: string[] | null;
|
|
27
|
+
/** Only return content in this state. An unknown state is rejected (HTTP 400). Limits the search to content kinds. */
|
|
28
|
+
state?: SearchState | null;
|
|
29
|
+
/** Only return results modified on or after this date (an ISO 8601 string, or a `Date`). */
|
|
30
|
+
modifiedAfter?: string | Date | null;
|
|
31
|
+
/** Results to skip, for paging. Defaults to 0. */
|
|
32
|
+
skip?: number | null;
|
|
33
|
+
/** Results to return. Defaults to 25; the API clamps it to 1..100. */
|
|
34
|
+
take?: number | null;
|
|
35
|
+
}
|
|
36
|
+
/** A kind of search result. */
|
|
37
|
+
export type SearchKind = "content" | "component" | "page" | "asset" | "model" | "container" | (string & {});
|
|
38
|
+
/** A content state to filter on. `any` is the same as leaving it out. */
|
|
39
|
+
export type SearchState = "staging" | "published" | "unpublished" | "any";
|
|
40
|
+
/** The result of a search. */
|
|
41
|
+
export declare class SearchResult {
|
|
42
|
+
/** The query as it was searched. */
|
|
43
|
+
query: string | null;
|
|
44
|
+
/** True when nothing matched every word, so the results match ANY of the words instead. */
|
|
45
|
+
relaxed: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* How many results there are of each kind the caller may see, keyed by kind, whichever kinds were
|
|
48
|
+
* requested. So it can drive tabs.
|
|
49
|
+
*/
|
|
50
|
+
facets: {
|
|
51
|
+
[kind: string]: SearchFacet;
|
|
52
|
+
} | null;
|
|
53
|
+
/** How many results there are across the requested kinds. */
|
|
54
|
+
total: number;
|
|
55
|
+
/** The requested page of results, best match first. */
|
|
56
|
+
hits: SearchHit[] | null;
|
|
57
|
+
/** How far behind the search index is. */
|
|
58
|
+
indexing?: SearchIndexing | null;
|
|
59
|
+
}
|
|
60
|
+
/** The number of results of one kind. */
|
|
61
|
+
export declare class SearchFacet {
|
|
62
|
+
count: number;
|
|
63
|
+
/** True when there are more results than were counted; show the count as a minimum ("N+"). */
|
|
64
|
+
capped: boolean;
|
|
65
|
+
}
|
|
66
|
+
/** How far behind the search index is. */
|
|
67
|
+
export declare class SearchIndexing {
|
|
68
|
+
/** Changes not yet searchable. Usually 0; high after a big import. */
|
|
69
|
+
pending: number;
|
|
70
|
+
/** True while the instance is being indexed in the background: search again shortly. */
|
|
71
|
+
catchingUp: boolean;
|
|
72
|
+
}
|
|
73
|
+
/** One search result. Properties that don't apply to the result's kind are null or left out. */
|
|
74
|
+
export declare class SearchHit {
|
|
75
|
+
kind: SearchKind | null;
|
|
76
|
+
/** Content Item, List Item, Component, Page, Asset, Content Model, Component Model, Content List or Single Item. */
|
|
77
|
+
typeLabel?: string | null;
|
|
78
|
+
/** The result's display name. */
|
|
79
|
+
name?: string | null;
|
|
80
|
+
/** Where the result lives: its container, page path, folder or model reference name. */
|
|
81
|
+
context?: string | null;
|
|
82
|
+
/** The matching text, HTML-encoded, with each matched word wrapped in `<mark>`. */
|
|
83
|
+
snippet?: string | null;
|
|
84
|
+
/** Which fields matched: field names, or `_title`, `_id`, `_attachment`, `_file`, `_model`, `_container`. */
|
|
85
|
+
matchedFields?: string[] | null;
|
|
86
|
+
/** The relevance score the results are ordered by. Higher is better. */
|
|
87
|
+
score: number;
|
|
88
|
+
/** The locale of a content, component or page result. Null for assets and models. */
|
|
89
|
+
languageCode?: string | null;
|
|
90
|
+
/** The state of a content, component or page result (Staging, Published, ...). */
|
|
91
|
+
state?: string | null;
|
|
92
|
+
modifiedDate?: string | null;
|
|
93
|
+
modifiedBy?: string | null;
|
|
94
|
+
/** A path to open the result in the Content Manager, relative to the instance (for example `content/list-12/listitem-34`). */
|
|
95
|
+
viewLink?: string | null;
|
|
96
|
+
/** The content ID of a content item, component or page's content. */
|
|
97
|
+
contentID?: number | null;
|
|
98
|
+
/** The ID of the container a content item or component lives in. */
|
|
99
|
+
containerID?: number | null;
|
|
100
|
+
containerReferenceName?: string | null;
|
|
101
|
+
/** The page ID of a page, or of a page a component sits on. */
|
|
102
|
+
pageID?: number | null;
|
|
103
|
+
pagePath?: string | null;
|
|
104
|
+
channel?: string | null;
|
|
105
|
+
mediaID?: number | null;
|
|
106
|
+
/** The asset's URL. */
|
|
107
|
+
url?: string | null;
|
|
108
|
+
/** The asset's MIME type. */
|
|
109
|
+
contentType?: string | null;
|
|
110
|
+
/** The asset's size in bytes. */
|
|
111
|
+
size?: number | null;
|
|
112
|
+
modelID?: number | null;
|
|
113
|
+
modelReferenceName?: string | null;
|
|
114
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SearchHit = exports.SearchIndexing = exports.SearchFacet = exports.SearchResult = exports.SearchRequest = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* A search across everything in an instance: content items, components, pages, assets, models and
|
|
6
|
+
* containers. Only `query` is required.
|
|
7
|
+
*
|
|
8
|
+
* Results are limited to what the caller may see: content, pages and containers for everyone,
|
|
9
|
+
* components and models with Develop or Manage, assets with Edit or Delete. Content and pages in
|
|
10
|
+
* containers or pages the caller can't read are left out.
|
|
11
|
+
*/
|
|
12
|
+
var SearchRequest = /** @class */ (function () {
|
|
13
|
+
function SearchRequest() {
|
|
14
|
+
}
|
|
15
|
+
return SearchRequest;
|
|
16
|
+
}());
|
|
17
|
+
exports.SearchRequest = SearchRequest;
|
|
18
|
+
/** The result of a search. */
|
|
19
|
+
var SearchResult = /** @class */ (function () {
|
|
20
|
+
function SearchResult() {
|
|
21
|
+
}
|
|
22
|
+
return SearchResult;
|
|
23
|
+
}());
|
|
24
|
+
exports.SearchResult = SearchResult;
|
|
25
|
+
/** The number of results of one kind. */
|
|
26
|
+
var SearchFacet = /** @class */ (function () {
|
|
27
|
+
function SearchFacet() {
|
|
28
|
+
}
|
|
29
|
+
return SearchFacet;
|
|
30
|
+
}());
|
|
31
|
+
exports.SearchFacet = SearchFacet;
|
|
32
|
+
/** How far behind the search index is. */
|
|
33
|
+
var SearchIndexing = /** @class */ (function () {
|
|
34
|
+
function SearchIndexing() {
|
|
35
|
+
}
|
|
36
|
+
return SearchIndexing;
|
|
37
|
+
}());
|
|
38
|
+
exports.SearchIndexing = SearchIndexing;
|
|
39
|
+
/** One search result. Properties that don't apply to the result's kind are null or left out. */
|
|
40
|
+
var SearchHit = /** @class */ (function () {
|
|
41
|
+
function SearchHit() {
|
|
42
|
+
}
|
|
43
|
+
return SearchHit;
|
|
44
|
+
}());
|
|
45
|
+
exports.SearchHit = SearchHit;
|