@datocms/cma-client 3.4.4 → 4.0.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/dist/cjs/generated/Client.js +1 -1
- package/dist/cjs/generated/resources/BuildEvent.js +137 -3
- package/dist/cjs/generated/resources/BuildEvent.js.map +1 -1
- package/dist/cjs/generated/resources/ItemType.js +4 -0
- package/dist/cjs/generated/resources/ItemType.js.map +1 -1
- package/dist/esm/generated/Client.js +1 -1
- package/dist/esm/generated/SchemaTypes.d.ts +93 -6
- package/dist/esm/generated/SimpleSchemaTypes.d.ts +56 -0
- package/dist/esm/generated/resources/BuildEvent.d.ts +21 -2
- package/dist/esm/generated/resources/BuildEvent.js +137 -3
- package/dist/esm/generated/resources/BuildEvent.js.map +1 -1
- package/dist/esm/generated/resources/ItemType.js +4 -0
- package/dist/esm/generated/resources/ItemType.js.map +1 -1
- package/dist/types/generated/SchemaTypes.d.ts +93 -6
- package/dist/types/generated/SimpleSchemaTypes.d.ts +56 -0
- package/dist/types/generated/resources/BuildEvent.d.ts +21 -2
- package/package.json +4 -4
- package/resources.json +9 -0
- package/src/generated/Client.ts +1 -1
- package/src/generated/SchemaTypes.ts +108 -6
- package/src/generated/SimpleSchemaTypes.ts +71 -0
- package/src/generated/resources/BuildEvent.ts +61 -3
- package/src/generated/resources/ItemType.ts +4 -0
|
@@ -131,7 +131,7 @@ var Client = /** @class */ (function () {
|
|
|
131
131
|
});
|
|
132
132
|
Client.prototype.request = function (options) {
|
|
133
133
|
var _this = this;
|
|
134
|
-
return (0, rest_client_utils_1.request)(__assign(__assign(__assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client
|
|
134
|
+
return (0, rest_client_utils_1.request)(__assign(__assign(__assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v4.0.0', baseUrl: this.baseUrl, preCallStack: new Error().stack, extraHeaders: __assign(__assign(__assign({}, (this.config.extraHeaders || {})), (this.config.environment
|
|
135
135
|
? { 'X-Environment': this.config.environment }
|
|
136
136
|
: {})), { 'X-API-Version': '3' }), fetchJobResult: function (jobId) {
|
|
137
137
|
return _this.jobResultsFetcher
|
|
@@ -14,6 +14,17 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
15
|
};
|
|
16
16
|
})();
|
|
17
|
+
var __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
17
28
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
29
|
if (k2 === undefined) k2 = k;
|
|
19
30
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -37,6 +48,52 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
37
48
|
__setModuleDefault(result, mod);
|
|
38
49
|
return result;
|
|
39
50
|
};
|
|
51
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
52
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
53
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
54
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
55
|
+
function step(op) {
|
|
56
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
57
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
58
|
+
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;
|
|
59
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
60
|
+
switch (op[0]) {
|
|
61
|
+
case 0: case 1: t = op; break;
|
|
62
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
63
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
64
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
65
|
+
default:
|
|
66
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
67
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
68
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
69
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
70
|
+
if (t[2]) _.ops.pop();
|
|
71
|
+
_.trys.pop(); continue;
|
|
72
|
+
}
|
|
73
|
+
op = body.call(thisArg, _);
|
|
74
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
75
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
79
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
80
|
+
var m = o[Symbol.asyncIterator], i;
|
|
81
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
82
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
83
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
84
|
+
};
|
|
85
|
+
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
|
86
|
+
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
|
87
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
88
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
89
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
90
|
+
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
91
|
+
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
92
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
93
|
+
function fulfill(value) { resume("next", value); }
|
|
94
|
+
function reject(value) { resume("throw", value); }
|
|
95
|
+
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
96
|
+
};
|
|
40
97
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
98
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
99
|
};
|
|
@@ -56,8 +113,8 @@ var BuildEvent = /** @class */ (function (_super) {
|
|
|
56
113
|
* @throws {ApiError}
|
|
57
114
|
* @throws {TimeoutError}
|
|
58
115
|
*/
|
|
59
|
-
BuildEvent.prototype.list = function () {
|
|
60
|
-
return this.rawList().then(function (body) {
|
|
116
|
+
BuildEvent.prototype.list = function (queryParams) {
|
|
117
|
+
return this.rawList(queryParams).then(function (body) {
|
|
61
118
|
return Utils.deserializeResponseBody(body);
|
|
62
119
|
});
|
|
63
120
|
};
|
|
@@ -69,12 +126,89 @@ var BuildEvent = /** @class */ (function (_super) {
|
|
|
69
126
|
* @throws {ApiError}
|
|
70
127
|
* @throws {TimeoutError}
|
|
71
128
|
*/
|
|
72
|
-
BuildEvent.prototype.rawList = function () {
|
|
129
|
+
BuildEvent.prototype.rawList = function (queryParams) {
|
|
73
130
|
return this.client.request({
|
|
74
131
|
method: 'GET',
|
|
75
132
|
url: '/build-events',
|
|
133
|
+
queryParams: queryParams,
|
|
76
134
|
});
|
|
77
135
|
};
|
|
136
|
+
/**
|
|
137
|
+
* Async iterator to auto-paginate over elements returned by list()
|
|
138
|
+
*
|
|
139
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/build-event/instances
|
|
140
|
+
*
|
|
141
|
+
* @throws {ApiError}
|
|
142
|
+
* @throws {TimeoutError}
|
|
143
|
+
*/
|
|
144
|
+
BuildEvent.prototype.listPagedIterator = function (queryParams, iteratorOptions) {
|
|
145
|
+
return __asyncGenerator(this, arguments, function listPagedIterator_1() {
|
|
146
|
+
var _a, _b, _c, element, e_1_1;
|
|
147
|
+
var _d, e_1, _e, _f;
|
|
148
|
+
return __generator(this, function (_g) {
|
|
149
|
+
switch (_g.label) {
|
|
150
|
+
case 0:
|
|
151
|
+
_g.trys.push([0, 9, 10, 15]);
|
|
152
|
+
_a = true, _b = __asyncValues(this.rawListPagedIterator(queryParams, iteratorOptions));
|
|
153
|
+
_g.label = 1;
|
|
154
|
+
case 1: return [4 /*yield*/, __await(_b.next())];
|
|
155
|
+
case 2:
|
|
156
|
+
if (!(_c = _g.sent(), _d = _c.done, !_d)) return [3 /*break*/, 8];
|
|
157
|
+
_f = _c.value;
|
|
158
|
+
_a = false;
|
|
159
|
+
_g.label = 3;
|
|
160
|
+
case 3:
|
|
161
|
+
_g.trys.push([3, , 6, 7]);
|
|
162
|
+
element = _f;
|
|
163
|
+
return [4 /*yield*/, __await(Utils.deserializeJsonEntity(element))];
|
|
164
|
+
case 4: return [4 /*yield*/, _g.sent()];
|
|
165
|
+
case 5:
|
|
166
|
+
_g.sent();
|
|
167
|
+
return [3 /*break*/, 7];
|
|
168
|
+
case 6:
|
|
169
|
+
_a = true;
|
|
170
|
+
return [7 /*endfinally*/];
|
|
171
|
+
case 7: return [3 /*break*/, 1];
|
|
172
|
+
case 8: return [3 /*break*/, 15];
|
|
173
|
+
case 9:
|
|
174
|
+
e_1_1 = _g.sent();
|
|
175
|
+
e_1 = { error: e_1_1 };
|
|
176
|
+
return [3 /*break*/, 15];
|
|
177
|
+
case 10:
|
|
178
|
+
_g.trys.push([10, , 13, 14]);
|
|
179
|
+
if (!(!_a && !_d && (_e = _b.return))) return [3 /*break*/, 12];
|
|
180
|
+
return [4 /*yield*/, __await(_e.call(_b))];
|
|
181
|
+
case 11:
|
|
182
|
+
_g.sent();
|
|
183
|
+
_g.label = 12;
|
|
184
|
+
case 12: return [3 /*break*/, 14];
|
|
185
|
+
case 13:
|
|
186
|
+
if (e_1) throw e_1.error;
|
|
187
|
+
return [7 /*endfinally*/];
|
|
188
|
+
case 14: return [7 /*endfinally*/];
|
|
189
|
+
case 15: return [2 /*return*/];
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* Async iterator to auto-paginate over elements returned by rawList()
|
|
196
|
+
*
|
|
197
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/build-event/instances
|
|
198
|
+
*
|
|
199
|
+
* @throws {ApiError}
|
|
200
|
+
* @throws {TimeoutError}
|
|
201
|
+
*/
|
|
202
|
+
BuildEvent.prototype.rawListPagedIterator = function (queryParams, iteratorOptions) {
|
|
203
|
+
var _this = this;
|
|
204
|
+
Utils.warnOnPageQueryParam(queryParams);
|
|
205
|
+
return Utils.rawPageIterator({
|
|
206
|
+
defaultLimit: 30,
|
|
207
|
+
maxLimit: 500,
|
|
208
|
+
}, function (page) {
|
|
209
|
+
return _this.rawList(__assign(__assign({}, queryParams), { page: page }));
|
|
210
|
+
}, iteratorOptions);
|
|
211
|
+
};
|
|
78
212
|
/**
|
|
79
213
|
* Retrieve a deploy event
|
|
80
214
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuildEvent.js","sourceRoot":"","sources":["../../../../src/generated/resources/BuildEvent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BuildEvent.js","sourceRoot":"","sources":["../../../../src/generated/resources/BuildEvent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gEAAoD;AACpD,oEAA8C;AAI9C;IAAwC,8BAAY;IAApD;;IA4HA,CAAC;IAzHC;;;;;;;OAOG;IACH,yBAAI,GAAJ,UAAK,WAA6D;QAChE,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,UAAC,IAAI;YACzC,OAAA,KAAK,CAAC,uBAAuB,CAC3B,IAAI,CACL;QAFD,CAEC,CACF,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,4BAAO,GAAP,UACE,WAAuD;QAEvD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAA8C;YACtE,MAAM,EAAE,KAAK;YACb,GAAG,EAAE,eAAe;YACpB,WAAW,aAAA;SACZ,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACI,sCAAiB,GAAxB,UACE,WAGC,EACD,eAAuC;;;;;;;;mCAEX,KAAA,cAAA,IAAI,CAAC,oBAAoB,CACnD,WAAW,EACX,eAAe,CAChB,CAAA;;;;;wBAH2B,cAG3B;wBAH2B,WAG3B;;;;wBAHgB,OAAO,KAAA,CAAA;qDAIhB,KAAK,CAAC,qBAAqB,CAE/B,OAAO,CAAC;4BAFV,gCAEU;;wBAFV,SAEU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEd;IAED;;;;;;;OAOG;IACH,yCAAoB,GAApB,UACE,WAGC,EACD,eAAuC;QALzC,iBAoBC;QAbC,KAAK,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC;QAExC,OAAO,KAAK,CAAC,eAAe,CAG1B;YACE,YAAY,EAAE,EAAE;YAChB,QAAQ,EAAE,GAAG;SACd,EACD,UAAC,IAAuD;YACtD,OAAA,KAAI,CAAC,OAAO,uBAAM,WAAW,KAAE,IAAI,MAAA,IAAG;QAAtC,CAAsC,EACxC,eAAe,CAChB,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,yBAAI,GAAJ,UAAK,YAAuD;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,UAAC,IAAI;YACtD,OAAA,KAAK,CAAC,uBAAuB,CAC3B,IAAI,CACL;QAFD,CAEC,CACF,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,4BAAO,GAAP,UACE,YAAoB;QAEpB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAyC;YACjE,MAAM,EAAE,KAAK;YACb,GAAG,EAAE,wBAAiB,YAAY,CAAE;SACrC,CAAC,CAAC;IACL,CAAC;IA1He,eAAI,GAAG,aAAsB,CAAC;IA2HhD,iBAAC;CAAA,AA5HD,CAAwC,sBAAY,GA4HnD;kBA5HoB,UAAU"}
|
|
@@ -78,6 +78,8 @@ var ItemType = /** @class */ (function (_super) {
|
|
|
78
78
|
],
|
|
79
79
|
relationships: [
|
|
80
80
|
'ordering_field',
|
|
81
|
+
'presentation_title_field',
|
|
82
|
+
'presentation_image_field',
|
|
81
83
|
'title_field',
|
|
82
84
|
'image_preview_field',
|
|
83
85
|
'excerpt_field',
|
|
@@ -135,6 +137,8 @@ var ItemType = /** @class */ (function (_super) {
|
|
|
135
137
|
],
|
|
136
138
|
relationships: [
|
|
137
139
|
'ordering_field',
|
|
140
|
+
'presentation_title_field',
|
|
141
|
+
'presentation_image_field',
|
|
138
142
|
'title_field',
|
|
139
143
|
'image_preview_field',
|
|
140
144
|
'excerpt_field',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemType.js","sourceRoot":"","sources":["../../../../src/generated/resources/ItemType.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gEAAoD;AACpD,oEAA8C;AAI9C;IAAsC,4BAAY;IAAlD;;
|
|
1
|
+
{"version":3,"file":"ItemType.js","sourceRoot":"","sources":["../../../../src/generated/resources/ItemType.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gEAAoD;AACpD,oEAA8C;AAI9C;IAAsC,4BAAY;IAAlD;;IA2SA,CAAC;IAxSC;;;;;;;OAOG;IACH,yBAAM,GAAN,UACE,IAA4C,EAC5C,WAAwD;QAExD,OAAO,IAAI,CAAC,SAAS,CACnB,KAAK,CAAC,oBAAoB,CAAmC,IAAI,EAAE;YACjE,IAAI,EAAE,WAAW;YACjB,UAAU,EAAE;gBACV,MAAM;gBACN,SAAS;gBACT,WAAW;gBACX,sBAAsB;gBACtB,UAAU;gBACV,eAAe;gBACf,mBAAmB;gBACnB,qBAAqB;gBACrB,MAAM;gBACN,oBAAoB;gBACpB,eAAe;gBACf,wBAAwB;gBACxB,uBAAuB;gBACvB,MAAM;gBACN,+BAA+B;aAChC;YACD,aAAa,EAAE;gBACb,gBAAgB;gBAChB,0BAA0B;gBAC1B,0BAA0B;gBAC1B,aAAa;gBACb,qBAAqB;gBACrB,eAAe;gBACf,UAAU;aACX;SACF,CAAC,EACF,WAAW,CACZ,CAAC,IAAI,CAAC,UAAC,IAAI;YACV,OAAA,KAAK,CAAC,uBAAuB,CAC3B,IAAI,CACL;QAFD,CAEC,CACF,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,4BAAS,GAAT,UACE,IAAsC,EACtC,WAAkD;QAElD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAyC;YACjE,MAAM,EAAE,MAAM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YACpE,OAAA,KAAK,CAAC,uBAAuB,CAC3B,IAAI,CACL;QAFD,CAEC,CACF,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,6BAAU,GAAV,UACE,UAAkB,EAClB,WAAmD;QAEnD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAuC;YAC/D,MAAM,EAAE,QAAQ;YAChB,GAAG,EAAE,sBAAe,UAAU,CAAE;YAChC,WAAW,aAAA;SACZ,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,+CAA4B,GAA5B,UACE,UAAkB,EAClB,IAAyD;QAEzD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB;YACE,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,sBAAe,UAAU,kCAA+B;YAC7D,IAAI,MAAA;SACL,CACF,CAAC;IACJ,CAAC;IAzSe,aAAI,GAAG,WAAoB,CAAC;IA0S9C,eAAC;CAAA,AA3SD,CAAsC,sBAAY,GA2SjD;kBA3SoB,QAAQ"}
|
|
@@ -105,7 +105,7 @@ var Client = /** @class */ (function () {
|
|
|
105
105
|
});
|
|
106
106
|
Client.prototype.request = function (options) {
|
|
107
107
|
var _this = this;
|
|
108
|
-
return request(__assign(__assign(__assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client
|
|
108
|
+
return request(__assign(__assign(__assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v4.0.0', baseUrl: this.baseUrl, preCallStack: new Error().stack, extraHeaders: __assign(__assign(__assign({}, (this.config.extraHeaders || {})), (this.config.environment
|
|
109
109
|
? { 'X-Environment': this.config.environment }
|
|
110
110
|
: {})), { 'X-API-Version': '3' }), fetchJobResult: function (jobId) {
|
|
111
111
|
return _this.jobResultsFetcher
|
|
@@ -538,6 +538,54 @@ export type BuildEventIdentity = string;
|
|
|
538
538
|
* via the `definition` "type".
|
|
539
539
|
*/
|
|
540
540
|
export type BuildTriggerType = 'build_trigger';
|
|
541
|
+
/**
|
|
542
|
+
* This interface was referenced by `BuildEvent`'s JSON-Schema
|
|
543
|
+
* via the `instances.hrefSchema` link.
|
|
544
|
+
*/
|
|
545
|
+
export type BuildEventInstancesHrefSchema = {
|
|
546
|
+
/**
|
|
547
|
+
* Parameters to control offset-based pagination
|
|
548
|
+
*/
|
|
549
|
+
page?: {
|
|
550
|
+
/**
|
|
551
|
+
* The (zero-based) offset of the first entity returned in the collection (defaults to 0)
|
|
552
|
+
*/
|
|
553
|
+
offset?: number;
|
|
554
|
+
/**
|
|
555
|
+
* The maximum number of entities to return (defaults to 30, maximum is 500)
|
|
556
|
+
*/
|
|
557
|
+
limit?: number;
|
|
558
|
+
};
|
|
559
|
+
/**
|
|
560
|
+
* Attributes to filter
|
|
561
|
+
*/
|
|
562
|
+
filter?: {
|
|
563
|
+
/**
|
|
564
|
+
* IDs to fetch, comma separated
|
|
565
|
+
*/
|
|
566
|
+
ids?: string;
|
|
567
|
+
fields?: {
|
|
568
|
+
build_trigger_id?: {
|
|
569
|
+
eq?: string;
|
|
570
|
+
};
|
|
571
|
+
event_type?: {
|
|
572
|
+
/**
|
|
573
|
+
* The type of activity
|
|
574
|
+
*/
|
|
575
|
+
eq?: 'request_success' | 'request_failure' | 'response_success' | 'response_failure' | 'request_aborted' | 'response_unprocessable' | 'indexing_started' | 'indexing_success' | 'indexing_failure';
|
|
576
|
+
};
|
|
577
|
+
created_at?: {
|
|
578
|
+
gt?: string;
|
|
579
|
+
lt?: string;
|
|
580
|
+
};
|
|
581
|
+
};
|
|
582
|
+
};
|
|
583
|
+
/**
|
|
584
|
+
* Fields used to order results
|
|
585
|
+
*/
|
|
586
|
+
order_by?: 'build_trigger_id_asc' | 'build_trigger_id_desc' | 'created_at_asc' | 'created_at_desc' | 'event_type_asc' | 'event_type_desc';
|
|
587
|
+
[k: string]: unknown;
|
|
588
|
+
};
|
|
541
589
|
/**
|
|
542
590
|
* This interface was referenced by `Item`'s JSON-Schema
|
|
543
591
|
* via the `instances.hrefSchema` link.
|
|
@@ -4142,13 +4190,25 @@ export type ItemTypeRelationships = {
|
|
|
4142
4190
|
data: FieldsetData[];
|
|
4143
4191
|
};
|
|
4144
4192
|
/**
|
|
4145
|
-
* The field to use as
|
|
4193
|
+
* The field to use as presentation title
|
|
4194
|
+
*/
|
|
4195
|
+
presentation_title_field: {
|
|
4196
|
+
data: FieldData | null;
|
|
4197
|
+
};
|
|
4198
|
+
/**
|
|
4199
|
+
* The field to use as presentation image
|
|
4200
|
+
*/
|
|
4201
|
+
presentation_image_field: {
|
|
4202
|
+
data: FieldData | null;
|
|
4203
|
+
};
|
|
4204
|
+
/**
|
|
4205
|
+
* The field to use as fallback title for SEO purposes
|
|
4146
4206
|
*/
|
|
4147
4207
|
title_field: {
|
|
4148
4208
|
data: FieldData | null;
|
|
4149
4209
|
};
|
|
4150
4210
|
/**
|
|
4151
|
-
* The field to use as
|
|
4211
|
+
* The field to use as fallback image for SEO purposes
|
|
4152
4212
|
*/
|
|
4153
4213
|
image_preview_field: {
|
|
4154
4214
|
data: FieldData | null;
|
|
@@ -4305,13 +4365,25 @@ export type ItemTypeCreateSchema = {
|
|
|
4305
4365
|
data: FieldData | null;
|
|
4306
4366
|
};
|
|
4307
4367
|
/**
|
|
4308
|
-
* The field to use as
|
|
4368
|
+
* The field to use as presentation title
|
|
4369
|
+
*/
|
|
4370
|
+
presentation_title_field?: {
|
|
4371
|
+
data: FieldData | null;
|
|
4372
|
+
};
|
|
4373
|
+
/**
|
|
4374
|
+
* The field to use as presentation image
|
|
4375
|
+
*/
|
|
4376
|
+
presentation_image_field?: {
|
|
4377
|
+
data: FieldData | null;
|
|
4378
|
+
};
|
|
4379
|
+
/**
|
|
4380
|
+
* The field to use as fallback title for SEO purposes
|
|
4309
4381
|
*/
|
|
4310
4382
|
title_field?: {
|
|
4311
4383
|
data: FieldData | null;
|
|
4312
4384
|
};
|
|
4313
4385
|
/**
|
|
4314
|
-
* The field to use as
|
|
4386
|
+
* The field to use as fallback image for SEO purposes
|
|
4315
4387
|
*/
|
|
4316
4388
|
image_preview_field?: {
|
|
4317
4389
|
data: FieldData | null;
|
|
@@ -4424,13 +4496,25 @@ export type ItemTypeUpdateSchema = {
|
|
|
4424
4496
|
data: FieldData | null;
|
|
4425
4497
|
};
|
|
4426
4498
|
/**
|
|
4427
|
-
* The field to use as
|
|
4499
|
+
* The field to use as presentation title
|
|
4500
|
+
*/
|
|
4501
|
+
presentation_title_field?: {
|
|
4502
|
+
data: FieldData | null;
|
|
4503
|
+
};
|
|
4504
|
+
/**
|
|
4505
|
+
* The field to use as presentation image
|
|
4506
|
+
*/
|
|
4507
|
+
presentation_image_field?: {
|
|
4508
|
+
data: FieldData | null;
|
|
4509
|
+
};
|
|
4510
|
+
/**
|
|
4511
|
+
* The field to use as fallback title for SEO purposes
|
|
4428
4512
|
*/
|
|
4429
4513
|
title_field?: {
|
|
4430
4514
|
data: FieldData | null;
|
|
4431
4515
|
};
|
|
4432
4516
|
/**
|
|
4433
|
-
* The field to use as
|
|
4517
|
+
* The field to use as fallback image for SEO purposes
|
|
4434
4518
|
*/
|
|
4435
4519
|
image_preview_field?: {
|
|
4436
4520
|
data: FieldData | null;
|
|
@@ -6599,6 +6683,9 @@ export type BuildEventData = {
|
|
|
6599
6683
|
*/
|
|
6600
6684
|
export type BuildEventInstancesTargetSchema = {
|
|
6601
6685
|
data: BuildEvent[];
|
|
6686
|
+
meta: {
|
|
6687
|
+
total_count: number;
|
|
6688
|
+
};
|
|
6602
6689
|
};
|
|
6603
6690
|
/**
|
|
6604
6691
|
* This interface was referenced by `BuildEvent`'s JSON-Schema
|
|
@@ -717,6 +717,54 @@ export type BuildTriggerType = 'build_trigger';
|
|
|
717
717
|
* via the `instances.targetSchema` link.
|
|
718
718
|
*/
|
|
719
719
|
export type BuildEventInstancesTargetSchema = BuildEvent[];
|
|
720
|
+
/**
|
|
721
|
+
* This interface was referenced by `BuildEvent`'s JSON-Schema
|
|
722
|
+
* via the `instances.hrefSchema` link.
|
|
723
|
+
*/
|
|
724
|
+
export type BuildEventInstancesHrefSchema = {
|
|
725
|
+
/**
|
|
726
|
+
* Parameters to control offset-based pagination
|
|
727
|
+
*/
|
|
728
|
+
page?: {
|
|
729
|
+
/**
|
|
730
|
+
* The (zero-based) offset of the first entity returned in the collection (defaults to 0)
|
|
731
|
+
*/
|
|
732
|
+
offset?: number;
|
|
733
|
+
/**
|
|
734
|
+
* The maximum number of entities to return (defaults to 30, maximum is 500)
|
|
735
|
+
*/
|
|
736
|
+
limit?: number;
|
|
737
|
+
};
|
|
738
|
+
/**
|
|
739
|
+
* Attributes to filter
|
|
740
|
+
*/
|
|
741
|
+
filter?: {
|
|
742
|
+
/**
|
|
743
|
+
* IDs to fetch, comma separated
|
|
744
|
+
*/
|
|
745
|
+
ids?: string;
|
|
746
|
+
fields?: {
|
|
747
|
+
build_trigger_id?: {
|
|
748
|
+
eq?: string;
|
|
749
|
+
};
|
|
750
|
+
event_type?: {
|
|
751
|
+
/**
|
|
752
|
+
* The type of activity
|
|
753
|
+
*/
|
|
754
|
+
eq?: 'request_success' | 'request_failure' | 'response_success' | 'response_failure' | 'request_aborted' | 'response_unprocessable' | 'indexing_started' | 'indexing_success' | 'indexing_failure';
|
|
755
|
+
};
|
|
756
|
+
created_at?: {
|
|
757
|
+
gt?: string;
|
|
758
|
+
lt?: string;
|
|
759
|
+
};
|
|
760
|
+
};
|
|
761
|
+
};
|
|
762
|
+
/**
|
|
763
|
+
* Fields used to order results
|
|
764
|
+
*/
|
|
765
|
+
order_by?: 'build_trigger_id_asc' | 'build_trigger_id_desc' | 'created_at_asc' | 'created_at_desc' | 'event_type_asc' | 'event_type_desc';
|
|
766
|
+
[k: string]: unknown;
|
|
767
|
+
};
|
|
720
768
|
/**
|
|
721
769
|
* This interface was referenced by `Item`'s JSON-Schema
|
|
722
770
|
* via the `instances.targetSchema` link.
|
|
@@ -4586,6 +4634,8 @@ export type ItemType = {
|
|
|
4586
4634
|
singleton_item: ItemData | null;
|
|
4587
4635
|
fields: FieldData[];
|
|
4588
4636
|
fieldsets: FieldsetData[];
|
|
4637
|
+
presentation_title_field: FieldData | null;
|
|
4638
|
+
presentation_image_field: FieldData | null;
|
|
4589
4639
|
title_field: FieldData | null;
|
|
4590
4640
|
image_preview_field: FieldData | null;
|
|
4591
4641
|
excerpt_field: FieldData | null;
|
|
@@ -4732,6 +4782,8 @@ export type ItemTypeRelationships = {
|
|
|
4732
4782
|
singleton_item: ItemData | null;
|
|
4733
4783
|
fields: FieldData[];
|
|
4734
4784
|
fieldsets: FieldsetData[];
|
|
4785
|
+
presentation_title_field: FieldData | null;
|
|
4786
|
+
presentation_image_field: FieldData | null;
|
|
4735
4787
|
title_field: FieldData | null;
|
|
4736
4788
|
image_preview_field: FieldData | null;
|
|
4737
4789
|
excerpt_field: FieldData | null;
|
|
@@ -4806,6 +4858,8 @@ export type ItemTypeCreateSchema = {
|
|
|
4806
4858
|
*/
|
|
4807
4859
|
inverse_relationships_enabled?: boolean;
|
|
4808
4860
|
ordering_field?: FieldData | null;
|
|
4861
|
+
presentation_title_field?: FieldData | null;
|
|
4862
|
+
presentation_image_field?: FieldData | null;
|
|
4809
4863
|
title_field?: FieldData | null;
|
|
4810
4864
|
image_preview_field?: FieldData | null;
|
|
4811
4865
|
excerpt_field?: FieldData | null;
|
|
@@ -4883,6 +4937,8 @@ export type ItemTypeUpdateSchema = {
|
|
|
4883
4937
|
*/
|
|
4884
4938
|
inverse_relationships_enabled?: boolean;
|
|
4885
4939
|
ordering_field?: FieldData | null;
|
|
4940
|
+
presentation_title_field?: FieldData | null;
|
|
4941
|
+
presentation_image_field?: FieldData | null;
|
|
4886
4942
|
title_field?: FieldData | null;
|
|
4887
4943
|
image_preview_field?: FieldData | null;
|
|
4888
4944
|
excerpt_field?: FieldData | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as Utils from '@datocms/rest-client-utils';
|
|
1
2
|
import BaseResource from '../../BaseResource';
|
|
2
3
|
import type * as SchemaTypes from '../SchemaTypes';
|
|
3
4
|
import type * as SimpleSchemaTypes from '../SimpleSchemaTypes';
|
|
@@ -11,7 +12,7 @@ export default class BuildEvent extends BaseResource {
|
|
|
11
12
|
* @throws {ApiError}
|
|
12
13
|
* @throws {TimeoutError}
|
|
13
14
|
*/
|
|
14
|
-
list(): Promise<SimpleSchemaTypes.BuildEventInstancesTargetSchema>;
|
|
15
|
+
list(queryParams?: SimpleSchemaTypes.BuildEventInstancesHrefSchema): Promise<SimpleSchemaTypes.BuildEventInstancesTargetSchema>;
|
|
15
16
|
/**
|
|
16
17
|
* List all deploy events
|
|
17
18
|
*
|
|
@@ -20,7 +21,25 @@ export default class BuildEvent extends BaseResource {
|
|
|
20
21
|
* @throws {ApiError}
|
|
21
22
|
* @throws {TimeoutError}
|
|
22
23
|
*/
|
|
23
|
-
rawList(): Promise<SchemaTypes.BuildEventInstancesTargetSchema>;
|
|
24
|
+
rawList(queryParams?: SchemaTypes.BuildEventInstancesHrefSchema): Promise<SchemaTypes.BuildEventInstancesTargetSchema>;
|
|
25
|
+
/**
|
|
26
|
+
* Async iterator to auto-paginate over elements returned by list()
|
|
27
|
+
*
|
|
28
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/build-event/instances
|
|
29
|
+
*
|
|
30
|
+
* @throws {ApiError}
|
|
31
|
+
* @throws {TimeoutError}
|
|
32
|
+
*/
|
|
33
|
+
listPagedIterator(queryParams?: Utils.OmitFromKnownKeys<SimpleSchemaTypes.BuildEventInstancesHrefSchema, 'page'>, iteratorOptions?: Utils.IteratorOptions): AsyncGenerator<SimpleSchemaTypes.BuildEvent, void, unknown>;
|
|
34
|
+
/**
|
|
35
|
+
* Async iterator to auto-paginate over elements returned by rawList()
|
|
36
|
+
*
|
|
37
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/build-event/instances
|
|
38
|
+
*
|
|
39
|
+
* @throws {ApiError}
|
|
40
|
+
* @throws {TimeoutError}
|
|
41
|
+
*/
|
|
42
|
+
rawListPagedIterator(queryParams?: Utils.OmitFromKnownKeys<SchemaTypes.BuildEventInstancesHrefSchema, 'page'>, iteratorOptions?: Utils.IteratorOptions): AsyncGenerator<SchemaTypes.BuildEvent, void, unknown>;
|
|
24
43
|
/**
|
|
25
44
|
* Retrieve a deploy event
|
|
26
45
|
*
|