contentful-management 11.13.3 → 11.14.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/contentful-management.browser.js +44 -1
- package/dist/contentful-management.browser.js.map +1 -1
- package/dist/contentful-management.browser.min.js +1 -1
- package/dist/contentful-management.node.js +41 -1
- package/dist/contentful-management.node.js.map +1 -1
- package/dist/contentful-management.node.min.js +1 -1
- package/dist/es-modules/adapters/REST/endpoints/asset.js +6 -0
- package/dist/es-modules/contentful-management.js +1 -1
- package/dist/es-modules/create-environment-api.js +32 -0
- package/dist/es-modules/plain/plain-client.js +1 -0
- package/dist/typings/adapters/REST/endpoints/asset.d.ts +1 -0
- package/dist/typings/common-types.d.ts +6 -0
- package/dist/typings/create-environment-api.d.ts +19 -0
- package/dist/typings/plain/common-types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -918,6 +918,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
918
918
|
/* harmony export */ del: () => (/* binding */ del),
|
|
919
919
|
/* harmony export */ get: () => (/* binding */ get),
|
|
920
920
|
/* harmony export */ getMany: () => (/* binding */ getMany),
|
|
921
|
+
/* harmony export */ getPublished: () => (/* binding */ getPublished),
|
|
921
922
|
/* harmony export */ processForAllLocales: () => (/* binding */ processForAllLocales),
|
|
922
923
|
/* harmony export */ processForLocale: () => (/* binding */ processForLocale),
|
|
923
924
|
/* harmony export */ publish: () => (/* binding */ publish),
|
|
@@ -956,6 +957,12 @@ var get = function get(http, params, rawData, headers) {
|
|
|
956
957
|
headers: headers ? _objectSpread({}, headers) : undefined
|
|
957
958
|
});
|
|
958
959
|
};
|
|
960
|
+
var getPublished = function getPublished(http, params, rawData, headers) {
|
|
961
|
+
return _raw__WEBPACK_IMPORTED_MODULE_3__.get(http, "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId, "/public/assets"), {
|
|
962
|
+
params: (0,_utils__WEBPACK_IMPORTED_MODULE_5__.normalizeSelect)(params.query),
|
|
963
|
+
headers: headers ? _objectSpread({}, headers) : undefined
|
|
964
|
+
});
|
|
965
|
+
};
|
|
959
966
|
var getMany = function getMany(http, params, rawData, headers) {
|
|
960
967
|
return _raw__WEBPACK_IMPORTED_MODULE_3__.get(http, "/spaces/".concat(params.spaceId, "/environments/").concat(params.environmentId, "/assets"), {
|
|
961
968
|
params: (0,_utils__WEBPACK_IMPORTED_MODULE_5__.normalizeSelect)(params.query),
|
|
@@ -7143,6 +7150,41 @@ function createEnvironmentApi(makeRequest) {
|
|
|
7143
7150
|
return wrapAssetCollection(makeRequest, data);
|
|
7144
7151
|
});
|
|
7145
7152
|
},
|
|
7153
|
+
/**
|
|
7154
|
+
* Gets a collection of published Assets
|
|
7155
|
+
* @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
|
|
7156
|
+
* @return Promise for a collection of published Assets
|
|
7157
|
+
* @example ```javascript
|
|
7158
|
+
* const contentful = require('contentful-management')
|
|
7159
|
+
*
|
|
7160
|
+
* const client = contentful.createClient({
|
|
7161
|
+
* accessToken: '<content_management_api_key>'
|
|
7162
|
+
* })
|
|
7163
|
+
*
|
|
7164
|
+
* client.getSpace('<space_id>')
|
|
7165
|
+
* .then((space) => space.getEnvironment('<environment-id>'))
|
|
7166
|
+
* .then((environment) => environment.getPublishedAssets())
|
|
7167
|
+
* .then((response) => console.log(response.items))
|
|
7168
|
+
* .catch(console.error)
|
|
7169
|
+
* ```
|
|
7170
|
+
*/
|
|
7171
|
+
getPublishedAssets: function getPublishedAssets() {
|
|
7172
|
+
var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7173
|
+
var raw = this.toPlainObject();
|
|
7174
|
+
return makeRequest({
|
|
7175
|
+
entityType: 'Asset',
|
|
7176
|
+
action: 'getPublished',
|
|
7177
|
+
params: {
|
|
7178
|
+
spaceId: raw.sys.space.sys.id,
|
|
7179
|
+
environmentId: raw.sys.id,
|
|
7180
|
+
query: (0,contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__.createRequestConfig)({
|
|
7181
|
+
query: query
|
|
7182
|
+
}).params
|
|
7183
|
+
}
|
|
7184
|
+
}).then(function (data) {
|
|
7185
|
+
return wrapAssetCollection(makeRequest, data);
|
|
7186
|
+
});
|
|
7187
|
+
},
|
|
7146
7188
|
/**
|
|
7147
7189
|
* Creates a Asset. After creation, call asset.processForLocale or asset.processForAllLocales to start asset processing.
|
|
7148
7190
|
* @param data - Object representation of the Asset to be created. Note that the field object should have an upload property on asset creation, which will be removed and replaced with an url property when processing is finished.
|
|
@@ -16555,6 +16597,7 @@ var createPlainClient = function createPlainClient(makeRequest, defaults) {
|
|
|
16555
16597
|
references: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Entry', 'references')
|
|
16556
16598
|
},
|
|
16557
16599
|
asset: {
|
|
16600
|
+
getPublished: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Asset', 'getPublished'),
|
|
16558
16601
|
getMany: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Asset', 'getMany'),
|
|
16559
16602
|
get: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Asset', 'get'),
|
|
16560
16603
|
update: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Asset', 'update'),
|
|
@@ -25401,7 +25444,7 @@ function createClient(params) {
|
|
|
25401
25444
|
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
25402
25445
|
var sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
|
|
25403
25446
|
var userAgent = (0,contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__.getUserAgentHeader)( // @ts-expect-error
|
|
25404
|
-
"".concat(sdkMain, "/").concat("11.
|
|
25447
|
+
"".concat(sdkMain, "/").concat("11.14.0"), params.application, params.integration, params.feature);
|
|
25405
25448
|
var adapter = (0,_create_adapter__WEBPACK_IMPORTED_MODULE_1__.createAdapter)(params);
|
|
25406
25449
|
|
|
25407
25450
|
// Parameters<?> and ReturnType<?> only return the types of the last overload
|